diff --git a/归档/docs/guides/功能列表/功能列表-H5 商城.md b/归档/docs/guides/功能列表/功能列表-H5 商城.md deleted file mode 100644 index 160c5d984..000000000 --- a/归档/docs/guides/功能列表/功能列表-H5 商城.md +++ /dev/null @@ -1,34 +0,0 @@ -如下是 onemall 的功能列表。 - -* 当功能被完成时,会标记已完成。 -* 未完成的功能,欢迎一起来开发,特别是【待认领】的任务。 - -- [x] 首页 - - [x] 首页广告 - - [x] 商品推荐(手动) -- 商品相关 - - [x] 分类列表 - - [x] 商品搜索 - - [x] 商品列表(基于分类) - - [ ] 商品列表(基于促销活动) - - [x] 商品详情 - - [ ] 商品收藏 @笑笑生 -- 订单相关 - - [x] 下单(直接购买) - - [x] 下单(购物车购买) - - [ ] 下单(拼团) @大太阳 - - [x] 订单列表 - - [x] 订单详情 - - [x] 支付 - - [ ] 退款 - - [x] 购物车 - - [x] 收获地址 -- 营销相关 - - [x] 优惠劵 - - [ ] 优惠码【待认领】 -- 用户相关 - - [x] 登陆 - - [x] 注册 - - [x] 个人信息 - - [ ] 手机改绑 - - [ ] 微信登陆 @To0R𓃰 diff --git a/归档/docs/guides/功能列表/功能列表-管理后台.md b/归档/docs/guides/功能列表/功能列表-管理后台.md deleted file mode 100644 index 381c02667..000000000 --- a/归档/docs/guides/功能列表/功能列表-管理后台.md +++ /dev/null @@ -1,60 +0,0 @@ -如下是 onemall 的功能列表。 - -* 当功能被完成时,会标记已完成。 -* 未完成的功能,欢迎一起来开发,特别是【待认领】的任务。 - -- [ ] 概述 TODO【待认领】 -- [ ] 数据分析【待认领】 - - [ ] 商品分析 【@zhenxianyimeng】 -- [ ] 店铺资产【待认领】 - - [ ] 支付单 20% 【待认领】 - - [ ] 退款单 20% 【待认领】 - - TODO 需要补充 -- [ ] 店铺装修【迫切需要靠谱前端一起做】 - - [ ] H5 装修 - - [ ] 小程序装修 - - [ ] 自定义页面 -- [ ] 商品管理 - - [x] 发布商品 - - [x] 商品列表 - - [x] 展示类目 - - [ ] 品牌管理【开发中 @黑子】 - - [ ] 商品标签 - - [X] 商品规格页面 -- [ ] 订单管理 - - [x] 销售单 - - [x] 售后单 - - [ ] 订单评价【开发中 @wang171776704】 -- [ ] 会员管理 - - [ ] 会员资料 【开发中 @nengjie】 - - [ ] 会员等级 - - [ ] 会员积分 - - [ ] 用户标签 - - TODO 需要补充 -- [ ] 营销管理 - - [x] 首页广告 - - [x] 商品推荐 - - [x] 优惠劵 - - [ ] 优惠码【开发中 @native8623 2019-05-17】 - - [ ] 满减送 20% 【待认领】 - - [ ] 限制折扣 20% 【待认领】 - - [ ] 多人拼团【认领 @mijiu 2019-06-05】 - - [ ] 积分商城 - - [ ] 问卷调查 - - [ ] 幸运大转盘 -- [ ] 分销管理 - - [ ] 分销设置 - - [ ] 分销员管理 - - [ ] 提现管理 -- [ ] 系统管理 - - [x] 员工管理 - - [x] 角色管理 - - [x] 权限管理 - - [x] 部门管理 - - [x] 数据字典 - - [x] 短信管理 - - [X] 短信模板 - - [ ] 短信发送日志【研发中 小范】 - - [ ] 员工操作日志 - - [ ] 访问日志【待认领】 - - [ ] 异常日志【待认领】 diff --git a/归档/docs/setup/quick-start.md b/归档/docs/setup/quick-start.md deleted file mode 100644 index f7657464f..000000000 --- a/归档/docs/setup/quick-start.md +++ /dev/null @@ -1,190 +0,0 @@ -> 艿艿:本文暂时会写的比较简洁,如果有不懂的地方,请来[「交流群」](http://www.iocoder.cn/mall-user-group/?vip&gitee),艿艿来帮你解决。 -> -> 交流群,我们提供了我们自己在使用的开发环境,搭建调试环境会更简便。 - -# 1. 概述 - -> 艿艿:本文暂时会写的比较简洁,如果有不懂的地方,请来[「交流群」](http://www.iocoder.cn/mall-user-group/?vip&gitee),艿艿来帮你解决。 - -本文,我们希望能带着胖友,快速搭建一个开发/调试环境。总的来说,我们需要安装如下东西: - -* 后端 - * JDK 8+ - * Maven - * IntelliJ IDEA - -* 前端 - * NPM - -# 2. 源码拉取 - -使用 IntelliJ IDEA 从 。拉取完成后,Maven 会下载依赖包,可能会花费一些时间,耐心等待下。 - -> 艿艿:也不要瞎等,咱继续顺着本文往下走。 - -# 3. MySQL - -① 安装 MySQL 数据库 - -* Windows :参考 [《Windows 安装 MySQL》](https://juejin.im/post/5bdab0645188251e753c66f8) -* Mac :参考 [《Mac 下安装与配置 MySQL》](https://www.jianshu.com/p/a8e4068a7a8a) - -② 导入 SQL - -将 [docs/sql](https://gitee.com/zhijiantianya/onemall/tree/master/docs/sql) 下的 SQL ,逐个导入到数据库中。 - -③ 修改项目中的 MySQL 配置 - -在 IDEA 中,搜索每个 `xxx-service-impl` 项目下的 `application.yaml` 文件,将数据库配置修改成连接你的。如下: - -```YAML -spring: - # datasource - datasource: - url: jdbc:mysql://s1.iocoder.cn:3306/mall_product?useSSL=false&useUnicode=true&characterEncoding=UTF-8 # 请修改成你本地的 MySQL url - driver-class-name: com.mysql.jdbc.Driver - username: root # 请修改成你本地的 MySQL username - password: zhuyang # 请修改成你本地的 MySQL password -``` - -# 4. Zookeeper - -① 安装 Zookeeper - -* Windows :参考 [《Windows 下 ZooKeeper 的配置和启动步骤 —— 单机模式》](https://www.jianshu.com/p/66857cbccbd3) -* Mac :参考 [《Zookeeper 安装及配置(Mac)》](https://www.jianshu.com/p/0ba61bf7149f) - -② 修改项目中的 Zookeeper 配置 - -在 IDEA 中,搜索每个 `xxx-service-impl` 项目下的 `application.yaml` 文件,将 Zookeeper 配置修改成连接你的。如下: - -```YAML -# dubbo -dubbo: - application: - name: product-service - registry: - address: zookeeper://127.0.0.1:2181 # 请修改成你本地的 Zookeeper url - protocol: - port: -1 - name: dubbo - scan: - base-packages: cn.iocoder.mall.product.service -``` - -# 5. RocketMQ - -① 安装 RocketMQ - -* Windows :参考 [《RocketMQ 入门 —— 安装以及快速入门》](http://www.iocoder.cn/RocketMQ/start/install/?vip&gitee) -* Mac :参考 [《RocketMQ 入门 —— 安装以及快速入门》](http://www.iocoder.cn/RocketMQ/start/install/?vip&gitee) - -② 修改项目中的 RocketMQ 配置 - -在 IDEA 中,搜索每个 `xxx-service-impl` 项目下的 `application.yaml` 文件,将 RocketMQ 配置修改成连接你的。如下: - -```YAML -rocketmq: - name-server: 127.0.0.1:9876 # 请修改成你本地的 RocketMQ url - producer: - group: product-producer-group -``` - -# 6. XXL-Job - -> 艿艿:这个中间件的安装,是可选项。如果不安装,只是定时任务无法执行。 - -TODO 未完成。建议先跳过。 - -① 安装 XXL-Job - -参考 [《分布式任务调度平台 XXL-JOB》](http://www.xuxueli.com/xxl-job/#/) 官方文档。 - -② 修改项目中的 XXL-Job 配置 - -在 IDEA 中,搜索每个 `xxx-service-impl` 项目下的 `application-dev.yaml` 文件,将 XXL-Job 配置修改成连接你的。如下: - -```YAML -# xxl-job -xxl: - job: - admin: - addresses: http://127.0.0.1:18079/ # 请修改成你本地的 XXL-Job url - executor: - appname: pay-job-executor - ip: - port: 0 - logpath: /Users/yunai/logs/xxl-job/ # 请修改成你希望存放日志的目录 - logretentiondays: 1 - accessToken: -``` - -③ 配置项目中的每个作业 - -TODO 芋艿,需要完善 - -# 7. Elasticsearch - -① 安装 Elasticsearch - -* Windows :参考 [《ElasticSearch 入门 第一篇:Windows 下安装ElasticSearch》](http://www.cnblogs.com/ljhdo/p/4887557.html) -* Mac :参考 [《mac 安装 ElasticSearch 笔记》](https://www.jianshu.com/p/81b0b3a60c01) - -因为需要中文分词,所以需要安装 [elasticsearch-analysis-ik](https://github.com/medcl/elasticsearch-analysis-ik) 插件。 - -② 修改项目中的 Elasticsearch 配置 - -在 IDEA 中,搜索`search-service-impl` 项目下的 `application.yaml` 文件,将 Elasticsearch 配置修改成连接你的。如下: - -```YAML -# es -spring: - data: - elasticsearch: - cluster-name: elasticsearch - cluster-nodes: 180.167.213.26:9300 # 请修改成你本地的 Elasticsearch url - repositories: - enable: true -``` - -# 8. 启动后端项目 - -在 IDEA 中,右键运行每个 `XXXApplication.java` 。例如说,`admin` 项目是 AdminApplication 。 - -是否启动成功,请查看 IDEA 输出的日志。 - -具体的启动顺序,是: - -* SystemApplication -* UserApplication -* ProductApplication -* PayApplication - > 因为支付服务,涉及三方支付平台的配置。所以,需要艿艿后续提供简便的方案。TODO - -* PromotionApplication -* OrderApplication -* SearchApplication - -# 9. 启动前端项目 - -① 启动商城 H5 项目 - -在 `mobile-web` 项目下,执行 `npm start` 。 - -启动成功后,浏览器访问 。 - -② 启动管理后台项目 - -在 `admin-web` 项目下,执行 `npm run start:no-mock` 。 - -启动成功后,浏览器访问 。 - -# 10. 数据配置 - -TODO 芋艿 - -因为项目该配置完,是没有任何数据的。所以,需要操作对应的功能,添加数据。 - -# 233. 彩蛋 - -> 艿艿:本文暂时会写的比较简洁,如果有不懂的地方,请来[「交流群」](http://www.iocoder.cn/mall-user-group/?vip&gitee),艿艿来帮你解决。 diff --git a/归档/docs/sql/old/mall_order.sql b/归档/docs/sql/old/mall_order.sql deleted file mode 100644 index 0631edf2f..000000000 --- a/归档/docs/sql/old/mall_order.sql +++ /dev/null @@ -1,139 +0,0 @@ --- ---------------------------- --- Table structure for order_cancel --- ---------------------------- -DROP TABLE IF EXISTS `order_cancel`; -CREATE TABLE `order_cancel` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `order_id` int(11) NOT NULL COMMENT '订单id', - `order_no` varchar(50) NOT NULL COMMENT '订单编号', - `reason` int(2) NOT NULL, - `other_reason` varchar(100) DEFAULT NULL COMMENT '其他原因', - `create_time` datetime NOT NULL COMMENT '创建时间', - `update_time` datetime DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; - --- ---------------------------- --- Table structure for order_exchange --- ---------------------------- -DROP TABLE IF EXISTS `order_exchange`; -CREATE TABLE `order_exchange` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `order_id` int(11) NOT NULL, - `order_no` varchar(50) NOT NULL, - `sku_id` int(11) NOT NULL, - `exchange_sku_id` int(11) NOT NULL COMMENT '换货商品id', - `exchange_order_logistics_id` int(11) NOT NULL COMMENT '换货物流id', - `receiver_order_logistics_id` int(11) NOT NULL COMMENT '收件地址', - `order_reason_id` int(11) DEFAULT NULL COMMENT '换货原因', - `reason` varchar(255) DEFAULT NULL COMMENT '换货原因 (其他的时候)', - `payment_time` datetime DEFAULT NULL COMMENT '付款时间', - `delivery_time` datetime DEFAULT NULL COMMENT '发货时间', - `receiver_time` datetime DEFAULT NULL COMMENT '收货时间', - `closing_time` datetime DEFAULT NULL COMMENT '成交时间', - `create_time` datetime DEFAULT NULL COMMENT '创建时间', - `update_time` datetime DEFAULT NULL COMMENT '更新时间', - `delete` smallint(2) DEFAULT NULL COMMENT '删除状态', - `order_type` int(2) DEFAULT NULL COMMENT '订单类型 0、为 Order 订单 1、为 OrderItem 订单', - `status` int(2) DEFAULT NULL COMMENT '状态 申请换货、申请成功、申请失败、换货中、换货成功', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- ---------------------------- --- Table structure for order_logistics --- ---------------------------- -DROP TABLE IF EXISTS `order_logistics`; -CREATE TABLE `order_logistics` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id自增长', - `area_no` varchar(10) NOT NULL COMMENT '地区编号', - `name` varchar(20) NOT NULL COMMENT '名称', - `mobile` varchar(20) NOT NULL COMMENT '手机号', - `address` varchar(255) NOT NULL COMMENT '详细地址', - `logistics` int(2) NOT NULL COMMENT '物流商家', - `logistics_no` varchar(20) NOT NULL COMMENT '物流单号', - `create_time` datetime NOT NULL COMMENT '创建时间', - `update_time` datetime DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8; - --- ---------------------------- --- Records of order_logistics --- ---------------------------- -BEGIN; -INSERT INTO `order_logistics` VALUES (24, '110101', 'Andy', '13302925934', '中二环,光电大厦11F 前台收', 1, '23123124123', '2019-04-11 22:50:31', NULL); -INSERT INTO `order_logistics` VALUES (34, '110101', 'Andy', '13302925934', '中二环,光电大厦11F 前台收', 1, '314123123123', '2019-04-12 19:23:42', NULL); -COMMIT; - --- ---------------------------- --- Table structure for order_logistics_detail --- ---------------------------- -DROP TABLE IF EXISTS `order_logistics_detail`; -CREATE TABLE `order_logistics_detail` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id自增长', - `order_logistics_id` int(11) NOT NULL COMMENT '物流编号', - `logistics_time` datetime NOT NULL COMMENT '物流时间', - `logistics_information` varchar(20) NOT NULL COMMENT '物流信息', - `create_time` datetime DEFAULT NULL COMMENT '创建时间', - `update_time` datetime DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; - - --- ---------------------------- --- Table structure for order_recipient --- ---------------------------- -DROP TABLE IF EXISTS `order_recipient`; -CREATE TABLE `order_recipient` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `order_id` int(11) NOT NULL COMMENT '订单id', - `area_no` varchar(20) NOT NULL COMMENT '区域编号', - `name` varchar(20) NOT NULL COMMENT '收件人名称', - `mobile` varchar(20) NOT NULL COMMENT '手机号', - `type` int(2) NOT NULL COMMENT '快递方式', - `address` varchar(250) NOT NULL COMMENT '地址详细', - `create_time` datetime NOT NULL COMMENT '创建时间', - `update_time` datetime DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=189 DEFAULT CHARSET=utf8; - --- ---------------------------- --- Table structure for order_return --- ---------------------------- -DROP TABLE IF EXISTS `order_return`; -CREATE TABLE `order_return` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id自增长', - `service_number` varchar(50) NOT NULL COMMENT '服务号', - `order_id` int(11) NOT NULL COMMENT '订单编号', - `order_no` varchar(50) NOT NULL COMMENT '订单号', - `order_logistics_id` int(11) DEFAULT NULL COMMENT '物流 id', - `refund_price` int(11) NOT NULL COMMENT '退回金额', - `reason` int(11) NOT NULL COMMENT '退货原因', - `describe` varchar(255) DEFAULT NULL COMMENT '换货原因 (其他的时候)', - `create_time` datetime NOT NULL COMMENT '创建时间', - `approval_time` datetime DEFAULT NULL COMMENT '同意时间', - `refuse_time` datetime DEFAULT NULL COMMENT '拒绝时间', - `logistics_time` datetime DEFAULT NULL COMMENT '物流时间(填写物流单号时间)', - `receiver_time` datetime DEFAULT NULL COMMENT '收货时间', - `closing_time` datetime DEFAULT NULL COMMENT '成交时间', - `service_type` int(2) DEFAULT NULL COMMENT ' 1、退货 2、退款', - `update_time` datetime DEFAULT NULL COMMENT '更新时间', - `status` int(2) NOT NULL COMMENT '状态 申请换货、申请成功、申请失败、退货中、退货成功', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8; - --- ---------------------------- --- Table structure for undo_log --- ---------------------------- -DROP TABLE IF EXISTS `undo_log`; -CREATE TABLE `undo_log` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `branch_id` bigint(20) NOT NULL, - `xid` varchar(100) NOT NULL, - `rollback_info` longblob NOT NULL, - `log_status` int(11) NOT NULL, - `log_created` datetime NOT NULL, - `log_modified` datetime NOT NULL, - `ext` varchar(100) DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `ux_undo_log` (`xid`,`branch_id`) -) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=utf8; diff --git a/归档/mall-dependencies/pom.xml b/归档/mall-dependencies/pom.xml deleted file mode 100644 index c934a2f6c..000000000 --- a/归档/mall-dependencies/pom.xml +++ /dev/null @@ -1,420 +0,0 @@ - - - - onemall - cn.iocoder.mall - 1.0-SNAPSHOT - - 4.0.0 - - mall-dependencies - - pom - ${project.artifactId} - Maven Bom,定义 Onemall 项目的所有依赖的版本 - - - - UTF-8 - UTF-8 - @ - 1.8 - ${java.version} - ${java.version} - 3.8.0 - - 2.2.5.RELEASE - Hoxton.SR1 - 2.2.1.RELEASE - - 2.5 - 2.0.2 - 1.5.21 - 2.9.2 - - 5.1.46 - 1.1.16 - 2.0.0 - 3.5.4 - 3.3.2 - 3.2.5.RELEASE - 3.13.6 - - 2.7.7 - - 2.1.1 - - 2.2.0 - - 1.1.0 - - 7.2.18 - 4.1.0 - - 8.0.1 - 2.2.2 - 1.7.30 - - 1.2.56 - 6.0.16.Final - 5.2.5 - 27.0.1-jre - 1.16.14 - 1.5.3.Final - - - - - - - - org.springframework.boot - spring-boot-starter-parent - ${spring.boot.version} - pom - import - - - org.springframework.cloud - spring-cloud-dependencies - ${spring.cloud.version} - pom - import - - - com.alibaba.cloud - spring-cloud-alibaba-dependencies - ${spring.cloud.alibaba.version} - pom - import - - - - - cn.iocoder.mall - common-framework - 1.0-SNAPSHOT - - - - - mysql - mysql-connector-java - ${mysql-connector-java.version} - - - - com.alibaba - druid-spring-boot-starter - ${druid.version} - - - - org.mybatis - mybatis - ${mybatis.version} - - - org.mybatis.spring.boot - mybatis-spring-boot-starter - ${mybatis-spring-boot-starter.version} - - - com.baomidou - mybatis-plus-core - ${mybatis-plus.version} - - - com.baomidou - mybatis-plus-boot-starter - ${mybatis-plus.version} - - - org.springframework.boot - spring-boot-starter-jdbc - - - - - - - com.github.vanroy - spring-boot-starter-data-jest - ${spring-boot-starter-data-jest.version} - - - - org.redisson - redisson-spring-boot-starter - ${redisson.version} - - - - cn.iocoder.mall - mall-spring-boot-starter-mybatis - 1.0-SNAPSHOT - - - cn.iocoder.mall - mall-spring-boot-starter-redis - 1.0-SNAPSHOT - - - - - javax.servlet - servlet-api - provided - ${servlet.version} - true - - - - cn.iocoder.mall - mall-spring-boot-starter-web - 1.0-SNAPSHOT - - - - io.swagger - swagger-annotations - ${swagger.version} - - - io.springfox - springfox-swagger2 - ${springfox-swagger.version} - - - com.github.xiaoymin - knife4j-spring-boot-starter - ${knife4j.version} - - - - cn.iocoder.mall - mall-security-annotations - 1.0-SNAPSHOT - - - cn.iocoder.mall - mall-spring-boot-starter-security-user - 1.0-SNAPSHOT - - - cn.iocoder.mall - mall-spring-boot-starter-security-admin - 1.0-SNAPSHOT - - - - cn.iocoder.mall - mall-spring-boot-starter-swagger - 1.0-SNAPSHOT - - - - - org.apache.dubbo - dubbo - ${dubbo.version} - - - - org.apache.dubbo - dubbo-spring-boot-starter - ${dubbo.version} - - - - cn.iocoder.mall - mall-spring-boot-starter-dubbo - 1.0-SNAPSHOT - - - - cn.iocoder.mall - mall-spring-boot-starter-system-error-code - 1.0-SNAPSHOT - - - - - org.apache.rocketmq - rocketmq-spring-boot-starter - ${rocketmq-spring-boot-starter.version} - - - - cn.iocoder.mall - mall-spring-boot-starter-rocketmq - 1.0-SNAPSHOT - - - - - com.xuxueli - xxl-job-core - ${xxl-job.version} - - - - cn.iocoder.mall - mall-spring-boot-starter-xxl-job - 1.0-SNAPSHOT - - - - - - - - - - - - io.seata - seata-spring-boot-starter - ${seata.version} - - - - - org.apache.skywalking - apm-toolkit-trace - ${skywalking.version} - - - - de.codecentric - spring-boot-admin-starter-client - ${spring-boot-admin-starter-client.version} - - - - io.sentry - sentry-logback - ${sentry.version} - - - io.sentry - sentry-spring-boot-starter - ${sentry.version} - - - - - - - - - com.qiniu - qiniu-java-sdk - ${qiniu.version} - - - - com.aliyun - aliyun-java-sdk-core - ${aliyun-java-sdk-core.version} - - - - - org.mapstruct - mapstruct - ${org.mapstruct.version} - - - org.mapstruct - mapstruct-jdk8 - ${org.mapstruct.version} - - - - org.projectlombok - lombok - ${org.projectlombok.version} - - - - com.google.guava - guava - ${guava.version} - - - - com.alibaba - fastjson - ${fastjson.version} - - - - - - - - - - - - - - - - cn.hutool - hutool-all - ${hutool.version} - - - - org.hibernate - hibernate-validator - ${hibernate-validator.version} - - - - - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${java.version} - ${java.version} - - - org.mapstruct - mapstruct-processor - ${org.mapstruct.version} - - - org.projectlombok - lombok - ${org.projectlombok.version} - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - true - - - - - - - diff --git a/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/product/ProductSpuController.java b/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/product/ProductSpuController.java deleted file mode 100644 index d38e36ed1..000000000 --- a/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/product/ProductSpuController.java +++ /dev/null @@ -1,47 +0,0 @@ -package cn.iocoder.mall.managementweb.controller.product; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.managementweb.controller.product.vo.spu.ProductSpuCreateReqVO; -import cn.iocoder.mall.managementweb.controller.product.vo.spu.ProductSpuPageReqVO; -import cn.iocoder.mall.managementweb.controller.product.vo.spu.ProductSpuRespVO; -import cn.iocoder.mall.managementweb.controller.product.vo.spu.ProductSpuUpdateReqVO; -import cn.iocoder.mall.managementweb.manager.product.ProductSpuManager; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; -import java.util.List; - -import static cn.iocoder.common.framework.vo.CommonResult.success; - -/** -* 商品 SPU Controller -*/ -@RestController -@RequestMapping("/product-spu") -@Api(tags = "商品 SPU") -@Validated -public class ProductSpuController { - - @Autowired - private ProductSpuManager productSpuManager; - - @GetMapping("/page") - @ApiOperation("获得商品 SPU 分页") - public CommonResult> pageProductSpu(ProductSpuPageReqVO pageVO) { - // 全部:无搜索条件 - // 在售中:visible = true && hasQuantity = true - // 已售罄:visible = true && hasQuantity = false - // 仓库中:visible = false - return success(productSpuManager.pageProductSpu(pageVO)); - } - - // TODO 芋艿,删除功能暂时不做。主要原因是,关联的数据太多。删除带来的问题会比较大 - - -} diff --git a/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/product/vo/spu/ProductSpuPageReqVO.java b/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/product/vo/spu/ProductSpuPageReqVO.java deleted file mode 100644 index 9911a8d46..000000000 --- a/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/product/vo/spu/ProductSpuPageReqVO.java +++ /dev/null @@ -1,23 +0,0 @@ -package cn.iocoder.mall.managementweb.controller.product.vo.spu; - -import cn.iocoder.common.framework.vo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; - -@ApiModel("商品 SPU分页 Request VO") -@Data -@EqualsAndHashCode(callSuper = true) -public class ProductSpuPageReqVO extends PageParam { - - @ApiModelProperty(value = "SPU 名字", notes = "模糊匹配", example = "艿艿") - private String name; - @ApiModelProperty(value = "分类编号", example = "1024") - private Integer cid; - @ApiModelProperty(value = "是否上架商品", example = "true") - private Boolean visible; - @ApiModelProperty(value = "是否有库存", example = "true") - private Boolean hasQuantity; - -} diff --git a/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/user/UserController.http b/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/user/UserController.http deleted file mode 100644 index d508139c7..000000000 --- a/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/user/UserController.http +++ /dev/null @@ -1,31 +0,0 @@ -### /user/page 成功 -GET http://127.0.0.1:18083/management-api/user/page?pageNo=1&pageSize=10 -Content-Type: application/x-www-form-urlencoded -Authorization: Bearer yudaoyuanma -dubbo-tag: {{dubboTag}} - -### /user/update 成功 -POST http://127.0.0.1:18083/management-api/user/update -Content-Type: application/x-www-form-urlencoded -Authorization: Bearer yudaoyuanma -dubbo-tag: {{dubboTag}} - -id=31&username=user02&password=buzhidao&name=测试管理员&departmentId=1 - -### /user/update-status 成功 -POST http://127.0.0.1:18083/management-api/user/update-status -Content-Type: application/x-www-form-urlencoded -Authorization: Bearer yudaoyuanma -dubbo-tag: {{dubboTag}} - -userId=243&status=2 - -### /user/update-status 失败,参数缺失 -POST http://127.0.0.1:18083/management-api/user/update-status -Content-Type: application/x-www-form-urlencoded -Authorization: Bearer yudaoyuanma -dubbo-tag: {{dubboTag}} - -userId=31 - -### diff --git a/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/user/UserController.java b/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/user/UserController.java deleted file mode 100644 index 65f6400c9..000000000 --- a/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/user/UserController.java +++ /dev/null @@ -1,68 +0,0 @@ -package cn.iocoder.mall.managementweb.controller.user; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.managementweb.controller.user.vo.UserPageReqVO; -import cn.iocoder.mall.managementweb.controller.user.vo.UserRespVO; -import cn.iocoder.mall.managementweb.controller.user.vo.UserUpdateInfoReqVO; -import cn.iocoder.mall.managementweb.controller.user.vo.UserUpdateStatusReqVO; -import cn.iocoder.mall.managementweb.manager.user.UserManager; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; -import java.util.List; - -import static cn.iocoder.common.framework.vo.CommonResult.success; - -/** -* 用户 Controller -*/ -@RestController -@RequestMapping("/user") -@Api(tags = "用户") -@Validated -public class UserController { - - @Autowired - private UserManager userManager; - - @PostMapping("/update-info") - @ApiOperation("更新用户信息") - public CommonResult updateUserInfo(@Valid UserUpdateInfoReqVO updateInfoReqVO) { - userManager.updateUserInfo(updateInfoReqVO); - return success(true); - } - - @PostMapping("/update-status") - @ApiOperation("更新用户信息") - public CommonResult updateUserStatus(@Valid UserUpdateStatusReqVO updateStatusReqVO) { - userManager.updateUserStatus(updateStatusReqVO); - return success(true); - } - - @GetMapping("/get") - @ApiOperation("获得用户") - @ApiImplicitParam(name = "userId", value = "用户编号", required = true) - public CommonResult getUser(@RequestParam("userId") Integer userId) { - return success(userManager.getUser(userId)); - } - - @GetMapping("/list") - @ApiOperation("获得用户列表") - @ApiImplicitParam(name = "userIds", value = "用户编号列表", required = true) - public CommonResult> listUsers(@RequestParam("userIds") List userIds) { - return success(userManager.listUsers(userIds)); - } - - @GetMapping("/page") - @ApiOperation("获得用户分页") - public CommonResult> pageUser(UserPageReqVO pageVO) { - return success(userManager.pageUser(pageVO)); - } - -} diff --git a/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/user/vo/UserPageReqVO.java b/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/user/vo/UserPageReqVO.java deleted file mode 100644 index 6a66530cf..000000000 --- a/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/user/vo/UserPageReqVO.java +++ /dev/null @@ -1,19 +0,0 @@ -package cn.iocoder.mall.managementweb.controller.user.vo; - -import cn.iocoder.common.framework.vo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; - -@ApiModel("用户分页 Request VO") -@Data -@EqualsAndHashCode(callSuper = true) -public class UserPageReqVO extends PageParam { - - @ApiModelProperty(value = "昵称", example = "丑艿艿", notes = "模糊匹配") - private String nickname; - @ApiModelProperty(value = "状态", example = "1", notes = "见 CommonStatusEnum 枚举") - private Integer status; - -} diff --git a/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/user/vo/UserRespVO.java b/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/user/vo/UserRespVO.java deleted file mode 100644 index 99e989d1a..000000000 --- a/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/user/vo/UserRespVO.java +++ /dev/null @@ -1,26 +0,0 @@ -package cn.iocoder.mall.managementweb.controller.user.vo; - -import lombok.*; -import io.swagger.annotations.*; -import java.util.*; - -@ApiModel("用户 Response VO") -@Data -public class UserRespVO { - - @ApiModelProperty(value = "用户编号", required = true, example = "1") - private Integer id; - @ApiModelProperty(value = "昵称", example = "丑艿艿") - private String nickname; - @ApiModelProperty(value = "头像", example = "http://www.iocoder.cn/xxx.jpg") - private String avatar; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举") - private Integer status; - @ApiModelProperty(value = "手机号", required = true, example = "15601691399") - private String mobile; - @ApiModelProperty(value = "注册 IP", required = true, example = "127.0.0.1") - private String createIp; - @ApiModelProperty(value = "创建时间", required = true) - private LocalDateTime createTime; - -} diff --git a/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/user/vo/UserUpdateInfoReqVO.java b/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/user/vo/UserUpdateInfoReqVO.java deleted file mode 100644 index d43288392..000000000 --- a/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/user/vo/UserUpdateInfoReqVO.java +++ /dev/null @@ -1,25 +0,0 @@ -package cn.iocoder.mall.managementweb.controller.user.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; - -@ApiModel("用户更新信息 Request VO") -@Data -public class UserUpdateInfoReqVO { - - @ApiModelProperty(value = "用户编号", required = true, example = "1") - @NotNull(message = "用户编号不能为空") - private Integer id; - @ApiModelProperty(value = "昵称", example = "臭艿艿") - private String nickname; - @ApiModelProperty(value = "头像", example = "http://www.iocoder.cn/nainainai.jpg") - private String avatar; - @ApiModelProperty(value = "手机号", example = "15601691300") - private String mobile; - @ApiModelProperty(value = "密码", example = "123456") - private String password; - -} diff --git a/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/user/vo/UserUpdateStatusReqVO.java b/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/user/vo/UserUpdateStatusReqVO.java deleted file mode 100644 index d8b43b7ca..000000000 --- a/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/user/vo/UserUpdateStatusReqVO.java +++ /dev/null @@ -1,24 +0,0 @@ -package cn.iocoder.mall.managementweb.controller.user.vo; - -import cn.iocoder.common.framework.enums.CommonStatusEnum; -import cn.iocoder.common.framework.validator.InEnum; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; - -@ApiModel("用户更新状态 Request VO") -@Data -public class UserUpdateStatusReqVO { - - @ApiModelProperty(value = "用户编号", required = true) - @NotNull(message = "用户编号不能为空") - private Integer userId; - - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举") - @NotNull(message = "状态不能为空") - @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") - private Integer status; - -} diff --git a/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/manager/product/ProductAttrKeyManager.java b/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/manager/product/ProductAttrKeyManager.java deleted file mode 100644 index 26590ba83..000000000 --- a/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/manager/product/ProductAttrKeyManager.java +++ /dev/null @@ -1,133 +0,0 @@ -package cn.iocoder.mall.managementweb.manager.product; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.managementweb.controller.product.vo.attr.*; -import cn.iocoder.mall.managementweb.convert.product.ProductAttrConvert; -import cn.iocoder.mall.productservice.rpc.attr.ProductAttrFeign; -import cn.iocoder.mall.productservice.rpc.attr.dto.ProductAttrKeyRespDTO; -import cn.iocoder.mall.productservice.rpc.attr.dto.ProductAttrValueRespDTO; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** -* 商品规格 Manager -*/ -@Service -public class ProductAttrKeyManager { - - @Autowired - private ProductAttrFeign productAttrFeign; - /** - * 创建商品规格键 - * - * @param createVO 创建商品规格键 VO - * @return 商品规格键 - */ - public Integer createProductAttrKey(ProductAttrKeyCreateReqVO createVO) { - CommonResult createProductAttrKeyResult = productAttrFeign.createProductAttrKey( - ProductAttrConvert.INSTANCE.convert(createVO)); - createProductAttrKeyResult.checkError(); - return createProductAttrKeyResult.getData(); - } - - /** - * 更新商品规格键 - * - * @param updateVO 更新商品规格键 VO - */ - public void updateProductAttrKey(ProductAttrKeyUpdateReqVO updateVO) { - CommonResult updateProductAttrKeyResult = productAttrFeign.updateProductAttrKey( - ProductAttrConvert.INSTANCE.convert(updateVO)); - updateProductAttrKeyResult.checkError(); - } - - /** - * 获得商品规格键 - * - * @param productAttrKeyId 商品规格键编号 - * @return 商品规格键 - */ - public ProductAttrKeyRespVO getProductAttrKey(Integer productAttrKeyId) { - CommonResult getProductAttrKeyResult = productAttrFeign.getProductAttrKey(productAttrKeyId); - getProductAttrKeyResult.checkError(); - return ProductAttrConvert.INSTANCE.convert(getProductAttrKeyResult.getData()); - } - - /** - * 获得商品规格键列表 - * - * @param productAttrKeyIds 商品规格键编号列表 - * @return 商品规格键列表 - */ - public List listProductAttrKeys(List productAttrKeyIds) { - CommonResult> listProductAttrKeyResult = productAttrFeign.listProductAttrKeys(productAttrKeyIds); - listProductAttrKeyResult.checkError(); - return ProductAttrConvert.INSTANCE.convertList(listProductAttrKeyResult.getData()); - } - - /** - * 获得商品规格键分页 - * - * @param pageVO 商品规格键分页查询 - * @return 商品规格键分页结果 - */ - public PageResult pageProductAttrKey(ProductAttrKeyPageReqVO pageVO) { - CommonResult> pageProductAttrKeyResult = productAttrFeign.pageProductAttrKey( - ProductAttrConvert.INSTANCE.convert(pageVO)); - pageProductAttrKeyResult.checkError(); - return ProductAttrConvert.INSTANCE.convertPage(pageProductAttrKeyResult.getData()); - } - - /** - * 创建商品规格值 - * - * @param createVO 创建商品规格值 VO - * @return 商品规格值 - */ - public Integer createProductAttrValue(ProductAttrValueCreateReqVO createVO) { - CommonResult createProductAttrValueResult = productAttrFeign.createProductAttrValue( - ProductAttrConvert.INSTANCE.convert(createVO)); - createProductAttrValueResult.checkError(); - return createProductAttrValueResult.getData(); - } - - /** - * 更新商品规格值 - * - * @param updateVO 更新商品规格值 VO - */ - public void updateProductAttrValue(ProductAttrValueUpdateReqVO updateVO) { - CommonResult updateProductAttrValueResult = productAttrFeign.updateProductAttrValue( - ProductAttrConvert.INSTANCE.convert(updateVO)); - updateProductAttrValueResult.checkError(); - } - - /** - * 获得商品规格值 - * - * @param productAttrValueId 商品规格值编号 - * @return 商品规格值 - */ - public ProductAttrValueRespVO getProductAttrValue(Integer productAttrValueId) { - CommonResult getProductAttrValueResult = productAttrFeign.getProductAttrValue(productAttrValueId); - getProductAttrValueResult.checkError(); - return ProductAttrConvert.INSTANCE.convert(getProductAttrValueResult.getData()); - } - - /** - * 获得商品规格值列表 - * - * @param queryReqVO 商品规格值的列表查询条件 VO - * @return 商品规格值列表 - */ - public List listProductAttrValues(ProductAttrValueListQueryReqVO queryReqVO) { - CommonResult> listProductAttrValueResult = productAttrFeign.listProductAttrValues( - ProductAttrConvert.INSTANCE.convert(queryReqVO)); - listProductAttrValueResult.checkError(); - return ProductAttrConvert.INSTANCE.convertList02(listProductAttrValueResult.getData()); - } - -} diff --git a/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/manager/user/UserManager.java b/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/manager/user/UserManager.java deleted file mode 100644 index 9f6a46c05..000000000 --- a/归档/management-web-app/src/main/java/cn/iocoder/mall/managementweb/manager/user/UserManager.java +++ /dev/null @@ -1,83 +0,0 @@ -package cn.iocoder.mall.managementweb.manager.user; - - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.managementweb.controller.user.vo.UserPageReqVO; -import cn.iocoder.mall.managementweb.controller.user.vo.UserRespVO; -import cn.iocoder.mall.managementweb.controller.user.vo.UserUpdateInfoReqVO; -import cn.iocoder.mall.managementweb.controller.user.vo.UserUpdateStatusReqVO; -import cn.iocoder.mall.managementweb.convert.user.UserConvert; -import cn.iocoder.mall.userservice.rpc.user.UserFeign; -import cn.iocoder.mall.userservice.rpc.user.dto.UserRespDTO; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 用户 Manager - */ -@Service -public class UserManager { - - - @Autowired - private UserFeign userFeign; - /** - * 更新用户信息 - * - * @param updateInfoReqVO 更新用户信息 VO - */ - public void updateUserInfo(UserUpdateInfoReqVO updateInfoReqVO) { - CommonResult updateUserResult = userFeign.updateUser(UserConvert.INSTANCE.convert(updateInfoReqVO)); - updateUserResult.checkError(); - } - - /** - * 更新用户状态 - * - * @param updateStatusReqVO 更新用户状态 VO - */ - public void updateUserStatus(UserUpdateStatusReqVO updateStatusReqVO) { - CommonResult updateUserResult = userFeign.updateUser(UserConvert.INSTANCE.convert(updateStatusReqVO)); - updateUserResult.checkError(); - } - - /** - * 获得用户 - * - * @param userId 用户编号 - * @return 用户 - */ - public UserRespVO getUser(Integer userId) { - CommonResult getUserResult = userFeign.getUser(userId); - getUserResult.checkError(); - return UserConvert.INSTANCE.convert(getUserResult.getData()); - } - - /** - * 获得用户列表 - * - * @param userIds 用户编号列表 - * @return 用户列表 - */ - public List listUsers(List userIds) { - CommonResult> listUserResult = userFeign.listUsers(userIds); - listUserResult.checkError(); - return UserConvert.INSTANCE.convertList(listUserResult.getData()); - } - - /** - * 获得用户分页 - * - * @param pageVO 用户分页查询 - * @return 用户分页结果 - */ - public PageResult pageUser(UserPageReqVO pageVO) { - CommonResult> pageUserResult = userFeign.pageUser(UserConvert.INSTANCE.convert(pageVO)); - pageUserResult.checkError(); - return UserConvert.INSTANCE.convertPage(pageUserResult.getData()); - } - -} diff --git a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/comment/OrderCommentRelpyTypeEnum.java b/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/comment/OrderCommentRelpyTypeEnum.java deleted file mode 100644 index 77fdf976e..000000000 --- a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/comment/OrderCommentRelpyTypeEnum.java +++ /dev/null @@ -1,35 +0,0 @@ -package cn.iocoder.mall.order.biz.enums.comment; - -/** - * - * 评论回复类型 - * - * @author wtz - * @time 2019-06-01 10:30:00 - */ -public enum OrderCommentRelpyTypeEnum { - - REPLY_REPLY(0, "回复的回复"), - COMMENT_REPLY(1, "评论的回复"); - /** - * 状态值 - */ - private Integer value; - /** - * 状态名 - */ - private String name; - - OrderCommentRelpyTypeEnum(Integer value, String name) { - this.value = value; - this.name = name; - } - - public Integer getValue() { - return value; - } - - public String getName() { - return name; - } -} diff --git a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/comment/OrderCommentStatusEnum.java b/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/comment/OrderCommentStatusEnum.java deleted file mode 100644 index fb91ff347..000000000 --- a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/comment/OrderCommentStatusEnum.java +++ /dev/null @@ -1,34 +0,0 @@ -package cn.iocoder.mall.order.biz.enums.comment; - -/** - * 订单评论状态 - * - * @author wtz - * @time 2019-06-15 14:26 - */ -public enum OrderCommentStatusEnum { - - WAIT_COMMENT(0, "待评论"), - SUCCESS_COMMENT(1, "评论成功"); - /** - * 状态值 - */ - private Integer value; - /** - * 状态名 - */ - private String name; - - OrderCommentStatusEnum(Integer value, String name) { - this.value = value; - this.name = name; - } - - public Integer getValue() { - return value; - } - - public String getName() { - return name; - } -} diff --git a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/comment/OrderReplyUserTypeEnum.java b/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/comment/OrderReplyUserTypeEnum.java deleted file mode 100644 index 1cf2d3a28..000000000 --- a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/comment/OrderReplyUserTypeEnum.java +++ /dev/null @@ -1,36 +0,0 @@ -package cn.iocoder.mall.order.biz.enums.comment; - -/** - * - * 评论回复 - 回复的用户的类型 - * - * @author wtz - * @time 2019-05-19 15:19 - */ -public enum OrderReplyUserTypeEnum { - - USER(0, "普通用户"), - MERCHANT(1, "商家"); - /** - * 状态值 - */ - private Integer value; - /** - * 状态名 - */ - private String name; - - OrderReplyUserTypeEnum(Integer value, String name) { - this.value = value; - this.name = name; - } - - public Integer getValue() { - return value; - } - - public String getName() { - return name; - } - -} diff --git a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/DictKeyConstants.java b/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/DictKeyConstants.java deleted file mode 100644 index caf9f14d3..000000000 --- a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/DictKeyConstants.java +++ /dev/null @@ -1,27 +0,0 @@ -package cn.iocoder.mall.order.biz.enums.order; - -/** - * 字典 keys 定义 - * - * @author Sin - * @time 2019-04-14 17:46 - */ -public class DictKeyConstants { - - /** - * 订单 - status - */ - public static final String ORDER_STATUS = "order_status"; - /** - * 订单 - 物流商家 - */ - public static final String ORDER_LOGISTICS_COMPANY = "logistics_company"; - /** - * 订单 - 退货原因 - */ - public static final String ORDER_RETURN_REASON = "order_return_reason"; - /** - * 订单退货 - 退货类型 - */ - public static final String ORDER_RETURN_SERVICE_TYPE = "order_return_service_type"; -} diff --git a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/ErrorCodeInterval.java b/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/ErrorCodeInterval.java deleted file mode 100644 index 7c0675292..000000000 --- a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/ErrorCodeInterval.java +++ /dev/null @@ -1,17 +0,0 @@ -package cn.iocoder.mall.order.biz.enums.order; - -import cn.iocoder.common.framework.enums.ModuleErrorCodeInterval; - -/** - * 错误码区间 - * - * 当前模块化区间:[1-008-000-000 ~ 1-008-000-000] - * - * @author Sin - * @time 2019-03-23 11:35 - */ -public class ErrorCodeInterval extends ModuleErrorCodeInterval { - - // OrderErrorCodeEnum 错误码区间 [1-008-000-000 ~ 1-008-000-000] - -} diff --git a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/LogisticsEnum.java b/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/LogisticsEnum.java deleted file mode 100644 index f4282404c..000000000 --- a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/LogisticsEnum.java +++ /dev/null @@ -1,41 +0,0 @@ -package cn.iocoder.mall.order.biz.enums.order; - -/** - * 物流信息 - * - * @author Sin - * @time 2019-03-30 22:33 - */ -public enum LogisticsEnum { - - LOGISTICS_1(1, "顺丰快递"), - LOGISTICS_2(2, "圆通快递"), - LOGISTICS_3(3, "申通快递"), - LOGISTICS_4(4, "韵答快递"), - LOGISTICS_5(5, "天天快递"), - LOGISTICS_6(6, "EMS中国邮政"), - - ; - - /** - * 状态值 - */ - private Integer value; - /** - * 状态名 - */ - private String name; - - LogisticsEnum(int value, String name) { - this.value = value; - this.name = name; - } - - public int getValue() { - return value; - } - - public String getName() { - return name; - } -} diff --git a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/MQConstants.java b/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/MQConstants.java deleted file mode 100644 index 24212e481..000000000 --- a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/MQConstants.java +++ /dev/null @@ -1,15 +0,0 @@ -package cn.iocoder.mall.order.biz.enums.order; - -/** - * MQ 订阅消息 - * - * @author Sin - * @time 2019-03-16 15:04 - */ -public class MQConstants { - - /** - * 订单 - 创建成功 消息 - */ - public static final String ORDER_CREATE_SUCCESS = "order.orderCreateSuccess"; -} diff --git a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderCancelReasonsEnum.java b/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderCancelReasonsEnum.java deleted file mode 100644 index dd14a3973..000000000 --- a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderCancelReasonsEnum.java +++ /dev/null @@ -1,54 +0,0 @@ -package cn.iocoder.mall.order.biz.enums.order; - -/** - * 订单取消原因 - * order_cancel_reasons - * @author Sin - * @time 2019-03-30 15:08 - */ -public enum OrderCancelReasonsEnum { - - CANCEL_1(1, "无法联系上买家"), - CANCEL_2(2, "买家误拍或重拍了"), - CANCEL_3(3, "买家无诚意完成交易"), - CANCEL_4(4, "已通过银行线下汇款"), - CANCEL_5(5, "已通过同城见面交易"), - CANCEL_6(6, "已通过货到付款交易"), - CANCEL_7(7, "已通过网上银行直接汇款"), - CANCEL_8(8, "已经缺货无法交易"), - CANCEL_20(20, "其他"), - ; - - // 无法联系上买家 - // 买家误拍或重拍了 - // 买家无诚意完成交易 - // 已通过银行线下汇款 - // 已通过同城见面交易 - // 已通过货到付款交易 - // 已通过网上银行直接汇款 - // 已经缺货无法交易 - - private final int code; - private final String message; - - OrderCancelReasonsEnum(int code, String message) { - this.code = code; - this.message = message; - } - - @Override - public String toString() { - return "OrderCancelEnum{" + - "code=" + code + - ", message='" + message + '\'' + - '}'; - } - - public int getCode() { - return code; - } - - public String getMessage() { - return message; - } -} diff --git a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderDeliveryTypeEnum.java b/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderDeliveryTypeEnum.java deleted file mode 100644 index 5d8dbc925..000000000 --- a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderDeliveryTypeEnum.java +++ /dev/null @@ -1,41 +0,0 @@ -package cn.iocoder.mall.order.biz.enums.order; - -/** - * 发货类型/发货方式 - * - * @author Sin - * @time 2019-04-05 16:03 - */ -public enum OrderDeliveryTypeEnum { - - NONE(1, "未选择"), - ORDER_ONLINE(2, "快递"), - CONTACT_YOURSELF(3, "自己联系"), - NO_DELIVERY(4, "无物流信息"), - ; - - private Integer value; - - private String name; - - OrderDeliveryTypeEnum(Integer value, String name) { - this.value = value; - this.name = name; - } - - @Override - public String toString() { - return "OrderRecipientTypeEnum{" + - "value=" + value + - ", name='" + name + '\'' + - '}'; - } - - public Integer getValue() { - return value; - } - - public String getName() { - return name; - } -} diff --git a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderExchangeReasonEnum.java b/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderExchangeReasonEnum.java deleted file mode 100644 index f426ac2a6..000000000 --- a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderExchangeReasonEnum.java +++ /dev/null @@ -1,40 +0,0 @@ -package cn.iocoder.mall.order.biz.enums.order; - -/** - * 订单换货原因 - * - * @author Sin - * @time 2019-03-20 21:17 - */ -public enum OrderExchangeReasonEnum { - - REASON_000(0, "其他"), - REASON_001(1, "尺码不合适"), - REASON_002(2, "质量问题"), - REASON_003(3, "不喜欢"), - ; - - private Integer value; - - private String name; - - OrderExchangeReasonEnum(Integer value, String name) { - this.value = value; - this.name = name; - } - - @Override - public String toString() { - return "OrderCommonReasonEnum{" + - "value=" + value + - ", name=" + name + - '}'; - } - - public Integer getValue() { - return value; - } - - public String getName() { - return name; - }} diff --git a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderPayStatus.java b/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderPayStatus.java deleted file mode 100644 index 46fcae38e..000000000 --- a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderPayStatus.java +++ /dev/null @@ -1,34 +0,0 @@ -package cn.iocoder.mall.order.biz.enums.order; - -/** - * 订单状态 status - * - * @author Sin - * @time 2019-03-16 14:32 - */ -public enum OrderPayStatus { - - WAITING_PAYMENT(0, "等待支付"), - SUCCESSFUL_PAYMENT(1, "支付成功"), - REFUND_PAYMENT(2, "退款成功"), - - ; - - - private final int value; - - private final String name; - - OrderPayStatus(int value, String name) { - this.value = value; - this.name = name; - } - - public int getValue() { - return value; - } - - public String getName() { - return name; - } -} diff --git a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderRecipientTypeEnum.java b/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderRecipientTypeEnum.java deleted file mode 100644 index 9d89607cb..000000000 --- a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderRecipientTypeEnum.java +++ /dev/null @@ -1,39 +0,0 @@ -package cn.iocoder.mall.order.biz.enums.order; - -/** - * 订单收件信息 type(配送信息) - * - * @author Sin - * @time 2019-04-05 16:03 - */ -public enum OrderRecipientTypeEnum { - - EXPRESS(1, "快递") - - ; - - private Integer value; - - private String name; - - OrderRecipientTypeEnum(Integer value, String name) { - this.value = value; - this.name = name; - } - - @Override - public String toString() { - return "OrderRecipientTypeEnum{" + - "value=" + value + - ", name='" + name + '\'' + - '}'; - } - - public Integer getValue() { - return value; - } - - public String getName() { - return name; - } -} diff --git a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderReturnReasonEnum.java b/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderReturnReasonEnum.java deleted file mode 100644 index d972c9d2d..000000000 --- a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderReturnReasonEnum.java +++ /dev/null @@ -1,52 +0,0 @@ -package cn.iocoder.mall.order.biz.enums.order; - -/** - * 订单退货原因 - * - * @author Sin - * @time 2019-03-20 21:17 - */ -public enum OrderReturnReasonEnum { - - /// - /// 未发货情况 - - REASON_000(0, "其他"), - REASON_001(1, "拍错/勿拍/多拍"), - REASON_002(2, "缺货"), - - /// - /// 已发货情况 - - REASON_020(20, "七天无理由"), - REASON_021(21, "质量问题"), - REASON_022(22, "不想要了"), - - ; - - // TODO: 2019-03-20 Sin 已发货情况 补全,需要对照一下 淘宝 - - private Integer value; - - private String name; - - OrderReturnReasonEnum(Integer value, String name) { - this.value = value; - this.name = name; - } - - @Override - public String toString() { - return "OrderCommonReasonEnum{" + - "value=" + value + - ", name=" + name + - '}'; - } - - public Integer getValue() { - return value; - } - - public String getName() { - return name; - }} diff --git a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderReturnServiceTypeEnum.java b/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderReturnServiceTypeEnum.java deleted file mode 100644 index 19dde5297..000000000 --- a/归档/moved/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderReturnServiceTypeEnum.java +++ /dev/null @@ -1,36 +0,0 @@ -package cn.iocoder.mall.order.biz.enums.order; - -/** - * 订单退货 - returnType - * - * @author Sin - * @time 2019-04-27 11:53 - */ -public enum OrderReturnServiceTypeEnum { - - /** - * 状态 - * - * - 1、退货退款 - * - 2、退款 - */ - RETURN_REFUND(1, "退货退款"), - REFUND(2, "退款") - ; - private final int value; - - private final String name; - - OrderReturnServiceTypeEnum(int value, String name) { - this.value = value; - this.name = name; - } - - public int getValue() { - return value; - } - - public String getName() { - return name; - } -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/convert/OrderCommentReplyConvert.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/convert/OrderCommentReplyConvert.java deleted file mode 100644 index bfa344a2a..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/convert/OrderCommentReplyConvert.java +++ /dev/null @@ -1,30 +0,0 @@ -package cn.iocoder.mall.order.biz.convert; - -import org.mapstruct.Mapper; -import org.mapstruct.factory.Mappers; - -/** - * - * 评论回复 convert - * - * @author wtz - * @time 2019-05-31 18:30 - */ -@Mapper -public interface OrderCommentReplyConvert { - - OrderCommentReplyConvert INSTANCE = Mappers.getMapper(OrderCommentReplyConvert.class); - -// @Mappings({}) -// OrderCommentReplyDO convert(OrderCommentReplyCreateDTO orderCommentReplyCreateDTO); -// -// @Mappings({}) -// OrderCommentReplyCreateBO convert(OrderCommentReplyDO orderCommentReplyDO); -// -// @Mappings({}) -// List convert(List orderCommentReplyDOList); -// -// @Mappings({}) -// List convertOrderCommentReplayItem( -// List orderCommentReplyDOList); -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/convert/OrderLogisticsConvert.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/convert/OrderLogisticsConvert.java deleted file mode 100644 index 17baca854..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/convert/OrderLogisticsConvert.java +++ /dev/null @@ -1,48 +0,0 @@ -package cn.iocoder.mall.order.biz.convert; - -import org.mapstruct.Mapper; -import org.mapstruct.factory.Mappers; - -/** - * 订单物流 convert - * - * @author Sin - * @time 2019-03-23 14:39 - */ -@Mapper -public interface OrderLogisticsConvert { - - OrderLogisticsConvert INSTANCE = Mappers.getMapper(OrderLogisticsConvert.class); - -// @Mappings({}) -// OrderLogisticsDO convert(OrderDeliveryDTO orderDelivery); -// -// @Mappings({}) -// OrderLogisticsDO convert(OrderLogisticsUpdateDTO orderLogisticsDTO); -// -// @Mappings({}) -// OrderLogisticsDO convert(OrderRecipientDO orderRecipientDO); -// -// @Mappings({}) -// List convertLogistics( -// List orderLogisticsDOList); -// -// @Mappings({}) -// List convertLogisticsDetail( -// List orderLogisticsDOList); -// -// @Mappings({}) -// OrderLogisticsInfoBO convert(OrderLogisticsDO orderLogisticsDO); -// -// @Mappings({}) -// List convert( -// List orderLogisticsDetailDOList); -// -// @Mappings({}) -// @Named(value = "orderLastLogisticsInfoBO") -// OrderLastLogisticsInfoBO convertOrderLastLogisticsInfoBO(OrderLogisticsDO orderLogisticsDO); -// -// @Mappings({}) -// OrderLastLogisticsInfoBO.LogisticsDetail convertLastLogisticsDetail( -// OrderLogisticsDetailDO orderLogisticsDetailDO); -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/convert/OrderLogisticsDetailConvert.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/convert/OrderLogisticsDetailConvert.java deleted file mode 100644 index 8d52f7fa9..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/convert/OrderLogisticsDetailConvert.java +++ /dev/null @@ -1,20 +0,0 @@ -package cn.iocoder.mall.order.biz.convert; - -import org.mapstruct.Mapper; -import org.mapstruct.factory.Mappers; - -/** - * 订单物流 convert - * - * @author Sin - * @time 2019-03-23 14:39 - */ -@Mapper -public interface OrderLogisticsDetailConvert { - - OrderLogisticsDetailConvert INSTANCE = Mappers.getMapper(OrderLogisticsDetailConvert.class); - -// @Mappings({}) -// OrderInfoBO.LogisticsDetail convertLogisticsDetail( -// OrderLogisticsDetailDO orderLogisticsDetailDO); -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/convert/OrderRecipientConvert.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/convert/OrderRecipientConvert.java deleted file mode 100644 index 08c46676a..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/convert/OrderRecipientConvert.java +++ /dev/null @@ -1,31 +0,0 @@ -package cn.iocoder.mall.order.biz.convert; - -import org.mapstruct.Mapper; -import org.mapstruct.factory.Mappers; - -/** - * 订单收件人信息 - * - * @author Sin - * @time 2019-03-31 12:50 - */ -@Mapper -public interface OrderRecipientConvert { - - OrderRecipientConvert INSTANCE = Mappers.getMapper(OrderRecipientConvert.class); - -// @Mappings({}) -// OrderRecipientDO convert(OrderCreateDTO orderCreateDTO); -// -// @Mappings({}) -// OrderRecipientDO convert(UserAddressBO userAddressBO); -// -// @Mappings({}) -// OrderRecipientBO convert(OrderRecipientDO orderRecipientDO); -// -// @Mappings({}) -// List convert(List orderRecipientDOList); -// -// @Mappings({}) -// OrderInfoBO.Recipient convertOrderInfoRecipient(OrderRecipientDO orderRecipientDO); -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/convert/OrderReturnConvert.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/convert/OrderReturnConvert.java deleted file mode 100644 index c79171571..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/convert/OrderReturnConvert.java +++ /dev/null @@ -1,31 +0,0 @@ -package cn.iocoder.mall.order.biz.convert; - -import org.mapstruct.Mapper; -import org.mapstruct.factory.Mappers; - -/** - * 订单 return - * - * @author Sin - * @time 2019-03-30 15:46 - */ -@Mapper -public interface OrderReturnConvert { - - OrderReturnConvert INSTANCE = Mappers.getMapper(OrderReturnConvert.class); - -// @Mappings({}) -// OrderReturnDO convert(OrderReturnCreateDTO orderReturnCreate); -// -// @Mappings({}) -// OrderReturnDO convert(OrderReturnApplyDTO orderReturnApplyDTO); -// -// @Mappings({}) -// OrderReturnInfoBO.ReturnInfo convert(OrderReturnDO orderReturnDO); -// -// @Mappings({}) -// List convert(List orderItemDOList); -// -// @Mappings({}) -// List convertListBO(List orderReturnDOList); -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/convert/comment/OrderCommentConvert.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/convert/comment/OrderCommentConvert.java deleted file mode 100644 index 9a9dd849f..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/convert/comment/OrderCommentConvert.java +++ /dev/null @@ -1,46 +0,0 @@ -package cn.iocoder.mall.order.biz.convert.comment; - -import cn.iocoder.mall.order.biz.bo.comment.OrderCommentInfoBO; -import cn.iocoder.mall.order.biz.bo.comment.OrderCommentPageBO; -import cn.iocoder.mall.order.biz.dataobject.comment.OrderCommentDO; -import cn.iocoder.mall.order.biz.dto.comment.OrderCommentAddDTO; -import java.util.List; -import org.mapstruct.Mapper; -import org.mapstruct.factory.Mappers; - -/** - * 订单评论转换 - * - * @author xiaofeng - * @version 1.0 - * @date 2020/05/19 23:06 - */ -@Mapper -public interface OrderCommentConvert { - - OrderCommentConvert INSTANCE = Mappers.getMapper(OrderCommentConvert.class); - - /** - * 参数转成 DO - * - * @param orderCommentAddDTO - * @return - */ - OrderCommentDO convert(OrderCommentAddDTO orderCommentAddDTO); - - /** - * 参数转成BO - * - * @param orderCommentList - * @return - */ - List convert(List orderCommentList); - - /** - * - * @param orderCommentDO - * @return - */ - OrderCommentInfoBO convert(OrderCommentDO orderCommentDO); - -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/comment/OrderCommentMapper.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/comment/OrderCommentMapper.java deleted file mode 100644 index 57a73649c..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/comment/OrderCommentMapper.java +++ /dev/null @@ -1,84 +0,0 @@ -package cn.iocoder.mall.order.biz.dao.comment; - -import org.springframework.stereotype.Repository; - -/** - * - * 订单评论 mapper - * - * @author wtz - * @time 2019-05-16 20:52 - */ -@Repository -public interface OrderCommentMapper{ - - -// /** -// * 插入订单评论 -// * @param orderCommentDO -// * @return -// */ -// void insert(OrderCommentDO orderCommentDO); -// -// -// /** -// * 根据 sku id 查询评论总条数 -// * @param productSkuId -// * @return -// */ -// int selectCommentTotalCountByProductSkuId(@Param("productSkuId") Integer productSkuId); -// -// -// /** -// * 分页获取评论 -// * @param orderCommentPageDTO -// * @return -// */ -// List selectCommentPage(OrderCommentPageDTO orderCommentPageDTO); -// -// -// /** -// * 根据评论 id 查询评论详情 -// * @param id -// * @return -// */ -// OrderCommentDO selectCommentInfoByCommentId(@Param("id") Integer id); -// -// -// /** -// * 订单评论状态信息详情 -// * @param orderCommentStateInfoPageDTO -// * @return -// */ -//// List selectOrderCommentStateInfoPage( -//// OrderCommentStateInfoPageDTO orderCommentStateInfoPageDTO); -// -// -// /** -// * 订单评论状态总数 -// * @param userId,commentState -// * @return -// */ -// int selectOrderCommentStateInfoTotal(@Param("userId") Integer userId, -// @Param("commentState") Integer commentState); -// -// -// /** -// * 订单评论超时分页 -// * @param orderCommentTimeOutPageDTO -// * @return -// */ -// List selectOrderCommentTimeOutPage( -// @Param("commentTimeOut") OrderCommentTimeOutPageDTO orderCommentTimeOutPageDTO); -// -// /** -// * 批量更新订单评论状态 -// * @param orderCommentTimeOutBOList -// * @param commentState -// */ -// void updateBatchOrderCommentState(@Param("commentState") Integer commentState, -// @Param("list") List orderCommentTimeOutBOList); - - - -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/comment/OrderCommentReplayMapper.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/comment/OrderCommentReplayMapper.java deleted file mode 100644 index d155c9206..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/comment/OrderCommentReplayMapper.java +++ /dev/null @@ -1,58 +0,0 @@ -package cn.iocoder.mall.order.biz.dao.comment; - -import org.springframework.stereotype.Repository; - -/** - * 订单评论回复 mapper - * - * @author wtz - * @time 2019-05-16 21:33 - */ -@Repository -public interface OrderCommentReplayMapper { - -// /** -// * 插入订单评论回复 -// * @param orderCommentReplyDO -// * @return -// */ -// void insert(OrderCommentReplyDO orderCommentReplyDO); -// -// /** -// * 根据评论 id 和用户类型获取商家回复 -// * @param commentId,userType -// * @return -// */ -// List selectCommentMerchantReplyByCommentIdAndUserType( -// @Param("commentId") Integer commentId, -// @Param("userType") Integer userType); -// -// -// /** -// * 分页获取评论回复 -// * @param orderCommentReplyPageDTO -// * @return -// */ -// List selectCommentReplyPage( -// OrderCommentReplyPageDTO orderCommentReplyPageDTO); -// -// -// /** -// * 根据评论 id 和用户类型获取评论回复总数 -// * @param commentId,userType -// * @return -// */ -// int selectCommentReplyTotalCountByCommentId(@Param("commentId") Integer commentId, -// @Param("userType") Integer userType); -// -// -// /** -// * 根据评论 id 查询最新的商家回复 -// * @param commentIds -// * @return -// */ -// List selectCommentNewMerchantReplyByCommentIds( -// @Param("commentIds") Collection commentIds, -// @Param("userType") Integer userType); - -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/order/OrderCancelMapper.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/order/OrderCancelMapper.java deleted file mode 100644 index 59d402475..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/order/OrderCancelMapper.java +++ /dev/null @@ -1,17 +0,0 @@ -package cn.iocoder.mall.order.biz.dao.order; - -import cn.iocoder.mall.order.biz.dataobject.OrderCancelDO; -import org.springframework.stereotype.Repository; - -/** - * 订单取消 mapper - * - * @author Sin - * @time 2019-03-30 16:27 - */ -@Repository -public interface OrderCancelMapper { - - int insert(OrderCancelDO orderCancelDO); - -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/order/OrderItemMapper.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/order/OrderItemMapper.java deleted file mode 100644 index 5c5550ce6..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/order/OrderItemMapper.java +++ /dev/null @@ -1,84 +0,0 @@ -package cn.iocoder.mall.order.biz.dao.order; - -import cn.iocoder.mall.order.biz.dataobject.OrderItemDO; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.Collection; -import java.util.List; - -/** - * 订单 item mapper - * - * @author Sin - * @time 2019-03-16 15:09 - */ -@Repository -public interface OrderItemMapper { - - /** - * 插入数据 - * - * @param orderItemDOList - */ - void insert(@Param("list") List orderItemDOList); - - /** - * 更新 - 根据Id - * - * @param orderItemDO - */ - void updateById(@Param("orderItemDO") OrderItemDO orderItemDO); - - /** - * 更新 - 根据 orderId - * @param orderId - * @param orderItemDO - */ - void updateByOrderId( - @Param("orderId") Integer orderId, - @Param("orderItemDO") OrderItemDO orderItemDO - ); - - /** - * 更新 - 根据Ids - * - * @param ids - * @param orderItemDO - */ - void updateByIds( - @Param("ids") List ids, - @Param("orderItemDO") OrderItemDO orderItemDO - ); - - /** - * 获取 - 根据 ids 查询 - * - * @param ids - * @return - */ - List selectByIds(@Param("ids") Collection ids); - - /** - * 查询 - 根据 orderIds 和 status - * - * @param orderIds - * @param deleted - * @return - */ - List selectByDeletedAndOrderIds( - @Param("orderIds") Collection orderIds, - @Param("deleted") Integer deleted - ); - - /** - * 查询 - 根据 orderId 下的 item - * - * @param orderId - * @return - */ - List selectByDeletedAndOrderId( - @Param("deleted") Integer deleted, - @Param("orderId") Integer orderId - ); -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/order/OrderLogisticsDetailMapper.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/order/OrderLogisticsDetailMapper.java deleted file mode 100644 index dddc9c394..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/order/OrderLogisticsDetailMapper.java +++ /dev/null @@ -1,66 +0,0 @@ -package cn.iocoder.mall.order.biz.dao.order; - -import cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDetailDO; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.Collection; -import java.util.List; - -/** - * 订单物流 - 物流详细信息 - * - * @author Sin - * @time 2019-04-12 21:35 - */ -@Repository -public interface OrderLogisticsDetailMapper { - - /** - * 插入 - * - * @param orderLogisticsDetailDO - * @return - */ - int insert(OrderLogisticsDetailDO orderLogisticsDetailDO); - - /** - * 查询 - 根据 物流id - * - * @param orderLogisticsId - * @return - */ - List selectByOrderLogisticsId( - @Param("orderLogisticsId") Integer orderLogisticsId - ); - - /** - * 查询 - 根据 物流ids - * - * @param orderLogisticsIds - * @return - */ - List selectByOrderLogisticsIds( - @Param("orderLogisticsIds") Collection orderLogisticsIds - ); - - /** - * 查询 - 获取最新的物流信息 - * - * @param orderLogisticsIds - * @return - */ - OrderLogisticsDetailDO selectLast( - @Param("orderLogisticsIds") Collection orderLogisticsIds - ); - - /** - * 查询 - 根据 last 根据物理id - * - * @param orderLogisticsId - * @return - */ - OrderLogisticsDetailDO selectLastByLogisticsId( - @Param("orderLogisticsId") Integer orderLogisticsId - ); -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/order/OrderLogisticsMapper.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/order/OrderLogisticsMapper.java deleted file mode 100644 index 9927933bc..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/order/OrderLogisticsMapper.java +++ /dev/null @@ -1,53 +0,0 @@ -package cn.iocoder.mall.order.biz.dao.order; - -import cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDO; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.Collection; -import java.util.List; - -/** - * 订单 item mapper - * - * @author Sin - * @time 2019-03-16 15:09 - */ -@Repository -public interface OrderLogisticsMapper { - - /** - * 插入数据 - * - * @param orderLogisticsDO - */ - void insert(OrderLogisticsDO orderLogisticsDO); - - /** - * 更新 - 根据id - * - * @param orderLogisticsDO - */ - void updateById(OrderLogisticsDO orderLogisticsDO); - - /** - * 查询 - 根据 ids - * - * @param id - * @return - */ - OrderLogisticsDO selectById( - @Param("id") Integer id - ); - - /** - * 查询 - 根据 ids - * - * @param ids - * @return - */ - List selectByIds( - @Param("ids") Collection ids - ); - -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/order/OrderRecipientMapper.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/order/OrderRecipientMapper.java deleted file mode 100644 index eb6be60c1..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/order/OrderRecipientMapper.java +++ /dev/null @@ -1,47 +0,0 @@ -package cn.iocoder.mall.order.biz.dao.order; - -import cn.iocoder.mall.order.biz.dataobject.OrderRecipientDO; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.Collection; -import java.util.List; - -/** - * 订单收件人 信息 - * - * @author Sin - * @time 2019-03-31 12:16 - */ -@Repository -public interface OrderRecipientMapper { - - /** - * 插入 - 订单收件人 - * - * @param orderRecipient - * @return - */ - int insert(OrderRecipientDO orderRecipient); - - /** - * 查询 - 根据 orderId - * - * @param orderId - * @return - */ - OrderRecipientDO selectByOrderId( - @Param("orderId") Integer orderId - ); - - /** - * 查询 - 根据 orderIds - * - * @param orderIds - * @return - */ - List selectByOrderIds( - @Param("orderIds") Collection orderIds - ); - -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/order/OrderReturnMapper.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/order/OrderReturnMapper.java deleted file mode 100644 index c0a1796ff..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/order/OrderReturnMapper.java +++ /dev/null @@ -1,63 +0,0 @@ -package cn.iocoder.mall.order.biz.dao.order; - -import org.springframework.stereotype.Repository; - -/** - * 订单退货 mapper - * - * @author Sin - * @time 2019-03-30 15:36 - */ -@Repository -public interface OrderReturnMapper { - -// /** -// * 插入 - 退货信息 -// * -// * @param orderReturnDO -// * @return -// */ -// int insert(OrderReturnDO orderReturnDO); -// -// /** -// * 更新 - 根据 orderId -// * -// * @param orderReturnDO -// * @return -// */ -// int updateById(OrderReturnDO orderReturnDO); -// -// /** -// * 查询 - 根据 orderId -// * -// * @param orderId -// * @return -// */ -// OrderReturnDO selectByOrderId( -// @Param("orderId") Integer orderId -// ); -// -// /** -// * 列表查询 - queryDTO -// * -// * @param queryDTO -// * @return -// */ -// int selectListCount(OrderReturnQueryDTO queryDTO); -// -// /** -// * 列表查询 - queryDTO -// * -// * @param queryDTO -// * @return -// */ -// List selectList(OrderReturnQueryDTO queryDTO); -// -// /** -// * 查询 - 根据 id 查询 -// * -// * @param id -// * @return -// */ -// OrderReturnDO selectById(Integer id); -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCommentReplyDO.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCommentReplyDO.java deleted file mode 100644 index c0edadf19..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCommentReplyDO.java +++ /dev/null @@ -1,87 +0,0 @@ -package cn.iocoder.mall.order.biz.dataobject; - -import cn.iocoder.mall.mybatis.core.dataobject.BaseDO; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 商品评价回复表 - * - * // TODO FROM 芋艿 TO wtz 商品评价回复表 =》订单评论回复表 - * - * @author wtz - * @time 2019-05-14 21:00 - * - */ -@Data -@Accessors(chain = true) -@TableName(value = "order_comment_replay") -public class OrderCommentReplyDO extends BaseDO { - - /** - * 回复 id - */ - private Integer id; - - /** - * 评论 id - */ - private Integer commentId; - - /** - * 回复的类型 // TODO FROM 芋艿 TO wtz 记得加下枚举类 - */ - private Integer replyType; - - /** - * 父 id - */ - private Integer parentId; - - /** - * 回复目标用户 id - */ - private Integer parentUserId; - - /** - * 回复目标用户昵称 - */ - private String parentUserNickName; - - /** - * 回复目标用户头像 - */ - private String parentUserAvatar; - - /** - * 回复的内容 - */ - private String replyContent; - - /** - * 回复用户 id - */ - private Integer replyUserId; - - /** - * 回复用户昵称 - */ - private String replyUserNickName; - - /** - * 回复用户头像 - */ - private String replyUserAvatar; - - /** - * 回复用户身份 // TODO FROM 芋艿 TO wtz 【提示】userType 和 UserTypeEnum 记录保持一致。 - */ - private Integer userType; - - /** - * 回复点赞数 - */ - private Integer replyLikeCount; - -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderExchangeDO.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderExchangeDO.java deleted file mode 100644 index 3fc400a8f..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderExchangeDO.java +++ /dev/null @@ -1,113 +0,0 @@ -package cn.iocoder.mall.order.biz.dataobject; - -import cn.iocoder.mall.mybatis.core.dataobject.DeletableDO; -import java.time.LocalDateTime; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 换货订单 - * - * @author Sin - * @time 2019-03-19 19:48 - */ -@Data -@Accessors(chain = true) -public class OrderExchangeDO extends DeletableDO { - - /** - * id - */ - private Integer id; - /** - * 订单id - */ - private Integer orderId; - /** - * 订单编号 - */ - private String orderNo; - /** - * 订单 item 编号 - */ - private Integer orderItemId; - /** - * 商品id(保存一个冗余,如果一个订单下存在多个商品,会有很大的作用) - */ - private String skuId; - /** - * 换货商品id - */ - private String exchangeSkuId; - /** - * 换货物流id - */ - private Integer exchangeOrderLogisticsId; - /** - * 收件物流id - */ - private Integer receiverOrderLogisticsId; - - /// - /// 原因 - - /** - * 原因 (关联字典) - * - * {@link cn.iocoder.mall.order.biz.constants.OrderExchangeReasonEnum} - */ - private Integer orderReasonId; - /** - * 原因(如果选择其他,原因保存在这) - * - * {@link cn.iocoder.mall.order.biz.constants.OrderExchangeReasonEnum#REASON_000} - */ - private String reason; - - /// - /// 时间信息 - - /** - * 创建时间 - * supper baseDO - */ -// private LocalDateTime createTime; - /** - * 付款时间 - */ - private LocalDateTime paymentTime; - /** - * 发货时间 - */ - private LocalDateTime deliveryTime; - /** - * 收货时间 - */ - private LocalDateTime receiverTime; - /** - * 成交时间 - */ - private LocalDateTime closingTime; - - /// - /// 其他 - - /** - * 订单类型 - * - * - 0、为 Order 订单 (对整个订单退货) - * - 1、为 OrderItem 订单 (对订单某一个商品退货) - */ - private Integer orderType; - /** - * 状态 - * - * - 申请换货 - * - 申请成功 - * - 申请失败 - * - 换货中 - * - 换货成功 - */ - private Integer status; - -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderLogisticsDO.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderLogisticsDO.java deleted file mode 100644 index 16873a6c1..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderLogisticsDO.java +++ /dev/null @@ -1,46 +0,0 @@ -package cn.iocoder.mall.order.biz.dataobject; - -import cn.iocoder.mall.mybatis.core.dataobject.BaseDO; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 订单物流信息 - * - * @author Sin - * @time 2019-03-19 20:47 - */ -@Data -@Accessors(chain = true) -public class OrderLogisticsDO extends BaseDO { - - /** - * id - */ - private Integer id; - /** - * 收件区域编号 - */ - private String areaNo; - /** - * 收件人名称 - */ - private String name; - /** - * 收件手机号 - */ - private String mobile; - /** - * 收件详细地址 - */ - private String address; - /** - * 物流 (字典) - */ - private Integer logistics; - /** - * 物流编号 - */ - private String logisticsNo; - -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderLogisticsDetailDO.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderLogisticsDetailDO.java deleted file mode 100644 index b6500ff11..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderLogisticsDetailDO.java +++ /dev/null @@ -1,37 +0,0 @@ -package cn.iocoder.mall.order.biz.dataobject; - -import cn.iocoder.mall.mybatis.core.dataobject.DeletableDO; -import java.time.LocalDateTime; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 订单物流 - 详细信息 - * - * - 同步第三方物流信息 - * - * @author Sin - * @time 2019-03-19 20:48 - */ -@Data -@Accessors(chain = true) -public class OrderLogisticsDetailDO extends DeletableDO { - - /** - * id - */ - private Integer id; - /** - * 物流id - */ - private Integer orderLogisticsId; - /** - * 物流时间 - */ - private LocalDateTime logisticsTime; - /** - * 物流信息 - */ - private String logisticsInformation; - -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderReturnDO.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderReturnDO.java deleted file mode 100644 index 18ac68e18..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderReturnDO.java +++ /dev/null @@ -1,102 +0,0 @@ -package cn.iocoder.mall.order.biz.dataobject; - -import cn.iocoder.mall.mybatis.core.dataobject.BaseDO; -import java.time.LocalDateTime; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 退货订单 - * - * @author Sin - * @time 2019-03-19 19:48 - */ -@Data -@Accessors(chain = true) -public class OrderReturnDO extends BaseDO { - - // TODO FROM 芋艿 TO 小范,存储下支付中心的退款单号 - - /** - * 编号自动增长 - */ - private Integer id; - /** - * 服务号 - */ - // TODO FROM 芋艿 to 小范,换个名字,看着怪怪的 哈哈哈哈。 - private String serviceNumber; - /** - * 订单编号 - */ - private Integer orderId; - /** - * 订单号 (保存一个冗余) - */ - private String orderNo; - /** - * 物流id - */ - private Integer orderLogisticsId; - - /// - /// 退货原因 - - /** - * 退货金额 - */ - private Integer refundPrice; - /** - * 退货原因(字典值) - * - * {@link cn.iocoder.mall.order.biz.constants.OrderReturnReasonEnum} - */ - private Integer reason; - /** - * 问题描述 - */ - // TODO FROM 芋艿 to 小范,describe 是动词,换成名词 description - private String describe; - - /// - /// 时间信息 - - /** - * 同意时间 - */ - private LocalDateTime approvalTime; - /** - * 拒绝时间 - */ - private LocalDateTime refuseTime; - /** - * 物流时间(填写物流单号时间) - */ - private LocalDateTime logisticsTime; - /** - * 收货时间 - */ - private LocalDateTime receiverTime; - /** - * 成交时间(确认时间) - */ - private LocalDateTime closingTime; - /** - * 服务类型 - * - * - 1、退货退款 - * - 2、退款 - */ - private Integer serviceType; - /** - * 状态 - * - * - 1、退货申请 - * - 2、申请成功 - * - 3、申请失败 - * - 4、退货中 - * - 5、已收货 - * - 6、退货成功 - */ - private Integer status; -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/README.md b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/README.md deleted file mode 100644 index f42e41382..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/README.md +++ /dev/null @@ -1,21 +0,0 @@ - -## 订单 - - -TODO - - -**退货** - -1. 商家未发货,退货原因 - - - 拍错/勿拍/多拍 - - 缺货 - -2. 商家已发货,退货原因 - - - 七天无理由 - - 质量问题 - - 不想要了 - - 其他 - \ No newline at end of file diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/comment/OrderCommentDO.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/comment/OrderCommentDO.java deleted file mode 100644 index d1cf55a7d..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/comment/OrderCommentDO.java +++ /dev/null @@ -1,124 +0,0 @@ -package cn.iocoder.mall.order.biz.dataobject.comment; - -import cn.iocoder.mall.mybatis.core.dataobject.BaseDO; -import lombok.Data; -import lombok.experimental.Accessors; -import org.springframework.data.annotation.Id; -import org.springframework.data.mongodb.core.mapping.Document; - -/** - * 订单评论 MONGODB - * - * @author xiaofeng - * @version 1.0 - * @date 2020/05/19 22:30 - */ -@Data -@Accessors(chain = true) -@Document(collection = "order_comment") -public class OrderCommentDO extends BaseDO { - - @Id - private Integer id; - - /** - * 订单 id - */ - private Integer orderId; - - /** - * 订单编号 - */ - private String orderNo; - - /** - * 商品 id - */ - private Integer productSpuId; - - /** - * 商品名称 - */ - private String productSpuName; - - /** - * 商品 sku id - */ - private Integer productSkuId; - - /** - * 商品 sku 属性 - */ - private String productSkuAttrs; - - /** - * 商品 sku 价格 - */ - private Integer productSkuPrice; - - /** - * 商品 sku url - */ - private String productSkuPicUrl; - - /** - * 用户id - */ - private Integer userId; - - /** - * 用户头像 - */ - private String userAvatar; - - /** - * 用户的真实姓名 - */ - private String userNickName; - - /** - * 评价星 - */ - private Integer star; - - /** - * 商品描述 - */ - private Integer productDescriptionStar; - - /** - * 物流评价 - */ - private Integer logisticsStar; - - /** - * 商家评价 - */ - private Integer merchantStar; - - /** - * 回复条数 - */ - private Integer replayCount; - - /** - * 点赞数 - */ - private Integer likeCount; - - /** - * 评论的内容 - */ - private String commentContent; - - /** - * 评论的图片地址 - */ - private String commentPics; - - /** - * 订单评论状态 - */ - private Integer commentState; - -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/comment/OrderCommentAddDTO.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/comment/OrderCommentAddDTO.java deleted file mode 100644 index 885960c5b..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/comment/OrderCommentAddDTO.java +++ /dev/null @@ -1,63 +0,0 @@ -package cn.iocoder.mall.order.biz.dto.comment; - -import java.io.Serializable; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 订单评论创建 - * - * @author wtz - * @update xiaofeng - * @time 2019-05-15 20:42 - * @update time 2020-05-13 0:07 - */ -@Data -@Accessors(chain = true) -public class OrderCommentAddDTO implements Serializable { - - @NotNull(message = "订单 id 不能为空") - private Integer orderId; - - @NotEmpty(message = "订单编号不能为空") - private String orderNo; - - @NotNull(message = "商品的 spu id 不能为空") - private Integer productSpuId; - - @NotEmpty(message = "商品的 spu name 不能为空") - private String productSpuName; - - @NotNull(message = "商品的 sku id 不能为空") - private Integer productSkuId; - - @NotEmpty(message = "商品的 sku attrs 不能为空") - private String productSkuAttrs; - - @NotNull(message = "商品的 sku price 不能为空") - private Integer productSkuPrice; - - @NotEmpty(message = "商品的 sku url 不能为空") - private String productSkuPicUrl; - - private Integer userId; - - private String userAvatar; - - @NotEmpty(message = "用户昵称不能为空") - private String userNickName; - - private Integer star; - - private Integer productDescriptionStar; - - private Integer logisticsStar; - - private Integer merchantStar; - - private String commentContent; - - private String commentPics; -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/comment/OrderCommentPageDTO.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/comment/OrderCommentPageDTO.java deleted file mode 100644 index b839b06b5..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/comment/OrderCommentPageDTO.java +++ /dev/null @@ -1,22 +0,0 @@ -package cn.iocoder.mall.order.biz.dto.comment; - -import cn.iocoder.common.framework.vo.PageParam; -import java.io.Serializable; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 订单评论 page - * - * @author xiaofeng - */ -@Data -@Accessors(chain = true) -public class OrderCommentPageDTO extends PageParam implements Serializable { - - /** - * 商品 sku id - */ - private Integer productSkuId; - -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/comment/OrderCommentReplyCreateDTO.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/comment/OrderCommentReplyCreateDTO.java deleted file mode 100644 index e9c267ab8..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/comment/OrderCommentReplyCreateDTO.java +++ /dev/null @@ -1,70 +0,0 @@ -package cn.iocoder.mall.order.biz.dto.comment; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * - * 订单回复评论创建 - * - * @author wtz - * @time 2019-05-16 19:07 - * - */ -@Data -@Accessors(chain = true) -public class OrderCommentReplyCreateDTO implements Serializable { - - /** - * 评论 id - */ - private Integer commentId; - - /** - * 评论目标对象 id - */ - private Integer parentId; - - /** - * 评论目标用户 id - */ - private Integer parentUserId; - - /** - * 评论目标用户昵称 - */ - private String parentUserNickName; - - /** - * 评论目标用户头像 - */ - private String parentUserAvatar; - - /** - * 回复内容 - */ - private String replyContent; - - /** - * 回复用户 id - */ - private Integer replyUserId; - - /** - * 回复用户昵称 - */ - private String replyUserNickName; - - /** - * 回复用户头像 - */ - private String replyUserAvatar; - - /** - * 回复用户类型 - */ - private Integer userType; - -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/comment/OrderCommentReplyPageDTO.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/comment/OrderCommentReplyPageDTO.java deleted file mode 100644 index 234a91bdf..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/comment/OrderCommentReplyPageDTO.java +++ /dev/null @@ -1,41 +0,0 @@ -package cn.iocoder.mall.order.biz.dto.comment; - - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * - * 订单评论信息详情 query - * - * @author wtz - * @time 2019-05-19 10:16 - */ -@Data -@Accessors(chain = true) -public class OrderCommentReplyPageDTO implements Serializable { - - /** - * 评论 id - */ - private Integer commentId; - - /** - * 用户类型 - */ - private Integer userType; - - /** - * 页码 - */ - private Integer pageNo; - - /** - * 每页条数 - */ - private Integer pageSize; - -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/comment/OrderCommentStateInfoPageDTO.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/comment/OrderCommentStateInfoPageDTO.java deleted file mode 100644 index 4d42d7740..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/comment/OrderCommentStateInfoPageDTO.java +++ /dev/null @@ -1,38 +0,0 @@ -package cn.iocoder.mall.order.biz.dto.comment; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * - * 订单评论状态分页信息 query - * - * @author wtz - * @time 2019-06-07 10:45 - */ -@Data -@Accessors(chain = true) -public class OrderCommentStateInfoPageDTO implements Serializable { - - /** - * 用户 id - */ - private Integer userId; - - /** - * 评论状态 - */ - private Integer commentState; - - /** - * 页码 - */ - private Integer pageNo; - - /** - * 每页条数 - */ - private Integer pageSize; -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/comment/OrderCommentTimeOutPageDTO.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/comment/OrderCommentTimeOutPageDTO.java deleted file mode 100644 index bb6b9bb0c..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/comment/OrderCommentTimeOutPageDTO.java +++ /dev/null @@ -1,36 +0,0 @@ -package cn.iocoder.mall.order.biz.dto.comment; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * 订单评论超时 - * - * @author wtz - * @time 2019-06-15 10:59 - */ -@Data -@Accessors(chain = true) -public class OrderCommentTimeOutPageDTO implements Serializable { - /** - * 超过的天数 - */ - private Integer overDay; - - /** - * 评论的状态 - */ - private Integer commentState; - - /** - * 页码 - */ - private Integer pageNo; - - /** - * 每页条数 - */ - private Integer pageSize; -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/CalcOrderPriceDTO.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/CalcOrderPriceDTO.java deleted file mode 100644 index 6f8409621..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/CalcOrderPriceDTO.java +++ /dev/null @@ -1,56 +0,0 @@ -package cn.iocoder.mall.order.biz.dto.order; - -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; -import java.util.List; - -/** - * 计算订单价格 DTO - */ -@Data -@Accessors(chain = true) -public class CalcOrderPriceDTO { - - @NotNull(message = "用户编号不能为空") - private Integer userId; - - /** - * 优惠劵编号 - */ - private Integer couponCardId; - - @NotNull(message = "商品数组不能为空") - private List items; - - @Data - @Accessors(chain = true) - public static class Item { - - /** - * SKU 编号 - */ - private Integer skuId; - /** - * 数量 - */ - private Integer quantity; - /** - * 是否选中 - * - * 注意下,目前只有在购物车的时候,才可能出现该属性为 false 。其它情况下,都会为 true 为主。 - */ - private Boolean selected; - - public Item() { - } - - public Item(Integer skuId, Integer quantity, Boolean selected) { - this.skuId = skuId; - this.quantity = quantity; - this.selected = selected; - } - } - -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderCreateDTO.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderCreateDTO.java deleted file mode 100644 index b9145d2ae..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderCreateDTO.java +++ /dev/null @@ -1,65 +0,0 @@ -package cn.iocoder.mall.order.biz.dto.order; - -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.Max; -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.List; - -/** - * 订单创建 - * - * @author Sin - * @time 2019-03-16 14:42 - */ -@Data -@Accessors(chain = true) -// TODO FROM 芋艿 to xiaofeng:辛苦后续补充下 Validation 注解哈 -public class OrderCreateDTO implements Serializable { - - /** - * 用户id - */ - private Integer userId; - /** - * 用户地址 - */ - private Integer userAddressId; - /** - * 优惠劵编号 - */ - private Integer couponCardId; - /** - * 备注 - */ - private String remark; - /** - * ip信息 - */ - private String ip; - - /// - /// order item - - private List orderItems; - - - @Data - @Accessors(chain = true) - public static class OrderItem { - - /** - * 商品编号 - */ - @NotNull - private Integer skuId; - /** - * 数量 - */ - @NotNull - @Max(value = 1000) - private Integer quantity; - } -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderDeliveryDTO.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderDeliveryDTO.java deleted file mode 100644 index 930cb03c9..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderDeliveryDTO.java +++ /dev/null @@ -1,41 +0,0 @@ -package cn.iocoder.mall.order.biz.dto.order; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.List; - -/** - * 订单发货 - * - * @author Sin - * @time 2019-03-30 22:31 - */ -@Data -@Accessors(chain = true) -public class OrderDeliveryDTO implements Serializable { - - /** - * 订单id - */ - private Integer orderId; - // TODO 芋艿,物流方式。会存在无需物流的情况 - /** - * 物流公司 (字典) - */ - private Integer logistics; - /** - * 物流单编号 - */ - private String logisticsNo; - - /// - /// 物理信息是跟 orderItem 走 - - /** - * 订单 orderItemId - */ - private List orderItemIds; - -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderItemDeletedDTO.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderItemDeletedDTO.java deleted file mode 100644 index e5cabab3a..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderItemDeletedDTO.java +++ /dev/null @@ -1,25 +0,0 @@ -package cn.iocoder.mall.order.biz.dto.order; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.List; - -/** - * @author Sin - * @time 2019-03-23 10:22 - */ -@Data -@Accessors(chain = true) -public class OrderItemDeletedDTO implements Serializable { - - /** - * 订单id - */ - private Integer orderId; - /** - * 订单item id - */ - private List orderItemIds; -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderItemUpdateDTO.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderItemUpdateDTO.java deleted file mode 100644 index ec97915b4..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderItemUpdateDTO.java +++ /dev/null @@ -1,40 +0,0 @@ -package cn.iocoder.mall.order.biz.dto.order; - -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; -import java.io.Serializable; - -/** - * 订单更新 - * - * @author Sin - * @time 2019-03-16 14:46 - */ -@Data -@Accessors(chain = true) -public class OrderItemUpdateDTO implements Serializable { - - /** - * 编号 - */ - @NotNull - private Integer id; - /** - * 商品编号 - */ - @NotNull - private Integer skuId; - /** - * 数量 - */ - @NotNull - private Integer quantity; - /** - * 金额(分) - */ - @NotNull - private Integer price; - -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderLogisticsUpdateDTO.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderLogisticsUpdateDTO.java deleted file mode 100644 index 6024870f2..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderLogisticsUpdateDTO.java +++ /dev/null @@ -1,51 +0,0 @@ -package cn.iocoder.mall.order.biz.dto.order; - -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import java.io.Serializable; - -/** - * 订单收件人信息 - * - * @author Sin - * @time 2019-03-17 20:22 - */ -@Data -@Accessors(chain = true) -public class OrderLogisticsUpdateDTO implements Serializable { - - /** - * 订单 id - */ - private Integer id; - /** - * 收件区域编号 - */ - @NotNull - private String areaNo; - /** - * 收件人名称 - */ - @NotNull - private String name; - /** - * 收件手机号 - */ - @NotNull - @Size(max = 11, min = 11) - // TODO: 2019-03-17 Sin 此处需要添加 手机号校验,需要添加新的注解 - private String mobile; - /** - * 收件详细地址 - */ - @NotNull - @Size(max = 250, min = 10, message = "收件地址应该在 10 ~ 250 个字符之间") - private String address; - /** - * 物流编号 - */ - private String logisticsNo; -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderQueryDTO.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderQueryDTO.java deleted file mode 100644 index 2f29a8ee6..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderQueryDTO.java +++ /dev/null @@ -1,59 +0,0 @@ -package cn.iocoder.mall.order.biz.dto.order; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 订单 query - * - * @author Sin - * @time 2019-03-23 14:15 - */ -@Data -@Accessors(chain = true) -public class OrderQueryDTO implements Serializable { - - /** - * id - */ - private Integer id; - /** - * 订单号 - */ - private String orderNo; - /** - * 用户 id - */ - private Integer userId; - /** - * 物流id - */ - private Integer orderLogisticsId; - /** - * 是否退换货 - */ - private Integer hasReturnExchange; - /** - * 付款时间(待发货) - */ - private LocalDateTime startPaymentTime; - private LocalDateTime endPaymentTime; - /** - * 创建时间 - */ - private LocalDateTime startCreateTime; - private LocalDateTime endCreateTime; - /** - * 删除状态 - */ - private Integer deleted; - /** - * 状态 - */ - private Integer status; - private Integer pageNo; - private Integer pageSize; -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderReturnApplyDTO.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderReturnApplyDTO.java deleted file mode 100644 index db4f8f435..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderReturnApplyDTO.java +++ /dev/null @@ -1,37 +0,0 @@ -package cn.iocoder.mall.order.biz.dto.order; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * @author Sin - * @time 2019-04-25 21:06 - */ -@Data -@Accessors(chain = true) -public class OrderReturnApplyDTO implements Serializable { - - /** - * 订单编号 - */ - private Integer orderId; - /** - * 退货原因(字典值) - */ - private Integer reason; - /** - * 问题描述 - */ - private String describe; - /** - * 退款类型 - * - * - 1、退货退款 - * - 2、退款 - */ - private Integer returnType; - -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderReturnCreateDTO.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderReturnCreateDTO.java deleted file mode 100644 index 8a2d19050..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderReturnCreateDTO.java +++ /dev/null @@ -1,41 +0,0 @@ -package cn.iocoder.mall.order.biz.dto.order; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * 订单退货 - 创建 - * - * @author Sin - * @time 2019-03-30 15:34 - */ -@Data -@Accessors(chain = true) -public class OrderReturnCreateDTO implements Serializable { - - /** - * 订单编号 - */ - private Integer orderId; - /** - * 订单 item 编号 - */ - private Integer orderItemId; - /** - * 退货原因(字典值) - */ - private Integer orderReason; - /** - * 原因(如果选择其他,原因保存在这) - */ - private String otherReasons; - /** - * 订单类型 - * - * - 0、为 Order 订单 (对整个订单退货) - * - 1、为 OrderItem 订单 (对订单某一个商品退货) - */ - private Integer orderType; -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderReturnQueryDTO.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderReturnQueryDTO.java deleted file mode 100644 index 74aae862c..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderReturnQueryDTO.java +++ /dev/null @@ -1,56 +0,0 @@ -package cn.iocoder.mall.order.biz.dto.order; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 订单退货 查询 po - * - * @author Sin - * @time 2019-05-06 21:36 - */ -@Data -@Accessors(chain = true) -public class OrderReturnQueryDTO implements Serializable { - - /** - * - * 订单id - */ - private Integer orderId; - /** - * 订单编号 - */ - private Integer orderNo; - /** - * 服务号 - */ - private String serviceNumber; - /** - * 创建时间 - 开始 - */ - private LocalDateTime startCreateTime; - /** - * 创建时间 - 结束 - */ - private LocalDateTime endCreateTime; - /** - * 状态 - */ - private Integer status; - - /// - /// 分页信息 - - /** - * 分页 index - */ - private Integer index; - /** - * 分页大小 - */ - private Integer pageSize; -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderUserPageDTO.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderUserPageDTO.java deleted file mode 100644 index 08ded7a99..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dto/order/OrderUserPageDTO.java +++ /dev/null @@ -1,45 +0,0 @@ -package cn.iocoder.mall.order.biz.dto.order; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 用户订单 page - * - * @author Sin - * @time 2019-04-08 17:50 - */ -@Data -@Accessors(chain = true) -public class OrderUserPageDTO implements Serializable { - - /** - * id - */ - private Integer id; - /** - * 订单号 - */ - private String orderNo; - /** - * 用户 id - */ - private Integer userId; - /** - * 付款时间(待发货) - */ - private LocalDateTime startPaymentTime; - private LocalDateTime endPaymentTime; - /** - * 创建时间 - */ - private LocalDateTime startCreateTime; - private LocalDateTime endCreateTime; - /** - * 状态 - */ - private Integer status; -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/OrderCommentReplyService.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/OrderCommentReplyService.java deleted file mode 100644 index ade023546..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/OrderCommentReplyService.java +++ /dev/null @@ -1,40 +0,0 @@ -package cn.iocoder.mall.order.biz.service; - -/** - * - * 订单评论回复模块 - * - * @author wtz - * @time 2019-05-29 14:30 - * - */ -public interface OrderCommentReplyService { - -// /** -// * 分页获取评论回复 -// * @param orderCommentReplyPageDTO -// * @return -// */ -// OrderCommentReplyPageBO getOrderCommentReplyPage( -// OrderCommentReplyPageDTO orderCommentReplyPageDTO); -// -// -// /** -// * 评论回复创建 -// * @param orderCommentReplyCreateDTO -// * @return -// */ -// OrderCommentReplyCreateBO createOrderCommentReply( -// OrderCommentReplyCreateDTO orderCommentReplyCreateDTO); -// -// -// /** -// * 获取商家评论回复 -// * @param commentId -// * @return -// */ -// List getOrderCommentMerchantReply(Integer commentId); - - - -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/OrderCommentService.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/OrderCommentService.java deleted file mode 100644 index ae6a50063..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/OrderCommentService.java +++ /dev/null @@ -1,61 +0,0 @@ -package cn.iocoder.mall.order.biz.service; - -/** - * 订单评论模块 - * - * @author wtz - * @time 2019-05-14 22:10 - */ -public interface OrderCommentService { - -// /** -// * 评论创建 -// * @param orderCommentCreateDTO -// * @return -// */ -// OrderCommentCreateBO createOrderComment(OrderCommentCreateDTO orderCommentCreateDTO); -// -// -// -// /** -// * 获取评论列表的分页 -// * @param orderCommentPageDTO -// * @return -// */ -// OrderCommentPageBO getOrderCommentPage(OrderCommentPageDTO orderCommentPageDTO); -// -// -// /** -// * 获取评论详情 -// * @param commentId -// * @return -// */ -// OrderCommentInfoBO getOrderCommentInfo(Integer commentId); -// -// -// /** -// * 获取订单评论状态详情 -// * @param orderCommentStateInfoPageDTO -// * @return -// */ -// OrderCommentStateInfoPageBO getOrderCommentStateInfoPage( -// OrderCommentStateInfoPageDTO orderCommentStateInfoPageDTO); -// -// /** -// * 获取订单评论超时分页 -// * @param orderCommentTimeOutPageDTO -// * @return -// */ -// List getOrderCommentTimeOutPage( -// OrderCommentTimeOutPageDTO orderCommentTimeOutPageDTO); -// -// -// /** -// * 批量更新订单评论状态 -// * @param orderCommentTimeOutBOList -// */ -// void updateBatchOrderCommentState(List orderCommentTimeOutBOList); - - - -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/OrderLogisticsService.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/OrderLogisticsService.java deleted file mode 100644 index 84ec10139..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/OrderLogisticsService.java +++ /dev/null @@ -1,39 +0,0 @@ -package cn.iocoder.mall.order.biz.service; - -/** - * 订单物流信息 - * - * @author Sin - * @time 2019-04-12 21:29 - */ -public interface OrderLogisticsService { - - -// /** -// * 获取物流信息 - 根据id -// * -// * @param id -// * @return -// */ -// CommonResult getLogisticsInfo(Integer id); -// -// -// /** -// * 获取 last 物流信息 - 根据id -// * -// * @param id -// * @return -// */ -// CommonResult getLastLogisticsInfo(Integer id); -// -// /** -// * 获取物流信息 - 根据 orderId -// * -// * @param userId -// * @param orderId -// * @return -// */ -// CommonResult getOrderLogisticsInfo(Integer userId, -// Integer orderId); - -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/OrderReturnService.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/OrderReturnService.java deleted file mode 100644 index c569afb15..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/OrderReturnService.java +++ /dev/null @@ -1,79 +0,0 @@ -package cn.iocoder.mall.order.biz.service; - -/** - * 订单退货 - * - * @author Sin - * @time 2019-03-30 15:33 - */ -public interface OrderReturnService { - - -// /** -// * 订单 - 退货 -// * -// * @param orderReturnApplyDTO -// * @return -// */ -// CommonResult orderReturnApply(OrderReturnApplyDTO orderReturnApplyDTO); -// -// /** -// * 更新退款成功 -// * -// * 如果成功,则返回 success -// * 如果失败,则返回具体原因 -// * -// * @param orderId 订单编号 -// * @param refundPrice 退款金额 -// * @return 支付结果 -// */ -// String updateRefundSuccess(String orderId, Integer refundPrice); -// -// /** -// * 订单申请信息 -// * -// * @param orderId -// * @return -// */ -// CommonResult orderApplyInfo(Integer orderId); -// -// /** -// * 订单退货 - 列表 -// * -// * @param queryDTO -// * @return -// */ -// CommonResult orderReturnList(OrderReturnQueryDTO queryDTO); -// -// /** -// * 订单退货 - 接受 -// * -// * @param id -// * @return -// */ -// CommonResult orderReturnAgree(Integer id); -// -// /** -// * 订单退货 - 拒绝 -// * -// * @param id -// * @return -// */ -// CommonResult orderReturnRefuse(Integer id); -// -// /** -// * 订单退货 - 确认收货 -// * -// * @param id -// * @return -// */ -// CommonResult confirmReceipt(Integer id); -// -// /** -// * 订单退货 - 确认订单 -// * -// * @param id -// * @return -// */ -// CommonResult refund(Integer id, String ip); -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/comment/OrderCommentService.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/comment/OrderCommentService.java deleted file mode 100644 index e5e4d4888..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/comment/OrderCommentService.java +++ /dev/null @@ -1,78 +0,0 @@ -package cn.iocoder.mall.order.biz.service.comment; - -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.order.biz.bo.comment.OrderCommentInfoBO; -import cn.iocoder.mall.order.biz.bo.comment.OrderCommentPageBO; -import cn.iocoder.mall.order.biz.bo.comment.OrderCommentStateInfoPageBO; -import cn.iocoder.mall.order.biz.bo.comment.OrderCommentTimeOutBO; -import cn.iocoder.mall.order.biz.dto.comment.OrderCommentAddDTO; -import cn.iocoder.mall.order.biz.dto.comment.OrderCommentPageDTO; -import cn.iocoder.mall.order.biz.dto.comment.OrderCommentStateInfoPageDTO; -import cn.iocoder.mall.order.biz.dto.comment.OrderCommentTimeOutPageDTO; -import java.util.List; -import javax.validation.Valid; -import org.springframework.validation.annotation.Validated; - -/** - * 订单评论业务 - * - * @author xiaofeng - * @version 1.0 - * @date 2020/05/17 15:24 - */ -@Validated -public interface OrderCommentService { - - /** - * 添加订单评论 - * - * @param orderCommentAddDTO - * @return - */ - Boolean addOrderComment(@Valid OrderCommentAddDTO orderCommentAddDTO); - - /** - * 分页 - * - * @param orderCommentPageDTO - * @return - */ - PageResult page(OrderCommentPageDTO orderCommentPageDTO); - - /** - * 获取订单评论信息 - * - * @param commentId - * @return - */ - OrderCommentInfoBO getOrderCommentInfo(Integer commentId); - - - /** - * 获取订单评论状态详情 - * - * @param orderCommentStateInfoPageDTO - * @return - */ - OrderCommentStateInfoPageBO getOrderCommentStateInfoPage( - OrderCommentStateInfoPageDTO orderCommentStateInfoPageDTO); - - /** - * 获取订单评论超时分页 - * - * @param orderCommentTimeOutPageDTO - * @return - */ - List getOrderCommentTimeOutPage( - OrderCommentTimeOutPageDTO orderCommentTimeOutPageDTO); - - - /** - * 批量更新订单评论状态 - * - * @param orderCommentTimeOutBOList - */ - void updateBatchOrderCommentState(List orderCommentTimeOutBOList); - - -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/comment/OrderCommentServiceImpl.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/comment/OrderCommentServiceImpl.java deleted file mode 100644 index 2d434e54c..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/comment/OrderCommentServiceImpl.java +++ /dev/null @@ -1,104 +0,0 @@ -package cn.iocoder.mall.order.biz.service.comment; - -import cn.iocoder.common.framework.util.CollectionUtil; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.order.biz.bo.comment.OrderCommentInfoBO; -import cn.iocoder.mall.order.biz.bo.comment.OrderCommentPageBO; -import cn.iocoder.mall.order.biz.bo.comment.OrderCommentStateInfoPageBO; -import cn.iocoder.mall.order.biz.bo.comment.OrderCommentTimeOutBO; -import cn.iocoder.mall.order.biz.convert.comment.OrderCommentConvert; -import cn.iocoder.mall.order.biz.dataobject.comment.OrderCommentDO; -import cn.iocoder.mall.order.biz.dto.comment.OrderCommentAddDTO; -import cn.iocoder.mall.order.biz.dto.comment.OrderCommentPageDTO; -import cn.iocoder.mall.order.biz.dto.comment.OrderCommentStateInfoPageDTO; -import cn.iocoder.mall.order.biz.dto.comment.OrderCommentTimeOutPageDTO; -import java.util.Collections; -import java.util.List; -import javax.validation.Valid; -import org.springframework.data.domain.Sort; -import org.springframework.data.domain.Sort.Direction; -import org.springframework.data.mongodb.core.MongoTemplate; -import org.springframework.data.mongodb.core.query.Criteria; -import org.springframework.data.mongodb.core.query.Query; -import org.springframework.stereotype.Service; - -/** - * OrderCommentServiceImpl - * - * @author xiaofeng - * @version 1.0 - * @date 2020/05/17 15:32 - */ -@Service -public class OrderCommentServiceImpl implements OrderCommentService { - - private final MongoTemplate mongoTemplate; - - public OrderCommentServiceImpl(final MongoTemplate mongoTemplate) { - this.mongoTemplate = mongoTemplate; - } - - @Override - public Boolean addOrderComment( - @Valid OrderCommentAddDTO orderCommentAddDTO) { - - OrderCommentDO orderCommentDO = mongoTemplate - .save(OrderCommentConvert.INSTANCE.convert(orderCommentAddDTO)); - return null != orderCommentDO ? Boolean.TRUE : Boolean.FALSE; - } - - @Override - public PageResult page( - OrderCommentPageDTO orderCommentPageDTO) { - Query query = new Query(); - query.with(Sort.by(Direction.ASC, "_id")); - List orderCommentList = Collections.EMPTY_LIST; - if (orderCommentPageDTO.getPageNo() == 1) { - query.limit(orderCommentPageDTO.getPageSize()); - } else { - final int offset = orderCommentPageDTO.getOffset(); - query.limit(offset); - List list = mongoTemplate.find(query, OrderCommentDO.class); - if (!CollectionUtil.isEmpty(list)) { - // 获取最后一条记录 - OrderCommentDO orderCommentDO = list.get(orderCommentList.size() - 1); - final Integer orderCommentId = orderCommentDO.getId(); - // 从上一页最后一条开始查 - query.addCriteria(Criteria.where("_id").gt(orderCommentId)); - // 重新赋值 - query.limit(orderCommentPageDTO.getPageSize()); - } - } - orderCommentList = mongoTemplate.find(query, OrderCommentDO.class); - - PageResult pageResult = new PageResult<>(); - pageResult.setList(OrderCommentConvert.INSTANCE.convert(orderCommentList)); - return pageResult; - } - - @Override - public OrderCommentInfoBO getOrderCommentInfo( - Integer commentId) { - OrderCommentDO orderCommentDO = mongoTemplate - .findOne(new Query(Criteria.where("_id").is(commentId)), OrderCommentDO.class); - return OrderCommentConvert.INSTANCE.convert(orderCommentDO); - } - - @Override - public OrderCommentStateInfoPageBO getOrderCommentStateInfoPage( - OrderCommentStateInfoPageDTO orderCommentStateInfoPageDTO) { - return null; - } - - @Override - public List getOrderCommentTimeOutPage( - OrderCommentTimeOutPageDTO orderCommentTimeOutPageDTO) { - return null; - } - - @Override - public void updateBatchOrderCommentState( - List orderCommentTimeOutBOList) { - - } -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/impl/OrderCommentReplyServiceImpl.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/impl/OrderCommentReplyServiceImpl.java deleted file mode 100644 index bb31fb549..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/impl/OrderCommentReplyServiceImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -package cn.iocoder.mall.order.biz.service.impl; - -import cn.iocoder.mall.order.biz.dao.comment.OrderCommentReplayMapper; -import cn.iocoder.mall.order.biz.service.OrderCommentReplyService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * - * 订单评论回复 service impl - * - * @author wtz - * @time 2019-05-31 18:30 - */ -@Service -@org.apache.dubbo.config.annotation.Service(validation = "true",version = "${dubbo.provider.OrderCommentReplyService.version}") -public class OrderCommentReplyServiceImpl implements OrderCommentReplyService { - - @Autowired - private OrderCommentReplayMapper orderCommentReplayMapper; - -// /** -// * 分页获取评论回复 -// * @param orderCommentReplyPageDTO -// * @return -// */ -// @Override -// public OrderCommentReplyPageBO getOrderCommentReplyPage(OrderCommentReplyPageDTO orderCommentReplyPageDTO) { -// OrderCommentReplyPageBO orderCommentReplyPageBO=new OrderCommentReplyPageBO(); -// //评论回复总数 -// Integer totalCount=orderCommentReplayMapper.selectCommentReplyTotalCountByCommentId(orderCommentReplyPageDTO.getCommentId(), -// orderCommentReplyPageDTO.getUserType()); -// //分页获取评论回复 -// List orderCommentReplyDOList=orderCommentReplayMapper.selectCommentReplyPage(orderCommentReplyPageDTO); -// orderCommentReplyPageBO.setTotal(totalCount); -// orderCommentReplyPageBO.setOrderCommentReplayItems(OrderCommentReplyConvert.INSTANCE.convertOrderCommentReplayItem(orderCommentReplyDOList)); -// return orderCommentReplyPageBO; -// } -// -// -// /** -// * 创建评论回复 -// * @param orderCommentReplyCreateDTO -// * @return -// */ -// @Override -// public OrderCommentReplyCreateBO createOrderCommentReply(OrderCommentReplyCreateDTO orderCommentReplyCreateDTO) { -// OrderCommentReplyDO orderCommentReplyDO=OrderCommentReplyConvert.INSTANCE.convert(orderCommentReplyCreateDTO); -// orderCommentReplyDO.setCreateTime(new Date()); -// -// Integer replyType=orderCommentReplyCreateDTO.getCommentId()==orderCommentReplyCreateDTO.getParentId()? -// OrderCommentRelpyTypeEnum.COMMENT_REPLY.getValue():OrderCommentRelpyTypeEnum.REPLY_REPLY.getValue(); -// -// orderCommentReplyDO.setReplyType(replyType); -// -// orderCommentReplayMapper.insert(orderCommentReplyDO); -// -// return OrderCommentReplyConvert.INSTANCE.convert(orderCommentReplyDO); -// } -// -// /** -// * 获取商家评论回复 -// * @param commentId -// * @return -// */ -// @Override -// public List getOrderCommentMerchantReply(Integer commentId) { -// List orderCommentReplyDOList=orderCommentReplayMapper.selectCommentMerchantReplyByCommentIdAndUserType(commentId, -// OrderReplyUserTypeEnum.MERCHANT.getValue()); -// return OrderCommentReplyConvert.INSTANCE.convert(orderCommentReplyDOList); -// } -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/impl/OrderCommentServiceImpl.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/impl/OrderCommentServiceImpl.java deleted file mode 100644 index 5f963c327..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/impl/OrderCommentServiceImpl.java +++ /dev/null @@ -1,93 +0,0 @@ -package cn.iocoder.mall.order.biz.service.impl; - -import cn.iocoder.mall.order.biz.dao.comment.OrderCommentMapper; -import cn.iocoder.mall.order.biz.dao.comment.OrderCommentReplayMapper; -import cn.iocoder.mall.order.biz.service.OrderCommentService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * - * 订单评论 service impl - * - * @author wtz - * @time 2019 - */ -@Service -@org.apache.dubbo.config.annotation.Service(validation = "true", version = "${dubbo.provider.OrderCommentService.version}") -public class OrderCommentServiceImpl implements OrderCommentService { - - @Autowired - private OrderCommentMapper orderCommentMapper; - - @Autowired - private OrderCommentReplayMapper orderCommentReplayMapper; - - -// @Override -// public OrderCommentCreateBO createOrderComment(OrderCommentCreateDTO orderCommentCreateDTO) { -// OrderCommentDO orderCommentDO=OrderCommentConvert.INSTANCE.convertOrderCommentDO(orderCommentCreateDTO); -// orderCommentDO.setCreateTime(new Date()); -// orderCommentMapper.insert(orderCommentDO); -// return OrderCommentConvert.INSTANCE.convertOrderCommentCreateBO(orderCommentDO); -// } -// -// @Override -// public OrderCommentPageBO getOrderCommentPage(OrderCommentPageDTO orderCommentPageDTO) { -// OrderCommentPageBO orderCommentPageBO=new OrderCommentPageBO(); -// //分页内容 -// List orderCommentDOList=orderCommentMapper.selectCommentPage(orderCommentPageDTO); -// //分页评论的 id -// List commentIds=orderCommentDOList.stream().map(x->x.getId()).collect(Collectors.toList()); -// //获取商家最新的评论回复 -// List orderCommentReplyDOList=orderCommentReplayMapper.selectCommentNewMerchantReplyByCommentIds(commentIds, -// OrderReplyUserTypeEnum.MERCHANT.getValue()); -// //评论组装 -// List orderCommentItemList=orderCommentDOList.stream() -// .flatMap(x->orderCommentReplyDOList.stream() -// .filter(y->x.getId()==y.getCommentId()) -// .map(y->new OrderCommentPageBO.OrderCommentItem(x.getId(),x.getUserAvatar(),x.getUserNickName(),x.getStar(), -// x.getCommentContent(),x.getCommentPics(),x.getReplayCount(),x.getLikeCount(),x.getCreateTime(),y.getReplyContent())) -// ).collect(Collectors.toList()); -// //总数 -// int totalCount=orderCommentMapper.selectCommentTotalCountByProductSkuId(orderCommentPageDTO.getProductSkuId()); -// orderCommentPageBO.setOrderCommentItems(orderCommentItemList); -// orderCommentPageBO.setTotal(totalCount); -// return orderCommentPageBO; -// } -// -// -// @Override -// public OrderCommentInfoBO getOrderCommentInfo(Integer commentId) { -// //查询评论详情 -// OrderCommentDO orderCommentDO=orderCommentMapper.selectCommentInfoByCommentId(commentId); -// return OrderCommentConvert.INSTANCE.convertOrderCommentInfoBO(orderCommentDO); -// } -// -// @Override -// public OrderCommentStateInfoPageBO getOrderCommentStateInfoPage(OrderCommentStateInfoPageDTO orderCommentStateInfoPageDTO) { -// OrderCommentStateInfoPageBO orderCommentStateInfoPageBO=new OrderCommentStateInfoPageBO(); -// //总数 -// int total=orderCommentMapper.selectOrderCommentStateInfoTotal(orderCommentStateInfoPageDTO.getUserId(), -// orderCommentStateInfoPageDTO.getCommentState()); -// //查询评论状态详情 -// List orderCommentDOList=orderCommentMapper.selectOrderCommentStateInfoPage(orderCommentStateInfoPageDTO); -// //转化评论状态详情 -// List orderCommentStateInfoItemList= -// OrderCommentConvert.INSTANCE.convertOrderCommentStateInfoItems(orderCommentDOList); -// orderCommentStateInfoPageBO.setTotal(total); -// orderCommentStateInfoPageBO.setOrderCommentStateInfoItems(orderCommentStateInfoItemList); -// return orderCommentStateInfoPageBO; -// } -// -// @Override -// public List getOrderCommentTimeOutPage(OrderCommentTimeOutPageDTO orderCommentTimeOutPageDTO) { -// List orderCommentDOList=orderCommentMapper.selectOrderCommentTimeOutPage(orderCommentTimeOutPageDTO); -// return OrderCommentConvert.INSTANCE.convertOrderCommentTimeOutBOList(orderCommentDOList); -// } -// -// @Override -// public void updateBatchOrderCommentState(List orderCommentTimeOutBOList) { -// orderCommentMapper.updateBatchOrderCommentState(OrderCommentStatusEnum.SUCCESS_COMMENT.getValue(),orderCommentTimeOutBOList); -// } -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/impl/OrderLogisticsServiceImpl.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/impl/OrderLogisticsServiceImpl.java deleted file mode 100644 index 5f4b744c2..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/impl/OrderLogisticsServiceImpl.java +++ /dev/null @@ -1,131 +0,0 @@ -package cn.iocoder.mall.order.biz.service.impl; - -import cn.iocoder.mall.order.biz.service.OrderLogisticsService; -import org.springframework.stereotype.Service; - -/** - * 订单物流 - * - * @author Sin - * @time 2019-04-12 21:32 - */ -@Service -@org.apache.dubbo.config.annotation.Service(validation = "true", version = "${dubbo.provider.OrderLogisticsService.version}") -public class OrderLogisticsServiceImpl implements OrderLogisticsService { - -// @Autowired -// private OrderMapper orderMapper; -// @Autowired -// private OrderItemMapper orderItemMapper; -// @Autowired -// private OrderLogisticsMapper orderLogisticsMapper; -// @Autowired -// private OrderLogisticsDetailMapper orderLogisticsDetailMapper; -// -// @Override -// public CommonResult getLogisticsInfo(Integer id) { -// OrderLogisticsDO orderLogisticsDO = orderLogisticsMapper.selectById(id); -// if (orderLogisticsDO == null) { -// return CommonResult.success(null); -// } -// -// List orderLogisticsDetailDOList = orderLogisticsDetailMapper -// .selectByOrderLogisticsId(orderLogisticsDO.getId()); -// -// // 转换数据结构 -// List logisticsDetails -// = OrderLogisticsConvert.INSTANCE.convert(orderLogisticsDetailDOList); -// -// OrderLogisticsInfoBO orderLogisticsInfo2BO = OrderLogisticsConvert.INSTANCE.convert(orderLogisticsDO); -// orderLogisticsInfo2BO.setDetails(logisticsDetails); -// return CommonResult.success(orderLogisticsInfo2BO); -// } -// -// @Override -// public CommonResult getLastLogisticsInfo(Integer id) { -// OrderLogisticsDO orderLogisticsDO = orderLogisticsMapper.selectById(id); -// if (orderLogisticsDO == null) { -// return CommonResult.success(null); -// } -// -// OrderLogisticsDetailDO orderLastLogisticsDetailDO = orderLogisticsDetailMapper.selectLastByLogisticsId(id); -// -// // 转换数据结构 -// OrderLastLogisticsInfoBO.LogisticsDetail lastLogisticsDetail -// = OrderLogisticsConvert.INSTANCE.convertLastLogisticsDetail(orderLastLogisticsDetailDO); -// -// OrderLastLogisticsInfoBO lastLogisticsInfoBO = OrderLogisticsConvert -// .INSTANCE.convertOrderLastLogisticsInfoBO(orderLogisticsDO); -// -// lastLogisticsInfoBO.setLastLogisticsDetail(lastLogisticsDetail); -// return CommonResult.success(lastLogisticsInfoBO); -// } -// -// @Override -// public CommonResult getOrderLogisticsInfo(Integer userId, Integer orderId) { -// OrderDO orderDO = orderMapper.selectById(orderId); -// -// if (orderDO == null) { -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_EXISTENT.getCode()); -// } -// -// if (!userId.equals(orderDO.getUserId())) { -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_USER_ORDER.getCode()); -// } -// -// // 获取订单所发货的订单 id -// List orderItemDOList = orderItemMapper.selectByDeletedAndOrderId( -// DeletedStatusEnum.DELETED_NO.getValue(), orderId); -// -// // 获取物流 信息 -// Set orderLogisticsIds = orderItemDOList.stream() -// .filter(o -> o.getOrderLogisticsId() != null) -// .map(o -> o.getOrderLogisticsId()) -// .collect(Collectors.toSet()); -// -// List orderLogisticsDOList = Collections.emptyList(); -// List orderLogisticsDetailDOList = Collections.emptyList(); -// if (!CollectionUtils.isEmpty(orderLogisticsIds)) { -// orderLogisticsDOList = orderLogisticsMapper.selectByIds(orderLogisticsIds); -// orderLogisticsDetailDOList = orderLogisticsDetailMapper.selectByOrderLogisticsIds(orderLogisticsIds); -// } -// -// // 转换 return 的数据 -// List logistics -// = OrderLogisticsConvert.INSTANCE.convertLogistics(orderLogisticsDOList); -// -// List logisticsDetails -// = OrderLogisticsConvert.INSTANCE.convertLogisticsDetail(orderLogisticsDetailDOList); -// -// logisticsDetails.stream().map(o -> { -// o.setLogisticsTimeText(DateUtil.format(o.getLogisticsTime(), "yyyy-MM-dd HH:mm")); -// return o; -// }).collect(Collectors.toList()); -// -// Map> logisticsDetailMultimap -// = logisticsDetails.stream().collect( -// Collectors.toMap( -// o -> o.getOrderLogisticsId(), -// item -> Lists.newArrayList(item), -// (oldVal, newVal) -> { -// oldVal.addAll(newVal); -// return oldVal; -// } -// ) -// ); -// -// logistics.stream().map(o -> { -// if (logisticsDetailMultimap.containsKey(o.getId())) { -// o.setDetails(logisticsDetailMultimap.get(o.getId())); -// } -// return o; -// }).collect(Collectors.toList()); -// -// return CommonResult.success( -// new OrderLogisticsInfoWithOrderBO() -// .setOrderId(orderId) -// .setOrderNo(orderDO.getOrderNo()) -// .setLogistics(logistics) -// ); -// } -} diff --git a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/impl/OrderReturnServiceImpl.java b/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/impl/OrderReturnServiceImpl.java deleted file mode 100644 index 7c8ab357f..000000000 --- a/归档/moved/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/impl/OrderReturnServiceImpl.java +++ /dev/null @@ -1,235 +0,0 @@ -package cn.iocoder.mall.order.biz.service.impl; - -import cn.iocoder.mall.order.biz.service.OrderReturnService; -import org.springframework.stereotype.Service; - -/** - * 订单退货 service - * - * @author Sin - * @time 2019-03-30 15:35 - */ -@Service -@org.apache.dubbo.config.annotation.Service(validation = "true", version = "${dubbo.provider.OrderReturnService.version}") -public class OrderReturnServiceImpl implements OrderReturnService { - -// @Autowired -// private OrderMapper orderMapper; -// @Autowired -// private OrderItemMapper orderItemMapper; -// @Autowired -// private OrderReturnMapper orderReturnMapper; -// @Autowired -// private OrderLogisticsService orderLogisticsService; -// -// @Reference(validation = "true", version = "${dubbo.consumer.PayRefundService.version}") -// private PayRefundService payRefundService; -// @Reference(validation = "true", version = "${dubbo.consumer.DataDictService.version}") -// private DataDictService dataDictService; -// -// -// @Override -// public CommonResult orderReturnApply(OrderReturnApplyDTO orderReturnDTO) { -// OrderDO checkOrder = orderMapper.selectById(orderReturnDTO.getOrderId()); -// -// // 检查订单是否 存在 -// if (checkOrder == null) { -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_EXISTENT.getCode()); -// } -// -// // 转换 DO -// OrderReturnDO orderReturnDO = OrderReturnConvert.INSTANCE.convert(orderReturnDTO); -// orderReturnDO -// .setOrderId(checkOrder.getId()) -// // TODO: 2019-04-27 Sin 服务号生成规则 -// .setServiceNumber(UUID.randomUUID().toString().replaceAll("-", "").substring(0, 16)) -// .setOrderNo(checkOrder.getOrderNo()) -// .setStatus(OrderReturnStatusEnum.RETURN_APPLICATION.getValue()) -// .setCreateTime(new Date()); -// -// // 保存申请信息 -// orderReturnMapper.insert(orderReturnDO); -// return CommonResult.success(null); -// } -// -// @Override -// public String updateRefundSuccess(String orderId, Integer refundPrice) { -// return "success"; -// } -// -// @Override -// public CommonResult orderApplyInfo(Integer orderId) { -// -// // 检查订单是否退货 -// OrderReturnDO orderReturnDO = orderReturnMapper.selectByOrderId(orderId); -// if (orderReturnDO == null) { -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_RETURN_NO_RETURN_APPLY.getCode()); -// } -// -// List orderItemDOList = orderItemMapper -// .selectByDeletedAndOrderId(DeletedStatusEnum.DELETED_NO.getValue(), orderId); -// -// // 订单不存在 -// if (CollectionUtils.isEmpty(orderItemDOList)) { -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_EXISTENT.getCode()); -// } -// -// // 转换 returnInfo -// OrderReturnInfoBO.ReturnInfo returnInfo = OrderReturnConvert.INSTANCE.convert(orderReturnDO); -// List itemList = OrderReturnConvert.INSTANCE.convert(orderItemDOList); -// -// // 物流信息 -// CommonResult lastLogisticsCommonResult = orderLogisticsService -// .getLastLogisticsInfo(orderReturnDO.getOrderLogisticsId()); -// -// if (lastLogisticsCommonResult.isError()) { -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_LOGISTICS_INVOKING_FAIL.getCode()); -// } -// -// OrderLastLogisticsInfoBO lastLogisticsInfoBO = lastLogisticsCommonResult.getData(); -// OrderReturnInfoBO orderReturnInfoBO = new OrderReturnInfoBO() -// .setOrderItems(itemList) -// .setReturnInfo(returnInfo) -// .setLastLogisticsInfo(lastLogisticsInfoBO); -// -// return CommonResult.success(orderReturnInfoBO); -// } -// -// @Override -// public CommonResult orderReturnList(OrderReturnQueryDTO queryDTO) { -// int totalCount = orderReturnMapper.selectListCount(queryDTO); -// if (totalCount <= 0) { -// return CommonResult.success( -// new OrderReturnListBO() -// .setData(Collections.EMPTY_LIST) -// .setIndex(queryDTO.getIndex()) -// .setPageSize(queryDTO.getPageSize()) -// .setTotalCount(0) -// ); -// } -// List orderReturnDOList = orderReturnMapper.selectList(queryDTO); -// List orderReturnListBOList -// = OrderReturnConvert.INSTANCE.convertListBO(orderReturnDOList); -// -// return CommonResult.success( -// new OrderReturnListBO() -// .setData(orderReturnListBOList) -// .setIndex(queryDTO.getIndex()) -// .setPageSize(queryDTO.getPageSize()) -// .setTotalCount(totalCount) -// ); -// } -// -// @Override -// public CommonResult orderReturnAgree(Integer id) { -// OrderReturnDO orderReturnDO = orderReturnMapper.selectById(id); -// if (orderReturnDO == null) { -// return ServiceExceptionUtil -// .error(OrderErrorCodeEnum.ORDER_RETURN_NOT_EXISTENT.getCode()); -// } -// -// orderReturnMapper.updateById( -// new OrderReturnDO() -// .setId(id) -// .setApprovalTime(new Date()) -// .setStatus(OrderReturnStatusEnum.APPLICATION_SUCCESSFUL.getValue()) -// ); -// return CommonResult.success(null); -// } -// -// @Override -// public CommonResult orderReturnRefuse(Integer id) { -// OrderReturnDO orderReturnDO = orderReturnMapper.selectById(id); -// if (orderReturnDO == null) { -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_RETURN_NOT_EXISTENT.getCode()); -// } -// -// orderReturnMapper.updateById( -// new OrderReturnDO() -// .setId(id) -// .setRefuseTime(new Date()) -// .setStatus(OrderReturnStatusEnum.APPLICATION_FAIL.getValue()) -// ); -// return CommonResult.success(null); -// } -// -// @Override -// public CommonResult confirmReceipt(Integer id) { -// OrderReturnDO orderReturnDO = orderReturnMapper.selectById(id); -// if (orderReturnDO == null) { -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_RETURN_NOT_EXISTENT.getCode()); -// } -// -// orderReturnMapper.updateById( -// new OrderReturnDO() -// .setId(id) -// .setReceiverTime(new Date()) -// .setStatus(OrderReturnStatusEnum.ORDER_RECEIPT.getValue()) -// ); -// return CommonResult.success(null); -// } -// -// @Override -// @Transactional -// public CommonResult refund(Integer id, String ip) { -// OrderReturnDO orderReturnDO = orderReturnMapper.selectById(id); -// if (orderReturnDO == null) { -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_RETURN_NOT_EXISTENT.getCode()); -// } -// -// // TODO: 2019/5/8 sin, 发送 MQ 消息,申请退货成功! -// // TODO: 2019/5/8 sin 退款:支付系统退款 -// // TODO: 2019/5/8 sin 退货+退款:退回商品签收后,支付系统退款 -// // TODO: 2019/5/8 sin 事务一致性 [重要] -// -// -// CommonResult dataDictResult = dataDictService -// .getDataDict(DictKeyConstants.ORDER_RETURN_REASON, orderReturnDO.getReason()); -// -// if (dataDictResult.isError()) { -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.DICT_SERVER_INVOKING_FAIL.getCode()); -// } -// -// // 支付退款 -// String orderDescription = dataDictResult.getData() -// .getDisplayName() + "(" + orderReturnDO.getDescribe() + ")"; -// -// CommonResult payResult = payRefundService.submitRefund( -// new PayRefundSubmitDTO() -// .setAppId(PayAppId.APP_ID_SHOP_ORDER) -// .setOrderId(String.valueOf(orderReturnDO.getOrderId())) -// .setPrice(orderReturnDO.getRefundPrice()) -// .setOrderDescription(orderDescription) -// .setCreateIp(ip) -// ); -// -// if (!payResult.isSuccess()) { -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_RETURN_REFUND_FAILED.getCode()); -// } -// -// // 更新 订单退货 信息 -// orderReturnMapper.updateById( -// new OrderReturnDO() -// .setId(id) -// .setClosingTime(new Date()) -// .setStatus(OrderReturnStatusEnum.RETURN_SUCCESS.getValue()) -// ); -// -// // 更新订单 -// orderMapper.updateById( -// new OrderDO() -// .setId(orderReturnDO.getOrderId()) -// .setClosingTime(new Date()) -// .setStatus(OrderStatusEnum.COMPLETED.getValue()) -// ); -// -// // 更新订单 -// orderItemMapper.updateByOrderId( -// orderReturnDO.getOrderId(), -// new OrderItemDO() -// .setClosingTime(new Date()) -// .setStatus(OrderStatusEnum.COMPLETED.getValue()) -// ); -// return CommonResult.success(null); -// } -} diff --git a/归档/moved/order/order-biz/src/main/resources/mapper/OrderCommentMapper.xml b/归档/moved/order/order-biz/src/main/resources/mapper/OrderCommentMapper.xml deleted file mode 100644 index e5f96e209..000000000 --- a/归档/moved/order/order-biz/src/main/resources/mapper/OrderCommentMapper.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - id,order_id,order_no,product_spu_id,product_spu_name,product_sku_id,product_sku_attrs,product_sku_price,product_sku_pic_url, - user_id,user_avatar,user_nick_name,star,product_description_star,logistics_star,merchant_star,replay_count,like_count,comment_content, - comment_pics,comment_state,create_time,update_time - - - - - INSERT INTO order_comment(order_id,order_no,product_spu_id,product_spu_name,product_sku_id, - product_sku_attrs,product_sku_price,product_sku_pic_url,user_id,user_avatar,user_nick_name,star, - product_description_star,logistics_star,merchant_star,comment_content,comment_pics,comment_state,create_time,update_time) - VALUES (#{orderId},#{orderNo},#{productSpuId},#{productSpuName},#{productSkuId},#{productSkuAttrs}, - #{productSkuPrice},#{productSkuPicUrl},#{userId},#{userAvatar},#{userNickName},#{star}, - #{productDescriptionStar},#{logisticsStar},#{merchantStar},#{commentContent},#{commentPics},#{commentState},#{createTime}, #{updateTime}); - - - - - - - - - - - - - - - - - - - - - - - - UPDATE order_comment - SET - comment_state = #{commentState} - WHERE - id - IN - - - #{item.id} - - - - - - - diff --git a/归档/moved/order/order-biz/src/main/resources/mapper/OrderCommentReplayMapper.xml b/归档/moved/order/order-biz/src/main/resources/mapper/OrderCommentReplayMapper.xml deleted file mode 100644 index ada6257d4..000000000 --- a/归档/moved/order/order-biz/src/main/resources/mapper/OrderCommentReplayMapper.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - id,comment_id,reply_type,parent_id,parent_user_id,parent_user_nick_name,parent_user_avatar,reply_content, - reply_user_id,reply_user_nick_name,reply_user_avatar,user_type,reply_like_count,create_time,update_time - - - - - INSERT INTO order_comment_replay(comment_id,reply_type,parent_id,parent_user_id,parent_user_nick_name,parent_user_avatar,reply_content,reply_user_id, - reply_user_nick_name,reply_user_avatar,user_type,create_time,update_time) - VALUES (#{commentId},#{replyType},#{parentId},#{parentUserId},#{parentUserNickName},#{parentUserAvatar},#{replyContent},#{replyUserId}, - #{replyUserNickName},#{replyUserAvatar},#{userType},#{createTime},#{updateTime}) - - - - - - - - - - - - - - - diff --git a/归档/moved/order/order-biz/src/main/resources/mapper/OrderLogisticsDetailMapper.xml b/归档/moved/order/order-biz/src/main/resources/mapper/OrderLogisticsDetailMapper.xml deleted file mode 100644 index 4f2745035..000000000 --- a/归档/moved/order/order-biz/src/main/resources/mapper/OrderLogisticsDetailMapper.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - id, - order_logistics_id, - logistics_time, - logistics_information, - create_time, - update_time - - - - - INSERT INTO cart_item (order_logistics_id, logistics_time, logistics_information, - create_time, update_time) - VALUES (#{orderLogisticsId}, #{logisticsTime}, #{logisticsInformation}, - #{createTime}, #{updateTime}) - - - - - - - - - - - - - - diff --git a/归档/moved/order/order-biz/src/main/resources/mapper/OrderLogisticsMapper.xml b/归档/moved/order/order-biz/src/main/resources/mapper/OrderLogisticsMapper.xml deleted file mode 100644 index 663dff66e..000000000 --- a/归档/moved/order/order-biz/src/main/resources/mapper/OrderLogisticsMapper.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - id, area_no, `name`, mobile, address, logistics, logistics_no, create_time, update_time - - - - - INSERT INTO `order_logistics` ( - area_no, `name`, mobile, address, logistics, logistics_no, create_time, update_time - ) VALUES ( - #{areaNo}, #{name}, #{mobile}, #{address}, - #{logistics}, #{logisticsNo}, #{createTime}, #{updateTime} - ) - - - - - - - , area_no = #{areaNo} - - - , `name` = #{name} - - - , mobile = #{mobile} - - - , address = #{address} - - - , logistics = #{logistics} - - - , logistics_no = #{logisticsNo} - - - - - - - UPDATE `order_logistics` - - WHERE id = #{id} - - - - - - - - diff --git a/归档/moved/order/order-biz/src/main/resources/mapper/OrderRecipientMapper.xml b/归档/moved/order/order-biz/src/main/resources/mapper/OrderRecipientMapper.xml deleted file mode 100644 index ca08c48bf..000000000 --- a/归档/moved/order/order-biz/src/main/resources/mapper/OrderRecipientMapper.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - id, order_id, `area_no`, `name`, mobile, address, `type`, - create_time, update_time - - - - - INSERT INTO `order_recipient` ( - order_id, `area_no`, `name`, mobile, address, - `type`, create_time, update_time - ) VALUES ( - #{orderId}, #{areaNo}, #{name}, #{mobile}, #{address}, - #{type}, #{createTime,jdbcType=TIMESTAMP} , #{updateTime} - ) - - - - - - - - - diff --git a/归档/moved/order/order-biz/src/main/resources/mapper/OrderReturnMapper.xml b/归档/moved/order/order-biz/src/main/resources/mapper/OrderReturnMapper.xml deleted file mode 100644 index 6748a6b8c..000000000 --- a/归档/moved/order/order-biz/src/main/resources/mapper/OrderReturnMapper.xml +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - id, - service_number, - order_id, - order_no, - order_logistics_id, - refund_price, - reason, - `describe`, - approval_time, - refuse_time, - logistics_time, - receiver_time, - closing_time, - service_type, - status, - create_time, - update_time - - - - - INSERT INTO `order_return` ( - service_number, order_id, order_no, order_logistics_id, - refund_price, reason, `describe`, - approval_time, refuse_time, logistics_time, receiver_time, closing_time, - service_type, status, - create_time, update_time) - VALUES ( - #{serviceNumber}, #{orderId}, #{orderNo}, #{orderLogisticsId}, - ${refundPrice}, #{reason}, #{describe}, - #{approvalTime}, #{refuse_time}, #{logisticsTime}, #{receiverTime}, #{closingTime}, - #{serviceType}, #{status}, #{createTime}, #{updateTime}) - - - - - - - , order_logistics_id = #{orderLogisticsId} - - - , refund_price = #{refundPrice} - - - , reason = #{reason} - - - , `describe` = #{describe} - - - , approval_time = #{approvalTime} - - - , refuse_time = #{refuseTime} - - - , logistics_time = #{logisticsTime} - - - , receiver_time = #{receiverTime} - - - , closing_time = #{closingTime} - - - , service_type = #{serviceType} - - - , status = #{status} - - - , create_time = #{createTime} - - - , update_time = #{updateTime} - - - - - - - UPDATE `order_return` - - WHERE id = #{id} - - - - - - - - - AND status = #{status} - - - AND service_number = #{serviceNumber} - - - AND order_id = #{orderId} - - - AND order_no = #{orderNo} - - - AND create_time >= #{startCreateTime} - AND create_time <= #{endCreateTime} - - - - - - - - - - - - - diff --git a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/controller/comment/OrderCommentReplyController.java b/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/controller/comment/OrderCommentReplyController.java deleted file mode 100644 index 15fe5515e..000000000 --- a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/controller/comment/OrderCommentReplyController.java +++ /dev/null @@ -1,37 +0,0 @@ -package cn.iocoder.mall.order.rest.controller.comment; - -import cn.iocoder.common.framework.enums.MallConstants; -import io.swagger.annotations.Api; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - - -/** - * - * 评论回复模块 Api(user) - * - * @author wtz - * @time 2019-05-31 18:00 - */ -@RestController -@RequestMapping(MallConstants.ROOT_PATH_USER + "/order_comment_reply") -@Api("用户评论回复模块 ") -public class OrderCommentReplyController { - -// @Reference(validation = "true", version = "${dubbo.provider.OrderCommentService.version}") -// private OrderCommentReplyService orderCommentReplyService; -// -// @PostMapping("create_order_comment_reply") -// //@RequiresLogin -// @ApiOperation(value = "创建订单回复") -// public CommonResult createOrderCommentReply(@RequestBody @Validated OrderCommentReplyCreateDTO orderCommentReplyCreateDTO){ -// return success(orderCommentReplyService.createOrderCommentReply(orderCommentReplyCreateDTO)); -// } -// -// @GetMapping("order_comment_reply_page") -// //@RequiresLogin -// @ApiOperation(value = "分页获取评论回复") -// public CommonResult getOrderCommentReplyPage(@Validated OrderCommentReplyPageDTO orderCommentReplyCreateDTO){ -// return success(orderCommentReplyService.getOrderCommentReplyPage(orderCommentReplyCreateDTO)); -// } -} diff --git a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/controller/comment/UsersOrderCommentController.java b/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/controller/comment/UsersOrderCommentController.java deleted file mode 100644 index 9570cdd19..000000000 --- a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/controller/comment/UsersOrderCommentController.java +++ /dev/null @@ -1,63 +0,0 @@ -package cn.iocoder.mall.order.rest.controller.comment; - -import cn.iocoder.common.framework.enums.MallConstants; -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.order.biz.dto.comment.OrderCommentPageDTO; -import cn.iocoder.mall.order.biz.service.comment.OrderCommentService; -import cn.iocoder.mall.order.rest.convert.comment.UsersOrderCommentConvert; -import cn.iocoder.mall.order.rest.request.comment.UsersOrderCommentAddRequest; -import cn.iocoder.mall.order.rest.request.comment.UsersOrderCommentPageRequest; -import cn.iocoder.mall.order.rest.response.comment.UsersOrderCommentPageResponse; -import cn.iocoder.mall.security.core.context.UserSecurityContextHolder; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * UsersOrderCommentController - * - * @author xiaofeng - * @version 1.0 - * @date 2020/05/12 22:56 - */ -@RestController -@RequestMapping(MallConstants.ROOT_PATH_USER + "/order_comment") -@Api("订单商品评论模块") -public class UsersOrderCommentController { - - private final OrderCommentService orderCommentService; - - public UsersOrderCommentController( - OrderCommentService orderCommentService) { - this.orderCommentService = orderCommentService; - } - - @PostMapping("/add") - @ApiOperation(value = "添加订单评论") - public CommonResult add( - @RequestBody @Validated UsersOrderCommentAddRequest request) { - Integer userId = UserSecurityContextHolder.getContext().getUserId(); - request.setUserId(userId); - - return CommonResult.success(orderCommentService.addOrderComment( - UsersOrderCommentConvert.INSTANCE.convert(request))); - } - - @GetMapping("/page") - @ApiOperation(value = "获取订单评论") - public CommonResult> page( - UsersOrderCommentPageRequest request) { - OrderCommentPageDTO orderCommentPageDTO = UsersOrderCommentConvert.INSTANCE - .convert(request); - return CommonResult.success(UsersOrderCommentConvert.INSTANCE - .convert(orderCommentService.page(orderCommentPageDTO))); - } - - -} diff --git a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/controller/order/AdminOrderReturnController.java b/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/controller/order/AdminOrderReturnController.java deleted file mode 100644 index 029d3a00f..000000000 --- a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/controller/order/AdminOrderReturnController.java +++ /dev/null @@ -1,47 +0,0 @@ -package cn.iocoder.mall.order.rest.controller.order; - -import io.swagger.annotations.Api; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * 订单退货 - * - * @author Sin - * @time 2019-05-06 21:31 - */ -@RestController -@RequestMapping("admins/order_return") -@Api("订单退货(admins api)") -public class AdminOrderReturnController { - -// @Reference(validation = "true", version = "${dubbo.provider.OrderReturnService.version}") -// private OrderReturnService orderReturnService; -// -// @GetMapping("list") -// public CommonResult list(@Validated OrderReturnQueryPO queryPO) { -// OrderReturnQueryDTO queryDTO = OrderReturnConvert.INSTANCE.convert(queryPO); -// return orderReturnService.orderReturnList(queryDTO); -// } -// -// @PostMapping("agree") -// public CommonResult agree(@RequestParam("id") Integer id) { -// return orderReturnService.orderReturnAgree(id); -// } -// -// @PostMapping("refuse") -// public CommonResult refuse(@RequestParam("id") Integer id) { -// return orderReturnService.orderReturnRefuse(id); -// } -// -// @PostMapping("confirm_receipt") -// public CommonResult confirmReceipt(@RequestParam("id") Integer id) { -// return orderReturnService.confirmReceipt(id); -// } -// -// @PostMapping("confirm_refund") -// public CommonResult confirmRefund(HttpServletRequest request, @RequestParam("id") Integer id) { -// String ip = HttpUtil.getIp(request); -// return orderReturnService.refund(id, ip); -// } -} diff --git a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/controller/order/AdminsOrderController.java b/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/controller/order/AdminsOrderController.java deleted file mode 100644 index 2d919f2d4..000000000 --- a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/controller/order/AdminsOrderController.java +++ /dev/null @@ -1,83 +0,0 @@ -package cn.iocoder.mall.order.rest.controller.order; - -import io.swagger.annotations.Api; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * 订单API(admins) - * - * @author Sin - * @time 2019-03-24 10:22 - */ -@RestController -@RequestMapping("admins/order") -@Api(value = "订单 API(admins)") -public class AdminsOrderController { - -// @Reference(validation = "true", version = "${dubbo.provider.OrderService.version}") -// private OrderService orderService; -// -// @GetMapping("page") -// @ApiOperation("订单列表") -// public CommonResult getOrderPage(@Validated OrderPageQueryPO orderPageQueryVO) { -// OrderQueryDTO orderQueryDTO = OrderConvertAPP.INSTANCE.convert(orderPageQueryVO); -// return orderService.getOrderPage(orderQueryDTO); -// } -// -// @GetMapping("order_items") -// @ApiOperation("订单列表") -// public CommonResult> getOrderItems(@RequestParam("orderId") Integer orderId) { -// return orderService.getOrderItems(orderId); -// } -// -// @GetMapping("order_recipient_info") -// @ApiOperation("订单收件人信息") -// public CommonResult getOrderRecipientBO(@RequestParam("orderId") Integer orderId) { -// return orderService.getOrderRecipientBO(orderId); -// } -// -// @PostMapping("order_deliver") -// @ApiOperation("订单发货") -// public CommonResult orderDeliver(@RequestBody @Validated OrderDeliverPO orderDeliverPO) { -// return orderService.orderDelivery(OrderDeliveryConvert.INSTANCE.convert(orderDeliverPO)); -// } -// -// @PutMapping("update_remark") -// @ApiOperation("更新-更新订单备注") -// public CommonResult updateRemark(@RequestParam("orderId") Integer orderId, -// @RequestParam("remark") String remark) { -// return orderService.updateOrderRemake(orderId, remark); -// } -// -// @PutMapping("cancel_order") -// @ApiOperation("取消订单") -// public CommonResult cancelOrder( -// @RequestParam("orderId") Integer orderId, -// @RequestParam("reasons") Integer reasons, -// @RequestParam(value = "otherReasons", required = false) String otherReasons) { -// return orderService.cancelOrder(orderId, reasons, otherReasons); -// } -// -// @PutMapping("order_item/update_pay_amount") -// @ApiOperation("更新-订单item实付金额") -// public CommonResult updateOrderItemPayAmount(@RequestParam("orderId") Integer orderId, -// @RequestParam("orderItemId") Integer orderItemId, -// @RequestParam("payAmount") Integer payAmount) { -// return orderService.updateOrderItemPayAmount(orderId, orderItemId, payAmount); -// } -// -// @PutMapping("order_item/update") -// @ApiOperation("更新-订单item") -// public CommonResult updateOrderItem(@RequestBody @Validated OrderItemUpdatePO orderItemUpdateVO) { -// OrderItemUpdateDTO dto = OrderConvertAPP.INSTANCE.convert(orderItemUpdateVO); -// return orderService.updateOrderItem(dto); -// } -// -// @PutMapping("logistics/update") -// @ApiOperation("更新-订单物流") -// public CommonResult updateLogistics(@RequestBody @Validated OrderLogisticsPO orderLogisticsVO) { -// OrderLogisticsUpdateDTO dto = OrderConvertAPP.INSTANCE.convert(orderLogisticsVO); -// return orderService.updateLogistics(dto); -// } -} diff --git a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/controller/order/UsersOrderController.java b/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/controller/order/UsersOrderController.java deleted file mode 100644 index 009838249..000000000 --- a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/controller/order/UsersOrderController.java +++ /dev/null @@ -1,28 +0,0 @@ -package cn.iocoder.mall.order.rest.controller.order; - - -import io.swagger.annotations.Api; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * 订单API(users) - * - * @author Sin - * @time 2019-03-24 11:24 - */ -@RestController -@RequestMapping("users/order") -@Api(description = "用户订单") // TODO FROM 芋艿 to 小范,description 已经废弃啦 -public class UsersOrderController { - -// -// @PostMapping("confirm_receiving") -// @RequiresLogin -// @ApiOperation("确认收货") -// public CommonResult confirmReceiving(@RequestParam("orderId") Integer orderId) { -// Integer userId = UserSecurityContextHolder.getContext().getUserId(); -// return orderService.confirmReceiving(userId, orderId); -// } - -} diff --git a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/controller/order/UsersOrderLogisticsController.java b/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/controller/order/UsersOrderLogisticsController.java deleted file mode 100644 index 4eaa37156..000000000 --- a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/controller/order/UsersOrderLogisticsController.java +++ /dev/null @@ -1,65 +0,0 @@ -package cn.iocoder.mall.order.rest.controller.order; - -import io.swagger.annotations.Api; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * 订单物流 controller - * - * @author Sin - * @time 2019-04-12 22:24 - */ -@RestController -@RequestMapping("users/order_logistics") -@Api(description = "订单物流信息") -public class UsersOrderLogisticsController { - -// @Reference(validation = "true", version = "${dubbo.provider.OrderLogisticsService.version}") -// private OrderLogisticsService orderLogisticsService; -// -// @Reference(validation = "true", version = "${dubbo.consumer.DataDictService.version}") -// private DataDictService dataDictService; -// -// @GetMapping("info") -// @ApiOperation("物流详细 - 物流通用") -// public CommonResult logistics(@RequestParam("logisticsId") Integer logisticsId) { -// return orderLogisticsService.getLogisticsInfo(logisticsId); -// } -// -// @GetMapping("info_order") -// @ApiOperation("物流详细 - 返回订单所关联的所有物流信息(订单用的)") -// public CommonResult logisticsInfoWithOrder(@RequestParam("orderId") Integer orderId) { -// Integer userId = UserSecurityContextHolder.getContext().getUserId(); -// CommonResult commonResult = orderLogisticsService.getOrderLogisticsInfo(userId, orderId); -// if (commonResult.isSuccess()) { -// OrderLogisticsInfoWithOrderBO orderLogisticsInfoBO = commonResult.getData(); -// List logisticsList = orderLogisticsInfoBO.getLogistics(); -// -// // 获取字典值 -// Set dictValues = logisticsList.stream().map(o -> o.getLogistics()).collect(Collectors.toSet()); -// if (!CollectionUtils.isEmpty(dictValues)) { -// CommonResult> dictResult = dataDictService -// .getDataDictList(DictKeyConstants.ORDER_LOGISTICS_COMPANY, dictValues); -// -// if (dictResult.isError()) { -// // 错误情况 -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.DICT_SERVER_INVOKING_FAIL.getCode()); -// } -// -// // 转换结果字典值 -// Map dataDictBOMap = dictResult.getData() -// .stream().collect(Collectors.toMap(o -> o.getValue(), o -> o)); -// -// logisticsList.stream().map(o -> { -// String dicValue = o.getLogistics().toString(); -// if (dataDictBOMap.containsKey(dicValue)) { -// o.setLogisticsText(dataDictBOMap.get(dicValue).getDisplayName()); -// } -// return o; -// }).collect(Collectors.toList()); -// } -// } -// return commonResult; -// } -} diff --git a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/controller/order/UsersOrderReturnController.java b/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/controller/order/UsersOrderReturnController.java deleted file mode 100644 index ab9a1e7db..000000000 --- a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/controller/order/UsersOrderReturnController.java +++ /dev/null @@ -1,53 +0,0 @@ -package cn.iocoder.mall.order.rest.controller.order; - -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * 订单退款/售后流程 - * - * @author Sin - * @time 2019-04-25 22:04 - */ -@RestController -@RequestMapping("users/order_return") -public class UsersOrderReturnController { - -// @Reference(validation = "true", version = "${dubbo.provider.OrderReturnService.version}") -// private OrderReturnService orderReturnService; -// -// @Reference(validation = "true", version = "${dubbo.consumer.DataDictService.version}") -// private DataDictService dataDictService; -// -// @GetMapping("reason") -// @ApiOperation("原因") -// public CommonResult> orderReturnReason() { -// return dataDictService.getDataDict(DictKeyConstants.ORDER_RETURN_REASON); -// } -// -// @PostMapping("apply") -// @ApiOperation("订单售后") -// public CommonResult orderReturnApply(@RequestBody OrderReturnApplyPO orderReturnApplyPO) { -// OrderReturnApplyDTO applyDTO = OrderReturnConvert.INSTANCE.convert(orderReturnApplyPO); -// return orderReturnService.orderReturnApply(applyDTO); -// } -// -// @GetMapping("info") -// @ApiOperation("订单售后详细") -// public CommonResult orderApplyInfo(@RequestParam("orderId") Integer orderId) { -// CommonResult commonResult = orderReturnService.orderApplyInfo(orderId); -// -// // 转换 字典值 -// if (commonResult.isSuccess()) { -// CommonResult dataDictResult = dataDictService.getDataDict( -// DictKeyConstants.ORDER_RETURN_SERVICE_TYPE, -// commonResult.getData().getReturnInfo().getServiceType()); -// -// if (dataDictResult.isSuccess()) { -// commonResult.getData().getReturnInfo().setServiceTypeText(dataDictResult.getData().getDisplayName()); -// } -// } -// -// return commonResult; -// } -} diff --git a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/convert/comment/UsersOrderCommentConvert.java b/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/convert/comment/UsersOrderCommentConvert.java deleted file mode 100644 index a453e503a..000000000 --- a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/convert/comment/UsersOrderCommentConvert.java +++ /dev/null @@ -1,50 +0,0 @@ -package cn.iocoder.mall.order.rest.convert.comment; - -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.order.biz.bo.comment.OrderCommentPageBO; -import cn.iocoder.mall.order.biz.dto.comment.OrderCommentAddDTO; -import cn.iocoder.mall.order.biz.dto.comment.OrderCommentPageDTO; -import cn.iocoder.mall.order.rest.request.comment.UsersOrderCommentAddRequest; -import cn.iocoder.mall.order.rest.request.comment.UsersOrderCommentPageRequest; -import cn.iocoder.mall.order.rest.response.comment.UsersOrderCommentPageResponse; -import org.mapstruct.Mapper; -import org.mapstruct.factory.Mappers; - -/** - * UsersOrderCommentConvert - * - * @author xiaofeng - * @version 1.0 - * @date 2020/05/13 0:15 - */ -@Mapper -public interface UsersOrderCommentConvert { - - UsersOrderCommentConvert INSTANCE = Mappers.getMapper(UsersOrderCommentConvert.class); - - - /** - * 保存订单评论参数转换 - * - * @param request - * @return - */ - OrderCommentAddDTO convert(UsersOrderCommentAddRequest request); - - /** - * 分页参数转换 - * - * @param request - * @return - */ - OrderCommentPageDTO convert(UsersOrderCommentPageRequest request); - - /** - * 分页转换 - * - * @param pageResult - * @return - */ - PageResult convert(PageResult pageResult); - -} diff --git a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/admin/AdminsOrderDeliverRequest.java b/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/admin/AdminsOrderDeliverRequest.java deleted file mode 100644 index 82df15a38..000000000 --- a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/admin/AdminsOrderDeliverRequest.java +++ /dev/null @@ -1,46 +0,0 @@ -package cn.iocoder.mall.order.rest.request.admin; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.Serializable; -import java.util.List; -import javax.validation.constraints.NotNull; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 订单发货 - * - * @author Sin - * @time 2019-04-05 16:55 - */ -@Data -@Accessors(chain = true) -@ApiModel(description = "订单发货PO") -public class AdminsOrderDeliverRequest implements Serializable { - - /** - * 订单编号 - */ - @ApiModelProperty("订单id") - @NotNull(message = "orderId不能为空") - private Integer orderId; - /** - * 物流 (字典) - */ - @ApiModelProperty("物流商家") - @NotNull(message = "必须选择商家") - private Integer logistics; - /** - * 物流编号 - */ - @ApiModelProperty("物流单号") - @NotNull(message = "没有物流单号") - private String logisticsNo; - /** - * 订单 items - */ - @ApiModelProperty("订单items") - @NotNull(message = "没有选择发货的商品") - private List orderItemIds; -} diff --git a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/admin/AdminsOrderItemUpdateRequest.java b/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/admin/AdminsOrderItemUpdateRequest.java deleted file mode 100644 index 64c46a28b..000000000 --- a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/admin/AdminsOrderItemUpdateRequest.java +++ /dev/null @@ -1,48 +0,0 @@ -package cn.iocoder.mall.order.rest.request.admin; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.Serializable; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 订单 item 更新 - * - * @author Sin - * @time 2019-03-24 11:16 - */ -@Data -@Accessors(chain = true) -@ApiModel("订单item更新") -public class AdminsOrderItemUpdateRequest implements Serializable { - - /** - * 编号 - */ - @NotNull(message = "id不能为空!") - @ApiModelProperty("编号(orderItemId)") - private Integer id; - /** - * 商品编号 - */ - @NotNull(message = "商品id不能为空!") - @ApiModelProperty("商品id") - private Integer skuId; - /** - * 数量 - */ - @NotNull(message = "数量不能为空!") - @Size(max = 9999, min = 1, message = "商品数量 1 ~ 9999") - @ApiModelProperty("商品数量") - private Integer quantity; - /** - * 金额(分) - */ - @NotNull(message = "商品金额") - @Size(max = 99999999, min = 0, message = "商品金额 0 ~ 99999999") - @ApiModelProperty("商品金额") - private Integer price; -} diff --git a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/admin/AdminsOrderLogisticsRequest.java b/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/admin/AdminsOrderLogisticsRequest.java deleted file mode 100644 index dd59bf25e..000000000 --- a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/admin/AdminsOrderLogisticsRequest.java +++ /dev/null @@ -1,60 +0,0 @@ -package cn.iocoder.mall.order.rest.request.admin; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.Serializable; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 订单物流 - * - * @author Sin - * @time 2019-03-24 11:01 - */ -@Data -@Accessors(chain = true) -@ApiModel("订单物流信息") -public class AdminsOrderLogisticsRequest implements Serializable { - - /** - * 订单 id - */ - @NotNull(message = "订单id不能为空!") - @ApiModelProperty("物流id") - private Integer id; - /** - * 收件区域编号 - */ - @NotNull(message = "区域编号不能为空!") - @ApiModelProperty("区域编号") - private String areaNo; - /** - * 收件人名称 - */ - @NotNull(message = "收件人姓名不能为空!") - @ApiModelProperty("收件人姓名") - private String name; - /** - * 收件手机号 - */ - @NotNull(message = "手机号不能为空!") - @Size(max = 11, min = 11, message = "手机号在11位!") - @ApiModelProperty("手机号") - private String mobile; - /** - * 收件详细地址 - */ - @NotNull(message = "收件详细地址不能为空") - @Size(max = 250, min = 5, message = "收件地址应该在 5 ~ 250 个字符之间") - @ApiModelProperty("手机地址") - private String address; - /** - * 物流编号 - */ - @ApiModelProperty("物流订号") - private String logisticsNo; - -} diff --git a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/admin/AdminsOrderPageQueryRequest.java b/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/admin/AdminsOrderPageQueryRequest.java deleted file mode 100644 index b34f70ea6..000000000 --- a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/admin/AdminsOrderPageQueryRequest.java +++ /dev/null @@ -1,73 +0,0 @@ -package cn.iocoder.mall.order.rest.request.admin; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.Serializable; -import java.time.LocalDateTime; -import lombok.Data; -import lombok.experimental.Accessors; -import org.springframework.format.annotation.DateTimeFormat; - -/** - * 订单 page 查询 vo - * - * @author Sin - * @time 2019-03-24 10:40 - */ -@Data -@Accessors(chain = true) -@ApiModel("订单查询") -public class AdminsOrderPageQueryRequest implements Serializable { - - /** - * id - */ - @ApiModelProperty("订单id") - private Integer id; - /** - * 订单号 - */ - @ApiModelProperty("订单号") - private String orderNo; - /** - * 用户 id - */ - @ApiModelProperty("用户id") - private Integer userId; - /** - * 付款时间(待发货) - */ - @ApiModelProperty("start付款时间") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime startPaymentTime; - @ApiModelProperty("end付款时间") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime endPaymentTime; - /** - * 创建时间 - */ - @ApiModelProperty("start订单创建时间") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime startCreateTime; - @ApiModelProperty("end订单创建时间") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime endCreateTime; - /** - * 结束时间 - */ - @ApiModelProperty("start成交时间") - private LocalDateTime startClosingTime; - @ApiModelProperty("end成交时间") - private LocalDateTime endClosingTime; - /** - * 删除状态 - */ - @ApiModelProperty("订单状态") - private Integer status; - @ApiModelProperty("删除状态") - private Integer deleted; - @ApiModelProperty("分页pageNo") - private Integer pageNo; - @ApiModelProperty("每页大小") - private Integer pageSize; -} diff --git a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/admin/AdminsOrderPageRequest.java b/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/admin/AdminsOrderPageRequest.java deleted file mode 100644 index 5b769db86..000000000 --- a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/admin/AdminsOrderPageRequest.java +++ /dev/null @@ -1,39 +0,0 @@ -package cn.iocoder.mall.order.rest.request.admin; - -import cn.iocoder.mall.order.biz.bo.order.OrderBO; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.List; - -/** - * 订单分页 vo - * - * @author Sin - * @time 2019-03-27 21:23 - */ -@Data -@Accessors(chain = true) -@ApiModel("订单VO") -// TODO FROM 芋艿 to jwf1173:命名要改下,rest 以 Admins 和 Users 开头 [DONE] -public class AdminsOrderPageRequest implements Serializable { - - /** - * 分页 - */ - @ApiModelProperty("分页下表当前") - private Integer pageNo; - /** - * 总条数 - */ - @ApiModelProperty("总条数") - private Integer total; - /** - * 订单 list - */ - @ApiModelProperty("订单信息") - private List orders; -} diff --git a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/admin/AdminsOrderReturnQueryRequest.java b/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/admin/AdminsOrderReturnQueryRequest.java deleted file mode 100644 index 30ee652e3..000000000 --- a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/admin/AdminsOrderReturnQueryRequest.java +++ /dev/null @@ -1,61 +0,0 @@ -package cn.iocoder.mall.order.rest.request.admin; - -import java.io.Serializable; -import java.time.LocalDateTime; -import javax.validation.constraints.NotNull; -import lombok.Data; -import lombok.experimental.Accessors; -import org.springframework.format.annotation.DateTimeFormat; - -/** - * 订单退货 查询 po - * - * @author Sin - * @time 2019-05-06 21:36 - */ -@Data -@Accessors(chain = true) -public class AdminsOrderReturnQueryRequest implements Serializable { - - /** - * - * 订单id - */ - private Integer orderId; - /** - * 订单编号 - */ - private Integer orderNo; - /** - * 服务号 - */ - private String serviceNumber; - /** - * 创建时间 - 开始 - */ - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime startCreateTime; - /** - * 创建时间 - 结束 - */ - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime endCreateTime; - /** - * 状态 - */ - private Integer status; - - /// - /// 分页信息 - - /** - * 分页 index - */ - @NotNull - private Integer index; - /** - * 分页大小 - */ - @NotNull - private Integer pageSize; -} diff --git a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/comment/UsersOrderCommentAddRequest.java b/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/comment/UsersOrderCommentAddRequest.java deleted file mode 100644 index 4bd07063c..000000000 --- a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/comment/UsersOrderCommentAddRequest.java +++ /dev/null @@ -1,82 +0,0 @@ -package cn.iocoder.mall.order.rest.request.comment; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 添加订单评论 - * - * @author xiaofeng - * @version 1.0 - * @date 2020/05/12 23:02 - */ -@ApiModel("用户 - Order 模块 - 添加订单评论") -@Data -@Accessors(chain = true) -public class UsersOrderCommentAddRequest { - - @ApiModelProperty(value = "订单 id", required = true) - @NotNull(message = "订单 id 不能为空") - private Integer orderId; - - @ApiModelProperty(value = "订单编号", required = true) - @NotEmpty(message = "订单编号不能为空") - private String orderNo; - - @ApiModelProperty(value = "商品 spu id", required = true) - @NotNull(message = "商品的 spu id 不能为空") - private Integer productSpuId; - - @ApiModelProperty(value = "商品 spu name", required = true) - @NotEmpty(message = "商品的 spu name 不能为空") - private String productSpuName; - - @ApiModelProperty(value = "商品 sku id", required = true) - @NotNull(message = "商品的 sku id 不能为空") - private Integer productSkuId; - - @ApiModelProperty(value = "商品 sku attrs", required = true) - @NotEmpty(message = "商品的 sku attrs 不能为空") - private String productSkuAttrs; - - @ApiModelProperty(value = "商品 sku price", required = true) - @NotNull(message = "商品的 sku price 不能为空") - private Integer productSkuPrice; - - @ApiModelProperty(value = "商品 sku url", required = true) - @NotEmpty(message = "商品的 sku url 不能为空") - private String productSkuPicUrl; - - @ApiModelProperty(value = "用户 id", required = true) - private Integer userId; - - @ApiModelProperty(value = "用户头像", required = true) - private String userAvatar; - - @ApiModelProperty(value = "用户昵称", required = true) - @NotEmpty(message = "用户昵称不能为空") - private String userNickName; - - @ApiModelProperty(value = "评价星级", required = true, example = "1-5") - private Integer star; - - @ApiModelProperty(value = "商品描述星级", required = true, example = "1-5") - private Integer productDescriptionStar; - - @ApiModelProperty(value = "物流评价星级", required = true, example = "1-5") - private Integer logisticsStar; - - @ApiModelProperty(value = "商家评价星级", required = true, example = "1-5") - private Integer merchantStar; - - @ApiModelProperty(value = "商家评价内容", required = true, example = "1-5") - private String commentContent; - - @ApiModelProperty(value = "评价图片", required = true) - private String commentPics; - -} diff --git a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/comment/UsersOrderCommentPageRequest.java b/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/comment/UsersOrderCommentPageRequest.java deleted file mode 100644 index f5c09e3a2..000000000 --- a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/comment/UsersOrderCommentPageRequest.java +++ /dev/null @@ -1,28 +0,0 @@ -package cn.iocoder.mall.order.rest.request.comment; - -import cn.iocoder.common.framework.vo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import javax.validation.constraints.NotNull; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * UsersOrderCommentPageRequest - * - * @author xiaofeng - * @version 1.0 - * @date 2020/05/20 23:21 - */ -@ApiModel("用户 - Order 模块 - 订单评论分页") -@Data -@Accessors(chain = true) -public class UsersOrderCommentPageRequest extends PageParam { - - /** - * 商品 sku id - */ - @ApiModelProperty(value = "商品 SKU id", required = true) - @NotNull(message = "商品 SKU id 不能为空") - private Integer productSkuId; -} diff --git a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/users/OrderReturnApplyRequest.java b/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/users/OrderReturnApplyRequest.java deleted file mode 100644 index adbbf143c..000000000 --- a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/users/OrderReturnApplyRequest.java +++ /dev/null @@ -1,50 +0,0 @@ -package cn.iocoder.mall.order.rest.request.users; - -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import java.io.Serializable; - -/** - * 订单售后 - * - * @author Sin - * @time 2019-04-25 20:59 - */ -@Data -@Accessors(chain = true) -public class OrderReturnApplyRequest implements Serializable { - - /** - * 订单编号 - */ - @NotNull(message = "orderId 不能为空!") - private Integer orderId; - /** - * 退款类型 - * - * - 1、退货退款 - * - 2、退款 - * - * / TODO FROM 芋艿 to xiaofeng:可以瞅瞅 @InEnum 注解,直接校验退货类型 - */ - @NotNull(message = "退货类型不能为空!") - private Integer returnType; - /** - * 退货原因(字典值) - * - * {@link cn.iocoder.mall.order.biz.constants.OrderReturnReasonEnum} - */ - @NotNull(message = "必须选择退货原因") - private Integer reason; - /** - * 原因(如果选择其他,原因保存在这) - * - * {@link cn.iocoder.mall.order.biz.constants.OrderReturnReasonEnum#REASON_000} - */ - @Size(max = 200) - private String describe; - -} diff --git a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/response/comment/UsersOrderCommentPageResponse.java b/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/response/comment/UsersOrderCommentPageResponse.java deleted file mode 100644 index 61765911a..000000000 --- a/归档/moved/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/response/comment/UsersOrderCommentPageResponse.java +++ /dev/null @@ -1,90 +0,0 @@ -package cn.iocoder.mall.order.rest.response.comment; - -import io.swagger.annotations.ApiModel; -import java.time.LocalDateTime; -import java.util.List; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * UsersOrderCommentPageResponse - * - * @author xiaofeng - * @version 1.0 - * @date 2020/05/20 23:32 - */ -@ApiModel("用户 - Order 模块 - 订单评论分页列表") -@Data -@Accessors(chain = true) -public class UsersOrderCommentPageResponse { - - /** - * 总条数 - */ - private Integer total; - - /** - * 评论列表 - */ - private List orderCommentItems; - - - @Data - @Accessors(chain = true) - @AllArgsConstructor - public static class OrderCommentItem { - - /** - * 评论 id - */ - private Integer id; - - /** - * 用户头像 - */ - private String userAvatar; - - /** - * 用户的真实姓名 - */ - private String userNickName; - - /** - * 评价星 - */ - private Integer star; - - /** - * 评论的内容 - */ - private String commentContent; - - /** - * 评论的图片地址 - */ - private String commentPics; - - /** - * 回复条数 - */ - private Integer replayCount; - - /** - * 点赞数 - */ - private Integer likeCount; - - /** - * 创建时间 - */ - private LocalDateTime createTime; - - /** - * 商家回复列表 只展示最近的一条 - */ - private String replyContent; - - } - -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/OrderCommentReplyService.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/OrderCommentReplyService.java deleted file mode 100644 index 71be604da..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/OrderCommentReplyService.java +++ /dev/null @@ -1,46 +0,0 @@ -package cn.iocoder.mall.order.api; - -import cn.iocoder.mall.order.api.bo.OrderCommentMerchantReplyBO; -import cn.iocoder.mall.order.api.bo.OrderCommentReplyCreateBO; -import cn.iocoder.mall.order.api.bo.OrderCommentReplyPageBO; -import cn.iocoder.mall.order.api.dto.OrderCommentReplyCreateDTO; -import cn.iocoder.mall.order.api.dto.OrderCommentReplyPageDTO; - -import java.util.List; - -/** - * - * 订单评论回复模块 - * - * @author wtz - * @time 2019-05-29 14:30 - * - */ -public interface OrderCommentReplyService { - - /** - * 分页获取评论回复 - * @param orderCommentReplyPageDTO - * @return - */ - OrderCommentReplyPageBO getOrderCommentReplyPage(OrderCommentReplyPageDTO orderCommentReplyPageDTO); - - - /** - * 评论回复创建 - * @param orderCommentReplyCreateDTO - * @return - */ - OrderCommentReplyCreateBO createOrderCommentReply(OrderCommentReplyCreateDTO orderCommentReplyCreateDTO); - - - /** - * 获取商家评论回复 - * @param commentId - * @return - */ - List getOrderCommentMerchantReply(Integer commentId); - - - -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/OrderCommentService.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/OrderCommentService.java deleted file mode 100644 index e60b63d3b..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/OrderCommentService.java +++ /dev/null @@ -1,68 +0,0 @@ -package cn.iocoder.mall.order.api; - -import cn.iocoder.mall.order.api.bo.*; -import cn.iocoder.mall.order.api.dto.OrderCommentCreateDTO; -import cn.iocoder.mall.order.api.dto.OrderCommentPageDTO; -import cn.iocoder.mall.order.api.dto.OrderCommentStateInfoPageDTO; -import cn.iocoder.mall.order.api.dto.OrderCommentTimeOutPageDTO; - -import java.util.Collection; -import java.util.List; - -/** - * 订单评论模块 - * - * @author wtz - * @time 2019-05-14 22:10 - */ -public interface OrderCommentService { - - /** - * 评论创建 - * @param orderCommentCreateDTO - * @return - */ - OrderCommentCreateBO createOrderComment(OrderCommentCreateDTO orderCommentCreateDTO); - - - - /** - * 获取评论列表的分页 - * @param orderCommentPageDTO - * @return - */ - OrderCommentPageBO getOrderCommentPage(OrderCommentPageDTO orderCommentPageDTO); - - - /** - * 获取评论详情 - * @param commentId - * @return - */ - OrderCommentInfoBO getOrderCommentInfo(Integer commentId); - - - /** - * 获取订单评论状态详情 - * @param orderCommentStateInfoPageDTO - * @return - */ - OrderCommentStateInfoPageBO getOrderCommentStateInfoPage(OrderCommentStateInfoPageDTO orderCommentStateInfoPageDTO); - - /** - * 获取订单评论超时分页 - * @param orderCommentTimeOutPageDTO - * @return - */ - List getOrderCommentTimeOutPage(OrderCommentTimeOutPageDTO orderCommentTimeOutPageDTO); - - - /** - * 批量更新订单评论状态 - * @param orderCommentTimeOutBOList - */ - void updateBatchOrderCommentState(List orderCommentTimeOutBOList); - - - -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/OrderLogisticsService.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/OrderLogisticsService.java deleted file mode 100644 index 18f6c72c1..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/OrderLogisticsService.java +++ /dev/null @@ -1,43 +0,0 @@ -package cn.iocoder.mall.order.api; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.order.api.bo.OrderLastLogisticsInfoBO; -import cn.iocoder.mall.order.api.bo.OrderLogisticsInfoBO; -import cn.iocoder.mall.order.api.bo.OrderLogisticsInfoWithOrderBO; - -/** - * 订单物流信息 - * - * @author Sin - * @time 2019-04-12 21:29 - */ -public interface OrderLogisticsService { - - - /** - * 获取物流信息 - 根据id - * - * @param id - * @return - */ - CommonResult getLogisticsInfo(Integer id); - - - /** - * 获取 last 物流信息 - 根据id - * - * @param id - * @return - */ - CommonResult getLastLogisticsInfo(Integer id); - - /** - * 获取物流信息 - 根据 orderId - * - * @param userId - * @param orderId - * @return - */ - CommonResult getOrderLogisticsInfo(Integer userId, Integer orderId); - -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/OrderReturnService.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/OrderReturnService.java deleted file mode 100644 index 5d3efaad0..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/OrderReturnService.java +++ /dev/null @@ -1,85 +0,0 @@ -package cn.iocoder.mall.order.api; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.order.api.bo.OrderReturnInfoBO; -import cn.iocoder.mall.order.api.bo.OrderReturnListBO; -import cn.iocoder.mall.order.api.dto.OrderReturnApplyDTO; -import cn.iocoder.mall.order.api.dto.OrderReturnQueryDTO; - -/** - * 订单退货 - * - * @author Sin - * @time 2019-03-30 15:33 - */ -public interface OrderReturnService { - - - /** - * 订单 - 退货 - * - * @param orderReturnApplyDTO - * @return - */ - CommonResult orderReturnApply(OrderReturnApplyDTO orderReturnApplyDTO); - - /** - * 更新退款成功 - * - * 如果成功,则返回 success - * 如果失败,则返回具体原因 - * - * @param orderId 订单编号 - * @param refundPrice 退款金额 - * @return 支付结果 - */ - String updateRefundSuccess(String orderId, Integer refundPrice); - - /** - * 订单申请信息 - * - * @param orderId - * @return - */ - CommonResult orderApplyInfo(Integer orderId); - - /** - * 订单退货 - 列表 - * - * @param queryDTO - * @return - */ - CommonResult orderReturnList(OrderReturnQueryDTO queryDTO); - - /** - * 订单退货 - 接受 - * - * @param id - * @return - */ - CommonResult orderReturnAgree(Integer id); - - /** - * 订单退货 - 拒绝 - * - * @param id - * @return - */ - CommonResult orderReturnRefuse(Integer id); - - /** - * 订单退货 - 确认收货 - * - * @param id - * @return - */ - CommonResult confirmReceipt(Integer id); - - /** - * 订单退货 - 确认订单 - * - * @param id - * @return - */ - CommonResult refund(Integer id, String ip); -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/OrderService.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/OrderService.java deleted file mode 100644 index f53121bd2..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/OrderService.java +++ /dev/null @@ -1,130 +0,0 @@ -package cn.iocoder.mall.order.api; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.order.api.bo.*; -import cn.iocoder.mall.order.api.dto.*; - -import java.util.List; - -/** - * 订单 service - * - * @author Sin - * @time 2019-03-16 13:15 - */ -public interface OrderService { - - /** - * 订单info - * - * @param userId - * @param orderId - * @return - */ - CommonResult info(Integer userId, Integer orderId); - - /** - * 订单item - 更新 - * - * @param orderItemUpdateDTO - * - */ - CommonResult updateOrderItem(OrderItemUpdateDTO orderItemUpdateDTO); - - /** - * 更新订单item - payAmount(实付金额) - * - * @param orderId - * @param orderItemId - * @param payAmount - * @return - */ - CommonResult updateOrderItemPayAmount(Integer orderId, Integer orderItemId, Integer payAmount); - - /** - * 订单 - 取消订单 - * - * @param orderId - * @return - */ - CommonResult cancelOrder(Integer orderId, Integer reasons, String otherReasons); - - /** - * 订单发货 - * - * @param orderDelivery - * @return - */ - CommonResult orderDelivery(OrderDeliveryDTO orderDelivery); - - /** - * 更新订单 - 备注 - * - * @param orderId - * @param remake - * @return - */ - CommonResult updateOrderRemake(Integer orderId, String remake); - - /** - * 删除订单item - * - * @param orderItemDeletedDTO - * @return - */ - CommonResult deleteOrderItem(OrderItemDeletedDTO orderItemDeletedDTO); - - /** - * 用户确认订单 - * - * @param userId - * @param orderId - * @return - */ - CommonResult confirmReceiving(Integer userId, Integer orderId); - - /** - * 更新订单 - 收件这信息 - * - * 包含: - * - 详细地址 - * - 区域编号 - * - 联系人电话 - * - 联系人姓名 - */ - CommonResult updateLogistics(OrderLogisticsUpdateDTO orderLogisticsDTO); - - /** - * 删除订单 // TODO FROM 芋艿 to 小范。删除订单,不要使用 deleted 字段,对于用户是删除,实际是隐藏。 - * - * @param id - */ - CommonResult deleteOrder(Integer id); - - /** - * 更新订单支付成功 - * - * 如果成功,则返回 success - * 如果失败,则返回具体原因 - * - * @param orderId 订单编号 - * @param payAmount 支付的订单金额 - * @return 支付结果 - */ - String updatePaySuccess(String orderId, Integer payAmount); - - /** - * 监听确认收货 - * - * mq 更新 status - */ - CommonResult listenerConfirmGoods(); - - /** - * 监听换货 - * - * mq 更新 status - */ - CommonResult listenerExchangeGoods(); - -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentBO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentBO.java deleted file mode 100644 index 4f016c54c..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentBO.java +++ /dev/null @@ -1,86 +0,0 @@ -package cn.iocoder.mall.order.api.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * - * 订单评价 - * - * @author wtz - * @time 2019-05-14 20:00:00 - */ -@Data -@Accessors(chain = true) -public class OrderCommentBO implements Serializable { - - /** - * 总条数 - */ - private Integer total; - - /** - * 好评 - */ - private Integer positiveTotal; - - /** - * 中评 - */ - private Integer moderateTotal; - - /** - * 差评 - */ - private Integer negativeTotal; - - /** - * 评论 id - */ - private Integer id; - - /** - * 用户头像 - */ - private String userAvatar; - - /** - * 用户的真实姓名 - */ - private String userNickName; - - /** - * 评价星 - */ - private Integer star; - - /** - * 评论的内容 - */ - private String commentContent; - - /** - * 评论的图片地址 - */ - private String commentPics; - - /** - * 回复条数 - */ - private Integer replayCount; - - /** - * 点赞数 - */ - private Integer collectCount; - - /** - * 创建时间 - */ - private LocalDateTime createTime; - - -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentCreateBO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentCreateBO.java deleted file mode 100644 index 92aa08d63..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentCreateBO.java +++ /dev/null @@ -1,25 +0,0 @@ -package cn.iocoder.mall.order.api.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * - * 订单评论创建 - * - * @author wtz - * @time 2019-05-19 18:32 - * - */ -@Data -@Accessors(chain = true) -public class OrderCommentCreateBO implements Serializable { - - /** - * 订单评论 id - */ - private Integer id; - -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentInfoAndMerchantReplyBO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentInfoAndMerchantReplyBO.java deleted file mode 100644 index 467232260..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentInfoAndMerchantReplyBO.java +++ /dev/null @@ -1,29 +0,0 @@ -package cn.iocoder.mall.order.api.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.List; - -/** - * - * 评论详情和商家评论回复 - * - * @author wtz - * @time 2019-06-03 20:30 - */ -@Data -@Accessors(chain = true) -public class OrderCommentInfoAndMerchantReplyBO { - - /** - * 评论详情 - */ - private OrderCommentInfoBO orderCommentInfoBO; - - /** - * 商家评论回复 - */ - private List orderCommentMerchantReplyBOS; - -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentInfoBO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentInfoBO.java deleted file mode 100644 index 991743fff..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentInfoBO.java +++ /dev/null @@ -1,84 +0,0 @@ -package cn.iocoder.mall.order.api.bo; - - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * - * 订单回复评价详情 - * - * @author wtz - * @time 2019-05-16 18:40 - * - */ -@Data -@Accessors(chain = true) -public class OrderCommentInfoBO implements Serializable { - - /** - * 评论 id - */ - private Integer id; - - /** - * 用户头像 - */ - private String userAvatar; - - /** - * 用户昵称 - */ - private String userNickName; - - /** - * 评价星 - */ - private Integer star; - - /** - * 评论的内容 - */ - private String commentContent; - - /** - * 评论的图片地址 - */ - private String commentPics; - - - /** - * 点赞数 - */ - private Integer likeCount; - - /** - * 创建时间 - */ - private LocalDateTime createTime; - - /** - * 商品 sku id - */ - private int productSkuId; - - /** - * 商品 sku 属性 - */ - private String productSkuAttrs; - - /** - * 商品 sku 价格 - */ - private String productSkuPrice; - - /** - * 商品 sku 地址 - */ - private String productSkuPicUrl; - - -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentMerchantReplyBO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentMerchantReplyBO.java deleted file mode 100644 index 85d86b744..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentMerchantReplyBO.java +++ /dev/null @@ -1,21 +0,0 @@ -package cn.iocoder.mall.order.api.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * - * 商家评论回复 - * - * @author wtz - * @time 2019-06-03 19:30 - */ -@Data -@Accessors(chain = true) -public class OrderCommentMerchantReplyBO { - - /** - * 商家评论回复 - */ - private String replyContent; -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentPageBO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentPageBO.java deleted file mode 100644 index e16514b5d..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentPageBO.java +++ /dev/null @@ -1,107 +0,0 @@ -package cn.iocoder.mall.order.api.bo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; -import java.util.List; - - -/** - * - * 订单评论分页展示 - * - * @author wtz - * @time 2019-05-14 20:00:00 - */ -@Data -@Accessors(chain = true) -public class OrderCommentPageBO implements Serializable { - - /** - * 总条数 - */ - private Integer total; - -// 评论标签化等等在做 -// /** -// * 好评 -// */ -// private Integer positiveTotal; -// -// /** -// * 中评 -// */ -// private Integer moderateTotal; -// -// /** -// * 差评 -// */ -// private Integer negativeTotal; - - /** - * 评论列表 - */ - private List orderCommentItems; - - - @Data - @Accessors(chain = true) - @AllArgsConstructor - public static class OrderCommentItem{ - /** - * 评论 id - */ - private Integer id; - - /** - * 用户头像 - */ - private String userAvatar; - - /** - * 用户的真实姓名 - */ - private String userNickName; - - /** - * 评价星 - */ - private Integer star; - - /** - * 评论的内容 - */ - private String commentContent; - - /** - * 评论的图片地址 - */ - private String commentPics; - - /** - * 回复条数 - */ - private Integer replayCount; - - /** - * 点赞数 - */ - private Integer likeCount; - - /** - * 创建时间 - */ - private LocalDateTime createTime; - - /** - * 商家回复列表 - * 只展示最近的一条 - */ - private String replyContent; - - } - -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentReplyCreateBO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentReplyCreateBO.java deleted file mode 100644 index 453aeb04c..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentReplyCreateBO.java +++ /dev/null @@ -1,24 +0,0 @@ -package cn.iocoder.mall.order.api.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * - * 订单回复创建 - * - * @author wtz - * @time 2019-05-19 18:35 - */ -@Data -@Accessors(chain = true) -public class OrderCommentReplyCreateBO implements Serializable { - - - /** - * 评论回复 id - */ - private Integer id; -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentReplyPageBO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentReplyPageBO.java deleted file mode 100644 index ca216e4b7..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentReplyPageBO.java +++ /dev/null @@ -1,83 +0,0 @@ -package cn.iocoder.mall.order.api.bo; - - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; -import java.util.List; - -/** - * - * 评论回复分页展示 - * - * @author wtz - * @time 2019-05-19 14:19 - * - */ -@Data -@Accessors(chain = true) -public class OrderCommentReplyPageBO implements Serializable { - - /** - * 评论回复总数 - */ - private Integer total; - - /** - * 用户回复 - */ - List orderCommentReplayItems; - - - @Data - @Accessors(chain = true) - public static class OrderCommentReplayItem{ - /** - * 回复 id - */ - private Integer id; - - /** - * 回复的类型 - */ - private Integer replyType; - - /** - * 回复的内容 - */ - private String replyContent; - - /** - * 回复的用户 id - */ - private int replyUserId; - - /** - * 回复用户的真实姓名 - */ - private String replyUserNickName; - - /** - * 回复用户的头像 - */ - private String replyUserAvatar; - - /** - * 回复的点赞数 - */ - private int replyCollectCount; - - /** - * 回复目标用户昵称 - */ - private String parentUserNickName; - - /** - * 创建时间 - */ - private LocalDateTime createTime; - - } -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentStateInfoPageBO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentStateInfoPageBO.java deleted file mode 100644 index 4bd4ca506..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentStateInfoPageBO.java +++ /dev/null @@ -1,87 +0,0 @@ -package cn.iocoder.mall.order.api.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; -import java.util.List; - -/** - * - * 订单评论状态详情分页(这么设计因为这个接口需要登陆以后才能看到所以与订单分页接口分开) - * - * @author wtz - * @time 2019-06-07 10:39 - */ -@Data -@Accessors(chain = true) -public class OrderCommentStateInfoPageBO implements Serializable { - - /** - * (待/已)评论总数 - */ - private Integer total; - - /** - * 评论状态 - */ - private List orderCommentStateInfoItems; - - @Data - @Accessors(chain = true) - public static class OrderCommentStateInfoItem{ - - /** - * 订单 id - */ - private Integer orderId; - - /** - * 订单编号 - */ - private String orderNo; - - /** - * 商品 id - */ - private Integer productSpuId; - - /** - * 商品名称 - */ - private String productSpuName; - - /** - * 商品 sku id - */ - private Integer productSkuId; - - /** - * 商品 sku 属性 - */ - private String productSkuAttrs; - - /** - * 商品 sku 价格 - */ - private Integer productSkuPrice; - - /** - * 商品 sku url - */ - private String productSkuPicUrl; - - /** - * 订单评论状态 - */ - private Integer commentState; - - /** - * 创建时间 - */ - private LocalDateTime createTime; - } - - -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentTimeOutBO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentTimeOutBO.java deleted file mode 100644 index d3c680767..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentTimeOutBO.java +++ /dev/null @@ -1,25 +0,0 @@ -package cn.iocoder.mall.order.api.bo; - -import lombok.Data; -import lombok.experimental.Accessors; -import org.springframework.beans.factory.annotation.Autowired; - -import java.io.Serializable; - - -/** - * 订单评论超时 - * - * @author wtz - * @time 2019-06-15 13:52 - */ -@Data -@Accessors(chain = true) -public class OrderCommentTimeOutBO implements Serializable { - - /** - * 评论 id - */ - private Integer id; - -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderLastLogisticsInfoBO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderLastLogisticsInfoBO.java deleted file mode 100644 index 0ff7c5a0b..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderLastLogisticsInfoBO.java +++ /dev/null @@ -1,85 +0,0 @@ -package cn.iocoder.mall.order.api.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; -import java.util.List; - -/** - * 订单物流 - 最后一个物流信息 - * - * @author Sin - * @time 2019-04-12 22:03 - */ -@Data -@Accessors(chain = true) -public class OrderLastLogisticsInfoBO implements Serializable { - - /** - * id - */ - private Integer id; - /** - * 收件区域编号 - */ - private String areaNo; - /** - * 收件人名称 - */ - private String name; - /** - * 收件手机号 - */ - private String mobile; - /** - * 收件详细地址 - */ - private String address; - /** - * 物流 (字典) - */ - private Integer logistics; - /** - * 物流 (字典) 转换后的值 - */ - private String logisticsText; - /** - * 物流编号 - */ - private String logisticsNo; - - /// - /// 物流信息 - - /** - * 最后一个物流信息 - */ - private LogisticsDetail lastLogisticsDetail; - - @Data - @Accessors(chain = true) - public static class LogisticsDetail { - /** - * id - */ - private Integer id; - /** - * 物流id - */ - private Integer orderLogisticsId; - /** - * 物流时间 - */ - private LocalDateTime logisticsTime; - /** - * 物流时间 text - */ - private String logisticsTimeText; - /** - * 物流信息 - */ - private String logisticsInformation; - } -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderLogisticsBO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderLogisticsBO.java deleted file mode 100644 index 4d617dcce..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderLogisticsBO.java +++ /dev/null @@ -1,41 +0,0 @@ -package cn.iocoder.mall.order.api.bo; - -import cn.iocoder.common.framework.dataobject.BaseDO; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 订单物流信息 - * - * @author Sin - * @time 2019-03-19 20:47 - */ -@Data -@Accessors(chain = true) -public class OrderLogisticsBO extends BaseDO { - - /** - * id - */ - private Integer id; - /** - * 收件区域编号 - */ - private String areaNo; - /** - * 收件人名称 - */ - private String name; - /** - * 收件手机号 - */ - private String mobile; - /** - * 收件详细地址 - */ - private String address; - /** - * 物流编号 - */ - private String logisticsNo; -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderLogisticsInfoBO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderLogisticsInfoBO.java deleted file mode 100644 index 42dc60c5d..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderLogisticsInfoBO.java +++ /dev/null @@ -1,82 +0,0 @@ -package cn.iocoder.mall.order.api.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; -import java.util.List; - -/** - * 订单物流 - 详细信息 - * - * @author Sin - * @time 2019-04-12 22:03 - */ -@Data -@Accessors(chain = true) -public class OrderLogisticsInfoBO implements Serializable { - - /** - * id - */ - private Integer id; - /** - * 收件区域编号 - */ - private String areaNo; - /** - * 收件人名称 - */ - private String name; - /** - * 收件手机号 - */ - private String mobile; - /** - * 收件详细地址 - */ - private String address; - /** - * 物流 (字典) - */ - private Integer logistics; - /** - * 物流 (字典) 转换后的值 - */ - private String logisticsText; - /** - * 物流编号 - */ - private String logisticsNo; - - /// - /// 物流信息 - - private List details; - - @Data - @Accessors(chain = true) - public static class LogisticsDetail { - /** - * id - */ - private Integer id; - /** - * 物流id - */ - private Integer orderLogisticsId; - /** - * 物流时间 - */ - private LocalDateTime logisticsTime; - /** - * 物流时间 text - */ - private String logisticsTimeText; - /** - * 物流信息 - */ - private String logisticsInformation; - } -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderLogisticsInfoWithOrderBO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderLogisticsInfoWithOrderBO.java deleted file mode 100644 index f1171a077..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderLogisticsInfoWithOrderBO.java +++ /dev/null @@ -1,100 +0,0 @@ -package cn.iocoder.mall.order.api.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; -import java.util.List; - -/** - * 订单物流 - 详细信息 - * - * @author Sin - * @time 2019-04-12 22:03 - */ -@Data -@Accessors(chain = true) -public class OrderLogisticsInfoWithOrderBO implements Serializable { - - /** - * 订单id - */ - private Integer orderId; - /** - * 订单编号 - */ - private String orderNo; - /** - * 物流信息 - */ - private List logistics; - - @Data - @Accessors(chain = true) - public static class Logistics { - - /** - * id - */ - private Integer id; - /** - * 收件区域编号 - */ - private String areaNo; - /** - * 收件人名称 - */ - private String name; - /** - * 收件手机号 - */ - private String mobile; - /** - * 收件详细地址 - */ - private String address; - /** - * 物流 (字典) - */ - private Integer logistics; - /** - * 物流 (字典) 转换后的值 - */ - private String logisticsText; - /** - * 物流编号 - */ - private String logisticsNo; - - /// - /// 物流信息 - - private List details; - } - - @Data - @Accessors(chain = true) - public static class LogisticsDetail { - /** - * id - */ - private Integer id; - /** - * 物流id - */ - private Integer orderLogisticsId; - /** - * 物流时间 - */ - private LocalDateTime logisticsTime; - /** - * 物流时间 text - */ - private String logisticsTimeText; - /** - * 物流信息 - */ - private String logisticsInformation; - } -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderReturnInfoBO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderReturnInfoBO.java deleted file mode 100644 index 14f594afa..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderReturnInfoBO.java +++ /dev/null @@ -1,141 +0,0 @@ -package cn.iocoder.mall.order.api.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; -import java.util.List; - -/** - * 订单退货 info - * - * @author Sin - * @time 2019-04-27 10:19 - */ -@Data -@Accessors(chain = true) -public class OrderReturnInfoBO implements Serializable { - - /** - * 退货信息 - */ - private ReturnInfo returnInfo; - /** - * 订单 item - */ - private List orderItems; - /** - * 最后一个物流信息/最新物流信息 - */ - private OrderLastLogisticsInfoBO lastLogisticsInfo; - - @Data - @Accessors(chain = true) - public static class OrderItem { - - /** - * 商品编号 - */ - private Integer skuId; - /** - * 商品名称 - */ - private String skuName; - /** - * 商品图片 - */ - private String skuImage; - /** - * 数量 - */ - private Integer quantity; - /** - * 最终总金额,单位:分。 - */ - private Integer presentTotal; - } - - @Data - @Accessors(chain = true) - public static class ReturnInfo { - - /** - * 编号自动增长 - */ - private Integer id; - /** - * 服务号 - */ - private String serviceNumber; - /** - * 订单编号 - */ - private Integer orderId; - /** - * 订单号 (保存一个冗余) - */ - private String orderNo; - /** - * 物流id - */ - private Integer orderLogisticsId; - - /// - /// 退货原因 - - /** - * 退货金额 - */ - private Integer refundPrice; - /** - * 退货原因(字典值) - */ - private Integer reason; - /** - * 问题描述 - */ - private String describe; - - /// - /// 时间信息 - - /** - * 同意时间 - */ - private LocalDateTime approvalTime; - /** - * 物流时间(填写物流单号时间) - */ - private LocalDateTime logisticsTime; - /** - * 收货时间 - */ - private LocalDateTime receiverTime; - /** - * 成交时间(确认时间) - */ - private LocalDateTime closingTime; - /** - * 退款类型 - * - * - 1、退货退款 - * - 2、退款 - */ - private Integer serviceType; - /** - * 退款类型 转换值 - */ - private String serviceTypeText; - /** - * 状态 - * - * - 1、退货申请 - * - 2、申请成功 - * - 3、申请失败 - * - 4、退货中 - * - 5、退货成功 - */ - private Integer status; - } -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderReturnListBO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderReturnListBO.java deleted file mode 100644 index 766fbfc24..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/bo/OrderReturnListBO.java +++ /dev/null @@ -1,124 +0,0 @@ -package cn.iocoder.mall.order.api.bo; - -import cn.iocoder.common.framework.dataobject.BaseDO; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; -import java.util.List; - -/** - * 订单退货 list - * - * @author Sin - * @time 2019-05-06 21:54 - */ -@Data -@Accessors(chain = true) -public class OrderReturnListBO implements Serializable { - - /** - * 分页当前 index - */ - private Integer index; - /** - * pageSize - */ - private Integer pageSize; - /** - * totalCount - */ - private Integer totalCount; - /** - * data - */ - private List data; - - @Data - @Accessors(chain = true) - public static class OrderReturn { - - /** - * 编号自动增长 - */ - private Integer id; - /** - * 服务号 - */ - private String serviceNumber; - /** - * 订单编号 - */ - private Integer orderId; - /** - * 订单号 (保存一个冗余) - */ - private String orderNo; - /** - * 物流id - */ - private Integer orderLogisticsId; - - /// - /// 退货原因 - - /** - * 退货金额 - */ - private Integer refundPrice; - /** - * 退货原因(字典值) - */ - private Integer reason; - /** - * 问题描述 - */ - private String describe; - - /// - /// 时间信息 - - /** - * 同意时间 - */ - private LocalDateTime approvalTime; - /** - * 物流时间(填写物流单号时间) - */ - private LocalDateTime logisticsTime; - /** - * 收货时间 - */ - private LocalDateTime receiverTime; - /** - * 成交时间(确认时间) - */ - private LocalDateTime closingTime; - /** - * 服务类型 - * - * - 1、退货退款 - * - 2、退款 - */ - private Integer serviceType; - /** - * 状态 - * - * - 1、退货申请 - * - 2、申请成功 - * - 3、申请失败 - * - 4、退货中 - * - 5、退货成功 - */ - private Integer status; - /** - * 创建时间 - */ - private LocalDateTime createTime; - /** - * 更新时间 - */ - private LocalDateTime updateTime; - } -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/DictKeyConstants.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/DictKeyConstants.java deleted file mode 100644 index fc7d901d9..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/DictKeyConstants.java +++ /dev/null @@ -1,27 +0,0 @@ -package cn.iocoder.mall.order.api.constant; - -/** - * 字典 keys 定义 - * - * @author Sin - * @time 2019-04-14 17:46 - */ -public class DictKeyConstants { - - /** - * 订单 - status - */ - public static final String ORDER_STATUS = "order_status"; - /** - * 订单 - 物流商家 - */ - public static final String ORDER_LOGISTICS_COMPANY = "logistics_company"; - /** - * 订单 - 退货原因 - */ - public static final String ORDER_RETURN_REASON = "order_return_reason"; - /** - * 订单退货 - 退货类型 - */ - public static final String ORDER_RETURN_SERVICE_TYPE = "order_return_service_type"; -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/MQConstants.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/MQConstants.java deleted file mode 100644 index d6a656fe1..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/MQConstants.java +++ /dev/null @@ -1,15 +0,0 @@ -package cn.iocoder.mall.order.api.constant; - -/** - * MQ 订阅消息 - * - * @author Sin - * @time 2019-03-16 15:04 - */ -public class MQConstants { - - /** - * 订单 - 创建成功 消息 - */ - public static final String ORDER_CREATE_SUCCESS = "order.orderCreateSuccess"; -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderCancelReasonsEnum.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderCancelReasonsEnum.java deleted file mode 100644 index 21967208f..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderCancelReasonsEnum.java +++ /dev/null @@ -1,54 +0,0 @@ -package cn.iocoder.mall.order.api.constant; - -/** - * 订单取消原因 - * order_cancel_reasons - * @author Sin - * @time 2019-03-30 15:08 - */ -public enum OrderCancelReasonsEnum { - - CANCEL_1(1, "无法联系上买家"), - CANCEL_2(2, "买家误拍或重拍了"), - CANCEL_3(3, "买家无诚意完成交易"), - CANCEL_4(4, "已通过银行线下汇款"), - CANCEL_5(5, "已通过同城见面交易"), - CANCEL_6(6, "已通过货到付款交易"), - CANCEL_7(7, "已通过网上银行直接汇款"), - CANCEL_8(8, "已经缺货无法交易"), - CANCEL_20(20, "其他"), - ; - - // 无法联系上买家 - // 买家误拍或重拍了 - // 买家无诚意完成交易 - // 已通过银行线下汇款 - // 已通过同城见面交易 - // 已通过货到付款交易 - // 已通过网上银行直接汇款 - // 已经缺货无法交易 - - private final int code; - private final String message; - - OrderCancelReasonsEnum(int code, String message) { - this.code = code; - this.message = message; - } - - @Override - public String toString() { - return "OrderCancelEnum{" + - "code=" + code + - ", message='" + message + '\'' + - '}'; - } - - public int getCode() { - return code; - } - - public String getMessage() { - return message; - } -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderCommentRelpyTypeEnum.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderCommentRelpyTypeEnum.java deleted file mode 100644 index c42f05bce..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderCommentRelpyTypeEnum.java +++ /dev/null @@ -1,35 +0,0 @@ -package cn.iocoder.mall.order.api.constant; - -/** - * - * 评论回复类型 - * - * @author wtz - * @time 2019-06-01 10:30:00 - */ -public enum OrderCommentRelpyTypeEnum { - - REPLY_REPLY(0, "回复的回复"), - COMMENT_REPLY(1, "评论的回复"); - /** - * 状态值 - */ - private Integer value; - /** - * 状态名 - */ - private String name; - - OrderCommentRelpyTypeEnum(Integer value, String name) { - this.value = value; - this.name = name; - } - - public Integer getValue() { - return value; - } - - public String getName() { - return name; - } -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderCommentStatusEnum.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderCommentStatusEnum.java deleted file mode 100644 index 71decf7bf..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderCommentStatusEnum.java +++ /dev/null @@ -1,34 +0,0 @@ -package cn.iocoder.mall.order.api.constant; - -/** - * 订单评论状态 - * - * @author wtz - * @time 2019-06-15 14:26 - */ -public enum OrderCommentStatusEnum { - - WAIT_COMMENT(0, "待评论"), - SUCCESS_COMMENT(1, "评论成功"); - /** - * 状态值 - */ - private Integer value; - /** - * 状态名 - */ - private String name; - - OrderCommentStatusEnum(Integer value, String name) { - this.value = value; - this.name = name; - } - - public Integer getValue() { - return value; - } - - public String getName() { - return name; - } -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderHasReturnExchangeEnum.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderHasReturnExchangeEnum.java deleted file mode 100644 index 084509868..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderHasReturnExchangeEnum.java +++ /dev/null @@ -1,37 +0,0 @@ -package cn.iocoder.mall.order.api.constant; - -/** - * 订单 - 是否退换货状态 - * - * @author Sin - * @time 2019-03-22 21:34 - */ -public enum OrderHasReturnExchangeEnum { - - NO(1, "没有"), - RETURN_GOODS(2, "退货"), - EXCHANGE_GOODS(3, "换货"), - RETURN_EXCHANGE_GOODS(4, "退换货"); - - /** - * 状态值 - */ - private Integer value; - /** - * 状态名 - */ - private String name; - - OrderHasReturnExchangeEnum(Integer value, String name) { - this.value = value; - this.name = name; - } - - public Integer getValue() { - return value; - } - - public String getName() { - return name; - } -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderPayStatus.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderPayStatus.java deleted file mode 100644 index b33384873..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderPayStatus.java +++ /dev/null @@ -1,34 +0,0 @@ -package cn.iocoder.mall.order.api.constant; - -/** - * 订单状态 status - * - * @author Sin - * @time 2019-03-16 14:32 - */ -public enum OrderPayStatus { - - WAITING_PAYMENT(0, "等待支付"), - SUCCESSFUL_PAYMENT(1, "支付成功"), - REFUND_PAYMENT(2, "退款成功"), - - ; - - - private final int value; - - private final String name; - - OrderPayStatus(int value, String name) { - this.value = value; - this.name = name; - } - - public int getValue() { - return value; - } - - public String getName() { - return name; - } -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderReplyUserTypeEnum.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderReplyUserTypeEnum.java deleted file mode 100644 index f22acdec1..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderReplyUserTypeEnum.java +++ /dev/null @@ -1,36 +0,0 @@ -package cn.iocoder.mall.order.api.constant; - -/** - * - * 评论回复 - 回复的用户的类型 - * - * @author wtz - * @time 2019-05-19 15:19 - */ -public enum OrderReplyUserTypeEnum { - - USER(0, "普通用户"), - MERCHANT(1, "商家"); - /** - * 状态值 - */ - private Integer value; - /** - * 状态名 - */ - private String name; - - OrderReplyUserTypeEnum(Integer value, String name) { - this.value = value; - this.name = name; - } - - public Integer getValue() { - return value; - } - - public String getName() { - return name; - } - -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderReturnServiceTypeEnum.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderReturnServiceTypeEnum.java deleted file mode 100644 index 0be9ebbbb..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderReturnServiceTypeEnum.java +++ /dev/null @@ -1,36 +0,0 @@ -package cn.iocoder.mall.order.api.constant; - -/** - * 订单退货 - returnType - * - * @author Sin - * @time 2019-04-27 11:53 - */ -public enum OrderReturnServiceTypeEnum { - - /** - * 状态 - * - * - 1、退货退款 - * - 2、退款 - */ - RETURN_REFUND(1, "退货退款"), - REFUND(2, "退款") - ; - private final int value; - - private final String name; - - OrderReturnServiceTypeEnum(int value, String name) { - this.value = value; - this.name = name; - } - - public int getValue() { - return value; - } - - public String getName() { - return name; - } -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderReturnStatusEnum.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderReturnStatusEnum.java deleted file mode 100644 index b1b9f0e8f..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderReturnStatusEnum.java +++ /dev/null @@ -1,45 +0,0 @@ -package cn.iocoder.mall.order.api.constant; - -/** - * 订单退货 status - * - * @author Sin - * @time 2019-03-30 15:56 - */ -public enum OrderReturnStatusEnum { - - /** - * 状态 - * - * - 1、退货申请 - * - 2、申请成功 - * - 3、申请失败 - * - 4、退货中 - * - 5、已收货 - * - 6、拒绝退款 - */ - RETURN_APPLICATION(1, "退货申请"), - APPLICATION_SUCCESSFUL(2, "申请成功"), - APPLICATION_FAIL(3, "申请失败"), - RETURN_IN(4, "退货中"), - ORDER_RECEIPT(5, "确认收货"), - RETURN_SUCCESS(6, "退货成功"), - ; - private final int value; - - private final String name; - - OrderReturnStatusEnum(int value, String name) { - this.value = value; - this.name = name; - } - - public int getValue() { - return value; - } - - public String getName() { - return name; - } - -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderReturnTypeEnum.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderReturnTypeEnum.java deleted file mode 100644 index e4e72a5d5..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderReturnTypeEnum.java +++ /dev/null @@ -1,31 +0,0 @@ -package cn.iocoder.mall.order.api.constant; - -/** - * 订单退货 类型 - * - * @author Sin - * @time 2019-03-30 15:42 - */ -public enum OrderReturnTypeEnum { - - ORDER(1, "订单"), - ORDER_ITEM(2, "订单item"), - ; - - private final int value; - - private final String name; - - OrderReturnTypeEnum(int value, String name) { - this.value = value; - this.name = name; - } - - public int getValue() { - return value; - } - - public String getName() { - return name; - } -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentCreateDTO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentCreateDTO.java deleted file mode 100644 index 55b09d4b1..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentCreateDTO.java +++ /dev/null @@ -1,84 +0,0 @@ -package cn.iocoder.mall.order.api.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import java.io.Serializable; - -/** - * 订单评论创建 - * - * @author wtz - * @time 2019-05-15 20:42 - * - */ -@ApiModel("订单创建 DTO") -@Data -@Accessors(chain = true) -public class OrderCommentCreateDTO implements Serializable { - - - @ApiModelProperty(value = "订单 id", required = true) - @NotNull(message = "订单 id 不能为空") - private Integer orderId; - - @ApiModelProperty(value = "订单编号", required = true) - @NotEmpty(message = "订单编号不能为空") - private String orderNo; - - @ApiModelProperty(value = "商品 spu id", required = true) - @NotNull(message = "商品的 spu id 不能为空") - private Integer productSpuId; - - @ApiModelProperty(value = "商品 spu name", required = true) - @NotEmpty(message = "商品的 spu name 不能为空") - private String productSpuName; - - @ApiModelProperty(value = "商品 sku id", required = true) - @NotNull(message = "商品的 sku id 不能为空") - private Integer productSkuId; - - @ApiModelProperty(value = "商品 sku attrs", required = true) - @NotEmpty(message = "商品的 sku attrs 不能为空") - private String productSkuAttrs; - - @ApiModelProperty(value = "商品 sku price", required = true) - @NotNull(message = "商品的 sku price 不能为空") - private Integer productSkuPrice; - - @ApiModelProperty(value = "商品 sku url", required = true) - @NotEmpty(message = "商品的 sku url 不能为空") - private String productSkuPicUrl; - - @ApiModelProperty(value = "用户 id", required = true) - private Integer userId; - - @ApiModelProperty(value = "用户头像", required = true) - private String userAvatar; - - @ApiModelProperty(value = "用户昵称", required = true) - @NotEmpty(message = "用户昵称不能为空") - private String userNickName; - - @ApiModelProperty(value = "评价星级", required = true,example = "1-5") - private Integer star; - - @ApiModelProperty(value = "商品描述星级", required = true,example = "1-5") - private Integer productDescriptionStar; - - @ApiModelProperty(value = "物流评价星级", required = true,example = "1-5") - private Integer logisticsStar; - - @ApiModelProperty(value = "商家评价星级", required = true,example = "1-5") - private Integer merchantStar; - - @ApiModelProperty(value = "商家评价内容", required = true,example = "1-5") - private String commentContent; - - @ApiModelProperty(value = "评价图片", required = true) - private String commentPics; -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentPageDTO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentPageDTO.java deleted file mode 100644 index 3d465ba1a..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentPageDTO.java +++ /dev/null @@ -1,32 +0,0 @@ -package cn.iocoder.mall.order.api.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * - * 订单评论 query - * - */ -@Data -@Accessors(chain = true) -public class OrderCommentPageDTO implements Serializable { - - /** - * 商品 sku id - */ - private Integer productSkuId; - - /** - * 页码 - */ - private Integer pageNo; - - /** - * 每页条数 - */ - private Integer pageSize; - -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentReplyCreateDTO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentReplyCreateDTO.java deleted file mode 100644 index a986b262d..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentReplyCreateDTO.java +++ /dev/null @@ -1,70 +0,0 @@ -package cn.iocoder.mall.order.api.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * - * 订单回复评论创建 - * - * @author wtz - * @time 2019-05-16 19:07 - * - */ -@Data -@Accessors(chain = true) -public class OrderCommentReplyCreateDTO implements Serializable { - - /** - * 评论 id - */ - private Integer commentId; - - /** - * 评论目标对象 id - */ - private Integer parentId; - - /** - * 评论目标用户 id - */ - private Integer parentUserId; - - /** - * 评论目标用户昵称 - */ - private String parentUserNickName; - - /** - * 评论目标用户头像 - */ - private String parentUserAvatar; - - /** - * 回复内容 - */ - private String replyContent; - - /** - * 回复用户 id - */ - private Integer replyUserId; - - /** - * 回复用户昵称 - */ - private String replyUserNickName; - - /** - * 回复用户头像 - */ - private String replyUserAvatar; - - /** - * 回复用户类型 - */ - private Integer userType; - -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentReplyPageDTO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentReplyPageDTO.java deleted file mode 100644 index 5e15f0bd6..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentReplyPageDTO.java +++ /dev/null @@ -1,41 +0,0 @@ -package cn.iocoder.mall.order.api.dto; - - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * - * 订单评论信息详情 query - * - * @author wtz - * @time 2019-05-19 10:16 - */ -@Data -@Accessors(chain = true) -public class OrderCommentReplyPageDTO implements Serializable { - - /** - * 评论 id - */ - private Integer commentId; - - /** - * 用户类型 - */ - private Integer userType; - - /** - * 页码 - */ - private Integer pageNo; - - /** - * 每页条数 - */ - private Integer pageSize; - -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentStateInfoPageDTO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentStateInfoPageDTO.java deleted file mode 100644 index b9618594d..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentStateInfoPageDTO.java +++ /dev/null @@ -1,38 +0,0 @@ -package cn.iocoder.mall.order.api.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * - * 订单评论状态分页信息 query - * - * @author wtz - * @time 2019-06-07 10:45 - */ -@Data -@Accessors(chain = true) -public class OrderCommentStateInfoPageDTO implements Serializable { - - /** - * 用户 id - */ - private Integer userId; - - /** - * 评论状态 - */ - private Integer commentState; - - /** - * 页码 - */ - private Integer pageNo; - - /** - * 每页条数 - */ - private Integer pageSize; -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentTimeOutPageDTO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentTimeOutPageDTO.java deleted file mode 100644 index b956efc26..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentTimeOutPageDTO.java +++ /dev/null @@ -1,36 +0,0 @@ -package cn.iocoder.mall.order.api.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * 订单评论超时 - * - * @author wtz - * @time 2019-06-15 10:59 - */ -@Data -@Accessors(chain = true) -public class OrderCommentTimeOutPageDTO implements Serializable { - /** - * 超过的天数 - */ - private Integer overDay; - - /** - * 评论的状态 - */ - private Integer commentState; - - /** - * 页码 - */ - private Integer pageNo; - - /** - * 每页条数 - */ - private Integer pageSize; -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderDeliveryDTO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderDeliveryDTO.java deleted file mode 100644 index 589d1ac86..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderDeliveryDTO.java +++ /dev/null @@ -1,41 +0,0 @@ -package cn.iocoder.mall.order.api.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.List; - -/** - * 订单发货 - * - * @author Sin - * @time 2019-03-30 22:31 - */ -@Data -@Accessors(chain = true) -public class OrderDeliveryDTO implements Serializable { - - /** - * 订单id - */ - private Integer orderId; - // TODO 芋艿,物流方式。会存在无需物流的情况 - /** - * 物流公司 (字典) - */ - private Integer logistics; - /** - * 物流单编号 - */ - private String logisticsNo; - - /// - /// 物理信息是跟 orderItem 走 - - /** - * 订单 orderItemId - */ - private List orderItemIds; - -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderItemDeletedDTO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderItemDeletedDTO.java deleted file mode 100644 index 8486c1865..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderItemDeletedDTO.java +++ /dev/null @@ -1,25 +0,0 @@ -package cn.iocoder.mall.order.api.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.List; - -/** - * @author Sin - * @time 2019-03-23 10:22 - */ -@Data -@Accessors(chain = true) -public class OrderItemDeletedDTO implements Serializable { - - /** - * 订单id - */ - private Integer orderId; - /** - * 订单item id - */ - private List orderItemIds; -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderItemUpdateDTO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderItemUpdateDTO.java deleted file mode 100644 index 6748e5be9..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderItemUpdateDTO.java +++ /dev/null @@ -1,40 +0,0 @@ -package cn.iocoder.mall.order.api.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; -import java.io.Serializable; - -/** - * 订单更新 - * - * @author Sin - * @time 2019-03-16 14:46 - */ -@Data -@Accessors(chain = true) -public class OrderItemUpdateDTO implements Serializable { - - /** - * 编号 - */ - @NotNull - private Integer id; - /** - * 商品编号 - */ - @NotNull - private Integer skuId; - /** - * 数量 - */ - @NotNull - private Integer quantity; - /** - * 金额(分) - */ - @NotNull - private Integer price; - -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderLogisticsUpdateDTO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderLogisticsUpdateDTO.java deleted file mode 100644 index 246d2fc91..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderLogisticsUpdateDTO.java +++ /dev/null @@ -1,51 +0,0 @@ -package cn.iocoder.mall.order.api.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import java.io.Serializable; - -/** - * 订单收件人信息 - * - * @author Sin - * @time 2019-03-17 20:22 - */ -@Data -@Accessors(chain = true) -public class OrderLogisticsUpdateDTO implements Serializable { - - /** - * 订单 id - */ - private Integer id; - /** - * 收件区域编号 - */ - @NotNull - private String areaNo; - /** - * 收件人名称 - */ - @NotNull - private String name; - /** - * 收件手机号 - */ - @NotNull - @Size(max = 11, min = 11) - // TODO: 2019-03-17 Sin 此处需要添加 手机号校验,需要添加新的注解 - private String mobile; - /** - * 收件详细地址 - */ - @NotNull - @Size(max = 250, min = 10, message = "收件地址应该在 10 ~ 250 个字符之间") - private String address; - /** - * 物流编号 - */ - private String logisticsNo; -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderQueryDTO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderQueryDTO.java deleted file mode 100644 index a3f90fd49..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderQueryDTO.java +++ /dev/null @@ -1,59 +0,0 @@ -package cn.iocoder.mall.order.api.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 订单 query - * - * @author Sin - * @time 2019-03-23 14:15 - */ -@Data -@Accessors(chain = true) -public class OrderQueryDTO implements Serializable { - - /** - * id - */ - private Integer id; - /** - * 订单号 - */ - private String orderNo; - /** - * 用户 id - */ - private Integer userId; - /** - * 物流id - */ - private Integer orderLogisticsId; - /** - * 是否退换货 - */ - private Integer hasReturnExchange; - /** - * 付款时间(待发货) - */ - private LocalDateTime startPaymentTime; - private LocalDateTime endPaymentTime; - /** - * 创建时间 - */ - private LocalDateTime startCreateTime; - private LocalDateTime endCreateTime; - /** - * 删除状态 - */ - private Integer deleted; - /** - * 状态 - */ - private Integer status; - private Integer pageNo; - private Integer pageSize; -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderReturnApplyDTO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderReturnApplyDTO.java deleted file mode 100644 index 747f88e31..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderReturnApplyDTO.java +++ /dev/null @@ -1,37 +0,0 @@ -package cn.iocoder.mall.order.api.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * @author Sin - * @time 2019-04-25 21:06 - */ -@Data -@Accessors(chain = true) -public class OrderReturnApplyDTO implements Serializable { - - /** - * 订单编号 - */ - private Integer orderId; - /** - * 退货原因(字典值) - */ - private Integer reason; - /** - * 问题描述 - */ - private String describe; - /** - * 退款类型 - * - * - 1、退货退款 - * - 2、退款 - */ - private Integer returnType; - -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderReturnCreateDTO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderReturnCreateDTO.java deleted file mode 100644 index a114be939..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderReturnCreateDTO.java +++ /dev/null @@ -1,41 +0,0 @@ -package cn.iocoder.mall.order.api.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * 订单退货 - 创建 - * - * @author Sin - * @time 2019-03-30 15:34 - */ -@Data -@Accessors(chain = true) -public class OrderReturnCreateDTO implements Serializable { - - /** - * 订单编号 - */ - private Integer orderId; - /** - * 订单 item 编号 - */ - private Integer orderItemId; - /** - * 退货原因(字典值) - */ - private Integer orderReason; - /** - * 原因(如果选择其他,原因保存在这) - */ - private String otherReasons; - /** - * 订单类型 - * - * - 0、为 Order 订单 (对整个订单退货) - * - 1、为 OrderItem 订单 (对订单某一个商品退货) - */ - private Integer orderType; -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderReturnQueryDTO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderReturnQueryDTO.java deleted file mode 100644 index e12c3111f..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderReturnQueryDTO.java +++ /dev/null @@ -1,56 +0,0 @@ -package cn.iocoder.mall.order.api.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 订单退货 查询 po - * - * @author Sin - * @time 2019-05-06 21:36 - */ -@Data -@Accessors(chain = true) -public class OrderReturnQueryDTO implements Serializable { - - /** - * - * 订单id - */ - private Integer orderId; - /** - * 订单编号 - */ - private Integer orderNo; - /** - * 服务号 - */ - private String serviceNumber; - /** - * 创建时间 - 开始 - */ - private LocalDateTime startCreateTime; - /** - * 创建时间 - 结束 - */ - private LocalDateTime endCreateTime; - /** - * 状态 - */ - private Integer status; - - /// - /// 分页信息 - - /** - * 分页 index - */ - private Integer index; - /** - * 分页大小 - */ - private Integer pageSize; -} diff --git a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderUserPageDTO.java b/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderUserPageDTO.java deleted file mode 100644 index 7b371147e..000000000 --- a/归档/moved/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderUserPageDTO.java +++ /dev/null @@ -1,45 +0,0 @@ -package cn.iocoder.mall.order.api.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 用户订单 page - * - * @author Sin - * @time 2019-04-08 17:50 - */ -@Data -@Accessors(chain = true) -public class OrderUserPageDTO implements Serializable { - - /** - * id - */ - private Integer id; - /** - * 订单号 - */ - private String orderNo; - /** - * 用户 id - */ - private Integer userId; - /** - * 付款时间(待发货) - */ - private LocalDateTime startPaymentTime; - private LocalDateTime endPaymentTime; - /** - * 创建时间 - */ - private LocalDateTime startCreateTime; - private LocalDateTime endCreateTime; - /** - * 状态 - */ - private Integer status; -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/constants/OrderDeliveryTypeEnum.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/constants/OrderDeliveryTypeEnum.java deleted file mode 100644 index 8894047b0..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/constants/OrderDeliveryTypeEnum.java +++ /dev/null @@ -1,41 +0,0 @@ -package cn.iocoder.mall.order.biz.constants; - -/** - * 发货类型/发货方式 - * - * @author Sin - * @time 2019-04-05 16:03 - */ -public enum OrderDeliveryTypeEnum { - - NONE(1, "未选择"), - ORDER_ONLINE(2, "快递"), - CONTACT_YOURSELF(3, "自己联系"), - NO_DELIVERY(4, "无物流信息"), - ; - - private Integer value; - - private String name; - - OrderDeliveryTypeEnum(Integer value, String name) { - this.value = value; - this.name = name; - } - - @Override - public String toString() { - return "OrderRecipientTypeEnum{" + - "value=" + value + - ", name='" + name + '\'' + - '}'; - } - - public Integer getValue() { - return value; - } - - public String getName() { - return name; - } -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/constants/OrderExchangeReasonEnum.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/constants/OrderExchangeReasonEnum.java deleted file mode 100644 index b1444a4cc..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/constants/OrderExchangeReasonEnum.java +++ /dev/null @@ -1,40 +0,0 @@ -package cn.iocoder.mall.order.biz.constants; - -/** - * 订单换货原因 - * - * @author Sin - * @time 2019-03-20 21:17 - */ -public enum OrderExchangeReasonEnum { - - REASON_000(0, "其他"), - REASON_001(1, "尺码不合适"), - REASON_002(2, "质量问题"), - REASON_003(3, "不喜欢"), - ; - - private Integer value; - - private String name; - - OrderExchangeReasonEnum(Integer value, String name) { - this.value = value; - this.name = name; - } - - @Override - public String toString() { - return "OrderCommonReasonEnum{" + - "value=" + value + - ", name=" + name + - '}'; - } - - public Integer getValue() { - return value; - } - - public String getName() { - return name; - }} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/constants/OrderRecipientTypeEnum.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/constants/OrderRecipientTypeEnum.java deleted file mode 100644 index 5d813db2c..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/constants/OrderRecipientTypeEnum.java +++ /dev/null @@ -1,39 +0,0 @@ -package cn.iocoder.mall.order.biz.constants; - -/** - * 订单收件信息 type(配送信息) - * - * @author Sin - * @time 2019-04-05 16:03 - */ -public enum OrderRecipientTypeEnum { - - EXPRESS(1, "快递") - - ; - - private Integer value; - - private String name; - - OrderRecipientTypeEnum(Integer value, String name) { - this.value = value; - this.name = name; - } - - @Override - public String toString() { - return "OrderRecipientTypeEnum{" + - "value=" + value + - ", name='" + name + '\'' + - '}'; - } - - public Integer getValue() { - return value; - } - - public String getName() { - return name; - } -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/constants/OrderReturnReasonEnum.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/constants/OrderReturnReasonEnum.java deleted file mode 100644 index b8335d9d9..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/constants/OrderReturnReasonEnum.java +++ /dev/null @@ -1,52 +0,0 @@ -package cn.iocoder.mall.order.biz.constants; - -/** - * 订单退货原因 - * - * @author Sin - * @time 2019-03-20 21:17 - */ -public enum OrderReturnReasonEnum { - - /// - /// 未发货情况 - - REASON_000(0, "其他"), - REASON_001(1, "拍错/勿拍/多拍"), - REASON_002(2, "缺货"), - - /// - /// 已发货情况 - - REASON_020(20, "七天无理由"), - REASON_021(21, "质量问题"), - REASON_022(22, "不想要了"), - - ; - - // TODO: 2019-03-20 Sin 已发货情况 补全,需要对照一下 淘宝 - - private Integer value; - - private String name; - - OrderReturnReasonEnum(Integer value, String name) { - this.value = value; - this.name = name; - } - - @Override - public String toString() { - return "OrderCommonReasonEnum{" + - "value=" + value + - ", name=" + name + - '}'; - } - - public Integer getValue() { - return value; - } - - public String getName() { - return name; - }} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderCommentConvert.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderCommentConvert.java deleted file mode 100644 index 5c9144e67..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderCommentConvert.java +++ /dev/null @@ -1,50 +0,0 @@ -package cn.iocoder.mall.order.biz.convert; - -import cn.iocoder.mall.order.api.bo.OrderCommentCreateBO; -import cn.iocoder.mall.order.api.bo.OrderCommentInfoBO; -import cn.iocoder.mall.order.api.bo.OrderCommentStateInfoPageBO; -import cn.iocoder.mall.order.api.bo.OrderCommentTimeOutBO; -import cn.iocoder.mall.order.api.dto.OrderCommentCreateDTO; -import cn.iocoder.mall.order.biz.dataobject.OrderCommentDO; -import org.mapstruct.Mapper; -import org.mapstruct.Mappings; -import org.mapstruct.factory.Mappers; - -import java.util.List; - -/** - * - * 订单评论 convert - * - * @author wtz - * @time 2019-05-31 18:30 - */ -@Mapper -public interface OrderCommentConvert { - - OrderCommentConvert INSTANCE = Mappers.getMapper(OrderCommentConvert.class); - - @Mappings({}) - OrderCommentStateInfoPageBO.OrderCommentStateInfoItem convertOrderCommentStateInfoItem(OrderCommentDO orderCommentDO); - - @Mappings({}) - List convertOrderCommentStateInfoItems(List orderCommentDOList); - - @Mappings({}) - OrderCommentDO convertOrderCommentDO(OrderCommentCreateDTO orderCommentCreateDTO); - - @Mappings({}) - OrderCommentCreateBO convertOrderCommentCreateBO(OrderCommentDO orderCommentDO); - - @Mappings({}) - OrderCommentInfoBO convertOrderCommentInfoBO(OrderCommentDO orderCommentDO); - - @Mappings({}) - OrderCommentTimeOutBO convertOrderCommentTimeOutBO(OrderCommentDO orderCommentDO); - - @Mappings({}) - List convertOrderCommentTimeOutBOList(List orderCommentDOList); - - - -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderCommentReplyConvert.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderCommentReplyConvert.java deleted file mode 100644 index 16d890678..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderCommentReplyConvert.java +++ /dev/null @@ -1,37 +0,0 @@ -package cn.iocoder.mall.order.biz.convert; - -import cn.iocoder.mall.order.api.bo.OrderCommentMerchantReplyBO; -import cn.iocoder.mall.order.api.bo.OrderCommentReplyCreateBO; -import cn.iocoder.mall.order.api.bo.OrderCommentReplyPageBO; -import cn.iocoder.mall.order.api.dto.OrderCommentReplyCreateDTO; -import cn.iocoder.mall.order.biz.dataobject.OrderCommentReplyDO; -import org.mapstruct.Mapper; -import org.mapstruct.Mappings; -import org.mapstruct.factory.Mappers; - -import java.util.List; - -/** - * - * 评论回复 convert - * - * @author wtz - * @time 2019-05-31 18:30 - */ -@Mapper -public interface OrderCommentReplyConvert { - - OrderCommentReplyConvert INSTANCE = Mappers.getMapper(OrderCommentReplyConvert.class); - - @Mappings({}) - OrderCommentReplyDO convert(OrderCommentReplyCreateDTO orderCommentReplyCreateDTO); - - @Mappings({}) - OrderCommentReplyCreateBO convert(OrderCommentReplyDO orderCommentReplyDO); - - @Mappings({}) - List convert(List orderCommentReplyDOList); - - @Mappings({}) - List convertOrderCommentReplayItem(List orderCommentReplyDOList); -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderItemConvert.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderItemConvert.java deleted file mode 100644 index e41b78bb7..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderItemConvert.java +++ /dev/null @@ -1,39 +0,0 @@ -package cn.iocoder.mall.order.biz.convert; - -import cn.iocoder.mall.order.api.bo.OrderInfoBO; -import cn.iocoder.mall.order.api.bo.OrderItemBO; -import cn.iocoder.mall.order.api.dto.OrderCreateDTO; -import cn.iocoder.mall.order.api.dto.OrderItemUpdateDTO; -import cn.iocoder.mall.order.biz.dataobject.OrderItemDO; -import org.mapstruct.Mapper; -import org.mapstruct.Mappings; -import org.mapstruct.factory.Mappers; - -import java.util.List; - -/** - * 订单 item convert - * - * @author Sin - * @time 2019-03-23 14:34 - */ -@Mapper -public interface OrderItemConvert { - - OrderItemConvert INSTANCE = Mappers.getMapper(OrderItemConvert.class); - - @Mappings({}) - OrderItemDO convert(OrderItemUpdateDTO orderItemUpdateDTO); - - @Mappings({}) - List convertOrderItemBO(List orderItemDOList); - - @Mappings({}) - List convert(List orderCreateItemDTOList); - - @Mappings({}) - List convertOrderItemDO(List orderItemDOList); - - @Mappings({}) - List convertOrderInfoWithOrderItem(List orderItemDOList); -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderLogisticsConvert.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderLogisticsConvert.java deleted file mode 100644 index 2ae2db9d0..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderLogisticsConvert.java +++ /dev/null @@ -1,56 +0,0 @@ -package cn.iocoder.mall.order.biz.convert; - -import cn.iocoder.mall.order.api.bo.OrderLastLogisticsInfoBO; -import cn.iocoder.mall.order.api.bo.OrderLogisticsInfoBO; -import cn.iocoder.mall.order.api.bo.OrderLogisticsInfoWithOrderBO; -import cn.iocoder.mall.order.api.dto.OrderDeliveryDTO; -import cn.iocoder.mall.order.api.dto.OrderLogisticsUpdateDTO; -import cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDO; -import cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDetailDO; -import cn.iocoder.mall.order.biz.dataobject.OrderRecipientDO; -import org.mapstruct.Mapper; -import org.mapstruct.Mappings; -import org.mapstruct.Named; -import org.mapstruct.factory.Mappers; - -import java.util.List; - -/** - * 订单物流 convert - * - * @author Sin - * @time 2019-03-23 14:39 - */ -@Mapper -public interface OrderLogisticsConvert { - - OrderLogisticsConvert INSTANCE = Mappers.getMapper(OrderLogisticsConvert.class); - - @Mappings({}) - OrderLogisticsDO convert(OrderDeliveryDTO orderDelivery); - - @Mappings({}) - OrderLogisticsDO convert(OrderLogisticsUpdateDTO orderLogisticsDTO); - - @Mappings({}) - OrderLogisticsDO convert(OrderRecipientDO orderRecipientDO); - - @Mappings({}) - List convertLogistics(List orderLogisticsDOList); - - @Mappings({}) - List convertLogisticsDetail(List orderLogisticsDOList); - - @Mappings({}) - OrderLogisticsInfoBO convert(OrderLogisticsDO orderLogisticsDO); - - @Mappings({}) - List convert(List orderLogisticsDetailDOList); - - @Mappings({}) - @Named(value = "orderLastLogisticsInfoBO") - OrderLastLogisticsInfoBO convertOrderLastLogisticsInfoBO(OrderLogisticsDO orderLogisticsDO); - - @Mappings({}) - OrderLastLogisticsInfoBO.LogisticsDetail convertLastLogisticsDetail(OrderLogisticsDetailDO orderLogisticsDetailDO); -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderLogisticsDetailConvert.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderLogisticsDetailConvert.java deleted file mode 100644 index 8a0235cf5..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderLogisticsDetailConvert.java +++ /dev/null @@ -1,25 +0,0 @@ -package cn.iocoder.mall.order.biz.convert; - -import cn.iocoder.mall.order.api.bo.OrderInfoBO; -import cn.iocoder.mall.order.api.bo.OrderLogisticsInfoWithOrderBO; -import cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDetailDO; -import org.mapstruct.Mapper; -import org.mapstruct.Mappings; -import org.mapstruct.factory.Mappers; - -import java.util.List; - -/** - * 订单物流 convert - * - * @author Sin - * @time 2019-03-23 14:39 - */ -@Mapper -public interface OrderLogisticsDetailConvert { - - OrderLogisticsDetailConvert INSTANCE = Mappers.getMapper(OrderLogisticsDetailConvert.class); - - @Mappings({}) - OrderInfoBO.LogisticsDetail convertLogisticsDetail(OrderLogisticsDetailDO orderLogisticsDetailDO); -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderRecipientConvert.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderRecipientConvert.java deleted file mode 100644 index 1229f4683..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderRecipientConvert.java +++ /dev/null @@ -1,39 +0,0 @@ -package cn.iocoder.mall.order.biz.convert; - -import cn.iocoder.mall.order.api.bo.OrderInfoBO; -import cn.iocoder.mall.order.api.bo.OrderRecipientBO; -import cn.iocoder.mall.order.api.dto.OrderCreateDTO; -import cn.iocoder.mall.order.biz.dataobject.OrderRecipientDO; -import cn.iocoder.mall.user.api.bo.UserAddressBO; -import org.mapstruct.Mapper; -import org.mapstruct.Mappings; -import org.mapstruct.factory.Mappers; - -import java.util.List; - -/** - * 订单收件人信息 - * - * @author Sin - * @time 2019-03-31 12:50 - */ -@Mapper -public interface OrderRecipientConvert { - - OrderRecipientConvert INSTANCE = Mappers.getMapper(OrderRecipientConvert.class); - - @Mappings({}) - OrderRecipientDO convert(OrderCreateDTO orderCreateDTO); - - @Mappings({}) - OrderRecipientDO convert(UserAddressBO userAddressBO); - - @Mappings({}) - OrderRecipientBO convert(OrderRecipientDO orderRecipientDO); - - @Mappings({}) - List convert(List orderRecipientDOList); - - @Mappings({}) - OrderInfoBO.Recipient convertOrderInfoRecipient(OrderRecipientDO orderRecipientDO); -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderReturnConvert.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderReturnConvert.java deleted file mode 100644 index 736075c65..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderReturnConvert.java +++ /dev/null @@ -1,40 +0,0 @@ -package cn.iocoder.mall.order.biz.convert; - -import cn.iocoder.mall.order.api.bo.OrderReturnInfoBO; -import cn.iocoder.mall.order.api.bo.OrderReturnListBO; -import cn.iocoder.mall.order.api.dto.OrderReturnApplyDTO; -import cn.iocoder.mall.order.api.dto.OrderReturnCreateDTO; -import cn.iocoder.mall.order.biz.dataobject.OrderItemDO; -import cn.iocoder.mall.order.biz.dataobject.OrderReturnDO; -import org.mapstruct.Mapper; -import org.mapstruct.Mappings; -import org.mapstruct.factory.Mappers; - -import java.util.List; - -/** - * 订单 return - * - * @author Sin - * @time 2019-03-30 15:46 - */ -@Mapper -public interface OrderReturnConvert { - - OrderReturnConvert INSTANCE = Mappers.getMapper(OrderReturnConvert.class); - - @Mappings({}) - OrderReturnDO convert(OrderReturnCreateDTO orderReturnCreate); - - @Mappings({}) - OrderReturnDO convert(OrderReturnApplyDTO orderReturnApplyDTO); - - @Mappings({}) - OrderReturnInfoBO.ReturnInfo convert(OrderReturnDO orderReturnDO); - - @Mappings({}) - List convert(List orderItemDOList); - - @Mappings({}) - List convertListBO(List orderReturnDOList); -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderCancelMapper.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderCancelMapper.java deleted file mode 100644 index 66563e679..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderCancelMapper.java +++ /dev/null @@ -1,17 +0,0 @@ -package cn.iocoder.mall.order.biz.dao; - -import cn.iocoder.mall.order.biz.dataobject.OrderCancelDO; -import org.springframework.stereotype.Repository; - -/** - * 订单取消 mapper - * - * @author Sin - * @time 2019-03-30 16:27 - */ -@Repository -public interface OrderCancelMapper { - - int insert(OrderCancelDO orderCancelDO); - -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderCommentMapper.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderCommentMapper.java deleted file mode 100644 index 2f0b21475..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderCommentMapper.java +++ /dev/null @@ -1,92 +0,0 @@ -package cn.iocoder.mall.order.biz.dao; - -import cn.iocoder.mall.order.api.bo.OrderCommentTimeOutBO; -import cn.iocoder.mall.order.api.dto.OrderCommentPageDTO; -import cn.iocoder.mall.order.api.dto.OrderCommentStateInfoPageDTO; -import cn.iocoder.mall.order.api.dto.OrderCommentTimeOutPageDTO; -import cn.iocoder.mall.order.biz.dataobject.OrderCommentDO; -import cn.iocoder.mall.order.biz.dataobject.OrderItemDO; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.Collection; -import java.util.List; - -/** - * - * 订单评论 mapper - * - * @author wtz - * @time 2019-05-16 20:52 - */ -@Repository -public interface OrderCommentMapper{ - - - /** - * 插入订单评论 - * @param orderCommentDO - * @return - */ - void insert(OrderCommentDO orderCommentDO); - - - /** - * 根据 sku id 查询评论总条数 - * @param productSkuId - * @return - */ - int selectCommentTotalCountByProductSkuId(@Param("productSkuId") Integer productSkuId); - - - /** - * 分页获取评论 - * @param orderCommentPageDTO - * @return - */ - List selectCommentPage(OrderCommentPageDTO orderCommentPageDTO); - - - /** - * 根据评论 id 查询评论详情 - * @param id - * @return - */ - OrderCommentDO selectCommentInfoByCommentId(@Param("id") Integer id); - - - /** - * 订单评论状态信息详情 - * @param orderCommentStateInfoPageDTO - * @return - */ - List selectOrderCommentStateInfoPage(OrderCommentStateInfoPageDTO orderCommentStateInfoPageDTO); - - - /** - * 订单评论状态总数 - * @param userId,commentState - * @return - */ - int selectOrderCommentStateInfoTotal(@Param("userId") Integer userId, - @Param("commentState") Integer commentState); - - - /** - * 订单评论超时分页 - * @param orderCommentTimeOutPageDTO - * @return - */ - List selectOrderCommentTimeOutPage(@Param("commentTimeOut") OrderCommentTimeOutPageDTO orderCommentTimeOutPageDTO); - - /** - * 批量更新订单评论状态 - * @param orderCommentTimeOutBOList - * @param commentState - */ - void updateBatchOrderCommentState(@Param("commentState") Integer commentState, - @Param("list") List orderCommentTimeOutBOList); - - - -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderCommentReplayMapper.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderCommentReplayMapper.java deleted file mode 100644 index c707249d5..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderCommentReplayMapper.java +++ /dev/null @@ -1,63 +0,0 @@ -package cn.iocoder.mall.order.biz.dao; - -import cn.iocoder.mall.order.api.bo.OrderCommentBO; -import cn.iocoder.mall.order.api.dto.OrderCommentReplyCreateDTO; -import cn.iocoder.mall.order.api.dto.OrderCommentReplyPageDTO; -import cn.iocoder.mall.order.biz.dataobject.OrderCommentReplyDO; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.Collection; -import java.util.List; - -/** - * 订单评论回复 mapper - * - * @author wtz - * @time 2019-05-16 21:33 - */ -@Repository -public interface OrderCommentReplayMapper { - - /** - * 插入订单评论回复 - * @param orderCommentReplyDO - * @return - */ - void insert(OrderCommentReplyDO orderCommentReplyDO); - - /** - * 根据评论 id 和用户类型获取商家回复 - * @param commentId,userType - * @return - */ - List selectCommentMerchantReplyByCommentIdAndUserType(@Param("commentId") Integer commentId, - @Param("userType") Integer userType); - - - /** - * 分页获取评论回复 - * @param orderCommentReplyPageDTO - * @return - */ - List selectCommentReplyPage(OrderCommentReplyPageDTO orderCommentReplyPageDTO); - - - /** - * 根据评论 id 和用户类型获取评论回复总数 - * @param commentId,userType - * @return - */ - int selectCommentReplyTotalCountByCommentId(@Param("commentId") Integer commentId, - @Param("userType") Integer userType); - - - /** - * 根据评论 id 查询最新的商家回复 - * @param commentIds - * @return - */ - List selectCommentNewMerchantReplyByCommentIds(@Param("commentIds") Collection commentIds, - @Param("userType") Integer userType); - -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderItemMapper.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderItemMapper.java deleted file mode 100644 index 9ccf9a3a2..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderItemMapper.java +++ /dev/null @@ -1,84 +0,0 @@ -package cn.iocoder.mall.order.biz.dao; - -import cn.iocoder.mall.order.biz.dataobject.OrderItemDO; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.Collection; -import java.util.List; - -/** - * 订单 item mapper - * - * @author Sin - * @time 2019-03-16 15:09 - */ -@Repository -public interface OrderItemMapper { - - /** - * 插入数据 - * - * @param orderItemDOList - */ - void insert(@Param("list") List orderItemDOList); - - /** - * 更新 - 根据Id - * - * @param orderItemDO - */ - void updateById(@Param("orderItemDO") OrderItemDO orderItemDO); - - /** - * 更新 - 根据 orderId - * @param orderId - * @param orderItemDO - */ - void updateByOrderId( - @Param("orderId") Integer orderId, - @Param("orderItemDO") OrderItemDO orderItemDO - ); - - /** - * 更新 - 根据Ids - * - * @param ids - * @param orderItemDO - */ - void updateByIds( - @Param("ids") List ids, - @Param("orderItemDO") OrderItemDO orderItemDO - ); - - /** - * 获取 - 根据 ids 查询 - * - * @param ids - * @return - */ - List selectByIds(@Param("ids") Collection ids); - - /** - * 查询 - 根据 orderIds 和 status - * - * @param orderIds - * @param deleted - * @return - */ - List selectByDeletedAndOrderIds( - @Param("orderIds") Collection orderIds, - @Param("deleted") Integer deleted - ); - - /** - * 查询 - 根据 orderId 下的 item - * - * @param orderId - * @return - */ - List selectByDeletedAndOrderId( - @Param("deleted") Integer deleted, - @Param("orderId") Integer orderId - ); -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderLogisticsDetailMapper.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderLogisticsDetailMapper.java deleted file mode 100644 index bf2525fb3..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderLogisticsDetailMapper.java +++ /dev/null @@ -1,66 +0,0 @@ -package cn.iocoder.mall.order.biz.dao; - -import cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDetailDO; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.Collection; -import java.util.List; - -/** - * 订单物流 - 物流详细信息 - * - * @author Sin - * @time 2019-04-12 21:35 - */ -@Repository -public interface OrderLogisticsDetailMapper { - - /** - * 插入 - * - * @param orderLogisticsDetailDO - * @return - */ - int insert(OrderLogisticsDetailDO orderLogisticsDetailDO); - - /** - * 查询 - 根据 物流id - * - * @param orderLogisticsId - * @return - */ - List selectByOrderLogisticsId( - @Param("orderLogisticsId") Integer orderLogisticsId - ); - - /** - * 查询 - 根据 物流ids - * - * @param orderLogisticsIds - * @return - */ - List selectByOrderLogisticsIds( - @Param("orderLogisticsIds") Collection orderLogisticsIds - ); - - /** - * 查询 - 获取最新的物流信息 - * - * @param orderLogisticsIds - * @return - */ - OrderLogisticsDetailDO selectLast( - @Param("orderLogisticsIds") Collection orderLogisticsIds - ); - - /** - * 查询 - 根据 last 根据物理id - * - * @param orderLogisticsId - * @return - */ - OrderLogisticsDetailDO selectLastByLogisticsId( - @Param("orderLogisticsId") Integer orderLogisticsId - ); -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderLogisticsMapper.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderLogisticsMapper.java deleted file mode 100644 index f1442a023..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderLogisticsMapper.java +++ /dev/null @@ -1,53 +0,0 @@ -package cn.iocoder.mall.order.biz.dao; - -import cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDO; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.Collection; -import java.util.List; - -/** - * 订单 item mapper - * - * @author Sin - * @time 2019-03-16 15:09 - */ -@Repository -public interface OrderLogisticsMapper { - - /** - * 插入数据 - * - * @param orderLogisticsDO - */ - void insert(OrderLogisticsDO orderLogisticsDO); - - /** - * 更新 - 根据id - * - * @param orderLogisticsDO - */ - void updateById(OrderLogisticsDO orderLogisticsDO); - - /** - * 查询 - 根据 ids - * - * @param id - * @return - */ - OrderLogisticsDO selectById( - @Param("id") Integer id - ); - - /** - * 查询 - 根据 ids - * - * @param ids - * @return - */ - List selectByIds( - @Param("ids") Collection ids - ); - -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderMapper.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderMapper.java deleted file mode 100644 index d9c16f47f..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderMapper.java +++ /dev/null @@ -1,35 +0,0 @@ -package cn.iocoder.mall.order.biz.dao; - -import cn.iocoder.mall.order.api.dto.OrderQueryDTO; -import cn.iocoder.mall.order.biz.dataobject.OrderDO; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 订单 mapper - * - * @author Sin - * @time 2019-03-16 15:09 - */ -@Repository -public interface OrderMapper extends BaseMapper { - - /** - * 查询 - 后台分页page - * - * @param orderQueryDTO - * @return - */ - int selectPageCount(OrderQueryDTO orderQueryDTO); - - /** - * 查询 - 后台分页page - * - * @param orderQueryDTO - * @return - */ - List selectPage(OrderQueryDTO orderQueryDTO); -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderRecipientMapper.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderRecipientMapper.java deleted file mode 100644 index 193f03bf0..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderRecipientMapper.java +++ /dev/null @@ -1,47 +0,0 @@ -package cn.iocoder.mall.order.biz.dao; - -import cn.iocoder.mall.order.biz.dataobject.OrderRecipientDO; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.Collection; -import java.util.List; - -/** - * 订单收件人 信息 - * - * @author Sin - * @time 2019-03-31 12:16 - */ -@Repository -public interface OrderRecipientMapper { - - /** - * 插入 - 订单收件人 - * - * @param orderRecipient - * @return - */ - int insert(OrderRecipientDO orderRecipient); - - /** - * 查询 - 根据 orderId - * - * @param orderId - * @return - */ - OrderRecipientDO selectByOrderId( - @Param("orderId") Integer orderId - ); - - /** - * 查询 - 根据 orderIds - * - * @param orderIds - * @return - */ - List selectByOrderIds( - @Param("orderIds")Collection orderIds - ); - -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderReturnMapper.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderReturnMapper.java deleted file mode 100644 index 5e4277bf6..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderReturnMapper.java +++ /dev/null @@ -1,68 +0,0 @@ -package cn.iocoder.mall.order.biz.dao; - -import cn.iocoder.mall.order.api.dto.OrderReturnQueryDTO; -import cn.iocoder.mall.order.biz.dataobject.OrderReturnDO; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 订单退货 mapper - * - * @author Sin - * @time 2019-03-30 15:36 - */ -@Repository -public interface OrderReturnMapper { - - /** - * 插入 - 退货信息 - * - * @param orderReturnDO - * @return - */ - int insert(OrderReturnDO orderReturnDO); - - /** - * 更新 - 根据 orderId - * - * @param orderReturnDO - * @return - */ - int updateById(OrderReturnDO orderReturnDO); - - /** - * 查询 - 根据 orderId - * - * @param orderId - * @return - */ - OrderReturnDO selectByOrderId( - @Param("orderId") Integer orderId - ); - - /** - * 列表查询 - queryDTO - * - * @param queryDTO - * @return - */ - int selectListCount(OrderReturnQueryDTO queryDTO); - - /** - * 列表查询 - queryDTO - * - * @param queryDTO - * @return - */ - List selectList(OrderReturnQueryDTO queryDTO); - - /** - * 查询 - 根据 id 查询 - * - * @param id - * @return - */ - OrderReturnDO selectById(Integer id); -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCommentDO.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCommentDO.java deleted file mode 100644 index 56d6607bc..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCommentDO.java +++ /dev/null @@ -1,125 +0,0 @@ -package cn.iocoder.mall.order.biz.dataobject; - -import cn.iocoder.common.framework.dataobject.BaseDO; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 订单评论表 - * - * @author wtz - * @time 2019-05-14 20:48 - * - */ -@Data -@Accessors(chain = true) -@TableName(value = "order_comment") -public class OrderCommentDO extends BaseDO { - - /** - * 评论 id // TODO FROM 芋艿 TO wtz 中英文之间,要有空格 - */ - private Integer id; - - /** - * 订单 id - */ - private Integer orderId; - - /** - * 订单编号 - */ - private String orderNo; - - /** - * 商品 id - */ - private Integer productSpuId; - - /** - * 商品名称 - */ - private String productSpuName; - - /** - * 商品 sku id - */ - private Integer productSkuId; - - /** - * 商品 sku 属性 - */ - private String productSkuAttrs; - - /** - * 商品 sku 价格 - */ - private Integer productSkuPrice; - - /** - * 商品 sku url - */ - private String productSkuPicUrl; - - /** - * 用户id - */ - private Integer userId; - - /** - * 用户头像 - */ - private String userAvatar; - - /** - * 用户的真实姓名 - */ - private String userNickName; - - /** - * 评价星 - */ - private Integer star; - - /** - * 商品描述 - */ - private Integer productDescriptionStar; - - /** - * 物流评价 - */ - private Integer logisticsStar; - - /** - * 商家评价 - */ - private Integer merchantStar; - - /** - * 回复条数 - */ - private Integer replayCount; - - /** - * 点赞数 // TODO FROM 芋艿 TO wtz collect 是收藏的意思,最好换个单词噢。 - */ - private Integer likeCount; - - /** - * 评论的内容 - */ - private String commentContent; - - /** - * 评论的图片地址 - */ - private String commentPics; - - /** - * 订单评论状态 - */ - private Integer commentState; - -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCommentReplyDO.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCommentReplyDO.java deleted file mode 100644 index ac39e63bc..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCommentReplyDO.java +++ /dev/null @@ -1,87 +0,0 @@ -package cn.iocoder.mall.order.biz.dataobject; - -import cn.iocoder.common.framework.dataobject.BaseDO; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 商品评价回复表 - * - * // TODO FROM 芋艿 TO wtz 商品评价回复表 =》订单评论回复表 - * - * @author wtz - * @time 2019-05-14 21:00 - * - */ -@Data -@Accessors(chain = true) -@TableName(value = "order_comment_replay") -public class OrderCommentReplyDO extends BaseDO { - - /** - * 回复 id - */ - private Integer id; - - /** - * 评论 id - */ - private Integer commentId; - - /** - * 回复的类型 // TODO FROM 芋艿 TO wtz 记得加下枚举类 - */ - private Integer replyType; - - /** - * 父 id - */ - private Integer parentId; - - /** - * 回复目标用户 id - */ - private Integer parentUserId; - - /** - * 回复目标用户昵称 - */ - private String parentUserNickName; - - /** - * 回复目标用户头像 - */ - private String parentUserAvatar; - - /** - * 回复的内容 - */ - private String replyContent; - - /** - * 回复用户 id - */ - private Integer replyUserId; - - /** - * 回复用户昵称 - */ - private String replyUserNickName; - - /** - * 回复用户头像 - */ - private String replyUserAvatar; - - /** - * 回复用户身份 // TODO FROM 芋艿 TO wtz 【提示】userType 和 UserTypeEnum 记录保持一致。 - */ - private Integer userType; - - /** - * 回复点赞数 - */ - private Integer replyLikeCount; - -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderExchangeDO.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderExchangeDO.java deleted file mode 100644 index f99e2afb3..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderExchangeDO.java +++ /dev/null @@ -1,114 +0,0 @@ -package cn.iocoder.mall.order.biz.dataobject; - -import cn.iocoder.common.framework.dataobject.DeletableDO; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.time.LocalDateTime; - -/** - * 换货订单 - * - * @author Sin - * @time 2019-03-19 19:48 - */ -@Data -@Accessors(chain = true) -public class OrderExchangeDO extends DeletableDO { - - /** - * id - */ - private Integer id; - /** - * 订单id - */ - private Integer orderId; - /** - * 订单编号 - */ - private String orderNo; - /** - * 订单 item 编号 - */ - private Integer orderItemId; - /** - * 商品id(保存一个冗余,如果一个订单下存在多个商品,会有很大的作用) - */ - private String skuId; - /** - * 换货商品id - */ - private String exchangeSkuId; - /** - * 换货物流id - */ - private Integer exchangeOrderLogisticsId; - /** - * 收件物流id - */ - private Integer receiverOrderLogisticsId; - - /// - /// 原因 - - /** - * 原因 (关联字典) - * - * {@link cn.iocoder.mall.order.biz.constants.OrderExchangeReasonEnum} - */ - private Integer orderReasonId; - /** - * 原因(如果选择其他,原因保存在这) - * - * {@link cn.iocoder.mall.order.biz.constants.OrderExchangeReasonEnum#REASON_000} - */ - private String reason; - - /// - /// 时间信息 - - /** - * 创建时间 - * supper baseDO - */ -// private LocalDateTime createTime; - /** - * 付款时间 - */ - private LocalDateTime paymentTime; - /** - * 发货时间 - */ - private LocalDateTime deliveryTime; - /** - * 收货时间 - */ - private LocalDateTime receiverTime; - /** - * 成交时间 - */ - private LocalDateTime closingTime; - - /// - /// 其他 - - /** - * 订单类型 - * - * - 0、为 Order 订单 (对整个订单退货) - * - 1、为 OrderItem 订单 (对订单某一个商品退货) - */ - private Integer orderType; - /** - * 状态 - * - * - 申请换货 - * - 申请成功 - * - 申请失败 - * - 换货中 - * - 换货成功 - */ - private Integer status; - -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderLogisticsDO.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderLogisticsDO.java deleted file mode 100644 index f5e1a705e..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderLogisticsDO.java +++ /dev/null @@ -1,46 +0,0 @@ -package cn.iocoder.mall.order.biz.dataobject; - -import cn.iocoder.common.framework.dataobject.BaseDO; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 订单物流信息 - * - * @author Sin - * @time 2019-03-19 20:47 - */ -@Data -@Accessors(chain = true) -public class OrderLogisticsDO extends BaseDO { - - /** - * id - */ - private Integer id; - /** - * 收件区域编号 - */ - private String areaNo; - /** - * 收件人名称 - */ - private String name; - /** - * 收件手机号 - */ - private String mobile; - /** - * 收件详细地址 - */ - private String address; - /** - * 物流 (字典) - */ - private Integer logistics; - /** - * 物流编号 - */ - private String logisticsNo; - -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderLogisticsDetailDO.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderLogisticsDetailDO.java deleted file mode 100644 index cc9aa8f63..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderLogisticsDetailDO.java +++ /dev/null @@ -1,38 +0,0 @@ -package cn.iocoder.mall.order.biz.dataobject; - -import cn.iocoder.common.framework.dataobject.DeletableDO; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.time.LocalDateTime; - -/** - * 订单物流 - 详细信息 - * - * - 同步第三方物流信息 - * - * @author Sin - * @time 2019-03-19 20:48 - */ -@Data -@Accessors(chain = true) -public class OrderLogisticsDetailDO extends DeletableDO { - - /** - * id - */ - private Integer id; - /** - * 物流id - */ - private Integer orderLogisticsId; - /** - * 物流时间 - */ - private LocalDateTime logisticsTime; - /** - * 物流信息 - */ - private String logisticsInformation; - -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderReturnDO.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderReturnDO.java deleted file mode 100644 index e89ba1ad0..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderReturnDO.java +++ /dev/null @@ -1,103 +0,0 @@ -package cn.iocoder.mall.order.biz.dataobject; - -import cn.iocoder.common.framework.dataobject.BaseDO; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.time.LocalDateTime; - -/** - * 退货订单 - * - * @author Sin - * @time 2019-03-19 19:48 - */ -@Data -@Accessors(chain = true) -public class OrderReturnDO extends BaseDO { - - // TODO FROM 芋艿 TO 小范,存储下支付中心的退款单号 - - /** - * 编号自动增长 - */ - private Integer id; - /** - * 服务号 - */ - // TODO FROM 芋艿 to 小范,换个名字,看着怪怪的 哈哈哈哈。 - private String serviceNumber; - /** - * 订单编号 - */ - private Integer orderId; - /** - * 订单号 (保存一个冗余) - */ - private String orderNo; - /** - * 物流id - */ - private Integer orderLogisticsId; - - /// - /// 退货原因 - - /** - * 退货金额 - */ - private Integer refundPrice; - /** - * 退货原因(字典值) - * - * {@link cn.iocoder.mall.order.biz.constants.OrderReturnReasonEnum} - */ - private Integer reason; - /** - * 问题描述 - */ - // TODO FROM 芋艿 to 小范,describe 是动词,换成名词 description - private String describe; - - /// - /// 时间信息 - - /** - * 同意时间 - */ - private LocalDateTime approvalTime; - /** - * 拒绝时间 - */ - private LocalDateTime refuseTime; - /** - * 物流时间(填写物流单号时间) - */ - private LocalDateTime logisticsTime; - /** - * 收货时间 - */ - private LocalDateTime receiverTime; - /** - * 成交时间(确认时间) - */ - private LocalDateTime closingTime; - /** - * 服务类型 - * - * - 1、退货退款 - * - 2、退款 - */ - private Integer serviceType; - /** - * 状态 - * - * - 1、退货申请 - * - 2、申请成功 - * - 3、申请失败 - * - 4、退货中 - * - 5、已收货 - * - 6、退货成功 - */ - private Integer status; -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/job/AutomaticCommentJob.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/job/AutomaticCommentJob.java deleted file mode 100644 index 7f203ac68..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/job/AutomaticCommentJob.java +++ /dev/null @@ -1,67 +0,0 @@ -package cn.iocoder.mall.order.biz.job; - -import cn.iocoder.mall.order.api.OrderCommentService; -import cn.iocoder.mall.order.api.bo.OrderCommentTimeOutBO; -import cn.iocoder.mall.order.api.constant.OrderCommentStatusEnum; -import cn.iocoder.mall.order.api.dto.OrderCommentTimeOutPageDTO; -import cn.iocoder.mall.order.biz.dao.OrderCommentMapper; -import com.xxl.job.core.biz.model.ReturnT; -import com.xxl.job.core.handler.IJobHandler; -import com.xxl.job.core.handler.annotation.JobHandler; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import java.util.List; -import java.util.stream.Collectors; - -/** - * 超时以后自动生成评论 - * - * @author wtz - * @time 2019-06-15 10:26 - */ -@Component -@JobHandler("automaticCommentJob") -public class AutomaticCommentJob extends IJobHandler { - - /** - * 默认生成订单7天以后的自动生成订单评论 - */ - private static final Integer OVERDAYCOUNT=7; - - private static final Integer PAGESIZE=1000; - - @Autowired - private OrderCommentService orderCommentService; - - @Override - public ReturnT execute(String param) throws Exception { - Integer overDayCount=OVERDAYCOUNT; - - if (param.isEmpty()){ - overDayCount=Integer.parseInt(param); - } - - for (int i=0;;i++){ - - OrderCommentTimeOutPageDTO orderCommentTimeOutPageDTO=new OrderCommentTimeOutPageDTO(); - orderCommentTimeOutPageDTO.setOverDay(overDayCount); - orderCommentTimeOutPageDTO.setCommentState(OrderCommentStatusEnum.WAIT_COMMENT.getValue()); - orderCommentTimeOutPageDTO.setPageNo(i); - orderCommentTimeOutPageDTO.setPageSize(PAGESIZE); - - List orderCommentTimeOutBOList=orderCommentService.getOrderCommentTimeOutPage(orderCommentTimeOutPageDTO); - - //为空时候跳出循环 - if (orderCommentTimeOutBOList.isEmpty()){ - break; - } - //批量更新 - orderCommentService.updateBatchOrderCommentState(orderCommentTimeOutBOList); - - } - return null; - } - - -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderCommentReplyServiceImpl.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderCommentReplyServiceImpl.java deleted file mode 100644 index 3efdebaa2..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderCommentReplyServiceImpl.java +++ /dev/null @@ -1,85 +0,0 @@ -package cn.iocoder.mall.order.biz.service; - -import cn.iocoder.mall.order.api.OrderCommentReplyService; -import cn.iocoder.mall.order.api.bo.OrderCommentMerchantReplyBO; -import cn.iocoder.mall.order.api.bo.OrderCommentReplyCreateBO; -import cn.iocoder.mall.order.api.bo.OrderCommentReplyPageBO; -import cn.iocoder.mall.order.api.constant.OrderCommentRelpyTypeEnum; -import cn.iocoder.mall.order.api.constant.OrderReplyUserTypeEnum; -import cn.iocoder.mall.order.api.dto.OrderCommentReplyCreateDTO; -import cn.iocoder.mall.order.api.dto.OrderCommentReplyPageDTO; -import cn.iocoder.mall.order.biz.convert.OrderCommentReplyConvert; -import cn.iocoder.mall.order.biz.dao.OrderCommentReplayMapper; -import cn.iocoder.mall.order.biz.dataobject.OrderCommentReplyDO; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.time.LocalDateTime; -import java.util.List; - -/** - * - * 订单评论回复 service impl - * - * @author wtz - * @time 2019-05-31 18:30 - */ -@Service -@org.apache.dubbo.config.annotation.Service(validation = "true",version = "${dubbo.provider.OrderCommentReplyService.version}") -public class OrderCommentReplyServiceImpl implements OrderCommentReplyService { - - @Autowired - private OrderCommentReplayMapper orderCommentReplayMapper; - - /** - * 分页获取评论回复 - * @param orderCommentReplyPageDTO - * @return - */ - @Override - public OrderCommentReplyPageBO getOrderCommentReplyPage(OrderCommentReplyPageDTO orderCommentReplyPageDTO) { - OrderCommentReplyPageBO orderCommentReplyPageBO=new OrderCommentReplyPageBO(); - //评论回复总数 - Integer totalCount=orderCommentReplayMapper.selectCommentReplyTotalCountByCommentId(orderCommentReplyPageDTO.getCommentId(), - orderCommentReplyPageDTO.getUserType()); - //分页获取评论回复 - List orderCommentReplyDOList=orderCommentReplayMapper.selectCommentReplyPage(orderCommentReplyPageDTO); - orderCommentReplyPageBO.setTotal(totalCount); - orderCommentReplyPageBO.setOrderCommentReplayItems(OrderCommentReplyConvert.INSTANCE.convertOrderCommentReplayItem(orderCommentReplyDOList)); - return orderCommentReplyPageBO; - } - - - /** - * 创建评论回复 - * @param orderCommentReplyCreateDTO - * @return - */ - @Override - public OrderCommentReplyCreateBO createOrderCommentReply(OrderCommentReplyCreateDTO orderCommentReplyCreateDTO) { - OrderCommentReplyDO orderCommentReplyDO=OrderCommentReplyConvert.INSTANCE.convert(orderCommentReplyCreateDTO); - orderCommentReplyDO.setCreateTime(new Date()); - - Integer replyType=orderCommentReplyCreateDTO.getCommentId()==orderCommentReplyCreateDTO.getParentId()? - OrderCommentRelpyTypeEnum.COMMENT_REPLY.getValue():OrderCommentRelpyTypeEnum.REPLY_REPLY.getValue(); - - orderCommentReplyDO.setReplyType(replyType); - - orderCommentReplayMapper.insert(orderCommentReplyDO); - - return OrderCommentReplyConvert.INSTANCE.convert(orderCommentReplyDO); - } - - /** - * 获取商家评论回复 - * @param commentId - * @return - */ - @Override - public List getOrderCommentMerchantReply(Integer commentId) { - List orderCommentReplyDOList=orderCommentReplayMapper.selectCommentMerchantReplyByCommentIdAndUserType(commentId, - OrderReplyUserTypeEnum.MERCHANT.getValue()); - return OrderCommentReplyConvert.INSTANCE.convert(orderCommentReplyDOList); - } -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderCommentServiceImpl.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderCommentServiceImpl.java deleted file mode 100644 index 06b04a7c4..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderCommentServiceImpl.java +++ /dev/null @@ -1,110 +0,0 @@ -package cn.iocoder.mall.order.biz.service; - -import cn.iocoder.mall.order.api.OrderCommentService; -import cn.iocoder.mall.order.api.bo.*; -import cn.iocoder.mall.order.api.constant.OrderCommentStatusEnum; -import cn.iocoder.mall.order.api.constant.OrderReplyUserTypeEnum; -import cn.iocoder.mall.order.api.dto.OrderCommentCreateDTO; -import cn.iocoder.mall.order.api.dto.OrderCommentPageDTO; -import cn.iocoder.mall.order.api.dto.OrderCommentStateInfoPageDTO; -import cn.iocoder.mall.order.api.dto.OrderCommentTimeOutPageDTO; -import cn.iocoder.mall.order.biz.convert.OrderCommentConvert; -import cn.iocoder.mall.order.biz.dao.OrderCommentMapper; -import cn.iocoder.mall.order.biz.dao.OrderCommentReplayMapper; -import cn.iocoder.mall.order.biz.dataobject.OrderCommentDO; -import cn.iocoder.mall.order.biz.dataobject.OrderCommentReplyDO; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.time.LocalDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * - * 订单评论 service impl - * - * @author wtz - * @time 2019 - */ -@Service -@org.apache.dubbo.config.annotation.Service(validation = "true", version = "${dubbo.provider.OrderCommentService.version}") -public class OrderCommentServiceImpl implements OrderCommentService { - - @Autowired - private OrderCommentMapper orderCommentMapper; - - @Autowired - private OrderCommentReplayMapper orderCommentReplayMapper; - - - @Override - public OrderCommentCreateBO createOrderComment(OrderCommentCreateDTO orderCommentCreateDTO) { - OrderCommentDO orderCommentDO=OrderCommentConvert.INSTANCE.convertOrderCommentDO(orderCommentCreateDTO); - orderCommentDO.setCreateTime(new Date()); - orderCommentMapper.insert(orderCommentDO); - return OrderCommentConvert.INSTANCE.convertOrderCommentCreateBO(orderCommentDO); - } - - @Override - public OrderCommentPageBO getOrderCommentPage(OrderCommentPageDTO orderCommentPageDTO) { - OrderCommentPageBO orderCommentPageBO=new OrderCommentPageBO(); - //分页内容 - List orderCommentDOList=orderCommentMapper.selectCommentPage(orderCommentPageDTO); - //分页评论的 id - List commentIds=orderCommentDOList.stream().map(x->x.getId()).collect(Collectors.toList()); - //获取商家最新的评论回复 - List orderCommentReplyDOList=orderCommentReplayMapper.selectCommentNewMerchantReplyByCommentIds(commentIds, - OrderReplyUserTypeEnum.MERCHANT.getValue()); - //评论组装 - List orderCommentItemList=orderCommentDOList.stream() - .flatMap(x->orderCommentReplyDOList.stream() - .filter(y->x.getId()==y.getCommentId()) - .map(y->new OrderCommentPageBO.OrderCommentItem(x.getId(),x.getUserAvatar(),x.getUserNickName(),x.getStar(), - x.getCommentContent(),x.getCommentPics(),x.getReplayCount(),x.getLikeCount(),x.getCreateTime(),y.getReplyContent())) - ).collect(Collectors.toList()); - //总数 - int totalCount=orderCommentMapper.selectCommentTotalCountByProductSkuId(orderCommentPageDTO.getProductSkuId()); - orderCommentPageBO.setOrderCommentItems(orderCommentItemList); - orderCommentPageBO.setTotal(totalCount); - return orderCommentPageBO; - } - - - @Override - public OrderCommentInfoBO getOrderCommentInfo(Integer commentId) { - //查询评论详情 - OrderCommentDO orderCommentDO=orderCommentMapper.selectCommentInfoByCommentId(commentId); - return OrderCommentConvert.INSTANCE.convertOrderCommentInfoBO(orderCommentDO); - } - - @Override - public OrderCommentStateInfoPageBO getOrderCommentStateInfoPage(OrderCommentStateInfoPageDTO orderCommentStateInfoPageDTO) { - OrderCommentStateInfoPageBO orderCommentStateInfoPageBO=new OrderCommentStateInfoPageBO(); - //总数 - int total=orderCommentMapper.selectOrderCommentStateInfoTotal(orderCommentStateInfoPageDTO.getUserId(), - orderCommentStateInfoPageDTO.getCommentState()); - //查询评论状态详情 - List orderCommentDOList=orderCommentMapper.selectOrderCommentStateInfoPage(orderCommentStateInfoPageDTO); - //转化评论状态详情 - List orderCommentStateInfoItemList= - OrderCommentConvert.INSTANCE.convertOrderCommentStateInfoItems(orderCommentDOList); - orderCommentStateInfoPageBO.setTotal(total); - orderCommentStateInfoPageBO.setOrderCommentStateInfoItems(orderCommentStateInfoItemList); - return orderCommentStateInfoPageBO; - } - - @Override - public List getOrderCommentTimeOutPage(OrderCommentTimeOutPageDTO orderCommentTimeOutPageDTO) { - List orderCommentDOList=orderCommentMapper.selectOrderCommentTimeOutPage(orderCommentTimeOutPageDTO); - return OrderCommentConvert.INSTANCE.convertOrderCommentTimeOutBOList(orderCommentDOList); - } - - @Override - public void updateBatchOrderCommentState(List orderCommentTimeOutBOList) { - orderCommentMapper.updateBatchOrderCommentState(OrderCommentStatusEnum.SUCCESS_COMMENT.getValue(),orderCommentTimeOutBOList); - } -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderLogisticsServiceImpl.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderLogisticsServiceImpl.java deleted file mode 100644 index 6630ad288..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderLogisticsServiceImpl.java +++ /dev/null @@ -1,154 +0,0 @@ -package cn.iocoder.mall.order.biz.service; - -import cn.iocoder.common.framework.enums.DeletedStatusEnum; -import cn.iocoder.common.framework.util.DateUtil; -import cn.iocoder.common.framework.util.ServiceExceptionUtil; -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.order.api.OrderLogisticsService; -import cn.iocoder.mall.order.api.bo.OrderLastLogisticsInfoBO; -import cn.iocoder.mall.order.api.bo.OrderLogisticsInfoBO; -import cn.iocoder.mall.order.api.bo.OrderLogisticsInfoWithOrderBO; -import cn.iocoder.mall.order.api.constant.OrderErrorCodeEnum; -import cn.iocoder.mall.order.biz.convert.OrderLogisticsConvert; -import cn.iocoder.mall.order.biz.dao.OrderItemMapper; -import cn.iocoder.mall.order.biz.dao.OrderLogisticsDetailMapper; -import cn.iocoder.mall.order.biz.dao.OrderLogisticsMapper; -import cn.iocoder.mall.order.biz.dao.OrderMapper; -import cn.iocoder.mall.order.biz.dataobject.OrderDO; -import cn.iocoder.mall.order.biz.dataobject.OrderItemDO; -import cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDO; -import cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDetailDO; -import com.google.common.collect.Lists; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - -import java.util.*; -import java.util.stream.Collectors; - -/** - * 订单物流 - * - * @author Sin - * @time 2019-04-12 21:32 - */ -@Service -@org.apache.dubbo.config.annotation.Service(validation = "true", version = "${dubbo.provider.OrderLogisticsService.version}") -public class OrderLogisticsServiceImpl implements OrderLogisticsService { - - @Autowired - private OrderMapper orderMapper; - @Autowired - private OrderItemMapper orderItemMapper; - @Autowired - private OrderLogisticsMapper orderLogisticsMapper; - @Autowired - private OrderLogisticsDetailMapper orderLogisticsDetailMapper; - - @Override - public CommonResult getLogisticsInfo(Integer id) { - OrderLogisticsDO orderLogisticsDO = orderLogisticsMapper.selectById(id); - if (orderLogisticsDO == null) { - return CommonResult.success(null); - } - - List orderLogisticsDetailDOList = orderLogisticsDetailMapper - .selectByOrderLogisticsId(orderLogisticsDO.getId()); - - // 转换数据结构 - List logisticsDetails - = OrderLogisticsConvert.INSTANCE.convert(orderLogisticsDetailDOList); - - OrderLogisticsInfoBO orderLogisticsInfo2BO = OrderLogisticsConvert.INSTANCE.convert(orderLogisticsDO); - orderLogisticsInfo2BO.setDetails(logisticsDetails); - return CommonResult.success(orderLogisticsInfo2BO); - } - - @Override - public CommonResult getLastLogisticsInfo(Integer id) { - OrderLogisticsDO orderLogisticsDO = orderLogisticsMapper.selectById(id); - if (orderLogisticsDO == null) { - return CommonResult.success(null); - } - - OrderLogisticsDetailDO orderLastLogisticsDetailDO = orderLogisticsDetailMapper.selectLastByLogisticsId(id); - - // 转换数据结构 - OrderLastLogisticsInfoBO.LogisticsDetail lastLogisticsDetail - = OrderLogisticsConvert.INSTANCE.convertLastLogisticsDetail(orderLastLogisticsDetailDO); - - OrderLastLogisticsInfoBO lastLogisticsInfoBO = OrderLogisticsConvert - .INSTANCE.convertOrderLastLogisticsInfoBO(orderLogisticsDO); - - lastLogisticsInfoBO.setLastLogisticsDetail(lastLogisticsDetail); - return CommonResult.success(lastLogisticsInfoBO); - } - - @Override - public CommonResult getOrderLogisticsInfo(Integer userId, Integer orderId) { - OrderDO orderDO = orderMapper.selectById(orderId); - - if (orderDO == null) { - return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_EXISTENT.getCode()); - } - - if (!userId.equals(orderDO.getUserId())) { - return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_USER_ORDER.getCode()); - } - - // 获取订单所发货的订单 id - List orderItemDOList = orderItemMapper.selectByDeletedAndOrderId( - DeletedStatusEnum.DELETED_NO.getValue(), orderId); - - // 获取物流 信息 - Set orderLogisticsIds = orderItemDOList.stream() - .filter(o -> o.getOrderLogisticsId() != null) - .map(o -> o.getOrderLogisticsId()) - .collect(Collectors.toSet()); - - List orderLogisticsDOList = Collections.emptyList(); - List orderLogisticsDetailDOList = Collections.emptyList(); - if (!CollectionUtils.isEmpty(orderLogisticsIds)) { - orderLogisticsDOList = orderLogisticsMapper.selectByIds(orderLogisticsIds); - orderLogisticsDetailDOList = orderLogisticsDetailMapper.selectByOrderLogisticsIds(orderLogisticsIds); - } - - // 转换 return 的数据 - List logistics - = OrderLogisticsConvert.INSTANCE.convertLogistics(orderLogisticsDOList); - - List logisticsDetails - = OrderLogisticsConvert.INSTANCE.convertLogisticsDetail(orderLogisticsDetailDOList); - - logisticsDetails.stream().map(o -> { - o.setLogisticsTimeText(DateUtil.format(o.getLogisticsTime(), "yyyy-MM-dd HH:mm")); - return o; - }).collect(Collectors.toList()); - - Map> logisticsDetailMultimap - = logisticsDetails.stream().collect( - Collectors.toMap( - o -> o.getOrderLogisticsId(), - item -> Lists.newArrayList(item), - (oldVal, newVal) -> { - oldVal.addAll(newVal); - return oldVal; - } - ) - ); - - logistics.stream().map(o -> { - if (logisticsDetailMultimap.containsKey(o.getId())) { - o.setDetails(logisticsDetailMultimap.get(o.getId())); - } - return o; - }).collect(Collectors.toList()); - - return CommonResult.success( - new OrderLogisticsInfoWithOrderBO() - .setOrderId(orderId) - .setOrderNo(orderDO.getOrderNo()) - .setLogistics(logistics) - ); - } -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderReturnServiceImpl.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderReturnServiceImpl.java deleted file mode 100644 index 057b0e396..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderReturnServiceImpl.java +++ /dev/null @@ -1,265 +0,0 @@ -package cn.iocoder.mall.order.biz.service; - -import cn.iocoder.common.framework.enums.DeletedStatusEnum; -import cn.iocoder.common.framework.util.ServiceExceptionUtil; -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.system.api.DataDictService; -import cn.iocoder.mall.system.api.bo.datadict.DataDictBO; -import cn.iocoder.mall.order.api.OrderLogisticsService; -import cn.iocoder.mall.order.api.OrderReturnService; -import cn.iocoder.mall.order.api.bo.OrderLastLogisticsInfoBO; -import cn.iocoder.mall.order.api.bo.OrderReturnInfoBO; -import cn.iocoder.mall.order.api.bo.OrderReturnListBO; -import cn.iocoder.mall.order.api.constant.*; -import cn.iocoder.mall.order.api.dto.OrderReturnApplyDTO; -import cn.iocoder.mall.order.api.dto.OrderReturnQueryDTO; -import cn.iocoder.mall.order.biz.convert.OrderReturnConvert; -import cn.iocoder.mall.order.biz.dao.OrderItemMapper; -import cn.iocoder.mall.order.biz.dao.OrderMapper; -import cn.iocoder.mall.order.biz.dao.OrderReturnMapper; -import cn.iocoder.mall.order.biz.dataobject.OrderDO; -import cn.iocoder.mall.order.biz.dataobject.OrderItemDO; -import cn.iocoder.mall.order.biz.dataobject.OrderReturnDO; -import cn.iocoder.mall.pay.api.PayRefundService; -import cn.iocoder.mall.pay.api.dto.refund.PayRefundSubmitDTO; -import org.apache.dubbo.config.annotation.Reference; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; - -import java.util.Collections; -import java.time.LocalDateTime; -import java.util.List; -import java.util.UUID; - -/** - * 订单退货 service - * - * @author Sin - * @time 2019-03-30 15:35 - */ -@Service -@org.apache.dubbo.config.annotation.Service(validation = "true", version = "${dubbo.provider.OrderReturnService.version}") -public class OrderReturnServiceImpl implements OrderReturnService { - - @Autowired - private OrderMapper orderMapper; - @Autowired - private OrderItemMapper orderItemMapper; - @Autowired - private OrderReturnMapper orderReturnMapper; - @Autowired - private OrderLogisticsService orderLogisticsService; - - @Reference(validation = "true", version = "${dubbo.consumer.PayRefundService.version}") - private PayRefundService payRefundService; - @Reference(validation = "true", version = "${dubbo.consumer.DataDictService.version}") - private DataDictService dataDictService; - - - @Override - public CommonResult orderReturnApply(OrderReturnApplyDTO orderReturnDTO) { - OrderDO checkOrder = orderMapper.selectById(orderReturnDTO.getOrderId()); - - // 检查订单是否 存在 - if (checkOrder == null) { - return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_EXISTENT.getCode()); - } - - // 转换 DO - OrderReturnDO orderReturnDO = OrderReturnConvert.INSTANCE.convert(orderReturnDTO); - orderReturnDO - .setOrderId(checkOrder.getId()) - // TODO: 2019-04-27 Sin 服务号生成规则 - .setServiceNumber(UUID.randomUUID().toString().replaceAll("-", "").substring(0, 16)) - .setOrderNo(checkOrder.getOrderNo()) - .setStatus(OrderReturnStatusEnum.RETURN_APPLICATION.getValue()) - .setCreateTime(new Date()); - - // 保存申请信息 - orderReturnMapper.insert(orderReturnDO); - return CommonResult.success(null); - } - - @Override - public String updateRefundSuccess(String orderId, Integer refundPrice) { - return "success"; - } - - @Override - public CommonResult orderApplyInfo(Integer orderId) { - - // 检查订单是否退货 - OrderReturnDO orderReturnDO = orderReturnMapper.selectByOrderId(orderId); - if (orderReturnDO == null) { - return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_RETURN_NO_RETURN_APPLY.getCode()); - } - - List orderItemDOList = orderItemMapper - .selectByDeletedAndOrderId(DeletedStatusEnum.DELETED_NO.getValue(), orderId); - - // 订单不存在 - if (CollectionUtils.isEmpty(orderItemDOList)) { - return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_EXISTENT.getCode()); - } - - // 转换 returnInfo - OrderReturnInfoBO.ReturnInfo returnInfo = OrderReturnConvert.INSTANCE.convert(orderReturnDO); - List itemList = OrderReturnConvert.INSTANCE.convert(orderItemDOList); - - // 物流信息 - CommonResult lastLogisticsCommonResult = orderLogisticsService - .getLastLogisticsInfo(orderReturnDO.getOrderLogisticsId()); - - if (lastLogisticsCommonResult.isError()) { - return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_LOGISTICS_INVOKING_FAIL.getCode()); - } - - OrderLastLogisticsInfoBO lastLogisticsInfoBO = lastLogisticsCommonResult.getData(); - OrderReturnInfoBO orderReturnInfoBO = new OrderReturnInfoBO() - .setOrderItems(itemList) - .setReturnInfo(returnInfo) - .setLastLogisticsInfo(lastLogisticsInfoBO); - - return CommonResult.success(orderReturnInfoBO); - } - - @Override - public CommonResult orderReturnList(OrderReturnQueryDTO queryDTO) { - int totalCount = orderReturnMapper.selectListCount(queryDTO); - if (totalCount <= 0) { - return CommonResult.success( - new OrderReturnListBO() - .setData(Collections.EMPTY_LIST) - .setIndex(queryDTO.getIndex()) - .setPageSize(queryDTO.getPageSize()) - .setTotalCount(0) - ); - } - List orderReturnDOList = orderReturnMapper.selectList(queryDTO); - List orderReturnListBOList - = OrderReturnConvert.INSTANCE.convertListBO(orderReturnDOList); - - return CommonResult.success( - new OrderReturnListBO() - .setData(orderReturnListBOList) - .setIndex(queryDTO.getIndex()) - .setPageSize(queryDTO.getPageSize()) - .setTotalCount(totalCount) - ); - } - - @Override - public CommonResult orderReturnAgree(Integer id) { - OrderReturnDO orderReturnDO = orderReturnMapper.selectById(id); - if (orderReturnDO == null) { - return ServiceExceptionUtil - .error(OrderErrorCodeEnum.ORDER_RETURN_NOT_EXISTENT.getCode()); - } - - orderReturnMapper.updateById( - new OrderReturnDO() - .setId(id) - .setApprovalTime(new Date()) - .setStatus(OrderReturnStatusEnum.APPLICATION_SUCCESSFUL.getValue()) - ); - return CommonResult.success(null); - } - - @Override - public CommonResult orderReturnRefuse(Integer id) { - OrderReturnDO orderReturnDO = orderReturnMapper.selectById(id); - if (orderReturnDO == null) { - return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_RETURN_NOT_EXISTENT.getCode()); - } - - orderReturnMapper.updateById( - new OrderReturnDO() - .setId(id) - .setRefuseTime(new Date()) - .setStatus(OrderReturnStatusEnum.APPLICATION_FAIL.getValue()) - ); - return CommonResult.success(null); - } - - @Override - public CommonResult confirmReceipt(Integer id) { - OrderReturnDO orderReturnDO = orderReturnMapper.selectById(id); - if (orderReturnDO == null) { - return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_RETURN_NOT_EXISTENT.getCode()); - } - - orderReturnMapper.updateById( - new OrderReturnDO() - .setId(id) - .setReceiverTime(new Date()) - .setStatus(OrderReturnStatusEnum.ORDER_RECEIPT.getValue()) - ); - return CommonResult.success(null); - } - - @Override - @Transactional - public CommonResult refund(Integer id, String ip) { - OrderReturnDO orderReturnDO = orderReturnMapper.selectById(id); - if (orderReturnDO == null) { - return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_RETURN_NOT_EXISTENT.getCode()); - } - - // TODO: 2019/5/8 sin, 发送 MQ 消息,申请退货成功! - // TODO: 2019/5/8 sin 退款:支付系统退款 - // TODO: 2019/5/8 sin 退货+退款:退回商品签收后,支付系统退款 - // TODO: 2019/5/8 sin 事务一致性 [重要] - - - CommonResult dataDictResult = dataDictService - .getDataDict(DictKeyConstants.ORDER_RETURN_REASON, orderReturnDO.getReason()); - - if (dataDictResult.isError()) { - return ServiceExceptionUtil.error(OrderErrorCodeEnum.DICT_SERVER_INVOKING_FAIL.getCode()); - } - - // 支付退款 - String orderDescription = dataDictResult.getData() - .getDisplayName() + "(" + orderReturnDO.getDescribe() + ")"; - - CommonResult payResult = payRefundService.submitRefund( - new PayRefundSubmitDTO() - .setAppId(PayAppId.APP_ID_SHOP_ORDER) - .setOrderId(String.valueOf(orderReturnDO.getOrderId())) - .setPrice(orderReturnDO.getRefundPrice()) - .setOrderDescription(orderDescription) - .setCreateIp(ip) - ); - - if (!payResult.isSuccess()) { - return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_RETURN_REFUND_FAILED.getCode()); - } - - // 更新 订单退货 信息 - orderReturnMapper.updateById( - new OrderReturnDO() - .setId(id) - .setClosingTime(new Date()) - .setStatus(OrderReturnStatusEnum.RETURN_SUCCESS.getValue()) - ); - - // 更新订单 - orderMapper.updateById( - new OrderDO() - .setId(orderReturnDO.getOrderId()) - .setClosingTime(new Date()) - .setStatus(OrderStatusEnum.COMPLETED.getValue()) - ); - - // 更新订单 - orderItemMapper.updateByOrderId( - orderReturnDO.getOrderId(), - new OrderItemDO() - .setClosingTime(new Date()) - .setStatus(OrderStatusEnum.COMPLETED.getValue()) - ); - return CommonResult.success(null); - } -} diff --git a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderServiceImpl.java b/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderServiceImpl.java deleted file mode 100644 index 2c55e2db3..000000000 --- a/归档/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderServiceImpl.java +++ /dev/null @@ -1,338 +0,0 @@ -package cn.iocoder.mall.order.biz.service; - -import cn.iocoder.common.framework.enums.DeletedStatusEnum; -import cn.iocoder.common.framework.util.DateUtil; -import cn.iocoder.common.framework.util.ServiceExceptionUtil; -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.order.api.OrderService; -import cn.iocoder.mall.order.api.bo.*; -import cn.iocoder.mall.order.api.constant.*; -import cn.iocoder.mall.order.api.dto.*; -import cn.iocoder.mall.order.biz.constants.OrderDeliveryTypeEnum; -import cn.iocoder.mall.order.biz.constants.OrderRecipientTypeEnum; -import cn.iocoder.mall.order.biz.convert.*; -import cn.iocoder.mall.order.biz.dao.*; -import cn.iocoder.mall.order.biz.dataobject.*; -import cn.iocoder.mall.pay.api.PayTransactionService; -import cn.iocoder.mall.pay.api.bo.transaction.PayTransactionBO; -import cn.iocoder.mall.pay.api.dto.transaction.PayTransactionCreateDTO; -import cn.iocoder.mall.product.api.ProductSpuService; -import cn.iocoder.mall.product.api.bo.ProductSkuDetailBO; -import cn.iocoder.mall.promotion.api.CouponService; -import cn.iocoder.mall.user.api.UserAddressService; -import cn.iocoder.mall.user.api.bo.UserAddressBO; -import io.seata.spring.annotation.GlobalTransactional; -import org.apache.dubbo.config.annotation.Reference; -import com.google.common.collect.Lists; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.Assert; -import org.springframework.util.CollectionUtils; - -import java.util.*; -import java.util.stream.Collectors; - -/** - * 订单 service impl - * - * @author Sin - * @time 2019-03-16 15:08 - */ -@Service -@org.apache.dubbo.config.annotation.Service(validation = "true", version = "${dubbo.provider.OrderService.version}") -public class OrderServiceImpl implements OrderService { - - /** - * 支付过期时间 120 分钟 - */ - public static final int PAY_EXPIRE_TIME = 120; - - @Override - public CommonResult info(Integer userId, Integer orderId) { - OrderDO orderDO = orderMapper.selectById(orderId); - if (orderDO == null) { - return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_EXISTENT.getCode()); - } - - List itemDOList = orderItemMapper - .selectByDeletedAndOrderId(DeletedStatusEnum.DELETED_NO.getValue(), orderId); - - List orderItems - = OrderItemConvert.INSTANCE.convertOrderInfoWithOrderItem(itemDOList); - - Set orderLogisticsIds = itemDOList.stream() - .filter(o -> o.getOrderLogisticsId() != null) - .map(o -> o.getOrderLogisticsId()) - .collect(Collectors.toSet()); - - - - // 收件人信息 - OrderRecipientDO orderRecipientDO = orderRecipientMapper.selectByOrderId(orderId); - - // 订单物流信息 - OrderLogisticsDetailDO orderLogisticsDetailDO = null; - if (!CollectionUtils.isEmpty(orderLogisticsIds)) { - orderLogisticsDetailDO = orderLogisticsDetailMapper.selectLast(orderLogisticsIds); - } - - // 检查是否申请退货 - OrderReturnDO orderReturnDO = orderReturnMapper.selectByOrderId(orderId); - - // convert 信息 - OrderInfoBO.LogisticsDetail logisticsDetail - = OrderLogisticsDetailConvert.INSTANCE.convertLogisticsDetail(orderLogisticsDetailDO); - - OrderInfoBO.Recipient recipient = OrderRecipientConvert.INSTANCE.convertOrderInfoRecipient(orderRecipientDO); - OrderInfoBO orderInfoBO = OrderConvert.INSTANCE.convert(orderDO); - orderInfoBO.setRecipient(recipient); - orderInfoBO.setOrderItems(orderItems); - orderInfoBO.setLatestLogisticsDetail(logisticsDetail); - - // 是否退货 - if (orderReturnDO != null) { - orderInfoBO.setHasOrderReturn(orderReturnDO.getStatus()); - } else { - orderInfoBO.setHasOrderReturn(-1); - } - return CommonResult.success(orderInfoBO); - } - - - - @Override // TODO 芋艿,需要确认下这个方法的用途。因为涉及修改价格和数量。 - public CommonResult updateOrderItem(OrderItemUpdateDTO orderUpdateDTO) { - OrderItemDO orderItemDO = OrderItemConvert.INSTANCE.convert(orderUpdateDTO); - orderItemMapper.updateById(orderItemDO); - - // TODO: 2019-03-24 sin 需要重新计算金额 - // TODO: 2019-03-24 sin 需要记录日志 - return CommonResult.success(null); - } - - @Override - @Transactional - public CommonResult updateOrderItemPayAmount(Integer orderId, Integer orderItemId, Integer payAmount) { - OrderDO orderDO = orderMapper.selectById(orderId); - if (orderDO == null) { - return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_EXISTENT.getCode()); - } - if (payAmount < 0) { - return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_PAY_AMOUNT_NOT_NEGATIVE.getCode()); - } - - // 先更新金额 - orderItemMapper.updateById(new OrderItemDO().setId(orderItemId) -// .setPayAmount(payAmount) TODO 芋艿,这里要修改 - ); - - // 再重新计算订单金额 - List orderItemDOList = orderItemMapper - .selectByDeletedAndOrderId(DeletedStatusEnum.DELETED_NO.getValue(), orderId); -// Integer price = orderCommon.calculatedPrice(orderItemDOList); -// Integer amount = orderCommon.calculatedAmount(orderItemDOList); - Integer price = -1; // TODO 芋艿,这里要修改,价格 - Integer amount = -1; - orderMapper.updateById( - new OrderDO() - .setId(orderId) -// .setPrice(price) TODO 芋艿,这里要修改 - .setPayAmount(amount) - ); - return CommonResult.success(null); - } - - @Override - @Transactional // TODO 芋艿,要校验下 userId 。不然可以取消任何用户的订单列。 - public CommonResult cancelOrder(Integer orderId, Integer reason, String otherReason) { - // 关闭订单,在用户还未付款的时候可操作 - OrderDO orderDO = orderMapper.selectById(orderId); - if (orderDO == null) { - return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_EXISTENT.getCode()); - } - - // 检查专题,只有待付款状态才能操作 - if (!orderDO.getStatus().equals(OrderStatusEnum.WAITING_PAYMENT.getValue())) { - return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_STATUS_NOT_CANCEL.getCode()); - } - - OrderCancelDO orderCancelDO - = (OrderCancelDO) new OrderCancelDO() - .setOrderId(orderDO.getId()) - .setOrderNo(orderDO.getOrderNo()) - .setReason(reason) - .setOtherReason(otherReason) - .setCreateTime(new Date()) - .setUpdateTime(null); - - // 关闭订单,修改状态 item - // TODO FROM 芋艿 TO 小范,更新的时候,where 里面带下 status 避免并发的问题 - orderItemMapper.updateByOrderId( - orderId, - new OrderItemDO().setStatus(OrderStatusEnum.CLOSED.getValue()) - ); - - // 关闭订单,修改状态 order - orderMapper.updateById(new OrderDO().setId(orderId).setStatus(OrderStatusEnum.CLOSED.getValue())); - // 保存取消订单原因 - orderCancelMapper.insert(orderCancelDO); - return CommonResult.success(null); - } - - @Override - @Transactional // TODO FROM 芋艿 TO 小范:泛型,一定要明确哈。 - public CommonResult orderDelivery(OrderDeliveryDTO orderDelivery) { - List orderItemIds = orderDelivery.getOrderItemIds(); - - // 获取所有订单 items // TODO FROM 芋艿 TO 小范,deleted 是默认条件,所以 by 里面可以不带哈 - List allOrderItems = orderItemMapper.selectByDeletedAndOrderId(orderDelivery.getOrderId(), DeletedStatusEnum.DELETED_NO.getValue()); - - // 当前需要发货订单,检查 id 和 status - List needDeliveryOrderItems = allOrderItems.stream() - .filter(orderItemDO -> orderItemIds.contains(orderItemDO.getId()) - && OrderStatusEnum.WAIT_SHIPMENT.getValue() == orderItemDO.getStatus()) - .collect(Collectors.toList()); // TODO 芋艿,如果这里只是比对数字,可以用 Lambda 求和,不需要弄成一个集合的 - // 发货订单,检查 - if (needDeliveryOrderItems.size() != orderItemIds.size()) { - return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_DELIVERY_INCORRECT_DATA.getCode()); - } - - OrderRecipientDO orderRecipientDO = orderRecipientMapper.selectByOrderId(orderDelivery.getOrderId()); - OrderLogisticsDO orderLogisticsDO = OrderLogisticsConvert.INSTANCE.convert(orderRecipientDO); - // 保存物流信息 - orderLogisticsDO - .setLogisticsNo(orderDelivery.getLogisticsNo()) - .setLogistics(orderDelivery.getLogistics()) - .setCreateTime(new Date()) - .setUpdateTime(null); - orderLogisticsMapper.insert(orderLogisticsDO); - - // 关联订单item 和 物流信息 - // TODO FROM 芋艿 TO 小范,更新的时候,where 里面带下 status 避免并发的问题,然后判断下更新数量,不对,就抛出异常。 - orderItemMapper.updateByIds( - orderItemIds, - new OrderItemDO() - .setOrderLogisticsId(orderLogisticsDO.getId()) - .setStatus(OrderStatusEnum.ALREADY_SHIPMENT.getValue()) - ); - - // 子订单是否全部发货,如果发完,就更新 order - List unShippedOrderItems = allOrderItems.stream() - .filter(orderItemDO -> OrderStatusEnum.WAIT_SHIPMENT.getValue() == orderItemDO.getStatus() - && !orderItemIds.contains(orderItemDO.getId())) - .collect(Collectors.toList()); - if (unShippedOrderItems.size() <= 0) { - // TODO FROM 芋艿 TO 小范,更新的时候,where 里面带下 status 避免并发的问题 - orderMapper.updateById( - new OrderDO() - .setId(orderDelivery.getOrderId()) - .setStatus(OrderStatusEnum.ALREADY_SHIPMENT.getValue()) - ); - } - // 返回成功 - return CommonResult.success(null); - } - - @Override - public CommonResult updateOrderRemake(Integer orderId, String remake) { - // 此处不做订单校验,直接设置备注即可 - orderMapper.updateById(new OrderDO().setId(orderId).setRemark(remake)); - return CommonResult.success(null); - } - - @Override - @Transactional // TODO FROM 芋艿 to 小范,先不做这个功能,电商一班不存在这个功能哈。 - public CommonResult deleteOrderItem(OrderItemDeletedDTO orderItemDeletedDTO) { - Integer orderId = orderItemDeletedDTO.getOrderId(); - List orderItemIds = orderItemDeletedDTO.getOrderItemIds(); - - // 获取当前有效的订单 item - List orderItemDOList = orderItemMapper - .selectByDeletedAndOrderId(DeletedStatusEnum.DELETED_NO.getValue(), orderId); - - List effectiveOrderItems = orderItemDOList.stream() - .filter(orderItemDO -> !orderItemIds.contains(orderItemDO.getId())) - .collect(Collectors.toList()); - - // 检查订单 item,必须要有一个 item - if (CollectionUtils.isEmpty(effectiveOrderItems)) { - return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_ITEM_ONLY_ONE.getCode()); - } - - // 更新订单 item - orderItemMapper.updateByIds( - orderItemIds, - (OrderItemDO) new OrderItemDO() - .setDeleted(DeletedStatusEnum.DELETED_YES.getValue()) - ); - - // 更新订单 amount -// Integer totalAmount = orderCommon.calculatedAmount(effectiveOrderItems); - Integer totalAmount = -1; // TODO 芋艿,需要修改下,价格相关 - orderMapper.updateById( - new OrderDO() - .setId(orderId) - .setPayAmount(totalAmount) - ); - return CommonResult.success(null); - } - - @Override - public CommonResult confirmReceiving(Integer userId, Integer orderId) { - OrderDO orderDO = orderMapper.selectById(orderId); - - // 是否该用户的订单 - if (!userId.equals(orderDO.getUserId())) { - return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_USER_ORDER.getCode()); - } - - if (OrderStatusEnum.ALREADY_SHIPMENT.getValue() != orderDO.getStatus()) { - return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_UNABLE_CONFIRM_ORDER.getCode()); - } - - // TODO FROM 芋艿 TO 小范,更新的时候,where 里面带下 status 避免并发的问题 - orderMapper.updateById( - new OrderDO() - .setId(orderId) - .setReceiverTime(new Date()) - .setStatus(OrderStatusEnum.COMPLETED.getValue()) - - ); - - orderItemMapper.updateByOrderId( - orderId, - new OrderItemDO() - .setStatus(OrderStatusEnum.COMPLETED.getValue()) - .setReceiverTime(new Date()) - ); - return CommonResult.success(null); - } - - @Override - public CommonResult updateLogistics(OrderLogisticsUpdateDTO orderLogisticsDTO) { - OrderLogisticsDO orderLogisticsDO = OrderLogisticsConvert.INSTANCE.convert(orderLogisticsDTO); - orderLogisticsMapper.updateById(orderLogisticsDO); - return CommonResult.success(null); - } - - @Override - public CommonResult deleteOrder(Integer id) { - // 删除订单操作,一般用于 用户端删除,是否存在检查可以过掉 - orderMapper.updateById((OrderDO) new OrderDO() - .setId(id) - .setDeleted(DeletedStatusEnum.DELETED_YES.getValue()) - ); - return CommonResult.success(null); - } - - @Override - public CommonResult listenerConfirmGoods() { - return null; - } - - @Override - public CommonResult listenerExchangeGoods() { - return null; - } -} diff --git a/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderCancelMapper.xml b/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderCancelMapper.xml deleted file mode 100644 index 1f36e4891..000000000 --- a/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderCancelMapper.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - id, order_id, order_no, reason, other_reason, - create_time, update_time - - - - - INSERT INTO `order_cancel` ( - order_id, order_no, reason, other_reason, - create_time, update_time - ) VALUES ( - #{orderId}, #{orderNo}, #{reason}, #{otherReason}, - #{createTime}, #{updateTime} - ) - - diff --git a/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderCommentMapper.xml b/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderCommentMapper.xml deleted file mode 100644 index e5f96e209..000000000 --- a/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderCommentMapper.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - id,order_id,order_no,product_spu_id,product_spu_name,product_sku_id,product_sku_attrs,product_sku_price,product_sku_pic_url, - user_id,user_avatar,user_nick_name,star,product_description_star,logistics_star,merchant_star,replay_count,like_count,comment_content, - comment_pics,comment_state,create_time,update_time - - - - - INSERT INTO order_comment(order_id,order_no,product_spu_id,product_spu_name,product_sku_id, - product_sku_attrs,product_sku_price,product_sku_pic_url,user_id,user_avatar,user_nick_name,star, - product_description_star,logistics_star,merchant_star,comment_content,comment_pics,comment_state,create_time,update_time) - VALUES (#{orderId},#{orderNo},#{productSpuId},#{productSpuName},#{productSkuId},#{productSkuAttrs}, - #{productSkuPrice},#{productSkuPicUrl},#{userId},#{userAvatar},#{userNickName},#{star}, - #{productDescriptionStar},#{logisticsStar},#{merchantStar},#{commentContent},#{commentPics},#{commentState},#{createTime}, #{updateTime}); - - - - - - - - - - - - - - - - - - - - - - - - UPDATE order_comment - SET - comment_state = #{commentState} - WHERE - id - IN - - - #{item.id} - - - - - - - diff --git a/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderCommentReplayMapper.xml b/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderCommentReplayMapper.xml deleted file mode 100644 index ada6257d4..000000000 --- a/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderCommentReplayMapper.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - id,comment_id,reply_type,parent_id,parent_user_id,parent_user_nick_name,parent_user_avatar,reply_content, - reply_user_id,reply_user_nick_name,reply_user_avatar,user_type,reply_like_count,create_time,update_time - - - - - INSERT INTO order_comment_replay(comment_id,reply_type,parent_id,parent_user_id,parent_user_nick_name,parent_user_avatar,reply_content,reply_user_id, - reply_user_nick_name,reply_user_avatar,user_type,create_time,update_time) - VALUES (#{commentId},#{replyType},#{parentId},#{parentUserId},#{parentUserNickName},#{parentUserAvatar},#{replyContent},#{replyUserId}, - #{replyUserNickName},#{replyUserAvatar},#{userType},#{createTime},#{updateTime}) - - - - - - - - - - - - - - - diff --git a/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderItemMapper.xml b/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderItemMapper.xml deleted file mode 100644 index f4bdf2c3c..000000000 --- a/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderItemMapper.xml +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - id, order_id, order_no, sku_id, sku_name, sku_image, order_logistics_id, - quantity, origin_price, buy_price, present_price, buy_total, discount_total, present_total, - payment_time, delivery_time, receiver_time, closing_time, - has_return_exchange, delivery_type, status, - create_time, update_time, deleted - - - - - INSERT INTO `order_item` ( - order_id, order_no, sku_id, sku_name, sku_image, order_logistics_id, - quantity, origin_price, buy_price, present_price, buy_total, discount_total, present_total, - payment_time, delivery_time, receiver_time, closing_time, - has_return_exchange, delivery_type, status, - create_time, update_time, deleted - ) VALUES - - (#{item.orderId}, #{item.orderNo}, #{item.skuId}, #{item.skuName}, #{item.skuImage}, #{item.orderLogisticsId}, - #{item.quantity}, #{item.originPrice}, #{item.buyPrice}, #{item.presentPrice}, #{item.buyTotal}, #{item.discountTotal}, #{item.presentTotal}, - #{item.paymentTime}, #{item.deliveryTime}, #{item.receiverTime}, #{item.closingTime}, - #{item.hasReturnExchange}, #{item.deliveryType}, #{item.status}, - #{item.createTime}, #{item.updateTime}, #{item.deleted}) - - - - - - - - , order_id = #{orderItemDO.orderId} - - - , order_no = #{orderItemDO.orderNo} - - - , order_logistics_id = #{orderItemDO.orderLogisticsId} - - - , sku_id = #{orderItemDO.skuId} - - - , sku_name = #{orderItemDO.skuName} - - - , sku_image = #{orderItemDO.skuImage} - - - , quantity = #{orderItemDO.quantity} - - - - - - - - - - - , payment_time = #{orderItemDO.paymentTime} - - - , delivery_time = #{orderItemDO.deliveryTime} - - - , receiver_time = #{orderItemDO.receiverTime} - - - , closing_time = #{orderItemDO.closingTime} - - - - , has_return_exchange = #{orderItemDO.hasReturnExchange} - - - , status = #{orderItemDO.status} - - - , delivery_type = #{orderItemDO.deliveryType} - - - , `deleted` = #{orderItemDO.deleted} - - - , create_time = #{orderItemDO.createTime} - - - , update_time = #{orderItemDO.updateTime} - - - - - - - UPDATE `order_item` - - WHERE id = #{orderItemDO.id} - - - - - UPDATE `order_item` - - WHERE id IN - - #{id} - - - - - - UPDATE `order_item` - - WHERE order_id = #{orderId} - - - - - - - - - - - diff --git a/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderLogisticsDetailMapper.xml b/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderLogisticsDetailMapper.xml deleted file mode 100644 index 4f2745035..000000000 --- a/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderLogisticsDetailMapper.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - id, - order_logistics_id, - logistics_time, - logistics_information, - create_time, - update_time - - - - - INSERT INTO cart_item (order_logistics_id, logistics_time, logistics_information, - create_time, update_time) - VALUES (#{orderLogisticsId}, #{logisticsTime}, #{logisticsInformation}, - #{createTime}, #{updateTime}) - - - - - - - - - - - - - - diff --git a/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderLogisticsMapper.xml b/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderLogisticsMapper.xml deleted file mode 100644 index 663dff66e..000000000 --- a/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderLogisticsMapper.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - id, area_no, `name`, mobile, address, logistics, logistics_no, create_time, update_time - - - - - INSERT INTO `order_logistics` ( - area_no, `name`, mobile, address, logistics, logistics_no, create_time, update_time - ) VALUES ( - #{areaNo}, #{name}, #{mobile}, #{address}, - #{logistics}, #{logisticsNo}, #{createTime}, #{updateTime} - ) - - - - - - - , area_no = #{areaNo} - - - , `name` = #{name} - - - , mobile = #{mobile} - - - , address = #{address} - - - , logistics = #{logistics} - - - , logistics_no = #{logisticsNo} - - - - - - - UPDATE `order_logistics` - - WHERE id = #{id} - - - - - - - - diff --git a/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderMapper.xml b/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderMapper.xml deleted file mode 100644 index e5bb8981d..000000000 --- a/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderMapper.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - AND `status` = #{status} - - - AND `user_id` = #{userId} - - - AND `id` = #{id} - - - AND `order_no` = #{orderNo} - - - AND `has_return_exchange` = #{hasReturnExchange} - - - AND `create_time` >= #{startCreateTime} - AND `create_time` <= #{endCreateTime} - - - - - - - - - diff --git a/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderRecipientMapper.xml b/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderRecipientMapper.xml deleted file mode 100644 index ca08c48bf..000000000 --- a/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderRecipientMapper.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - id, order_id, `area_no`, `name`, mobile, address, `type`, - create_time, update_time - - - - - INSERT INTO `order_recipient` ( - order_id, `area_no`, `name`, mobile, address, - `type`, create_time, update_time - ) VALUES ( - #{orderId}, #{areaNo}, #{name}, #{mobile}, #{address}, - #{type}, #{createTime,jdbcType=TIMESTAMP} , #{updateTime} - ) - - - - - - - - - diff --git a/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderReturnMapper.xml b/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderReturnMapper.xml deleted file mode 100644 index 6748a6b8c..000000000 --- a/归档/moved/order/order-service-impl/src/main/resources/mapper/OrderReturnMapper.xml +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - id, - service_number, - order_id, - order_no, - order_logistics_id, - refund_price, - reason, - `describe`, - approval_time, - refuse_time, - logistics_time, - receiver_time, - closing_time, - service_type, - status, - create_time, - update_time - - - - - INSERT INTO `order_return` ( - service_number, order_id, order_no, order_logistics_id, - refund_price, reason, `describe`, - approval_time, refuse_time, logistics_time, receiver_time, closing_time, - service_type, status, - create_time, update_time) - VALUES ( - #{serviceNumber}, #{orderId}, #{orderNo}, #{orderLogisticsId}, - ${refundPrice}, #{reason}, #{describe}, - #{approvalTime}, #{refuse_time}, #{logisticsTime}, #{receiverTime}, #{closingTime}, - #{serviceType}, #{status}, #{createTime}, #{updateTime}) - - - - - - - , order_logistics_id = #{orderLogisticsId} - - - , refund_price = #{refundPrice} - - - , reason = #{reason} - - - , `describe` = #{describe} - - - , approval_time = #{approvalTime} - - - , refuse_time = #{refuseTime} - - - , logistics_time = #{logisticsTime} - - - , receiver_time = #{receiverTime} - - - , closing_time = #{closingTime} - - - , service_type = #{serviceType} - - - , status = #{status} - - - , create_time = #{createTime} - - - , update_time = #{updateTime} - - - - - - - UPDATE `order_return` - - WHERE id = #{id} - - - - - - - - - AND status = #{status} - - - AND service_number = #{serviceNumber} - - - AND order_id = #{orderId} - - - AND order_no = #{orderNo} - - - AND create_time >= #{startCreateTime} - AND create_time <= #{endCreateTime} - - - - - - - - - - - - - diff --git a/归档/moved/order/order-service-impl/src/main/resources/sql/mall_order.sql b/归档/moved/order/order-service-impl/src/main/resources/sql/mall_order.sql deleted file mode 100644 index 4683263a8..000000000 --- a/归档/moved/order/order-service-impl/src/main/resources/sql/mall_order.sql +++ /dev/null @@ -1,121 +0,0 @@ -DROP TABLE `order`; -DROP TABLE `order_item`; -DROP TABLE `order_exchange`; -DROP TABLE `order_return`; -DROP TABLE `order_logistics`; -DROP TABLE `order_logistics_detail`; - -CREATE TABLE `order` ( -`id` int NOT NULL AUTO_INCREMENT COMMENT 'Id,自增长', -`order_logistics_id` int NOT NULL COMMENT '物流id', -`order_no` varchar(50) NOT NULL COMMENT '订单单号', -`price` int(10) NULL COMMENT '金额(分)', -`payment_time` datetime NULL COMMENT '付款时间', -`delivery_time` datetime NULL COMMENT '发货时间', -`receiver_time` datetime NULL COMMENT '收货时间', -`closing_time` datetime NULL COMMENT '成交时间', -`has_return_exchange` smallint NULL COMMENT '是否退换货', -`remark` varchar(255) NULL COMMENT '备注', -`status` smallint(2) NULL COMMENT '状态(如果有多个商品分开发货需要全部商品发完才会改变状态) 0、待付款 1、待发货 2、待收货 3、已完成 4、已关闭', -`create_time` datetime NULL COMMENT '订单创建时间', -`update_time` datetime NULL COMMENT '更新时间', -`deleted` smallint NULL COMMENT '删除状态', -PRIMARY KEY (`id`) -); -CREATE TABLE `order_item` ( -`id` int NOT NULL AUTO_INCREMENT COMMENT 'id自增长', -`order_id` int NOT NULL COMMENT '订单编号', -`order_no` varchar(50) NOT NULL COMMENT '订单号', -`sku_id` int NOT NULL COMMENT '商品编号', -`quantity` int(3) NOT NULL COMMENT '商品数量', -`price` int(255) NOT NULL COMMENT '金额', -`payment_time` datetime NULL COMMENT '付款时间', -`delivery_time` datetime NULL COMMENT '发货时间', -`receiver_time` datetime NULL COMMENT '收货时间', -`closing_time` datetime NULL, -`has_return_exchange` int NULL COMMENT '是否退换货', -`create_time` datetime NULL COMMENT '创建时间', -`update_time` datetime NULL COMMENT '更新时间', -`status` smallint(2) NOT NULL COMMENT '状态:0、代发货 1、已发货 2、已收货 20、换货中 21、换货成功 40、退货中 41、已退货', -`delete` smallint(2) NOT NULL COMMENT '删除状态', -PRIMARY KEY (`id`) -); - -CREATE TABLE `order_exchange` ( -`id` int(11) NOT NULL AUTO_INCREMENT, -`order_id` int(11) NOT NULL, -`order_no` varchar(50) NOT NULL, -`sku_id` int(11) NOT NULL, -`exchange_sku_id` int(11) NOT NULL COMMENT '换货商品id', -`exchange_order_logistics_id` int(11) NOT NULL COMMENT '换货物流id', -`receiver_order_logistics_id` int(11) NOT NULL COMMENT '收件地址', -`order_reason_id` int(11) NULL COMMENT '换货原因', -`reason` varchar(255) NULL COMMENT '换货原因 (其他的时候)', -`payment_time` datetime NULL COMMENT '付款时间', -`delivery_time` datetime NULL COMMENT '发货时间', -`receiver_time` datetime NULL COMMENT '收货时间', -`closing_time` datetime NULL COMMENT '成交时间', -`create_time` datetime NULL COMMENT '创建时间', -`update_time` datetime NULL COMMENT '更新时间', -`delete` smallint(2) NULL COMMENT '删除状态', -`order_type` int(2) NULL COMMENT '订单类型 0、为 Order 订单 1、为 OrderItem 订单', -`status` int(2) NULL COMMENT '状态 申请换货、申请成功、申请失败、换货中、换货成功', -PRIMARY KEY (`id`) -); - - -CREATE TABLE `order_return` ( -`id` int NOT NULL AUTO_INCREMENT COMMENT 'id自增长', -`order_id` int NOT NULL COMMENT '订单编号', -`order_no` varchar(50) NOT NULL COMMENT '订单号', -`sku_id` int NOT NULL COMMENT '商品编号', -`order_item_id` int(11) NOT NULL COMMENT '订单item id', -`order_logistics_id` int(11) NOT NULL COMMENT '物流 id', - -`order_reason_id` int(11) NULL COMMENT '退货原因', -`reason` varchar(255) NULL COMMENT '换货原因 (其他的时候)', -`create_time` datetime NULL COMMENT '创建时间', -`approval_time` datetime NULL COMMENT '同意时间', -`logistics_time` datetime NULL COMMENT '物流时间(填写物流单号时间)', -`receiver_time` datetime NULL COMMENT '收货时间', -`closing_time` datetime NULL COMMENT '成交时间', -`order_type` int(2) NULL COMMENT '订单类型 0、为 Order 订单 1、为 OrderItem 订单', - -`update_time` datetime NULL COMMENT '更新时间', -`delete` smallint(2) NULL COMMENT '删除状态', -`status` int(2) NULL COMMENT '状态 申请换货、申请成功、申请失败、退货中、退货成功', -PRIMARY KEY (`id`) -); - - -CREATE TABLE `order_logistics` ( -`id` int NOT NULL AUTO_INCREMENT COMMENT 'id自增长', -`area_no` int NOT NULL COMMENT '订单编号', -`name` VARCHAR(20) NOT NULL COMMENT '名称', -`mobile` VARCHAR(20) NOT NULL COMMENT '手机号', -`address` VARCHAR(255) NOT NULL COMMENT '详细地址', -`logistics_no` VARCHAR(20) NOT NULL COMMENT '物流单号', -PRIMARY KEY (`id`) -); - - -CREATE TABLE `order_logistics_detail` ( -`id` int NOT NULL AUTO_INCREMENT COMMENT 'id自增长', -`order_logistics_id` int NOT NULL COMMENT '物流编号', -`logistics_time` datetime NOT NULL COMMENT '物流时间', -`logistics_information` VARCHAR(20) NOT NULL COMMENT '物流信息', -PRIMARY KEY (`id`) -); - - - - - - - - - - - - - diff --git a/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/api/PayRefundService.java b/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/api/PayRefundService.java deleted file mode 100644 index 6c8ed94c4..000000000 --- a/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/api/PayRefundService.java +++ /dev/null @@ -1,27 +0,0 @@ -package cn.iocoder.mall.pay.api; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.pay.api.bo.refund.PayRefundPageBO; -import cn.iocoder.mall.pay.api.bo.refund.PayRefundSubmitBO; -import cn.iocoder.mall.pay.api.dto.refund.PayRefundPageDTO; -import cn.iocoder.mall.pay.api.dto.refund.PayRefundSubmitDTO; - -public interface PayRefundService { - - CommonResult submitRefund(PayRefundSubmitDTO payRefundSubmitDTO); - - /** - * 更新退款支付成功 - * - * 该接口用于不同支付平台,退款成功后,回调该接口 - * - * @param payChannel 支付渠道 - * @param params 回调参数。 - * 因为不同平台,能够提供的参数不同,所以使用 String 类型统一接收,然后在使用不同的 AbstractPaySDK 进行处理。 - * @return 是否支付成功 - */ - CommonResult updateRefundSuccess(Integer payChannel, String params); - - PayRefundPageBO getRefundPage(PayRefundPageDTO payRefundPageDTO); - -} diff --git a/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/api/bo/refund/PayRefundBO.java b/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/api/bo/refund/PayRefundBO.java deleted file mode 100644 index 8a7101d4d..000000000 --- a/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/api/bo/refund/PayRefundBO.java +++ /dev/null @@ -1,102 +0,0 @@ -package cn.iocoder.mall.pay.api.bo.refund; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.time.LocalDateTime; - -/** - * 支付退款 BO - */ -@Data -@Accessors(chain = true) -public class PayRefundBO { - - /** - * 编号,自增 - */ - private Integer id; - /** - * 支付交易编号 - */ - private Integer transactionId; - /** - * 生成传输给第三方的退款号 - * - * 唯一索引 - */ - private String refundCode; - /** - * 应用编号 - * - * 不同业务线分配不同的 appId - * 举个例子, - * 1. 电商系统的订单,appId = 1024 - * 2. 活动系统的订单,appId = 2048 - */ - private String appId; - /** - * 业务线的订单编号 - * - * 1. 使用 String 的原因是,业务线可能使用 String 做为编号 - * 2. 每个 appId 下,orderId 唯一 - */ - private String orderId; - /** - * 发起交易的 IP - */ - private String createIp; - /** - * 业务退款描述 - */ - private String orderDescription; - /** - * 退款金额,单位:分。 - * - * TODO 暂时不考虑货币类型。 - */ - private Integer price; - /** - * 退款状态 - * - * @see cn.iocoder.mall.pay.api.constant.PayRefundStatus - */ - private Integer status; - /** - * 回调业务线完成时间 - */ - private LocalDateTime finishTime; - /** - * 异步通知地址 - */ - private String notifyUrl; - /** - * 扩展内容 - * - * 异步通知的时候填充回调的数据 - */ - private String extensionData; - /** - * 退款渠道 - */ - private Integer refundChannel; - /** - * 第三方退款成功的时间 - */ - private LocalDateTime refundTime; - /** - * 收到第三方系统通知的时间 - * - * 一般情况下,即第三方系统的异步通知 - */ - private LocalDateTime notifyTime; - /** - * 第三方的流水号 - */ - private String tradeNo; - /** - * 创建时间 - */ - private LocalDateTime createTime; - -} diff --git a/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/api/bo/refund/PayRefundPageBO.java b/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/api/bo/refund/PayRefundPageBO.java deleted file mode 100644 index e3d1bc446..000000000 --- a/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/api/bo/refund/PayRefundPageBO.java +++ /dev/null @@ -1,25 +0,0 @@ -package cn.iocoder.mall.pay.api.bo.refund; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.List; - -/** - * 支付退款 Page BO - */ -@Data -@Accessors(chain = true) -public class PayRefundPageBO implements Serializable { - - /** - * 支付退款数组 - */ - private List list; - /** - * 总量 - */ - private Integer total; - -} diff --git a/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/api/bo/refund/PayRefundSubmitBO.java b/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/api/bo/refund/PayRefundSubmitBO.java deleted file mode 100644 index 7fc734bc8..000000000 --- a/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/api/bo/refund/PayRefundSubmitBO.java +++ /dev/null @@ -1,18 +0,0 @@ -package cn.iocoder.mall.pay.api.bo.refund; - -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 退款单结果 BO - */ -@Data -@Accessors(chain = true) -public class PayRefundSubmitBO { - - /** - * 退款 - */ - private Integer id; - -} diff --git a/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/api/dto/refund/PayRefundPageDTO.java b/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/api/dto/refund/PayRefundPageDTO.java deleted file mode 100644 index 349eef7b9..000000000 --- a/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/api/dto/refund/PayRefundPageDTO.java +++ /dev/null @@ -1,46 +0,0 @@ -package cn.iocoder.mall.pay.api.dto.refund; - -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; -import java.time.LocalDateTime; - -/** - * 支付退款分页 DTO - */ -@Data -@Accessors(chain = true) -public class PayRefundPageDTO { - - /** - * 创建时间(开始) - */ - private LocalDateTime createBeginTime; - /** - * 创建时间(结束) - */ - private LocalDateTime createEndTime; - /** - * 完成时间(开始) - */ - private LocalDateTime finishBeginTime; - /** - * 完成时间(结束) - */ - private LocalDateTime finishEndTime; - /** - * 退款状态 - */ - private Integer status; - /** - * 支付渠道 - */ - private Integer payChannel; - - @NotNull(message = "页码不能为空") - private Integer pageNo; - @NotNull(message = "每页条数不能为空") - private Integer pageSize; - -} diff --git a/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/api/dto/refund/PayRefundSubmitDTO.java b/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/api/dto/refund/PayRefundSubmitDTO.java deleted file mode 100644 index 2f9cf9901..000000000 --- a/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/api/dto/refund/PayRefundSubmitDTO.java +++ /dev/null @@ -1,47 +0,0 @@ -package cn.iocoder.mall.pay.api.dto.refund; - -import lombok.Data; -import lombok.experimental.Accessors; -import org.hibernate.validator.constraints.Length; - -import javax.validation.constraints.DecimalMin; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import java.io.Serializable; - -/** - * 支付退款创建 DTO - */ -@Data -@Accessors(chain = true) -public class PayRefundSubmitDTO implements Serializable { - - /** - * 应用编号 - */ - @NotEmpty(message = "应用编号不能为空") - private String appId; - /** - * 发起交易的 IP - */ - @NotEmpty(message = "IP 不能为空") - private String createIp; - /** - * 业务线的订单编号 - */ - @NotEmpty(message = "订单号不能为空") - private String orderId; - /** - * 退款描述 - */ - @NotEmpty(message = "退款描述不能为空") - @Length(max = 128, message = "退款描述长度不能超过128") - private String orderDescription; - /** - * 支付金额,单位:分。 - */ - @NotNull(message = "金额不能为空") - @DecimalMin(value = "0", inclusive = false, message = "金额必须大于零") - private Integer price; - -} diff --git a/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/application/controller/admins/AdminsPayRefundController.java b/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/application/controller/admins/AdminsPayRefundController.java deleted file mode 100644 index 354281c81..000000000 --- a/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/application/controller/admins/AdminsPayRefundController.java +++ /dev/null @@ -1,68 +0,0 @@ -package cn.iocoder.mall.pay.application.controller.admins; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.pay.api.PayRefundService; -import cn.iocoder.mall.pay.api.PayTransactionService; -import cn.iocoder.mall.pay.api.bo.refund.PayRefundBO; -import cn.iocoder.mall.pay.api.bo.refund.PayRefundPageBO; -import cn.iocoder.mall.pay.api.bo.transaction.PayTransactionBO; -import cn.iocoder.mall.pay.api.dto.refund.PayRefundPageDTO; -import cn.iocoder.mall.pay.application.convert.PayRefundConvert; -import cn.iocoder.mall.pay.application.vo.admins.AdminsPayRefundPageVO; -import org.apache.dubbo.config.annotation.Reference; -import org.springframework.format.annotation.DateTimeFormat; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import java.time.LocalDateTime; -import java.util.Map; -import java.util.stream.Collectors; - -import static cn.iocoder.common.framework.vo.CommonResult.success; - -@RestController -@RequestMapping("admins/refund") -public class AdminsPayRefundController { - - @Reference(validation = "true", version = "${dubbo.provider.PayRefundService.version}") - private PayRefundService payRefundService; - @Reference(validation = "true", version = "${dubbo.provider.PayTransactionService.version}") - private PayTransactionService payTransactionService; - - @GetMapping("/page") - public CommonResult page(@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @RequestParam(value = "createBeginTime", required = false) LocalDateTime createBeginTime, - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @RequestParam(value = "createEndTime", required = false) LocalDateTime createEndTime, - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @RequestParam(value = "finishBeginTime", required = false) LocalDateTime finishBeginTime, - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @RequestParam(value = "finishEndTime", required = false) LocalDateTime finishEndTime, - @RequestParam(value = "status", required = false) Integer status, - @RequestParam(value = "payChannel", required = false) Integer payChannel, - @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { - PayRefundPageDTO payRefundPageDTO = new PayRefundPageDTO() - .setCreateBeginTime(createBeginTime).setCreateEndTime(createEndTime) - .setFinishBeginTime(finishBeginTime).setFinishEndTime(finishEndTime) - .setStatus(status).setPayChannel(payChannel) - .setPageNo(pageNo).setPageSize(pageSize); - // 执行查询 - PayRefundPageBO refundBOPage = payRefundService.getRefundPage(payRefundPageDTO); - AdminsPayRefundPageVO result = new AdminsPayRefundPageVO() - .setList(PayRefundConvert.INSTANCE.convertList(refundBOPage.getList())) - .setTotal(refundBOPage.getTotal()); - if (result.getList().isEmpty()) { - return success(result); - } - // 拼接结果 - Map transactionMap = payTransactionService.getTransactionList( - result.getList().stream().map(PayRefundBO::getTransactionId).collect(Collectors.toSet())) - .stream().collect(Collectors.toMap(PayTransactionBO::getId, transaction -> transaction)); - result.getList().forEach(refund -> refund.setTransaction(transactionMap.get(refund.getTransactionId()))); - return success(result); - } - -} diff --git a/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/application/vo/admins/AdminsPayRefundDetailVO.java b/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/application/vo/admins/AdminsPayRefundDetailVO.java deleted file mode 100644 index 1a5966202..000000000 --- a/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/application/vo/admins/AdminsPayRefundDetailVO.java +++ /dev/null @@ -1,21 +0,0 @@ -package cn.iocoder.mall.pay.application.vo.admins; - -import cn.iocoder.mall.pay.api.bo.refund.PayRefundBO; -import cn.iocoder.mall.pay.api.bo.transaction.PayTransactionBO; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 支付退款详细 VO - */ -@Data -@Accessors(chain = true) -public class AdminsPayRefundDetailVO extends PayRefundBO { // TODO 芋艿,暂时偷懒下 - - /** - * 支付交易 - */ - private PayTransactionBO transaction; - -} - diff --git a/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/application/vo/admins/AdminsPayRefundPageVO.java b/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/application/vo/admins/AdminsPayRefundPageVO.java deleted file mode 100644 index 2410b42b2..000000000 --- a/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/application/vo/admins/AdminsPayRefundPageVO.java +++ /dev/null @@ -1,25 +0,0 @@ -package cn.iocoder.mall.pay.application.vo.admins; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.List; - -/** - * 支付退款 Page VO - */ -@Data -@Accessors(chain = true) -public class AdminsPayRefundPageVO implements Serializable { - - /** - * 支付退款数组 - */ - private List list; - /** - * 总量 - */ - private Integer total; - -} diff --git a/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/biz/service/PayRefundServiceImpl.java b/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/biz/service/PayRefundServiceImpl.java deleted file mode 100644 index 12ac48553..000000000 --- a/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/biz/service/PayRefundServiceImpl.java +++ /dev/null @@ -1,185 +0,0 @@ -package cn.iocoder.mall.pay.biz.service; - -import cn.iocoder.common.framework.util.DateUtil; -import cn.iocoder.common.framework.util.MathUtil; -import cn.iocoder.common.framework.util.ServiceExceptionUtil; -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.pay.api.PayRefundService; -import cn.iocoder.mall.pay.api.bo.refund.PayRefundPageBO; -import cn.iocoder.mall.pay.api.bo.refund.PayRefundSubmitBO; -import cn.iocoder.mall.pay.api.constant.PayErrorCodeEnum; -import cn.iocoder.mall.pay.api.constant.PayRefundStatus; -import cn.iocoder.mall.pay.api.constant.PayTransactionStatusEnum; -import cn.iocoder.mall.pay.api.dto.refund.PayRefundPageDTO; -import cn.iocoder.mall.pay.api.dto.refund.PayRefundSubmitDTO; -import cn.iocoder.mall.pay.biz.client.AbstractPaySDK; -import cn.iocoder.mall.pay.biz.client.PaySDKFactory; -import cn.iocoder.mall.pay.biz.client.RefundSuccessBO; -import cn.iocoder.mall.pay.biz.convert.PayRefundConvert; -import cn.iocoder.mall.pay.biz.dao.PayRefundMapper; -import cn.iocoder.mall.pay.biz.dataobject.PayAppDO; -import cn.iocoder.mall.pay.biz.dataobject.PayRefundDO; -import cn.iocoder.mall.pay.biz.dataobject.PayTransactionDO; -import cn.iocoder.mall.pay.biz.dataobject.PayTransactionExtensionDO; -import org.apache.rocketmq.spring.core.RocketMQTemplate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.time.LocalDateTime; - -@Service -@org.apache.dubbo.config.annotation.Service(validation = "true", version = "${dubbo.provider.PayRefundService.version}") -public class PayRefundServiceImpl implements PayRefundService { - - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Autowired - private PayRefundMapper payRefundMapper; - - @Autowired - private PayAppServiceImpl payAppService; - @Autowired - private PayNotifyServiceImpl payNotifyService; - @Autowired - private PayTransactionServiceImpl payTransactionService; - - @Resource - private RocketMQTemplate rocketMQTemplate; - - @Override - public CommonResult submitRefund(PayRefundSubmitDTO payRefundSubmitDTO) { - // 校验 App 是否有效 - PayAppDO payAppDO = payAppService.validPayApp(payRefundSubmitDTO.getAppId()); - // 获得 PayTransactionDO ,并校验其是否存在 - PayTransactionDO payTransaction = payTransactionService.getTransaction(payRefundSubmitDTO.getAppId(), payRefundSubmitDTO.getOrderId()); - if (payTransaction == null) { // 是否存在 - return ServiceExceptionUtil.error(PayErrorCodeEnum.PAY_TRANSACTION_NOT_FOUND.getCode()); - } - if (!PayTransactionStatusEnum.SUCCESS.getValue().equals(payTransaction.getStatus())) { // 校验状态,必须是待支付 - return ServiceExceptionUtil.error(PayErrorCodeEnum.PAY_TRANSACTION_STATUS_IS_NOT_SUCCESS.getCode()); - } - if (payRefundSubmitDTO.getPrice() > payTransaction.getPrice() - payTransaction.getRefundTotal()) { // 金额校验 - return ServiceExceptionUtil.error(PayErrorCodeEnum.PAY_REFUND_PRICE_EXCEED.getCode()); - } - // 获得 PayTransactionExtensionDO ,并校验其是否存在 - PayTransactionExtensionDO payTransactionExtension = payTransactionService.getPayTransactionExtension(payTransaction.getExtensionId()); - if (payTransactionExtension == null) { // 是否存在 - return ServiceExceptionUtil.error(PayErrorCodeEnum.PAY_TRANSACTION_EXTENSION_NOT_FOUND.getCode()); - } - if (!PayTransactionStatusEnum.SUCCESS.getValue().equals(payTransactionExtension.getStatus())) { // 校验状态,必须是待支付 - return ServiceExceptionUtil.error(PayErrorCodeEnum.PAY_TRANSACTION_EXTENSION_STATUS_IS_NOT_SUCCESS.getCode()); - } - // 插入 PayTransactionExtensionDO - PayRefundDO payRefundDO = PayRefundConvert.INSTANCE.convert(payRefundSubmitDTO) - .setTransactionId(payTransaction.getId()) - .setRefundCode(generateTransactionCode()) // TODO 芋艿,后续调整 - .setStatus(PayRefundStatus.WAITING.getValue()) - .setNotifyUrl(payAppDO.getRefundNotifyUrl()) - .setRefundChannel(payTransaction.getPayChannel()); - payRefundDO.setCreateTime(new Date()); - payRefundMapper.insert(payRefundDO); - // 调用三方接口 - AbstractPaySDK paySDK = PaySDKFactory.getSDK(payTransaction.getPayChannel()); - CommonResult invokeResult = paySDK.submitRefund(payRefundDO, payTransactionExtension, null); // TODO 暂时传入 extra = null - if (invokeResult.isError()) { - return CommonResult.error(invokeResult); - } - // 返回成功 - PayRefundSubmitBO payRefundSubmitBO = new PayRefundSubmitBO() - .setId(payRefundDO.getId()); - return CommonResult.success(payRefundSubmitBO); - } - - @Override - @Transactional - public CommonResult updateRefundSuccess(Integer payChannel, String params) { - // TODO 芋艿,记录回调日志 - // 解析传入的参数,成 TransactionSuccessBO 对象 - AbstractPaySDK paySDK = PaySDKFactory.getSDK(payChannel); - CommonResult paySuccessResult = paySDK.parseRefundSuccessParams(params); - if (paySuccessResult.isError()) { - return CommonResult.error(paySuccessResult); - } - // TODO 芋艿,先最严格的校验。即使调用方重复调用,实际哪个订单已经被重复回调的支付,也返回 false 。也没问题,因为实际已经回调成功了。 - // 1.1 查询 PayRefundDO - PayRefundDO payRefund = payRefundMapper.selectByRefundCode(paySuccessResult.getData().getRefundCode()); - if (payRefund == null) { - return ServiceExceptionUtil.error(PayErrorCodeEnum.PAY_REFUND_NOT_FOUND.getCode()); - } - if (!PayRefundStatus.WAITING.getValue().equals(payRefund.getStatus())) { // 校验状态,必须是待支付 - return ServiceExceptionUtil.error(PayErrorCodeEnum.PAY_REFUND_STATUS_NOT_WAITING.getCode()); - } - // 1.2 更新 PayRefundDO - Integer status = paySuccessResult.getData().getSuccess() ? PayRefundStatus.SUCCESS.getValue() : PayRefundStatus.FAILURE.getValue(); - PayRefundDO updatePayRefundDO = new PayRefundDO() - .setId(payRefund.getId()) - .setStatus(status) - .setTradeNo(paySuccessResult.getData().getTradeNo()) - .setExtensionData(params); - int updateCounts = payRefundMapper.update(updatePayRefundDO, PayRefundStatus.WAITING.getValue()); - if (updateCounts == 0) { // 校验状态,必须是待支付 - throw ServiceExceptionUtil.exception(PayErrorCodeEnum.PAY_REFUND_STATUS_NOT_WAITING.getCode()); - } - // 2.1 判断 PayTransactionDO ,增加已退款金额 - PayTransactionDO payTransaction = payTransactionService.getTransaction(payRefund.getTransactionId()); - if (payTransaction == null) { - return ServiceExceptionUtil.error(PayErrorCodeEnum.PAY_TRANSACTION_NOT_FOUND.getCode()); - } - if (!PayTransactionStatusEnum.SUCCESS.getValue().equals(payTransaction.getStatus())) { // 校验状态,必须是已支付 - throw ServiceExceptionUtil.exception(PayErrorCodeEnum.PAY_TRANSACTION_STATUS_IS_NOT_SUCCESS.getCode()); - } - if (payRefund.getPrice() + payTransaction.getRefundTotal() > payTransaction.getPrice()) { - throw ServiceExceptionUtil.exception(PayErrorCodeEnum.PAY_REFUND_PRICE_EXCEED.getCode()); - } - // 2.2 更新 PayTransactionDO - updateCounts = payTransactionService.updateTransactionPriceTotalIncr(payRefund.getTransactionId(), payRefund.getPrice()); - if (updateCounts == 0) { // 保证不超退 TODO 这种类型,需要思考下。需要返回错误,但是又要保证事务回滚 - throw ServiceExceptionUtil.exception(PayErrorCodeEnum.PAY_REFUND_PRICE_EXCEED.getCode()); - } - // 3 新增 PayNotifyTaskDO - payNotifyService.addRefundNotifyTask(payRefund); - // 返回结果 - return CommonResult.success(true); - } - - @Override - public PayRefundPageBO getRefundPage(PayRefundPageDTO payRefundPageDTO) { - PayRefundPageBO payRefundPageBO = new PayRefundPageBO(); - // 查询分页数据 - int offset = (payRefundPageDTO.getPageNo() - 1) * payRefundPageDTO.getPageSize(); - payRefundPageBO.setList(PayRefundConvert.INSTANCE.convertList(payRefundMapper.selectListByPage( - payRefundPageDTO.getCreateBeginTime(), payRefundPageDTO.getCreateEndTime(), - payRefundPageDTO.getFinishBeginTime(), payRefundPageDTO.getFinishEndTime(), - payRefundPageDTO.getStatus(), payRefundPageDTO.getPayChannel(), - offset, payRefundPageDTO.getPageSize()))); - // 查询分页总数 - payRefundPageBO.setTotal(payRefundMapper.selectCountByPage( - payRefundPageDTO.getCreateBeginTime(), payRefundPageDTO.getCreateEndTime(), - payRefundPageDTO.getFinishBeginTime(), payRefundPageDTO.getFinishEndTime(), - payRefundPageDTO.getStatus(), payRefundPageDTO.getPayChannel())); - return payRefundPageBO; - } - - private String generateTransactionCode() { -// wx -// 2014 -// 10 -// 27 -// 20 -// 09 -// 39 -// 5522657 -// a690389285100 - // 目前的算法 - // 时间序列,年月日时分秒 14 位 - // 纯随机,6 位 TODO 此处估计是会有问题的,后续在调整 - return DateUtil.format(new Date(), "yyyyMMddHHmmss") + // 时间序列 - MathUtil.random(100000, 999999) // 随机。为什么是这个范围,因为偷懒 - ; - } - -} diff --git a/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/biz/service/PayTransactionServiceImpl.java b/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/biz/service/PayTransactionServiceImpl.java deleted file mode 100644 index 43677dbf3..000000000 --- a/归档/moved/pay/pay-application/src/main/java/cn/iocoder/mall/pay/biz/service/PayTransactionServiceImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -package cn.iocoder.mall.pay.biz.service; - -import cn.iocoder.common.framework.util.DateUtil; -import cn.iocoder.common.framework.util.MathUtil; -import cn.iocoder.common.framework.util.ServiceExceptionUtil; -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.pay.api.PayTransactionService; -import cn.iocoder.mall.pay.api.bo.transaction.PayTransactionBO; -import cn.iocoder.mall.pay.api.bo.transaction.PayTransactionPageBO; -import cn.iocoder.mall.pay.api.bo.transaction.PayTransactionSubmitBO; -import cn.iocoder.mall.pay.api.constant.PayErrorCodeEnum; -import cn.iocoder.mall.pay.api.constant.PayTransactionStatusEnum; -import cn.iocoder.mall.pay.api.dto.transaction.PayTransactionCreateDTO; -import cn.iocoder.mall.pay.api.dto.transaction.PayTransactionGetDTO; -import cn.iocoder.mall.pay.api.dto.transaction.PayTransactionPageDTO; -import cn.iocoder.mall.pay.api.dto.transaction.PayTransactionSubmitDTO; -import cn.iocoder.mall.pay.biz.client.AbstractPaySDK; -import cn.iocoder.mall.pay.biz.client.PaySDKFactory; -import cn.iocoder.mall.pay.biz.client.TransactionSuccessBO; -import cn.iocoder.mall.pay.biz.convert.PayTransactionConvert; -import cn.iocoder.mall.pay.biz.dao.PayNotifyTaskMapper; -import cn.iocoder.mall.pay.biz.dao.PayTransactionExtensionMapper; -import cn.iocoder.mall.pay.biz.dao.PayTransactionMapper; -import cn.iocoder.mall.pay.biz.dataobject.PayAppDO; -import cn.iocoder.mall.pay.biz.dataobject.PayTransactionDO; -import cn.iocoder.mall.pay.biz.dataobject.PayTransactionExtensionDO; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.Collection; -import java.time.LocalDateTime; -import java.util.List; - -@Service -@org.apache.dubbo.config.annotation.Service(validation = "true", version = "${dubbo.provider.PayTransactionService.version}") -public class PayTransactionServiceImpl implements PayTransactionService { - -} diff --git a/归档/moved/product/product-biz/pom.xml b/归档/moved/product/product-biz/pom.xml deleted file mode 100644 index 366cac7ce..000000000 --- a/归档/moved/product/product-biz/pom.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - product - cn.iocoder.mall - 1.0-SNAPSHOT - - 4.0.0 - - product-biz - - - - - cn.iocoder.mall - product-biz-api - 1.0-SNAPSHOT - - - - - org.springframework.boot - spring-boot-starter - - - - - mysql - mysql-connector-java - - - - org.springframework - spring-tx - - - org.springframework - spring-jdbc - - - com.alibaba - druid-spring-boot-starter - - - - cn.iocoder.mall - mall-spring-boot-starter-mybatis - 1.0-SNAPSHOT - - - - - com.aliyun - aliyun-java-sdk-core - - - - - org.mapstruct - mapstruct - - - org.mapstruct - mapstruct-jdk8 - - - org.projectlombok - lombok - - - - com.alibaba - fastjson - - - - com.google.guava - guava - - - - - com.alibaba.cloud - spring-cloud-starter-stream-rocketmq - - - - diff --git a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/attr/ProductAttrSimpleWithValueBO.java b/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/attr/ProductAttrSimpleWithValueBO.java deleted file mode 100644 index 8ace5c5c0..000000000 --- a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/attr/ProductAttrSimpleWithValueBO.java +++ /dev/null @@ -1,18 +0,0 @@ -package cn.iocoder.mall.product.biz.bo.attr; - -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.util.List; - -@Data -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -public class ProductAttrSimpleWithValueBO extends ProductAttrSimpleBO { - - /** - * 规格值数组 - */ - private List values; -} diff --git a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/attr/ProductAttrValueSimpleBO.java b/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/attr/ProductAttrValueSimpleBO.java deleted file mode 100644 index 91d4db153..000000000 --- a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/attr/ProductAttrValueSimpleBO.java +++ /dev/null @@ -1,24 +0,0 @@ -package cn.iocoder.mall.product.biz.bo.attr; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * 商品规格值 VO - */ -@Data -@Accessors(chain = true) -public class ProductAttrValueSimpleBO implements Serializable { - - /** - * 规格值编号 - */ - private Integer id; - /** - * 规格值名 - */ - private String name; - -} diff --git a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/attr/ProductAttrWithValueBO.java b/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/attr/ProductAttrWithValueBO.java deleted file mode 100644 index b4fc489b4..000000000 --- a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/attr/ProductAttrWithValueBO.java +++ /dev/null @@ -1,18 +0,0 @@ -package cn.iocoder.mall.product.biz.bo.attr; - -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.util.List; - -@Data -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -public class ProductAttrWithValueBO extends ProductAttrBO { - - /** - * 规格值数组 - */ - private List values; -} diff --git a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/ProductAttrBO2.java b/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/ProductAttrBO2.java deleted file mode 100644 index 76fa0ba5c..000000000 --- a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/ProductAttrBO2.java +++ /dev/null @@ -1,33 +0,0 @@ -package cn.iocoder.mall.product.biz.bo.product; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 商品规格 VO - */ -@Data -@Accessors(chain = true) -public class ProductAttrBO2 implements Serializable { - - /** - * 规格编号 - */ - private Integer id; - /** - * 规格名 - */ - private String name; - /** - * 状态 - */ - private Integer status; - /** - * 创建时间 - */ - private LocalDateTime createTime; - -} diff --git a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/ProductAttrSimpleBO.java b/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/ProductAttrSimpleBO.java deleted file mode 100644 index 0a0ab22e1..000000000 --- a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/ProductAttrSimpleBO.java +++ /dev/null @@ -1,29 +0,0 @@ -package cn.iocoder.mall.product.biz.bo.product; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.List; - -/** - * 商品规格精简 VO - */ -@Data -@Accessors(chain = true) -public class ProductAttrSimpleBO implements Serializable { - - /** - * 规格编号 - */ - private Integer id; - /** - * 规格名 - */ - private String name; - /** - * 规格值数组 - */ - private List values; - -} diff --git a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/ProductAttrValueBO.java b/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/ProductAttrValueBO.java deleted file mode 100644 index 95d634782..000000000 --- a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/ProductAttrValueBO.java +++ /dev/null @@ -1,37 +0,0 @@ -package cn.iocoder.mall.product.biz.bo.product; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 商品规格值 VO - */ -@Data -@Accessors(chain = true) -public class ProductAttrValueBO implements Serializable { - - /** - * 规格值编号 - */ - private Integer id; - /** - * 规格编号 - */ - private Integer attrId; - /** - * 规格值名 - */ - private String name; - /** - * 状态 - */ - private Integer status; - /** - * 创建时间 - */ - private LocalDateTime createTime; - -} diff --git a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/ProductAttrValueDetailBO.java b/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/ProductAttrValueDetailBO.java deleted file mode 100644 index 3088af11d..000000000 --- a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/ProductAttrValueDetailBO.java +++ /dev/null @@ -1,33 +0,0 @@ -package cn.iocoder.mall.product.biz.bo.product; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 商品规格值 VO - */ -@Data -@Accessors(chain = true) -public class ProductAttrValueDetailBO implements Serializable { - - /** - * 规格值编号 - */ - private Integer id; - /** - * 规格值名 - */ - private String name; - /** - * 状态 - */ - private Integer status; - /** - * 创建时间 - */ - private LocalDateTime createTime; - -} diff --git a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/ProductAttrValueSimpleBO.java b/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/ProductAttrValueSimpleBO.java deleted file mode 100644 index 246de84a9..000000000 --- a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/ProductAttrValueSimpleBO.java +++ /dev/null @@ -1,24 +0,0 @@ -package cn.iocoder.mall.product.biz.bo.product; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * 商品规格值 VO - */ -@Data -@Accessors(chain = true) -public class ProductAttrValueSimpleBO implements Serializable { - - /** - * 规格值编号 - */ - private Integer id; - /** - * 规格值名 - */ - private String name; - -} diff --git a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/ProductSkuDetailBO.java b/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/ProductSkuDetailBO.java deleted file mode 100644 index 634383941..000000000 --- a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/ProductSkuDetailBO.java +++ /dev/null @@ -1,91 +0,0 @@ -package cn.iocoder.mall.product.biz.bo.product; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.List; - -/** - * 商品 Sku 明细 BO(包括 Spu 明细) - */ -@Data -@Accessors(chain = true) -public class ProductSkuDetailBO implements Serializable { - - /** - * sku 编号 - */ - private Integer id; - /** - * SPU 信息 - */ - private Spu spu; - /** - * 图片地址 - */ - private String picURL; - /** - * 规格值数组 - */ - private List attrs; - /** - * 价格,单位:分 - */ - private Integer price; - /** - * 库存数量 - */ - private Integer quantity; - - @Data - @Accessors(chain = true) - public static class Spu implements Serializable { - - /** - * SPU 编号 - */ - private Integer id; - - // ========== 基本信息 ========= - /** - * SPU 名字 - */ - private String name; - /** - * 卖点 - */ - private String sellPoint; - /** - * 描述 - */ - private String description; - /** - * 分类编号 - */ - private Integer cid; - /** - * 商品主图地址 - * - * 数组,以逗号分隔 - * - * 建议尺寸:800*800像素,你可以拖拽图片调整顺序,最多上传15张 - */ - private List picUrls; - - // ========== 其他信息 ========= - /** - * 是否上架商品(是否可见)。 - * - * true 为已上架 - * false 为已下架 - */ - private Boolean visible; - /** - * 排序字段 - */ - private Integer sort; - - } - -} diff --git a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/ProductSpuBO.java b/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/ProductSpuBO.java deleted file mode 100644 index 6823ac14b..000000000 --- a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/ProductSpuBO.java +++ /dev/null @@ -1,74 +0,0 @@ -package cn.iocoder.mall.product.biz.bo.product; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.List; - -/** - * 商品 SPU BO - */ -@Data -@Accessors(chain = true) -public class ProductSpuBO implements Serializable { - - /** - * SPU 编号 - */ - private Integer id; - - // ========== 基本信息 ========= - /** - * SPU 名字 - */ - private String name; - /** - * 卖点 - */ - private String sellPoint; - /** - * 描述 - */ - private String description; - /** - * 分类编号 - */ - private Integer cid; - /** - * 商品主图地址 - * - * 数组,以逗号分隔 - * - * 建议尺寸:800*800像素,你可以拖拽图片调整顺序,最多上传15张 - */ - private List picUrls; - - // ========== 其他信息 ========= - /** - * 是否上架商品(是否可见)。 - * - * true 为已上架 - * false 为已下架 - */ - private Boolean visible; - /** - * 排序字段 - */ - private Integer sort; - - // ========== Sku 相关字段 ========= - /** - * 价格 - * - * 目前的计算方式是,以 Sku 最小价格为准 - */ - private Integer price; - /** - * 库存数量 - * - * 目前的计算方式是,以 Sku 库存累加为准 - */ - private Integer quantity; - -} diff --git a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/UserProductSpuCollectionsBO.java b/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/UserProductSpuCollectionsBO.java deleted file mode 100644 index 9539e92a8..000000000 --- a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/UserProductSpuCollectionsBO.java +++ /dev/null @@ -1,74 +0,0 @@ -package cn.iocoder.mall.product.biz.bo.product; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 用户_商品_收藏记录表 - * @author xiaofeng - * @date 2019-07-01 20:23:30 - */ -@Data -@Accessors(chain = true) -public class UserProductSpuCollectionsBO implements Serializable { - - /** - * id自增长 - */ - private Integer id; - - /** - * 用户id - */ - private Integer userId; - - /** - * 用户名称 - */ - private String nickname; - - /** - * 商品id - */ - private Integer spuId; - - /** - * 商品名字 - */ - private String spuName; - - /** - * 图片名字 - */ - private String spuImage; - - /** - * 卖点 - */ - private String sellPoint; - - /** - * 价格,单位:分 - */ - private Integer price; - - /** - * 创建时间 - */ - private LocalDateTime createTime; - - /** - * 更新时间 - */ - private LocalDateTime updateTime; - - /** - * 删除状态 - */ - private Integer deleted; - - -} diff --git a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/UserProductSpuCollectionsPageBO.java b/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/UserProductSpuCollectionsPageBO.java deleted file mode 100644 index ea5233c91..000000000 --- a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/product/UserProductSpuCollectionsPageBO.java +++ /dev/null @@ -1,30 +0,0 @@ -package cn.iocoder.mall.product.biz.bo.product; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.List; - -/** - * 商品收藏分页 - * @author xiaofeng - * @date 2019/07/06 18:37 - * @version 1.0 - */ -@Data -@Accessors(chain = true) -public class UserProductSpuCollectionsPageBO implements Serializable { - - /** - * 返回的数据列表 - */ - private List list; - - /** - * 总量 - */ - private Integer total; - - -} diff --git a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/convert/attr/ProductAttrConvert.java b/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/convert/attr/ProductAttrConvert.java deleted file mode 100644 index 4da67ed90..000000000 --- a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/convert/attr/ProductAttrConvert.java +++ /dev/null @@ -1,49 +0,0 @@ -package cn.iocoder.mall.product.biz.convert.attr; - -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.product.biz.bo.attr.*; -import cn.iocoder.mall.product.biz.dataobject.attr.ProductAttrDO; -import cn.iocoder.mall.product.biz.dataobject.attr.ProductAttrValueDO; -import cn.iocoder.mall.product.biz.dto.attr.ProductAttrUpdateDTO; -import cn.iocoder.mall.product.biz.dto.attr.ProductAttrValueAddDTO; -import cn.iocoder.mall.product.biz.dto.attr.ProductAttrValueUpdateDTO; -import com.baomidou.mybatisplus.core.metadata.IPage; -import org.mapstruct.Mapper; -import org.mapstruct.Mapping; -import org.mapstruct.Mappings; -import org.mapstruct.factory.Mappers; - -import java.util.List; - -@Mapper -public interface ProductAttrConvert { - - ProductAttrConvert INSTANCE = Mappers.getMapper(ProductAttrConvert.class); - - @Mapping(source = "records", target = "list") - PageResult convertPage(IPage bean); - - @Mappings({}) - ProductAttrBO convertAttr(ProductAttrDO values); - - @Mappings({}) - ProductAttrValueBO convertAttrValue(ProductAttrValueDO productAttrValueDO); - - @Mappings({}) - List convertAttrValues(List values); - - @Mappings({}) - List convertAttrSimple(List attrs); - - @Mappings({}) - List convertAttrValueSimple(List values); - - @Mappings({}) - ProductAttrDO convertUpdate(ProductAttrUpdateDTO productAttrUpdateDTO); - - @Mappings({}) - ProductAttrValueDO convertValueAdd(ProductAttrValueAddDTO productAttrValueAddDTO); - - @Mappings({}) - ProductAttrValueDO convertValueUpdate(ProductAttrValueUpdateDTO productAttrValueUpdateDTO); -} diff --git a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/convert/product/UserProductSpuCollectionsConvert.java b/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/convert/product/UserProductSpuCollectionsConvert.java deleted file mode 100644 index 2b9146848..000000000 --- a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/convert/product/UserProductSpuCollectionsConvert.java +++ /dev/null @@ -1,65 +0,0 @@ -package cn.iocoder.mall.product.biz.convert.product; - -import cn.iocoder.mall.product.biz.bo.product.UserProductSpuCollectionsBO; -import cn.iocoder.mall.product.biz.dataobject.spu.UserProductSpuCollectionsDO; -import cn.iocoder.mall.product.biz.dto.product.UserProductSpuCollectionsAddDTO; -import cn.iocoder.mall.product.biz.dto.product.UserProductSpuCollectionsUpdateDTO; -import org.mapstruct.Mapper; -import org.mapstruct.Mappings; -import org.mapstruct.factory.Mappers; - -import java.util.List; - -/** - * 用户_商品_收藏记录表 - * - * @author xiaofeng - * @date 2019-07-01 20:23:30 - */ -@Mapper -public interface UserProductSpuCollectionsConvert { - - UserProductSpuCollectionsConvert INSTANCE = Mappers.getMapper(UserProductSpuCollectionsConvert.class); - - /** - * DTO convert DO - * @param userSkuCollectionsAddDTO - * @return - */ - @Mappings({}) - UserProductSpuCollectionsDO convert(UserProductSpuCollectionsAddDTO userSkuCollectionsAddDTO); - - /** - * update DTO convert DO - * @param userProductSpuCollectionsUpdateDTO - * @return - */ - @Mappings({}) - UserProductSpuCollectionsDO convert(UserProductSpuCollectionsUpdateDTO userProductSpuCollectionsUpdateDTO); - - /** - * DO Convert BO - * @param userSkuCollectionsDO - * @return - */ - @Mappings({}) - UserProductSpuCollectionsBO convert(UserProductSpuCollectionsDO userSkuCollectionsDO); - - /** - * DO List convert BO LIST - * @param userSkuCollectionsDOS - * @return - */ - @Mappings({}) - List convert(List userSkuCollectionsDOS); - -// /** -// * 消处数据转换 -// * @param productSpuCollectionMessage -// * @return -// */ -// @Mappings({}) -// UserProductSpuCollectionsAddDTO convert(ProductSpuCollectionMessage productSpuCollectionMessage); - - -} diff --git a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/convert/sku/ProductSpuConvert.java b/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/convert/sku/ProductSpuConvert.java deleted file mode 100644 index 2c898bdeb..000000000 --- a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/convert/sku/ProductSpuConvert.java +++ /dev/null @@ -1,133 +0,0 @@ -package cn.iocoder.mall.product.biz.convert.sku; - -import cn.iocoder.common.framework.util.StringUtil; -import cn.iocoder.mall.product.biz.bo.product.*; -import cn.iocoder.mall.product.biz.dataobject.category.ProductCategoryDO; -import cn.iocoder.mall.product.biz.dataobject.spu.ProductSkuDO; -import cn.iocoder.mall.product.biz.dataobject.spu.ProductSpuDO; -import cn.iocoder.mall.product.biz.dto.sku.ProductSkuAddOrUpdateDTO; -import cn.iocoder.mall.product.biz.dto.sku.ProductSpuAddDTO; -import cn.iocoder.mall.product.biz.dto.sku.ProductSpuUpdateDTO; -import org.mapstruct.Mapper; -import org.mapstruct.Mapping; -import org.mapstruct.Mappings; -import org.mapstruct.Named; -import org.mapstruct.factory.Mappers; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -@Mapper -public interface ProductSpuConvert { - - ProductSpuConvert INSTANCE = Mappers.getMapper(ProductSpuConvert.class); - - @Mappings({ - @Mapping(source = "picUrls", target = "picUrls", ignore = true) - }) - ProductSpuDO convertToSpuDO(ProductSpuAddDTO productSpuAddDTO); - - - @Mappings({ - @Mapping(source = "attrs", target = "attrs", ignore = true) - }) - ProductSkuDO convertToSkuDO(ProductSkuAddOrUpdateDTO productSkuAddDTO); - - @Mappings({ - @Mapping(source = "picUrls", target = "picUrls", qualifiedByName = "translatePicUrlsFromString") - }) - ProductSpuBO convert(ProductSpuDO spu); - - @Mappings({}) - List convert(List spus); - - @Mappings({ - @Mapping(source = "picUrls", target = "picUrls", ignore = true) - }) - ProductSpuDO convert(ProductSpuUpdateDTO productSpuUpdateDTO); - - @Mappings({}) - ProductSpuDetailBO convert(ProductSpuBO spu); - - @Mappings({ - @Mapping(source = "picUrls", target = "picUrls", ignore = true) - }) - ProductSpuDetailBO convert2(ProductSpuDO spu); - - @Mappings({ - @Mapping(source = "picUrls", target = "picUrls", ignore = true) - }) - ProductSkuDetailBO.Spu convert3(ProductSpuDO spu); - - @Mappings({ - @Mapping(source = "attrs", target = "attrs", ignore = true) - }) - ProductSpuDetailBO.Sku convert2(ProductSkuDO sku); - - @Mappings({ - @Mapping(source = "attrs", target = "attrs", ignore = true) - }) - ProductSkuDetailBO convert3(ProductSkuDO sku); - - @Mappings({ -// @Mapping(source = "attrs", target = "attrs", ignore = true) // TODO 芋艿 后续补充 - }) - ProductSkuBO convert4(ProductSkuDO sku); - - @Mappings({}) // TODO 芋艿,后续细看下 mapstruct 的 API ,优化这块 - default ProductSpuDetailBO convert2(ProductSpuDO spu, List skus, List productAttrDetailBOs, - ProductCategoryDO category) { - // 创建并转换 ProductSpuDetailBO 对象 - ProductSpuDetailBO spuDetail = this.convert2(spu).setPicUrls(StringUtil.split(spu.getPicUrls(), ",")); - // 创建 ProductAttrDetailBO 的映射。其中,KEY 为 ProductAttrDetailBO.attrValueId ,即规格值的编号 - Map productAttrDetailBOMap = productAttrDetailBOs.stream().collect( - Collectors.toMap(ProductAttrAndValuePairBO::getAttrValueId, productAttrDetailBO -> productAttrDetailBO)); - // 创建并转换 ProductSpuDetailBO 数组 - spuDetail.setSkus(new ArrayList<>()); - skus.forEach(sku -> { - // 创建 ProductSpuDetailBO 对象 - ProductSpuDetailBO.Sku skuDetail = ProductSpuConvert.this.convert2(sku) - .setAttrs(new ArrayList<>()); - spuDetail.getSkus().add(skuDetail); - // 设置 ProductSpuDetailBO 的 attrs 规格属性 - List attrs = StringUtil.split(sku.getAttrs(), ","); - attrs.forEach(attr -> skuDetail.getAttrs().add(productAttrDetailBOMap.get(Integer.valueOf(attr)))); - }); - // 设置分类名 - spuDetail.setCategoryName(category.getName()); - // 返回 - return spuDetail; - } - - @Mappings({}) // TODO 芋艿,后续细看下 mapstruct 的 API ,优化这块 - default List convert3(List skus, List spus, List productAttrDetailBOs) { - // 创建 ProductAttrDetailBO 的映射。其中,KEY 为 ProductAttrDetailBO.attrValueId ,即规格值的编号 - Map productAttrDetailBOMap = productAttrDetailBOs.stream().collect( - Collectors.toMap(ProductAttrAndValuePairBO::getAttrValueId, productAttrDetailBO -> productAttrDetailBO)); - // 创建 ProductSpuDO 的映射 - Map spuMap = spus.stream().collect( - Collectors.toMap(ProductSpuDO::getId, spu -> ProductSpuConvert.this.convert3(spu).setPicUrls(StringUtil.split(spu.getPicUrls(), ",")))); - // 拼装结果 - List spuDetailList = new ArrayList<>(skus.size()); - for (ProductSkuDO sku : skus) { - // 创建 ProductSkuDetailBO 对象 - ProductSkuDetailBO skuDetail = ProductSpuConvert.this.convert3(sku) - .setAttrs(new ArrayList<>()) - .setSpu(spuMap.get(sku.getSpuId())); - spuDetailList.add(skuDetail); - // 设置 ProductSpuDetailBO 的 attrs 规格属性 - List attrs = StringUtil.split(sku.getAttrs(), ","); - attrs.forEach(attr -> skuDetail.getAttrs().add(productAttrDetailBOMap.get(Integer.valueOf(attr)))); - } - // 返回 - return spuDetailList; - } - - @Named("translatePicUrlsFromString") - default List translatePicUrlsFromString(String picUrls) { - return StringUtil.split(picUrls, ","); - } - -} diff --git a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/dao/sku/UserProductSpuCollectionsMapper.java b/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/dao/sku/UserProductSpuCollectionsMapper.java deleted file mode 100644 index ca604ec7e..000000000 --- a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/dao/sku/UserProductSpuCollectionsMapper.java +++ /dev/null @@ -1,54 +0,0 @@ -package cn.iocoder.mall.product.biz.dao.sku; - -import cn.iocoder.mall.product.biz.dataobject.spu.UserProductSpuCollectionsDO; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 用户_商品_收藏记录表 - * - * @author xiaofeng - * @date 2019-07-01 20:23:30 - */ -@Repository -public interface UserProductSpuCollectionsMapper extends BaseMapper { - - /** - * 根据用户id 和 spuId 查找用户商品收藏 - * - * @param userId - * @param spuId - * @return - */ - default UserProductSpuCollectionsDO getUserSpuCollectionsByUserIdAndSpuId(final Integer userId, - final Integer spuId) { - QueryWrapper query = new QueryWrapper() - .eq("user_id", userId).eq("spu_id", spuId); - return selectOne(query); - } - - - /** - * 查询用户收藏列表 - * - * @param userId - * @param offset - * @param limit - * @return - */ - List selectListByUser(@Param("userId") Integer userId, @Param("offset") Integer offset, - @Param("limit") Integer limit); - - /** - * 根据用户ID 查找总数 - * - * @param userId - * @return - */ - Integer selectCountByUser(Integer userId); - -} diff --git a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/dataobject/spu/UserProductSpuCollectionsDO.java b/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/dataobject/spu/UserProductSpuCollectionsDO.java deleted file mode 100644 index 1728111ea..000000000 --- a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/dataobject/spu/UserProductSpuCollectionsDO.java +++ /dev/null @@ -1,78 +0,0 @@ -package cn.iocoder.mall.product.biz.dataobject.spu; - -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 用户_商品_收藏记录表 - * - * @author xiaofeng - * @date 2019-07-01 20:23:30 - */ -@TableName("user_spu_collections") -@Data -@Accessors(chain = true) -public class UserProductSpuCollectionsDO implements Serializable { - private static final long serialVersionUID = 1L; - - /** - * id自增长 - */ - private Integer id; - - /** - * 用户id - */ - private Integer userId; - - /** - * 用户名称 - */ - private String nickname; - - /** - * 商品id - */ - private Integer spuId; - - /** - * 商品名字 - */ - private String spuName; - - /** - * 图片名字 - */ - private String spuImage; - - /** - * 卖点 - */ - private String sellPoint; - - /** - * 价格,单位:分 - */ - private Integer price; - - /** - * 创建时间 - */ - private LocalDateTime createTime; - - /** - * 更新时间 - */ - private LocalDateTime updateTime; - - /** - * 删除状态 - */ - private Integer deleted; - - -} diff --git a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/dataobject/stock/ProductStockDO.java b/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/dataobject/stock/ProductStockDO.java deleted file mode 100644 index 2010b3418..000000000 --- a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/dataobject/stock/ProductStockDO.java +++ /dev/null @@ -1,44 +0,0 @@ -package cn.iocoder.mall.product.biz.dataobject.stock; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.time.LocalDateTime; - -/** - * Product 库存 - */ -@Deprecated // TODO 芋艿,咱暂时不加库存表和库存服务 -@Data -@Accessors(chain = true) -public class ProductStockDO { - - /** - * 编号,自增 - */ - private Integer id; - /** - * SKU 编号 - */ - private Integer skuId; - /** - * 库存数 - */ - private Integer quantity; - /** - * 创建时间 - */ - private LocalDateTime createTime; - /** - * 最后更新时间 - */ - private LocalDateTime updateTime; - /** - * 状态 - * - * 1-正常 - * 2-删除 - */ - private Integer status; - -} diff --git a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/dto/product/ProductSpuSearchListDTO.java b/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/dto/product/ProductSpuSearchListDTO.java deleted file mode 100644 index cc278bb9e..000000000 --- a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/dto/product/ProductSpuSearchListDTO.java +++ /dev/null @@ -1,20 +0,0 @@ -package cn.iocoder.mall.product.biz.dto.product; - -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 商品 Spu 搜索列表 DTO - */ -@Data -@Accessors(chain = true) -public class ProductSpuSearchListDTO { - - /** - * 商品名 - * - * 模糊匹配 - */ - private String name; - -} diff --git a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/dto/product/UserProductSpuCollectionsAddDTO.java b/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/dto/product/UserProductSpuCollectionsAddDTO.java deleted file mode 100644 index b7732601c..000000000 --- a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/dto/product/UserProductSpuCollectionsAddDTO.java +++ /dev/null @@ -1,75 +0,0 @@ -package cn.iocoder.mall.product.biz.dto.product; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 添加商品收藏参数 - * @author xiaofeng - * @date 2019/07/01 20:38 - * @version 1.0 - */ -@Data -@Accessors(chain = true) -public class UserProductSpuCollectionsAddDTO implements Serializable { - - /** - * id自增长 - */ - private Integer id; - - /** - * 用户id - */ - private Integer userId; - - /** - * 用户名称 - */ - private String nickname; - - /** - * 商品id - */ - private Integer spuId; - - /** - * 商品名字 - */ - private String spuName; - - /** - * 图片名字 - */ - private String spuImage; - - /** - * 卖点 - */ - private String sellPoint; - - /** - * 价格,单位:分 - */ - private Integer price; - - /** - * 创建时间 - */ - private LocalDateTime createTime; - - /** - * 更新时间 - */ - private LocalDateTime updateTime; - - /** - * 删除状态 - */ - private Integer deleted; - - -} diff --git a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/dto/product/UserProductSpuCollectionsPageDTO.java b/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/dto/product/UserProductSpuCollectionsPageDTO.java deleted file mode 100644 index 22befd128..000000000 --- a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/dto/product/UserProductSpuCollectionsPageDTO.java +++ /dev/null @@ -1,35 +0,0 @@ -package cn.iocoder.mall.product.biz.dto.product; - -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; -import java.io.Serializable; - -/** - * 商品收藏分页参数 - * @author xiaofeng - * @date 2019/07/06 18:40 - * @version 1.0 - */ -@Data -@Accessors(chain = true) -public class UserProductSpuCollectionsPageDTO implements Serializable { - - /** - * 用户ID - */ - private Integer userId; - - /** - * 当前页 - */ - @NotNull(message = "页码不能为空") - private Integer pageNo; - - /** - * 每页显示的条数 - */ - @NotNull(message = "每页条数不能为空") - private Integer pageSize; -} diff --git a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/service/attr/ProductAttrService.java b/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/service/attr/ProductAttrService.java deleted file mode 100644 index 437e35a57..000000000 --- a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/service/attr/ProductAttrService.java +++ /dev/null @@ -1,18 +0,0 @@ -package cn.iocoder.mall.product.biz.service.attr; - -import cn.iocoder.mall.product.biz.bo.attr.ProductAttrSimpleWithValueBO; - -import java.util.List; - -public interface ProductAttrService { - - /** - * 获得规格属性数组 - *

- * 注意,该方法过滤了禁用的规格 - * - * @return 规格属性数组 - */ - List getProductAttrList(); - -} diff --git a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/service/attr/ProductAttrServiceImpl.java b/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/service/attr/ProductAttrServiceImpl.java deleted file mode 100644 index 77c7af0c3..000000000 --- a/归档/moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/service/attr/ProductAttrServiceImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -package cn.iocoder.mall.product.biz.service.attr; - -import cn.iocoder.common.framework.util.CollectionUtil; -import cn.iocoder.common.framework.util.ServiceExceptionUtil; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.mybatis.core.enums.DeletedStatusEnum; -import cn.iocoder.mall.product.biz.bo.attr.ProductAttrBO; -import cn.iocoder.mall.product.biz.bo.attr.ProductAttrSimpleWithValueBO; -import cn.iocoder.mall.product.biz.bo.attr.ProductAttrValueBO; -import cn.iocoder.mall.product.biz.bo.attr.ProductAttrWithValueBO; -import cn.iocoder.mall.product.biz.bo.product.ProductAttrAndValuePairBO; -import cn.iocoder.mall.product.biz.convert.attr.ProductAttrConvert; -import cn.iocoder.mall.product.biz.dao.attr.ProductAttrMapper; -import cn.iocoder.mall.product.biz.dao.attr.ProductAttrValueMapper; -import cn.iocoder.mall.product.biz.dataobject.attr.ProductAttrDO; -import cn.iocoder.mall.product.biz.dataobject.attr.ProductAttrValueDO; -import cn.iocoder.mall.product.biz.dto.attr.*; -import cn.iocoder.mall.product.biz.enums.ProductErrorCodeEnum; -import cn.iocoder.mall.product.biz.enums.attr.ProductAttrConstants; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.*; -import java.util.stream.Collectors; - -/** - * 商品规格 Service 实现类 - * - * @see ProductAttrDO - * @see ProductAttrValueDO - */ -@Service -public class ProductAttrServiceImpl implements ProductAttrService { - - @Override - public List getProductAttrList() { - // 查询所有开启的规格数组 - List attrDos = productAttrMapper.selectList(Wrappers.query().lambda() - .in(ProductAttrDO::getStatus, ProductAttrConstants.ATTR_STATUS_ENABLE) - .eq(ProductAttrDO::getDeleted, false)); - // 如果为空,则返回空 - if (attrDos.isEmpty()) { - return Collections.emptyList(); - } - List attrs = ProductAttrConvert.INSTANCE.convertAttrSimple(attrDos); - // 将规格值拼接上去 - List attrValues = productAttrValueMapper.selectList(Wrappers.query().lambda() - .in(ProductAttrValueDO::getStatus, ProductAttrConstants.ATTR_STATUS_ENABLE) - .eq(ProductAttrValueDO::getDeleted, false)); - Map> attrValueMap = attrValues.stream().collect(Collectors.groupingBy(ProductAttrValueDO::getAttrId)); - for (ProductAttrSimpleWithValueBO item : attrs) { - item.setValues(ProductAttrConvert.INSTANCE.convertAttrValueSimple(attrValueMap.get(item.getId()))); - } - return attrs; - } - -} diff --git a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/ProductAttrService.java b/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/ProductAttrService.java deleted file mode 100644 index 86f008413..000000000 --- a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/ProductAttrService.java +++ /dev/null @@ -1,25 +0,0 @@ -package cn.iocoder.mall.product.api; - -import cn.iocoder.common.framework.enums.CommonStatusEnum; -import cn.iocoder.common.framework.validator.InEnum; -import cn.iocoder.mall.product.api.bo.ProductAttrBO; -import cn.iocoder.mall.product.api.bo.ProductAttrPageBO; -import cn.iocoder.mall.product.api.bo.ProductAttrSimpleBO; -import cn.iocoder.mall.product.api.bo.ProductAttrValueBO; -import cn.iocoder.mall.product.api.dto.*; - -import java.util.List; - -public interface ProductAttrService { - - - /** - * 获得规格属性数组 - * - * 注意,该方法过滤了禁用的规格 - * - * @return 规格属性数组 - */ - List getProductAttrList(); - -} diff --git a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/ProductSpuCollectionService.java b/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/ProductSpuCollectionService.java deleted file mode 100644 index 130a0bf6b..000000000 --- a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/ProductSpuCollectionService.java +++ /dev/null @@ -1,19 +0,0 @@ -package cn.iocoder.mall.product.api; - -/** - * 商品收藏 - * @author xiaofeng - * @date 2019/07/01 23:13 - * @version 1.0 - */ -public interface ProductSpuCollectionService { - - /** - * 商品收藏 - * @param spuId - * @param hasCollectionType 1 商品收藏 2 取消收藏 - * @param userId - * @return - */ - boolean productSpuCollection(Integer spuId,Integer hasCollectionType,Integer userId); -} diff --git a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/ProductSpuService.java b/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/ProductSpuService.java deleted file mode 100644 index 718a2b081..000000000 --- a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/ProductSpuService.java +++ /dev/null @@ -1,26 +0,0 @@ -package cn.iocoder.mall.product.api; - -import cn.iocoder.mall.product.api.bo.*; -import cn.iocoder.mall.product.api.dto.ProductSpuAddDTO; -import cn.iocoder.mall.product.api.dto.ProductSpuPageDTO; -import cn.iocoder.mall.product.api.dto.ProductSpuSearchListDTO; -import cn.iocoder.mall.product.api.dto.ProductSpuUpdateDTO; - -import java.util.Collection; -import java.util.List; - -public interface ProductSpuService { - - ProductSpuDetailBO getProductSpuDetail(Integer id); - - List getProductSpuSearchList(ProductSpuSearchListDTO productSpuSearchListDTO); - - List getProductSpuList(Collection ids); - - ProductSkuBO getProductSku(Integer id); - - List getProductSkuDetailList(Collection ids); - - Boolean updateProductSpuSort(Integer adminId, Integer spuId, Integer sort); - -} diff --git a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/UserProductSpuCollectionsService.java b/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/UserProductSpuCollectionsService.java deleted file mode 100644 index d1ee152cf..000000000 --- a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/UserProductSpuCollectionsService.java +++ /dev/null @@ -1,64 +0,0 @@ -package cn.iocoder.mall.product.api; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.product.api.bo.UserProductSpuCollectionsBO; -import cn.iocoder.mall.product.api.bo.UserProductSpuCollectionsPageBO; -import cn.iocoder.mall.product.api.dto.UserProductSpuCollectionsAddDTO; -import cn.iocoder.mall.product.api.dto.UserProductSpuCollectionsPageDTO; -import cn.iocoder.mall.product.api.dto.UserProductSpuCollectionsUpdateDTO; - -/** - * UserProductSpuCollectionsService - * @author xiaofeng - * @date 2019/07/01 20:27 - * @version 1.0 - */ -public interface UserProductSpuCollectionsService { - - /** - * 添加商品收藏 - * @return - */ - int addUserSkuCollections(UserProductSpuCollectionsAddDTO userProductSpuCollectionsAddDTO); - - /** - * 获取用户商品收藏 - * @param userId 用户ID - * @param spuId 商品ID - * @return - */ - UserProductSpuCollectionsBO getUserSpuCollectionsByUserIdAndSpuId(Integer userId, Integer spuId); - - /** - * 取消商品收藏 - * @param userProductSpuCollectionsUpdateDTO - * @return - */ - int updateUserProductSpuCollections(UserProductSpuCollectionsUpdateDTO userProductSpuCollectionsUpdateDTO); - - /** - * 获取用户收藏列表数据 - * @param userProductSpuCollectionsPageDTO - * @return - */ - CommonResult getUserProductSpuCollectionsPage( - UserProductSpuCollectionsPageDTO userProductSpuCollectionsPageDTO); - - /** - * 删除收藏数据 - * @param userId - * @param spuId - * @return - */ - CommonResult deleteUserProductSpuCollections(Integer userId, Integer spuId); - - - /** - * 检验用户商品是否收藏 - * @param spuId - * @param userId - * @return - */ - CommonResult hasUserSpuFavorite(Integer spuId, Integer userId); - -} diff --git a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/ProductAttrBO.java b/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/ProductAttrBO.java deleted file mode 100644 index e797a4124..000000000 --- a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/ProductAttrBO.java +++ /dev/null @@ -1,33 +0,0 @@ -package cn.iocoder.mall.product.api.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 商品规格 VO - */ -@Data -@Accessors(chain = true) -public class ProductAttrBO implements Serializable { - - /** - * 规格编号 - */ - private Integer id; - /** - * 规格名 - */ - private String name; - /** - * 状态 - */ - private Integer status; - /** - * 创建时间 - */ - private LocalDateTime createTime; - -} diff --git a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/ProductAttrSimpleBO.java b/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/ProductAttrSimpleBO.java deleted file mode 100644 index 2337c7a90..000000000 --- a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/ProductAttrSimpleBO.java +++ /dev/null @@ -1,29 +0,0 @@ -package cn.iocoder.mall.product.api.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.List; - -/** - * 商品规格精简 VO - */ -@Data -@Accessors(chain = true) -public class ProductAttrSimpleBO implements Serializable { - - /** - * 规格编号 - */ - private Integer id; - /** - * 规格名 - */ - private String name; - /** - * 规格值数组 - */ - private List values; - -} diff --git a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/ProductAttrValueBO.java b/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/ProductAttrValueBO.java deleted file mode 100644 index f63fdce6c..000000000 --- a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/ProductAttrValueBO.java +++ /dev/null @@ -1,37 +0,0 @@ -package cn.iocoder.mall.product.api.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 商品规格值 VO - */ -@Data -@Accessors(chain = true) -public class ProductAttrValueBO implements Serializable { - - /** - * 规格值编号 - */ - private Integer id; - /** - * 规格编号 - */ - private Integer attrId; - /** - * 规格值名 - */ - private String name; - /** - * 状态 - */ - private Integer status; - /** - * 创建时间 - */ - private LocalDateTime createTime; - -} diff --git a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/ProductAttrValueDetailBO.java b/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/ProductAttrValueDetailBO.java deleted file mode 100644 index e4f48f314..000000000 --- a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/ProductAttrValueDetailBO.java +++ /dev/null @@ -1,33 +0,0 @@ -package cn.iocoder.mall.product.api.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 商品规格值 VO - */ -@Data -@Accessors(chain = true) -public class ProductAttrValueDetailBO implements Serializable { - - /** - * 规格值编号 - */ - private Integer id; - /** - * 规格值名 - */ - private String name; - /** - * 状态 - */ - private Integer status; - /** - * 创建时间 - */ - private LocalDateTime createTime; - -} diff --git a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/ProductAttrValueSimpleBO.java b/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/ProductAttrValueSimpleBO.java deleted file mode 100644 index f2380b3ed..000000000 --- a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/ProductAttrValueSimpleBO.java +++ /dev/null @@ -1,24 +0,0 @@ -package cn.iocoder.mall.product.api.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * 商品规格值 VO - */ -@Data -@Accessors(chain = true) -public class ProductAttrValueSimpleBO implements Serializable { - - /** - * 规格值编号 - */ - private Integer id; - /** - * 规格值名 - */ - private String name; - -} diff --git a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/ProductSkuDetailBO.java b/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/ProductSkuDetailBO.java deleted file mode 100644 index 8a5caf80a..000000000 --- a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/ProductSkuDetailBO.java +++ /dev/null @@ -1,91 +0,0 @@ -package cn.iocoder.mall.product.api.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.List; - -/** - * 商品 Sku 明细 BO(包括 Spu 明细) - */ -@Data -@Accessors(chain = true) -public class ProductSkuDetailBO implements Serializable { - - /** - * sku 编号 - */ - private Integer id; - /** - * SPU 信息 - */ - private Spu spu; - /** - * 图片地址 - */ - private String picURL; - /** - * 规格值数组 - */ - private List attrs; - /** - * 价格,单位:分 - */ - private Integer price; - /** - * 库存数量 - */ - private Integer quantity; - - @Data - @Accessors(chain = true) - public static class Spu implements Serializable { - - /** - * SPU 编号 - */ - private Integer id; - - // ========== 基本信息 ========= - /** - * SPU 名字 - */ - private String name; - /** - * 卖点 - */ - private String sellPoint; - /** - * 描述 - */ - private String description; - /** - * 分类编号 - */ - private Integer cid; - /** - * 商品主图地址 - * - * 数组,以逗号分隔 - * - * 建议尺寸:800*800像素,你可以拖拽图片调整顺序,最多上传15张 - */ - private List picUrls; - - // ========== 其他信息 ========= - /** - * 是否上架商品(是否可见)。 - * - * true 为已上架 - * false 为已下架 - */ - private Boolean visible; - /** - * 排序字段 - */ - private Integer sort; - - } - -} diff --git a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/ProductSpuDetailBO.java b/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/ProductSpuDetailBO.java deleted file mode 100644 index 63e7bdc6b..000000000 --- a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/ProductSpuDetailBO.java +++ /dev/null @@ -1,106 +0,0 @@ -package cn.iocoder.mall.product.api.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.List; - -/** - * 商品 Spu 明细 BO(包括 Sku 明细) - */ -@Data -@Accessors(chain = true) -@Deprecated -public class ProductSpuDetailBO implements Serializable { - - /** - * SPU 编号 - */ - private Integer id; - - // ========== 基本信息 ========= - /** - * SPU 名字 - */ - private String name; - /** - * 卖点 - */ - private String sellPoint; - /** - * 描述 - */ - private String description; - /** - * 分类编号 - */ - private Integer cid; - /** - * 分类名 - */ - private String categoryName; - /** - * 商品主图地址 - * - * 数组,以逗号分隔 - * - * 建议尺寸:800*800像素,你可以拖拽图片调整顺序,最多上传15张 - */ - private List picUrls; - - // ========== 其他信息 ========= - /** - * 是否上架商品(是否可见)。 - * - * true 为已上架 - * false 为已下架 - */ - private Boolean visible; - /** - * 排序字段 - */ - private Integer sort; - - // ========== SKU ========= - - /** - * SKU 数组 - */ - private List skus; - - /** - * 商品 Sku 明细 BO - */ - @Data - @Accessors(chain = true) - public static class Sku implements Serializable { - - /** - * sku 编号 - */ - private Integer id; - /** - * 商品编号 - */ - private Integer spuId; - /** - * 图片地址 - */ - private String picURL; - /** - * 规格值数组 - */ - private List attrs; - /** - * 价格,单位:分 - */ - private Integer price; - /** - * 库存数量 - */ - private Integer quantity; - - } - -} diff --git a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/UserProductSpuCollectionsBO.java b/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/UserProductSpuCollectionsBO.java deleted file mode 100644 index e91192d13..000000000 --- a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/UserProductSpuCollectionsBO.java +++ /dev/null @@ -1,74 +0,0 @@ -package cn.iocoder.mall.product.api.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 用户_商品_收藏记录表 - * @author xiaofeng - * @date 2019-07-01 20:23:30 - */ -@Data -@Accessors(chain = true) -public class UserProductSpuCollectionsBO implements Serializable { - - /** - * id自增长 - */ - private Integer id; - - /** - * 用户id - */ - private Integer userId; - - /** - * 用户名称 - */ - private String nickname; - - /** - * 商品id - */ - private Integer spuId; - - /** - * 商品名字 - */ - private String spuName; - - /** - * 图片名字 - */ - private String spuImage; - - /** - * 卖点 - */ - private String sellPoint; - - /** - * 价格,单位:分 - */ - private Integer price; - - /** - * 创建时间 - */ - private LocalDateTime createTime; - - /** - * 更新时间 - */ - private LocalDateTime updateTime; - - /** - * 删除状态 - */ - private Integer deleted; - - -} diff --git a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/UserProductSpuCollectionsPageBO.java b/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/UserProductSpuCollectionsPageBO.java deleted file mode 100644 index 228e8206a..000000000 --- a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/bo/UserProductSpuCollectionsPageBO.java +++ /dev/null @@ -1,30 +0,0 @@ -package cn.iocoder.mall.product.api.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.List; - -/** - * 商品收藏分页 - * @author xiaofeng - * @date 2019/07/06 18:37 - * @version 1.0 - */ -@Data -@Accessors(chain = true) -public class UserProductSpuCollectionsPageBO implements Serializable { - - /** - * 返回的数据列表 - */ - private List list; - - /** - * 总量 - */ - private Integer total; - - -} diff --git a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/dto/ProductSpuSearchListDTO.java b/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/dto/ProductSpuSearchListDTO.java deleted file mode 100644 index c5232dd8c..000000000 --- a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/dto/ProductSpuSearchListDTO.java +++ /dev/null @@ -1,20 +0,0 @@ -package cn.iocoder.mall.product.api.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 商品 Spu 搜索列表 DTO - */ -@Data -@Accessors(chain = true) -public class ProductSpuSearchListDTO { - - /** - * 商品名 - * - * 模糊匹配 - */ - private String name; - -} diff --git a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/dto/UserProductSpuCollectionsAddDTO.java b/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/dto/UserProductSpuCollectionsAddDTO.java deleted file mode 100644 index f3e807f6d..000000000 --- a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/dto/UserProductSpuCollectionsAddDTO.java +++ /dev/null @@ -1,75 +0,0 @@ -package cn.iocoder.mall.product.api.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 添加商品收藏参数 - * @author xiaofeng - * @date 2019/07/01 20:38 - * @version 1.0 - */ -@Data -@Accessors(chain = true) -public class UserProductSpuCollectionsAddDTO implements Serializable { - - /** - * id自增长 - */ - private Integer id; - - /** - * 用户id - */ - private Integer userId; - - /** - * 用户名称 - */ - private String nickname; - - /** - * 商品id - */ - private Integer spuId; - - /** - * 商品名字 - */ - private String spuName; - - /** - * 图片名字 - */ - private String spuImage; - - /** - * 卖点 - */ - private String sellPoint; - - /** - * 价格,单位:分 - */ - private Integer price; - - /** - * 创建时间 - */ - private LocalDateTime createTime; - - /** - * 更新时间 - */ - private LocalDateTime updateTime; - - /** - * 删除状态 - */ - private Integer deleted; - - -} diff --git a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/dto/UserProductSpuCollectionsPageDTO.java b/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/dto/UserProductSpuCollectionsPageDTO.java deleted file mode 100644 index 8b67ed46b..000000000 --- a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/dto/UserProductSpuCollectionsPageDTO.java +++ /dev/null @@ -1,35 +0,0 @@ -package cn.iocoder.mall.product.api.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; -import java.io.Serializable; - -/** - * 商品收藏分页参数 - * @author xiaofeng - * @date 2019/07/06 18:40 - * @version 1.0 - */ -@Data -@Accessors(chain = true) -public class UserProductSpuCollectionsPageDTO implements Serializable { - - /** - * 用户ID - */ - private Integer userId; - - /** - * 当前页 - */ - @NotNull(message = "页码不能为空") - private Integer pageNo; - - /** - * 每页显示的条数 - */ - @NotNull(message = "每页条数不能为空") - private Integer pageSize; -} diff --git a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/dto/UserProductSpuCollectionsUpdateDTO.java b/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/dto/UserProductSpuCollectionsUpdateDTO.java deleted file mode 100644 index 883423a9f..000000000 --- a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/dto/UserProductSpuCollectionsUpdateDTO.java +++ /dev/null @@ -1,35 +0,0 @@ -package cn.iocoder.mall.product.api.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 更新商品收藏参数 - * @author xiaofeng - * @date 2019/07/01 20:38 - * @version 1.0 - */ -@Data -@Accessors(chain = true) -public class UserProductSpuCollectionsUpdateDTO implements Serializable { - - /** - * id自增长 - */ - private Integer id; - - /** - * 更新时间 - */ - private LocalDateTime updateTime; - - /** - * 删除状态 - */ - private Integer deleted; - - -} diff --git a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/message/ProductSpuCollectionMessage.java b/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/message/ProductSpuCollectionMessage.java deleted file mode 100644 index b957218e0..000000000 --- a/归档/moved/product/product-service-api/src/main/java/cn/iocoder/mall/product/api/message/ProductSpuCollectionMessage.java +++ /dev/null @@ -1,56 +0,0 @@ -package cn.iocoder.mall.product.api.message; - -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 商品收藏或取消收藏时发送消息 - * @author xiaofeng - * @date 2019/07/01 22:33 - * @version 1.0 - */ -@Data -@Accessors(chain = true) -public class ProductSpuCollectionMessage { - - public static final String TOPIC = "ProductSpuCollection"; - - /** - * SPU 编号 - */ - private Integer spuId; - - /** - * 用户ID - */ - private Integer userId; - - // ========== 基本信息 ========= - /** - * SPU 名字 - */ - private String spuName; - - - /** - * 商品图片 - */ - private String spuImage; - - /** - * 卖点 - */ - private String sellPoint; - - /** - * 价格,单位:分 - */ - private Integer price; - - /** - * 1 收藏 2 取消 - */ - private Integer hasCollectionType; - - -} diff --git a/归档/moved/product/product-service-impl/src/main/java/cn/iocoder/mall/product/convert/ProductSpuConvert.java b/归档/moved/product/product-service-impl/src/main/java/cn/iocoder/mall/product/convert/ProductSpuConvert.java deleted file mode 100644 index 6aea9a899..000000000 --- a/归档/moved/product/product-service-impl/src/main/java/cn/iocoder/mall/product/convert/ProductSpuConvert.java +++ /dev/null @@ -1,112 +0,0 @@ -package cn.iocoder.mall.product.convert; - -import cn.iocoder.common.framework.util.StringUtil; -import cn.iocoder.mall.product.api.bo.*; -import cn.iocoder.mall.product.api.dto.ProductSkuAddOrUpdateDTO; -import cn.iocoder.mall.product.api.dto.ProductSpuAddDTO; -import cn.iocoder.mall.product.api.dto.ProductSpuUpdateDTO; -import cn.iocoder.mall.product.dataobject.ProductCategoryDO; -import cn.iocoder.mall.product.dataobject.ProductSkuDO; -import cn.iocoder.mall.product.dataobject.ProductSpuDO; -import org.mapstruct.Mapper; -import org.mapstruct.Mapping; -import org.mapstruct.Mappings; -import org.mapstruct.Named; -import org.mapstruct.factory.Mappers; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -@Mapper -public interface ProductSpuConvert { - - ProductSpuConvert INSTANCE = Mappers.getMapper(ProductSpuConvert.class); - - @Mappings({ - @Mapping(source = "picUrls", target = "picUrls", qualifiedByName = "translatePicUrlsFromString") - }) - ProductSpuBO convert(ProductSpuDO spu); - - @Named("translatePicUrlsFromString") - default List translatePicUrlsFromString(String picUrls) { - return StringUtil.split(picUrls, ","); - } - - @Mappings({}) - List convert(List spus); - - @Mappings({ - @Mapping(source = "picUrls", target = "picUrls", ignore = true) - }) - ProductSpuDO convert(ProductSpuAddDTO productSpuAddDTO); - - @Mappings({ - @Mapping(source = "attrs", target = "attrs", ignore = true) - }) - ProductSkuDO convert(ProductSkuAddOrUpdateDTO productSkuAddDTO); - - - @Mappings({ - @Mapping(source = "picUrls", target = "picUrls", ignore = true) - }) - ProductSpuDO convert(ProductSpuUpdateDTO productSpuUpdateDTO); - - @Mappings({}) - ProductSpuDetailBO convert(ProductSpuBO spu); - - @Mappings({ - @Mapping(source = "picUrls", target = "picUrls", ignore = true) - }) - ProductSpuDetailBO convert2(ProductSpuDO spu); - - @Mappings({ - @Mapping(source = "picUrls", target = "picUrls", ignore = true) - }) - ProductSkuDetailBO.Spu convert3(ProductSpuDO spu); - - @Mappings({ - @Mapping(source = "attrs", target = "attrs", ignore = true) - }) - ProductSpuDetailBO.Sku convert2(ProductSkuDO sku); - - @Mappings({ - @Mapping(source = "attrs", target = "attrs", ignore = true) - }) - ProductSkuDetailBO convert3(ProductSkuDO sku); - - @Mappings({ -// @Mapping(source = "attrs", target = "attrs", ignore = true) // TODO 芋艿 后续补充 - }) - ProductSkuBO convert4(ProductSkuDO sku); - - - - @Mappings({}) // TODO 芋艿,后续细看下 mapstruct 的 API ,优化这块 - default List convert3(List skus, List spus, List productAttrDetailBOs) { - // 创建 ProductAttrDetailBO 的映射。其中,KEY 为 ProductAttrDetailBO.attrValueId ,即规格值的编号 - Map productAttrDetailBOMap = productAttrDetailBOs.stream().collect( - Collectors.toMap(ProductAttrAndValuePairBO::getAttrValueId, productAttrDetailBO -> productAttrDetailBO)); - // 创建 ProductSpuDO 的映射 - Map spuMap = spus.stream().collect( - Collectors.toMap(ProductSpuDO::getId, spu -> ProductSpuConvert.this.convert3(spu).setPicUrls(StringUtil.split(spu.getPicUrls(), ",")))); - // 拼装结果 - List spuDetailList = new ArrayList<>(skus.size()); - for (ProductSkuDO sku : skus) { - // 创建 ProductSkuDetailBO 对象 - ProductSkuDetailBO skuDetail = ProductSpuConvert.this.convert3(sku) - .setAttrs(new ArrayList<>()) - .setSpu(spuMap.get(sku.getSpuId())); - spuDetailList.add(skuDetail); - // 设置 ProductSpuDetailBO 的 attrs 规格属性 - List attrs = StringUtil.split(sku.getAttrs(), ","); - attrs.forEach(attr -> skuDetail.getAttrs().add(productAttrDetailBOMap.get(Integer.valueOf(attr)))); - } - // 返回 - return spuDetailList; - } - - - -} diff --git a/归档/moved/product/product-service-impl/src/main/java/cn/iocoder/mall/product/convert/UserProductSpuCollectionsConvert.java b/归档/moved/product/product-service-impl/src/main/java/cn/iocoder/mall/product/convert/UserProductSpuCollectionsConvert.java deleted file mode 100644 index 06f2ef460..000000000 --- a/归档/moved/product/product-service-impl/src/main/java/cn/iocoder/mall/product/convert/UserProductSpuCollectionsConvert.java +++ /dev/null @@ -1,66 +0,0 @@ -package cn.iocoder.mall.product.convert; - -import cn.iocoder.mall.product.api.bo.UserProductSpuCollectionsBO; -import cn.iocoder.mall.product.api.dto.UserProductSpuCollectionsAddDTO; -import cn.iocoder.mall.product.api.dto.UserProductSpuCollectionsUpdateDTO; -import cn.iocoder.mall.product.api.message.ProductSpuCollectionMessage; -import cn.iocoder.mall.product.dataobject.UserProductSpuCollectionsDO; -import org.mapstruct.Mapper; -import org.mapstruct.Mappings; -import org.mapstruct.factory.Mappers; - -import java.util.List; - -/** - * 用户_商品_收藏记录表 - * - * @author xiaofeng - * @date 2019-07-01 20:23:30 - */ -@Mapper -public interface UserProductSpuCollectionsConvert { - - UserProductSpuCollectionsConvert INSTANCE = Mappers.getMapper(UserProductSpuCollectionsConvert.class); - - /** - * DTO convert DO - * @param userSkuCollectionsAddDTO - * @return - */ - @Mappings({}) - UserProductSpuCollectionsDO convert(UserProductSpuCollectionsAddDTO userSkuCollectionsAddDTO); - - /** - * update DTO convert DO - * @param userProductSpuCollectionsUpdateDTO - * @return - */ - @Mappings({}) - UserProductSpuCollectionsDO convert(UserProductSpuCollectionsUpdateDTO userProductSpuCollectionsUpdateDTO); - - /** - * DO Convert BO - * @param userSkuCollectionsDO - * @return - */ - @Mappings({}) - UserProductSpuCollectionsBO convert(UserProductSpuCollectionsDO userSkuCollectionsDO); - - /** - * DO List convert BO LIST - * @param userSkuCollectionsDOS - * @return - */ - @Mappings({}) - List convert(List userSkuCollectionsDOS); - - /** - * 消处数据转换 - * @param productSpuCollectionMessage - * @return - */ - @Mappings({}) - UserProductSpuCollectionsAddDTO convert(ProductSpuCollectionMessage productSpuCollectionMessage); - - -} diff --git a/归档/moved/product/product-service-impl/src/main/java/cn/iocoder/mall/product/message/UserProductSpuCollectionsConsumer.java b/归档/moved/product/product-service-impl/src/main/java/cn/iocoder/mall/product/message/UserProductSpuCollectionsConsumer.java deleted file mode 100644 index 0a5121180..000000000 --- a/归档/moved/product/product-service-impl/src/main/java/cn/iocoder/mall/product/message/UserProductSpuCollectionsConsumer.java +++ /dev/null @@ -1,125 +0,0 @@ -package cn.iocoder.mall.product.message; - -import cn.iocoder.common.framework.util.ServiceExceptionUtil; -import cn.iocoder.mall.mybatis.core.enums.DeletedStatusEnum; -import cn.iocoder.mall.product.api.UserProductSpuCollectionsService; -import cn.iocoder.mall.product.api.bo.UserProductSpuCollectionsBO; -import cn.iocoder.mall.product.api.dto.UserProductSpuCollectionsAddDTO; -import cn.iocoder.mall.product.api.dto.UserProductSpuCollectionsUpdateDTO; -import cn.iocoder.mall.product.api.message.ProductSpuCollectionMessage; -import cn.iocoder.mall.product.convert.UserProductSpuCollectionsConvert; -import cn.iocoder.mall.user.api.UserService; -import cn.iocoder.mall.user.api.bo.UserBO; -import cn.iocoder.mall.user.biz.enums.UserErrorCodeEnum; -import org.apache.commons.lang3.StringUtils; -import org.apache.dubbo.config.annotation.Reference; -import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; -import org.apache.rocketmq.spring.core.RocketMQListener; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.time.LocalDateTime; - -/** - * 商品收藏 消费者 - * @author xiaofeng - * @date 2019/07/02 19:57 - * @version 1.0 - */ -@Service -@RocketMQMessageListener(topic = ProductSpuCollectionMessage.TOPIC, consumerGroup = "product-spu-consumer-group-" - + ProductSpuCollectionMessage.TOPIC) -public class UserProductSpuCollectionsConsumer implements RocketMQListener { - - @Autowired - private UserProductSpuCollectionsService userProductSpuCollectionsService; - - @Reference(validation = "true", version = "${dubbo.consumer.UserService.version}") - private UserService userService; - - @Override - public void onMessage(ProductSpuCollectionMessage productSpuCollectionMessage) { - UserBO userBO = userService.getUser(productSpuCollectionMessage.getUserId()); - if (userBO == null) { - throw ServiceExceptionUtil.exception(UserErrorCodeEnum.USER_NOT_EXISTS.getCode()); - } - // 收藏 - if (productSpuCollectionMessage.getHasCollectionType().equals(1)) { - this.saveUserProductSpuCollections(productSpuCollectionMessage, userBO.getNickname()); - } else if (productSpuCollectionMessage.getHasCollectionType().equals(2)) { - // 取消收藏 - this.deleteUserProductSpuCollections(productSpuCollectionMessage.getUserId(), - productSpuCollectionMessage.getSpuId()); - } - - } - - /** - * 保存商品收藏 - * @param productSpuCollectionMessage - * @param nickname - * @return - */ - private int saveUserProductSpuCollections(final ProductSpuCollectionMessage productSpuCollectionMessage, - final String nickname) { - int result = 0; - UserProductSpuCollectionsBO userProductSpuCollectionsBO = this.userProductSpuCollectionsService - .getUserSpuCollectionsByUserIdAndSpuId(productSpuCollectionMessage.getUserId(), - productSpuCollectionMessage.getSpuId()); - if (userProductSpuCollectionsBO == null) { - UserProductSpuCollectionsAddDTO userProductSpuCollectionsAddDTO = UserProductSpuCollectionsConvert.INSTANCE - .convert(productSpuCollectionMessage); - userProductSpuCollectionsAddDTO.setNickname(StringUtils.isEmpty(nickname) ? "" : nickname); - userProductSpuCollectionsAddDTO.setCreateTime(new Date()); - userProductSpuCollectionsAddDTO.setDeleted(DeletedStatusEnum.DELETED_NO.getValue()); - result = userProductSpuCollectionsService.addUserSkuCollections(userProductSpuCollectionsAddDTO); - } else { - // 存在重新收藏 - if (userProductSpuCollectionsBO.getDeleted().equals(DeletedStatusEnum.DELETED_YES.getValue())) { - UserProductSpuCollectionsUpdateDTO userProductSpuCollectionsUpdateDTO = this - .setUserProductSpuCollectionsUpdateDTO(userProductSpuCollectionsBO.getId(), - DeletedStatusEnum.DELETED_NO); - result = this.userProductSpuCollectionsService - .updateUserProductSpuCollections(userProductSpuCollectionsUpdateDTO); - } - } - return result; - } - - /** - * 取消收藏 - * @param userId - * @param spuId - * @return - */ - private int deleteUserProductSpuCollections(final Integer userId, final Integer spuId) { - UserProductSpuCollectionsBO userProductSpuCollectionsBO = this.userProductSpuCollectionsService - .getUserSpuCollectionsByUserIdAndSpuId(userId, spuId); - int result = 0; - if (userProductSpuCollectionsBO != null) { - // 未取消收藏的数据 - if (userProductSpuCollectionsBO.getDeleted().equals(DeletedStatusEnum.DELETED_NO.getValue())) { - UserProductSpuCollectionsUpdateDTO userProductSpuCollectionsUpdateDTO = this - .setUserProductSpuCollectionsUpdateDTO(userProductSpuCollectionsBO.getId(), - DeletedStatusEnum.DELETED_YES); - result = this.userProductSpuCollectionsService - .updateUserProductSpuCollections(userProductSpuCollectionsUpdateDTO); - } - } - return result; - } - - /** - * 设置更新值 - * @param id - * @param deletedStatusEnum - * @return - */ - private UserProductSpuCollectionsUpdateDTO setUserProductSpuCollectionsUpdateDTO(final Integer id, - final DeletedStatusEnum deletedStatusEnum) { - return new UserProductSpuCollectionsUpdateDTO().setId(id).setUpdateTime(new Date()) - .setDeleted(deletedStatusEnum.getValue()); - } - - -} diff --git a/归档/moved/product/product-service-impl/src/main/java/cn/iocoder/mall/product/service/ProductAttrServiceImpl.java b/归档/moved/product/product-service-impl/src/main/java/cn/iocoder/mall/product/service/ProductAttrServiceImpl.java deleted file mode 100644 index e310289af..000000000 --- a/归档/moved/product/product-service-impl/src/main/java/cn/iocoder/mall/product/service/ProductAttrServiceImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -package cn.iocoder.mall.product.service; - -import cn.iocoder.common.framework.util.ServiceExceptionUtil; -import cn.iocoder.mall.mybatis.core.enums.DeletedStatusEnum; -import cn.iocoder.mall.product.api.ProductAttrService; -import cn.iocoder.mall.product.api.bo.*; -import cn.iocoder.mall.product.api.constant.ProductAttrConstants; -import cn.iocoder.mall.product.api.constant.ProductErrorCodeEnum; -import cn.iocoder.mall.product.api.dto.*; -import cn.iocoder.mall.product.convert.ProductAttrConvert; -import cn.iocoder.mall.product.dao.ProductAttrMapper; -import cn.iocoder.mall.product.dao.ProductAttrValueMapper; -import cn.iocoder.mall.product.dataobject.ProductAttrDO; -import cn.iocoder.mall.product.dataobject.ProductAttrValueDO; -import com.google.common.collect.ImmutableListMultimap; -import com.google.common.collect.Multimaps; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.*; -import java.util.stream.Collectors; - -/** - * 商品规格 Service 实现类 - * - * @see cn.iocoder.mall.product.dataobject.ProductAttrDO - * @see cn.iocoder.mall.product.dataobject.ProductAttrValueDO - */ -@Service -@org.apache.dubbo.config.annotation.Service(validation = "true", version = "${dubbo.provider.ProductAttrService.version}") -public class ProductAttrServiceImpl implements ProductAttrService { - - @Autowired - private ProductAttrMapper productAttrMapper; - @Autowired - private ProductAttrValueMapper productAttrValueMapper; - - @Override - public List getProductAttrList() { - // 查询所有开启的规格数组 - List attrs = ProductAttrConvert.INSTANCE.convert3(productAttrMapper.selectListByStatus(ProductAttrConstants.ATTR_STATUS_ENABLE)); - // 如果为空,则返回空 - if (attrs.isEmpty()) { - return Collections.emptyList(); - } - // 将规格值拼接上去 - List attrValues = productAttrValueMapper.selectListByStatus(ProductAttrConstants.ATTR_VALUE_STATUS_ENABLE); - ImmutableListMultimap attrValueMap = Multimaps.index(attrValues, ProductAttrValueDO::getAttrId); // KEY 是 attrId ,VALUE 是 ProductAttrValueDO 数组 - for (ProductAttrSimpleBO productAttrSimpleBO : attrs) { - productAttrSimpleBO.setValues(ProductAttrConvert.INSTANCE.convert4(((attrValueMap).get(productAttrSimpleBO.getId())))); - } - return attrs; - } - - -} diff --git a/归档/moved/product/product-service-impl/src/main/java/cn/iocoder/mall/product/service/ProductSpuServiceImpl.java b/归档/moved/product/product-service-impl/src/main/java/cn/iocoder/mall/product/service/ProductSpuServiceImpl.java deleted file mode 100644 index 47a424bc9..000000000 --- a/归档/moved/product/product-service-impl/src/main/java/cn/iocoder/mall/product/service/ProductSpuServiceImpl.java +++ /dev/null @@ -1,108 +0,0 @@ -package cn.iocoder.mall.product.service; - -import cn.iocoder.common.framework.util.CollectionUtil; -import cn.iocoder.common.framework.util.ServiceExceptionUtil; -import cn.iocoder.common.framework.util.StringUtil; -import cn.iocoder.mall.mybatis.core.enums.DeletedStatusEnum; -import cn.iocoder.mall.product.api.ProductSpuService; -import cn.iocoder.mall.product.api.bo.*; -import cn.iocoder.mall.product.api.constant.ProductCategoryConstants; -import cn.iocoder.mall.product.api.constant.ProductErrorCodeEnum; -import cn.iocoder.mall.product.api.constant.ProductSpuConstants; -import cn.iocoder.mall.product.api.dto.*; -import cn.iocoder.mall.product.api.message.ProductUpdateMessage; -import cn.iocoder.mall.product.convert.ProductSpuConvert; -import cn.iocoder.mall.product.dao.ProductSkuMapper; -import cn.iocoder.mall.product.dao.ProductSpuMapper; -import cn.iocoder.mall.product.dataobject.ProductCategoryDO; -import cn.iocoder.mall.product.dataobject.ProductSkuDO; -import cn.iocoder.mall.product.dataobject.ProductSpuDO; -import cn.iocoder.mall.product.message.MQStreamProducer; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.messaging.Message; -import org.springframework.messaging.support.MessageBuilder; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.Assert; - -import java.util.*; -import java.util.stream.Collectors; - -@Service // 实际上不用添加。添加的原因是,必须 Spring 报错提示 -@org.apache.dubbo.config.annotation.Service(validation = "true", version = "${dubbo.provider.ProductSpuService.version}") -public class ProductSpuServiceImpl implements ProductSpuService { - - @Autowired - private ProductSpuMapper productSpuMapper; - @Autowired - private ProductSkuMapper productSkuMapper; - - @Autowired - private ProductCategoryServiceImpl productCategoryService; - @Autowired - private ProductAttrServiceImpl productAttrService; - -// @Override -// public ProductSpuBO getProductSpuDetail(Integer id) { -// ProductSpuDO productSpuDO = productSpuMapper.selectById(id); -// // 转换成 BO -// return ProductSpuConvert.INSTANCE.convert(productSpuDO); -// } - - @Override - public Boolean updateProductSpuSort(Integer adminId, Integer spuId, Integer sort) { - // 校验 Spu 是否存在 - if (productSpuMapper.selectById(spuId) == null) { - throw ServiceExceptionUtil.exception(ProductErrorCodeEnum.PRODUCT_SPU_NOT_EXISTS.getCode()); - } - // 更新排序 - ProductSpuDO updateSpu = new ProductSpuDO().setId(spuId).setSort(sort); - productSpuMapper.update(updateSpu); - // 修改成功,发送商品 Topic 消息 - sendProductUpdateMessage(spuId); - // 返回成功 - return true; - } - - @Override - public List getProductSpuSearchList(ProductSpuSearchListDTO productSpuSearchListDTO) { - return ProductSpuConvert.INSTANCE.convert( - productSpuMapper.selectListByNameLikeOrderBySortAsc(productSpuSearchListDTO.getName(), null, null, - null, null, null) - ); - } - - @Override - public List getProductSpuList(Collection ids) { - List spus = productSpuMapper.selectByIds(ids); - return ProductSpuConvert.INSTANCE.convert(spus); - } - - @Override - public ProductSkuBO getProductSku(Integer id) { - ProductSkuDO sku = productSkuMapper.selectById(id); - return ProductSpuConvert.INSTANCE.convert4(sku); - } - - @Override - public List getProductSkuDetailList(Collection ids) { - // 查询 SKU 数组 - List skus = productSkuMapper.selectByIds(ids); - if (skus.isEmpty()) { - return Collections.emptyList(); - } - // 查询 SPU 数组 - List spus = productSpuMapper.selectByIds(skus.stream().map(ProductSkuDO::getSpuId).collect(Collectors.toSet())); - if (spus.isEmpty()) { - return Collections.emptyList(); - } - // 获得规格 - Set productAttrValueIds = new HashSet<>(); - skus.forEach(sku -> productAttrValueIds.addAll(StringUtil.splitToInt(sku.getAttrs(), ","))); - List attrAndValuePairList = productAttrService.validProductAttrAndValue(productAttrValueIds, - false); // 读取规格时,不考虑规格是否被禁用 - // 返回成功 - return ProductSpuConvert.INSTANCE.convert3(skus, spus, attrAndValuePairList); - } - -} diff --git a/归档/moved/product/product-service-impl/src/main/java/cn/iocoder/mall/product/service/UserProductSpuCollectionsServiceImpl.java b/归档/moved/product/product-service-impl/src/main/java/cn/iocoder/mall/product/service/UserProductSpuCollectionsServiceImpl.java deleted file mode 100644 index 2f55f6ea3..000000000 --- a/归档/moved/product/product-service-impl/src/main/java/cn/iocoder/mall/product/service/UserProductSpuCollectionsServiceImpl.java +++ /dev/null @@ -1,132 +0,0 @@ -package cn.iocoder.mall.product.service; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.mybatis.core.enums.DeletedStatusEnum; -import cn.iocoder.mall.product.api.UserProductSpuCollectionsService; -import cn.iocoder.mall.product.api.bo.UserProductSpuCollectionsBO; -import cn.iocoder.mall.product.api.bo.UserProductSpuCollectionsPageBO; -import cn.iocoder.mall.product.api.dto.UserProductSpuCollectionsAddDTO; -import cn.iocoder.mall.product.api.dto.UserProductSpuCollectionsPageDTO; -import cn.iocoder.mall.product.api.dto.UserProductSpuCollectionsUpdateDTO; -import cn.iocoder.mall.product.convert.UserProductSpuCollectionsConvert; -import cn.iocoder.mall.product.dao.UserProductSpuCollectionsMapper; -import cn.iocoder.mall.product.dataobject.UserProductSpuCollectionsDO; -import com.google.common.base.Splitter; -import com.google.common.collect.Lists; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - -import java.util.Collections; -import java.time.LocalDateTime; -import java.util.List; - -/** - * UserSkuCollectionsServiceImpl - * @author xiaofeng - * @date 2019/07/01 21:02 - * @version 1.0 - */ -@Service -@org.apache.dubbo.config.annotation.Service(validation = "true", version = "${dubbo.provider.UserProductSpuCollectionsService.version}") -public class UserProductSpuCollectionsServiceImpl implements UserProductSpuCollectionsService { - - - @Autowired - private UserProductSpuCollectionsMapper userProductSpuCollectionsMapper; - - // TODO 暂时先使用冗余字段,有需要在对接实时数据查询 -// @Reference(validation = "true", version = "${dubbo.consumer.PromotionActivityService.version}") -// private ProductSpuService productSpuService; - - - @Override - public int addUserSkuCollections(UserProductSpuCollectionsAddDTO userProductSpuCollectionsAddDTO) { - return userProductSpuCollectionsMapper - .insert(UserProductSpuCollectionsConvert.INSTANCE.convert(userProductSpuCollectionsAddDTO)); - } - - @Override - public UserProductSpuCollectionsBO getUserSpuCollectionsByUserIdAndSpuId(Integer userId, Integer spuId) { - UserProductSpuCollectionsDO userProductSpuCollectionsDO = userProductSpuCollectionsMapper - .getUserSpuCollectionsByUserIdAndSpuId(userId, spuId); - return UserProductSpuCollectionsConvert.INSTANCE.convert(userProductSpuCollectionsDO); - } - - @Override - public int updateUserProductSpuCollections(UserProductSpuCollectionsUpdateDTO userProductSpuCollectionsUpdateDTO) { - return userProductSpuCollectionsMapper - .updateById(UserProductSpuCollectionsConvert.INSTANCE.convert(userProductSpuCollectionsUpdateDTO)); - } - - @Override - public CommonResult getUserProductSpuCollectionsPage( - UserProductSpuCollectionsPageDTO userProductSpuCollectionsPageDTO) { - final int offset = - (userProductSpuCollectionsPageDTO.getPageNo() - 1) * userProductSpuCollectionsPageDTO.getPageSize(); - final int totalCount = this.userProductSpuCollectionsMapper - .selectCountByUser(userProductSpuCollectionsPageDTO.getUserId()); - if (totalCount == 0) { - return CommonResult - .success(new UserProductSpuCollectionsPageBO().setList(Collections.emptyList()).setTotal(0)); - } - - List list = userProductSpuCollectionsMapper - .selectListByUser(userProductSpuCollectionsPageDTO.getUserId(), offset, - userProductSpuCollectionsPageDTO.getPageSize()); - if (CollectionUtils.isEmpty(list)) { - return CommonResult.success( - new UserProductSpuCollectionsPageBO().setList(Collections.emptyList()).setTotal(totalCount)); - } - for (UserProductSpuCollectionsDO userProductSpuCollectionsDO : list - ) { - List result = Lists.newArrayList(Splitter.on(",").omitEmptyStrings().trimResults().split(userProductSpuCollectionsDO.getSpuImage())); - userProductSpuCollectionsDO.setSpuImage(result.size() > 0 ? result.get(0) : ""); - } - - UserProductSpuCollectionsPageBO userProductSpuCollectionsPageBO = new UserProductSpuCollectionsPageBO(); - userProductSpuCollectionsPageBO.setList(UserProductSpuCollectionsConvert.INSTANCE.convert(list)); - // 查询分页总数 - userProductSpuCollectionsPageBO.setTotal(totalCount); - // 返回结果 - return CommonResult.success(userProductSpuCollectionsPageBO); - } - - - /** - * 取消收藏 - * @param userId - * @param spuId - * @return - */ - @Override - public CommonResult deleteUserProductSpuCollections(final Integer userId, final Integer spuId) { - UserProductSpuCollectionsBO userProductSpuCollectionsBO = this - .getUserSpuCollectionsByUserIdAndSpuId(userId, spuId); - int result = 0; - if (userProductSpuCollectionsBO != null) { - // 未取消收藏的数据 - if (userProductSpuCollectionsBO.getDeleted().equals(DeletedStatusEnum.DELETED_NO.getValue())) { - UserProductSpuCollectionsUpdateDTO userProductSpuCollectionsUpdateDTO = new UserProductSpuCollectionsUpdateDTO() - .setId(userProductSpuCollectionsBO.getId()).setUpdateTime(new Date()) - .setDeleted(DeletedStatusEnum.DELETED_YES.getValue()); - result = this.updateUserProductSpuCollections(userProductSpuCollectionsUpdateDTO); - } - } - return CommonResult.success(result > 0 ? Boolean.TRUE : Boolean.FALSE); - } - - @Override - public CommonResult hasUserSpuFavorite(final Integer spuId, final Integer userId) { - UserProductSpuCollectionsBO userProductSpuCollectionsBO = this - .getUserSpuCollectionsByUserIdAndSpuId(userId, spuId); - - if (userProductSpuCollectionsBO != null) { - // 收藏 - final boolean hasCollect = userProductSpuCollectionsBO.getDeleted() - .equals(DeletedStatusEnum.DELETED_NO.getValue()); - return CommonResult.success(hasCollect); - } - return CommonResult.success(Boolean.FALSE); - } -} diff --git a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/admins/AdminsProductAttrController.java b/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/admins/AdminsProductAttrController.java deleted file mode 100644 index 425db2b6f..000000000 --- a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/admins/AdminsProductAttrController.java +++ /dev/null @@ -1,44 +0,0 @@ -package cn.iocoder.mall.product.application.controller.admins; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.product.api.ProductAttrService; -import cn.iocoder.mall.product.api.bo.ProductAttrBO; -import cn.iocoder.mall.product.api.bo.ProductAttrPageBO; -import cn.iocoder.mall.product.api.bo.ProductAttrSimpleBO; -import cn.iocoder.mall.product.api.bo.ProductAttrValueBO; -import cn.iocoder.mall.product.api.dto.*; -import cn.iocoder.mall.product.application.convert.ProductAttrConvert; -import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrPageVO; -import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrSimpleVO; -import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrVO; -import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrValueVO; -import cn.iocoder.mall.security.core.context.AdminSecurityContextHolder; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import org.apache.dubbo.config.annotation.Reference; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -import static cn.iocoder.common.framework.vo.CommonResult.success; - -@RestController -@RequestMapping("admins") -@Api("商品规格") -public class AdminsProductAttrController { - - @Reference(validation = "true", version = "${dubbo.provider.ProductAttrService.version}") - private ProductAttrService productAttrService; - - @GetMapping("/attr/tree") - @ApiOperation(value = "获得规格树结构", notes = "该接口返回的信息更为精简。一般用于前端缓存数据字典到本地。") - public CommonResult> tree() { - // 查询全列表 - List result = productAttrService.getProductAttrList(); - // 返回结果 - return success(ProductAttrConvert.INSTANCE.convert(result)); - } - -} diff --git a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/admins/AdminsProductSpuController.java b/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/admins/AdminsProductSpuController.java deleted file mode 100644 index fe7430e72..000000000 --- a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/admins/AdminsProductSpuController.java +++ /dev/null @@ -1,71 +0,0 @@ -package cn.iocoder.mall.product.application.controller.admins; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.product.api.ProductSpuService; -import cn.iocoder.mall.product.api.bo.ProductSpuBO; -import cn.iocoder.mall.product.api.bo.ProductSpuDetailBO; -import cn.iocoder.mall.product.api.bo.ProductSpuPageBO; -import cn.iocoder.mall.product.api.dto.*; -import cn.iocoder.mall.product.application.convert.ProductSpuConvert; -import cn.iocoder.mall.product.application.vo.admins.AdminsProductSpuDetailVO; -import cn.iocoder.mall.product.application.vo.admins.AdminsProductSpuPageVO; -import cn.iocoder.mall.product.application.vo.admins.AdminsProductSpuVO; -import cn.iocoder.mall.security.core.context.AdminSecurityContextHolder; -import com.alibaba.fastjson.JSON; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import org.apache.dubbo.config.annotation.Reference; -import org.springframework.web.bind.annotation.*; - -import java.util.Collection; -import java.util.List; - -import static cn.iocoder.common.framework.vo.CommonResult.success; - -@RestController -@RequestMapping("admins") -@Api("商品 SPU + SKU") -public class AdminsProductSpuController { - - @PostMapping("/spu/update_sort") - @ApiOperation("更新商品的排序") - public CommonResult updateSort(@RequestParam("id") Integer id, - @RequestParam("sort") Integer sort) { - return success(productSpuService.updateProductSpuSort(AdminSecurityContextHolder.getContext().getAdminId(), id, sort)); - } - - @GetMapping("/spu/search_list") - @ApiOperation("商品 SPU 搜索列表") - @ApiImplicitParams({ - @ApiImplicitParam(name = "name", value = "商品名称,模糊匹配", example = "小王"), - }) - public CommonResult> spuSearchList(@RequestParam(value = "name", required = false) String name) { - // 创建 ProductSpuSearchListDTO 对象 - ProductSpuSearchListDTO productSpuSearchListDTO = new ProductSpuSearchListDTO().setName(name); - // 执行搜索 - List list = productSpuService.getProductSpuSearchList(productSpuSearchListDTO); - // 转换返回 - return success(ProductSpuConvert.INSTANCE.convert3(list)); - } - - @GetMapping("/spu/info") - @ApiOperation("商品 SPU 明细") - @ApiImplicitParam(name = "id", value = "SPU 编号", required = true, example = "100") - public CommonResult spuInfo(@RequestParam("id") Integer id) { - return success(ProductSpuConvert.INSTANCE.convert(productSpuService.getProductSpuDetail(id))); - } - - @GetMapping("/spu/list") - @ApiOperation("商品 SPU 列表") - @ApiImplicitParams({ - @ApiImplicitParam(name = "ids", value = "商品 SPU 编号数组", example = "1,2,3"), - }) - public CommonResult> spuList(@RequestParam("ids") Collection ids) { - List list = productSpuService.getProductSpuList(ids); - // 转换返回 - return success(ProductSpuConvert.INSTANCE.convert3(list)); - } - -} diff --git a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/users/UserFavoriteController.java b/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/users/UserFavoriteController.java deleted file mode 100644 index 5a8efd159..000000000 --- a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/users/UserFavoriteController.java +++ /dev/null @@ -1,50 +0,0 @@ -package cn.iocoder.mall.product.application.controller.users; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.product.api.UserProductSpuCollectionsService; -import cn.iocoder.mall.product.api.bo.UserProductSpuCollectionsPageBO; -import cn.iocoder.mall.product.api.dto.UserProductSpuCollectionsPageDTO; -import cn.iocoder.mall.security.core.context.UserSecurityContextHolder; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.apache.dubbo.config.annotation.Reference; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -/** - * 用户收藏 - * @author xiaofeng - * @date 2019/07/07 11:06 - * @version 1.0 - */ -@RestController -@RequestMapping("users/favorite") -@Api("用户收藏") -public class UserFavoriteController { - - @Reference(validation = "true", version = "${dubbo.provider.UserProductSpuCollectionsService.version}") - private UserProductSpuCollectionsService userProductSpuCollectionsService; - - @GetMapping("page") - @ApiOperation("用户商品收藏列表") - public CommonResult getUserProductSpuCollectionsPage( - @Validated UserProductSpuCollectionsPageDTO userProductSpuCollectionsPageDTO) { - final Integer userId = UserSecurityContextHolder.getContext().getUserId(); - userProductSpuCollectionsPageDTO.setUserId(userId); - return userProductSpuCollectionsService.getUserProductSpuCollectionsPage(userProductSpuCollectionsPageDTO); - } - - @DeleteMapping("remove") - @ApiOperation(value = "用户商品收藏-删除") - public CommonResult removeUserFavorite(@RequestParam("spuId") final Integer spuId) { - final Integer userId = UserSecurityContextHolder.getContext().getUserId(); - return userProductSpuCollectionsService.deleteUserProductSpuCollections(userId, spuId); - } - - @GetMapping("hasUserFavorite") - @ApiOperation(value = "用户商品收藏-是否收藏") - public CommonResult hasUserSpuFavorite(@RequestParam("spuId") final Integer spuId) { - final Integer userId = UserSecurityContextHolder.getContext().getUserId(); - return userProductSpuCollectionsService.hasUserSpuFavorite(spuId, userId); - } -} diff --git a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/users/UsersProductSpuCollectionController.java b/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/users/UsersProductSpuCollectionController.java deleted file mode 100644 index 46fe604f4..000000000 --- a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/users/UsersProductSpuCollectionController.java +++ /dev/null @@ -1,37 +0,0 @@ -package cn.iocoder.mall.product.application.controller.users; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.product.api.ProductSpuCollectionService; -import cn.iocoder.mall.security.core.context.UserSecurityContextHolder; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.apache.dubbo.config.annotation.Reference; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import static cn.iocoder.common.framework.vo.CommonResult.success; - -/** - * 商品收藏接口 - * @author xiaofeng - * @date 2019/07/01 23:21 - * @version 1.0 - */ -@RestController -@RequestMapping("users/spu") -@Api("商品收藏") -public class UsersProductSpuCollectionController { - - @Reference(validation = "true", version = "${dubbo.provider.ProductSpuCollectionService.version}") - private ProductSpuCollectionService productSpuCollectionService; - - @PostMapping("/collection/{spuId}/{hasCollectionType}") - @ApiOperation("商品收藏") - public CommonResult productSpuCollection(@PathVariable("spuId") Integer spuId, - @PathVariable("hasCollectionType") Integer hasCollectionType) { - final Integer userId = UserSecurityContextHolder.getContext().getUserId(); - return success(productSpuCollectionService.productSpuCollection(spuId, hasCollectionType,userId)); - } -} diff --git a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductAttrAndValuePairVO.java b/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductAttrAndValuePairVO.java deleted file mode 100644 index 33c6fb643..000000000 --- a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductAttrAndValuePairVO.java +++ /dev/null @@ -1,22 +0,0 @@ -package cn.iocoder.mall.product.application.vo.admins; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -@ApiModel(value = "商品规格属性和值对 VO") -@Data -@Accessors(chain = true) -public class AdminsProductAttrAndValuePairVO { - - @ApiModelProperty(value = "规格编号", required = true, example = "1") - private Integer attrId; - @ApiModelProperty(value = "规格名", required = true, example = "颜色") - private String attrName; - @ApiModelProperty(value = "规格值", required = true, example = "10") - private Integer attrValueId; - @ApiModelProperty(value = "规格值名", required = true, example = "红色") - private String attrValueName; - -} diff --git a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductAttrDetailVO.java b/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductAttrDetailVO.java deleted file mode 100644 index 1d65c4193..000000000 --- a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductAttrDetailVO.java +++ /dev/null @@ -1,27 +0,0 @@ -package cn.iocoder.mall.product.application.vo.admins; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.time.LocalDateTime; -import java.util.List; - -@ApiModel(value = "商品规格明细 VO", description = "带有规格值数组") -@Data -@Accessors(chain = true) -public class AdminsProductAttrDetailVO { - - @ApiModelProperty(value = "规格编号", required = true, example = "1") - private Integer id; - @ApiModelProperty(value = "规格名", required = true, example = "颜色") - private String name; - @ApiModelProperty(value = "状态", required = true, example = "1") - private Integer status; - @ApiModelProperty(value = "创建时间", required = true, example = "时间戳") - private LocalDateTime createTime; - @ApiModelProperty(value = "规格值数组", required = true) - private List values; - -} diff --git a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductAttrPageVO.java b/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductAttrPageVO.java deleted file mode 100644 index 73fe8e343..000000000 --- a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductAttrPageVO.java +++ /dev/null @@ -1,20 +0,0 @@ -package cn.iocoder.mall.product.application.vo.admins; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.List; - -@ApiModel(value = "商品规格明细分页 VO") -@Data -@Accessors(chain = true) -public class AdminsProductAttrPageVO { - - @ApiModelProperty(value = "规格数组", required = true) - private List attrs; - @ApiModelProperty(value = "总数", required = true) - private Integer count; - -} diff --git a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductAttrSimpleVO.java b/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductAttrSimpleVO.java deleted file mode 100644 index b734772f0..000000000 --- a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductAttrSimpleVO.java +++ /dev/null @@ -1,22 +0,0 @@ -package cn.iocoder.mall.product.application.vo.admins; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.List; - -@ApiModel(value = "商品规格精简 VO", description = "带有规格值数组") -@Data -@Accessors(chain = true) -public class AdminsProductAttrSimpleVO { - - @ApiModelProperty(value = "规格编号", required = true, example = "1") - private Integer id; - @ApiModelProperty(value = "规格名", required = true, example = "颜色") - private String name; - @ApiModelProperty(value = "规格值数组", required = true) - private List values; - -} diff --git a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductAttrVO.java b/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductAttrVO.java deleted file mode 100644 index 2309ad9d8..000000000 --- a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductAttrVO.java +++ /dev/null @@ -1,24 +0,0 @@ -package cn.iocoder.mall.product.application.vo.admins; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.time.LocalDateTime; - -@ApiModel(value = "商品规格 VO", description = "不带有规格值数组") -@Data -@Accessors(chain = true) -public class AdminsProductAttrVO { - - @ApiModelProperty(value = "规格编号", required = true, example = "1") - private Integer id; - @ApiModelProperty(value = "规格名", required = true, example = "颜色") - private String name; - @ApiModelProperty(value = "状态", required = true, example = "1") - private Integer status; - @ApiModelProperty(value = "创建时间", required = true, example = "时间戳") - private LocalDateTime createTime; - -} diff --git a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductAttrValueDetailVO.java b/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductAttrValueDetailVO.java deleted file mode 100644 index f4c89be0e..000000000 --- a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductAttrValueDetailVO.java +++ /dev/null @@ -1,24 +0,0 @@ -package cn.iocoder.mall.product.application.vo.admins; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.time.LocalDateTime; - -@ApiModel(value = "商品规格值 VO") -@Data -@Accessors(chain = true) -public class AdminsProductAttrValueDetailVO { - - @ApiModelProperty(value = "规格值编号", required = true, example = "1") - private Integer id; - @ApiModelProperty(value = "规格值名", required = true, example = "颜色") - private String name; - @ApiModelProperty(value = "状态", required = true, example = "1") - private Integer status; - @ApiModelProperty(value = "创建时间", required = true, example = "时间戳") - private LocalDateTime createTime; - -} diff --git a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductAttrValueSimpleVO.java b/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductAttrValueSimpleVO.java deleted file mode 100644 index bcd12b54e..000000000 --- a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductAttrValueSimpleVO.java +++ /dev/null @@ -1,18 +0,0 @@ -package cn.iocoder.mall.product.application.vo.admins; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -@ApiModel(value = "商品规格值精简 VO") -@Data -@Accessors(chain = true) -public class AdminsProductAttrValueSimpleVO { - - @ApiModelProperty(value = "规格值编号", required = true, example = "1") - private Integer id; - @ApiModelProperty(value = "规格值名", required = true, example = "颜色") - private String name; - -} diff --git a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductAttrValueVO.java b/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductAttrValueVO.java deleted file mode 100644 index b9e2c8e7f..000000000 --- a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductAttrValueVO.java +++ /dev/null @@ -1,26 +0,0 @@ -package cn.iocoder.mall.product.application.vo.admins; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.time.LocalDateTime; - -@ApiModel(value = "商品规格值 VO") -@Data -@Accessors(chain = true) -public class AdminsProductAttrValueVO { - - @ApiModelProperty(value = "规格值编号", required = true, example = "1") - private Integer id; - @ApiModelProperty(value = "规格编号", required = true, example = "1") - private Integer attrId; - @ApiModelProperty(value = "规格名", required = true, example = "颜色") - private String name; - @ApiModelProperty(value = "状态", required = true, example = "1") - private Integer status; - @ApiModelProperty(value = "创建时间", required = true, example = "时间戳") - private LocalDateTime createTime; - -} diff --git a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductSkuDetailVO.java b/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductSkuDetailVO.java deleted file mode 100644 index bc80242ca..000000000 --- a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductSkuDetailVO.java +++ /dev/null @@ -1,29 +0,0 @@ -package cn.iocoder.mall.product.application.vo.admins; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.List; - -/** - * 商品 Sku 明细 BO - */ -@Data -@Accessors(chain = true) -public class AdminsProductSkuDetailVO { - - @ApiModelProperty(value = "sku 编号", required = true, example = "1") - private Integer id; - @ApiModelProperty(value = "SPU 编号", required = true, example = "1") - private Integer spuId; - @ApiModelProperty(value = "图片地址", required = true, example = "http://www.iocoder.cn") - private String picURL; - @ApiModelProperty(value = "规格值数组", required = true) - private List attrs; - @ApiModelProperty(value = "价格,单位:分", required = true, example = "100") - private Integer price; - @ApiModelProperty(value = "库存数量", required = true, example = "100") - private Integer quantity; - -} diff --git a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductSpuDetailVO.java b/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductSpuDetailVO.java deleted file mode 100644 index 7626f96df..000000000 --- a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductSpuDetailVO.java +++ /dev/null @@ -1,43 +0,0 @@ -package cn.iocoder.mall.product.application.vo.admins; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.List; - -@ApiModel(value = "商品 SPU 详细 VO", description = "包括 SKU 信息 VO") -@Data -@Accessors(chain = true) -public class AdminsProductSpuDetailVO { - - @ApiModelProperty(value = "SPU 编号", required = true, example = "1") - private Integer id; - - // ========== 基本信息 ========= - @ApiModelProperty(value = "SPU 名字", required = true, example = "厮大牛逼") - private String name; - @ApiModelProperty(value = "卖点", required = true, example = "各种 MQ 骚操作") - private String sellPoint; - @ApiModelProperty(value = "描述", required = true, example = "你就说强不强") - private String description; - @ApiModelProperty(value = "分类编号", required = true, example = "反正我是信了") - private Integer cid; - @ApiModelProperty(value = "商品主图地址的数组", required = true, example = "http://www.iocoder.cn") - private List picUrls; - - // ========== 其他信息 ========= - @ApiModelProperty(value = "是否上架商品(是否可见)", required = true, example = "true") - private Boolean visible; - @ApiModelProperty(value = "排序字段", required = true, example = "10") - private Integer sort; - - // ========== SKU ========= - - /** - * SKU 数组 - */ - private List skus; - -} diff --git a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductSpuPageVO.java b/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductSpuPageVO.java deleted file mode 100644 index c83583d2c..000000000 --- a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductSpuPageVO.java +++ /dev/null @@ -1,20 +0,0 @@ -package cn.iocoder.mall.product.application.vo.admins; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.List; - -@ApiModel("商品 SPU 分页 VO") -@Data -@Accessors(chain = true) -public class AdminsProductSpuPageVO { - - @ApiModelProperty(value = "spu 数组", required = true) - private List list; - @ApiModelProperty(value = "总数", required = true) - private Integer total; - -} diff --git a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductSpuVO.java b/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductSpuVO.java deleted file mode 100644 index dddf86389..000000000 --- a/归档/moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/admins/AdminsProductSpuVO.java +++ /dev/null @@ -1,38 +0,0 @@ -package cn.iocoder.mall.product.application.vo.admins; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.List; - -@ApiModel(value = "商品 SPU VO", description = "不包括 SKU 信息 VO") -@Data -@Accessors(chain = true) -public class AdminsProductSpuVO { - - @ApiModelProperty(value = "SPU 编号", required = true, example = "1") - private Integer id; - - // ========== 基本信息 ========= - @ApiModelProperty(value = "SPU 名字", required = true, example = "厮大牛逼") - private String name; - @ApiModelProperty(value = "卖点", required = true, example = "各种 MQ 骚操作") - private String sellPoint; - @ApiModelProperty(value = "描述", required = true, example = "你就说强不强") - private String description; - @ApiModelProperty(value = "分类编号", required = true, example = "反正我是信了") - private Integer cid; - @ApiModelProperty(value = "商品主图地址的数组", required = true, example = "http://www.iocoder.cn") - private List picUrls; - @ApiModelProperty(value = "库存数量", required = true, example = "10") - private Integer quantity; - - // ========== 其他信息 ========= - @ApiModelProperty(value = "是否上架商品(是否可见)", required = true, example = "true") - private Boolean visible; - @ApiModelProperty(value = "排序字段", required = true, example = "10") - private Integer sort; - -} diff --git a/归档/pay-service-project/pay-service-api/pom.xml b/归档/pay-service-project/pay-service-api/pom.xml deleted file mode 100644 index 1241319fa..000000000 --- a/归档/pay-service-project/pay-service-api/pom.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - pay-service-project - cn.iocoder.mall - 1.0-SNAPSHOT - - 4.0.0 - - pay-service-api - - - - cn.iocoder.mall - common-framework - - - - - javax.validation - validation-api - - - org.hibernate - hibernate-validator - true - - - org.projectlombok - lombok - - - org.springframework.cloud - spring-cloud-openfeign-core - RELEASE - - - diff --git a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/enums/PayChannelEnum.java b/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/enums/PayChannelEnum.java deleted file mode 100644 index b75d88e4f..000000000 --- a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/enums/PayChannelEnum.java +++ /dev/null @@ -1,58 +0,0 @@ -package cn.iocoder.mall.payservice.enums; - -import cn.iocoder.common.framework.core.IntArrayValuable; - -import java.util.Arrays; - -/** - * 支付通道 - */ -public enum PayChannelEnum implements IntArrayValuable { - - WEIXIN_APP(100, "wx", "微信 App 支付"), - WEIXIN_PUB(101, "wxjs", "微信 JS API 支付"), - - ALIPAY(200, "alipay", "支付宝 App 支付"), - - PINGXX(9999, "ping++", "ping++ 支付"), - ; - - public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(PayChannelEnum::getId).toArray(); - - /** - * 渠道编号 - */ - private Integer id; - /** - * 编码 - */ - private String code; - /** - * 渠道名 - */ - private String name; - - PayChannelEnum(Integer id, String code, String name) { - this.id = id; - this.code = code; - this.name = name; - } - - public Integer getId() { - return id; - } - - public String getCode() { - return code; - } - - public String getName() { - return name; - } - - @Override - public int[] array() { - return ARRAYS; - } - -} diff --git a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/enums/PayErrorCodeConstants.java b/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/enums/PayErrorCodeConstants.java deleted file mode 100644 index d3905e6cc..000000000 --- a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/enums/PayErrorCodeConstants.java +++ /dev/null @@ -1,31 +0,0 @@ -package cn.iocoder.mall.payservice.enums; - -import cn.iocoder.common.framework.exception.ErrorCode; - -/** - * 错误码枚举类 - * - * 管理员系统,使用 1-004-000-000 段 - */ -public interface PayErrorCodeConstants { - - // ========== APP 模块 ========== - ErrorCode PAY_APP_NOT_FOUND = new ErrorCode(1004000000, "App 不存在"); - ErrorCode PAY_APP_IS_DISABLE = new ErrorCode(1004000001, "App 已经被禁用"); - - // ========== TRANSACTION PAY 模块 ========== - ErrorCode PAY_TRANSACTION_NOT_FOUND = new ErrorCode(100401000, "支付交易单不存在"); - ErrorCode PAY_TRANSACTION_STATUS_IS_NOT_WAITING = new ErrorCode(100401001, "支付交易单不处于待支付"); - ErrorCode PAY_TRANSACTION_STATUS_IS_NOT_SUCCESS = new ErrorCode(100401002, "支付交易单不处于已支付"); - ErrorCode PAY_TRANSACTION_ERROR_USER = new ErrorCode(100401003, "支付交易单用户不正确"); - - ErrorCode PAY_TRANSACTION_EXTENSION_NOT_FOUND = new ErrorCode(100401050, "支付交易拓展单不存在"); - ErrorCode PAY_TRANSACTION_EXTENSION_STATUS_IS_NOT_WAITING = new ErrorCode(100401051, "支付交易拓展单不处于待支付"); - ErrorCode PAY_TRANSACTION_EXTENSION_STATUS_IS_NOT_SUCCESS = new ErrorCode(100401052, "支付交易单不处于已支付"); - - // ========== TRANSACTION REFUND 模块 ========== - ErrorCode PAY_REFUND_PRICE_EXCEED = new ErrorCode(100402000, "退款金额超过支付交易单可退金额"); - ErrorCode PAY_REFUND_NOT_FOUND = new ErrorCode(100402001, "退款单不存在"); - ErrorCode PAY_REFUND_STATUS_NOT_WAITING = new ErrorCode(100402002, "退款单不处于待处理"); - -} diff --git a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/enums/notify/PayNotifyStatusEnum.java b/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/enums/notify/PayNotifyStatusEnum.java deleted file mode 100644 index cd27e50a5..000000000 --- a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/enums/notify/PayNotifyStatusEnum.java +++ /dev/null @@ -1,33 +0,0 @@ -package cn.iocoder.mall.payservice.enums.notify; - -import lombok.Getter; - -/** - * 支付通知状态枚举 - */ -@Getter -public enum PayNotifyStatusEnum { - - WAITING(1, "等待通知"), - SUCCESS(2, "通知成功"), - FAILURE(3, "通知失败"), // 多次尝试,彻底失败 - REQUEST_SUCCESS(4, "请求成功,但是结果失败"), - REQUEST_FAILURE(5, "请求失败"), - - ; - - /** - * 状态 - */ - private final Integer status; - /** - * 名字 - */ - private final String name; - - PayNotifyStatusEnum(Integer status, String name) { - this.status = status; - this.name = name; - } - -} diff --git a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/enums/notify/PayNotifyType.java b/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/enums/notify/PayNotifyType.java deleted file mode 100644 index 0c97b1cbc..000000000 --- a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/enums/notify/PayNotifyType.java +++ /dev/null @@ -1,29 +0,0 @@ -package cn.iocoder.mall.payservice.enums.notify; - -import lombok.Getter; - -/** - * 支付通知类型 - */ -@Getter -public enum PayNotifyType { - - TRANSACTION(1, "支付"), - REFUND(2, "退款"), - ; - - /** - * 类型 - */ - private final Integer type; - /** - * 名字 - */ - private final String name; - - PayNotifyType(Integer type, String name) { - this.type = type; - this.name = name; - } - -} diff --git a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/enums/refund/PayRefundStatus.java b/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/enums/refund/PayRefundStatus.java deleted file mode 100644 index efbe9fbe6..000000000 --- a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/enums/refund/PayRefundStatus.java +++ /dev/null @@ -1,30 +0,0 @@ -package cn.iocoder.mall.payservice.enums.refund; - -import lombok.Getter; - -/** - * 支付退款状态枚举 - */ -@Getter -public enum PayRefundStatus { - - WAITING(1, "处理中"), - SUCCESS(2, "成功"), - FAILURE(3, "失败"), // 例如说,支付单超时 - ; - - /** - * 状态 - */ - private final Integer value; - /** - * 名字 - */ - private final String name; - - PayRefundStatus(Integer value, String name) { - this.value = value; - this.name = name; - } - -} diff --git a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/enums/transaction/PayTransactionStatusEnum.java b/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/enums/transaction/PayTransactionStatusEnum.java deleted file mode 100644 index b30416d86..000000000 --- a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/enums/transaction/PayTransactionStatusEnum.java +++ /dev/null @@ -1,30 +0,0 @@ -package cn.iocoder.mall.payservice.enums.transaction; - -import lombok.Getter; - -/** - * 支付交易状态枚举 - */ -@Getter -public enum PayTransactionStatusEnum { - - WAITING(1, "等待支付"), - SUCCESS(2, "支付成功"), - CANCEL(3, "取消支付"), // 例如说,支付单超时 - ; - - /** - * 状态 - */ - private final Integer status; - /** - * 名字 - */ - private final String name; - - PayTransactionStatusEnum(Integer status, String name) { - this.status = status; - this.name = name; - } - -} diff --git a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/app/PayAppRpc.java b/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/app/PayAppRpc.java deleted file mode 100644 index 6a97ffdfa..000000000 --- a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/app/PayAppRpc.java +++ /dev/null @@ -1,7 +0,0 @@ -package cn.iocoder.mall.payservice.rpc.app; - -/** - * 支付应用 RPC 接口 - */ -public interface PayAppRpc { -} diff --git a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/app/dto/PayAppRespDTO.java b/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/app/dto/PayAppRespDTO.java deleted file mode 100644 index 3289fc740..000000000 --- a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/app/dto/PayAppRespDTO.java +++ /dev/null @@ -1,36 +0,0 @@ -package cn.iocoder.mall.payservice.rpc.app.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * 支付应用 Response DTO - */ -@Data -@Accessors(chain = true) -public class PayAppRespDTO implements Serializable { - - /** - * 应用编号 - */ - private String id; - /** - * 应用名 - */ - private String name; - /** - * 异步通知地址 - */ - private String payNotifyUrl; - /** - * 退款异步通知地址 - */ - private String refundNotifyUrl; - /** - * 状态 - */ - private Integer status; - -} diff --git a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/transaction/PayTransactionFeign.java b/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/transaction/PayTransactionFeign.java deleted file mode 100644 index 48dd9d09b..000000000 --- a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/transaction/PayTransactionFeign.java +++ /dev/null @@ -1,63 +0,0 @@ -package cn.iocoder.mall.payservice.rpc.transaction; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.payservice.rpc.transaction.dto.*; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; - -/** - * Title: - * Description: - * - * @author zhuyang - * @version 1.0 2021/10/9 - */ -@FeignClient(value = "pay-service") -public interface PayTransactionFeign { - /** - * 创建支付交易单 - * - * @param createReqDTO 创建信息 - * @return 支付交易单号 - */ - @PostMapping("/pay/transaction/createPayTransaction") - CommonResult createPayTransaction(@RequestBody PayTransactionCreateReqDTO createReqDTO); - - /** - * 提交支付交易单 - * - * @param submitReqDTO 提交信息 - * @return 提交响应,包含三方支付的响应 - */ - @PostMapping("/pay/transaction/submitPayTransaction") - CommonResult submitPayTransaction(@RequestBody PayTransactionSubmitReqDTO submitReqDTO); - - /** - * 获得当支付交易单 - * - * @param getReqDTO 获得条件 - * @return 支付交易单 - */ - @PostMapping("/pay/transaction/getPayTransaction") - CommonResult getPayTransaction(@RequestBody PayTransactionGetReqDTO getReqDTO); - - /** - * 更新交易支付成功 - * - * @param successReqDTO 支付成功信息 - * @return 是否成功 - */ - @PostMapping("/pay/transaction/updatePayTransactionSuccess") - CommonResult updatePayTransactionSuccess(@RequestBody PayTransactionSuccessReqDTO successReqDTO); - - /** - * 获得交易支付单分页 - * - * @param pageReqDTO 分页条件 - * @return 交易支付单分页 - */ - @PostMapping("/pay/transaction/pagePayTransaction") - CommonResult> pagePayTransaction(@RequestBody PayTransactionPageReqDTO pageReqDTO); -} diff --git a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/transaction/dto/PayTransactionCreateReqDTO.java b/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/transaction/dto/PayTransactionCreateReqDTO.java deleted file mode 100644 index 7674ade40..000000000 --- a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/transaction/dto/PayTransactionCreateReqDTO.java +++ /dev/null @@ -1,72 +0,0 @@ -package cn.iocoder.mall.payservice.rpc.transaction.dto; - -import lombok.Data; -import lombok.experimental.Accessors; -import org.hibernate.validator.constraints.Length; - -import javax.validation.constraints.DecimalMin; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 支付交易单创建 DTO - */ -@Data -@Accessors(chain = true) -public class PayTransactionCreateReqDTO implements Serializable { - - /** - * 用户编号 - */ - @NotNull(message = "用户编号不能为空") - private Integer userId; - - /** - * 应用编号 - */ - @NotEmpty(message = "应用编号不能为空") - private String appId; - /** - * 发起交易的 IP - */ - @NotEmpty(message = "IP 不能为空") - private String createIp; - - /** - * 订单号 - */ - @NotEmpty(message = "订单号不能为空") - private String orderId; - /** - * 商品名 - */ - @NotEmpty(message = "商品名不能为空") - @Length(max = 32, message = "商品名不能超过32") - private String orderSubject; - /** - * 订单商品描述 - */ - @NotEmpty(message = "商品描述不能为空") - @Length(max = 128, message = "商品描述长度不能超过128") - private String orderDescription; - /** - * 订单商品备注 - */ - @Length(max = 256, message = "商品备注长度不能超过256") - private String orderMemo; - /** - * 支付金额,单位:分 - */ - @NotNull(message = "金额不能为空") - @DecimalMin(value = "0", inclusive = false, message = "金额必须大于零") - private Integer price; - - /** - * 交易过期时间 - */ - @NotNull(message = "交易过期时间不能为空") - private LocalDateTime expireTime; - -} diff --git a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/transaction/dto/PayTransactionGetReqDTO.java b/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/transaction/dto/PayTransactionGetReqDTO.java deleted file mode 100644 index 813c9fce0..000000000 --- a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/transaction/dto/PayTransactionGetReqDTO.java +++ /dev/null @@ -1,28 +0,0 @@ -package cn.iocoder.mall.payservice.rpc.transaction.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotEmpty; -import java.io.Serializable; - -/** - * 支付交易获得 Request DTO - */ -@Data -@Accessors(chain = true) -public class PayTransactionGetReqDTO implements Serializable { - - /** - * 应用编号 - */ - @NotEmpty(message = "应用编号不能为空") - private String appId; - - /** - * 订单号 - */ - @NotEmpty(message = "订单号不能为空") - private String orderId; - -} diff --git a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/transaction/dto/PayTransactionPageReqDTO.java b/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/transaction/dto/PayTransactionPageReqDTO.java deleted file mode 100644 index 745dd1df8..000000000 --- a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/transaction/dto/PayTransactionPageReqDTO.java +++ /dev/null @@ -1,53 +0,0 @@ -package cn.iocoder.mall.payservice.rpc.transaction.dto; - -import cn.iocoder.common.framework.vo.PageParam; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.time.LocalDateTime; - -/** - * 支付交易分页 Request DTO - */ -@Data -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -public class PayTransactionPageReqDTO extends PageParam { - - /** - * 创建时间(开始) - */ - private LocalDateTime createBeginTime; - /** - * 创建时间(结束) - */ - private LocalDateTime createEndTime; - /** - * 支付时间(开始) - */ - private LocalDateTime paymentBeginTime; - /** - * 支付时间(结束) - */ - private LocalDateTime paymentEndTime; - /** - * 支付状态 - */ - private Integer status; - /** - * 是否有退款 - */ - private Boolean hasRefund; - /** - * 支付渠道 - */ - private Integer payChannel; - /** - * 商品标题 - * - * 模糊匹配 - */ - private String orderSubject; - -} diff --git a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/transaction/dto/PayTransactionRespDTO.java b/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/transaction/dto/PayTransactionRespDTO.java deleted file mode 100644 index fcc530230..000000000 --- a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/transaction/dto/PayTransactionRespDTO.java +++ /dev/null @@ -1,97 +0,0 @@ -package cn.iocoder.mall.payservice.rpc.transaction.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** -* 支付交易 Response DTO -*/ -@Data -@Accessors(chain = true) -public class PayTransactionRespDTO implements Serializable { - - /** - * 编号,自增 - */ - private Integer id; - /** - * 用户编号 - */ - private Integer userId; - /** - * 应用编号 - */ - private String appId; - /** - * 发起交易的 IP - */ - private String createIp; - /** - * 业务线的订单编号 - */ - private String orderId; - /** - * 订单商品名 - */ - private String orderSubject; - /** - * 订单商品描述 - */ - private String orderDescription; - /** - * 订单备注 - */ - private String orderMemo; - /** - * 支付金额,单位:分。 - */ - private Integer price; - /** - * 订单状态 - */ - private Integer status; - /** - * 交易过期时间 - */ - private LocalDateTime expireTime; - /** - * 回调业务线完成时间 - */ - private LocalDateTime finishTime; - /** - * 异步通知地址 - */ - private String notifyUrl; - /** - * 成功支付的交易拓展编号 - */ - private Integer extensionId; - /** - * 支付成功的支付渠道 - */ - private Integer payChannel; - /** - * 第三方支付成功的时间 - */ - private LocalDateTime paymentTime; - /** - * 收到第三方系统通知的时间 - */ - private LocalDateTime notifyTime; - /** - * 第三方的流水号 - */ - private String tradeNo; - /** - * 退款总金额 - */ - private Integer refundTotal; - /** - * 创建时间 - */ - private LocalDateTime createTime; - -} diff --git a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/transaction/dto/PayTransactionSubmitReqDTO.java b/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/transaction/dto/PayTransactionSubmitReqDTO.java deleted file mode 100644 index eb50bd9fa..000000000 --- a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/transaction/dto/PayTransactionSubmitReqDTO.java +++ /dev/null @@ -1,44 +0,0 @@ -package cn.iocoder.mall.payservice.rpc.transaction.dto; - -import cn.iocoder.common.framework.validator.InEnum; -import cn.iocoder.mall.payservice.enums.PayChannelEnum; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import java.io.Serializable; - -/** - * 支付交易提交 Request VO - */ -@Data -@Accessors(chain = true) -public class PayTransactionSubmitReqDTO implements Serializable { - - /** - * 应用编号 - */ - @NotEmpty(message = "应用编号不能为空") - private String appId; - - /** - * 发起交易的 IP - */ - @NotEmpty(message = "IP 不能为空") - private String createIp; - - /** - * 订单号 - */ - @NotEmpty(message = "订单号不能为空") - private String orderId; - - /** - * 支付渠道 - */ - @InEnum(value = PayChannelEnum.class, message = "支付渠道必须是 {value}") - @NotNull(message = "支付渠道") - private Integer payChannel; - -} diff --git a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/transaction/dto/PayTransactionSubmitRespDTO.java b/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/transaction/dto/PayTransactionSubmitRespDTO.java deleted file mode 100644 index 0eee364cb..000000000 --- a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/transaction/dto/PayTransactionSubmitRespDTO.java +++ /dev/null @@ -1,25 +0,0 @@ -package cn.iocoder.mall.payservice.rpc.transaction.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * 支付交易提交 Response DTO - */ -@Data -@Accessors(chain = true) -public class PayTransactionSubmitRespDTO implements Serializable { - - /** - * 支付交易拓展单编号 - */ - private Integer id; - - /** - * 调用三方平台的响应结果 - */ - private String invokeResponse; - -} diff --git a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/transaction/dto/PayTransactionSuccessReqDTO.java b/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/transaction/dto/PayTransactionSuccessReqDTO.java deleted file mode 100644 index 1484eee90..000000000 --- a/归档/pay-service-project/pay-service-api/src/main/java/cn/iocoder/mall/payservice/rpc/transaction/dto/PayTransactionSuccessReqDTO.java +++ /dev/null @@ -1,24 +0,0 @@ -package cn.iocoder.mall.payservice.rpc.transaction.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * 交易支付成功 Request DTO - */ -@Data -@Accessors(chain = true) -public class PayTransactionSuccessReqDTO implements Serializable { - - /** - * 支付渠道 - */ - private Integer payChannel; - /** - * 支付渠道的回调参数 - */ - private String params; - -} diff --git a/归档/pay-service-project/pay-service-app/pom.xml b/归档/pay-service-project/pay-service-app/pom.xml deleted file mode 100644 index f16d1a35d..000000000 --- a/归档/pay-service-project/pay-service-app/pom.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - pay-service-project - cn.iocoder.mall - 1.0-SNAPSHOT - - 4.0.0 - - pay-service-app - - - - - cn.iocoder.mall - mall-spring-boot-starter-dubbo - - - - - cn.iocoder.mall - pay-service-api - 1.0-SNAPSHOT - - - - - org.springframework.boot - spring-boot-starter-web - - - - - cn.iocoder.mall - mall-spring-boot-starter-rocketmq - - - - - cn.iocoder.mall - mall-spring-boot-starter-xxl-job - - - - - com.alibaba.cloud - spring-cloud-starter-alibaba-nacos-discovery - - - - - mysql - mysql-connector-java - - - - com.alibaba - druid-spring-boot-starter - - - - cn.iocoder.mall - mall-spring-boot-starter-mybatis - - - - - org.springframework.boot - spring-boot-starter-actuator - - - - - Pingplusplus - pingpp-java - 2.2.4 - jar - - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - org.springframework.boot - spring-boot-starter-validation - - - - org.projectlombok - lombok - - - - org.mapstruct - mapstruct - - - org.mapstruct - mapstruct-jdk8 - - - - org.aspectj - aspectjweaver - 1.9.6 - - - - - - ${project.artifactId} - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - - - false - - central - bintray - http://jcenter.bintray.com - - - - diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/PayServiceApplication.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/PayServiceApplication.java deleted file mode 100644 index 67d3e4171..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/PayServiceApplication.java +++ /dev/null @@ -1,17 +0,0 @@ -package cn.iocoder.mall.payservice; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.openfeign.EnableFeignClients; - -@SpringBootApplication -@EnableDiscoveryClient -@EnableFeignClients -public class PayServiceApplication { - - public static void main(String[] args) { - SpringApplication.run(PayServiceApplication.class, args); - } - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/client/package-info.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/client/package-info.java deleted file mode 100644 index e211ca48a..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/client/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package cn.iocoder.mall.payservice.client; diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/client/thirdpay/AbstractThirdPayClient.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/client/thirdpay/AbstractThirdPayClient.java deleted file mode 100644 index 3d6bbe3bb..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/client/thirdpay/AbstractThirdPayClient.java +++ /dev/null @@ -1,59 +0,0 @@ -package cn.iocoder.mall.payservice.client.thirdpay; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.payservice.client.thirdpay.dto.ThirdPayRefundSuccessRespDTO; -import cn.iocoder.mall.payservice.client.thirdpay.dto.ThirdPayTransactionSuccessRespDTO; -import cn.iocoder.mall.payservice.dal.mysql.dataobject.refund.PayRefundDO; -import cn.iocoder.mall.payservice.dal.mysql.dataobject.transaction.PayTransactionDO; -import cn.iocoder.mall.payservice.dal.mysql.dataobject.transaction.PayTransactionExtensionDO; - -import java.util.Map; - -/** - * 三方支付平台的 Client 抽象类 - */ -public abstract class AbstractThirdPayClient { - - /** - * 提交支付请求给支付平台,并返回请求结果 - * - * @param transaction 支付交易数据 - * @param transactionExtension 交易扩展数据 - * @param extra 额外参数。用于支持不同支付平台的拓展字段。例如说,微信公众号支付,需要多传递一个 openid - * @return 请求结果 - */ - public abstract CommonResult submitTransaction(PayTransactionDO transaction, - PayTransactionExtensionDO transactionExtension, - Map extra); - - /** - * 解析支付成功回调的参数,返回 TransactionSuccessBO 对象 - * - * @param params 回调的参数 - * @return 解析结果 - */ - // TODO 芋艿,理论来说不会出现解析失败的情况,先返回这个参数列。等后面封装支付宝和微信支付的时候,在看看。 - public abstract CommonResult parseTransactionSuccessParams(String params); - - /** - * 提交退款请求给支付平台,并返回请求结果 - * - * @param refund 退款数据 - * @param transactionExtension 交易扩展数据 - * @param extra 额外参数。用于支持不同支付平台的拓展字段。 - * @return 请求结果 - */ - public abstract CommonResult submitRefund(PayRefundDO refund, - PayTransactionExtensionDO transactionExtension, - Map extra); - - /** - * 解析退款成功回调的参数,返回 RefundSuccessBO 对象 - * - * @param params 回调的参数 - * @return 解析结果 - */ - // TODO 芋艿,理论来说不会出现解析失败的情况,先返回这个参数列。等后面封装支付宝和微信支付的时候,在看看。 - public abstract CommonResult parseRefundSuccessParams(String params); - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/client/thirdpay/PingxxThirdPayClient.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/client/thirdpay/PingxxThirdPayClient.java deleted file mode 100644 index f373221c5..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/client/thirdpay/PingxxThirdPayClient.java +++ /dev/null @@ -1,149 +0,0 @@ -package cn.iocoder.mall.payservice.client.thirdpay; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.payservice.client.thirdpay.dto.ThirdPayRefundSuccessRespDTO; -import cn.iocoder.mall.payservice.client.thirdpay.dto.ThirdPayTransactionSuccessRespDTO; -import cn.iocoder.mall.payservice.dal.mysql.dataobject.refund.PayRefundDO; -import cn.iocoder.mall.payservice.dal.mysql.dataobject.transaction.PayTransactionDO; -import cn.iocoder.mall.payservice.dal.mysql.dataobject.transaction.PayTransactionExtensionDO; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.google.common.collect.ImmutableMap; -import com.pingplusplus.Pingpp; -import com.pingplusplus.exception.*; -import com.pingplusplus.model.Charge; -import com.pingplusplus.model.Refund; - -import java.time.LocalDateTime; -import java.util.HashMap; -import java.util.Map; - -// TODO 代码略乱,后面重构下 -public class PingxxThirdPayClient extends AbstractThirdPayClient { - - static { - Pingpp.privateKeyPath = "/Users/yunai/Downloads/pingxx.pem"; - Pingpp.apiKey = "sk_test_8a9SGSXLKqX1ennjX9DenvbT"; - } - - @Override - public CommonResult submitTransaction(PayTransactionDO transaction, - PayTransactionExtensionDO transactionExtension, - Map extra) { - Map reqObj = createChargeRequest(transaction, transactionExtension, extra); - // 请求ping++ - try { - Charge charge = Charge.create(reqObj); - System.out.println(charge.toString()); - return CommonResult.success(charge.toString()); - } catch (AuthenticationException | InvalidRequestException | - APIConnectionException | APIException | - ChannelException | RateLimitException e) { - e.printStackTrace(); - throw new RuntimeException(e); // TODO 芋艿,后续优化 - } - } - - private static Map createChargeRequest(PayTransactionDO transaction, - PayTransactionExtensionDO transactionExtension, - Map extra) { - // 计算支付渠道和支付额外参数 - String channel = "wx_pub"; // 因为 ping++ 是用来做模拟支付的渠道,所以这里强制就选择了 wx_pub 微信公众号支付 - extra = new HashMap<>(); // TODO 临时,后面用 extra - extra.put("open_id", "just_for_test"); - // 生成支付对象 - Map reqObj = new HashMap<>(); - reqObj.put("subject", transaction.getOrderSubject()); - reqObj.put("body", transaction.getOrderDescription()); - reqObj.put("description", transaction.getOrderMemo()); - reqObj.put("amount", transaction.getPrice()); - reqObj.put("order_no", transactionExtension.getTransactionCode()); - reqObj.put("channel", channel); - reqObj.put("currency", "cny"); - reqObj.put("client_ip", transactionExtension.getCreateIp()); - reqObj.put("app", ImmutableMap.of("id", "app_aTyfXDjrvzDSbLuz")); // TODO 写死先 - reqObj.put("extra", extra); - return reqObj; - } - - @Override - public CommonResult parseTransactionSuccessParams(String params) { - JSONObject paramsObj = JSON.parseObject(params); - JSONObject chargeObj = paramsObj.getJSONObject("data").getJSONObject("object"); - ThirdPayTransactionSuccessRespDTO successRespDTO = new ThirdPayTransactionSuccessRespDTO() - .setTransactionCode(chargeObj.getString("order_no")) - .setPaymentTime(new Date(chargeObj.getLong("time_paid") * 1000)) - .setTradeNo(chargeObj.getString("transaction_no")); - return CommonResult.success(successRespDTO); - } - - @Override - public CommonResult submitRefund(PayRefundDO refund, - PayTransactionExtensionDO transactionExtension, - Map extra) { - // 解析出 chargeId - JSONObject paramsObj = JSON.parseObject(transactionExtension.getExtensionData()); - JSONObject chargeObj = paramsObj.getJSONObject("data").getJSONObject("object"); - String chargeId = chargeObj.getString("id"); - // 请求ping++ - Map reqObj = createRefundRequest(refund, chargeId, refund.getOrderDescription(), refund.getPrice()); - try { - Refund pingxxRefund = Refund.create(chargeId, reqObj); - System.out.println(pingxxRefund.toString()); - return CommonResult.success(pingxxRefund.toString()); - } catch (AuthenticationException | InvalidRequestException | - APIConnectionException | APIException | - ChannelException | RateLimitException e) { - e.printStackTrace(); - throw new RuntimeException(e); // TODO 芋艿,后续优化 - } - } - -// {"id":"evt_400190427005305341228202","created":1556297585,"livemode":false,"type":"refund.succeeded","data":{"object":{"id":"re_HO0m9GOGOi50KCmX104ufHe1","object":"refund","order_no":"HO0m9GOGOi50KCmX104ufHe1","amount":1,"created":1556297585,"succeed":true,"status":"succeeded","time_succeed":1556297585,"description":"测试下退款","failure_code":null,"failure_msg":null,"metadata":{},"charge":"ch_y1iXjLnDS4G4OO4uT4a5C4W1","charge_order_no":"20190427004410165545","transaction_no":"201904270053053608824","extra":{}}},"object":"event","request":"iar_Oa188KCiHC40iLibbHX5WrHC","pending_webhooks":0} - @Override - public CommonResult parseRefundSuccessParams(String params) { - JSONObject paramsObj = JSON.parseObject(params); - JSONObject chargeObj = paramsObj.getJSONObject("data").getJSONObject("object"); - ThirdPayRefundSuccessRespDTO successRespDTO = new ThirdPayRefundSuccessRespDTO() - .setRefundCode(chargeObj.getJSONObject("metadata").getString("refundCode")) - .setRefundTime(new Date(chargeObj.getLong("time_succeed") * 1000)) - .setTradeNo(chargeObj.getString("transaction_no")) - // TODO 芋艿,需要测试下,退款失败 - .setSuccess(chargeObj.containsValue("failure_code") || chargeObj.containsValue("failure_msg")); - return CommonResult.success(successRespDTO); - } - - private Map createRefundRequest(PayRefundDO refund, String chargeId, String orderDescription, Integer price) { - Map reqObj = new HashMap<>(); -// reqObj.put("CHARGE_ID", chargeId); - reqObj.put("description", orderDescription); - reqObj.put("amount", price); - Map metadata = new HashMap<>(); - metadata.put("refundCode", refund.getRefundCode()); - reqObj.put("metadata", metadata); - return reqObj; - } - - public static void main(String[] args) { - if (true) { // 测试支付请求 - PayTransactionDO transaction = new PayTransactionDO(); - transaction.setOrderSubject("测试商品"); - transaction.setOrderDescription("测试描述"); - transaction.setPrice(1); - - PayTransactionExtensionDO extension = new PayTransactionExtensionDO(); - extension.setTransactionCode(System.currentTimeMillis() + ""); - extension.setCreateIp("127.0.0.1"); - - new PingxxThirdPayClient().submitTransaction(transaction, extension, null); - } - if (false) { // 测试退款请求 - PayRefundDO refund = new PayRefundDO().setPrice(9999999).setOrderDescription("测试描述"); - PayTransactionExtensionDO transactionExtension = new PayTransactionExtensionDO() - .setExtensionData("{\"id\":\"evt_400190423100354205607502\",\"created\":1555985033,\"livemode\":false,\"type\":\"charge.succeeded\",\"data\":{\"object\":{\"id\":\"ch_DCGyXTmDGuHKb1C0yTzjPOGC\",\"object\":\"charge\",\"created\":1555985032,\"livemode\":false,\"paid\":true,\"refunded\":false,\"reversed\":false,\"app\":\"app_aTyfXDjrvzDSbLuz\",\"channel\":\"wx_pub\",\"order_no\":\"20190423100352158401\",\"client_ip\":\"114.87.158.59\",\"amount\":10,\"amount_settle\":10,\"currency\":\"cny\",\"subject\":\"kafka 实战\",\"body\":\"测试描述\",\"extra\":{\"open_id\":\"just_for_test\",\"bank_type\":\"your bank type\"},\"time_paid\":1555985033,\"time_expire\":1555992232,\"time_settle\":null,\"transaction_no\":\"1244341374201904238178164740\",\"refunds\":{\"object\":\"list\",\"url\":\"/v1/charges/ch_DCGyXTmDGuHKb1C0yTzjPOGC/refunds\",\"has_more\":false,\"data\":[]},\"amount_refunded\":0,\"failure_code\":null,\"failure_msg\":null,\"metadata\":{},\"credential\":{},\"description\":\"测试备注\"}},\"object\":\"event\",\"request\":\"iar_4e9mPODW5ujPqLen5OOmvL8S\",\"pending_webhooks\":0}"); - - new PingxxThirdPayClient().submitRefund(refund, transactionExtension, null); - } - } - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/client/thirdpay/ThirdPayClientFactory.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/client/thirdpay/ThirdPayClientFactory.java deleted file mode 100644 index c1998cb3c..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/client/thirdpay/ThirdPayClientFactory.java +++ /dev/null @@ -1,24 +0,0 @@ -package cn.iocoder.mall.payservice.client.thirdpay; - -import cn.iocoder.mall.payservice.enums.PayChannelEnum; - -import java.util.HashMap; -import java.util.Map; - -public class ThirdPayClientFactory { - - private static Map CLIENTS = new HashMap<>(); - - static { - CLIENTS.put(PayChannelEnum.PINGXX.getId(), new PingxxThirdPayClient()); - } - - public static AbstractThirdPayClient getThirdPayClient(Integer payChannel) { - AbstractThirdPayClient client = CLIENTS.get(payChannel); - if (client == null) { - throw new NullPointerException("找不到合适的 ThirdPayClient :" + payChannel); - } - return client; - } - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/client/thirdpay/dto/ThirdPayRefundSuccessRespDTO.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/client/thirdpay/dto/ThirdPayRefundSuccessRespDTO.java deleted file mode 100644 index b8fa38bfa..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/client/thirdpay/dto/ThirdPayRefundSuccessRespDTO.java +++ /dev/null @@ -1,34 +0,0 @@ -package cn.iocoder.mall.payservice.client.thirdpay.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.time.LocalDateTime; - -/** - * 三方平台的交易退款成功 Response DTO - */ -@Data -@Accessors(chain = true) -public class ThirdPayRefundSuccessRespDTO { - - /** - * 生成传输给第三方的订单号 - * - * 唯一索引 - */ - private String refundCode; - /** - * 第三方的流水号 - */ - private String tradeNo; - /** - * 第三方退款成功的时间 - */ - private LocalDateTime refundTime; - /** - * 是否成功 - */ - private Boolean success; - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/client/thirdpay/dto/ThirdPayTransactionSuccessRespDTO.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/client/thirdpay/dto/ThirdPayTransactionSuccessRespDTO.java deleted file mode 100644 index f2f7b22af..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/client/thirdpay/dto/ThirdPayTransactionSuccessRespDTO.java +++ /dev/null @@ -1,30 +0,0 @@ -package cn.iocoder.mall.payservice.client.thirdpay.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.time.LocalDateTime; - -/** - * 三方平台的交易支付成功 Response DTO - */ -@Data -@Accessors(chain = true) -public class ThirdPayTransactionSuccessRespDTO { - - /** - * 生成传输给第三方的订单号 - * - * 唯一索引 - */ - private String transactionCode; - /** - * 第三方的流水号 - */ - private String tradeNo; - /** - * 第三方支付成功的时间 - */ - private LocalDateTime paymentTime; - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/common/dubbo/DubboReferencePool.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/common/dubbo/DubboReferencePool.java deleted file mode 100644 index 19ea518fb..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/common/dubbo/DubboReferencePool.java +++ /dev/null @@ -1,83 +0,0 @@ -package cn.iocoder.mall.payservice.common.dubbo; - -import cn.iocoder.common.framework.util.StringUtils; -import com.google.common.cache.CacheBuilder; -import com.google.common.cache.CacheLoader; -import com.google.common.cache.LoadingCache; -import lombok.Data; -import org.apache.dubbo.config.ApplicationConfig; -import org.apache.dubbo.config.ReferenceConfig; -import org.apache.dubbo.config.RegistryConfig; -import org.apache.dubbo.rpc.service.GenericService; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; -import org.springframework.util.Assert; - -import java.util.List; - -@Component -public class DubboReferencePool { - - @Data - public class ReferenceMeta { - - private final ReferenceConfig config; // TODO 芋艿,后续需要做销毁 - private final GenericService service; - private final String methodName; - - private ReferenceMeta(ReferenceConfig config, GenericService service, String methodName) { - this.config = config; - this.service = service; - this.methodName = methodName; - } - - } - - private LoadingCache referenceMetaCache = CacheBuilder.newBuilder() - .build(new CacheLoader() { - @Override - public ReferenceMeta load(String notifyUrl) { - return createGenericService(notifyUrl); - } - }); - - @Value("${dubbo.registry.address}") - private String dubboRegistryAddress; - @Value("${dubbo.application.name}") - private String dubboApplicationName; - - public ReferenceMeta getReferenceMeta(String notifyUrl) { - DubboReferencePool.ReferenceMeta referenceMeta = referenceMetaCache.getUnchecked(notifyUrl); - Assert.notNull(referenceMeta, String.format("notifyUrl(%s) 不存在对应的 ReferenceMeta 对象", notifyUrl)); - return referenceMeta; - } - - private ReferenceMeta createGenericService(String notifyUrl) { - // 使用 # 号分隔,格式为 服务名#方法名#版本号 - List notifyUrlParts = this.parseNotifyUrl(notifyUrl); - // 创建 ApplicationConfig 对象 - ApplicationConfig application = new ApplicationConfig(); - application.setName(dubboApplicationName); - // 创建 RegistryConfig 对象 - RegistryConfig registry = new RegistryConfig(); -// registry.setAddress("zookeeper://127.0.0.1:2181"); - registry.setAddress(dubboRegistryAddress); - application.setRegistry(registry); - // 创建 ReferenceConfig 对象 - ReferenceConfig reference = new ReferenceConfig<>(); - reference.setInterface(notifyUrlParts.get(0)); // 弱类型接口名 - reference.setGeneric(true); // 声明为泛化接口 - reference.setApplication(application); - reference.setVersion(notifyUrlParts.size() > 2 ? notifyUrlParts.get(2) : "1.0.0"); // 如果未配置服务的版本号,则默认使用 1.0.0 - // 获得 GenericService 对象 - GenericService genericService = reference.get(); - // 构建最终的 ReferenceMeta 对象 - return new ReferenceMeta(reference, genericService, notifyUrlParts.get(1)); - } - - // TODO 芋艿,后续重构成一个对象 - private List parseNotifyUrl(String notifyUrl) { - return StringUtils.split(notifyUrl, "#"); - } - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/common/package-info.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/common/package-info.java deleted file mode 100644 index ed83cb4e9..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/common/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package cn.iocoder.mall.payservice.common; diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/config/AopConfiguration.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/config/AopConfiguration.java deleted file mode 100644 index 1781c61c9..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/config/AopConfiguration.java +++ /dev/null @@ -1,12 +0,0 @@ -package cn.iocoder.mall.payservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.EnableAspectJAutoProxy; - -/** - * Spring Aop 配置类 - */ -@Configuration(proxyBeanMethods = false) -@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true) -public class AopConfiguration { -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/config/DatabaseConfiguration.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/config/DatabaseConfiguration.java deleted file mode 100644 index 802b4836a..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/config/DatabaseConfiguration.java +++ /dev/null @@ -1,28 +0,0 @@ -package cn.iocoder.mall.payservice.config; - -import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector; -import com.baomidou.mybatisplus.core.injector.ISqlInjector; -import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; -import org.mybatis.spring.annotation.MapperScan; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.transaction.annotation.EnableTransactionManagement; - -@Configuration(proxyBeanMethods = false) -@MapperScan("cn.iocoder.mall.payservice.dal.mysql.mapper") // 扫描对应的 Mapper 接口 -@EnableTransactionManagement(proxyTargetClass = true) // 启动事务管理。 -public class DatabaseConfiguration { - - // 数据库连接池 Druid - - @Bean - public ISqlInjector sqlInjector() { - return new DefaultSqlInjector(); // MyBatis Plus 逻辑删除 - } - - @Bean - public PaginationInterceptor paginationInterceptor() { - return new PaginationInterceptor(); // MyBatis Plus 分页插件 - } - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/convert/app/PayAppConvert.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/convert/app/PayAppConvert.java deleted file mode 100644 index d6d44a098..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/convert/app/PayAppConvert.java +++ /dev/null @@ -1,16 +0,0 @@ -package cn.iocoder.mall.payservice.convert.app; - -import cn.iocoder.mall.payservice.dal.mysql.dataobject.app.PayAppDO; -import cn.iocoder.mall.payservice.rpc.app.dto.PayAppRespDTO; -import org.mapstruct.Mapper; -import org.mapstruct.factory.Mappers; - -@Mapper -public interface PayAppConvert { - - PayAppConvert INSTANCE = Mappers.getMapper(PayAppConvert.class); - - PayAppRespDTO convert(PayAppDO bean); - -} - diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/convert/notify/PayNotifyConvert.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/convert/notify/PayNotifyConvert.java deleted file mode 100644 index dca4e7db1..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/convert/notify/PayNotifyConvert.java +++ /dev/null @@ -1,30 +0,0 @@ -package cn.iocoder.mall.payservice.convert.notify; - -import cn.iocoder.mall.payservice.dal.mysql.dataobject.notify.PayNotifyTaskDO; -import cn.iocoder.mall.payservice.mq.producer.message.PayRefundSuccessMessage; -import cn.iocoder.mall.payservice.mq.producer.message.PayTransactionSuccessMessage; -import org.mapstruct.Mapper; -import org.mapstruct.Mapping; -import org.mapstruct.Mappings; -import org.mapstruct.factory.Mappers; - -@Mapper -public interface PayNotifyConvert { - - PayNotifyConvert INSTANCE = Mappers.getMapper(PayNotifyConvert.class); - - @Mappings({ - @Mapping(source = "transaction.transactionId", target = "transactionId"), - @Mapping(source = "transaction.orderId", target = "orderId"), - }) - PayTransactionSuccessMessage convertTransaction(PayNotifyTaskDO entity); - - @Mappings({ - @Mapping(source = "refund.transactionId", target = "transactionId"), - @Mapping(source = "refund.orderId", target = "orderId"), - @Mapping(source = "refund.refundId", target = "refundId"), - }) - PayRefundSuccessMessage convertRefund(PayNotifyTaskDO entity); - - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/convert/transaction/PayTransactionConvert.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/convert/transaction/PayTransactionConvert.java deleted file mode 100644 index 73493fe02..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/convert/transaction/PayTransactionConvert.java +++ /dev/null @@ -1,28 +0,0 @@ -package cn.iocoder.mall.payservice.convert.transaction; - -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.payservice.dal.mysql.dataobject.transaction.PayTransactionDO; -import cn.iocoder.mall.payservice.dal.mysql.dataobject.transaction.PayTransactionExtensionDO; -import cn.iocoder.mall.payservice.rpc.transaction.dto.PayTransactionCreateReqDTO; -import cn.iocoder.mall.payservice.rpc.transaction.dto.PayTransactionRespDTO; -import cn.iocoder.mall.payservice.rpc.transaction.dto.PayTransactionSubmitReqDTO; -import com.baomidou.mybatisplus.core.metadata.IPage; -import org.mapstruct.Mapper; -import org.mapstruct.Mapping; -import org.mapstruct.factory.Mappers; - -@Mapper -public interface PayTransactionConvert { - - PayTransactionConvert INSTANCE = Mappers.getMapper(PayTransactionConvert.class); - - PayTransactionDO convert(PayTransactionCreateReqDTO bean); - - PayTransactionExtensionDO convert(PayTransactionSubmitReqDTO bean); - - PayTransactionRespDTO convert(PayTransactionDO bean); - - @Mapping(source = "records", target = "list") - PageResult convertPage(IPage bean); - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/dataobject/app/PayAppDO.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/dataobject/app/PayAppDO.java deleted file mode 100644 index bf2c8bbd1..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/dataobject/app/PayAppDO.java +++ /dev/null @@ -1,43 +0,0 @@ -package cn.iocoder.mall.payservice.dal.mysql.dataobject.app; - -import cn.iocoder.mall.mybatis.core.dataobject.DeletableDO; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - * 支付应用 - * - * 每个接入的业务都是一个应用,进行个性化的配置 - */ -@TableName("pay_app") -@Data -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -public class PayAppDO extends DeletableDO { - - /** - * 应用编号 - */ - private String id; - /** - * 应用名 - */ - private String name; - /** - * 异步通知地址 - */ - private String payNotifyUrl; - /** - * 退款异步通知地址 - */ - private String refundNotifyUrl; - /** - * 状态 - * - * 枚举 {@link cn.iocoder.common.framework.enums.CommonStatusEnum} - */ - private Integer status; - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/dataobject/log/PayLogDO.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/dataobject/log/PayLogDO.java deleted file mode 100644 index 4b797f436..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/dataobject/log/PayLogDO.java +++ /dev/null @@ -1,29 +0,0 @@ -package cn.iocoder.mall.payservice.dal.mysql.dataobject.log; - -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 交易日志 DO - * - * 通过该日志,我们可以追溯整个执行过程 - * - * TODO 芋艿,后面在捉摸 - */ -@Data -@Accessors(chain = true) -public class PayLogDO { - - /** - * 编号,自增 - */ - private Integer id; - /** - * 应用编号 - */ - private String appId; - /** - * 业务线订单编号 - */ - private Integer orderId; -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/dataobject/notify/PayNotifyLogDO.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/dataobject/notify/PayNotifyLogDO.java deleted file mode 100644 index e9c58b8a3..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/dataobject/notify/PayNotifyLogDO.java +++ /dev/null @@ -1,44 +0,0 @@ -package cn.iocoder.mall.payservice.dal.mysql.dataobject.notify; - -import cn.iocoder.mall.mybatis.core.dataobject.DeletableDO; -import cn.iocoder.mall.payservice.enums.notify.PayNotifyStatusEnum; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - * 支付通知 App 的日志 DO - * - * 通过该表,记录通知 App 时,产生的日志 - */ -@TableName("pay_notify_log") -@Data -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -public class PayNotifyLogDO extends DeletableDO { - - /** - * 日志编号,自增 - */ - private Integer id; - /** - * 通知编号 - */ - private Integer notifyId; - /** - * 请求参数 - */ - private String request; - /** - * 响应结果 - */ - private String response; - /** - * 状态 - * - * 外键 {@link PayNotifyStatusEnum} - */ - private Integer status; - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/dataobject/notify/PayNotifyTaskDO.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/dataobject/notify/PayNotifyTaskDO.java deleted file mode 100644 index 5169dc551..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/dataobject/notify/PayNotifyTaskDO.java +++ /dev/null @@ -1,140 +0,0 @@ -package cn.iocoder.mall.payservice.dal.mysql.dataobject.notify; - -import cn.iocoder.mall.mybatis.core.dataobject.DeletableDO; -import cn.iocoder.mall.payservice.dal.mysql.dataobject.transaction.PayTransactionDO; -import cn.iocoder.mall.payservice.dal.mysql.dataobject.transaction.PayTransactionExtensionDO; -import cn.iocoder.mall.payservice.enums.notify.PayNotifyStatusEnum; -import cn.iocoder.mall.payservice.enums.notify.PayNotifyType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.time.LocalDateTime; - -/** - * 支付通知 App 的任务 DO - * - * 目前包括支付通知、退款通知。 - */ -@TableName("pay_notify_task") -@Data -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -public class PayNotifyTaskDO extends DeletableDO { - - /** - * 通知频率,单位为秒。 - * - * 算上首次的通知,实际是一共 1 + 8 = 9 次。 - */ - public static final Integer[] NOTIFY_FREQUENCY = new Integer[]{ - 15, 15, 30, 180, - 1800, 1800, 1800, 3600 - }; - - /** - * 编号,自增 - */ - private Integer id; - /** - * 应用编号 - */ - private String appId; - /** - * 类型 - * - * 外键 {@link PayNotifyType} - */ - private Integer type; - /** - * 通知状态 - * - * 外键 {@link PayNotifyStatusEnum} - */ - private Integer status; - /** - * 是否激活中,即处于正在 MQ 异步通知中 - * - * @see cn.iocoder.mall.payservice.job.notify.PayNotifyRetryJob - */ - private Boolean active; - /** - * 下一次通知时间 - */ - private LocalDateTime nextNotifyTime; - /** - * 最后一次执行时间 - */ - private LocalDateTime lastExecuteTime; - /** - * 当前通知次数 - */ - private Integer notifyTimes; - /** - * 最大可通知次数 - */ - private Integer maxNotifyTimes; - /** - * 通知地址 - */ - private String notifyUrl; - // TODO 芋艿,未来把 transaction 和 refund 优化成一个字段。现在为了方便。 - /** - * 支付数据 - */ - @TableField(typeHandler = FastjsonTypeHandler.class) - private Transaction transaction; - /** - * 退款数据 - */ - @TableField(typeHandler = FastjsonTypeHandler.class) - private Refund refund; - - @Data - @Accessors(chain = true) - public static class Transaction { - - /** - * 应用订单编号 - */ - private String orderId; - /** - * 交易编号 - * - * {@link PayTransactionDO#getId()} - */ - private Integer transactionId; - /** - * 交易拓展编号 - * - * {@link PayTransactionExtensionDO#getId()} - */ - private Integer transactionExtensionId; - - } - - @Data - @Accessors(chain = true) - public static class Refund { - - /** - * 应用订单编号 - */ - private String orderId; - /** - * 交易编号 - * - * {@link PayTransactionDO#getId()} - */ - private Integer transactionId; - /** - * 退款单编号 - */ - private Integer refundId; - - } - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/dataobject/refund/PayRefundDO.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/dataobject/refund/PayRefundDO.java deleted file mode 100644 index b99337a99..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/dataobject/refund/PayRefundDO.java +++ /dev/null @@ -1,108 +0,0 @@ -package cn.iocoder.mall.payservice.dal.mysql.dataobject.refund; - -import cn.iocoder.mall.mybatis.core.dataobject.DeletableDO; -import cn.iocoder.mall.payservice.enums.refund.PayRefundStatus; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.time.LocalDateTime; - -/** - * 退款单 DO - */ -@TableName("pay_refund") -@Data -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -public class PayRefundDO extends DeletableDO { - - /** - * 编号,自增 - */ - private Integer id; - /** - * 用户编号 - */ - private Integer userId; - /** - * 支付交易编号 - */ - private Integer transactionId; - /** - * 生成传输给第三方的退款号 - * - * 唯一索引 - */ - private String refundCode; - /** - * 应用编号 - * - * 不同业务线分配不同的 appId - * 举个例子, - * 1. 电商系统的订单,appId = 1024 - * 2. 活动系统的订单,appId = 2048 - */ - private String appId; - /** - * 业务线的订单编号 - * - * 1. 使用 String 的原因是,业务线可能使用 String 做为编号 - * 2. 每个 appId 下,orderId 唯一 - */ - private String orderId; - /** - * 发起交易的 IP - */ - private String createIp; - /** - * 业务退款描述 - */ - private String orderDescription; - /** - * 退款金额,单位:分。 - * - * TODO 暂时不考虑货币类型。 - */ - private Integer price; - /** - * 退款状态 - * - * 外键 {@link PayRefundStatus} - */ - private Integer status; - /** - * 回调业务线完成时间 - */ - private LocalDateTime finishTime; - /** - * 异步通知地址 - */ - private String notifyUrl; - /** - * 扩展内容 - * - * 异步通知的时候填充回调的数据 - */ - private String extensionData; - /** - * 退款渠道 - */ - private Integer refundChannel; - /** - * 第三方退款成功的时间 - */ - private LocalDateTime refundTime; - /** - * 收到第三方系统通知的时间 - * - * 一般情况下,即第三方系统的异步通知 - */ - private LocalDateTime notifyTime; - /** - * 第三方的流水号 - */ - private String tradeNo; - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/dataobject/transaction/PayRepeatTransactionDO.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/dataobject/transaction/PayRepeatTransactionDO.java deleted file mode 100644 index 813e680b8..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/dataobject/transaction/PayRepeatTransactionDO.java +++ /dev/null @@ -1,15 +0,0 @@ -package cn.iocoder.mall.payservice.dal.mysql.dataobject.transaction; - -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * TODO 重复支付的交易 - * - * 可能不靠这个表,而是差错处理。 - */ -@Data -@Accessors(chain = true) -@Deprecated -public class PayRepeatTransactionDO { -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/dataobject/transaction/PayTransactionDO.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/dataobject/transaction/PayTransactionDO.java deleted file mode 100644 index cf05e7e6c..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/dataobject/transaction/PayTransactionDO.java +++ /dev/null @@ -1,103 +0,0 @@ -package cn.iocoder.mall.payservice.dal.mysql.dataobject.transaction; - -import cn.iocoder.mall.mybatis.core.dataobject.DeletableDO; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.time.LocalDateTime; - -/** -* 支付交易表 -*/ -@TableName("pay_transaction") -@Data -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -public class PayTransactionDO extends DeletableDO { - - /** - * 编号,自增 - */ - @TableId - private Integer id; - /** - * 用户编号 - */ - private Integer userId; - /** - * 应用编号 - */ - private String appId; - /** - * 发起交易的 IP - */ - private String createIp; - /** - * 业务线的订单编号 - */ - private String orderId; - /** - * 订单商品名 - */ - private String orderSubject; - /** - * 订单商品描述 - */ - private String orderDescription; - /** - * 订单备注 - */ - private String orderMemo; - /** - * 支付金额,单位:分。 - */ - private Integer price; - /** - * 订单状态 - */ - private Integer status; - /** - * 交易过期时间 - */ - private LocalDateTime expireTime; - /** - * 回调业务线完成时间 - */ - private LocalDateTime finishTime; - /** - * 异步通知地址 - */ - private String notifyUrl; - /** - * 成功支付的交易拓展编号 - */ - private Integer extensionId; - /** - * 支付成功的支付渠道 - */ - private Integer payChannel; - - /** - * 第三方支付成功的时间 - */ - private LocalDateTime paymentTime; - /** - * 收到第三方系统通知的时间 - */ - private LocalDateTime notifyTime; - /** - * 第三方的流水号 - */ - private String tradeNo; - - // ========== 退款相关 ========== - - /** - * 退款总金额 - */ - private Integer refundTotal; - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/dataobject/transaction/PayTransactionExtensionDO.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/dataobject/transaction/PayTransactionExtensionDO.java deleted file mode 100644 index d63b43f61..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/dataobject/transaction/PayTransactionExtensionDO.java +++ /dev/null @@ -1,54 +0,0 @@ -package cn.iocoder.mall.payservice.dal.mysql.dataobject.transaction; - -import cn.iocoder.mall.mybatis.core.dataobject.DeletableDO; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - * 交易扩展表 - */ -@TableName("pay_transaction_extension") -@Data -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -public class PayTransactionExtensionDO extends DeletableDO { - - /** - * 编号,自增 - */ - private Integer id; - /** - * 交易编号 {@link PayTransactionDO#getId()} - */ - private Integer transactionId; - /** - * 选择的支付渠道 - */ - private Integer payChannel; - /** - * 生成传输给第三方的订单号 - * - * 唯一索引 - */ - private String transactionCode; - /** - * 扩展内容 - * - * 异步通知的时候填充回调的数据 - */ - private String extensionData; - /** - * 发起交易的 IP - */ - private String createIp; - /** - * 状态 - * - * @see cn.iocoder.mall.payservice.enums.transaction.PayTransactionStatusEnum - * 注意,只包含上述枚举的 WAITING 和 SUCCESS - */ - private Integer status; - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/mapper/app/PayAppMapper.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/mapper/app/PayAppMapper.java deleted file mode 100644 index 0717898ea..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/mapper/app/PayAppMapper.java +++ /dev/null @@ -1,9 +0,0 @@ -package cn.iocoder.mall.payservice.dal.mysql.mapper.app; - -import cn.iocoder.mall.payservice.dal.mysql.dataobject.app.PayAppDO; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.springframework.stereotype.Repository; - -@Repository -public interface PayAppMapper extends BaseMapper { -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/mapper/notify/PayNotifyLogMapper.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/mapper/notify/PayNotifyLogMapper.java deleted file mode 100644 index c7f5c1b80..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/mapper/notify/PayNotifyLogMapper.java +++ /dev/null @@ -1,10 +0,0 @@ -package cn.iocoder.mall.payservice.dal.mysql.mapper.notify; - -import cn.iocoder.mall.payservice.dal.mysql.dataobject.notify.PayNotifyLogDO; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.springframework.stereotype.Repository; - -@Repository -public interface PayNotifyLogMapper extends BaseMapper { - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/mapper/notify/PayNotifyTaskMapper.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/mapper/notify/PayNotifyTaskMapper.java deleted file mode 100644 index 5ab193beb..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/mapper/notify/PayNotifyTaskMapper.java +++ /dev/null @@ -1,46 +0,0 @@ -package cn.iocoder.mall.payservice.dal.mysql.mapper.notify; - -import cn.iocoder.mall.payservice.dal.mysql.dataobject.notify.PayNotifyTaskDO; -import cn.iocoder.mall.payservice.enums.notify.PayNotifyStatusEnum; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.springframework.stereotype.Repository; - -import java.util.List; - -@Repository -public interface PayNotifyTaskMapper extends BaseMapper { - - /** - * 获得需要通知的 PayTransactionNotifyTaskDO 记录。需要满足如下条件: - * - * 1. status 非成功 - * 2. nextNotifyTime 小于当前时间 - * 3. active 为 false 并未正在执行中 - * - * @return PayTransactionNotifyTaskDO 数组 - */ - default List selectListByNotify() { - return selectList(new QueryWrapper() - .in("status", PayNotifyStatusEnum.WAITING.getStatus(), PayNotifyStatusEnum.REQUEST_SUCCESS.getStatus(), - PayNotifyStatusEnum.REQUEST_FAILURE.getStatus()) - .le("next_notify_time", "NOW()") - .eq("active", Boolean.FALSE)); - } - - default int update(PayNotifyTaskDO update, Integer whereNotifyTimes) { - return update(update, new QueryWrapper() - .eq("id", update.getId()).eq("notify_times", whereNotifyTimes)); - } - -// -// - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/mapper/refund/PayRefundMapper.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/mapper/refund/PayRefundMapper.java deleted file mode 100644 index c59436511..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/mapper/refund/PayRefundMapper.java +++ /dev/null @@ -1,57 +0,0 @@ -package cn.iocoder.mall.payservice.dal.mysql.mapper.refund; - -import cn.iocoder.mall.payservice.dal.mysql.dataobject.refund.PayRefundDO; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.springframework.stereotype.Repository; - -@Repository -public interface PayRefundMapper extends BaseMapper { - - default int update(PayRefundDO entity, Integer whereStatus) { - return update(entity, new QueryWrapper() - .eq("id", entity.getId()).eq("status", whereStatus)); - } - - default PayRefundDO selectByRefundCode(String refundCode) { - return selectOne(new QueryWrapper() - .eq("refund_code", refundCode)); - } - - -// -// AND create_time >= #{createBeginTime} -// -// -// AND #{createEndTime} >= create_time -// -// -// AND finish_time >= #{finishBeginTime} -// -// -// AND #{finishEndTime} >= finish_time -// -// -// AND status = #{status} -// -// -// AND pay_channel = #{payChannel} -// - -// List selectListByPage(@Param("createBeginTime") LocalDateTime createBeginTime, -// @Param("createEndTime") LocalDateTime createEndTime, -// @Param("finishBeginTime") LocalDateTime finishBeginTime, -// @Param("finishEndTime") LocalDateTime finishEndTime, -// @Param("status") Integer status, -// @Param("payChannel") Integer payChannel, -// @Param("offset") Integer offset, -// @Param("limit") Integer limit); -// -// Integer selectCountByPage(@Param("createBeginTime") LocalDateTime createBeginTime, -// @Param("createEndTime") LocalDateTime createEndTime, -// @Param("finishBeginTime") LocalDateTime finishBeginTime, -// @Param("finishEndTime") LocalDateTime finishEndTime, -// @Param("status") Integer status, -// @Param("payChannel") Integer payChannel); - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/mapper/transaction/PayTransactionExtensionMapper.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/mapper/transaction/PayTransactionExtensionMapper.java deleted file mode 100644 index 036720177..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/mapper/transaction/PayTransactionExtensionMapper.java +++ /dev/null @@ -1,21 +0,0 @@ -package cn.iocoder.mall.payservice.dal.mysql.mapper.transaction; - -import cn.iocoder.mall.payservice.dal.mysql.dataobject.transaction.PayTransactionExtensionDO; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.springframework.stereotype.Repository; - -@Repository -public interface PayTransactionExtensionMapper extends BaseMapper { - - default int update(PayTransactionExtensionDO entity, Integer whereStatus) { - return update(entity, new QueryWrapper() - .eq("id", entity.getId()).eq("status", whereStatus)); - } - - default PayTransactionExtensionDO selectByTransactionCode(String transactionCode) { - return selectOne(new QueryWrapper() - .eq("transaction_code", transactionCode)); - } - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/mapper/transaction/PayTransactionMapper.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/mapper/transaction/PayTransactionMapper.java deleted file mode 100644 index 51e49cc65..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/dal/mysql/mapper/transaction/PayTransactionMapper.java +++ /dev/null @@ -1,47 +0,0 @@ -package cn.iocoder.mall.payservice.dal.mysql.mapper.transaction; - -import cn.iocoder.mall.mybatis.core.query.QueryWrapperX; -import cn.iocoder.mall.mybatis.core.util.PageUtil; -import cn.iocoder.mall.payservice.dal.mysql.dataobject.transaction.PayTransactionDO; -import cn.iocoder.mall.payservice.rpc.transaction.dto.PayTransactionPageReqDTO; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -@Repository -public interface PayTransactionMapper extends BaseMapper { - - - - default IPage selectPage(PayTransactionPageReqDTO pageReqDTO) { - QueryWrapperX query = new QueryWrapperX() - .betweenIfPresent("create_time", pageReqDTO.getCreateBeginTime(), pageReqDTO.getPaymentEndTime()) - .betweenIfPresent("payment_time", pageReqDTO.getPaymentBeginTime(), pageReqDTO.getPaymentEndTime()) - .eqIfPresent("status", pageReqDTO.getStatus()) - .eqIfPresent("payChannel", pageReqDTO.getPayChannel()) - .likeIfPresent("order_subject", pageReqDTO.getOrderSubject()); - if (pageReqDTO.getHasRefund() != null) { - if (pageReqDTO.getHasRefund()) { - query.gt("refund_total", 0); - } else { - query.eq("refund_total", 0); - } - } - return selectPage(PageUtil.build(pageReqDTO), query); - } - - default int update(PayTransactionDO entity, Integer whereStatus) { - return update(entity, new QueryWrapper() - .eq("id", entity.getId()).eq("status", whereStatus)); - } - - default PayTransactionDO selectByAppIdAndOrderId(String appId, String orderId) { - return selectOne(new QueryWrapper().eq("app_id", appId) - .eq("order_id", orderId)); - } - - int updatePriceTotalIncr(@Param("id") Integer id, @Param("refundTotalIncr") Integer refundTotalIncr); - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/job/notify/PayNotifyRetryJob.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/job/notify/PayNotifyRetryJob.java deleted file mode 100644 index b792c9e06..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/job/notify/PayNotifyRetryJob.java +++ /dev/null @@ -1,51 +0,0 @@ -package cn.iocoder.mall.payservice.job.notify; - -import cn.iocoder.mall.payservice.dal.mysql.dataobject.notify.PayNotifyTaskDO; -import cn.iocoder.mall.payservice.dal.mysql.mapper.notify.PayNotifyTaskMapper; -import cn.iocoder.mall.payservice.service.notify.PayNotifyService; -import com.xxl.job.core.biz.model.ReturnT; -import com.xxl.job.core.handler.IJobHandler; -import com.xxl.job.core.handler.annotation.XxlJob; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * 支付通知重试 Job - * - * 由于 RocketMQ 不支持指定时间的延迟消息,所以我们需要通过 Job 扫描到达 {@link PayNotifyTaskDO#getNextNotifyTime()} 时间的任务。 - * 扫描到后,通过发送 MQ 去异步通知,提高通知效率。 - * - * 考虑到 MQ 执行可能存在延迟的情况,导致一个 {@link PayNotifyTaskDO} 同时触发多个通知,通过 {@link PayNotifyTaskDO#getActive()} 标记解决。 - */ -@Component -@Slf4j -public class PayNotifyRetryJob extends IJobHandler { - - @Autowired - private PayNotifyTaskMapper payNotifyTaskMapper; - - @Autowired - private PayNotifyService payNotifyService; - - @Override - @XxlJob("payNotifyRetryJob") - public ReturnT execute(String param) { - // 获得需要通知的任务 - List notifyTasks = payNotifyTaskMapper.selectListByNotify(); - - // 循环任务,发送通知 - for (PayNotifyTaskDO notifyTask : notifyTasks) { - // 发送 MQ - payNotifyService.sendNotifyMessage(notifyTask); - - // 标记任务执行中。考虑到 MQ 可能会存在先于该操作执行完,所以更新时,增加一个 notifyTimes 作为额外条件,避免覆盖更新的问题。 - PayNotifyTaskDO updateNotifyTask = new PayNotifyTaskDO().setId(notifyTask.getId()).setActive(true); - payNotifyTaskMapper.update(updateNotifyTask, notifyTask.getNotifyTimes()); - } - return new ReturnT<>("执行通知数:" + notifyTasks.size()); - } - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/job/package-info.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/job/package-info.java deleted file mode 100644 index 29479eb7a..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/job/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package cn.iocoder.mall.payservice.job; diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/mq/consumer/AbstractPayNotifySuccessMQConsumer.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/mq/consumer/AbstractPayNotifySuccessMQConsumer.java deleted file mode 100644 index 0aafb0151..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/mq/consumer/AbstractPayNotifySuccessMQConsumer.java +++ /dev/null @@ -1,107 +0,0 @@ -package cn.iocoder.mall.payservice.mq.consumer; - -import cn.iocoder.common.framework.util.DateUtil; -import cn.iocoder.common.framework.util.ExceptionUtil; -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.payservice.common.dubbo.DubboReferencePool; -import cn.iocoder.mall.payservice.dal.mysql.dataobject.notify.PayNotifyLogDO; -import cn.iocoder.mall.payservice.dal.mysql.dataobject.notify.PayNotifyTaskDO; -import cn.iocoder.mall.payservice.dal.mysql.mapper.notify.PayNotifyLogMapper; -import cn.iocoder.mall.payservice.dal.mysql.mapper.notify.PayNotifyTaskMapper; -import cn.iocoder.mall.payservice.enums.notify.PayNotifyStatusEnum; -import cn.iocoder.mall.payservice.mq.producer.message.AbstractPayNotifySuccessMessage; -import com.alibaba.fastjson.JSON; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; - -import java.util.Calendar; -import java.time.LocalDateTime; -import java.util.Map; - -public abstract class AbstractPayNotifySuccessMQConsumer { -// implements RocketMQListener TODO 芋艿,理论来说,可以实现 RocketMQListener 接口,然后 execute 作为 onMessage 的具体实现。但是新版本貌似不行,后续在排查下; - - @Autowired - private DubboReferencePool dubboReferencePool; - - @Autowired - private PayNotifyTaskMapper payNotifyTaskMapper; - @Autowired - private PayNotifyLogMapper payTransactionNotifyLogMapper; - - @Transactional - public void execute(T message) { - // 发起调用 - CommonResult invokeResult = null; // RPC / HTTP 调用的响应 - Throwable invokeException = null; // - PayNotifyTaskDO updateTask = new PayNotifyTaskDO() // 更新 PayTransactionNotifyTaskDO 对象 - .setId(message.getId()) - .setActive(false) // 标记本地通知已经完成 - .setLastExecuteTime(new Date()) - .setNotifyTimes(message.getNotifyTimes() + 1); - try { - // 获得 ReferenceMeta 对象 - DubboReferencePool.ReferenceMeta referenceMeta = dubboReferencePool.getReferenceMeta(message.getNotifyUrl()); - // TODO 芋艿,这里要优化下,不要在事务里,进行 RPC 调用 - invokeResult = invoke(message, referenceMeta); - if (invokeResult.isSuccess()) { // 情况一,请求成功且返回成功 - // 更新通知成功 - updateTask.setStatus(PayNotifyStatusEnum.SUCCESS.getStatus()); - payNotifyTaskMapper.updateById(updateTask); - // 需要更新支付交易单通知应用成功 - afterInvokeSuccess(message); - } else { // 情况二,请求成功且返回失败 - // 更新通知请求成功,但是结果失败 - handleFailure(updateTask, PayNotifyStatusEnum.REQUEST_SUCCESS.getStatus()); - payNotifyTaskMapper.updateById(updateTask); - } - } catch (Throwable e) { // 请求失败 - invokeException = e; - // 更新通知请求失败 - handleFailure(updateTask, PayNotifyStatusEnum.REQUEST_FAILURE.getStatus()); - payNotifyTaskMapper.updateById(updateTask); - // 抛出异常,回滚事务 - // TODO 芋艿,此处不能抛出异常。因为,会导致 MQ + 定时任务多重试。此处的目标是,事务回滚 + 吃掉事务。另外,最后的 finally 的日志,要插入成功。 -// throw e; - } finally { - // 插入 PayTransactionNotifyLogDO 日志 - PayNotifyLogDO notifyLog = new PayNotifyLogDO().setNotifyId(message.getId()) - .setStatus(updateTask.getStatus()) - .setRequest(JSON.toJSONString(message)) - .setResponse(invokeResult != null ? JSON.toJSONString(invokeResult) : ExceptionUtil.getRootCauseMessage(invokeException)); - payTransactionNotifyLogMapper.insert(notifyLog); - } - } - - private void handleFailure(PayNotifyTaskDO updateTask, Integer defaultStatus) { - if (updateTask.getNotifyTimes() >= PayNotifyTaskDO.NOTIFY_FREQUENCY.length) { - updateTask.setStatus(PayNotifyStatusEnum.FAILURE.getStatus()); - } else { - updateTask.setNextNotifyTime(DateUtil.addDate(Calendar.SECOND, PayNotifyTaskDO.NOTIFY_FREQUENCY[updateTask.getNotifyTimes()])); - updateTask.setStatus(defaultStatus); - } - } - - protected abstract CommonResult invoke(T message, DubboReferencePool.ReferenceMeta referenceMeta); - - protected abstract void afterInvokeSuccess(T message); - - /** - * 将 Dubbo 泛化调用的结果,解析成 CommonResult - * - * 目前,约定 Dubbo 返回的结果为 CommonResult - * - * @param dubboResult Dubbo 调用结果 - * @return CommonResult 结果 - */ - protected static CommonResult parseDubboGenericResult(Object dubboResult) { - // TODO 芋艿,目前暂时这么实现,未来找下更合适的 - Map dubboResultMap = (Map) dubboResult; - CommonResult commonResult = new CommonResult<>(); - commonResult.setCode((Integer) dubboResultMap.get("code")); - commonResult.setMessage((String) dubboResultMap.get("message")); - commonResult.setData((Boolean) dubboResultMap.get("data")); - return commonResult; - } - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/mq/consumer/PayRefundSuccessMQConsumer.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/mq/consumer/PayRefundSuccessMQConsumer.java deleted file mode 100644 index 0e7859083..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/mq/consumer/PayRefundSuccessMQConsumer.java +++ /dev/null @@ -1,53 +0,0 @@ -package cn.iocoder.mall.payservice.mq.consumer; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.payservice.common.dubbo.DubboReferencePool; -import cn.iocoder.mall.payservice.dal.mysql.dataobject.refund.PayRefundDO; -import cn.iocoder.mall.payservice.dal.mysql.mapper.refund.PayRefundMapper; -import cn.iocoder.mall.payservice.mq.producer.message.PayRefundSuccessMessage; -import org.apache.dubbo.rpc.service.GenericService; -import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; -import org.apache.rocketmq.spring.core.RocketMQListener; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.Assert; - -import java.time.LocalDateTime; - -@Service -@RocketMQMessageListener( - topic = PayRefundSuccessMessage.TOPIC, - consumerGroup = "pay-consumer-group-" + PayRefundSuccessMessage.TOPIC -) -public class PayRefundSuccessMQConsumer extends AbstractPayNotifySuccessMQConsumer - implements RocketMQListener { - - @Autowired - private PayRefundMapper payRefundMapper; - - @Override - public void onMessage(PayRefundSuccessMessage message) { - super.execute(message); - } - - @Override - protected CommonResult invoke(PayRefundSuccessMessage message, DubboReferencePool.ReferenceMeta referenceMeta) { - // 查询支付交易 - PayRefundDO refund = payRefundMapper.selectById(message.getRefundId()); - Assert.notNull(refund, String.format("回调消息(%s) 退款单不能为空", message.toString())); - // 执行调用 - GenericService genericService = referenceMeta.getService(); - String methodName = referenceMeta.getMethodName(); - Object dubboResult = genericService.$invoke(methodName, - new String[]{String.class.getName(), Integer.class.getName()}, - new Object[]{message.getOrderId(), refund.getPrice()}); - return parseDubboGenericResult(dubboResult); - } - - @Override - protected void afterInvokeSuccess(PayRefundSuccessMessage message) { - PayRefundDO updateRefund = new PayRefundDO().setId(message.getRefundId()).setFinishTime(new Date()); - payRefundMapper.updateById(updateRefund); - } - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/mq/consumer/PayTransactionSuccessMQConsumer.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/mq/consumer/PayTransactionSuccessMQConsumer.java deleted file mode 100644 index 2ca197a25..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/mq/consumer/PayTransactionSuccessMQConsumer.java +++ /dev/null @@ -1,53 +0,0 @@ -package cn.iocoder.mall.payservice.mq.consumer; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.payservice.common.dubbo.DubboReferencePool; -import cn.iocoder.mall.payservice.dal.mysql.dataobject.transaction.PayTransactionDO; -import cn.iocoder.mall.payservice.dal.mysql.mapper.transaction.PayTransactionMapper; -import cn.iocoder.mall.payservice.mq.producer.message.PayTransactionSuccessMessage; -import org.apache.dubbo.rpc.service.GenericService; -import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; -import org.apache.rocketmq.spring.core.RocketMQListener; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.Assert; - -import java.time.LocalDateTime; - -@Service -@RocketMQMessageListener( - topic = PayTransactionSuccessMessage.TOPIC, - consumerGroup = "pay-consumer-group-" + PayTransactionSuccessMessage.TOPIC -) -public class PayTransactionSuccessMQConsumer extends AbstractPayNotifySuccessMQConsumer - implements RocketMQListener { - - @Autowired - private PayTransactionMapper payTransactionMapper; - - @Override - public void onMessage(PayTransactionSuccessMessage message) { - super.execute(message); - } - - @Override - protected CommonResult invoke(PayTransactionSuccessMessage message, DubboReferencePool.ReferenceMeta referenceMeta) { - // 查询支付交易 - PayTransactionDO transaction = payTransactionMapper.selectById(message.getTransactionId()); - Assert.notNull(transaction, String.format("回调消息(%s) 订单交易不能为空", message.toString())); - // 执行调用 - GenericService genericService = referenceMeta.getService(); - String methodName = referenceMeta.getMethodName(); - Object dubboResult = genericService.$invoke(methodName, - new String[]{String.class.getName(), Integer.class.getName()}, - new Object[]{message.getOrderId(), transaction.getPrice()}); - return parseDubboGenericResult(dubboResult); - } - - @Override - protected void afterInvokeSuccess(PayTransactionSuccessMessage message) { - PayTransactionDO updateTransaction = new PayTransactionDO().setId(message.getTransactionId()).setFinishTime(new Date()); - payTransactionMapper.updateById(updateTransaction); - } - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/mq/producer/PayMQProducer.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/mq/producer/PayMQProducer.java deleted file mode 100644 index da4153c51..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/mq/producer/PayMQProducer.java +++ /dev/null @@ -1,43 +0,0 @@ -package cn.iocoder.mall.payservice.mq.producer; - -import cn.iocoder.mall.payservice.mq.producer.message.PayRefundSuccessMessage; -import cn.iocoder.mall.payservice.mq.producer.message.PayTransactionSuccessMessage; -import lombok.extern.slf4j.Slf4j; -import org.apache.rocketmq.client.producer.SendResult; -import org.apache.rocketmq.client.producer.SendStatus; -import org.apache.rocketmq.spring.core.RocketMQTemplate; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Component -@Slf4j -// TODO 芋艿:后续优化下,考虑下一致性 -public class PayMQProducer { - - @Autowired - private RocketMQTemplate template; - - public void sendPayRefundNotifyTaskMessage(PayRefundSuccessMessage message) { - try { - SendResult sendResult = template.syncSend(PayTransactionSuccessMessage.TOPIC, message); - if (!SendStatus.SEND_OK.equals(sendResult.getSendStatus())) { - log.error("[sendPayRefundNotifyTaskMessage][消息({}) 发送更新消息失败,结果为({})]", message, sendResult); - } - } catch (Throwable throwable) { - log.error("[sendPayRefundNotifyTaskMessage][消息({}) 发送更新消息失败,发生异常]", message, throwable); - } - } - - public void sendPayTransactionNotifyTaskMessage(PayTransactionSuccessMessage message) { - try { - SendResult sendResult = template.syncSend(PayTransactionSuccessMessage.TOPIC, message); - if (!SendStatus.SEND_OK.equals(sendResult.getSendStatus())) { - log.error("[sendPayTransactionNotifyTaskMessage][消息({}) 发送更新消息失败,结果为({})]", message, sendResult); - } - } catch (Throwable throwable) { - log.error("[sendPayTransactionNotifyTaskMessage][消息({}) 发送更新消息失败,发生异常]", message, throwable); - } - } - - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/mq/producer/message/AbstractPayNotifySuccessMessage.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/mq/producer/message/AbstractPayNotifySuccessMessage.java deleted file mode 100644 index c821baf89..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/mq/producer/message/AbstractPayNotifySuccessMessage.java +++ /dev/null @@ -1,26 +0,0 @@ -package cn.iocoder.mall.payservice.mq.producer.message; -import lombok.Data; -import lombok.experimental.Accessors; - -@Data -@Accessors(chain = true) -public class AbstractPayNotifySuccessMessage { - - /** - * 任务编号 - */ - private Integer id; - /** - * 应用编号 - */ - private String appId; - /** - * 当前通知次数 - */ - private Integer notifyTimes; - /** - * 通知地址 - */ - private String notifyUrl; - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/mq/producer/message/PayRefundSuccessMessage.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/mq/producer/message/PayRefundSuccessMessage.java deleted file mode 100644 index 6a878b0d3..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/mq/producer/message/PayRefundSuccessMessage.java +++ /dev/null @@ -1,30 +0,0 @@ -package cn.iocoder.mall.payservice.mq.producer.message; - -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - * 支付退款成功的消息对象 - */ -@Data -@Accessors(chain = true) -@EqualsAndHashCode(callSuper = true) -public class PayRefundSuccessMessage extends AbstractPayNotifySuccessMessage { - - public static final String TOPIC = "PAY_REFUND_SUCCESS"; - - /** - * 退款单编号 - */ - private Integer refundId; - /** - * 交易编号 - */ - private Integer transactionId; - /** - * 应用订单编号 - */ - private String orderId; - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/mq/producer/message/PayTransactionSuccessMessage.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/mq/producer/message/PayTransactionSuccessMessage.java deleted file mode 100644 index 98213493c..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/mq/producer/message/PayTransactionSuccessMessage.java +++ /dev/null @@ -1,26 +0,0 @@ -package cn.iocoder.mall.payservice.mq.producer.message; - -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - * 支付交易单支付成功的消息对象 - */ -@Data -@Accessors(chain = true) -@EqualsAndHashCode(callSuper = true) -public class PayTransactionSuccessMessage extends AbstractPayNotifySuccessMessage { - - public static final String TOPIC = "PAY_TRANSACTION_SUCCESS"; - - /** - * 交易编号 - */ - private Integer transactionId; - /** - * 应用订单编号 - */ - private String orderId; - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/service/app/PayAppService.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/service/app/PayAppService.java deleted file mode 100644 index eb0e8c1b6..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/service/app/PayAppService.java +++ /dev/null @@ -1,20 +0,0 @@ -package cn.iocoder.mall.payservice.service.app; - -import cn.iocoder.mall.payservice.rpc.app.dto.PayAppRespDTO; - -/** - * 支付应用 Service 接口 - */ -public interface PayAppService { - - /** - * 交易支付应用的合法性 - * - * 如果不合法,抛出 {@link cn.iocoder.common.framework.exception.ServiceException} 业务异常 - * - * @param payAppId 应用编号 - * @return 应用信息 - */ - PayAppRespDTO validPayApp(String payAppId); - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/service/app/impl/PayAppServiceImpl.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/service/app/impl/PayAppServiceImpl.java deleted file mode 100644 index 6f57cf598..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/service/app/impl/PayAppServiceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -package cn.iocoder.mall.payservice.service.app.impl; - -import cn.iocoder.common.framework.enums.CommonStatusEnum; -import cn.iocoder.common.framework.exception.util.ServiceExceptionUtil; -import cn.iocoder.mall.payservice.convert.app.PayAppConvert; -import cn.iocoder.mall.payservice.dal.mysql.dataobject.app.PayAppDO; -import cn.iocoder.mall.payservice.dal.mysql.mapper.app.PayAppMapper; -import cn.iocoder.mall.payservice.rpc.app.dto.PayAppRespDTO; -import cn.iocoder.mall.payservice.service.app.PayAppService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import static cn.iocoder.mall.payservice.enums.PayErrorCodeConstants.*; - -/** - * 支付应用 Service 实现类 - */ -@Service -public class PayAppServiceImpl implements PayAppService { - - @Autowired - private PayAppMapper payAppMapper; - - @Override - public PayAppRespDTO validPayApp(String payAppId) { - PayAppDO payAppDO = payAppMapper.selectById(payAppId); - // 校验是否存在 - if (payAppDO == null) { - throw ServiceExceptionUtil.exception(PAY_APP_NOT_FOUND); - } - // 校验是否禁用 - if (CommonStatusEnum.DISABLE.getValue().equals(payAppDO.getStatus())) { - throw ServiceExceptionUtil.exception(PAY_APP_IS_DISABLE); - } - return PayAppConvert.INSTANCE.convert(payAppDO); - } - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/service/notify/PayNotifyService.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/service/notify/PayNotifyService.java deleted file mode 100644 index a3ae5741f..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/service/notify/PayNotifyService.java +++ /dev/null @@ -1,22 +0,0 @@ -package cn.iocoder.mall.payservice.service.notify; - -import cn.iocoder.mall.payservice.dal.mysql.dataobject.notify.PayNotifyTaskDO; -import cn.iocoder.mall.payservice.dal.mysql.dataobject.refund.PayRefundDO; -import cn.iocoder.mall.payservice.dal.mysql.dataobject.transaction.PayTransactionDO; -import cn.iocoder.mall.payservice.dal.mysql.dataobject.transaction.PayTransactionExtensionDO; - -/** - * 支付通知 Service 接口 - */ -public interface PayNotifyService { - - // TODO 芋艿:后续优化下,不要暴露 entity 出来 - void addPayRefundNotifyTask(PayRefundDO refund); - - // TODO 芋艿:后续优化下,不要暴露 entity 出来 - void addPayTransactionNotifyTask(PayTransactionDO transaction, PayTransactionExtensionDO extension); - - // TODO 芋艿:后续优化下,不要暴露 entity 出来 - void sendNotifyMessage(PayNotifyTaskDO notifyTask); - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/service/notify/impl/PayNotifyServiceImpl.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/service/notify/impl/PayNotifyServiceImpl.java deleted file mode 100644 index 2d4a0ac76..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/service/notify/impl/PayNotifyServiceImpl.java +++ /dev/null @@ -1,79 +0,0 @@ -package cn.iocoder.mall.payservice.service.notify.impl; - -import cn.iocoder.common.framework.util.DateUtil; -import cn.iocoder.mall.payservice.convert.notify.PayNotifyConvert; -import cn.iocoder.mall.payservice.dal.mysql.dataobject.notify.PayNotifyTaskDO; -import cn.iocoder.mall.payservice.dal.mysql.dataobject.refund.PayRefundDO; -import cn.iocoder.mall.payservice.dal.mysql.dataobject.transaction.PayTransactionDO; -import cn.iocoder.mall.payservice.dal.mysql.dataobject.transaction.PayTransactionExtensionDO; -import cn.iocoder.mall.payservice.dal.mysql.mapper.notify.PayNotifyTaskMapper; -import cn.iocoder.mall.payservice.enums.notify.PayNotifyStatusEnum; -import cn.iocoder.mall.payservice.enums.notify.PayNotifyType; -import cn.iocoder.mall.payservice.mq.producer.PayMQProducer; -import cn.iocoder.mall.payservice.service.notify.PayNotifyService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.Calendar; - -/** - * 支付通知 Service 实现类 - */ -@Service -public class PayNotifyServiceImpl implements PayNotifyService { - - @Autowired - private PayNotifyTaskMapper payNotifyTaskMapper; - - @Autowired - private PayMQProducer payMQProducer; - - @Override - public void addPayRefundNotifyTask(PayRefundDO refund) { - PayNotifyTaskDO payNotifyTaskDO = this.createBasePayNotifyTaskDO(refund.getAppId(), refund.getNotifyUrl()) - .setType(PayNotifyType.REFUND.getType()); - // 设置 Refund 属性 - payNotifyTaskDO.setRefund(new PayNotifyTaskDO.Refund().setRefundId(refund.getId()) - .setTransactionId(refund.getTransactionId()).setOrderId(refund.getOrderId())); - // 保存到数据库 - payNotifyTaskMapper.insert(payNotifyTaskDO); - - // 发送 MQ 消息 - sendNotifyMessage(payNotifyTaskDO); - } - - @Override - public void addPayTransactionNotifyTask(PayTransactionDO transaction, PayTransactionExtensionDO extension) { - PayNotifyTaskDO payNotifyTaskDO = this.createBasePayNotifyTaskDO(transaction.getAppId(), transaction.getNotifyUrl()) - .setType(PayNotifyType.TRANSACTION.getType()); - // 设置 Transaction 属性 - payNotifyTaskDO.setTransaction(new PayNotifyTaskDO.Transaction().setOrderId(transaction.getOrderId()) - .setTransactionId(extension.getTransactionId()).setTransactionExtensionId(extension.getId())); - // 保存到数据库 - payNotifyTaskMapper.insert(payNotifyTaskDO); - - // 发送 MQ 消息 - sendNotifyMessage(payNotifyTaskDO); - } - - @Override - public void sendNotifyMessage(PayNotifyTaskDO notifyTask) { - if (PayNotifyType.TRANSACTION.getType().equals(notifyTask.getType())) { - payMQProducer.sendPayTransactionNotifyTaskMessage(PayNotifyConvert.INSTANCE.convertTransaction(notifyTask)); - } else if (PayNotifyType.REFUND.getType().equals(notifyTask.getType())) { - payMQProducer.sendPayRefundNotifyTaskMessage(PayNotifyConvert.INSTANCE.convertRefund(notifyTask)); - } else { - throw new IllegalArgumentException(String.format("通知任务(%s) 无法发送通知消息", notifyTask.toString())); - } - } - - private PayNotifyTaskDO createBasePayNotifyTaskDO(String appId, String notifyUrl) { - return new PayNotifyTaskDO() - .setAppId(appId) - .setStatus(PayNotifyStatusEnum.WAITING.getStatus()).setActive(true) - .setNotifyTimes(0).setMaxNotifyTimes(PayNotifyTaskDO.NOTIFY_FREQUENCY.length + 1) - .setNextNotifyTime(DateUtil.addDate(Calendar.SECOND, PayNotifyTaskDO.NOTIFY_FREQUENCY[0])) - .setNotifyUrl(notifyUrl); - } - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/service/transaction/PayTransactionService.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/service/transaction/PayTransactionService.java deleted file mode 100644 index acf191277..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/service/transaction/PayTransactionService.java +++ /dev/null @@ -1,64 +0,0 @@ -package cn.iocoder.mall.payservice.service.transaction; - -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.payservice.rpc.transaction.dto.*; - -/** - * 支付交易单 Service 接口 - */ -public interface PayTransactionService { - - /** - * 创建支付交易单 - * - * @param createReqDTO 创建信息 - * @return 支付交易单号 - */ - Integer createPayTransaction(PayTransactionCreateReqDTO createReqDTO); - - /** - * 提交支付交易单 - * - * @param submitReqDTO 提交信息 - * @return 提交响应,包含三方支付的响应 - */ - PayTransactionSubmitRespDTO submitPayTransaction(PayTransactionSubmitReqDTO submitReqDTO); - - /** - * 获得当支付交易单 - * - * @param getReqDTO 获得条件 - * @return 支付交易单 - */ - PayTransactionRespDTO getPayTransaction(PayTransactionGetReqDTO getReqDTO); - - /** - * 更新交易支付成功 - * - * 该接口用于不同支付平台,支付成功后,回调该接口 - * - * @param payChannel 支付渠道 - * @param params 回调参数。 - * 因为不同平台,能够提供的参数不同,所以使用 String 类型统一接收,然后在使用不同的 AbstractThirdPayClient 进行处理。 - * @return 是否支付成功 - */ - Boolean updateTransactionPaySuccess(Integer payChannel, String params); - - /** - * 获得交易支付单分页 - * - * @param pageReqDTO 分页条件 - * @return 交易支付单分页 - */ - PageResult pagePayTransaction(PayTransactionPageReqDTO pageReqDTO); - - /** - * 增加交易支付单的退款总金额 - * - * @param payTransactionId 支付交易单 - * @param incr 新增的退款金额 - * @return 是否增加成功 - */ - boolean updateTransactionPriceTotalIncr(Integer payTransactionId, Integer incr); - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/service/transaction/impl/PayTransactionServiceImpl.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/service/transaction/impl/PayTransactionServiceImpl.java deleted file mode 100644 index 14a051d29..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/payservice/service/transaction/impl/PayTransactionServiceImpl.java +++ /dev/null @@ -1,201 +0,0 @@ -package cn.iocoder.mall.payservice.service.transaction.impl; - -import cn.iocoder.common.framework.exception.util.ServiceExceptionUtil; -import cn.iocoder.common.framework.util.DateUtil; -import cn.iocoder.common.framework.util.MathUtil; -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.payservice.client.thirdpay.AbstractThirdPayClient; -import cn.iocoder.mall.payservice.client.thirdpay.ThirdPayClientFactory; -import cn.iocoder.mall.payservice.client.thirdpay.dto.ThirdPayTransactionSuccessRespDTO; -import cn.iocoder.mall.payservice.convert.transaction.PayTransactionConvert; -import cn.iocoder.mall.payservice.dal.mysql.dataobject.transaction.PayTransactionDO; -import cn.iocoder.mall.payservice.dal.mysql.dataobject.transaction.PayTransactionExtensionDO; -import cn.iocoder.mall.payservice.dal.mysql.mapper.transaction.PayTransactionExtensionMapper; -import cn.iocoder.mall.payservice.dal.mysql.mapper.transaction.PayTransactionMapper; -import cn.iocoder.mall.payservice.enums.transaction.PayTransactionStatusEnum; -import cn.iocoder.mall.payservice.rpc.app.dto.PayAppRespDTO; -import cn.iocoder.mall.payservice.rpc.transaction.dto.*; -import cn.iocoder.mall.payservice.service.app.PayAppService; -import cn.iocoder.mall.payservice.service.notify.PayNotifyService; -import cn.iocoder.mall.payservice.service.transaction.PayTransactionService; -import com.baomidou.mybatisplus.core.metadata.IPage; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.annotation.Validated; - -import java.time.LocalDateTime; - -import static cn.iocoder.mall.payservice.enums.PayErrorCodeConstants.*; - -/** -* 支付交易单 Service 实现类 -*/ -@Service -@Validated -@Slf4j -public class PayTransactionServiceImpl implements PayTransactionService { - - @Autowired - private PayTransactionMapper payTransactionMapper; - @Autowired - private PayTransactionExtensionMapper payTransactionExtensionMapper; - - @Autowired - private PayAppService payAppService; - @Autowired - private PayNotifyService payNotifyService; - - @Override - public Integer createPayTransaction(PayTransactionCreateReqDTO createReqDTO) { - // 校验 App - PayAppRespDTO payAppRespDTO = payAppService.validPayApp(createReqDTO.getAppId()); - - // 查询对应的支付交易单是否已经存在。如果是,则直接返回 - PayTransactionDO payTransaction = payTransactionMapper.selectByAppIdAndOrderId( - createReqDTO.getAppId(), createReqDTO.getOrderId()); - if (payTransaction != null) { - log.warn("[createTransaction][appId({}) orderId({}) 已经存在对应的支付交易单({})]", createReqDTO.getAppId(), - createReqDTO.getOrderId(), payTransaction.toString()); // 理论来说,不会出现这个情况 - return payTransaction.getId(); - } - - // 创建支付交易单 - payTransaction = PayTransactionConvert.INSTANCE.convert(createReqDTO) - .setStatus(PayTransactionStatusEnum.WAITING.getStatus()) - .setNotifyUrl(payAppRespDTO.getPayNotifyUrl()); - payTransactionMapper.insert(payTransaction); - // 最终返回 - return payTransaction.getId(); - } - - @Override - public PayTransactionSubmitRespDTO submitPayTransaction(PayTransactionSubmitReqDTO submitReqDTO) { - // TODO 校验支付渠道是否有效 - // 校验 App 是否有效 - payAppService.validPayApp(submitReqDTO.getAppId()); - - // 获得 PayTransactionDO ,并校验其是否存在 - PayTransactionDO payTransaction = payTransactionMapper.selectByAppIdAndOrderId( - submitReqDTO.getAppId(), submitReqDTO.getOrderId()); - if (payTransaction == null) { // 是否存在 - throw ServiceExceptionUtil.exception(PAY_TRANSACTION_NOT_FOUND); - } - if (!PayTransactionStatusEnum.WAITING.getStatus().equals(payTransaction.getStatus())) { // 校验状态,必须是待支付 - throw ServiceExceptionUtil.exception(PAY_TRANSACTION_STATUS_IS_NOT_WAITING); - } - - // 插入 PayTransactionExtensionDO - PayTransactionExtensionDO payTransactionExtensionDO = PayTransactionConvert.INSTANCE.convert(submitReqDTO) - .setTransactionId(payTransaction.getId()).setTransactionCode(generateTransactionCode()) - .setStatus(PayTransactionStatusEnum.WAITING.getStatus()); - payTransactionExtensionMapper.insert(payTransactionExtensionDO); - - // 调用三方接口 - AbstractThirdPayClient thirdPayClient = ThirdPayClientFactory.getThirdPayClient(submitReqDTO.getPayChannel()); - CommonResult invokeResult = thirdPayClient.submitTransaction(payTransaction, payTransactionExtensionDO, null); // TODO 暂时传入 extra = null - invokeResult.checkError(); - - // TODO 轮询三方接口,是否已经支付的任务 - // 返回成功 - return new PayTransactionSubmitRespDTO().setId(payTransactionExtensionDO.getId()).setInvokeResponse(invokeResult.getData()); - } - - @Override - public PayTransactionRespDTO getPayTransaction(PayTransactionGetReqDTO getReqDTO) { - return PayTransactionConvert.INSTANCE.convert(payTransactionMapper.selectByAppIdAndOrderId( - getReqDTO.getAppId(), getReqDTO.getOrderId())); - } - - @Override - @Transactional - public Boolean updateTransactionPaySuccess(Integer payChannel, String params) { - // TODO 芋艿,记录回调日志 - // 解析传入的参数,成 ThirdPayTransactionSuccessRespDTO 对象 - AbstractThirdPayClient thirdPayClient = ThirdPayClientFactory.getThirdPayClient(payChannel); - CommonResult paySuccessResult = thirdPayClient.parseTransactionSuccessParams(params); - paySuccessResult.checkError(); - - // TODO 芋艿,先最严格的校验。即使调用方重复调用,实际哪个订单已经被重复回调的支付,也返回 false 。也没问题,因为实际已经回调成功了。 - // 1.1 查询 PayTransactionExtensionDO - PayTransactionExtensionDO extension = payTransactionExtensionMapper.selectByTransactionCode(paySuccessResult.getData().getTransactionCode()); - if (extension == null) { - throw ServiceExceptionUtil.exception(PAY_TRANSACTION_EXTENSION_NOT_FOUND); - } - if (!PayTransactionStatusEnum.WAITING.getStatus().equals(extension.getStatus())) { // 校验状态,必须是待支付 - throw ServiceExceptionUtil.exception(PAY_TRANSACTION_EXTENSION_STATUS_IS_NOT_WAITING); - } - // 1.2 更新 PayTransactionExtensionDO - PayTransactionExtensionDO updatePayTransactionExtension = new PayTransactionExtensionDO() - .setId(extension.getId()) - .setStatus(PayTransactionStatusEnum.SUCCESS.getStatus()) - .setExtensionData(params); - int updateCounts = payTransactionExtensionMapper.update(updatePayTransactionExtension, PayTransactionStatusEnum.WAITING.getStatus()); - if (updateCounts == 0) { // 校验状态,必须是待支付 - throw ServiceExceptionUtil.exception(PAY_TRANSACTION_EXTENSION_STATUS_IS_NOT_WAITING); - } - log.info("[updateTransactionPaySuccess][PayTransactionExtensionDO({}) 更新为已支付]", extension.getId()); - - // 2.1 判断 PayTransactionDO 是否处于待支付 - PayTransactionDO transaction = payTransactionMapper.selectById(extension.getTransactionId()); - if (transaction == null) { - throw ServiceExceptionUtil.exception(PAY_TRANSACTION_NOT_FOUND); - } - if (!PayTransactionStatusEnum.WAITING.getStatus().equals(transaction.getStatus())) { // 校验状态,必须是待支付 - throw ServiceExceptionUtil.exception(PAY_TRANSACTION_STATUS_IS_NOT_WAITING); - } - // 2.2 更新 PayTransactionDO - PayTransactionDO updatePayTransaction = new PayTransactionDO() - .setId(transaction.getId()) - .setStatus(PayTransactionStatusEnum.SUCCESS.getStatus()) - .setExtensionId(extension.getId()) - .setPayChannel(payChannel) - .setPaymentTime(paySuccessResult.getData().getPaymentTime()) - .setNotifyTime(new Date()) - .setTradeNo(paySuccessResult.getData().getTradeNo()); - updateCounts = payTransactionMapper.update(updatePayTransaction, PayTransactionStatusEnum.WAITING.getStatus()); - if (updateCounts == 0) { // 校验状态,必须是待支付 - throw ServiceExceptionUtil.exception(PAY_TRANSACTION_STATUS_IS_NOT_WAITING); - } - log.info("[updateTransactionPaySuccess][PayTransactionDO({}) 更新为已支付]", transaction.getId()); - - // 3 新增 PayNotifyTaskDO 注释原因,参见 PayRefundSuccessConsumer 类。 - payNotifyService.addPayTransactionNotifyTask(transaction, extension); - // 返回结果 - return true; - } - - @Override - public PageResult pagePayTransaction(PayTransactionPageReqDTO pageReqDTO) { - IPage payTransactionDOPage = payTransactionMapper.selectPage(pageReqDTO); - return PayTransactionConvert.INSTANCE.convertPage(payTransactionDOPage); - } - - @Override - public boolean updateTransactionPriceTotalIncr(Integer payTransactionId, Integer incr) { - return payTransactionMapper.updatePriceTotalIncr(payTransactionId, incr) > 0; - } - - private String generateTransactionCode() { -// wx -// 2014 -// 10 -// 27 -// 20 -// 09 -// 39 -// 5522657 -// a690389285100 - // 目前的算法 - // 时间序列,年月日时分秒 14 位 - // 纯随机,6 位 TODO 此处估计是会有问题的,后续在调整 - return DateUtil.format(new Date(), "yyyyMMddHHmmss") + // 时间序列 - MathUtil.random(100000, 999999) // 随机。为什么是这个范围,因为偷懒 - ; - } - -// CommonResult cancelTransaction(); // TODO 1. params 2. result - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/systemservice/controller/PayTransactionController.java b/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/systemservice/controller/PayTransactionController.java deleted file mode 100644 index f3e1050c1..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/java/cn/iocoder/mall/systemservice/controller/PayTransactionController.java +++ /dev/null @@ -1,81 +0,0 @@ -package cn.iocoder.mall.systemservice.controller; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.payservice.rpc.transaction.dto.*; -import cn.iocoder.mall.payservice.service.transaction.PayTransactionService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import static cn.iocoder.common.framework.vo.CommonResult.success; - -/** - * Title: - * Description: - * - * @author zhuyang - * @version 1.0 2021/10/9 - */ -@RestController -@RequestMapping("/pay/transaction") -public class PayTransactionController { - @Autowired - private PayTransactionService payTransactionService; - - /** - * 创建支付交易单 - * - * @param createReqDTO 创建信息 - * @return 支付交易单号 - */ - @PostMapping("createPayTransaction") - CommonResult createPayTransaction(@RequestBody PayTransactionCreateReqDTO createReqDTO){ - return success(payTransactionService.createPayTransaction(createReqDTO)); - } - - /** - * 提交支付交易单 - * - * @param submitReqDTO 提交信息 - * @return 提交响应,包含三方支付的响应 - */ - @PostMapping("submitPayTransaction") - CommonResult submitPayTransaction(@RequestBody PayTransactionSubmitReqDTO submitReqDTO){ - return success(payTransactionService.submitPayTransaction(submitReqDTO)); - } - - /** - * 获得当支付交易单 - * - * @param getReqDTO 获得条件 - * @return 支付交易单 - */ - @PostMapping("getPayTransaction") - CommonResult getPayTransaction(@RequestBody PayTransactionGetReqDTO getReqDTO){ - return success(payTransactionService.getPayTransaction(getReqDTO));} - - /** - * 更新交易支付成功 - * - * @param successReqDTO 支付成功信息 - * @return 是否成功 - */ - @PostMapping("updatePayTransactionSuccess") - CommonResult updatePayTransactionSuccess(@RequestBody PayTransactionSuccessReqDTO successReqDTO){ - return success(payTransactionService.updateTransactionPaySuccess(successReqDTO.getPayChannel(), - successReqDTO.getParams()));} - - /** - * 获得交易支付单分页 - * - * @param pageReqDTO 分页条件 - * @return 交易支付单分页 - */ - @PostMapping("pagePayTransaction") - CommonResult> pagePayTransaction(@RequestBody PayTransactionPageReqDTO pageReqDTO){ - return success(payTransactionService.pagePayTransaction(pageReqDTO));} - -} diff --git a/归档/pay-service-project/pay-service-app/src/main/resources/application-dev.yaml b/归档/pay-service-project/pay-service-app/src/main/resources/application-dev.yaml deleted file mode 100644 index faab4b01a..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/resources/application-dev.yaml +++ /dev/null @@ -1,31 +0,0 @@ -spring: - # 数据源配置项 - datasource: - url: jdbc:mysql://localhost:3306/mall_pay?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT - driver-class-name: com.mysql.jdbc.Driver - username: root - password: zhuyang - # Spring Cloud 配置项 - cloud: - nacos: - # Spring Cloud Nacos Discovery 配置项 - discovery: - server-addr: localhost:8848 # Nacos 服务器地址 - namespace: dev # Nacos 命名空间 - -# Dubbo 配置项 -dubbo: - # Dubbo 注册中心 - registry: - # address: spring-cloud://localhost:8848 # 指定 Dubbo 服务注册中心的地址 - address: nacos://localhost:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 - -# XXL-Job 配置项 -xxl: - job: - admin: - addresses: http://127.0.0.1:9099/ - executor: - appname: ${spring.application.name} - logpath: /data/applogs/xxl-job/ - accessToken: diff --git a/归档/pay-service-project/pay-service-app/src/main/resources/application-local.yaml b/归档/pay-service-project/pay-service-app/src/main/resources/application-local.yaml deleted file mode 100644 index ffc81eb45..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/resources/application-local.yaml +++ /dev/null @@ -1,40 +0,0 @@ -spring: - # 数据源配置项 - datasource: - url: jdbc:mysql://localhost:3306/mall_pay?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT - driver-class-name: com.mysql.jdbc.Driver - username: root - password: zhuyang - # Spring Cloud 配置项 - cloud: - nacos: - # Spring Cloud Nacos Discovery 配置项 - discovery: - server-addr: localhost:8848 # Nacos 服务器地址 - namespace: dev # Nacos 命名空间 - -# Dubbo 配置项 -dubbo: - # Dubbo 注册中心 - registry: -# address: spring-cloud://localhost:8848 # 指定 Dubbo 服务注册中心的地址 - address: nacos://localhost:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 - # Dubbo 服务提供者的配置 - provider: - tag: ${DUBBO_TAG} # Dubbo 路由分组 - -# XXL-Job 配置项 -xxl: - job: - enabled: false # 本地开发时,关闭 XXL-Job - admin: - addresses: http://localhost:9099 - executor: - appname: ${spring.application.name} - accessToken: - - -# MyBatis Plus 配置 -mybatis-plus: - configuration: - log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 本地开发环境下,多打印 SQL 到控制台 diff --git a/归档/pay-service-project/pay-service-app/src/main/resources/application.yaml b/归档/pay-service-project/pay-service-app/src/main/resources/application.yaml deleted file mode 100644 index e35632ddf..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/resources/application.yaml +++ /dev/null @@ -1,64 +0,0 @@ -spring: - # Application 的配置项 - application: - name: pay-service - # Profile 的配置项 - profiles: - active: local - -# MyBatis Plus 配置项 -mybatis-plus: - configuration: - map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。 - global-config: - db-config: - id-type: auto - logic-delete-value: 1 # 逻辑已删除值(默认为 1) - logic-not-delete-value: 0 # 逻辑未删除值(默认为 0) - mapper-locations: classpath*:mapper/*.xml - type-aliases-package: cn.iocoder.mall.payservice.dal.mysql.dataobject - -# Dubbo 配置项 -dubbo: - # Spring Cloud Alibaba Dubbo 专属配置 - cloud: - subscribed-services: '' # 设置订阅的应用列表,默认为 * 订阅所有应用 - # Dubbo 提供者的协议 - protocol: - name: dubbo - port: -1 - # Dubbo 提供服务的扫描基础包 - scan: - base-packages: cn.iocoder.mall.payservice.rpc - # Dubbo 服务提供者的配置 - provider: - filter: -exception - validation: true # 开启 Provider 参数校验 - version: 1.0.0 # 服务的版本号 - # Dubbo 服务消费者的配置 - consumer: - ErrorCodeRpc: - version: 1.0.0 - ProductSkuRpc: - version: 1.0.0 - ProductSpuRpc: - version: 1.0.0 - -# RocketMQ 配置项 -rocketmq: - name-server: localhost:9876 - producer: - group: ${spring.application.name}-producer-group - -# Actuator 监控配置项 -management: - server.port: 38089 # 独立端口,避免被暴露出去 - endpoints.web.exposure.include: '*' # 暴露所有监控端点 -server.port: ${management.server.port} # 设置使用 Actuator 的服务器端口,因为 RPC 服务不需要 Web 端口 - -# Mall 配置项 -mall: - # 错误码配置项对应 ErrorCodeProperties 配置类 - error-code: - group: ${spring.application.name} - constants-class: cn.iocoder.mall.payservice.enums.PayErrorCodeConstants diff --git a/归档/pay-service-project/pay-service-app/src/main/resources/mapper/PayTransactionMapper.xml b/归档/pay-service-project/pay-service-app/src/main/resources/mapper/PayTransactionMapper.xml deleted file mode 100644 index 278d29930..000000000 --- a/归档/pay-service-project/pay-service-app/src/main/resources/mapper/PayTransactionMapper.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - UPDATE pay_transaction - SET refund_total = refund_total + ${refundTotalIncr} - WHERE id = #{id} - AND price >= refund_total + ${refundTotalIncr} - - - diff --git a/归档/pay-service-project/pay-service-integration-test/pom.xml b/归档/pay-service-project/pay-service-integration-test/pom.xml deleted file mode 100644 index d76113f48..000000000 --- a/归档/pay-service-project/pay-service-integration-test/pom.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - pay-service-project - cn.iocoder.mall - 1.0-SNAPSHOT - - 4.0.0 - - pay-service-integration-test - - - - cn.iocoder.mall - pay-service-app - 1.0-SNAPSHOT - - - - - org.springframework.boot - spring-boot-starter-test - test - - - - diff --git a/归档/pay-service-project/pay-service-integration-test/src/test/java/cn/iocoder/mall/payservice/common/dubbo/DubboGenericInvokerTest.java b/归档/pay-service-project/pay-service-integration-test/src/test/java/cn/iocoder/mall/payservice/common/dubbo/DubboGenericInvokerTest.java deleted file mode 100644 index 603267cd7..000000000 --- a/归档/pay-service-project/pay-service-integration-test/src/test/java/cn/iocoder/mall/payservice/common/dubbo/DubboGenericInvokerTest.java +++ /dev/null @@ -1,49 +0,0 @@ -package cn.iocoder.mall.payservice.common.dubbo; - -import cn.iocoder.common.framework.vo.CommonResult; -import org.apache.dubbo.config.ApplicationConfig; -import org.apache.dubbo.config.ReferenceConfig; -import org.apache.dubbo.config.RegistryConfig; -import org.apache.dubbo.rpc.service.GenericService; - -import java.util.Map; - -public class DubboGenericInvokerTest { - - public static void main(String[] args) { - ApplicationConfig application = new ApplicationConfig(); - application.setName("api-generic-consumer"); - - RegistryConfig registry = new RegistryConfig(); - registry.setAddress("nacos://localhost:8848?namespace=dev"); - - application.setRegistry(registry); - - ReferenceConfig reference = new ReferenceConfig<>(); - // 弱类型接口名 - reference.setInterface("cn.iocoder.mall.tradeservice.rpc.order.TradeOrderRpc"); - reference.setVersion("1.0.0"); - // 声明为泛化接口 - reference.setGeneric(true); - - reference.setApplication(application); - - // 用com.alibaba.dubbo.rpc.service.GenericService可以替代所有接口引用 - GenericService genericService = reference.get(); - - Object result = genericService.$invoke("updateTradeOrderPaySuccess", - new String[]{String.class.getName(), Integer.class.getName()}, - new Object[]{"1", 100}); - CommonResult commonResult = parseCommonResult((Map) result); - System.out.println(result); - } - - private static CommonResult parseCommonResult(Map dubboResult) { - CommonResult commonResult = new CommonResult<>(); - commonResult.setCode((Integer) dubboResult.get("code")); - commonResult.setMessage((String) dubboResult.get("message")); - commonResult.setData((Boolean) dubboResult.get("data")); - return commonResult; - } - -} diff --git a/归档/pay-service-project/pay-service-integration-test/src/test/java/cn/iocoder/mall/payservice/common/package-info.java b/归档/pay-service-project/pay-service-integration-test/src/test/java/cn/iocoder/mall/payservice/common/package-info.java deleted file mode 100644 index ed83cb4e9..000000000 --- a/归档/pay-service-project/pay-service-integration-test/src/test/java/cn/iocoder/mall/payservice/common/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package cn.iocoder.mall.payservice.common; diff --git a/归档/pay-service-project/pay-service-integration-test/src/test/java/cn/iocoder/mall/payservice/service/transaction/impl/PayTransactionServiceImplTest.java b/归档/pay-service-project/pay-service-integration-test/src/test/java/cn/iocoder/mall/payservice/service/transaction/impl/PayTransactionServiceImplTest.java deleted file mode 100644 index 0ec6f4167..000000000 --- a/归档/pay-service-project/pay-service-integration-test/src/test/java/cn/iocoder/mall/payservice/service/transaction/impl/PayTransactionServiceImplTest.java +++ /dev/null @@ -1,27 +0,0 @@ -package cn.iocoder.mall.payservice.service.transaction.impl; - -import cn.iocoder.mall.payservice.enums.PayChannelEnum; -import cn.iocoder.mall.payservice.rpc.transaction.dto.PayTransactionSubmitReqDTO; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest -public class PayTransactionServiceImplTest { - - @Autowired - private PayTransactionServiceImpl payTransactionService; - - @Test - public void testSubmitPayTransaction() { - payTransactionService.submitPayTransaction(new PayTransactionSubmitReqDTO() - .setAppId("POd4RC6a") - .setCreateIp("127.0.0.1") - .setOrderId("239") - .setPayChannel(PayChannelEnum.PINGXX.getId())); - } - -} diff --git a/归档/pay-service-project/pay-service-integration-test/src/test/java/cn/iocoder/mall/payservice/service/transaction/package-info.java b/归档/pay-service-project/pay-service-integration-test/src/test/java/cn/iocoder/mall/payservice/service/transaction/package-info.java deleted file mode 100644 index c80ad27ff..000000000 --- a/归档/pay-service-project/pay-service-integration-test/src/test/java/cn/iocoder/mall/payservice/service/transaction/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package cn.iocoder.mall.payservice.service.transaction; diff --git a/归档/pay-service-project/pom.xml b/归档/pay-service-project/pom.xml deleted file mode 100644 index 3c5450e59..000000000 --- a/归档/pay-service-project/pom.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - onemall - cn.iocoder.mall - 1.0-SNAPSHOT - - 4.0.0 - - pay-service-project - pom - 支付相关服务 - - pay-service-api - pay-service-app - pay-service-integration-test - - - - - - - - cn.iocoder.mall - mall-dependencies - 1.0-SNAPSHOT - pom - import - - - - cn.iocoder.mall - common-framework - 1.0-SNAPSHOT - - - - - cn.iocoder.mall - pay-service-api - 1.0-SNAPSHOT - - - - - diff --git a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/enums/sku/ProductSkuDetailFieldEnum.java b/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/enums/sku/ProductSkuDetailFieldEnum.java deleted file mode 100644 index 6e35823d1..000000000 --- a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/enums/sku/ProductSkuDetailFieldEnum.java +++ /dev/null @@ -1,28 +0,0 @@ -package cn.iocoder.mall.productservice.enums.sku; - -import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuRespDTO; - -/** - * 商品 SKU 明细的字段枚举 - * - * @see ProductSkuRespDTO - */ -public enum ProductSkuDetailFieldEnum { - - SPU("spu"), - ATTR("attr"); - - /** - * 字段 - */ - private final String field; - - ProductSkuDetailFieldEnum(String field) { - this.field = field; - } - - public String getField() { - return field; - } - -} diff --git a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/enums/spu/ProductSpuDetailFieldEnum.java b/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/enums/spu/ProductSpuDetailFieldEnum.java deleted file mode 100644 index 20b3c3796..000000000 --- a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/enums/spu/ProductSpuDetailFieldEnum.java +++ /dev/null @@ -1,28 +0,0 @@ -package cn.iocoder.mall.productservice.enums.spu; - -import cn.iocoder.mall.productservice.rpc.spu.dto.ProductSpuDetailRespDTO; - -/** - * 商品 SPU 明细的字段枚举 - * - * @see ProductSpuDetailRespDTO - */ -public enum ProductSpuDetailFieldEnum { - - SKU("sku"), - ATTR("attr"); - - /** - * 字段 - */ - private final String field; - - ProductSpuDetailFieldEnum(String field) { - this.field = field; - } - - public String getField() { - return field; - } - -} diff --git a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/ProductAttrFeign.java b/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/ProductAttrFeign.java deleted file mode 100644 index 0360aa6e3..000000000 --- a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/ProductAttrFeign.java +++ /dev/null @@ -1,94 +0,0 @@ -package cn.iocoder.mall.productservice.rpc.attr; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.productservice.rpc.attr.dto.*; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestParam; - -import java.util.List; - -/** - * 商品规格 Rpc 接口 - */ -@FeignClient(value = "product-service") -public interface ProductAttrFeign { - - /** - * 创建商品规格键 - * - * @param createDTO 创建商品规格键 DTO - * @return 商品规格键编号 - */ - @PostMapping(value = "/product/attr/createProductAttrKey") - CommonResult createProductAttrKey(@RequestBody ProductAttrKeyCreateReqDTO createDTO); - - /** - * 更新商品规格键 - * - * @param updateDTO 更新商品规格键 DTO - */ - @PostMapping(value = "/product/attr/updateProductAttrKey") - CommonResult updateProductAttrKey(@RequestBody ProductAttrKeyUpdateReqDTO updateDTO); - - /** - * 获得商品规格键 - * - * @param productAttrKeyId 商品规格键编号 - * @return 商品规格键 - */ - @GetMapping("/product/attr/getProductAttrKey") - CommonResult getProductAttrKey(@RequestParam("productAttrKeyId") Integer productAttrKeyId); - - /** - * 获得商品规格键列表 - * - * @param productAttrKeyIds 商品规格键编号列表 - * @return 商品规格键列表 - */ - @GetMapping("/product/attr/listProductAttrKeys") - CommonResult> listProductAttrKeys(@RequestParam("productAttrKeyIds") List productAttrKeyIds); - - /** - * 获得商品规格键分页 - * - * @param pageDTO 商品规格键分页查询 - * @return 商品规格键分页结果 - */ - @PostMapping("/product/attr/pageProductAttrKey") - CommonResult> pageProductAttrKey(@RequestBody ProductAttrKeyPageReqDTO pageDTO); - - /** - * 创建商品规格值 - * - * @param createDTO 创建商品规格值 DTO - * @return 商品规格值编号 - */ - @PostMapping("/product/attr/createProductAttrValue") - CommonResult createProductAttrValue(@RequestBody ProductAttrValueCreateReqDTO createDTO); - - - /** - * 更新商品规格值 - * - * @param updateDTO 更新商品规格值 DTO - */ - @PostMapping("/product/attr/updateProductAttrValue") - CommonResult updateProductAttrValue(@RequestBody ProductAttrValueUpdateReqDTO updateDTO); - - /** - * 获得商品规格值 - * - * @param productAttrValueId 商品规格值编号 - * @return 商品规格值 - */ - @GetMapping("/product/attr/getProductAttrValue") - CommonResult getProductAttrValue(@RequestParam("productAttrValueId") Integer productAttrValueId); - - @PostMapping("/product/attr/listProductAttrValues") - CommonResult> listProductAttrValues(@RequestBody ProductAttrValueListQueryReqDTO queryDTO); - -} \ No newline at end of file diff --git a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrKeyCreateReqDTO.java b/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrKeyCreateReqDTO.java deleted file mode 100644 index e28a4a736..000000000 --- a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrKeyCreateReqDTO.java +++ /dev/null @@ -1,31 +0,0 @@ -package cn.iocoder.mall.productservice.rpc.attr.dto; - -import cn.iocoder.common.framework.enums.CommonStatusEnum; -import cn.iocoder.common.framework.validator.InEnum; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import java.io.Serializable; - -/** - * 商品规格键创建 Request DTO - */ -@Data -@Accessors(chain = true) -public class ProductAttrKeyCreateReqDTO implements Serializable { - - /** - * 规格键名称 - */ - @NotEmpty(message = "规格键名称不能为空") - private String name; - /** - * 状态 - */ - @NotNull(message = "状态不能为空") - @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") - private Integer status; - -} diff --git a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrKeyPageReqDTO.java b/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrKeyPageReqDTO.java deleted file mode 100644 index 742ecc26c..000000000 --- a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrKeyPageReqDTO.java +++ /dev/null @@ -1,25 +0,0 @@ -package cn.iocoder.mall.productservice.rpc.attr.dto; - -import cn.iocoder.common.framework.vo.PageParam; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - * 商品规格键分页 Request DTO - */ -@Data -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -public class ProductAttrKeyPageReqDTO extends PageParam { - - /** - * 规格键名称 - */ - private String name; - /** - * 状态 - */ - private Integer status; - -} diff --git a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrKeyRespDTO.java b/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrKeyRespDTO.java deleted file mode 100644 index 670308aee..000000000 --- a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrKeyRespDTO.java +++ /dev/null @@ -1,33 +0,0 @@ -package cn.iocoder.mall.productservice.rpc.attr.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 商品规格键 Response DTO - */ -@Data -@Accessors(chain = true) -public class ProductAttrKeyRespDTO implements Serializable { - - /** - * 规格键编号 - */ - private Integer id; - /** - * 规格键名称 - */ - private String name; - /** - * 状态 - */ - private Integer status; - /** - * 创建时间 - */ - private LocalDateTime createTime; - -} diff --git a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrKeyUpdateReqDTO.java b/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrKeyUpdateReqDTO.java deleted file mode 100644 index 7094628bf..000000000 --- a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrKeyUpdateReqDTO.java +++ /dev/null @@ -1,36 +0,0 @@ -package cn.iocoder.mall.productservice.rpc.attr.dto; - -import cn.iocoder.common.framework.enums.CommonStatusEnum; -import cn.iocoder.common.framework.validator.InEnum; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import java.io.Serializable; - -/** - * 商品规格键更新 Request DTO - */ -@Data -@Accessors(chain = true) -public class ProductAttrKeyUpdateReqDTO implements Serializable { - - /** - * 规格键编号 - */ - @NotNull(message = "规格键编号不能为空") - private Integer id; - /** - * 规格键名称 - */ - @NotEmpty(message = "规格键名称不能为空") - private String name; - /** - * 状态 - */ - @NotNull(message = "状态不能为空") - @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") - private Integer status; - -} diff --git a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrKeyValueRespDTO.java b/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrKeyValueRespDTO.java deleted file mode 100644 index 7086af492..000000000 --- a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrKeyValueRespDTO.java +++ /dev/null @@ -1,32 +0,0 @@ -package cn.iocoder.mall.productservice.rpc.attr.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * 商品规格 KEY + VALUE 对的 Response DTO - */ -@Data -@Accessors(chain = true) -public class ProductAttrKeyValueRespDTO implements Serializable { - - /** - * 规格 KEY 编号 - */ - private Integer attrKeyId; - /** - * 规格 KEY 名 - */ - private String attrKeyName; - /** - * 规格 VALUE 编号 - */ - private Integer attrValueId; - /** - * 规格 VALUE 名 - */ - private String attrValueName; - -} diff --git a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrValueCreateReqDTO.java b/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrValueCreateReqDTO.java deleted file mode 100644 index 439d8b299..000000000 --- a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrValueCreateReqDTO.java +++ /dev/null @@ -1,36 +0,0 @@ -package cn.iocoder.mall.productservice.rpc.attr.dto; - -import cn.iocoder.common.framework.enums.CommonStatusEnum; -import cn.iocoder.common.framework.validator.InEnum; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import java.io.Serializable; - -/** - * 商品规格值创建 Request DTO - */ -@Data -@Accessors(chain = true) -public class ProductAttrValueCreateReqDTO implements Serializable { - - /** - * 规格键编号 - */ - @NotNull(message = "规格键编号不能为空") - private Integer attrKeyId; - /** - * 规格值名字 - */ - @NotEmpty(message = "规格值名字不能为空") - private String name; - /** - * 状态 - */ - @NotNull(message = "状态不能为空") - @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") - private Integer status; - -} diff --git a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrValueListQueryReqDTO.java b/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrValueListQueryReqDTO.java deleted file mode 100644 index 745502d61..000000000 --- a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrValueListQueryReqDTO.java +++ /dev/null @@ -1,26 +0,0 @@ -package cn.iocoder.mall.productservice.rpc.attr.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.List; - -/** - * 商品规格值的列表查询条件 Request DTO - */ -@Data -@Accessors(chain = true) -public class ProductAttrValueListQueryReqDTO implements Serializable { - - /** - * 商品规格值编号列表 - */ - private List productAttrValueIds; - - /** - * 商品规格键编号 - */ - private Integer productAttrKeyId; - -} diff --git a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrValueRespDTO.java b/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrValueRespDTO.java deleted file mode 100644 index 4afccc626..000000000 --- a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrValueRespDTO.java +++ /dev/null @@ -1,37 +0,0 @@ -package cn.iocoder.mall.productservice.rpc.attr.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 商品规格值 Response DTO - */ -@Data -@Accessors(chain = true) -public class ProductAttrValueRespDTO implements Serializable { - - /** - * 规格值编号 - */ - private Integer id; - /** - * 规格键编号 - */ - private Integer attrKeyId; - /** - * 规格值名字 - */ - private String name; - /** - * 状态 - */ - private Integer status; - /** - * 创建时间 - */ - private LocalDateTime createTime; - -} diff --git a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrValueUpdateReqDTO.java b/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrValueUpdateReqDTO.java deleted file mode 100644 index 2cac47a0f..000000000 --- a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/attr/dto/ProductAttrValueUpdateReqDTO.java +++ /dev/null @@ -1,36 +0,0 @@ -package cn.iocoder.mall.productservice.rpc.attr.dto; - -import cn.iocoder.common.framework.enums.CommonStatusEnum; -import cn.iocoder.common.framework.validator.InEnum; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import java.io.Serializable; - -/** - * 商品规格值更新 Request DTO - */ -@Data -@Accessors(chain = true) -public class ProductAttrValueUpdateReqDTO implements Serializable { - - /** - * 规格值编号 - */ - @NotNull(message = "规格值编号不能为空") - private Integer id; - /** - * 规格值名字 - */ - @NotEmpty(message = "规格值名字不能为空") - private String name; - /** - * 状态 - */ - @NotNull(message = "状态不能为空") - @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") - private Integer status; - -} diff --git a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/sku/ProductSkuFeign.java b/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/sku/ProductSkuFeign.java deleted file mode 100644 index 94b077eac..000000000 --- a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/sku/ProductSkuFeign.java +++ /dev/null @@ -1,27 +0,0 @@ -package cn.iocoder.mall.productservice.rpc.sku; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuListQueryReqDTO; -import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuRespDTO; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestParam; - -import java.util.List; - -@FeignClient(value = "product-service") -public interface ProductSkuFeign { - @GetMapping("/product/sku/getProductSku") - CommonResult getProductSku(@RequestParam("productSkuId") Integer productSkuId); - - /** - * 获得商品 SKU 列表 - * - * @param queryReqDTO 商品 SKU 列表的查询请求 DTO - * @return 商品 SKU 列表 - */ - @PostMapping("/product/sku/listProductSkus") - CommonResult> listProductSkus(@RequestBody ProductSkuListQueryReqDTO queryReqDTO); -} diff --git a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/sku/dto/ProductSkuListQueryReqDTO.java b/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/sku/dto/ProductSkuListQueryReqDTO.java deleted file mode 100644 index e1bf68605..000000000 --- a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/sku/dto/ProductSkuListQueryReqDTO.java +++ /dev/null @@ -1,38 +0,0 @@ -package cn.iocoder.mall.productservice.rpc.sku.dto; - -import cn.iocoder.mall.productservice.enums.sku.ProductSkuDetailFieldEnum; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.Collection; -import java.util.Collections; - -/** - * 商品 SKU 列表查询 DTO - */ -@Data -@Accessors(chain = true) -public class ProductSkuListQueryReqDTO implements Serializable { - - /** - * 商品 SKU 编号 - */ - private Integer productSkuId; - /** - * 商品 SKU 编号数组 - */ - private Collection productSkuIds; - /** - * 商品 SPU 编号 - */ - private Integer productSpuId; - - /** - * 额外返回字段 - * - * @see ProductSkuDetailFieldEnum - */ - private Collection fields = Collections.emptySet(); - -} diff --git a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/sku/dto/ProductSkuRespDTO.java b/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/sku/dto/ProductSkuRespDTO.java deleted file mode 100644 index 7a66c113f..000000000 --- a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/sku/dto/ProductSkuRespDTO.java +++ /dev/null @@ -1,67 +0,0 @@ -package cn.iocoder.mall.productservice.rpc.sku.dto; - -import cn.iocoder.mall.productservice.enums.sku.ProductSkuDetailFieldEnum; -import cn.iocoder.mall.productservice.rpc.attr.dto.ProductAttrKeyValueRespDTO; -import cn.iocoder.mall.productservice.rpc.spu.dto.ProductSpuRespDTO; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; -import java.util.List; - -/** - * 商品 SKU Response DTO - */ -@Data -@Accessors(chain = true) -public class ProductSkuRespDTO implements Serializable { - - /** - * sku 编号 - */ - private Integer id; - /** - * 商品编号 - */ - private Integer spuId; - /** - * 状态 - */ - private Integer status; - /** - * 图片地址 - */ - private String picUrl; - /** - * 规格值编号数组 - */ - private List attrValueIds; - /** - * 价格,单位:分 - */ - private Integer price; - /** - * 库存数量 - */ - private Integer quantity; - /** - * 创建时间 - */ - private LocalDateTime createTime; - /** - * 规格值数组 - * - * 需要设置 {@link ProductSkuDetailFieldEnum#ATTR} 才返回 - */ - private List attrs; - /** - * 商品 SPU 信息 - * - * 需要设置 {@link ProductSkuDetailFieldEnum#SPU} 才返回 - * - * // TODO 芋艿,后续考虑怎么优化下,目前是内嵌了别的 dto - */ - private ProductSpuRespDTO spu; - -} diff --git a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/spu/dto/ProductSpuDetailRespDTO.java b/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/spu/dto/ProductSpuDetailRespDTO.java deleted file mode 100644 index 1dfbee6c3..000000000 --- a/归档/product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/spu/dto/ProductSpuDetailRespDTO.java +++ /dev/null @@ -1,103 +0,0 @@ -package cn.iocoder.mall.productservice.rpc.spu.dto; - -import cn.iocoder.mall.productservice.rpc.attr.dto.ProductAttrKeyValueRespDTO; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.List; - -/** - * 商品 SPU 明细 Response DTO - */ -@Data -@Accessors(chain = true) -public class ProductSpuDetailRespDTO implements Serializable { - - /** - * SPU 编号 - */ - private Integer id; - - // ========== 基本信息 ========= - /** - * SPU 名字 - */ - private String name; - /** - * 卖点 - */ - private String sellPoint; - /** - * 描述 - */ - private String description; - /** - * 分类编号 - */ - private Integer cid; - /** - * 分类名 - */ - private String categoryName; - /** - * 商品主图地址 - * - * 数组,以逗号分隔 - * - * 建议尺寸:800*800像素,你可以拖拽图片调整顺序,最多上传15张 - */ - private List picUrls; - - // ========== 其他信息 ========= - /** - * 是否上架商品(是否可见)。 - * - * true 为已上架 - * false 为已下架 - */ - private Boolean visible; - /** - * 排序字段 - */ - private Integer sort; - - // ========== SKU ========= - - /** - * SKU 数组 - */ - private List skus; - - /** - * 商品 Sku 明细 - */ - @Data - @Accessors(chain = true) - public static class Sku implements Serializable { - - private Integer id; - /** - * 商品编号 - */ - private Integer spuId; - /** - * 图片地址 - */ - private String picURL; - /** - * 规格值数组 - */ - private List attrs; - /** - * 价格,单位:分 - */ - private Integer price; - /** - * 库存数量 - */ - private Integer quantity; - - } - -} diff --git a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/controller/ProductAttrController.java b/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/controller/ProductAttrController.java deleted file mode 100644 index 26904d4e7..000000000 --- a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/controller/ProductAttrController.java +++ /dev/null @@ -1,128 +0,0 @@ -package cn.iocoder.mall.productservice.controller; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.productservice.manager.attr.ProductAttrManager; -import cn.iocoder.mall.productservice.rpc.attr.dto.*; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -import static cn.iocoder.common.framework.vo.CommonResult.success; - -@RestController -@RequestMapping("/product/attr") -@Api("商品属性") -public class ProductAttrController { - @Autowired - private ProductAttrManager productAttrManager; - - @PostMapping("/createProductAttrKey") - @ApiOperation("创建商品规格键") - CommonResult createProductAttrKey(@RequestBody ProductAttrKeyCreateReqDTO createDTO){ - return success(productAttrManager.createProductAttrKey(createDTO)); - } - - /** - * 更新商品规格键 - * - * @param updateDTO 更新商品规格键 DTO - */ - @PostMapping("/updateProductAttrKey") - @ApiOperation("更新商品规格键") - CommonResult updateProductAttrKey(@RequestBody ProductAttrKeyUpdateReqDTO updateDTO){ - productAttrManager.updateProductAttrKey(updateDTO); - return success(true); - } - - /** - * 获得商品规格键 - * - * @param productAttrKeyId 商品规格键编号 - * @return 商品规格键 - */ - @GetMapping("/getProductAttrKey") - @ApiOperation("获得商品规格键") - CommonResult getProductAttrKey(@RequestParam("productAttrKeyId") Integer productAttrKeyId){ - return success(productAttrManager.getProductAttrKey(productAttrKeyId)); - } - - - /** - * 获得商品规格键列表 - * - * @param productAttrKeyIds 商品规格键编号列表 - * @return 商品规格键列表 - */ - @GetMapping("/listProductAttrKeys") - @ApiOperation("获得商品规格键列表") - CommonResult> listProductAttrKeys(@RequestParam("productAttrKeyIds") List productAttrKeyIds){ - return success(productAttrManager.listProductAttrKeys(productAttrKeyIds)); - } - - /** - * 获得商品规格键分页 - * - * @param pageDTO 商品规格键分页查询 - * @return 商品规格键分页结果 - */ - @PostMapping("/pageProductAttrKey") - @ApiOperation("获得商品规格键分页") - CommonResult> pageProductAttrKey(@RequestBody ProductAttrKeyPageReqDTO pageDTO){ - return success(productAttrManager.pageProductAttrKey(pageDTO)); - } - - /** - * 创建商品规格值 - * - * @param createDTO 创建商品规格值 DTO - * @return 商品规格值编号 - */ - @PostMapping("/createProductAttrValue") - @ApiOperation("创建商品规格值") - CommonResult createProductAttrValue(@RequestBody ProductAttrValueCreateReqDTO createDTO){ - return success(productAttrManager.createProductAttrValue(createDTO)); - } - - - - /** - * 更新商品规格值 - * - * @param updateDTO 更新商品规格值 DTO - */ - @PostMapping("/updateProductAttrValue") - @ApiOperation("更新商品规格值") - CommonResult updateProductAttrValue(@RequestBody ProductAttrValueUpdateReqDTO updateDTO){ - productAttrManager.updateProductAttrValue(updateDTO); - return success(true); - } - - /** - * 获得商品规格值 - * - * @param productAttrValueId 商品规格值编号 - * @return 商品规格值 - */ - @GetMapping("/getProductAttrValue") - @ApiOperation("获得商品规格值") - CommonResult getProductAttrValue(@RequestParam("productAttrValueId") Integer productAttrValueId){ - return success(productAttrManager.getProductAttrValue(productAttrValueId)); - } - - /** - * 获得商品规格值列表 - * - * @param queryDTO 商品规格值的列表查询条件 DTO - * @return 商品规格值列表 - */ - @PostMapping("/listProductAttrValues") - @ApiOperation("获得商品规格值列表") - CommonResult> listProductAttrValues(@RequestBody ProductAttrValueListQueryReqDTO queryDTO){ - return success(productAttrManager.listProductAttrValues(queryDTO)); - } - -} diff --git a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/controller/ProductSkuController.java b/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/controller/ProductSkuController.java deleted file mode 100644 index 5e3e83782..000000000 --- a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/controller/ProductSkuController.java +++ /dev/null @@ -1,47 +0,0 @@ -package cn.iocoder.mall.productservice.controller; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.productservice.manager.attr.ProductAttrManager; -import cn.iocoder.mall.productservice.manager.sku.ProductSkuManager; -import cn.iocoder.mall.productservice.rpc.attr.dto.*; -import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuListQueryReqDTO; -import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuRespDTO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -import static cn.iocoder.common.framework.vo.CommonResult.success; - -@RestController -@RequestMapping("/product/sku") -@Api("商品sku") -public class ProductSkuController { - @Autowired - private ProductSkuManager productSkuManager; - /** - * 获得商品 SKU - * - * @param productSkuId 商品 SKU 编号 - * @return 商品 SKU - */ - @GetMapping("getProductSku") - CommonResult getProductSku(@RequestParam("productSkuId") Integer productSkuId){ - return success(productSkuManager.getProductSku(productSkuId)); - } - - /** - * 获得商品 SKU 列表 - * - * @param queryReqDTO 商品 SKU 列表的查询请求 DTO - * @return 商品 SKU 列表 - */ - @PostMapping("listProductSkus") - CommonResult> listProductSkus(@RequestBody ProductSkuListQueryReqDTO queryReqDTO){ - return success(productSkuManager.listProductSkus(queryReqDTO)); - } - -} diff --git a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/controller/ProductSpuController.java b/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/controller/ProductSpuController.java deleted file mode 100644 index 89e1f5979..000000000 --- a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/controller/ProductSpuController.java +++ /dev/null @@ -1,73 +0,0 @@ -package cn.iocoder.mall.productservice.controller; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.productservice.manager.spu.ProductSpuManager; -import cn.iocoder.mall.productservice.rpc.spu.dto.*; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; - -import java.util.Collection; -import java.util.List; - -import static cn.iocoder.common.framework.vo.CommonResult.success; - -@RestController -@RequestMapping("/product/spu") -@Api("商品spu") -public class ProductSpuController { - @Autowired - private ProductSpuManager productSpuManager; - - @GetMapping("/get") - @ApiOperation("获得商品 SPU") - @ApiImplicitParam(name = "productSpuId", value = "商品 SPU 编号", required = true) - public CommonResult getProductSpu(@RequestParam(value="productSpuId") Integer productSpuId) { - return success(productSpuManager.getProductSpu(productSpuId)); - } - - @GetMapping("/list") - @ApiOperation("获得商品 SPU 列表") - @ApiImplicitParam(name = "productSpuIds", value = "商品 SPU 编号列表", required = true) - public CommonResult> listProductSpus(@RequestParam("productSpuIds") List productSpuIds) { - return success(productSpuManager.listProductSpus(productSpuIds)); - } - - @PostMapping("/page") - @ApiOperation("获得商品 SPU 分页") - public CommonResult> pageProductSpu(@RequestBody ProductSpuPageReqDTO pageVO) { - // 全部:无搜索条件 - // 在售中:visible = true && hasQuantity = true - // 已售罄:visible = true && hasQuantity = false - // 仓库中:visible = false - return success(productSpuManager.pageProductSpu(pageVO)); - } - - - /** - * 顺序获得商品 SPU 编号数组 - * - * @param lastSpuId 最后一个商品 SPU 编号 - * @param limit 数量 - * @return 商品 SPU 编号数组 - */ - @GetMapping("/lislistProductSpuIdst") - public CommonResult> lislistProductSpuIdst(@RequestParam("lastSpuId")Integer lastSpuId, @RequestParam("limit")Integer limit) { - // 全部:无搜索条件 - // 在售中:visible = true && hasQuantity = true - // 已售罄:visible = true && hasQuantity = false - // 仓库中:visible = false - return success(productSpuManager.listProductSpuIds(lastSpuId, limit)); - } - - - @GetMapping("/getProductSpuDetail") - public CommonResult getProductSpuDetail(@RequestParam("productSpuId") Integer productSpuId,@RequestParam("fields") Collection fields) { - return success(productSpuManager.getProductSpuDetail(productSpuId,fields)); - } -} diff --git a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/convert/sku/ProductSkuConvert.java b/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/convert/sku/ProductSkuConvert.java deleted file mode 100644 index 8ac6df5b0..000000000 --- a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/convert/sku/ProductSkuConvert.java +++ /dev/null @@ -1,78 +0,0 @@ -package cn.iocoder.mall.productservice.convert.sku; - -import cn.iocoder.common.framework.util.CollectionUtils; -import cn.iocoder.common.framework.util.StringUtils; -import cn.iocoder.mall.productservice.dal.mysql.dataobject.sku.ProductSkuDO; -import cn.iocoder.mall.productservice.rpc.attr.dto.ProductAttrKeyValueRespDTO; -import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuListQueryReqDTO; -import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuRespDTO; -import cn.iocoder.mall.productservice.rpc.spu.dto.ProductSpuRespDTO; -import cn.iocoder.mall.productservice.service.attr.bo.ProductAttrKeyValueBO; -import cn.iocoder.mall.productservice.service.sku.bo.ProductSkuBO; -import cn.iocoder.mall.productservice.service.sku.bo.ProductSkuCreateOrUpdateBO; -import cn.iocoder.mall.productservice.service.sku.bo.ProductSkuListQueryBO; -import cn.iocoder.mall.productservice.service.spu.bo.ProductSpuBO; -import org.mapstruct.Mapper; -import org.mapstruct.Mapping; -import org.mapstruct.Named; -import org.mapstruct.factory.Mappers; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -@Mapper -public interface ProductSkuConvert { - - ProductSkuConvert INSTANCE = Mappers.getMapper(ProductSkuConvert.class); - - List convertList(List list); - - @Mapping(source = "attrValueIds", target = "attrs", qualifiedByName = "translatePicUrlsFromStringList") - ProductSkuDO convert(ProductSkuCreateOrUpdateBO bean); - - @Mapping(source = "attrs", target = "attrValueIds", qualifiedByName = "translateAttrValueIdsFromString") - ProductSkuBO convert(ProductSkuDO bean); - - List convertList02(List list); - - ProductSkuRespDTO convert(ProductSkuBO bean); - - ProductSkuListQueryBO convert(ProductSkuListQueryReqDTO bean); - - ProductSpuRespDTO convert(ProductSpuBO bean); - - ProductAttrKeyValueRespDTO convert(ProductAttrKeyValueBO bean); - - default List convertList(List skuBOs, List spuBOs, - List attrBOs) { - // 创建 ProductAttrDetailBO 的映射。其中,KEY 为 ProductAttrDetailBO.attrValueId ,即规格值的编号 - Map attrDetailBOMap = CollectionUtils.convertMap(attrBOs, - ProductAttrKeyValueBO::getAttrValueId); - // 构建 ProductSpuBO 的映射。 - Map spuBOMap = CollectionUtils.convertMap(spuBOs, ProductSpuBO::getId); - // 拼接数据 - List skuRespDTOs = new ArrayList<>(skuBOs.size()); - skuBOs.forEach(skuBO -> { - ProductSkuRespDTO skuRespDTO = convert(skuBO); - skuRespDTOs.add(skuRespDTO); - // 拼接商品 SPU - skuRespDTO.setSpu(convert(spuBOMap.get(skuBO.getSpuId()))); - // 拼接商品 Attr - skuRespDTO.setAttrs(new ArrayList<>()); - skuBO.getAttrValueIds().forEach(attrValueId -> skuRespDTO.getAttrs().add(convert(attrDetailBOMap.get(attrValueId)))); - }); - return skuRespDTOs; - } - - @Named("translateAttrValueIdsFromString") - default List translateAttrValueIdsFromString(String attrValueIdsStar) { - return StringUtils.splitToInt(attrValueIdsStar, ","); - } - - @Named("translateAttrValueIdsFromList") - default String translateAttrValueIdsFromList(List attrValueIds) { - return StringUtils.join(attrValueIds, ","); - } - -} diff --git a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/convert/spu/ProductSpuConvert.java b/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/convert/spu/ProductSpuConvert.java deleted file mode 100644 index 4f694ba7b..000000000 --- a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/convert/spu/ProductSpuConvert.java +++ /dev/null @@ -1,99 +0,0 @@ -package cn.iocoder.mall.productservice.convert.spu; - -import cn.iocoder.common.framework.util.StringUtils; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.productservice.dal.mysql.dataobject.spu.ProductSpuDO; -import cn.iocoder.mall.productservice.rpc.attr.dto.ProductAttrKeyValueRespDTO; -import cn.iocoder.mall.productservice.rpc.spu.dto.*; -import cn.iocoder.mall.productservice.service.attr.bo.ProductAttrKeyValueBO; -import cn.iocoder.mall.productservice.service.category.bo.ProductCategoryBO; -import cn.iocoder.mall.productservice.service.sku.bo.ProductSkuBO; -import cn.iocoder.mall.productservice.service.sku.bo.ProductSkuCreateOrUpdateBO; -import cn.iocoder.mall.productservice.service.spu.bo.ProductSpuBO; -import cn.iocoder.mall.productservice.service.spu.bo.ProductSpuCreateBO; -import cn.iocoder.mall.productservice.service.spu.bo.ProductSpuPageBO; -import cn.iocoder.mall.productservice.service.spu.bo.ProductSpuUpdateBO; -import com.baomidou.mybatisplus.core.metadata.IPage; -import org.mapstruct.Mapper; -import org.mapstruct.Mapping; -import org.mapstruct.Named; -import org.mapstruct.factory.Mappers; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -@Mapper -public interface ProductSpuConvert { - - ProductSpuConvert INSTANCE = Mappers.getMapper(ProductSpuConvert.class); - - @Mapping(source = "picUrls", target = "picUrls", qualifiedByName = "translatePicUrlsFromStringList") - ProductSpuDO convert(ProductSpuCreateBO bean); - - @Mapping(source = "picUrls", target = "picUrls", qualifiedByName = "translatePicUrlsFromString") - ProductSpuBO convert(ProductSpuDO bean); - - @Mapping(source = "picUrls", target = "picUrls", qualifiedByName = "translatePicUrlsFromStringList") - ProductSpuDO convert(ProductSpuUpdateBO bean); - - List convertList(List list); - - @Mapping(source = "records", target = "list") - PageResult convertPage(IPage page); - - ProductSpuCreateBO convert(ProductSpuAndSkuCreateReqDTO bean); - - ProductSpuUpdateBO convert(ProductSpuAndSkuUpdateReqDTO bean); - - ProductSpuRespDTO convert(ProductSpuBO bean); - ProductSpuDetailRespDTO convert2(ProductSpuBO bean); - - List convertList02(List list); - - ProductSpuPageBO convert(ProductSpuPageReqDTO bean); - - PageResult convertPage(PageResult page); - - List convert(List list); - List convert02(List list); - - ProductSpuDetailRespDTO.Sku convert(ProductSkuBO bean); - - ProductAttrKeyValueRespDTO convert(ProductAttrKeyValueBO bean); - - default ProductSpuDetailRespDTO convert(ProductSpuBO spuBO, List skuBOs, - List attrBOs, ProductCategoryBO categoryBO) { - // 创建并转换 ProductSpuDetailBO 对象 - ProductSpuDetailRespDTO spuDetailDTO = this.convert2(spuBO); - // 创建 ProductAttrDetailBO 的映射。其中,KEY 为 ProductAttrDetailBO.attrValueId ,即规格值的编号 - Map attrDetailBOMap = attrBOs.stream().collect( - Collectors.toMap(ProductAttrKeyValueBO::getAttrValueId, attrBO -> attrBO)); - // 创建并转换 ProductSpuDetailBO 数组 - spuDetailDTO.setSkus(new ArrayList<>()); - skuBOs.forEach(skuBO -> { - // 创建 ProductSpuDetailBO 对象 - ProductSpuDetailRespDTO.Sku skuDetail = convert(skuBO).setAttrs(new ArrayList<>()); - spuDetailDTO.getSkus().add(skuDetail); - // 设置 ProductSpuDetailBO 的 attrs 规格属性 - skuBO.getAttrValueIds().forEach(attrValueId -> skuDetail.getAttrs().add(convert(attrDetailBOMap.get(attrValueId)))); - }); - // 设置分类名 - spuDetailDTO.setCategoryName(categoryBO.getName()); - // 返回 - return spuDetailDTO; - } - - @Named("translatePicUrlsFromString") - default List translatePicUrlsFromList(String picUrls) { - return StringUtils.split(picUrls, ","); - } - - @Named("translatePicUrlsFromStringList") - default String translatePicUrlsFromList(List picUrls) { - return StringUtils.join(picUrls, ","); - } - - -} diff --git a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/dal/mysql/mapper/sku/ProductSkuMapper.java b/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/dal/mysql/mapper/sku/ProductSkuMapper.java deleted file mode 100644 index ae5dfae1b..000000000 --- a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/dal/mysql/mapper/sku/ProductSkuMapper.java +++ /dev/null @@ -1,27 +0,0 @@ -package cn.iocoder.mall.productservice.dal.mysql.mapper.sku; - -import cn.iocoder.mall.mybatis.core.query.QueryWrapperX; -import cn.iocoder.mall.productservice.dal.mysql.dataobject.sku.ProductSkuDO; -import cn.iocoder.mall.productservice.service.sku.bo.ProductSkuListQueryBO; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -@Repository -public interface ProductSkuMapper extends BaseMapper { - - default List selectListBySpuIdAndStatus(Integer spuId, Integer status) { - return selectList(new QueryWrapperX().eq("spu_id", spuId) - .eq("status", status)); - } - - default List selectList(ProductSkuListQueryBO queryBO) { - return selectList(new QueryWrapperX().eqIfPresent("id", queryBO.getProductSkuId()) - .inIfPresent("id", queryBO.getProductSkuIds()) - .eqIfPresent("spu_id", queryBO.getProductSpuId()) - .eqIfPresent("status", queryBO.getProductSkuStatus())); - } - -} diff --git a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/dal/mysql/mapper/spu/ProductSpuMapper.java b/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/dal/mysql/mapper/spu/ProductSpuMapper.java deleted file mode 100644 index c2b9a84d9..000000000 --- a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/dal/mysql/mapper/spu/ProductSpuMapper.java +++ /dev/null @@ -1,35 +0,0 @@ -package cn.iocoder.mall.productservice.dal.mysql.mapper.spu; - -import cn.iocoder.mall.mybatis.core.query.QueryWrapperX; -import cn.iocoder.mall.productservice.dal.mysql.dataobject.spu.ProductSpuDO; -import cn.iocoder.mall.productservice.service.spu.bo.ProductSpuPageBO; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import org.springframework.stereotype.Repository; - -import java.util.List; - -@Repository -public interface ProductSpuMapper extends BaseMapper { - - default IPage selectPage(ProductSpuPageBO pageBO) { - QueryWrapperX query = new QueryWrapperX().likeIfPresent("name", pageBO.getName()) - .eqIfPresent("cid", pageBO.getCid()).eqIfPresent("visible", pageBO.getVisible()); - // 库存过滤 - if (pageBO.getHasQuantity() != null) { - if (pageBO.getHasQuantity()) { - query.gt("quantity", 0); - } else { - query.eq("quantity", 0); - } - } - return selectPage(new Page<>(pageBO.getPageNo(), pageBO.getPageSize()), query); - } - - default List selectListByIdGt(Integer id, Integer limit) { - return selectList(new QueryWrapperX().gtIfPresent("id", id) - .orderByAsc("id").last("LIMIT " + limit)); - } - -} diff --git a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/manager/attr/ProductAttrManager.java b/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/manager/attr/ProductAttrManager.java deleted file mode 100644 index 0e4a4ac81..000000000 --- a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/manager/attr/ProductAttrManager.java +++ /dev/null @@ -1,118 +0,0 @@ -package cn.iocoder.mall.productservice.manager.attr; - -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.productservice.convert.attr.ProductAttrConvert; -import cn.iocoder.mall.productservice.rpc.attr.dto.*; -import cn.iocoder.mall.productservice.service.attr.ProductAttrService; -import cn.iocoder.mall.productservice.service.attr.bo.ProductAttrKeyBO; -import cn.iocoder.mall.productservice.service.attr.bo.ProductAttrValueBO; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 商品规格 Manager - */ -@Service -public class ProductAttrManager { - - @Autowired - private ProductAttrService productAttrService; - - /** - * 创建商品规格键 - * - * @param createDTO 创建商品规格键 DTO - * @return 商品规格键 - */ - public Integer createProductAttrKey(ProductAttrKeyCreateReqDTO createDTO) { - ProductAttrKeyBO productAttrKeyBO = productAttrService.createProductAttrKey(ProductAttrConvert.INSTANCE.convert(createDTO)); - return productAttrKeyBO.getId(); - } - - /** - * 更新商品规格键 - * - * @param updateDTO 更新商品规格键 DTO - */ - public void updateProductAttrKey(ProductAttrKeyUpdateReqDTO updateDTO) { - productAttrService.updateProductAttrKey(ProductAttrConvert.INSTANCE.convert(updateDTO)); - } - - /** - * 获得商品规格键 - * - * @param productAttrKeyId 商品规格键编号 - * @return 商品规格键 - */ - public ProductAttrKeyRespDTO getProductAttrKey(Integer productAttrKeyId) { - ProductAttrKeyBO productAttrKeyBO = productAttrService.getProductAttrKey(productAttrKeyId); - return ProductAttrConvert.INSTANCE.convert(productAttrKeyBO); - } - - /** - * 获得商品规格键列表 - * - * @param productAttrKeyIds 商品规格键编号列表 - * @return 商品规格键列表 - */ - public List listProductAttrKeys(List productAttrKeyIds) { - List productAttrKeyBOs = productAttrService.listProductAttrKeys(productAttrKeyIds); - return ProductAttrConvert.INSTANCE.convertList02(productAttrKeyBOs); - } - - /** - * 获得商品规格键分页 - * - * @param pageDTO 商品规格键分页查询 - * @return 商品规格键分页结果 - */ - public PageResult pageProductAttrKey(ProductAttrKeyPageReqDTO pageDTO) { - PageResult pageResultBO = productAttrService.pageProductAttrKey(ProductAttrConvert.INSTANCE.convert(pageDTO)); - return ProductAttrConvert.INSTANCE.convertPage(pageResultBO); - } - - /** - * 创建商品规格值 - * - * @param createDTO 创建商品规格值 DTO - * @return 商品规格值 - */ - public Integer createProductAttrValue(ProductAttrValueCreateReqDTO createDTO) { - ProductAttrValueBO productAttrValueBO = productAttrService.createProductAttrValue(ProductAttrConvert.INSTANCE.convert(createDTO)); - return productAttrValueBO.getId(); - } - - /** - * 更新商品规格值 - * - * @param updateDTO 更新商品规格值 DTO - */ - public void updateProductAttrValue(ProductAttrValueUpdateReqDTO updateDTO) { - productAttrService.updateProductAttrValue(ProductAttrConvert.INSTANCE.convert(updateDTO)); - } - - /** - * 获得商品规格值 - * - * @param productAttrValueId 商品规格值编号 - * @return 商品规格值 - */ - public ProductAttrValueRespDTO getProductAttrValue(Integer productAttrValueId) { - ProductAttrValueBO productAttrValueBO = productAttrService.getProductAttrValue(productAttrValueId); - return ProductAttrConvert.INSTANCE.convert(productAttrValueBO); - } - - /** - * 获得商品规格值列表 - * - * @param queryDTO 商品规格值的列表查询条件 DTO - * @return 商品规格值列表 - */ - public List listProductAttrValues(ProductAttrValueListQueryReqDTO queryDTO) { - List productAttrValueBOs = productAttrService.listProductAttrValues(ProductAttrConvert.INSTANCE.convert(queryDTO)); - return ProductAttrConvert.INSTANCE.convertList04(productAttrValueBOs); - } - -} diff --git a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/manager/sku/ProductSkuManager.java b/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/manager/sku/ProductSkuManager.java deleted file mode 100644 index ffbc6d278..000000000 --- a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/manager/sku/ProductSkuManager.java +++ /dev/null @@ -1,65 +0,0 @@ -package cn.iocoder.mall.productservice.manager.sku; - -import cn.iocoder.common.framework.util.CollectionUtils; -import cn.iocoder.mall.productservice.convert.sku.ProductSkuConvert; -import cn.iocoder.mall.productservice.enums.sku.ProductSkuDetailFieldEnum; -import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuListQueryReqDTO; -import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuRespDTO; -import cn.iocoder.mall.productservice.service.attr.ProductAttrService; -import cn.iocoder.mall.productservice.service.attr.bo.ProductAttrKeyValueBO; -import cn.iocoder.mall.productservice.service.sku.ProductSkuService; -import cn.iocoder.mall.productservice.service.sku.bo.ProductSkuBO; -import cn.iocoder.mall.productservice.service.spu.ProductSpuService; -import cn.iocoder.mall.productservice.service.spu.bo.ProductSpuBO; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -/** - * 商品 SKU Manager - */ -@Service -public class ProductSkuManager { - - @Autowired - private ProductSkuService productSkuService; - @Autowired - private ProductSpuService productSpuService; - @Autowired - private ProductAttrService productAttrService; - - /** - * 获得商品 SKU 列表 - * - * @param queryReqDTO 商品 SKU 列表的查询请求 DTO - * @return 商品 SKU列表 - */ - public List listProductSkus(ProductSkuListQueryReqDTO queryReqDTO) { - // 获得商品 SKU 列表 - List skuBOs = productSkuService.listProductSkus( - ProductSkuConvert.INSTANCE.convert(queryReqDTO)); - if (CollectionUtils.isEmpty(skuBOs)) { - return Collections.emptyList(); - } - // 获得商品 SPU 列表 - List spuBOs = Collections.emptyList(); - if (queryReqDTO.getFields().contains(ProductSkuDetailFieldEnum.SPU.getField())) { - spuBOs = productSpuService.listProductSpus( - CollectionUtils.convertSet(skuBOs, ProductSkuBO::getSpuId)); - } - // 获取商品 SKU 的规格数组 - List attrBOs = Collections.emptyList(); - if (queryReqDTO.getFields().contains(ProductSkuDetailFieldEnum.ATTR.getField())) { - Set attrValueIds = new HashSet<>(); - skuBOs.forEach(sku -> attrValueIds.addAll(sku.getAttrValueIds())); - attrBOs = productAttrService.validProductAttr(attrValueIds, false); // 读取规格时,不考虑规格是否被禁用 - } - // 拼接最终返回 - return ProductSkuConvert.INSTANCE.convertList(skuBOs, spuBOs, attrBOs); - } - -} diff --git a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/manager/spu/ProductSpuManager.java b/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/manager/spu/ProductSpuManager.java deleted file mode 100644 index a0fa80ab0..000000000 --- a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/manager/spu/ProductSpuManager.java +++ /dev/null @@ -1,115 +0,0 @@ -package cn.iocoder.mall.productservice.manager.spu; - -import cn.iocoder.common.framework.enums.CommonStatusEnum; -import cn.iocoder.common.framework.exception.util.ServiceExceptionUtil; -import cn.iocoder.common.framework.util.CollectionUtils; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.productservice.convert.spu.ProductSpuConvert; -import cn.iocoder.mall.productservice.enums.category.ProductCategoryIdEnum; -import cn.iocoder.mall.productservice.enums.spu.ProductSpuDetailFieldEnum; -import cn.iocoder.mall.productservice.mq.producer.ProductMQProducer; -import cn.iocoder.mall.productservice.rpc.spu.dto.*; -import cn.iocoder.mall.productservice.service.attr.ProductAttrService; -import cn.iocoder.mall.productservice.service.attr.bo.ProductAttrKeyValueBO; -import cn.iocoder.mall.productservice.service.category.ProductCategoryService; -import cn.iocoder.mall.productservice.service.category.bo.ProductCategoryBO; -import cn.iocoder.mall.productservice.service.sku.ProductSkuService; -import cn.iocoder.mall.productservice.service.sku.bo.ProductSkuBO; -import cn.iocoder.mall.productservice.service.sku.bo.ProductSkuCreateOrUpdateBO; -import cn.iocoder.mall.productservice.service.sku.bo.ProductSkuListQueryBO; -import cn.iocoder.mall.productservice.service.spu.ProductSpuService; -import cn.iocoder.mall.productservice.service.spu.bo.ProductSpuBO; -import cn.iocoder.mall.productservice.service.spu.bo.ProductSpuCreateBO; -import cn.iocoder.mall.productservice.service.spu.bo.ProductSpuUpdateBO; -import lombok.extern.slf4j.Slf4j; -import org.springframework.aop.framework.AopContext; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.*; -import java.util.stream.Collectors; - -import static cn.iocoder.mall.productservice.enums.ProductErrorCodeConstants.*; - -/** -* 商品 SPU Manager -*/ -@Service -@Slf4j -public class ProductSpuManager { - - @Autowired - private ProductSpuService productSpuService; - @Autowired - private ProductSkuService productSkuService; - @Autowired - private ProductCategoryService productCategoryService; - @Autowired - private ProductAttrService productAttrService; - - @Autowired - private ProductMQProducer productMQProducer; - - /** - * 获得商品 SPU列表 - * - * @param productSpuIds 商品 SPU编号列表 - * @return 商品 SPU列表 - */ - public List listProductSpus(Collection productSpuIds) { - List productSpuBOs = productSpuService.listProductSpus(productSpuIds); - return ProductSpuConvert.INSTANCE.convertList02(productSpuBOs); - } - - /** - * 获得商品 SPU分页 - * - * @param pageDTO 商品 SPU分页查询 - * @return 商品 SPU分页结果 - */ - public PageResult pageProductSpu(ProductSpuPageReqDTO pageDTO) { - PageResult pageResultBO = productSpuService.pageProductSpu(ProductSpuConvert.INSTANCE.convert(pageDTO)); - return ProductSpuConvert.INSTANCE.convertPage(pageResultBO); - } - - /** - * 顺序获得商品 SPU 编号数组 - * - * @param lastSpuId 最后一个商品 SPU 编号 - * @param limit 数量 - * @return 商品 SPU 编号数组 - */ - public List listProductSpuIds(Integer lastSpuId, Integer limit) { - return productSpuService.listProductSpuIds(lastSpuId, limit); - } - - public ProductSpuDetailRespDTO getProductSpuDetail(Integer productSpuId, Collection fields) { - // 获得商品 SPU 信息 - ProductSpuBO spuBO = productSpuService.getProductSpu(productSpuId); - if (spuBO == null) { - throw ServiceExceptionUtil.exception(PRODUCT_SPU_NOT_EXISTS); - } - // 获取商品分类 - ProductCategoryBO categoryBO = productCategoryService.getProductCategory(spuBO.getCid()); - if (categoryBO == null) { - throw ServiceExceptionUtil.exception(PRODUCT_CATEGORY_NOT_EXISTS); - } - // 获得商品 SKU 数组 - List skuBOs = Collections.emptyList(); - if (fields.contains(ProductSpuDetailFieldEnum.SKU.getField())) { - skuBOs = productSkuService.listProductSkus(new ProductSkuListQueryBO().setProductSpuId(productSpuId) - .setProductSkuStatus(CommonStatusEnum.ENABLE.getValue())); - } - // 获取商品 SKU 的规格数组 - List attrBOs = Collections.emptyList(); - if (fields.contains(ProductSpuDetailFieldEnum.ATTR.getField()) && !CollectionUtils.isEmpty(skuBOs)) { - Set attrValueIds = new HashSet<>(); - skuBOs.forEach(sku -> attrValueIds.addAll(sku.getAttrValueIds())); - attrBOs = productAttrService.validProductAttr(attrValueIds, false); // 读取规格时,不考虑规格是否被禁用 - } - // 拼接最终返回 - return ProductSpuConvert.INSTANCE.convert(spuBO, skuBOs, attrBOs, categoryBO); - } - -} diff --git a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/mq/producer/ProductMQProducer.java b/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/mq/producer/ProductMQProducer.java deleted file mode 100644 index 9eb8805ef..000000000 --- a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/mq/producer/ProductMQProducer.java +++ /dev/null @@ -1,30 +0,0 @@ -package cn.iocoder.mall.productservice.mq.producer; - -import cn.iocoder.mall.productservice.mq.producer.message.ProductUpdateMessage; -import lombok.extern.slf4j.Slf4j; -import org.apache.rocketmq.client.producer.SendResult; -import org.apache.rocketmq.client.producer.SendStatus; -import org.apache.rocketmq.spring.core.RocketMQTemplate; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Component -@Slf4j -public class ProductMQProducer { - - @Autowired - private RocketMQTemplate rocketMQTemplate; - - public void sendProductUpdateMessage(Integer id) { - // TODO 芋艿:后续优化下,考虑下一致性 - try { - SendResult sendResult = rocketMQTemplate.syncSend(ProductUpdateMessage.TOPIC, new ProductUpdateMessage().setId(id)); - if (!SendStatus.SEND_OK.equals(sendResult.getSendStatus())) { - log.error("[sendProductUpdateMessage][product({}) 发送更新消息失败,结果为({})]", id, sendResult); - } - } catch (Throwable throwable) { - log.error("[sendProductUpdateMessage][product({}) 发送更新消息失败,发生异常]", id, throwable); - } - } - -} diff --git a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/mq/producer/message/ProductUpdateMessage.java b/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/mq/producer/message/ProductUpdateMessage.java deleted file mode 100644 index 8a40d5c0f..000000000 --- a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/mq/producer/message/ProductUpdateMessage.java +++ /dev/null @@ -1,20 +0,0 @@ -package cn.iocoder.mall.productservice.mq.producer.message; - -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 商品更新(包括创建)消息 - */ -@Data -@Accessors(chain = true) -public class ProductUpdateMessage { - - public static final String TOPIC = "ProductUpdate"; - - /** - * 商品编号 - */ - private Integer id; - -} diff --git a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/ProductAttrService.java b/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/ProductAttrService.java deleted file mode 100644 index 517fa257c..000000000 --- a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/ProductAttrService.java +++ /dev/null @@ -1,211 +0,0 @@ -package cn.iocoder.mall.productservice.service.attr; - -import cn.iocoder.common.framework.enums.CommonStatusEnum; -import cn.iocoder.common.framework.exception.util.ServiceExceptionUtil; -import cn.iocoder.common.framework.util.CollectionUtils; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.productservice.convert.attr.ProductAttrConvert; -import cn.iocoder.mall.productservice.dal.mysql.dataobject.attr.ProductAttrKeyDO; -import cn.iocoder.mall.productservice.dal.mysql.dataobject.attr.ProductAttrValueDO; -import cn.iocoder.mall.productservice.dal.mysql.mapper.attr.ProductAttrKeyMapper; -import cn.iocoder.mall.productservice.dal.mysql.mapper.attr.ProductAttrValueMapper; -import cn.iocoder.mall.productservice.service.attr.bo.*; -import com.baomidou.mybatisplus.core.metadata.IPage; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import javax.validation.Valid; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; - -import static cn.iocoder.mall.productservice.enums.ProductErrorCodeConstants.*; - -/** - * 商品规格 Service - * - * 包括商品键和值 - */ -@Service -@Valid -public class ProductAttrService { - - @Autowired - private ProductAttrKeyMapper productAttrKeyMapper; - @Autowired - private ProductAttrValueMapper productAttrValueMapper; - - public List validProductAttr(Set productAttrValueIds, boolean validStatus) { - // 首先,校验规格 Value - List attrValues = productAttrValueMapper.selectBatchIds(productAttrValueIds); - if (attrValues.size() != productAttrValueIds.size()) { - throw ServiceExceptionUtil.exception(PRODUCT_ATTR_VALUE_NOT_EXIST); - } - if (validStatus) { - for (ProductAttrValueDO attrValue : attrValues) { // 同时,校验下状态 - if (CommonStatusEnum.DISABLE.getValue().equals(attrValue.getStatus())) { - throw ServiceExceptionUtil.exception(PRODUCT_ATTR_VALUE_NOT_EXIST); - } - } - } - // 然后,校验规 Key - Set attrKeyIds = CollectionUtils.convertSet(attrValues, ProductAttrValueDO::getAttrKeyId); - List attrKeys = productAttrKeyMapper.selectBatchIds(attrKeyIds); - if (attrKeys.size() != attrKeyIds.size()) { - throw ServiceExceptionUtil.exception(PRODUCT_ATTR_KEY_NOT_EXIST); - } - if (validStatus) { - for (ProductAttrKeyDO attrKey : attrKeys) { // 同时,校验下状态 - if (CommonStatusEnum.DISABLE.getValue().equals(attrKey.getStatus())) { - throw ServiceExceptionUtil.exception(PRODUCT_ATTR_KEY_NOT_EXIST); - } - } - } - // 返回成功 - Map attrKeyMap = CollectionUtils.convertMap(attrKeys, - ProductAttrKeyDO::getId, attrKeyDO -> attrKeyDO); // ProductAttrDO 的映射,方便查找。 - return attrValues.stream().map(attrValueDO -> new ProductAttrKeyValueBO() - .setAttrKeyId(attrValueDO.getAttrKeyId()).setAttrKeyName(attrKeyMap.get(attrValueDO.getAttrKeyId()).getName()) - .setAttrValueId(attrValueDO.getId()).setAttrValueName(attrValueDO.getName())) - .collect(Collectors.toList()); - } - - /** - * 创建商品规格键 - * - * @param createBO 创建商品规格键 BO - * @return 商品规格键 - */ - public ProductAttrKeyBO createProductAttrKey(@Valid ProductAttrKeyCreateBO createBO) { - // 校验规格键的名字是否重复 - if (productAttrKeyMapper.selectByName(createBO.getName()) != null) { - throw ServiceExceptionUtil.exception(PRODUCT_ATTR_KEY_EXISTS); - } - // 插入到数据库 - ProductAttrKeyDO productAttrKeyDO = ProductAttrConvert.INSTANCE.convert(createBO); - productAttrKeyMapper.insert(productAttrKeyDO); - // 返回 - return ProductAttrConvert.INSTANCE.convert(productAttrKeyDO); - } - - /** - * 更新商品规格键 - * - * @param updateBO 更新商品规格键 BO - */ - public void updateProductAttrKey(@Valid ProductAttrKeyUpdateBO updateBO) { - // 校验规格键的名字是否重复 - ProductAttrKeyDO attrKeyDOByName = productAttrKeyMapper.selectByName(updateBO.getName()); - if (attrKeyDOByName != null && !attrKeyDOByName.getId().equals(updateBO.getId())) { - throw ServiceExceptionUtil.exception(PRODUCT_ATTR_KEY_EXISTS); - } - // 校验更新的商品规格键是否存在 - if (productAttrKeyMapper.selectById(updateBO.getId()) == null) { - throw ServiceExceptionUtil.exception(PRODUCT_ATTR_KEY_NOT_EXIST); - } - // 更新到数据库 - ProductAttrKeyDO updateObject = ProductAttrConvert.INSTANCE.convert(updateBO); - productAttrKeyMapper.updateById(updateObject); - } - - /** - * 获得商品规格键 - * - * @param productAttrKeyId 商品规格键编号 - * @return 商品规格键 - */ - public ProductAttrKeyBO getProductAttrKey(Integer productAttrKeyId) { - ProductAttrKeyDO productAttrKeyDO = productAttrKeyMapper.selectById(productAttrKeyId); - return ProductAttrConvert.INSTANCE.convert(productAttrKeyDO); - } - - /** - * 获得商品规格键列表 - * - * @param productAttrKeyIds 商品规格键编号列表 - * @return 商品规格键列表 - */ - public List listProductAttrKeys(List productAttrKeyIds) { - List productAttrKeyDOs = productAttrKeyMapper.selectBatchIds(productAttrKeyIds); - return ProductAttrConvert.INSTANCE.convertList(productAttrKeyDOs); - } - - /** - * 获得商品规格键分页 - * - * @param pageBO 商品规格键分页查询 - * @return 商品规格键分页结果 - */ - public PageResult pageProductAttrKey(ProductAttrKeyPageBO pageBO) { - IPage productAttrKeyDOPage = productAttrKeyMapper.selectPage(pageBO); - return ProductAttrConvert.INSTANCE.convertPage(productAttrKeyDOPage); - } - - /** - * 创建商品规格值 - * - * @param createBO 创建商品规格值 BO - * @return 商品规格值 - */ - public ProductAttrValueBO createProductAttrValue(@Valid ProductAttrValueCreateBO createBO) { - // 校验规格键是否存在 - if (productAttrKeyMapper.selectById(createBO.getAttrKeyId()) == null) { - throw ServiceExceptionUtil.exception(PRODUCT_ATTR_KEY_NOT_EXIST); - } - // 校验规格值的名字是否重复 - if (productAttrValueMapper.selectByAttrKeyIdAndName(createBO.getAttrKeyId(), createBO.getName()) != null) { - throw ServiceExceptionUtil.exception(PRODUCT_ATTR_VALUE_EXISTS); - } - // 插入到数据库 - ProductAttrValueDO productAttrValueDO = ProductAttrConvert.INSTANCE.convert(createBO); - productAttrValueMapper.insert(productAttrValueDO); - // 返回 - return ProductAttrConvert.INSTANCE.convert(productAttrValueDO); - } - - /** - * 更新商品规格值 - * - * @param updateBO 更新商品规格值 BO - */ - public void updateProductAttrValue(@Valid ProductAttrValueUpdateBO updateBO) { - // 校验更新的商品规格值是否存在 - ProductAttrValueDO attrValueDO = productAttrValueMapper.selectById(updateBO.getId()); - if (attrValueDO == null) { - throw ServiceExceptionUtil.exception(PRODUCT_ATTR_VALUE_NOT_EXIST); - } - // 校验规格值的名字是否重复 - ProductAttrValueDO attrValueDOByName = productAttrValueMapper.selectByAttrKeyIdAndName( - attrValueDO.getAttrKeyId(), updateBO.getName()); - if (attrValueDOByName != null && !attrValueDOByName.getId().equals(updateBO.getId())) { - throw ServiceExceptionUtil.exception(PRODUCT_ATTR_VALUE_EXISTS); - } - // 更新到数据库 - ProductAttrValueDO updateObject = ProductAttrConvert.INSTANCE.convert(updateBO); - productAttrValueMapper.updateById(updateObject); - } - - /** - * 获得商品规格值 - * - * @param productAttrValueId 商品规格值编号 - * @return 商品规格值 - */ - public ProductAttrValueBO getProductAttrValue(Integer productAttrValueId) { - ProductAttrValueDO productAttrValueDO = productAttrValueMapper.selectById(productAttrValueId); - return ProductAttrConvert.INSTANCE.convert(productAttrValueDO); - } - - /** - * 获得商品规格值列表 - * - * @param queryBO 商品规格值的列表查询条件 BO - * @return 商品规格值列表 - */ - public List listProductAttrValues(ProductAttrValueListQueryBO queryBO) { - List productAttrValueDOs = productAttrValueMapper.selectList(queryBO); - return ProductAttrConvert.INSTANCE.convertList03(productAttrValueDOs); - } - -} diff --git a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrKeyBO.java b/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrKeyBO.java deleted file mode 100644 index f43c918bb..000000000 --- a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrKeyBO.java +++ /dev/null @@ -1,32 +0,0 @@ -package cn.iocoder.mall.productservice.service.attr.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.time.LocalDateTime; - -/** - * 商品规格键 BO - */ -@Data -@Accessors(chain = true) -public class ProductAttrKeyBO { - - /** - * 规格键编号 - */ - private Integer id; - /** - * 规格键名称 - */ - private String name; - /** - * 状态 - */ - private Integer status; - /** - * 创建时间 - */ - private LocalDateTime createTime; - -} diff --git a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrKeyCreateBO.java b/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrKeyCreateBO.java deleted file mode 100644 index 0dc28ed9b..000000000 --- a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrKeyCreateBO.java +++ /dev/null @@ -1,30 +0,0 @@ -package cn.iocoder.mall.productservice.service.attr.bo; - -import cn.iocoder.common.framework.enums.CommonStatusEnum; -import cn.iocoder.common.framework.validator.InEnum; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; - -/** - * 商品规格键创建 BO - */ -@Data -@Accessors(chain = true) -public class ProductAttrKeyCreateBO { - - /** - * 规格键名称 - */ - @NotEmpty(message = "规格键名称不能为空") - private String name; - /** - * 状态 - */ - @NotNull(message = "状态不能为空") - @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") - private Integer status; - -} diff --git a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrKeyPageBO.java b/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrKeyPageBO.java deleted file mode 100644 index 9a5a41194..000000000 --- a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrKeyPageBO.java +++ /dev/null @@ -1,25 +0,0 @@ -package cn.iocoder.mall.productservice.service.attr.bo; - -import cn.iocoder.common.framework.vo.PageParam; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - * 商品规格键分页 BO - */ -@Data -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -public class ProductAttrKeyPageBO extends PageParam { - - /** - * 规格键名称,模糊匹配 - */ - private String name; - /** - * 状态 - */ - private Integer status; - -} diff --git a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrKeyUpdateBO.java b/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrKeyUpdateBO.java deleted file mode 100644 index 5992e0c36..000000000 --- a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrKeyUpdateBO.java +++ /dev/null @@ -1,35 +0,0 @@ -package cn.iocoder.mall.productservice.service.attr.bo; - -import cn.iocoder.common.framework.enums.CommonStatusEnum; -import cn.iocoder.common.framework.validator.InEnum; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; - -/** - * 商品规格键更新 BO - */ -@Data -@Accessors(chain = true) -public class ProductAttrKeyUpdateBO { - - /** - * 规格键编号 - */ - @NotNull(message = "规格键编号不能为空") - private Integer id; - /** - * 规格键名称 - */ - @NotEmpty(message = "规格键名称不能为空") - private String name; - /** - * 状态 - */ - @NotNull(message = "状态不能为空") - @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") - private Integer status; - -} diff --git a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrKeyValueBO.java b/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrKeyValueBO.java deleted file mode 100644 index 12c8b88c0..000000000 --- a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrKeyValueBO.java +++ /dev/null @@ -1,32 +0,0 @@ -package cn.iocoder.mall.productservice.service.attr.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * 商品规格键值对 BO - */ -@Data -@Accessors(chain = true) -public class ProductAttrKeyValueBO implements Serializable { - - /** - * 规格 Key 编号 - */ - private Integer attrKeyId; - /** - * 规格 Key 名字 - */ - private String attrKeyName; - /** - * 规格 Value 编号 - */ - private Integer attrValueId; - /** - * 规格 Value 名字 - */ - private String attrValueName; - -} diff --git a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrValueBO.java b/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrValueBO.java deleted file mode 100644 index fcf61029c..000000000 --- a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrValueBO.java +++ /dev/null @@ -1,36 +0,0 @@ -package cn.iocoder.mall.productservice.service.attr.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.time.LocalDateTime; - -/** - * 商品规格值 BO - */ -@Data -@Accessors(chain = true) -public class ProductAttrValueBO { - - /** - * 规格值编号 - */ - private Integer id; - /** - * 规格键编号 - */ - private Integer attrKeyId; - /** - * 规格值名字 - */ - private String name; - /** - * 状态 - */ - private Integer status; - /** - * 创建时间 - */ - private LocalDateTime createTime; - -} diff --git a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrValueCreateBO.java b/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrValueCreateBO.java deleted file mode 100644 index d9dfda20e..000000000 --- a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrValueCreateBO.java +++ /dev/null @@ -1,35 +0,0 @@ -package cn.iocoder.mall.productservice.service.attr.bo; - -import cn.iocoder.common.framework.enums.CommonStatusEnum; -import cn.iocoder.common.framework.validator.InEnum; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; - -/** - * 商品规格值创建 BO - */ -@Data -@Accessors(chain = true) -public class ProductAttrValueCreateBO { - - /** - * 规格键编号 - */ - @NotNull(message = "规格键编号不能为空") - private Integer attrKeyId; - /** - * 规格值名字 - */ - @NotEmpty(message = "规格值名字不能为空") - private String name; - /** - * 状态 - */ - @NotNull(message = "状态") - @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") - private Integer status; - -} diff --git a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrValueListQueryBO.java b/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrValueListQueryBO.java deleted file mode 100644 index 9f5d3d614..000000000 --- a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrValueListQueryBO.java +++ /dev/null @@ -1,25 +0,0 @@ -package cn.iocoder.mall.productservice.service.attr.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.List; - -/** - * 商品规格值的列表查询条件 BO - */ -@Data -@Accessors(chain = true) -public class ProductAttrValueListQueryBO { - - /** - * 商品规格值编号列表 - */ - private List productAttrValueIds; - - /** - * 商品规格键编号 - */ - private Integer productAttrKeyId; - -} diff --git a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrValueUpdateBO.java b/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrValueUpdateBO.java deleted file mode 100644 index f0c0f2886..000000000 --- a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/attr/bo/ProductAttrValueUpdateBO.java +++ /dev/null @@ -1,41 +0,0 @@ -package cn.iocoder.mall.productservice.service.attr.bo; - - -import cn.iocoder.common.framework.enums.CommonStatusEnum; -import cn.iocoder.common.framework.validator.InEnum; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; - -/** - * 商品规格值更新 BO - */ -@Data -@Accessors(chain = true) -public class ProductAttrValueUpdateBO { - - /** - * 规格值编号 - */ - @NotNull(message = "规格值编号不能为空") - private Integer id; - /** - * 规格键编号 - */ - @NotNull(message = "规格键编号不能为空") - private Integer attrKeyId; - /** - * 规格值名字 - */ - @NotEmpty(message = "规格值名字不能为空") - private String name; - /** - * 状态 - */ - @NotNull(message = "状态") - @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") - private Integer status; - -} diff --git a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/sku/ProductSkuService.java b/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/sku/ProductSkuService.java deleted file mode 100644 index 70cf1a2e7..000000000 --- a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/sku/ProductSkuService.java +++ /dev/null @@ -1,60 +0,0 @@ -package cn.iocoder.mall.productservice.service.sku; - -import cn.iocoder.common.framework.enums.CommonStatusEnum; -import cn.iocoder.common.framework.util.CollectionUtils; -import cn.iocoder.common.framework.util.StringUtils; -import cn.iocoder.mall.productservice.convert.sku.ProductSkuConvert; -import cn.iocoder.mall.productservice.dal.mysql.dataobject.sku.ProductSkuDO; -import cn.iocoder.mall.productservice.dal.mysql.mapper.sku.ProductSkuMapper; -import cn.iocoder.mall.productservice.service.sku.bo.ProductSkuBO; -import cn.iocoder.mall.productservice.service.sku.bo.ProductSkuCreateOrUpdateBO; -import cn.iocoder.mall.productservice.service.sku.bo.ProductSkuListQueryBO; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.*; -import java.util.stream.Collectors; - -@Service -public class ProductSkuService { - - @Autowired - private ProductSkuMapper productSkuMapper; - - /** - * 获得 sku 数组中,指定规格的 sku - * - * @param attrValueIds 指定规格 Value 的编号数组 - * @param skus sku 数组 - * @return 符合条件的 sku - */ - private ProductSkuDO findProductSku(Collection attrValueIds, List skus) { - if (CollectionUtils.isEmpty(skus)) { - return null; - } - // 创建成 Set ,方便后面比较 - attrValueIds = new HashSet<>(attrValueIds); - for (ProductSkuDO sku : skus) { - Set skuAttrValueIds = StringUtils.split(sku.getAttrs(), ",") - .stream().map(Integer::parseInt).collect(Collectors.toSet()); - if (attrValueIds.equals(skuAttrValueIds)) { - return sku; - } - } - return null; - } - - /** - * 获得商品 SKU 列表 - * - * @param queryBO 商品 SKU 列表查询条件 BO - * @return 商品 SKU 列表 - */ - public List listProductSkus(ProductSkuListQueryBO queryBO) { - // TODO FROM 芋艿:可能要考虑下,是不是要必须传递条件 - List productSkuDOs = productSkuMapper.selectList(queryBO); - return ProductSkuConvert.INSTANCE.convertList02(productSkuDOs); - } - -} diff --git a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/sku/bo/ProductSkuCreateOrUpdateBO.java b/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/sku/bo/ProductSkuCreateOrUpdateBO.java deleted file mode 100644 index 7a6c7edbe..000000000 --- a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/sku/bo/ProductSkuCreateOrUpdateBO.java +++ /dev/null @@ -1,37 +0,0 @@ -package cn.iocoder.mall.productservice.service.sku.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; -import java.util.List; - -/** - * 商品 SKU 创建或者修改 BO - * - * 注意,目前该对象是搭配 {@link} - */ -@Data -@Accessors(chain = true) -public class ProductSkuCreateOrUpdateBO { - - /** - * 规格值数组 - */ - @NotNull(message = "规格值数组不能为空") - private List attrValueIds; - /** - * 价格,单位:分 - */ - @NotNull(message = "价格不能为空") - @Min(value = 1L, message = "最小价格为 1") - private Integer price; - /** - * 库存数量 - */ - @NotNull(message = "库存数量不能为空") - @Min(value = 1L, message = "最小库存为 1") - private Integer quantity; - -} diff --git a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/sku/bo/ProductSkuListQueryBO.java b/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/sku/bo/ProductSkuListQueryBO.java deleted file mode 100644 index c7e2c67ce..000000000 --- a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/sku/bo/ProductSkuListQueryBO.java +++ /dev/null @@ -1,32 +0,0 @@ -package cn.iocoder.mall.productservice.service.sku.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.Collection; - -/** - * 商品 SKU 列表查询 BO - */ -@Data -@Accessors(chain = true) -public class ProductSkuListQueryBO { - - /** - * 商品 SKU 编号 - */ - private Integer productSkuId; - /** - * 商品 SKU 编号数组 - */ - private Collection productSkuIds; - /** - * 商品 SPU 编号 - */ - private Integer productSpuId; - /** - * 商品 SKU 状态 - */ - private Integer productSkuStatus; - -} diff --git a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/spu/bo/ProductSpuPageBO.java b/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/spu/bo/ProductSpuPageBO.java deleted file mode 100644 index 0a0bf23a3..000000000 --- a/归档/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/service/spu/bo/ProductSpuPageBO.java +++ /dev/null @@ -1,33 +0,0 @@ -package cn.iocoder.mall.productservice.service.spu.bo; - -import cn.iocoder.common.framework.vo.PageParam; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** -* 商品 SPU 分页 BO -*/ -@Data -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -public class ProductSpuPageBO extends PageParam { - - /** - * SPU 名字 - */ - private String name; - /** - * 分类编号 - */ - private Integer cid; - /** - * 是否可见 - */ - private Boolean visible; - /** - * 是否有库存 - */ - private Boolean hasQuantity; - -} diff --git a/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/enums/PromotionErrorCodeConstants.java b/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/enums/PromotionErrorCodeConstants.java deleted file mode 100644 index 24cfb762e..000000000 --- a/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/enums/PromotionErrorCodeConstants.java +++ /dev/null @@ -1,22 +0,0 @@ -package cn.iocoder.mall.promotion.api.enums; - -import cn.iocoder.common.framework.exception.ErrorCode; - -/** - * 错误码枚举类 - * - * 营销系统,使用 1-006-000-000 段 - */ -public interface PromotionErrorCodeConstants { - - // ========== COUPON TEMPLATE 模块 ========== - ErrorCode COUPON_TEMPLATE_NOT_EXISTS = new ErrorCode(1006002000, "优惠劵模板(码)不存在"); - ErrorCode COUPON_TEMPLATE_STATUS_NOT_ENABLE = new ErrorCode(1006002004, "优惠劵模板(码)未开启"); - ErrorCode COUPON_TEMPLATE_TOTAL_NOT_ENOUGH = new ErrorCode(1006002005, "优惠劵(码)模板的发放量不足"); - ErrorCode COUPON_TEMPLATE_CARD_ADD_EXCEED_QUOTA = new ErrorCode(1006002006, "优惠劵领取到达上限"); - - // ========== COUPON CARD 模块 ========== - ErrorCode COUPON_CARD_NOT_EXISTS = new ErrorCode(1006003000, "优惠劵不存在"); - ErrorCode COUPON_CARD_STATUS_NOT_USED = new ErrorCode( 1006003004, "优惠劵不处于已使用状态"); - -} diff --git a/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/coupon/CouponCardFeign.java b/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/coupon/CouponCardFeign.java deleted file mode 100644 index 118a4c149..000000000 --- a/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/coupon/CouponCardFeign.java +++ /dev/null @@ -1,24 +0,0 @@ -package cn.iocoder.mall.promotion.api.rpc.coupon; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.promotion.api.rpc.coupon.dto.card.*; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; - -import java.util.List; - -@FeignClient("promotion-service") -public interface CouponCardFeign { - - @PostMapping("/coupon/card/pageCouponCard") - public CommonResult> pageCouponCard(@RequestBody CouponCardPageReqDTO pageReqDTO) ; - - @PostMapping("/coupon/card/createCouponCard") - public CommonResult createCouponCard(@RequestBody CouponCardCreateReqDTO createReqDTO); - - @PostMapping("/coupon/card/cancelUseCouponCard") - public CommonResult cancelUseCouponCard(@RequestBody CouponCardCancelUseReqDTO cancelUseReqDTO) ; - -} diff --git a/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/coupon/dto/card/CouponCardCancelUseReqDTO.java b/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/coupon/dto/card/CouponCardCancelUseReqDTO.java deleted file mode 100644 index 987f43d22..000000000 --- a/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/coupon/dto/card/CouponCardCancelUseReqDTO.java +++ /dev/null @@ -1,27 +0,0 @@ -package cn.iocoder.mall.promotion.api.rpc.coupon.dto.card; - -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; -import java.io.Serializable; - -/** - * 优惠劵取消使用 Request DTO - */ -@Data -@Accessors(chain = true) -public class CouponCardCancelUseReqDTO implements Serializable { - - /** - * 用户编号 - */ - @NotNull(message = "用户编号不能为空") - private Integer userId; - /** - * 优惠劵编号 - */ - @NotNull(message = "优惠劵编号不能为空") - private Integer couponCardId; - -} diff --git a/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/coupon/dto/card/CouponCardRespDTO.java b/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/coupon/dto/card/CouponCardRespDTO.java deleted file mode 100644 index bfa3ab7f3..000000000 --- a/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/coupon/dto/card/CouponCardRespDTO.java +++ /dev/null @@ -1,110 +0,0 @@ -package cn.iocoder.mall.promotion.api.rpc.coupon.dto.card; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 优惠劵 Response DTO - */ -@Data -@Accessors(chain = true) -public class CouponCardRespDTO implements Serializable { - - // ========== 基本信息 BEGIN ========== - /** - * 优惠劵编号 - */ - private Integer id; - /** - * 优惠劵(码)分组编号 - */ - private Integer templateId; - /** - * 优惠劵名 - */ - private String title; -// /** -// * 核销码 -// */ -// private String verifyCode; - /** - * 优惠码状态 - * - * 1-未使用 - * 2-已使用 - * 3-已失效 - */ - private Integer status; - - // ========== 基本信息 END ========== - - // ========== 领取情况 BEGIN ========== - /** - * 用户编号 - */ - private Integer userId; - /** - * 领取类型 - * - * 1 - 用户主动领取 - * 2 - 后台自动发放 - */ - private Integer takeType; - // ========== 领取情况 END ========== - - // ========== 使用规则 BEGIN ========== - /** - * 是否设置满多少金额可用,单位:分 - */ - private Integer priceAvailable; - /** - * 生效开始时间 - */ - private LocalDateTime validStartTime; - /** - * 生效结束时间 - */ - private LocalDateTime validEndTime; - // ========== 使用规则 END ========== - - // ========== 使用效果 BEGIN ========== - /** - * 优惠类型 - * - * 1-代金卷 - * 2-折扣卷 - */ - private Integer preferentialType; - /** - * 折扣 - */ - private Integer percentOff; - /** - * 优惠金额,单位:分。 - */ - private Integer priceOff; - /** - * 折扣上限,仅在 {@link #preferentialType} 等于 2 时生效。 - * - * 例如,折扣上限为 20 元,当使用 8 折优惠券,订单金额为 1000 元时,最高只可折扣 20 元,而非 80 元。 - */ - private Integer discountPriceLimit; - // ========== 使用效果 END ========== - - // ========== 使用情况 BEGIN ========== - /** - * 使用时间 - */ - private LocalDateTime usedTime; - - // ========== 使用情况 END ========== - - /** - * 创建时间 - */ - private LocalDateTime createTime; - -} diff --git a/归档/promotion-service-project/promotion-service-app/src/main/java/cn/iocoder/mall/promotionservice/controller/CouponCardController.java b/归档/promotion-service-project/promotion-service-app/src/main/java/cn/iocoder/mall/promotionservice/controller/CouponCardController.java deleted file mode 100644 index fa9d0d95f..000000000 --- a/归档/promotion-service-project/promotion-service-app/src/main/java/cn/iocoder/mall/promotionservice/controller/CouponCardController.java +++ /dev/null @@ -1,55 +0,0 @@ -package cn.iocoder.mall.promotionservice.controller; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.promotion.api.rpc.coupon.dto.card.*; -import cn.iocoder.mall.promotionservice.manager.coupon.CouponCardManager; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -import static cn.iocoder.common.framework.vo.CommonResult.success; - -/** - * Title: - * Description: - * - * @author zhuyang - * @version 1.0 2021/10/9 - */ -@RestController -@RequestMapping("/coupon/card") -public class CouponCardController { - - @Autowired - private CouponCardManager couponCardManager; - - @PostMapping("pageCouponCard") - public CommonResult> pageCouponCard(@RequestBody CouponCardPageReqDTO pageReqDTO) { - return success(couponCardManager.pageCouponCard(pageReqDTO)); - } - - @PostMapping("createCouponCard") - public CommonResult createCouponCard(@RequestBody CouponCardCreateReqDTO createReqDTO) { - return success(couponCardManager.createCouponCard(createReqDTO)); - } - - @PostMapping("useCouponCard") - public CommonResult useCouponCard(@RequestBody CouponCardUseReqDTO useReqDTO) { - return success(couponCardManager.useCouponCard(useReqDTO)); - } - - @PostMapping("cancelUseCouponCard") - public CommonResult cancelUseCouponCard(@RequestBody CouponCardCancelUseReqDTO cancelUseReqDTO) { - return success(couponCardManager.cancelUseCouponCard(cancelUseReqDTO)); - } - - @PostMapping("listAvailableCouponCards") - public CommonResult> listAvailableCouponCards(@RequestBody CouponCardAvailableListReqDTO listReqDTO) { - return success(couponCardManager.listAvailableCouponCards(listReqDTO)); - } -} diff --git a/归档/promotion-service-project/promotion-service-app/src/main/java/cn/iocoder/mall/promotionservice/dal/mysql/mapper/coupon/CouponCardMapper.java b/归档/promotion-service-project/promotion-service-app/src/main/java/cn/iocoder/mall/promotionservice/dal/mysql/mapper/coupon/CouponCardMapper.java deleted file mode 100644 index 63158619d..000000000 --- a/归档/promotion-service-project/promotion-service-app/src/main/java/cn/iocoder/mall/promotionservice/dal/mysql/mapper/coupon/CouponCardMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -package cn.iocoder.mall.promotionservice.dal.mysql.mapper.coupon; - -import cn.iocoder.mall.mybatis.core.query.QueryWrapperX; -import cn.iocoder.mall.promotion.api.rpc.coupon.dto.card.CouponCardPageReqDTO; -import cn.iocoder.mall.promotionservice.dal.mysql.dataobject.coupon.CouponCardDO; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import org.springframework.stereotype.Repository; - -import java.util.List; - -@Repository -public interface CouponCardMapper extends BaseMapper { - - default List selectListByUserIdAndStatus(Integer userId, Integer status) { - return selectList(new QueryWrapper().eq("user_id", userId) - .eq("status", status)); - } - - default IPage selectPage(CouponCardPageReqDTO pageReqDTO) { - return selectPage(new Page<>(pageReqDTO.getPageNo(), pageReqDTO.getPageSize()), - new QueryWrapperX().eqIfPresent("user_id", pageReqDTO.getUserId()) - .eqIfPresent("status", pageReqDTO.getStatus())); - } - -} diff --git a/归档/promotion-service-project/promotion-service-app/src/main/java/cn/iocoder/mall/promotionservice/dal/mysql/mapper/coupon/CouponTemplateMapper.java b/归档/promotion-service-project/promotion-service-app/src/main/java/cn/iocoder/mall/promotionservice/dal/mysql/mapper/coupon/CouponTemplateMapper.java deleted file mode 100644 index 32a0e6f7e..000000000 --- a/归档/promotion-service-project/promotion-service-app/src/main/java/cn/iocoder/mall/promotionservice/dal/mysql/mapper/coupon/CouponTemplateMapper.java +++ /dev/null @@ -1,25 +0,0 @@ -package cn.iocoder.mall.promotionservice.dal.mysql.mapper.coupon; - -import cn.iocoder.mall.mybatis.core.query.QueryWrapperX; -import cn.iocoder.mall.promotion.api.rpc.coupon.dto.template.CouponTemplatePageReqDTO; -import cn.iocoder.mall.promotionservice.dal.mysql.dataobject.coupon.CouponTemplateDO; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -@Repository -public interface CouponTemplateMapper extends BaseMapper { - - /** - * 更新优惠劵模板已领取的数量 - * - * 如果超过领取上限,则返回 0 - * - * @param id 优惠劵模板编号 - * @return 更新数量 - */ - int updateStatFetchNumIncr(@Param("id") Integer id); - -} diff --git a/归档/promotion-service-project/promotion-service-app/src/main/java/cn/iocoder/mall/promotionservice/service/activity/PromotionActivityService.java b/归档/promotion-service-project/promotion-service-app/src/main/java/cn/iocoder/mall/promotionservice/service/activity/PromotionActivityService.java deleted file mode 100644 index 36d4f9d9c..000000000 --- a/归档/promotion-service-project/promotion-service-app/src/main/java/cn/iocoder/mall/promotionservice/service/activity/PromotionActivityService.java +++ /dev/null @@ -1,93 +0,0 @@ -package cn.iocoder.mall.promotionservice.service.activity; - -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.promotion.api.enums.RangeTypeEnum; -import cn.iocoder.mall.promotion.api.enums.activity.PromotionActivityTypeEnum; -import cn.iocoder.mall.promotion.api.rpc.activity.dto.PromotionActivityListReqDTO; -import cn.iocoder.mall.promotion.api.rpc.activity.dto.PromotionActivityPageReqDTO; -import cn.iocoder.mall.promotion.api.rpc.activity.dto.PromotionActivityRespDTO; -import cn.iocoder.mall.promotionservice.convert.activity.PromotionActivityConvert; -import cn.iocoder.mall.promotionservice.dal.mysql.dataobject.activity.PromotionActivityDO; -import cn.iocoder.mall.promotionservice.dal.mysql.mapper.activity.PromotionActivityMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.Assert; -import org.springframework.validation.annotation.Validated; - -import java.util.Collection; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - - -@Service -@Validated -public class PromotionActivityService { - - @Autowired - private PromotionActivityMapper promotionActivityMapper; - - public List listPromotionActivities(PromotionActivityListReqDTO listReqDTO) { - List activityList = promotionActivityMapper.selectList(listReqDTO); - return PromotionActivityConvert.INSTANCE.convertList(activityList); - } - - public List listPromotionActivitiesBySpuIds(Collection spuIds, Collection activityStatuses) { - if (spuIds.isEmpty() || activityStatuses.isEmpty()) { - return Collections.emptyList(); - } - // 查询指定状态的促销活动 - List activityList = promotionActivityMapper.selectListByStatus(activityStatuses); - if (activityList.isEmpty()) { - return Collections.emptyList(); - } - // 匹配商品 - for (Iterator iterator = activityList.iterator(); iterator.hasNext();) { - PromotionActivityDO activity = iterator.next(); - boolean matched = false; - for (Integer spuId : spuIds) { - if (PromotionActivityTypeEnum.TIME_LIMITED_DISCOUNT.getValue().equals(activity.getActivityType())) { - matched = isSpuMatchTimeLimitDiscount(spuId, activity); - } else if (PromotionActivityTypeEnum.FULL_PRIVILEGE.getValue().equals(activity.getActivityType())) { - matched = isSpuMatchFullPrivilege(spuId, activity); - } - if (matched) { - break; - } - } - // 不匹配,则进行移除 - if (!matched) { - iterator.remove(); - } else { // 匹配,则做一些后续的处理 - // 如果是限时折扣,移除不在 spuId 数组中的折扣规则 - if (PromotionActivityTypeEnum.TIME_LIMITED_DISCOUNT.getValue().equals(activity.getActivityType())) { - activity.getTimeLimitedDiscount().getItems().removeIf(item -> !spuIds.contains(item.getSpuId())); - } - } - } - // 返回最终结果 - return PromotionActivityConvert.INSTANCE.convertList(activityList); - } - - private boolean isSpuMatchTimeLimitDiscount(Integer spuId, PromotionActivityDO activity) { - Assert.isTrue(PromotionActivityTypeEnum.TIME_LIMITED_DISCOUNT.getValue().equals(activity.getActivityType()), - "传入的必须的促销活动必须是限时折扣"); - return activity.getTimeLimitedDiscount().getItems().stream() - .anyMatch(item -> spuId.equals(item.getSpuId())); - } - - private boolean isSpuMatchFullPrivilege(Integer spuId, PromotionActivityDO activity) { - Assert.isTrue(PromotionActivityTypeEnum.FULL_PRIVILEGE.getValue().equals(activity.getActivityType()), - "传入的必须的促销活动必须是满减送"); - PromotionActivityDO.FullPrivilege fullPrivilege = activity.getFullPrivilege(); - if (RangeTypeEnum.ALL.getValue().equals(fullPrivilege.getRangeType())) { - return true; - } else if (RangeTypeEnum.PRODUCT_INCLUDE_PART.getValue().equals(fullPrivilege.getRangeType())) { - return fullPrivilege.getRangeValues().contains(spuId); - } else { - throw new IllegalArgumentException(String.format("促销活动(%s) 可用范围的类型是不正确", activity.toString())); - } - } - -} diff --git a/归档/promotion-service-project/promotion-service-app/src/main/java/cn/iocoder/mall/promotionservice/service/coupon/CouponCardService.java b/归档/promotion-service-project/promotion-service-app/src/main/java/cn/iocoder/mall/promotionservice/service/coupon/CouponCardService.java deleted file mode 100644 index 1f8fad518..000000000 --- a/归档/promotion-service-project/promotion-service-app/src/main/java/cn/iocoder/mall/promotionservice/service/coupon/CouponCardService.java +++ /dev/null @@ -1,160 +0,0 @@ -package cn.iocoder.mall.promotionservice.service.coupon; - -import cn.iocoder.common.framework.exception.util.ServiceExceptionUtil; -import cn.iocoder.common.framework.util.CollectionUtils; -import cn.iocoder.common.framework.util.DateUtil; -import cn.iocoder.common.framework.util.StringUtils; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.promotion.api.enums.PromotionErrorCodeConstants; -import cn.iocoder.mall.promotion.api.enums.RangeTypeEnum; -import cn.iocoder.mall.promotion.api.enums.coupon.card.CouponCardStatusEnum; -import cn.iocoder.mall.promotion.api.enums.coupon.card.CouponCardTakeTypeEnum; -import cn.iocoder.mall.promotion.api.enums.coupon.template.CouponTemplateDateTypeEnum; -import cn.iocoder.mall.promotion.api.enums.coupon.template.CouponTemplateStatusEnum; -import cn.iocoder.mall.promotion.api.enums.coupon.template.CouponTemplateTypeEnum; -import cn.iocoder.mall.promotion.api.rpc.coupon.dto.card.CouponCardAvailableListReqDTO; -import cn.iocoder.mall.promotion.api.rpc.coupon.dto.card.CouponCardAvailableRespDTO; -import cn.iocoder.mall.promotion.api.rpc.coupon.dto.card.CouponCardPageReqDTO; -import cn.iocoder.mall.promotion.api.rpc.coupon.dto.card.CouponCardRespDTO; -import cn.iocoder.mall.promotionservice.convert.coupon.CouponCardConvert; -import cn.iocoder.mall.promotionservice.dal.mysql.dataobject.coupon.CouponCardDO; -import cn.iocoder.mall.promotionservice.dal.mysql.dataobject.coupon.CouponTemplateDO; -import cn.iocoder.mall.promotionservice.dal.mysql.mapper.coupon.CouponCardMapper; -import cn.iocoder.mall.promotionservice.dal.mysql.mapper.coupon.CouponTemplateMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.annotation.Validated; - -import java.util.*; -import java.util.stream.Collectors; - -/** - * 优惠劵 Service - */ -@Service -@Validated -public class CouponCardService { - - /** - * 获得用户的优惠劵 - * - * @param userId 用户编号 - * @param couponCardId 优惠劵编号 - * @return 优惠劵 - */ - public CouponCardRespDTO getCouponCard(Integer userId, Integer couponCardId) { - CouponCardDO card = couponCardMapper.selectById(couponCardId); - if (card == null) { - return null; - } - if (!Objects.equals(userId, card.getUserId())) { - return null; - } - return CouponCardConvert.INSTANCE.convert(card); - } - - /** - * 获得优惠劵分页 - * - * @param pageReqDTO 优惠劵分页查询 - * @return 优惠劵分页结果 - */ - public PageResult pageCouponCard(CouponCardPageReqDTO pageReqDTO) { - IPage couponCardDOPage = couponCardMapper.selectPage(pageReqDTO); - return CouponCardConvert.INSTANCE.convertPage(couponCardDOPage); - } - - /** - * 给用户添加优惠劵 - * - * @param userId 用户编号 - * @param couponTemplateId 优惠劵模板编号 - * @return 优惠劵编号 - */ - @Transactional - public Integer createCouponCard(Integer userId, Integer couponTemplateId) { - // 校验 CouponCardTemplate 存在 - CouponTemplateDO template = couponTemplateMapper.selectById(couponTemplateId); - if (template == null) { - throw ServiceExceptionUtil.exception(PromotionErrorCodeConstants.COUPON_TEMPLATE_NOT_EXISTS.getCode()); - } - // 校验 CouponCardTemplate 是 CARD - if (!CouponTemplateTypeEnum.CARD.getValue().equals(template.getType())) { - throw ServiceExceptionUtil.exception(PromotionErrorCodeConstants.COUPON_TEMPLATE_NOT_CARD.getCode()); - } - // 校验 CouponCardTemplate 状态是否开启 - if (!CouponTemplateStatusEnum.ENABLE.getValue().equals(template.getStatus())) { - throw ServiceExceptionUtil.exception(PromotionErrorCodeConstants.COUPON_TEMPLATE_STATUS_NOT_ENABLE.getCode()); - } - // 校验 CouponCardTemplate 是否到达可领取的上限 - if (template.getStatFetchNum() > template.getTotal()) { - throw ServiceExceptionUtil.exception(PromotionErrorCodeConstants.COUPON_TEMPLATE_TOTAL_NOT_ENOUGH.getCode()); - } - // 校验单人可领取优惠劵是否到达上限 - if (couponCardMapper.selectCountByUserIdAndTemplateId(userId, couponTemplateId) > template.getQuota()) { - throw ServiceExceptionUtil.exception(PromotionErrorCodeConstants.COUPON_TEMPLATE_CARD_ADD_EXCEED_QUOTA.getCode()); - } - // 增加优惠劵已领取量 - int updateTemplateCount = couponTemplateMapper.updateStatFetchNumIncr(couponTemplateId); - if (updateTemplateCount == 0) { // 超过 CouponCardTemplate 发放量 - throw ServiceExceptionUtil.exception(PromotionErrorCodeConstants.COUPON_TEMPLATE_CARD_ADD_EXCEED_QUOTA.getCode()); - } - // 创建优惠劵 - // 1. 基本信息 + 领取情况 - CouponCardDO card = new CouponCardDO() - .setTemplateId(couponTemplateId) - .setTitle(template.getTitle()) - .setStatus(CouponCardStatusEnum.UNUSED.getValue()) - .setUserId(userId) - .setTakeType(CouponCardTakeTypeEnum.BY_USER.getValue()); // TODO 需要改 - // 2. 使用规则 - card.setPriceAvailable(template.getPriceAvailable()); - setCouponCardValidTime(card, template); - // 3. 使用效果 - card.setPreferentialType(template.getPreferentialType()) - .setPriceOff(template.getPriceOff()) - .setPercentOff(template.getPercentOff()).setDiscountPriceLimit(template.getDiscountPriceLimit()); - // 保存优惠劵模板到数据库 - couponCardMapper.insert(card); - // 返回成功 - return card.getId(); - } - - /** - * 用户取消使用优惠劵 - * - * @param userId 用户编号 - * @param couponCardId 优惠劵编号 - */ - public void cancelUseCouponCard(Integer userId, Integer couponCardId) { - // 查询优惠劵 - CouponCardDO card = couponCardMapper.selectById(couponCardId); - if (card == null) { - throw ServiceExceptionUtil.exception(PromotionErrorCodeConstants.COUPON_CARD_NOT_EXISTS.getCode()); - } - if (!CouponCardStatusEnum.USED.getValue().equals(card.getStatus())) { - throw ServiceExceptionUtil.exception(PromotionErrorCodeConstants.COUPON_CARD_STATUS_NOT_USED.getCode()); - } - // 更新优惠劵已使用 - int updateCount = couponCardMapper.updateByIdAndStatus(card.getId(), CouponCardStatusEnum.USED.getValue(), - new CouponCardDO().setStatus(CouponCardStatusEnum.UNUSED.getValue())); // TODO 芋艿,usedTime 未设置空,后面处理。 - if (updateCount == 0) { - throw ServiceExceptionUtil.exception(PromotionErrorCodeConstants.COUPON_CARD_STATUS_NOT_USED.getCode()); - } - // 有一点要注意,更新会未使用时,优惠劵可能已经过期了,直接让定时器跑过期,这里不做处理。 - } - - private void setCouponCardValidTime(CouponCardDO card, CouponTemplateDO template) { - if (CouponTemplateDateTypeEnum.FIXED_DATE.getValue().equals(template.getDateType())) { - card.setValidStartTime(template.getValidStartTime()).setValidEndTime(template.getValidEndTime()); - } else if (CouponTemplateDateTypeEnum.FIXED_TERM.getValue().equals(template.getDateType())) { - LocalDateTime validStartTime = DateUtil.getDayBegin(new Date()); - card.setValidStartTime(DateUtil.addDate(validStartTime, Calendar.DAY_OF_YEAR, template.getFixedStartTerm())); - LocalDateTime validEndTime = DateUtil.getDayEnd(card.getValidStartTime()); - card.setValidEndTime(DateUtil.addDate(validEndTime, Calendar.DAY_OF_YEAR, template.getFixedEndTerm() - 1)); - } - } - -} diff --git a/归档/promotion-service-project/promotion-service-app/src/main/resources/mapper/CouponTemplateMapper.xml b/归档/promotion-service-project/promotion-service-app/src/main/resources/mapper/CouponTemplateMapper.xml deleted file mode 100644 index ee7580f45..000000000 --- a/归档/promotion-service-project/promotion-service-app/src/main/resources/mapper/CouponTemplateMapper.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - UPDATE coupon_template - SET stat_fetch_Num = stat_fetch_Num + 1 - WHERE id = #{id} - AND total > stat_fetch_Num - - - diff --git a/归档/search-service-project/pom.xml b/归档/search-service-project/pom.xml deleted file mode 100644 index 6ee80429a..000000000 --- a/归档/search-service-project/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - onemall - cn.iocoder.mall - 1.0-SNAPSHOT - - 4.0.0 - - search-service-project - pom - - search-service-api - search-service-app - - - - - - - cn.iocoder.mall - mall-dependencies - 1.0-SNAPSHOT - pom - import - - - - - cn.iocoder.mall - search-service-api - 1.0-SNAPSHOT - - - - - diff --git a/归档/search-service-project/search-service-api/pom.xml b/归档/search-service-project/search-service-api/pom.xml deleted file mode 100644 index 0d3eb3c2f..000000000 --- a/归档/search-service-project/search-service-api/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - search-service-project - cn.iocoder.mall - 1.0-SNAPSHOT - - 4.0.0 - - search-service-api - - - - cn.iocoder.mall - common-framework - - - - - javax.validation - validation-api - - - org.projectlombok - lombok - - - org.springframework.cloud - spring-cloud-openfeign-core - RELEASE - - - - diff --git a/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/enums/package-info.java b/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/enums/package-info.java deleted file mode 100644 index 8651e340d..000000000 --- a/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/enums/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * 占位,避免包折叠 - */ -package cn.iocoder.mall.searchservice.enums; diff --git a/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/enums/product/SearchProductConditionFieldEnum.java b/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/enums/product/SearchProductConditionFieldEnum.java deleted file mode 100644 index b32c3355b..000000000 --- a/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/enums/product/SearchProductConditionFieldEnum.java +++ /dev/null @@ -1,23 +0,0 @@ -package cn.iocoder.mall.searchservice.enums.product; - -/** - * 搜索商品条件的字段枚举 - */ -public enum SearchProductConditionFieldEnum { - - CATEGORY("category"); - - /** - * 字段 - */ - private final String field; - - SearchProductConditionFieldEnum(String field) { - this.field = field; - } - - public String getField() { - return field; - } - -} diff --git a/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/enums/product/SearchProductPageQuerySortFieldEnum.java b/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/enums/product/SearchProductPageQuerySortFieldEnum.java deleted file mode 100644 index 5544f4e99..000000000 --- a/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/enums/product/SearchProductPageQuerySortFieldEnum.java +++ /dev/null @@ -1,35 +0,0 @@ -package cn.iocoder.mall.searchservice.enums.product; - -/** - * 搜索商品分页查询的排序字段枚举 - */ -public enum SearchProductPageQuerySortFieldEnum { - - /** - * 购买价格 - */ - BUY_PRICE("buyPrice"); - - /** - * 字段 - */ - private final String field; - - SearchProductPageQuerySortFieldEnum(String field) { - this.field = field; - } - - public String getField() { - return field; - } - - public static boolean contains(String field) { - for (SearchProductPageQuerySortFieldEnum fieldEnum : values()) { - if (field.equals(fieldEnum.getField())) { - return true; - } - } - return false; - } - -} diff --git a/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/rpc/package-info.java b/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/rpc/package-info.java deleted file mode 100644 index 193599110..000000000 --- a/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/rpc/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * 占位,避免包折叠 - */ -package cn.iocoder.mall.searchservice.rpc; diff --git a/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/rpc/product/SearchProductFeign.java b/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/rpc/product/SearchProductFeign.java deleted file mode 100644 index bbf7aa249..000000000 --- a/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/rpc/product/SearchProductFeign.java +++ /dev/null @@ -1,40 +0,0 @@ -package cn.iocoder.mall.searchservice.rpc.product; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.searchservice.rpc.product.dto.SearchProductConditionReqDTO; -import cn.iocoder.mall.searchservice.rpc.product.dto.SearchProductConditionRespDTO; -import cn.iocoder.mall.searchservice.rpc.product.dto.SearchProductPageReqDTO; -import cn.iocoder.mall.searchservice.rpc.product.dto.SearchProductRespDTO; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; - -/** - * Title: - * Description: - * - * @author zhuyang - * @version 1.0 2021/10/9 - */ -@FeignClient(value = "search-service") -public interface SearchProductFeign { - /** - * 获得商品搜索分页 - * - * @param pageReqDTO 分页请求 DTO - * @return 商品搜索分页结果 - */ - @PostMapping("/search/product//pageSearchProduct") - CommonResult> pageSearchProduct(@RequestBody SearchProductPageReqDTO pageReqDTO); - - - /** - * 获得商品搜索条件 - * - * @param conditionReqDTO 搜索条件 DTO - * @return 搜索条件 - */ - @PostMapping("/search/product/getSearchProductCondition") - CommonResult getSearchProductCondition(@RequestBody SearchProductConditionReqDTO conditionReqDTO); -} diff --git a/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/rpc/product/dto/SearchProductConditionReqDTO.java b/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/rpc/product/dto/SearchProductConditionReqDTO.java deleted file mode 100644 index a630c3684..000000000 --- a/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/rpc/product/dto/SearchProductConditionReqDTO.java +++ /dev/null @@ -1,28 +0,0 @@ -package cn.iocoder.mall.searchservice.rpc.product.dto; - -import cn.iocoder.mall.searchservice.enums.product.SearchProductConditionFieldEnum; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.Collection; - -/** - * 商品搜索条件 Request DTO - */ -@Data -@Accessors(chain = true) -public class SearchProductConditionReqDTO implements Serializable { - - /** - * 关键字 - */ - private String keyword; - /** - * 需要返回的搜索条件 - * - * 可选择的条件,见 {@link SearchProductConditionFieldEnum} 枚举类 - */ - private Collection fields; - -} diff --git a/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/rpc/product/dto/SearchProductConditionRespDTO.java b/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/rpc/product/dto/SearchProductConditionRespDTO.java deleted file mode 100644 index 1f86012a0..000000000 --- a/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/rpc/product/dto/SearchProductConditionRespDTO.java +++ /dev/null @@ -1,21 +0,0 @@ -package cn.iocoder.mall.searchservice.rpc.product.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.List; - -/** - * 商品搜索条件 Response DTO - */ -@Data -@Accessors(chain = true) -public class SearchProductConditionRespDTO implements Serializable { - - /** - * 商品分类数组 - */ - private List cids; - -} diff --git a/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/rpc/product/dto/SearchProductPageReqDTO.java b/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/rpc/product/dto/SearchProductPageReqDTO.java deleted file mode 100644 index fb961e30e..000000000 --- a/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/rpc/product/dto/SearchProductPageReqDTO.java +++ /dev/null @@ -1,35 +0,0 @@ -package cn.iocoder.mall.searchservice.rpc.product.dto; - -import cn.iocoder.common.framework.vo.PageParam; -import cn.iocoder.common.framework.vo.SortingField; -import cn.iocoder.mall.searchservice.enums.product.SearchProductPageQuerySortFieldEnum; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.util.List; - -/** - * 商品检索分页查询 Request DTO - */ -@Data -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -public class SearchProductPageReqDTO extends PageParam { - - /** - * 分类编号 - */ - private Integer cid; - /** - * 关键字 - */ - private String keyword; - /** - * 排序字段数组 - * - * 可支持排序的字段,见 {@link SearchProductPageQuerySortFieldEnum} - */ - private List sorts; - -} diff --git a/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/rpc/product/dto/SearchProductRespDTO.java b/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/rpc/product/dto/SearchProductRespDTO.java deleted file mode 100644 index 5014c9e77..000000000 --- a/归档/search-service-project/search-service-api/src/main/java/cn/iocoder/mall/searchservice/rpc/product/dto/SearchProductRespDTO.java +++ /dev/null @@ -1,86 +0,0 @@ -package cn.iocoder.mall.searchservice.rpc.product.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.List; - -/** - * 搜索商品 Response DTO - */ -@Data -@Accessors(chain = true) -public class SearchProductRespDTO implements Serializable { - - private Integer id; - - // ========== 基本信息 ========= - /** - * SPU 名字 - */ - private String name; - /** - * 卖点 - */ - private String sellPoint; - /** - * 描述 - */ - private String description; - /** - * 分类编号 - */ - private Integer cid; - /** - * 分类名 - */ - private String categoryName; - /** - * 商品主图地数组 - */ - private List picUrls; - - // ========== 其他信息 ========= - /** - * 是否上架商品(是否可见)。 - * - * true 为已上架 - * false 为已下架 - */ - private Boolean visible; - /** - * 排序字段 - */ - private Integer sort; - - // ========== Sku 相关字段 ========= - /** - * 原价格,单位:分 - */ - private Integer originalPrice; - /** - * 购买价格,单位:分。 - */ - private Integer buyPrice; - /** - * 库存数量 - */ - private Integer quantity; - - // ========== 促销活动相关字段 ========= - // 目前只促销单体商品促销,目前仅限制折扣。 - /** - * 促销活动编号 - */ - private Integer promotionActivityId; - /** - * 促销活动标题 - */ - private String promotionActivityTitle; - /** - * 促销活动类型 - */ - private Integer promotionActivityType; - -} diff --git a/归档/search-service-project/search-service-app/pom.xml b/归档/search-service-project/search-service-app/pom.xml deleted file mode 100644 index 71ff669e6..000000000 --- a/归档/search-service-project/search-service-app/pom.xml +++ /dev/null @@ -1,126 +0,0 @@ - - - - search-service-project - cn.iocoder.mall - 1.0-SNAPSHOT - - 4.0.0 - - search-service-app - - - - - cn.iocoder.mall - mall-spring-boot-starter-dubbo - - - - - - - - - - - - cn.iocoder.mall - product-service-api - 1.0-SNAPSHOT - - - - - cn.iocoder.mall - search-service-api - 1.0-SNAPSHOT - - - - - org.springframework.boot - spring-boot-starter-web - - - - - cn.iocoder.mall - mall-spring-boot-starter-rocketmq - - - - - com.alibaba.cloud - spring-cloud-starter-alibaba-nacos-discovery - - - - - org.springframework.boot - spring-boot-starter-data-elasticsearch - - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - org.springframework.boot - spring-boot-starter-actuator - - - - - org.springframework.boot - spring-boot-starter-validation - - - - org.projectlombok - lombok - - - - org.mapstruct - mapstruct - - - org.mapstruct - mapstruct-jdk8 - - - - org.aspectj - aspectjweaver - 1.9.6 - - - org.springframework.cloud - spring-cloud-starter-openfeign - - - io.swagger - swagger-annotations - - - - - - ${project.artifactId} - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - diff --git a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/SearchServiceApplication.java b/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/SearchServiceApplication.java deleted file mode 100644 index fb9a89867..000000000 --- a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/SearchServiceApplication.java +++ /dev/null @@ -1,19 +0,0 @@ -package cn.iocoder.mall.searchservice; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.openfeign.EnableFeignClients; - -@SpringBootApplication -@EnableDiscoveryClient -@EnableFeignClients(basePackages = {"cn.iocoder.mall.productservice.rpc"}) -public class SearchServiceApplication { - - public static void main(String[] args) { - // 解决 ES java.lang.IllegalStateException: availableProcessors is already - System.setProperty("es.set.netty.runtime.available.processors", "false"); - SpringApplication.run(SearchServiceApplication.class, args); - } - -} diff --git a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/config/ElasticsearchConfiguration.java b/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/config/ElasticsearchConfiguration.java deleted file mode 100644 index 818170523..000000000 --- a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/config/ElasticsearchConfiguration.java +++ /dev/null @@ -1,9 +0,0 @@ -package cn.iocoder.mall.searchservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories; - -@Configuration(proxyBeanMethods = false) -@EnableElasticsearchRepositories(basePackages = "cn.iocoder.mall.search.biz.dao") -public class ElasticsearchConfiguration { -} diff --git a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/controller/SearchProductController.java b/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/controller/SearchProductController.java deleted file mode 100644 index 864523634..000000000 --- a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/controller/SearchProductController.java +++ /dev/null @@ -1,54 +0,0 @@ -package cn.iocoder.mall.searchservice.controller; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.searchservice.manager.product.SearchProductManager; -import cn.iocoder.mall.searchservice.rpc.product.dto.SearchProductConditionReqDTO; -import cn.iocoder.mall.searchservice.rpc.product.dto.SearchProductConditionRespDTO; -import cn.iocoder.mall.searchservice.rpc.product.dto.SearchProductPageReqDTO; -import cn.iocoder.mall.searchservice.rpc.product.dto.SearchProductRespDTO; -import io.swagger.annotations.Api; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import static cn.iocoder.common.framework.vo.CommonResult.success; - -/** - * Title: - * Description: - * - * @author zhuyang - * @version 1.0 2021/10/9 - */ -@RestController -@RequestMapping("/search/product") -@Api("商品搜索") -public class SearchProductController { - @Autowired - private SearchProductManager searchProductManager; - /** - * 获得商品搜索分页 - * - * @param pageReqDTO 分页请求 DTO - * @return 商品搜索分页结果 - */ - @PostMapping("/pageSearchProduct") - CommonResult> pageSearchProduct(@RequestBody SearchProductPageReqDTO pageReqDTO){ - return success(searchProductManager.pageSearchProduct(pageReqDTO)); - } - - /** - * 获得商品搜索条件 - * - * @param conditionReqDTO 搜索条件 DTO - * @return 搜索条件 - */ - @PostMapping("/getSearchProductCondition") - CommonResult getSearchProductCondition(@RequestBody SearchProductConditionReqDTO conditionReqDTO){ - return success(searchProductManager.getSearchProductCondition(conditionReqDTO)); - } - -} diff --git a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/convert/package-info.java b/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/convert/package-info.java deleted file mode 100644 index fdea95c78..000000000 --- a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/convert/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package cn.iocoder.mall.searchservice.convert; diff --git a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/convert/product/SearchProductConvert.java b/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/convert/product/SearchProductConvert.java deleted file mode 100644 index aca0ca739..000000000 --- a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/convert/product/SearchProductConvert.java +++ /dev/null @@ -1,53 +0,0 @@ -package cn.iocoder.mall.searchservice.convert.product; - -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.productservice.rpc.category.dto.ProductCategoryRespDTO; -import cn.iocoder.mall.productservice.rpc.spu.dto.ProductSpuRespDTO; -import cn.iocoder.mall.searchservice.dal.es.dataobject.ESProductDO; -import cn.iocoder.mall.searchservice.rpc.product.dto.SearchProductConditionRespDTO; -import cn.iocoder.mall.searchservice.rpc.product.dto.SearchProductPageReqDTO; -import cn.iocoder.mall.searchservice.rpc.product.dto.SearchProductRespDTO; -import cn.iocoder.mall.searchservice.service.product.bo.SearchProductBO; -import cn.iocoder.mall.searchservice.service.product.bo.SearchProductConditionBO; -import cn.iocoder.mall.searchservice.service.product.bo.SearchProductPageQueryBO; -import cn.iocoder.mall.searchservice.service.product.bo.SearchProductSaveBO; -import org.mapstruct.Mapper; -import org.mapstruct.Mapping; -import org.mapstruct.factory.Mappers; -import org.springframework.data.domain.Page; - -import java.util.List; - -@Mapper -public interface SearchProductConvert { - - SearchProductConvert INSTANCE = Mappers.getMapper(SearchProductConvert.class); - - - @Mapping(source = "spu.id", target = "id") - @Mapping(source = "spu.name", target = "name") - @Mapping(source = "spu.sellPoint", target = "sellPoint") - @Mapping(source = "spu.description", target = "description") - @Mapping(source = "spu.cid", target = "cid") - @Mapping(source = "category.name", target = "categoryName") - @Mapping(source = "spu.picUrls", target = "picUrls") - @Mapping(source = "spu.visible", target = "visible") - @Mapping(source = "spu.sort", target = "sort") - SearchProductSaveBO convert(ProductSpuRespDTO spu, ProductCategoryRespDTO category); - - ESProductDO convert(SearchProductSaveBO bean); - - List convertList(List list); - - default PageResult convertPage(Page page) { - return new PageResult().setList(convertList(page.getContent())) - .setTotal(page.getTotalElements()); - } - - SearchProductPageQueryBO convert(SearchProductPageReqDTO bean); - - PageResult convertPage(PageResult page); - - SearchProductConditionRespDTO convert(SearchProductConditionBO bean); - -} diff --git a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/dal/es/FieldAnalyzer.java b/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/dal/es/FieldAnalyzer.java deleted file mode 100644 index 8be69ff70..000000000 --- a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/dal/es/FieldAnalyzer.java +++ /dev/null @@ -1,26 +0,0 @@ -package cn.iocoder.mall.searchservice.dal.es; - -/** - * ES 字段分析器的枚举类 - * - * 关于 IK 分词,文章 https://blog.csdn.net/xsdxs/article/details/72853288 不错。 - * 目前项目使用的 ES 版本是 6.7.1 ,可以在 https://www.elastic.co/cn/downloads/past-releases/elasticsearch-6-7-1 下载。 - * 如果不知道怎么安装 ES ,可以看 https://blog.csdn.net/chengyuqiang/article/details/78837712 简单。 - */ -public class FieldAnalyzer { - - /** - * IK 最大化分词 - * - * 会将文本做最细粒度的拆分 - */ - public static final String IK_MAX_WORD = "ik_max_word"; - - /** - * IK 智能分词 - * - * 会做最粗粒度的拆分 - */ - public static final String IK_SMART = "ik_smart"; - -} diff --git a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/dal/es/dataobject/ESProductDO.java b/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/dal/es/dataobject/ESProductDO.java deleted file mode 100644 index 05e0598cb..000000000 --- a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/dal/es/dataobject/ESProductDO.java +++ /dev/null @@ -1,96 +0,0 @@ -package cn.iocoder.mall.searchservice.dal.es.dataobject; - -import cn.iocoder.mall.searchservice.dal.es.FieldAnalyzer; -import lombok.Data; -import lombok.experimental.Accessors; -import org.springframework.data.annotation.Id; -import org.springframework.data.elasticsearch.annotations.Document; -import org.springframework.data.elasticsearch.annotations.Field; -import org.springframework.data.elasticsearch.annotations.FieldType; - -import java.util.List; - -/** - * 商品 ES DO - */ -@Document(indexName = "product", type = "product", shards = 1, replicas = 0) -@Data -@Accessors(chain = true) -public class ESProductDO { - - @Id - private Integer id; - - // ========== 基本信息 ========= - /** - * SPU 名字 - */ - @Field(analyzer = FieldAnalyzer.IK_MAX_WORD, type = FieldType.Text) - private String name; - /** - * 卖点 - */ - @Field(analyzer = FieldAnalyzer.IK_MAX_WORD, type = FieldType.Text) - private String sellPoint; - /** - * 描述 - */ - @Field(analyzer = FieldAnalyzer.IK_MAX_WORD, type = FieldType.Text) - private String description; - /** - * 分类编号 - */ - private Integer cid; - /** - * 分类名 - */ - @Field(analyzer = FieldAnalyzer.IK_MAX_WORD, type = FieldType.Text) - private String categoryName; - /** - * 商品主图地数组 - */ - private List picUrls; - - // ========== 其他信息 ========= - /** - * 是否上架商品(是否可见)。 - * - * true 为已上架 - * false 为已下架 - */ - private Boolean visible; - /** - * 排序字段 - */ - private Integer sort; - - // ========== Sku 相关字段 ========= - /** - * 原价格,单位:分 - */ - private Integer originalPrice; - /** - * 购买价格,单位:分。 - */ - private Integer buyPrice; - /** - * 库存数量 - */ - private Integer quantity; - - // ========== 促销活动相关字段 ========= - // 目前只促销单体商品促销,目前仅限制折扣。 - /** - * 促销活动编号 - */ - private Integer promotionActivityId; - /** - * 促销活动标题 - */ - private String promotionActivityTitle; - /** - * 促销活动类型 - */ - private Integer promotionActivityType; - -} diff --git a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/dal/es/repository/ESProductRepository.java b/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/dal/es/repository/ESProductRepository.java deleted file mode 100644 index ca32ac9c7..000000000 --- a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/dal/es/repository/ESProductRepository.java +++ /dev/null @@ -1,69 +0,0 @@ -package cn.iocoder.mall.searchservice.dal.es.repository; - -import cn.iocoder.common.framework.util.CollectionUtils; -import cn.iocoder.common.framework.util.StringUtils; -import cn.iocoder.common.framework.vo.SortingField; -import cn.iocoder.mall.searchservice.dal.es.dataobject.ESProductDO; -import org.elasticsearch.common.lucene.search.function.FunctionScoreQuery; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder; -import org.elasticsearch.index.query.functionscore.ScoreFunctionBuilders; -import org.elasticsearch.search.sort.SortBuilders; -import org.elasticsearch.search.sort.SortOrder; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder; -import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; -import org.springframework.stereotype.Repository; - -import java.util.List; - -import static org.elasticsearch.index.query.QueryBuilders.matchQuery; - -@Repository -public interface ESProductRepository extends ElasticsearchRepository { - - @Deprecated - ESProductDO findByName(String name); - - default Page search(Integer cid, String keyword, Integer pageNo, Integer pageSize, - List sortFields) { - NativeSearchQueryBuilder nativeSearchQueryBuilder = new NativeSearchQueryBuilder() - .withPageable(PageRequest.of(pageNo - 1, pageSize)); - // 筛选条件 cid - if (cid != null) { - nativeSearchQueryBuilder.withFilter(QueryBuilders.termQuery("cid", cid)); - } - // 筛选 - if (StringUtils.hasText(keyword)) { - FunctionScoreQueryBuilder.FilterFunctionBuilder[] functions = { // TODO 芋艿,分值随便打的 - new FunctionScoreQueryBuilder.FilterFunctionBuilder(matchQuery("name", keyword), - ScoreFunctionBuilders.weightFactorFunction(10)), - new FunctionScoreQueryBuilder.FilterFunctionBuilder(matchQuery("sellPoint", keyword), - ScoreFunctionBuilders.weightFactorFunction(2)), - new FunctionScoreQueryBuilder.FilterFunctionBuilder(matchQuery("categoryName", keyword), - ScoreFunctionBuilders.weightFactorFunction(3)), -// new FunctionScoreQueryBuilder.FilterFunctionBuilder(matchQuery("description", keyword), -// ScoreFunctionBuilders.weightFactorFunction(2)), // TODO 芋艿,目前这么做,如果商品描述很长,在按照价格降序,会命中超级多的关键字。 - }; - FunctionScoreQueryBuilder functionScoreQueryBuilder = QueryBuilders.functionScoreQuery(functions) - .scoreMode(FunctionScoreQuery.ScoreMode.SUM) - .setMinScore(2F); // TODO 芋艿,需要考虑下 score - nativeSearchQueryBuilder.withQuery(functionScoreQueryBuilder); - } else { - nativeSearchQueryBuilder.withQuery(QueryBuilders.matchAllQuery()); - } - // 排序 - if (!CollectionUtils.isEmpty(sortFields)) { - sortFields.forEach(sortField -> nativeSearchQueryBuilder.withSort(SortBuilders.fieldSort(sortField.getField()) - .order(SortOrder.fromString(sortField.getOrder())))); - } else if (StringUtils.hasText(keyword)) { - nativeSearchQueryBuilder.withSort(SortBuilders.scoreSort().order(SortOrder.DESC)); - } else { - nativeSearchQueryBuilder.withSort(SortBuilders.fieldSort("sort").order(SortOrder.DESC)); - } - // 执行查询 - return search(nativeSearchQueryBuilder.build()); - } - -} diff --git a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/manager/package-info.java b/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/manager/package-info.java deleted file mode 100644 index ff9569ee8..000000000 --- a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/manager/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * 占位 - */ -package cn.iocoder.mall.searchservice.manager; diff --git a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/manager/product/SearchProductManager.java b/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/manager/product/SearchProductManager.java deleted file mode 100644 index ec7e2461a..000000000 --- a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/manager/product/SearchProductManager.java +++ /dev/null @@ -1,133 +0,0 @@ -package cn.iocoder.mall.searchservice.manager.product; - -import cn.iocoder.common.framework.util.CollectionUtils; -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.productservice.rpc.category.ProductCategoryFeign; -import cn.iocoder.mall.productservice.rpc.category.dto.ProductCategoryRespDTO; -import cn.iocoder.mall.productservice.rpc.sku.ProductSkuFeign; -import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuListQueryReqDTO; -import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuRespDTO; -import cn.iocoder.mall.productservice.rpc.spu.ProductSpuFeign; -import cn.iocoder.mall.productservice.rpc.spu.dto.ProductSpuRespDTO; -import cn.iocoder.mall.searchservice.convert.product.SearchProductConvert; -import cn.iocoder.mall.searchservice.rpc.product.dto.SearchProductConditionReqDTO; -import cn.iocoder.mall.searchservice.rpc.product.dto.SearchProductConditionRespDTO; -import cn.iocoder.mall.searchservice.rpc.product.dto.SearchProductPageReqDTO; -import cn.iocoder.mall.searchservice.rpc.product.dto.SearchProductRespDTO; -import cn.iocoder.mall.searchservice.service.product.SearchProductService; -import cn.iocoder.mall.searchservice.service.product.bo.SearchProductBO; -import cn.iocoder.mall.searchservice.service.product.bo.SearchProductConditionBO; -import cn.iocoder.mall.searchservice.service.product.bo.SearchProductSaveBO; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.Comparator; -import java.util.List; - -@Service -@Slf4j -public class SearchProductManager { - - private static final Integer REBUILD_FETCH_PER_SIZE = 100; - - - @Autowired - private ProductSkuFeign productSkuFeign; - @Autowired - private ProductCategoryFeign productCategoryFeign; - @Autowired - private ProductSpuFeign productSpuFeign; - -// @DubboReference( version = "${dubbo.consumer.CartService.version}") -// private CartService cartService; - - @Autowired - private SearchProductService searchProductService; - - public PageResult pageSearchProduct(SearchProductPageReqDTO pageReqDTO) { - PageResult pageResult = searchProductService.pageSearchProduct(SearchProductConvert.INSTANCE.convert(pageReqDTO)); - return SearchProductConvert.INSTANCE.convertPage(pageResult); - } - - public SearchProductConditionRespDTO getSearchProductCondition(SearchProductConditionReqDTO conditionReqDTO) { - SearchProductConditionBO conditionBO = - searchProductService.getSearchProductCondition(conditionReqDTO.getKeyword(), conditionReqDTO.getFields()); - return SearchProductConvert.INSTANCE.convert(conditionBO); - } - - /** - * 重建所有商品的 ES 索引 - * - * @return 重建数量 - */ - public Integer rebuild() { - // TODO 芋艿,因为目前商品比较少,所以写的很粗暴。等未来重构 - Integer lastId = null; - int rebuildCounts = 0; - while (true) { - // 从商品服务,增量获取商品列表编号 - CommonResult> listProductSpuIdsResult = productSpuFeign.listProductSpuIds(lastId, REBUILD_FETCH_PER_SIZE); - listProductSpuIdsResult.checkError(); - List spuIds = listProductSpuIdsResult.getData(); - // 逐个重建索引到 ES 中 - spuIds.forEach(this::saveProduct); - // 设置新的 lastId ,或者结束 - rebuildCounts += listProductSpuIdsResult.getData().size(); - if (spuIds.size() < REBUILD_FETCH_PER_SIZE) { - break; - } else { - lastId = spuIds.get(spuIds.size() - 1); - } - } - // 返回成功 - return rebuildCounts; - } - - /** - * 重建指定商品的 ES 索引 - * - * @param id 商品 SPU 编号 - * @return 是否重建成功 - */ - public Boolean saveProduct(Integer id) { - // 获得商品 SPU - CommonResult productSpuResult = productSpuFeign.getProductSpu(id); - productSpuResult.checkError(); - if (productSpuResult.getData() == null) { - log.error("[saveProduct][商品 SPU({}) 不存在]", id); - return false; - } - // 获得商品 SKU - CommonResult> listProductSkusResult = - productSkuFeign.listProductSkus(new ProductSkuListQueryReqDTO().setProductSpuId(id)); - listProductSkusResult.checkError(); - if (CollectionUtils.isEmpty(listProductSkusResult.getData())) { - log.error("[saveProduct][商品 SPU({}) 的 SKU 不存在]", id); - return false; - } - // 获得商品分类 - CommonResult getProductCategoryResult = - productCategoryFeign.getProductCategory(productSpuResult.getData().getCid()); - getProductCategoryResult.checkError(); - if (getProductCategoryResult.getData() == null) { - log.error("[saveProduct][商品 SPU({}) 的分类({}) 不存在]", id, productSpuResult.getData().getCid()); - return false; - } - // 保存商品到 ES 中 - SearchProductSaveBO searchProductCreateBO = SearchProductConvert.INSTANCE.convert( - productSpuResult.getData(), getProductCategoryResult.getData()); - ProductSkuRespDTO productSku = listProductSkusResult.getData().stream() - .min(Comparator.comparing(ProductSkuRespDTO::getPrice)).orElse(null); - assert productSku != null; -// // 价格计算 TODO 芋艿:需要补充,暂时使用这个逻辑 -// CalcSkuPriceBO calSkuPriceResult = cartService.calcSkuPrice(sku.getId()); - searchProductCreateBO.setOriginalPrice(productSku.getPrice()); - searchProductCreateBO.setBuyPrice(productSku.getPrice()); - searchProductCreateBO.setQuantity(productSku.getQuantity()); - searchProductService.saveSearchProduct(searchProductCreateBO); - return true; - } - -} diff --git a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/mq/consumer/ProductUpdateConsumer.java b/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/mq/consumer/ProductUpdateConsumer.java deleted file mode 100644 index 03391fca4..000000000 --- a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/mq/consumer/ProductUpdateConsumer.java +++ /dev/null @@ -1,30 +0,0 @@ -package cn.iocoder.mall.searchservice.mq.consumer; - -import cn.iocoder.mall.searchservice.manager.product.SearchProductManager; -import cn.iocoder.mall.searchservice.mq.consumer.message.ProductUpdateMessage; -import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; -import org.apache.rocketmq.spring.core.RocketMQListener; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.Assert; - -/** - * 商品更新 Topic 的消费者,重建对应的商品的 ES 索引 - */ -@Service -@RocketMQMessageListener( - topic = ProductUpdateMessage.TOPIC, - consumerGroup = "${spring.application.name}-consumer-group-" + ProductUpdateMessage.TOPIC -) -public class ProductUpdateConsumer implements RocketMQListener { - - @Autowired - private SearchProductManager productSearchManager; - - @Override - public void onMessage(ProductUpdateMessage message) { - Boolean result = productSearchManager.saveProduct(message.getId()); - Assert.isTrue(result, String.format("重构商品(%d)的 ES 索引,必然成功。实际结果是 %s", message.getId(), result)); - } - -} diff --git a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/mq/consumer/message/ProductUpdateMessage.java b/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/mq/consumer/message/ProductUpdateMessage.java deleted file mode 100644 index 03d956c55..000000000 --- a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/mq/consumer/message/ProductUpdateMessage.java +++ /dev/null @@ -1,20 +0,0 @@ -package cn.iocoder.mall.searchservice.mq.consumer.message; - -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 商品更新(包括创建)消息 - */ -@Data -@Accessors(chain = true) -public class ProductUpdateMessage { - - public static final String TOPIC = "ProductUpdate"; - - /** - * 商品编号 - */ - private Integer id; - -} diff --git a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/rpc/package-info.java b/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/rpc/package-info.java deleted file mode 100644 index 1daa4587e..000000000 --- a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/rpc/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package cn.iocoder.mall.searchservice.rpc; diff --git a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/service/package-info.java b/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/service/package-info.java deleted file mode 100644 index 66a4e86ab..000000000 --- a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/service/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * 占位,避免包折叠 - */ -package cn.iocoder.mall.searchservice.service; diff --git a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/service/product/SearchProductService.java b/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/service/product/SearchProductService.java deleted file mode 100644 index 4f4100a2f..000000000 --- a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/service/product/SearchProductService.java +++ /dev/null @@ -1,112 +0,0 @@ -package cn.iocoder.mall.searchservice.service.product; - -import cn.iocoder.common.framework.util.CollectionUtils; -import cn.iocoder.common.framework.util.StringUtils; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.common.framework.vo.SortingField; -import cn.iocoder.mall.searchservice.convert.product.SearchProductConvert; -import cn.iocoder.mall.searchservice.dal.es.dataobject.ESProductDO; -import cn.iocoder.mall.searchservice.dal.es.repository.ESProductRepository; -import cn.iocoder.mall.searchservice.enums.product.SearchProductConditionFieldEnum; -import cn.iocoder.mall.searchservice.enums.product.SearchProductPageQuerySortFieldEnum; -import cn.iocoder.mall.searchservice.service.product.bo.SearchProductBO; -import cn.iocoder.mall.searchservice.service.product.bo.SearchProductConditionBO; -import cn.iocoder.mall.searchservice.service.product.bo.SearchProductPageQueryBO; -import cn.iocoder.mall.searchservice.service.product.bo.SearchProductSaveBO; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.search.aggregations.Aggregation; -import org.elasticsearch.search.aggregations.AggregationBuilders; -import org.elasticsearch.search.aggregations.bucket.terms.LongTerms; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; -import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder; -import org.springframework.stereotype.Service; -import org.springframework.util.Assert; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -@Service -public class SearchProductService { - - @Autowired - private ESProductRepository productRepository; - @Autowired - private ElasticsearchTemplate elasticsearchTemplate; // 因为需要使用到聚合操作,只好引入 ElasticsearchTemplate 。 - - /** - * 搜索商品分页结果 - * - * @param pageQueryBO 分页查询条件 - * @return 商品信息 - */ - public PageResult pageSearchProduct(SearchProductPageQueryBO pageQueryBO) { - checkSortFieldInvalid(pageQueryBO.getSorts()); - // 执行查询 - Page searchPage = productRepository.search(pageQueryBO.getCid(), pageQueryBO.getKeyword(), - pageQueryBO.getPageNo(), pageQueryBO.getPageSize(), pageQueryBO.getSorts()); - // 转换结果 - return SearchProductConvert.INSTANCE.convertPage(searchPage); - } - - private void checkSortFieldInvalid(List sorts) { - if (CollectionUtils.isEmpty(sorts)) { - return; - } - sorts.forEach(sortingField -> Assert.isTrue(SearchProductPageQuerySortFieldEnum.contains(sortingField.getField()), - String.format("排序字段(%s) 不在允许范围内", sortingField.getField()))); - } - - /** - * 保存商品信息到 ES 中 - * - * @param saveBO 商品信息 - */ - public void saveSearchProduct(SearchProductSaveBO saveBO) { - ESProductDO productDO = SearchProductConvert.INSTANCE.convert(saveBO); - productRepository.save(productDO); - } - - /** - * 获得指定关键字对应的搜索条件 - * - * 在我们搜索商品时,需要获得关键字可选择的分类、品牌等等搜索条件,方便用户进一步检索 - * - * @param keyword 关键字 - * @param fields 需要返回的搜索条件{@link SearchProductConditionFieldEnum}。目前可传入的参数为 - * 1. category :商品分类,会返回商品分类编号 - * @return 搜索条件 - */ - public SearchProductConditionBO getSearchProductCondition(String keyword, Collection fields) { - // 创建 ES 搜索条件 - NativeSearchQueryBuilder nativeSearchQueryBuilder = new NativeSearchQueryBuilder(); - // 筛选 - if (StringUtils.hasText(keyword)) { // 如果有 keyword ,就去匹配 - nativeSearchQueryBuilder.withQuery(QueryBuilders.multiMatchQuery(keyword, - "name", "sellPoint", "categoryName")); - } else { - nativeSearchQueryBuilder.withQuery(QueryBuilders.matchAllQuery()); - } - // 聚合 - if (fields.contains("category")) { // 商品分类 - nativeSearchQueryBuilder.addAggregation(AggregationBuilders.terms("cids").field("cid")); - } - // 执行查询,返回结果 - return elasticsearchTemplate.query(nativeSearchQueryBuilder.build(), response -> { - SearchProductConditionBO result = new SearchProductConditionBO(); - // categoryIds 聚合 - Aggregation categoryIdsAggregation = response.getAggregations().get("cids"); - if (categoryIdsAggregation != null) { - result.setCids(new ArrayList<>()); - for (LongTerms.Bucket bucket : (((LongTerms) categoryIdsAggregation).getBuckets())) { - result.getCids().add(bucket.getKeyAsNumber().intValue()); - } - } - // 返回结果 - return result; - }); - } - -} diff --git a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/service/product/bo/SearchProductBO.java b/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/service/product/bo/SearchProductBO.java deleted file mode 100644 index b962d6ad6..000000000 --- a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/service/product/bo/SearchProductBO.java +++ /dev/null @@ -1,85 +0,0 @@ -package cn.iocoder.mall.searchservice.service.product.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.List; - -/** - * 搜索商品 BO - */ -@Data -@Accessors(chain = true) -public class SearchProductBO { - - private Integer id; - - // ========== 基本信息 ========= - /** - * SPU 名字 - */ - private String name; - /** - * 卖点 - */ - private String sellPoint; - /** - * 描述 - */ - private String description; - /** - * 分类编号 - */ - private Integer cid; - /** - * 分类名 - */ - private String categoryName; - /** - * 商品主图地数组 - */ - private List picUrls; - - // ========== 其他信息 ========= - /** - * 是否上架商品(是否可见)。 - * - * true 为已上架 - * false 为已下架 - */ - private Boolean visible; - /** - * 排序字段 - */ - private Integer sort; - - // ========== Sku 相关字段 ========= - /** - * 原价格,单位:分 - */ - private Integer originalPrice; - /** - * 购买价格,单位:分。 - */ - private Integer buyPrice; - /** - * 库存数量 - */ - private Integer quantity; - - // ========== 促销活动相关字段 ========= - // 目前只促销单体商品促销,目前仅限制折扣。 - /** - * 促销活动编号 - */ - private Integer promotionActivityId; - /** - * 促销活动标题 - */ - private String promotionActivityTitle; - /** - * 促销活动类型 - */ - private Integer promotionActivityType; - -} diff --git a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/service/product/bo/SearchProductConditionBO.java b/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/service/product/bo/SearchProductConditionBO.java deleted file mode 100644 index b61e7eace..000000000 --- a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/service/product/bo/SearchProductConditionBO.java +++ /dev/null @@ -1,20 +0,0 @@ -package cn.iocoder.mall.searchservice.service.product.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.List; - -/** - * 商品搜索条件返回 BO - */ -@Data -@Accessors(chain = true) -public class SearchProductConditionBO { - - /** - * 商品分类数组 - */ - private List cids; - -} diff --git a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/service/product/bo/SearchProductPageQueryBO.java b/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/service/product/bo/SearchProductPageQueryBO.java deleted file mode 100644 index f7a79c4f2..000000000 --- a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/service/product/bo/SearchProductPageQueryBO.java +++ /dev/null @@ -1,35 +0,0 @@ -package cn.iocoder.mall.searchservice.service.product.bo; - -import cn.iocoder.common.framework.vo.PageParam; -import cn.iocoder.common.framework.vo.SortingField; -import cn.iocoder.mall.searchservice.enums.product.SearchProductPageQuerySortFieldEnum; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.util.List; - -/** - * 商品检索分查询 BO - */ -@Data -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -public class SearchProductPageQueryBO extends PageParam { - - /** - * 分类编号 - */ - private Integer cid; - /** - * 关键字 - */ - private String keyword; - /** - * 排序字段数组 - * - * 可支持排序的字段,见 {@link SearchProductPageQuerySortFieldEnum} - */ - private List sorts; - -} diff --git a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/service/product/bo/SearchProductSaveBO.java b/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/service/product/bo/SearchProductSaveBO.java deleted file mode 100644 index 87dc49f6d..000000000 --- a/归档/search-service-project/search-service-app/src/main/java/cn/iocoder/mall/searchservice/service/product/bo/SearchProductSaveBO.java +++ /dev/null @@ -1,85 +0,0 @@ -package cn.iocoder.mall.searchservice.service.product.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.List; - -/** - * 搜索商品保存 BO - */ -@Data -@Accessors -public class SearchProductSaveBO { - - private Integer id; - - // ========== 基本信息 ========= - /** - * SPU 名字 - */ - private String name; - /** - * 卖点 - */ - private String sellPoint; - /** - * 描述 - */ - private String description; - /** - * 分类编号 - */ - private Integer cid; - /** - * 分类名 - */ - private String categoryName; - /** - * 商品主图地数组 - */ - private List picUrls; - - // ========== 其他信息 ========= - /** - * 是否上架商品(是否可见)。 - * - * true 为已上架 - * false 为已下架 - */ - private Boolean visible; - /** - * 排序字段 - */ - private Integer sort; - - // ========== Sku 相关字段 ========= - /** - * 原价格,单位:分 - */ - private Integer originalPrice; - /** - * 购买价格,单位:分。 - */ - private Integer buyPrice; - /** - * 库存数量 - */ - private Integer quantity; - - // ========== 促销活动相关字段 ========= - // 目前只促销单体商品促销,目前仅限制折扣。 - /** - * 促销活动编号 - */ - private Integer promotionActivityId; - /** - * 促销活动标题 - */ - private String promotionActivityTitle; - /** - * 促销活动类型 - */ - private Integer promotionActivityType; - -} diff --git a/归档/search-service-project/search-service-app/src/main/resources/application-dev.yaml b/归档/search-service-project/search-service-app/src/main/resources/application-dev.yaml deleted file mode 100644 index fede4927b..000000000 --- a/归档/search-service-project/search-service-app/src/main/resources/application-dev.yaml +++ /dev/null @@ -1,15 +0,0 @@ -spring: - # Spring Cloud 配置项 - cloud: - nacos: - # Spring Cloud Nacos Discovery 配置项 - discovery: - server-addr: localhost:8848 # Nacos 服务器地址 - namespace: dev # Nacos 命名空间 - -# Dubbo 配置项 -dubbo: - # Dubbo 注册中心 - registry: - # address: spring-cloud://localhost:8848 # 指定 Dubbo 服务注册中心的地址 - address: nacos://localhost:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 diff --git a/归档/search-service-project/search-service-app/src/main/resources/application-local.yaml b/归档/search-service-project/search-service-app/src/main/resources/application-local.yaml deleted file mode 100644 index 07ae5f036..000000000 --- a/归档/search-service-project/search-service-app/src/main/resources/application-local.yaml +++ /dev/null @@ -1,21 +0,0 @@ -spring: - # Spring Cloud 配置项 - cloud: - nacos: - # Spring Cloud Nacos Discovery 配置项 - discovery: - server-addr: localhost:8848 # Nacos 服务器地址 - namespace: dev # Nacos 命名空间 - -# Dubbo 配置项 -dubbo: - # Dubbo 注册中心 - registry: -# address: spring-cloud://localhost:8848 # 指定 Dubbo 服务注册中心的地址 - address: nacos://localhost:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 - # Dubbo 服务提供者的配置 - provider: - tag: ${DUBBO_TAG} # Dubbo 路由分组 - # Dubbo 服务消费者的配置 - consumer: - tag: ${DUBBO_TAG} # Dubbo 路由分组 diff --git a/归档/search-service-project/search-service-app/src/main/resources/application.yaml b/归档/search-service-project/search-service-app/src/main/resources/application.yaml deleted file mode 100644 index 71b38c6bf..000000000 --- a/归档/search-service-project/search-service-app/src/main/resources/application.yaml +++ /dev/null @@ -1,62 +0,0 @@ -spring: - # Application 的配置项 - application: - name: search-service - # Profile 的配置项 - profiles: - active: local - # Elasticsearch 配置项 - data: - elasticsearch: - cluster-name: elasticsearch - cluster-nodes: localhost:9300 - repositories: - enable: true - elasticsearch: - rest: - uris: localhost:9200 - -# Dubbo 配置项 -dubbo: - # Spring Cloud Alibaba Dubbo 专属配置 - cloud: - subscribed-services: '' # 设置订阅的应用列表,默认为 * 订阅所有应用 - # Dubbo 提供者的协议 - protocol: - name: dubbo - port: -1 - # Dubbo 提供服务的扫描基础包 - scan: - base-packages: cn.iocoder.mall.searchservice.rpc - # Dubbo 服务提供者的配置 - provider: - filter: -exception - validation: true # 开启 Provider 参数校验 - version: 1.0.0 # 服务的版本号 - # Dubbo 服务消费者的配置 - consumer: - ErrorCodeRpc: - version: 1.0.0 - ProductCategoryRpc: - version: 1.0.0 - ProductSpuRpc: - version: 1.0.0 - ProductSkuRpc: - version: 1.0.0 - -# RocketMQ 配置项 -rocketmq: - name-server: localhost:9876 - -# Actuator 监控配置项 -management: - server.port: 38083 # 独立端口,避免被暴露出去 - endpoints.web.exposure.include: '*' # 暴露所有监控端点 -server.port: ${management.server.port} # 设置使用 Actuator 的服务器端口,因为 RPC 服务不需要 Web 端口 - -# Mall 配置项 -mall: - # 错误码配置项对应 ErrorCodeProperties 配置类 - error-code: - group: ${spring.application.name} - constants-class: cn.iocoder.mall.searchservice.enums.ProductErrorCodeConstants diff --git a/归档/search-service-project/search-service-app/src/test/java/cn/iocoder/mall/searchservice/manager/package-info.java b/归档/search-service-project/search-service-app/src/test/java/cn/iocoder/mall/searchservice/manager/package-info.java deleted file mode 100644 index ff9569ee8..000000000 --- a/归档/search-service-project/search-service-app/src/test/java/cn/iocoder/mall/searchservice/manager/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * 占位 - */ -package cn.iocoder.mall.searchservice.manager; diff --git a/归档/search-service-project/search-service-app/src/test/java/cn/iocoder/mall/searchservice/manager/product/SearchProductManagerTest.java b/归档/search-service-project/search-service-app/src/test/java/cn/iocoder/mall/searchservice/manager/product/SearchProductManagerTest.java deleted file mode 100644 index 287548d56..000000000 --- a/归档/search-service-project/search-service-app/src/test/java/cn/iocoder/mall/searchservice/manager/product/SearchProductManagerTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package cn.iocoder.mall.searchservice.manager.product; - -import cn.iocoder.mall.searchservice.dal.es.repository.ESProductRepository; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -/** - * {@link SearchProductManager} 的测试类,目前是集成测试类 - */ -@RunWith(SpringJUnit4ClassRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) -public class SearchProductManagerTest { - - static { - System.setProperty("es.set.netty.runtime.available.processors", "false"); - } - - @Autowired - private SearchProductManager searchProductManager; - - @Autowired - private ESProductRepository esProductRepository; - - @Test - public void testRebuild() { - int counts = searchProductManager.rebuild(); - System.out.println("重建数量:" + counts); - - System.out.println(esProductRepository.count()); - } - -} diff --git a/归档/search-service-project/search-service-app/src/test/java/cn/iocoder/mall/searchservice/service/package-info.java b/归档/search-service-project/search-service-app/src/test/java/cn/iocoder/mall/searchservice/service/package-info.java deleted file mode 100644 index edcc8abe4..000000000 --- a/归档/search-service-project/search-service-app/src/test/java/cn/iocoder/mall/searchservice/service/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * 占位 - */ -package cn.iocoder.mall.searchservice.service; diff --git a/归档/search-service-project/search-service-app/src/test/java/cn/iocoder/mall/searchservice/service/product/SearchProductServiceTest.java b/归档/search-service-project/search-service-app/src/test/java/cn/iocoder/mall/searchservice/service/product/SearchProductServiceTest.java deleted file mode 100644 index 98d9597d4..000000000 --- a/归档/search-service-project/search-service-app/src/test/java/cn/iocoder/mall/searchservice/service/product/SearchProductServiceTest.java +++ /dev/null @@ -1,32 +0,0 @@ -package cn.iocoder.mall.searchservice.service.product; - -import cn.iocoder.mall.searchservice.service.product.bo.SearchProductConditionBO; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -import java.util.Collections; - -/** - * {@link SearchProductService} 的测试类,目前是集成测试类 - */ -@RunWith(SpringJUnit4ClassRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) -public class SearchProductServiceTest { - - static { - System.setProperty("es.set.netty.runtime.available.processors", "false"); - } - - @Autowired - private SearchProductService searchProductService; - - @Test - public void testGetSearchCondition() { - SearchProductConditionBO conditionBO = searchProductService.getSearchProductCondition("商品", Collections.singletonList("category")); - System.out.println(conditionBO); - } - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/client/pay/PayTransactionClient.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/client/pay/PayTransactionClient.java deleted file mode 100644 index c24aadffc..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/client/pay/PayTransactionClient.java +++ /dev/null @@ -1,42 +0,0 @@ -package cn.iocoder.mall.shopweb.client.pay; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.payservice.rpc.transaction.PayTransactionFeign; -import cn.iocoder.mall.payservice.rpc.transaction.dto.*; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.Objects; - -@Service -public class PayTransactionClient { - - - @Autowired - private PayTransactionFeign payTransactionFeign; - - public PayTransactionRespDTO getPayTransaction(Integer userId, String appId, String orderId) { - CommonResult getPayTransactionResult = payTransactionFeign.getPayTransaction(new PayTransactionGetReqDTO() - .setAppId(appId).setOrderId(orderId)); - getPayTransactionResult.checkError(); - if (getPayTransactionResult.getData() == null) { - return null; - } - // 如果用户编号不匹配,则返回 null - return Objects.equals(getPayTransactionResult.getData().getUserId(), userId) ? - getPayTransactionResult.getData() : null; - } - - public PayTransactionSubmitRespDTO submitPayTransaction(PayTransactionSubmitReqDTO submitReqDTO) { - CommonResult submitPayTransactionResult = payTransactionFeign.submitPayTransaction(submitReqDTO); - submitPayTransactionResult.checkError(); - return submitPayTransactionResult.getData(); - } - - public void updatePayTransactionSuccess(Integer payChannel, String params) { - CommonResult updatePayTransactionSuccessResult = payTransactionFeign.updatePayTransactionSuccess( - new PayTransactionSuccessReqDTO().setPayChannel(payChannel).setParams(params)); - updatePayTransactionSuccessResult.checkError(); - } - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/client/trade/TradeOrderClient.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/client/trade/TradeOrderClient.java deleted file mode 100644 index 9989d82b0..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/client/trade/TradeOrderClient.java +++ /dev/null @@ -1,38 +0,0 @@ -package cn.iocoder.mall.shopweb.client.trade; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.tradeservice.rpc.order.TradeOrderFeign; -import cn.iocoder.mall.tradeservice.rpc.order.dto.TradeOrderCreateReqDTO; -import cn.iocoder.mall.tradeservice.rpc.order.dto.TradeOrderPageReqDTO; -import cn.iocoder.mall.tradeservice.rpc.order.dto.TradeOrderRespDTO; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.Arrays; - -@Service -public class TradeOrderClient { - - @Autowired - private TradeOrderFeign tradeOrderFeign; - - public Integer createTradeOrder(TradeOrderCreateReqDTO createReqDTO) { - CommonResult createTradeOrderResult = tradeOrderFeign.createTradeOrder(createReqDTO); - createTradeOrderResult.checkError(); - return createTradeOrderResult.getData(); - } - - public PageResult pageTradeOrder(TradeOrderPageReqDTO pageReqDTO) { - CommonResult> pageTradeOrderResult = tradeOrderFeign.pageTradeOrder(pageReqDTO); - pageTradeOrderResult.checkError(); - return pageTradeOrderResult.getData(); - } - - public TradeOrderRespDTO getTradeOrder(Integer tradeOrderId, String... fields) { - CommonResult getTradeOrderResult = tradeOrderFeign.getTradeOrder(tradeOrderId, Arrays.asList(fields)); - getTradeOrderResult.checkError(); - return getTradeOrderResult.getData(); - } - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/pay/PayTransactionController.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/pay/PayTransactionController.java deleted file mode 100644 index ec80ca4a3..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/pay/PayTransactionController.java +++ /dev/null @@ -1,81 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.pay; - -import cn.iocoder.common.framework.util.HttpUtil; -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.payservice.enums.PayChannelEnum; -import cn.iocoder.mall.security.user.core.context.UserSecurityContextHolder; -import cn.iocoder.mall.shopweb.controller.pay.vo.transaction.PayTransactionRespVO; -import cn.iocoder.mall.shopweb.controller.pay.vo.transaction.PayTransactionSubmitReqVO; -import cn.iocoder.mall.shopweb.controller.pay.vo.transaction.PayTransactionSubmitRespVO; -import cn.iocoder.mall.shopweb.service.pay.PayTransactionService; -import cn.iocoder.security.annotations.RequiresAuthenticate; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.MediaType; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.io.BufferedReader; -import java.io.IOException; - -import static cn.iocoder.common.framework.vo.CommonResult.success; - -@Api("支付交易 API") -@RestController -@RequestMapping("/pay/transaction") -@Validated -@Slf4j -public class PayTransactionController { - - @Autowired - private PayTransactionService payTransactionService; - - // TODO 芋艿:这个 API 定义可能不太太合适,应该改成支付交易单号 - @GetMapping("/get") - @ApiOperation("获得支付交易") - @ApiImplicitParams({ - @ApiImplicitParam(name = "appId", required = true, value = "应用编号", example = "POd4RC6a"), - @ApiImplicitParam(name = "orderId", required = true, value = "订单号", example = "1024"), - }) - @RequiresAuthenticate - public CommonResult getPayTransaction(@RequestParam("appId") String appId, - @RequestParam("orderId") String orderId) { - return success(payTransactionService.getPayTransaction(UserSecurityContextHolder.getUserId(), appId, orderId)); - } - - // TODO 芋艿:这个 API 定义可能不太太合适,应该改成支付交易单号 - @PostMapping("/submit") - @ApiOperation("提交支付交易") - @RequiresAuthenticate - public CommonResult submitPayTransaction(HttpServletRequest request, - PayTransactionSubmitReqVO submitReqVO) { - return success(payTransactionService.submitPayTransaction(submitReqVO, HttpUtil.getIp(request))); - } - - @PostMapping(value = "pingxx_pay_success", consumes = MediaType.APPLICATION_JSON_VALUE) - @ApiOperation("Pingxx 支付成功回调") -// @GetMapping(value = "pingxx_pay_success") - public String updatePayTransactionSuccess(HttpServletRequest request) throws IOException { - log.info("[pingxxPaySuccess][被回调]"); - // 读取 webhook - StringBuilder sb = new StringBuilder(); - try (BufferedReader reader = request.getReader()) { - String line; - while ((line = reader.readLine()) != null) { - sb.append(line); - } - } - -// JSONObject bodyObj = JSON.parseObject(sb.toString()); -// bodyObj.put("webhookId", bodyObj.remove("id")); -// String body = bodyObj.toString(); - payTransactionService.updatePayTransactionSuccess(PayChannelEnum.PINGXX.getId(), sb.toString()); - return "success"; - } - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/pay/vo/transaction/PayTransactionRespVO.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/pay/vo/transaction/PayTransactionRespVO.java deleted file mode 100644 index 4f0ffde08..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/pay/vo/transaction/PayTransactionRespVO.java +++ /dev/null @@ -1,39 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.pay.vo.transaction; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.time.LocalDateTime; - -@ApiModel("支付交易 Response VO") -@Data -@Accessors(chain = true) -public class PayTransactionRespVO { - - @ApiModelProperty(value = "交易编号", required = true, example = "1") - private Integer id; - - @ApiModelProperty(value = "应用编号", required = true, example = "POd4RC6a") - private String appId; - - @ApiModelProperty(value = "订单号不能为空", required = true, example = "1024") - private String orderId; - - @ApiModelProperty(value = "商品名", required = true, example = "芋道源码") - private String orderSubject; - - @ApiModelProperty(value = "订单商品描述", required = true, example = "绵啾啾的") - private String orderDescription; - - @ApiModelProperty(value = "支付金额,单位:分。", required = true, example = "10") - private Integer price; - - @ApiModelProperty(value = "订单状态", required = true, example = "1", notes = "参见 PayTransactionStatusEnum 枚举") - private Integer status; - - @ApiModelProperty(value = "交易过期时间", required = true) - private LocalDateTime expireTime; - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/pay/vo/transaction/PayTransactionSubmitReqVO.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/pay/vo/transaction/PayTransactionSubmitReqVO.java deleted file mode 100644 index c0f795e10..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/pay/vo/transaction/PayTransactionSubmitReqVO.java +++ /dev/null @@ -1,31 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.pay.vo.transaction; - -import cn.iocoder.common.framework.validator.InEnum; -import cn.iocoder.mall.payservice.enums.PayChannelEnum; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; - -@ApiModel("支付交易提交 Request VO") -@Data -@Accessors(chain = true) -public class PayTransactionSubmitReqVO { - - @ApiModelProperty(value = "应用编号", required = true, example = "POd4RC6a") - @NotEmpty(message = "应用编号不能为空") - private String appId; - - @ApiModelProperty(value = "订单号", required = true, example = "1024") - @NotEmpty(message = "订单号不能为空") - private String orderId; - - @ApiModelProperty(value = "支付渠道", required = true, example = "1", notes = "参见 PayChannelEnum 枚举") - @InEnum(value = PayChannelEnum.class, message = "支付渠道必须是 {value}") - @NotNull(message = "支付渠道") - private Integer payChannel; - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/pay/vo/transaction/PayTransactionSubmitRespVO.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/pay/vo/transaction/PayTransactionSubmitRespVO.java deleted file mode 100644 index 7f14ab7a6..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/pay/vo/transaction/PayTransactionSubmitRespVO.java +++ /dev/null @@ -1,19 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.pay.vo.transaction; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -@ApiModel("支付交易提交 Response VO") -@Data -@Accessors(chain = true) -public class PayTransactionSubmitRespVO { - - @ApiModelProperty(value = "支付交易拓展单编号", required = true, example = "1") - private Integer id; - - @ApiModelProperty(value = "调用三方平台的响应结果", required = true) - private String invokeResponse; - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductCategoryController.http b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductCategoryController.http deleted file mode 100644 index 16623f3ee..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductCategoryController.http +++ /dev/null @@ -1,4 +0,0 @@ -### /user-address/get-default 成功 -GET {{shop-api-base-url}}/product-category/list?pid=0 - -### diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductCategoryController.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductCategoryController.java deleted file mode 100644 index df5c037e3..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductCategoryController.java +++ /dev/null @@ -1,36 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.product; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.shopweb.controller.product.vo.category.ProductCategoryRespVO; -import cn.iocoder.mall.shopweb.service.product.ProductCategoryManager; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -import static cn.iocoder.common.framework.vo.CommonResult.success; - -@Api(tags = "商品分类 API") -@RestController -@RequestMapping("/product-category") -@Validated -public class ProductCategoryController { - - @Autowired - private ProductCategoryManager productCategoryManager; - - @GetMapping("/list") - @ApiOperation("获得商品分类的列表") - @ApiImplicitParam(name = "pid", value = "父分类编号", required = true, example = "1024") - public CommonResult> listProductCategories(@RequestParam("pid") Integer pid) { - return success(productCategoryManager.listProductCategories(pid)); - } - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductSkuController.http b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductSkuController.http deleted file mode 100644 index d304b6911..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductSkuController.http +++ /dev/null @@ -1,5 +0,0 @@ -### /product-spu/page 计算商品 SKU 价格 -GET http://127.0.0.1:18084/shop-api/product-sku/cal-price?id=33 -Content-Type: application/x-www-form-urlencoded - -### diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductSkuController.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductSkuController.java deleted file mode 100644 index df5337008..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductSkuController.java +++ /dev/null @@ -1,33 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.product; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.security.user.core.context.UserSecurityContextHolder; -import cn.iocoder.mall.shopweb.controller.product.vo.sku.ProductSkuCalcPriceRespVO; -import cn.iocoder.mall.shopweb.service.product.ProductSkuManager; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -@Api(tags = "商品 SKU API") -@RestController -@RequestMapping("/product-sku") -@Validated -public class ProductSkuController { - - @Autowired - private ProductSkuManager productSkuManager; - - @GetMapping("/cal-price") - @ApiOperation("计算商品 SKU 价格") - @ApiImplicitParam(name = "id", required = true, value = "商品 SKU 编号", example = "1024") - public CommonResult calcProductSkuPrice(@RequestParam("id") Integer id) { - return CommonResult.success(productSkuManager.calcProductSkuPrice(UserSecurityContextHolder.getUserId(), id)); - } - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductSpuController.http b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductSpuController.http deleted file mode 100644 index c18e02753..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductSpuController.http +++ /dev/null @@ -1,13 +0,0 @@ -### /product-spu/page 成功(全部) -GET http://127.0.0.1:18084/shop-api/product-spu/page?pageNo=1&pageSize=10&keyword=骚气 -Content-Type: application/x-www-form-urlencoded - -### /product-spu/search-condition 成功 -GET http://127.0.0.1:18084/shop-api/product-spu/search-condition?keyword=骚气 -Content-Type: application/x-www-form-urlencoded - -### /product-spu/get-detail 成功 -GET http://127.0.0.1:18084/shop-api/product-spu/get-detail?id=63 -Content-Type: application/x-www-form-urlencoded - -### diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductSpuController.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductSpuController.java deleted file mode 100644 index 4931eca47..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductSpuController.java +++ /dev/null @@ -1,52 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.product; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuDetailRespVO; -import cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuPageReqVO; -import cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuRespVO; -import cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuSearchConditionRespVO; -import cn.iocoder.mall.shopweb.service.product.ProductSpuManager; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import static cn.iocoder.common.framework.vo.CommonResult.success; - -@Api(tags = "商品 SPU API") -@RestController -@RequestMapping("/product-spu") -@Validated -public class ProductSpuController { - - @Autowired - private ProductSpuManager productSpuManager; - - @GetMapping("/page") - @ApiOperation("获得商品 SPU 的分页") - public CommonResult> pageProductSpu(ProductSpuPageReqVO pageReqVO) { - return success(productSpuManager.pageProductSpu(pageReqVO)); - } - - @GetMapping("/search-condition") - @ApiOperation("获得商品的搜索条件") - @ApiImplicitParam(name = "keyword", value = "关键字", example = "芋艿") - public CommonResult getProductSpuSearchCondition( - @RequestParam(value = "keyword", required = false) String keyword) { - return success(productSpuManager.getProductSpuSearchCondition(keyword)); - } - - @GetMapping("/get-detail") - @ApiOperation("获得商品 SPU 的明细,包括 SKU 等等信息") - @ApiImplicitParam(name = "id", required = true, value = "商品 SPU 编号", example = "1024") - public CommonResult getProductSpuDetail(@RequestParam("id") Integer id) { - return success(productSpuManager.getProductSpuDetail(id)); - } - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/vo/attr/ProductAttrKeyValueRespVO.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/vo/attr/ProductAttrKeyValueRespVO.java deleted file mode 100644 index ece6087bc..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/vo/attr/ProductAttrKeyValueRespVO.java +++ /dev/null @@ -1,22 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.product.vo.attr; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -@ApiModel(value = "商品规格 KEY + VALUE 对的 Response VO") -@Data -@Accessors(chain = true) -public class ProductAttrKeyValueRespVO { - - @ApiModelProperty(value = "规格 KEY 编号", required = true, example = "1") - private Integer attrKeyId; - @ApiModelProperty(value = "规格 KEY 名字", required = true, example = "颜色") - private String attrKeyName; - @ApiModelProperty(value = "规格 VALUE 值", required = true, example = "10") - private Integer attrValueId; - @ApiModelProperty(value = "规格 VALUE 名字", required = true, example = "红色") - private String attrValueName; - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/vo/product/ProductSpuDetailRespVO.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/vo/product/ProductSpuDetailRespVO.java deleted file mode 100644 index f07a06299..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/vo/product/ProductSpuDetailRespVO.java +++ /dev/null @@ -1,61 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.product.vo.product; - -import cn.iocoder.mall.shopweb.controller.product.vo.attr.ProductAttrKeyValueRespVO; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.List; - -@ApiModel(value = "商品 SPU 详细 Response VO", description = "包括 SKU 信息 VO") -@Data -@Accessors(chain = true) -public class ProductSpuDetailRespVO { - - @ApiModelProperty(value = "SPU 编号", required = true, example = "1") - private Integer id; - - // ========== 基本信息 ========= - @ApiModelProperty(value = "SPU 名字", required = true, example = "芋艿") - private String name; - @ApiModelProperty(value = "卖点", required = true, example = "好吃好玩") - private String sellPoint; - @ApiModelProperty(value = "描述", required = true, example = "我是哈哈哈") - private String description; - @ApiModelProperty(value = "分类编号", required = true, example = "1") - private Integer cid; - @ApiModelProperty(value = "商品主图地址", required = true, example = "http://www.iocoder.cn/xxx.jpg", notes = "多个之间,使用逗号分隔") - private List picUrls; - - // ========== SKU ========= - - /** - * SKU 数组 - */ - private List skus; - - @ApiModel("商品 SKU 详细 Response VO") - @Data - @Accessors(chain = true) - public static class Sku implements Serializable { - - @ApiModelProperty(value = "sku 编号", required = true, example = "1") - private Integer id; - @ApiModelProperty(value = "SPU 编号", required = true, example = "1") - private Integer spuId; - @ApiModelProperty(value = "图片地址", required = true, example = "http://www.iocoder.cn") - private String picURL; - /** - * 规格值数组 - */ - private List attrs; - @ApiModelProperty(value = "价格,单位:分", required = true, example = "100") - private Integer price; - @ApiModelProperty(value = "库存数量", required = true, example = "100") - private Integer quantity; - - } - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/vo/product/ProductSpuPageReqVO.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/vo/product/ProductSpuPageReqVO.java deleted file mode 100644 index 563ac04ce..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/vo/product/ProductSpuPageReqVO.java +++ /dev/null @@ -1,25 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.product.vo.product; - -import cn.iocoder.common.framework.vo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -@ApiModel("商品 SPU 分页 Request VO") -@Data -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -public class ProductSpuPageReqVO extends PageParam { - - @ApiModelProperty(value = "分类编号", example = "1") - private Integer cid; - @ApiModelProperty(value = "关键字", example = "芋艿") - private String keyword; - @ApiModelProperty(value = "排序字段", example = "buyPrice", notes = "参见 SearchProductPageQuerySortFieldEnum 枚举") - private String sortField; - @ApiModelProperty(value = "排序顺序", example = "1") - private String sortOrder; - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/vo/product/ProductSpuSearchConditionRespVO.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/vo/product/ProductSpuSearchConditionRespVO.java deleted file mode 100644 index 7a80c0413..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/vo/product/ProductSpuSearchConditionRespVO.java +++ /dev/null @@ -1,32 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.product.vo.product; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.List; - -@ApiModel("商品 SPU 搜索条件 Response VO") -@Data -@Accessors(chain = true) -public class ProductSpuSearchConditionRespVO { - - @ApiModel("商品分类信息") - @Data - @Accessors(chain = true) - public static class Category { - - @ApiModelProperty(value = "分类编号", required = true, example = "1") - private Integer id; - @ApiModelProperty(value = "分类名称", required = true, example = "手机") - private String name; - - } - - /** - * 商品分类数组 - */ - private List categories; - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/vo/sku/ProductSkuCalcPriceRespVO.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/vo/sku/ProductSkuCalcPriceRespVO.java deleted file mode 100644 index b4dc56090..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/vo/sku/ProductSkuCalcPriceRespVO.java +++ /dev/null @@ -1,35 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.product.vo.sku; - -import cn.iocoder.mall.promotion.api.rpc.activity.dto.PromotionActivityRespDTO; -import io.swagger.annotations.ApiModel; -import lombok.Data; -import lombok.experimental.Accessors; - -@ApiModel("计算商品 SKU 价格结果 VO") -@Data -@Accessors(chain = true) -// TODO 芋艿:swagger 注解 -public class ProductSkuCalcPriceRespVO { - - /** - * 原价格,单位:分。 - */ - private Integer originalPrice; - /** - * 最终价格,单位:分。 - */ - private Integer buyPrice; - /** - * 满减送促销活动 - * - * TODO 芋艿,后续改成 VO - */ - private PromotionActivityRespDTO fullPrivilege; - /** - * 限时折扣促销活动 - * - * TODO 芋艿,后续改成 VO - */ - private PromotionActivityRespDTO timeLimitedDiscount; - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/BannerController.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/BannerController.java deleted file mode 100644 index 7474b2891..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/BannerController.java +++ /dev/null @@ -1,33 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.promotion; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.shopweb.controller.promotion.vo.brand.BannerRespVO; -import cn.iocoder.mall.shopweb.service.promotion.BannerManager; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -import static cn.iocoder.common.framework.vo.CommonResult.success; - -@RestController -@RequestMapping("/promotion/banner") -@Api(tags = "Banner API") -@Validated -public class BannerController { - - @Autowired - private BannerManager bannerManager; - - @GetMapping("/list") - @ApiOperation("获得所有 Banner 列表") - public CommonResult> listBanners() { - return success(bannerManager.listBanners()); - } - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/CouponCardController.http b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/CouponCardController.http deleted file mode 100644 index d42640384..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/CouponCardController.http +++ /dev/null @@ -1,23 +0,0 @@ -### /promotion/coupon-card/page 优惠劵分页(未使用) -GET {{shop-api-base-url}}/promotion/coupon-card/page?pageNo=1&pageSize=10&status=1 -Content-Type: application/x-www-form-urlencoded -Authorization: Bearer {{user-access-token}} - -### /promotion/coupon-card/page 优惠劵分页(已使用) -GET {{shop-api-base-url}}/promotion/coupon-card/page?pageNo=1&pageSize=10&status=2 -Content-Type: application/x-www-form-urlencoded -Authorization: Bearer {{user-access-token}} - -### /promotion/coupon-card/page 优惠劵分页(已过期) -GET {{shop-api-base-url}}/promotion/coupon-card/page?pageNo=1&pageSize=10&status=3 -Content-Type: application/x-www-form-urlencoded -Authorization: Bearer {{user-access-token}} - -### /promotion/coupon-card/create 用户领取优惠劵(成功) -POST {{shop-api-base-url}}/promotion/coupon-card/create -Content-Type: application/x-www-form-urlencoded -Authorization: Bearer {{user-access-token}} - -couponTemplateId=1 - -### diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/CouponCardController.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/CouponCardController.java deleted file mode 100644 index 2975796ae..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/CouponCardController.java +++ /dev/null @@ -1,43 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.promotion; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.security.user.core.context.UserSecurityContextHolder; -import cn.iocoder.mall.shopweb.controller.promotion.vo.coupon.card.CouponCardPageReqVO; -import cn.iocoder.mall.shopweb.controller.promotion.vo.coupon.card.CouponCardRespVO; -import cn.iocoder.mall.shopweb.service.promotion.CouponCardManager; -import cn.iocoder.security.annotations.RequiresAuthenticate; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import static cn.iocoder.common.framework.vo.CommonResult.success; - -@RestController -@RequestMapping("/promotion/coupon-card") -@Api(tags = "优惠劵 API") -@Validated -public class CouponCardController { - - @Autowired - private CouponCardManager couponCardManager; - - @GetMapping("/page") - @ApiOperation("获得优惠劵分页") - @RequiresAuthenticate - public CommonResult> pageCouponCard(CouponCardPageReqVO pageVO) { - return success(couponCardManager.pageCouponCard(UserSecurityContextHolder.getUserId(),pageVO)); - } - - @PostMapping("/create") - @ApiOperation("用户领取优惠劵") - @ApiImplicitParam(name = "couponTemplateId", value = "优惠劵模板编号", required = true, example = "1024") - @RequiresAuthenticate - public CommonResult createCouponCard(@RequestParam("couponTemplateId") Integer couponTemplateId) { - return success(couponCardManager.createCouponCard(UserSecurityContextHolder.getUserId(), couponTemplateId)); - } - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/CouponTemplateController.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/CouponTemplateController.java deleted file mode 100644 index 7b8146b31..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/CouponTemplateController.java +++ /dev/null @@ -1,34 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.promotion; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.shopweb.controller.promotion.vo.coupon.template.CouponTemplateRespVO; -import cn.iocoder.mall.shopweb.service.promotion.CouponTemplateManager; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import static cn.iocoder.common.framework.vo.CommonResult.success; - -@RestController -@RequestMapping("/promotion/coupon-template") -@Api(tags = "优惠劵(码)模板 API") -@Validated -public class CouponTemplateController { - - @Autowired - private CouponTemplateManager couponTemplateManager; - - @GetMapping("/get") - @ApiOperation(value = "优惠劵(码)模板信息") - @ApiImplicitParam(name = "id", value = "优惠劵(码)模板编号", required = true, example = "10") - public CommonResult getCouponTemplate(@RequestParam("id") Integer id) { - return success(couponTemplateManager.getCouponTemplate(id)); - } - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/vo/brand/BannerRespVO.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/vo/brand/BannerRespVO.java deleted file mode 100644 index 5ccb2cac8..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/vo/brand/BannerRespVO.java +++ /dev/null @@ -1,18 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.promotion.vo.brand; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -@ApiModel("Banner Response VO") -@Data -@Accessors(chain = true) -public class BannerRespVO { - - @ApiModelProperty(value = "跳转链接", required = true, example = "http://www.baidu.com") - private String url; - @ApiModelProperty(value = "图片链接", required = true, example = "http://www.iocoder.cn/01.jpg") - private String picUrl; - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/vo/coupon/card/CouponCardPageReqVO.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/vo/coupon/card/CouponCardPageReqVO.java deleted file mode 100644 index a64f3d785..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/vo/coupon/card/CouponCardPageReqVO.java +++ /dev/null @@ -1,17 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.promotion.vo.coupon.card; - -import cn.iocoder.common.framework.vo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; - -@ApiModel("优惠劵分页 Request VO") -@Data -@EqualsAndHashCode(callSuper = true) -public class CouponCardPageReqVO extends PageParam { - - @ApiModelProperty(value = "优惠码状态", required = true, example = "1", notes = "对应 CouponCardStatusEnum 枚举") - private Integer status; - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/vo/coupon/card/CouponCardRespVO.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/vo/coupon/card/CouponCardRespVO.java deleted file mode 100644 index 52e95967d..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/vo/coupon/card/CouponCardRespVO.java +++ /dev/null @@ -1,51 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.promotion.vo.coupon.card; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.time.LocalDateTime; - -@ApiModel("优惠劵 Response VO") -@Data -@Accessors(chain = true) -public class CouponCardRespVO { - - // ========== 基本信息 BEGIN ========== - @ApiModelProperty(value = "优惠劵编号", required = true, example = "1") - private Integer id; - @ApiModelProperty(value = "模板编号,自增唯一", required = true, example = "1") - private Integer templateId; - @ApiModelProperty(value = "优惠劵名", required = true, example = "大保剑") - private String title; - @ApiModelProperty(value = "优惠码状态", required = true, example = "参见 CouponCardStatusEnum 枚举") - private Integer status; - - // ========== 基本信息 END ========== - - // ========== 使用规则 BEGIN ========== - @ApiModelProperty(value = "是否设置满多少金额可用,单位:分", required = true) - private Integer priceAvailable; - @ApiModelProperty(value = "固定日期-生效开始时间", required = true) - private LocalDateTime validStartTime; - @ApiModelProperty(value = "固定日期-生效结束时间", required = true) - private LocalDateTime validEndTime; - // ========== 使用规则 END ========== - - // ========== 使用效果 BEGIN ========== - @ApiModelProperty(value = "优惠类型", required = true, example = "参见 CouponTemplatePreferentialTypeEnum 枚举") - private Integer preferentialType; - @ApiModelProperty(value = "折扣百分比") - private Integer percentOff; - @ApiModelProperty(value = "优惠金额,单位:分") - private Integer priceOff; - @ApiModelProperty(value = "折扣上限") - private Integer discountPriceLimit; - // ========== 使用效果 END ========== - - // ========== 使用情况 BEGIN ========== - - // ========== 使用情况 END ========== - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/vo/coupon/template/CouponTemplateRespVO.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/vo/coupon/template/CouponTemplateRespVO.java deleted file mode 100644 index d9c2cceea..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/vo/coupon/template/CouponTemplateRespVO.java +++ /dev/null @@ -1,80 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.promotion.vo.coupon.template; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.time.LocalDateTime; -import java.util.List; - -@ApiModel("优惠劵(码)模板 VO") -@Data -@Accessors(chain = true) -public class CouponTemplateRespVO { - - // ========== 基本信息 BEGIN ========== - @ApiModelProperty(value = "模板编号,自增唯一", required = true, example = "1") - private Integer id; - @ApiModelProperty(value = "标题", required = true, example = "优惠劵牛逼") - private String title; - @ApiModelProperty(value = "使用说明", required = true, example = "我只是描述") - private String description; - @ApiModelProperty(value = "优惠劵类型", required = true, example = "1", notes = "参见 CouponTemplateTypeEnum 枚举") - private Integer type; - /** - * 码类型 - * - * 1-一卡一码(UNIQUE) - * 2-通用码(GENERAL) - * - * 【优惠码独有】 @see CouponCodeDO - */ - private Integer codeType; - @ApiModelProperty(value = "优惠码状态", required = true, example = "1", notes = "参见 CouponTemplateStatusEnum 枚举") - private Integer status; - @ApiModelProperty(value = "每人限领个数", example = "1", notes = "null - 则表示不限制") - private Integer quota; - @ApiModelProperty(value = "发放总量", example = "100") - private Integer total; - // ========== 领取规则 END ========== - - // ========== 使用规则 BEGIN ========== - @ApiModelProperty(value = "是否设置满多少金额可用,单位:分", required = true, example = "0", notes = "0-不限制;大于0-多少金额可用") - private Integer priceAvailable; - @ApiModelProperty(value = "可用范围的类型", required = true, example = "10", notes = "参见 RangeTypeEnum 枚举") - private Integer rangeType; - @ApiModelProperty(value = "指定商品 / 分类列表,使用逗号分隔商品编号", example = "1,3,5") - private List rangeValues; - @ApiModelProperty(value = "生效日期类型", example = "1", notes = "参见 CouponTemplateDateTypeEnum 枚举") - private Integer dateType; - @ApiModelProperty(value = "固定日期-生效开始时间", notes = "当 dateType 为固定日期时,非空") - private LocalDateTime validStartTime; - @ApiModelProperty(value = "固定日期-生效结束时间", notes = "当 dateType 为固定日期时,非空") - private LocalDateTime validEndTime; - @ApiModelProperty(value = "领取日期-开始天数", example = "0", notes = "例如,0-当天;1-次天") - private Integer fixedStartTerm; - @ApiModelProperty(value = "领取日期-结束天数", example = "1", notes = "当 dateType 为领取日期时,非空") - private Integer fixedEndTerm; - // ========== 使用规则 END ========== - - // ========== 使用效果 BEGIN ========== - @ApiModelProperty(value = "优惠类型", required = true, example = "1", notes = "参见 PreferentialTypeEnum 枚举") - private Integer preferentialType; - @ApiModelProperty(value = "折扣百分比", example = "80", notes = "当 preferentialType 为现金券时,非空") - private Integer percentOff; - @ApiModelProperty(value = "优惠金额,单位:分", example = "100", notes = "当 preferentialType 为折扣卷时,非空") - private Integer priceOff; - @ApiModelProperty(value = "折扣上限", example = "100", notes = "当 preferentialType 为折扣卷时,非空") - private Integer discountPriceLimit; - // ========== 使用效果 END ========== - - // ========== 统计信息 BEGIN ========== - @ApiModelProperty(value = "领取优惠券的次数", required = true) - private Integer statFetchNum; - // ========== 统计信息 END ========== - - @ApiModelProperty(value = "创建时间", required = true) - private LocalDateTime createTime; - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/pay/PayTransactionConvert.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/pay/PayTransactionConvert.java deleted file mode 100644 index f0f9ddfea..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/pay/PayTransactionConvert.java +++ /dev/null @@ -1,23 +0,0 @@ -package cn.iocoder.mall.shopweb.convert.pay; - -import cn.iocoder.mall.payservice.rpc.transaction.dto.PayTransactionRespDTO; -import cn.iocoder.mall.payservice.rpc.transaction.dto.PayTransactionSubmitReqDTO; -import cn.iocoder.mall.payservice.rpc.transaction.dto.PayTransactionSubmitRespDTO; -import cn.iocoder.mall.shopweb.controller.pay.vo.transaction.PayTransactionRespVO; -import cn.iocoder.mall.shopweb.controller.pay.vo.transaction.PayTransactionSubmitReqVO; -import cn.iocoder.mall.shopweb.controller.pay.vo.transaction.PayTransactionSubmitRespVO; -import org.mapstruct.Mapper; -import org.mapstruct.factory.Mappers; - -@Mapper -public interface PayTransactionConvert { - - PayTransactionConvert INSTANCE = Mappers.getMapper(PayTransactionConvert.class); - - PayTransactionSubmitReqDTO convert(PayTransactionSubmitReqVO bean); - - PayTransactionSubmitRespVO convert(PayTransactionSubmitRespDTO bean); - - PayTransactionRespVO convert(PayTransactionRespDTO bean); - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/product/ProductSkuConvert.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/product/ProductSkuConvert.java deleted file mode 100644 index 3f4271137..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/product/ProductSkuConvert.java +++ /dev/null @@ -1,20 +0,0 @@ -package cn.iocoder.mall.shopweb.convert.product; - -import cn.iocoder.mall.promotion.api.rpc.activity.dto.PromotionActivityRespDTO; -import cn.iocoder.mall.promotion.api.rpc.price.dto.PriceProductCalcRespDTO; -import cn.iocoder.mall.shopweb.controller.product.vo.sku.ProductSkuCalcPriceRespVO; -import org.mapstruct.Mapper; -import org.mapstruct.factory.Mappers; - -@Mapper -public interface ProductSkuConvert { - - ProductSkuConvert INSTANCE = Mappers.getMapper(ProductSkuConvert.class); - - default ProductSkuCalcPriceRespVO convert(PriceProductCalcRespDTO.Item item, - PromotionActivityRespDTO fullPrivilege, PromotionActivityRespDTO timeLimitedDiscount) { - return new ProductSkuCalcPriceRespVO().setOriginalPrice(item.getOriginPrice()).setBuyPrice(item.getBuyPrice()) - .setFullPrivilege(fullPrivilege).setTimeLimitedDiscount(timeLimitedDiscount); - } - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/product/ProductSpuConvert.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/product/ProductSpuConvert.java deleted file mode 100644 index 976b763b7..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/product/ProductSpuConvert.java +++ /dev/null @@ -1,41 +0,0 @@ -package cn.iocoder.mall.shopweb.convert.product; - -import cn.iocoder.common.framework.util.StringUtils; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.common.framework.vo.SortingField; -import cn.iocoder.mall.productservice.rpc.category.dto.ProductCategoryRespDTO; -import cn.iocoder.mall.productservice.rpc.spu.dto.ProductSpuDetailRespDTO; -import cn.iocoder.mall.searchservice.rpc.product.dto.SearchProductPageReqDTO; -import cn.iocoder.mall.searchservice.rpc.product.dto.SearchProductRespDTO; -import cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuDetailRespVO; -import cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuPageReqVO; -import cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuRespVO; -import cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuSearchConditionRespVO; -import org.mapstruct.Mapper; -import org.mapstruct.factory.Mappers; - -import java.util.Collections; -import java.util.List; - -@Mapper -public interface ProductSpuConvert { - - ProductSpuConvert INSTANCE = Mappers.getMapper(ProductSpuConvert.class); - - default SearchProductPageReqDTO convert(ProductSpuPageReqVO bean) { - SearchProductPageReqDTO reqDTO = new SearchProductPageReqDTO() - .setCid(bean.getCid()).setKeyword(bean.getKeyword()); - reqDTO.setPageNo(bean.getPageNo()).setPageSize(bean.getPageSize()); - if (StringUtils.hasText(bean.getSortField()) && StringUtils.hasText(bean.getSortOrder())) { - reqDTO.setSorts(Collections.singletonList(new SortingField(bean.getSortField(), bean.getSortOrder()))); - } - return reqDTO; - } - - PageResult convertPage(PageResult page); - - List convertList(List list); - - ProductSpuDetailRespVO convert(ProductSpuDetailRespDTO bean); - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/promotion/CouponCardConvert.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/promotion/CouponCardConvert.java deleted file mode 100644 index 543debce8..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/promotion/CouponCardConvert.java +++ /dev/null @@ -1,23 +0,0 @@ -package cn.iocoder.mall.shopweb.convert.promotion; - -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.promotion.api.rpc.coupon.dto.card.CouponCardPageReqDTO; -import cn.iocoder.mall.promotion.api.rpc.coupon.dto.card.CouponCardRespDTO; -import cn.iocoder.mall.shopweb.controller.promotion.vo.coupon.card.CouponCardPageReqVO; -import cn.iocoder.mall.shopweb.controller.promotion.vo.coupon.card.CouponCardRespVO; -import org.mapstruct.Mapper; -import org.mapstruct.factory.Mappers; - -/** - * 优惠劵 Convert - */ -@Mapper -public interface CouponCardConvert { - - CouponCardConvert INSTANCE = Mappers.getMapper(CouponCardConvert.class); - - PageResult convertPage(PageResult page); - - CouponCardPageReqDTO convert(CouponCardPageReqVO bean); - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/promotion/CouponTemplateConvert.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/promotion/CouponTemplateConvert.java deleted file mode 100644 index b098ea739..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/promotion/CouponTemplateConvert.java +++ /dev/null @@ -1,15 +0,0 @@ -package cn.iocoder.mall.shopweb.convert.promotion; - -import cn.iocoder.mall.promotion.api.rpc.coupon.dto.template.CouponTemplateRespDTO; -import cn.iocoder.mall.shopweb.controller.promotion.vo.coupon.template.CouponTemplateRespVO; -import org.mapstruct.Mapper; -import org.mapstruct.factory.Mappers; - -@Mapper -public interface CouponTemplateConvert { - - CouponTemplateConvert INSTANCE = Mappers.getMapper(CouponTemplateConvert.class); - - CouponTemplateRespVO convert(CouponTemplateRespDTO bean); - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/promotion/ProductRecommendConvert.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/promotion/ProductRecommendConvert.java deleted file mode 100644 index 4494df723..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/promotion/ProductRecommendConvert.java +++ /dev/null @@ -1,15 +0,0 @@ -package cn.iocoder.mall.shopweb.convert.promotion; - -import cn.iocoder.mall.productservice.rpc.spu.dto.ProductSpuRespDTO; -import cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuRespVO; -import org.mapstruct.Mapper; -import org.mapstruct.factory.Mappers; - -@Mapper -public interface ProductRecommendConvert { - - ProductRecommendConvert INSTANCE = Mappers.getMapper(ProductRecommendConvert.class); - - ProductSpuRespVO convert(ProductSpuRespDTO bean); - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/trade/CartConvert.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/trade/CartConvert.java deleted file mode 100644 index beed9a262..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/trade/CartConvert.java +++ /dev/null @@ -1,21 +0,0 @@ -package cn.iocoder.mall.shopweb.convert.trade; - -import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuRespDTO; -import cn.iocoder.mall.promotion.api.rpc.activity.dto.PromotionActivityRespDTO; -import cn.iocoder.mall.promotion.api.rpc.price.dto.PriceProductCalcRespDTO; -import cn.iocoder.mall.shopweb.controller.trade.vo.cart.CartDetailVO; -import org.mapstruct.Mapper; -import org.mapstruct.Mapping; -import org.mapstruct.factory.Mappers; - -@Mapper -public interface CartConvert { - - CartConvert INSTANCE = Mappers.getMapper(CartConvert.class); - - CartDetailVO.Fee convert(PriceProductCalcRespDTO.Fee bean); - - @Mapping(source = "sku.id", target = "id") - CartDetailVO.Sku convert(PriceProductCalcRespDTO.Item item, ProductSkuRespDTO sku, PromotionActivityRespDTO activity); - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/trade/TradeOrderConvert.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/trade/TradeOrderConvert.java deleted file mode 100644 index 69576da8d..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/trade/TradeOrderConvert.java +++ /dev/null @@ -1,48 +0,0 @@ -package cn.iocoder.mall.shopweb.convert.trade; - -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.promotion.api.rpc.coupon.dto.card.CouponCardAvailableListReqDTO; -import cn.iocoder.mall.promotion.api.rpc.price.dto.PriceProductCalcRespDTO; -import cn.iocoder.mall.shopweb.controller.trade.vo.order.TradeOrderConfirmCreateInfoRespVO; -import cn.iocoder.mall.shopweb.controller.trade.vo.order.TradeOrderCreateReqVO; -import cn.iocoder.mall.shopweb.controller.trade.vo.order.TradeOrderPageReqVO; -import cn.iocoder.mall.shopweb.controller.trade.vo.order.TradeOrderRespVO; -import cn.iocoder.mall.tradeservice.rpc.order.dto.TradeOrderCreateReqDTO; -import cn.iocoder.mall.tradeservice.rpc.order.dto.TradeOrderPageReqDTO; -import cn.iocoder.mall.tradeservice.rpc.order.dto.TradeOrderRespDTO; -import org.mapstruct.Mapper; -import org.mapstruct.factory.Mappers; - -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; - -@Mapper -public interface TradeOrderConvert { - - TradeOrderConvert INSTANCE = Mappers.getMapper(TradeOrderConvert.class); - - TradeOrderConfirmCreateInfoRespVO.Fee convert(PriceProductCalcRespDTO.Fee bean); - - default List convertList(List itemGroups) { - List items = new ArrayList<>(); - itemGroups.forEach(itemGroup -> items.addAll(itemGroup.getItems().stream().map( - item -> new CouponCardAvailableListReqDTO.Item() - .setSpuId(item.getSpuId()) - .setSkuId(item.getSkuId()) - .setCid(item.getCid()) - .setPrice(item.getBuyPrice()) - .setQuantity(item.getBuyQuantity())) - .collect(Collectors.toList()))); - return items; - } - - TradeOrderCreateReqDTO convert(TradeOrderCreateReqVO bean); - - TradeOrderPageReqDTO convert(TradeOrderPageReqVO bean); - - PageResult convertPage(PageResult page); - - TradeOrderRespVO convert(TradeOrderRespDTO bean); - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/pay/PayTransactionService.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/pay/PayTransactionService.java deleted file mode 100644 index 92fca0757..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/pay/PayTransactionService.java +++ /dev/null @@ -1,32 +0,0 @@ -package cn.iocoder.mall.shopweb.service.pay; - -import cn.iocoder.mall.payservice.rpc.transaction.dto.PayTransactionSubmitRespDTO; -import cn.iocoder.mall.shopweb.client.pay.PayTransactionClient; -import cn.iocoder.mall.shopweb.controller.pay.vo.transaction.PayTransactionRespVO; -import cn.iocoder.mall.shopweb.controller.pay.vo.transaction.PayTransactionSubmitReqVO; -import cn.iocoder.mall.shopweb.controller.pay.vo.transaction.PayTransactionSubmitRespVO; -import cn.iocoder.mall.shopweb.convert.pay.PayTransactionConvert; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -public class PayTransactionService { - - @Autowired - private PayTransactionClient payTransactionClient; - - public PayTransactionSubmitRespVO submitPayTransaction(PayTransactionSubmitReqVO submitReqVO, String ip) { - PayTransactionSubmitRespDTO submitPayTransaction = payTransactionClient.submitPayTransaction( - PayTransactionConvert.INSTANCE.convert(submitReqVO).setCreateIp(ip)); - return PayTransactionConvert.INSTANCE.convert(submitPayTransaction); - } - - public PayTransactionRespVO getPayTransaction(Integer userId, String appId, String orderId) { - return PayTransactionConvert.INSTANCE.convert(payTransactionClient.getPayTransaction(userId, appId, orderId)); - } - - public void updatePayTransactionSuccess(Integer payChannel, String params) { - payTransactionClient.updatePayTransactionSuccess(payChannel, params); - } - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/product/ProductCategoryManager.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/product/ProductCategoryManager.java deleted file mode 100644 index 503105b8e..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/product/ProductCategoryManager.java +++ /dev/null @@ -1,34 +0,0 @@ -package cn.iocoder.mall.shopweb.service.product; - -import cn.iocoder.common.framework.enums.CommonStatusEnum; -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.productservice.rpc.category.ProductCategoryFeign; -import cn.iocoder.mall.productservice.rpc.category.dto.ProductCategoryListQueryReqDTO; -import cn.iocoder.mall.productservice.rpc.category.dto.ProductCategoryRespDTO; -import cn.iocoder.mall.shopweb.controller.product.vo.category.ProductCategoryRespVO; -import cn.iocoder.mall.shopweb.convert.product.ProductCategoryConvert; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.validation.annotation.Validated; - -import java.util.List; - -/** - * Product 分类 Manager - */ -@Service -@Validated -public class ProductCategoryManager { - - - @Autowired - private ProductCategoryFeign productCategoryFeign; - - public List listProductCategories(Integer pid) { - CommonResult> listProductCategoriesResult = productCategoryFeign.listProductCategories( - new ProductCategoryListQueryReqDTO().setPid(pid).setStatus(CommonStatusEnum.ENABLE.getValue())); - listProductCategoriesResult.checkError(); - return ProductCategoryConvert.INSTANCE.convertList(listProductCategoriesResult.getData()); - } - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/product/ProductSkuManager.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/product/ProductSkuManager.java deleted file mode 100644 index 1acb589a8..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/product/ProductSkuManager.java +++ /dev/null @@ -1,60 +0,0 @@ -package cn.iocoder.mall.shopweb.service.product; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.promotion.api.rpc.activity.PromotionActivityFeign; -import cn.iocoder.mall.promotion.api.rpc.activity.dto.PromotionActivityListReqDTO; -import cn.iocoder.mall.promotion.api.rpc.activity.dto.PromotionActivityRespDTO; -import cn.iocoder.mall.promotion.api.rpc.price.PriceFeign; -import cn.iocoder.mall.promotion.api.rpc.price.dto.PriceProductCalcReqDTO; -import cn.iocoder.mall.promotion.api.rpc.price.dto.PriceProductCalcRespDTO; -import cn.iocoder.mall.shopweb.controller.product.vo.sku.ProductSkuCalcPriceRespVO; -import cn.iocoder.mall.shopweb.convert.product.ProductSkuConvert; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.validation.annotation.Validated; - -import java.util.Collections; -import java.util.List; - -/** - * 商品 SKU Manager - */ -@Service -@Validated -public class ProductSkuManager { - - - @Autowired - private PriceFeign priceFeign; - @Autowired - private PromotionActivityFeign promotionActivityFeign; - /** - * 计算商品 SKU 价格 - * - * @param userId 用户编号 - * @param skuId 商品 SKU 编号 - * @return SKU 价格明细 - */ - public ProductSkuCalcPriceRespVO calcProductSkuPrice(Integer userId, Integer skuId) { - CommonResult calcProductPriceResult = priceFeign.calcProductPrice(new PriceProductCalcReqDTO().setUserId(userId) - .setItems(Collections.singletonList(new PriceProductCalcReqDTO.Item(skuId, 1, true)))); - calcProductPriceResult.checkError(); - // 拼接结果 - PriceProductCalcRespDTO.ItemGroup itemGroup = calcProductPriceResult.getData().getItemGroups().get(0); - // 1. 加载 满减送 促销活动 - PromotionActivityRespDTO fullPrivilege = itemGroup.getActivityId() != null ? this.getPromotionActivity(itemGroup.getActivityId()) : null; - // 2. 加载 限时折扣 促销活动 - PriceProductCalcRespDTO.Item item = itemGroup.getItems().get(0); - PromotionActivityRespDTO timeLimitedDiscount = item.getActivityId() != null ? this.getPromotionActivity(item.getActivityId()) : null; - // 3. 最终组装 - return ProductSkuConvert.INSTANCE.convert(item, fullPrivilege, timeLimitedDiscount); - } - - private PromotionActivityRespDTO getPromotionActivity(Integer activityId) { - CommonResult> listPromotionActivitiesResult = promotionActivityFeign.listPromotionActivities( - new PromotionActivityListReqDTO().setActiveIds(Collections.singleton(activityId))); - listPromotionActivitiesResult.checkError(); - return listPromotionActivitiesResult.getData().get(0); - } - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/product/ProductSpuManager.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/product/ProductSpuManager.java deleted file mode 100644 index 574905c38..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/product/ProductSpuManager.java +++ /dev/null @@ -1,77 +0,0 @@ -package cn.iocoder.mall.shopweb.service.product; - -import cn.iocoder.common.framework.util.CollectionUtils; -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.productservice.enums.spu.ProductSpuDetailFieldEnum; -import cn.iocoder.mall.productservice.rpc.category.ProductCategoryFeign; -import cn.iocoder.mall.productservice.rpc.category.dto.ProductCategoryRespDTO; -import cn.iocoder.mall.productservice.rpc.spu.ProductSpuFeign; -import cn.iocoder.mall.productservice.rpc.spu.dto.ProductSpuDetailRespDTO; -import cn.iocoder.mall.searchservice.enums.product.SearchProductConditionFieldEnum; -import cn.iocoder.mall.searchservice.rpc.product.SearchProductFeign; -import cn.iocoder.mall.searchservice.rpc.product.dto.SearchProductConditionReqDTO; -import cn.iocoder.mall.searchservice.rpc.product.dto.SearchProductConditionRespDTO; -import cn.iocoder.mall.searchservice.rpc.product.dto.SearchProductRespDTO; -import cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuDetailRespVO; -import cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuPageReqVO; -import cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuRespVO; -import cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuSearchConditionRespVO; -import cn.iocoder.mall.shopweb.convert.product.ProductSpuConvert; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.validation.annotation.Validated; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -/** - * 商品 SPU Manager - */ -@Service -@Validated -public class ProductSpuManager { - - @Autowired - private SearchProductFeign searchProductFeign; - - @Autowired - private ProductCategoryFeign productCategoryFeign; - @Autowired - private ProductSpuFeign productSpuFeign; - - public PageResult pageProductSpu(ProductSpuPageReqVO pageReqVO) { - CommonResult> pageResult = - searchProductFeign.pageSearchProduct(ProductSpuConvert.INSTANCE.convert(pageReqVO)); - pageResult.checkError(); - return ProductSpuConvert.INSTANCE.convertPage(pageResult.getData()); - } - - public ProductSpuSearchConditionRespVO getProductSpuSearchCondition(String keyword) { - // 获得搜索条件 - CommonResult getSearchProductConditionResult = - searchProductFeign.getSearchProductCondition(new SearchProductConditionReqDTO().setKeyword(keyword) - .setFields(Collections.singletonList(SearchProductConditionFieldEnum.CATEGORY.getField()))); - getSearchProductConditionResult.checkError(); - // 拼接结果 - ProductSpuSearchConditionRespVO conditionRespVO = new ProductSpuSearchConditionRespVO(); - if (CollectionUtils.isEmpty(getSearchProductConditionResult.getData().getCids())) { - conditionRespVO.setCategories(Collections.emptyList()); - } else { - CommonResult> listProductCategoriesResult = - productCategoryFeign.listProductCategoriesByIds(getSearchProductConditionResult.getData().getCids()); - listProductCategoriesResult.checkError(); - conditionRespVO.setCategories(ProductSpuConvert.INSTANCE.convertList(listProductCategoriesResult.getData())); - } - return conditionRespVO; - } - - public ProductSpuDetailRespVO getProductSpuDetail(Integer id) { - CommonResult getProductSpuDetailResult = productSpuFeign.getProductSpuDetail(id, - Arrays.asList(ProductSpuDetailFieldEnum.SKU.getField(), ProductSpuDetailFieldEnum.ATTR.getField())); - getProductSpuDetailResult.checkError(); - return ProductSpuConvert.INSTANCE.convert(getProductSpuDetailResult.getData()); - } - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/promotion/CouponCardManager.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/promotion/CouponCardManager.java deleted file mode 100644 index c5abb432b..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/promotion/CouponCardManager.java +++ /dev/null @@ -1,50 +0,0 @@ -package cn.iocoder.mall.shopweb.service.promotion; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.promotion.api.rpc.coupon.CouponCardFeign; -import cn.iocoder.mall.promotion.api.rpc.coupon.dto.card.CouponCardCreateReqDTO; -import cn.iocoder.mall.promotion.api.rpc.coupon.dto.card.CouponCardRespDTO; -import cn.iocoder.mall.shopweb.controller.promotion.vo.coupon.card.CouponCardPageReqVO; -import cn.iocoder.mall.shopweb.controller.promotion.vo.coupon.card.CouponCardRespVO; -import cn.iocoder.mall.shopweb.convert.promotion.CouponCardConvert; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * 优惠劵 Manager - */ -@Service -public class CouponCardManager { - - @Autowired - private CouponCardFeign couponCardFeign; - /** - * 获得优惠劵分页 - * - * @param userId 用户编号 - * @param pageVO 优惠劵分页查询 - * @return 优惠劵分页结果 - */ - public PageResult pageCouponCard(Integer userId, CouponCardPageReqVO pageVO) { - CommonResult> pageCouponCardResult = couponCardFeign.pageCouponCard( - CouponCardConvert.INSTANCE.convert(pageVO).setUserId(userId)); - pageCouponCardResult.checkError(); - return CouponCardConvert.INSTANCE.convertPage(pageCouponCardResult.getData()); - } - - /** - * 用户领取优惠劵 - * - * @param userId 用户编号 - * @param couponTemplateId 优惠劵模板编号 - * @return 优惠劵编号 - */ - public Integer createCouponCard(Integer userId, Integer couponTemplateId) { - CommonResult createCouponCardResult = couponCardFeign.createCouponCard( - new CouponCardCreateReqDTO().setUserId(userId).setCouponTemplateId(couponTemplateId)); - createCouponCardResult.checkError(); - return createCouponCardResult.getData(); - } - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/promotion/CouponTemplateManager.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/promotion/CouponTemplateManager.java deleted file mode 100644 index 7fbffc651..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/promotion/CouponTemplateManager.java +++ /dev/null @@ -1,23 +0,0 @@ -package cn.iocoder.mall.shopweb.service.promotion; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.promotion.api.rpc.coupon.CouponTemplateFeign; -import cn.iocoder.mall.promotion.api.rpc.coupon.dto.template.CouponTemplateRespDTO; -import cn.iocoder.mall.shopweb.controller.promotion.vo.coupon.template.CouponTemplateRespVO; -import cn.iocoder.mall.shopweb.convert.promotion.CouponTemplateConvert; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * 优惠劵(码)模板 Manager - */ -@Service -public class CouponTemplateManager { - @Autowired - private CouponTemplateFeign couponTemplateFeign; - public CouponTemplateRespVO getCouponTemplate(Integer id) { - CommonResult getCouponTemplateResult = couponTemplateFeign.getCouponTemplate(id); - getCouponTemplateResult.checkError(); - return CouponTemplateConvert.INSTANCE.convert(getCouponTemplateResult.getData()); - } -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/promotion/ProductRecommendManager.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/promotion/ProductRecommendManager.java deleted file mode 100644 index e0faa8353..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/promotion/ProductRecommendManager.java +++ /dev/null @@ -1,57 +0,0 @@ -package cn.iocoder.mall.shopweb.service.promotion; - -import cn.iocoder.common.framework.enums.CommonStatusEnum; -import cn.iocoder.common.framework.util.CollectionUtils; -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.productservice.rpc.spu.ProductSpuFeign; -import cn.iocoder.mall.productservice.rpc.spu.dto.ProductSpuRespDTO; -import cn.iocoder.mall.promotion.api.rpc.recommend.ProductRecommendFeign; -import cn.iocoder.mall.promotion.api.rpc.recommend.dto.ProductRecommendListReqDTO; -import cn.iocoder.mall.promotion.api.rpc.recommend.dto.ProductRecommendRespDTO; -import cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuRespVO; -import cn.iocoder.mall.shopweb.convert.promotion.ProductRecommendConvert; -import com.google.common.collect.HashMultimap; -import com.google.common.collect.Multimap; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.validation.annotation.Validated; - -import java.util.Collection; -import java.util.Comparator; -import java.util.List; -import java.util.Map; - -/** - * 商品推荐 Manager - */ -@Service -@Validated -public class ProductRecommendManager { - @Autowired - private ProductRecommendFeign productRecommendFeign; - @Autowired - private ProductSpuFeign productSpuFeign; - - public Map> listProductRecommends() { - // 查询商品推荐列表 - CommonResult> listProductRecommendsResult = productRecommendFeign.listProductRecommends( - new ProductRecommendListReqDTO().setStatus(CommonStatusEnum.ENABLE.getValue())); - listProductRecommendsResult.checkError(); - listProductRecommendsResult.getData().sort(Comparator.comparing(ProductRecommendRespDTO::getSort)); // 排序,按照 sort 升序 - // 获得商品集合 - Map spuMap = this.getProductSkuMap(listProductRecommendsResult.getData()); - // 组合结果,返回 - Multimap result = HashMultimap.create(); - listProductRecommendsResult.getData().forEach(productRecommendBO -> result.put(productRecommendBO.getType(), - ProductRecommendConvert.INSTANCE.convert(spuMap.get(productRecommendBO.getProductSpuId())))); - return result.asMap(); - } - - private Map getProductSkuMap(List productRecommends) { - CommonResult> listProductSpusResult = productSpuFeign.listProductSpus( - CollectionUtils.convertSet(productRecommends, ProductRecommendRespDTO::getProductSpuId)); - listProductSpusResult.checkError(); - return CollectionUtils.convertMap(listProductSpusResult.getData(), ProductSpuRespDTO::getId); - } - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/trade/CartManager.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/trade/CartManager.java deleted file mode 100644 index 0b62c71b7..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/trade/CartManager.java +++ /dev/null @@ -1,99 +0,0 @@ -package cn.iocoder.mall.shopweb.service.trade; - -import cn.iocoder.common.framework.util.CollectionUtils; -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.productservice.enums.sku.ProductSkuDetailFieldEnum; -import cn.iocoder.mall.productservice.rpc.sku.ProductSkuFeign; -import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuListQueryReqDTO; -import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuRespDTO; -import cn.iocoder.mall.promotion.api.rpc.activity.PromotionActivityFeign; -import cn.iocoder.mall.promotion.api.rpc.activity.dto.PromotionActivityListReqDTO; -import cn.iocoder.mall.promotion.api.rpc.activity.dto.PromotionActivityRespDTO; -import cn.iocoder.mall.promotion.api.rpc.price.PriceFeign; -import cn.iocoder.mall.promotion.api.rpc.price.dto.PriceProductCalcReqDTO; -import cn.iocoder.mall.promotion.api.rpc.price.dto.PriceProductCalcRespDTO; -import cn.iocoder.mall.shopweb.controller.trade.vo.cart.CartDetailVO; -import cn.iocoder.mall.shopweb.convert.trade.CartConvert; -import cn.iocoder.mall.tradeservice.rpc.cart.CartFeign; -import cn.iocoder.mall.tradeservice.rpc.cart.dto.*; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.*; -import java.util.stream.Collectors; - -/** - * 购物车 Manager - */ -@Service -public class CartManager { - - /** - * 查询用户的购物车的商品列表 - * - * @return 商品列表 - */ - public CartDetailVO getCartDetail(Integer userId) { - - // 计算商品价格 - CommonResult calcProductPriceResult = priceFeign.calcProductPrice(new PriceProductCalcReqDTO().setUserId(userId) - .setItems(listCartItemsResult.getData().stream() - .map(cartItem -> new PriceProductCalcReqDTO.Item(cartItem.getSkuId(), cartItem.getQuantity(), cartItem.getSelected())) - .collect(Collectors.toList()))); - calcProductPriceResult.checkError(); - // 获得促销活动信息 - Map promotionActivityMap = this.getPromotionActivityMap(calcProductPriceResult.getData()); - // 获得商品 SKU 信息 - Map productSkuMap = this.getProductSkuMap(listCartItemsResult.getData()); - // 拼接结果 - CartDetailVO cartDetailVO = new CartDetailVO(); - cartDetailVO.setFee(CartConvert.INSTANCE.convert(calcProductPriceResult.getData().getFee())); - cartDetailVO.setItemGroups(new ArrayList<>()); - for (PriceProductCalcRespDTO.ItemGroup itemGroupDTO : calcProductPriceResult.getData().getItemGroups()) { - CartDetailVO.ItemGroup itemGroupVO = new CartDetailVO.ItemGroup(); - cartDetailVO.getItemGroups().add(itemGroupVO); - // 活动信息 - if (itemGroupDTO.getActivityId() != null) { - itemGroupVO.setActivity(promotionActivityMap.get(itemGroupDTO.getActivityId())) - .setActivityDiscountTotal(itemGroupDTO.getActivityDiscountTotal()); - } - // 商品 SKU 信息 - itemGroupVO.setItems(new ArrayList<>()); - itemGroupDTO.getItems().forEach(item -> itemGroupVO.getItems().add(CartConvert.INSTANCE.convert(item, - productSkuMap.get(item.getSkuId()), promotionActivityMap.get(item.getActivityId())))); - } - return cartDetailVO; - } - - private Map getPromotionActivityMap(PriceProductCalcRespDTO calcRespDTO) { - // 获得所有促销活动编号 - Set activeIds = new HashSet<>(); - calcRespDTO.getItemGroups().forEach(itemGroup -> { - if (itemGroup.getActivityId() != null) { - activeIds.add(itemGroup.getActivityId()); - } - itemGroup.getItems().forEach(item -> { - if (item.getActivityId() != null) { - activeIds.add(item.getActivityId()); - } - }); - }); - if (CollectionUtils.isEmpty(activeIds)) { - return Collections.emptyMap(); - } - // 查询促销活动列表 - CommonResult> listPromotionActivitiesResult = - promotionActivityFeign.listPromotionActivities(new PromotionActivityListReqDTO().setActiveIds(activeIds)); - listPromotionActivitiesResult.checkError(); - return CollectionUtils.convertMap(listPromotionActivitiesResult.getData(), PromotionActivityRespDTO::getId); - } - - private Map getProductSkuMap(List itemRespDTOs) { - CommonResult> listProductSkusResult = productSkuFeign.listProductSkus(new ProductSkuListQueryReqDTO() - .setProductSkuIds(CollectionUtils.convertSet(itemRespDTOs, CartItemRespDTO::getSkuId)) - .setFields(Arrays.asList(ProductSkuDetailFieldEnum.SPU.getField(), ProductSkuDetailFieldEnum.ATTR.getField()))); - listProductSkusResult.checkError(); - return CollectionUtils.convertMap(listProductSkusResult.getData(), ProductSkuRespDTO::getId); - } - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/trade/TradeOrderService.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/trade/TradeOrderService.java deleted file mode 100644 index a804c81a3..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/trade/TradeOrderService.java +++ /dev/null @@ -1,203 +0,0 @@ -package cn.iocoder.mall.shopweb.service.trade; - -import cn.iocoder.common.framework.enums.CommonStatusEnum; -import cn.iocoder.common.framework.exception.util.ServiceExceptionUtil; -import cn.iocoder.common.framework.util.CollectionUtils; -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.productservice.enums.sku.ProductSkuDetailFieldEnum; -import cn.iocoder.mall.productservice.rpc.sku.ProductSkuFeign; -import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuListQueryReqDTO; -import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuRespDTO; -import cn.iocoder.mall.promotion.api.rpc.activity.PromotionActivityFeign; -import cn.iocoder.mall.promotion.api.rpc.activity.dto.PromotionActivityListReqDTO; -import cn.iocoder.mall.promotion.api.rpc.activity.dto.PromotionActivityRespDTO; -import cn.iocoder.mall.promotion.api.rpc.coupon.CouponCardFeign; -import cn.iocoder.mall.promotion.api.rpc.coupon.dto.card.CouponCardAvailableListReqDTO; -import cn.iocoder.mall.promotion.api.rpc.coupon.dto.card.CouponCardAvailableRespDTO; -import cn.iocoder.mall.promotion.api.rpc.price.PriceFeign; -import cn.iocoder.mall.promotion.api.rpc.price.dto.PriceProductCalcReqDTO; -import cn.iocoder.mall.promotion.api.rpc.price.dto.PriceProductCalcRespDTO; -import cn.iocoder.mall.shopweb.client.trade.TradeOrderClient; -import cn.iocoder.mall.shopweb.controller.trade.vo.order.TradeOrderConfirmCreateInfoRespVO; -import cn.iocoder.mall.shopweb.controller.trade.vo.order.TradeOrderCreateReqVO; -import cn.iocoder.mall.shopweb.controller.trade.vo.order.TradeOrderPageReqVO; -import cn.iocoder.mall.shopweb.controller.trade.vo.order.TradeOrderRespVO; -import cn.iocoder.mall.shopweb.convert.trade.CartConvert; -import cn.iocoder.mall.shopweb.convert.trade.TradeOrderConvert; -import cn.iocoder.mall.tradeservice.enums.order.TradeOrderDetailFieldEnum; -import cn.iocoder.mall.tradeservice.rpc.cart.CartFeign; -import cn.iocoder.mall.tradeservice.rpc.cart.dto.CartItemListReqDTO; -import cn.iocoder.mall.tradeservice.rpc.cart.dto.CartItemRespDTO; -import cn.iocoder.mall.tradeservice.rpc.order.dto.TradeOrderPageReqDTO; -import cn.iocoder.mall.tradeservice.rpc.order.dto.TradeOrderRespDTO; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.validation.annotation.Validated; - -import java.util.*; -import java.util.stream.Collectors; - -import static cn.iocoder.mall.shopweb.enums.ShopWebErrorCodeConstants.ORDER_PRODUCT_SKU_NOT_EXISTS; -import static cn.iocoder.mall.shopweb.enums.ShopWebErrorCodeConstants.ORDER_PRODUCT_SKU_QUANTITY_NOT_ENOUGH; - -/** - * 交易订单 Service - */ -@Service -@Validated -public class TradeOrderService { - - @Autowired - private PriceFeign priceFeign; - @Autowired - private PromotionActivityFeign promotionActivityFeign; - - @Autowired - private CartFeign cartFeign; - @Autowired - private CouponCardFeign couponCardFeign; - @Autowired - private ProductSkuFeign productSkuFeign; - - @Autowired - private TradeOrderClient tradeOrderClient; - - public TradeOrderConfirmCreateInfoRespVO getOrderConfirmCreateInfo(Integer userId, Integer skuId, Integer quantity, Integer couponCardId) { - Map skuMap = new HashMap<>(); - skuMap.put(skuId, quantity); - return this.getOrderConfirmCreateInfo0(userId, skuMap, couponCardId); - } - - public TradeOrderConfirmCreateInfoRespVO getOrderConfirmCreateInfoFromCart(Integer userId, Integer couponCardId) { - // 获得购物车的商品 - CommonResult> listCartItemsResult = cartFeign.listCartItems( - new CartItemListReqDTO().setUserId(userId).setSelected(true)); - listCartItemsResult.checkError(); - // 购物车为空时,构造空的 OrderConfirmCreateInfoRespVO 返回 - if (CollectionUtils.isEmpty(listCartItemsResult.getData())) { - TradeOrderConfirmCreateInfoRespVO result = new TradeOrderConfirmCreateInfoRespVO(); - result.setItemGroups(Collections.emptyList()); - result.setFee(new TradeOrderConfirmCreateInfoRespVO.Fee(0, 0, 0, 0)); - return result; - } - // 计算商品价格 - Map skuMap = CollectionUtils.convertMap(listCartItemsResult.getData(), - CartItemRespDTO::getSkuId, CartItemRespDTO::getQuantity); - return this.getOrderConfirmCreateInfo0(userId, skuMap, couponCardId); - } - - private TradeOrderConfirmCreateInfoRespVO getOrderConfirmCreateInfo0(Integer userId, Map skuMap, Integer couponCardId) { - // 校验商品都存在,并且库存足够 - this.checkProductSkus(skuMap); - // 获得商品 SKU 信息 - Map productSkuMap = this.checkProductSkus(skuMap); - // 计算商品价格 - CommonResult calcProductPriceResult = priceFeign.calcProductPrice(new PriceProductCalcReqDTO() - .setUserId(userId).setCouponCardId(couponCardId) - .setItems(skuMap.entrySet().stream().map(entry -> new PriceProductCalcReqDTO.Item(entry.getKey(), entry.getValue(), true)) - .collect(Collectors.toList()))); - calcProductPriceResult.checkError(); - // 获得促销活动信息 - Map promotionActivityMap = this.getPromotionActivityMap(calcProductPriceResult.getData()); - // 拼接结果 - TradeOrderConfirmCreateInfoRespVO createInfoRespVO = new TradeOrderConfirmCreateInfoRespVO(); - createInfoRespVO.setFee(TradeOrderConvert.INSTANCE.convert(calcProductPriceResult.getData().getFee())); - createInfoRespVO.setItemGroups(new ArrayList<>(calcProductPriceResult.getData().getItemGroups().size())); - for (PriceProductCalcRespDTO.ItemGroup itemGroupDTO : calcProductPriceResult.getData().getItemGroups()) { - TradeOrderConfirmCreateInfoRespVO.ItemGroup itemGroupVO = new TradeOrderConfirmCreateInfoRespVO.ItemGroup(); - createInfoRespVO.getItemGroups().add(itemGroupVO); - // 活动信息 - if (itemGroupDTO.getActivityId() != null) { - itemGroupVO.setActivity(promotionActivityMap.get(itemGroupDTO.getActivityId())) - .setActivityDiscountTotal(itemGroupDTO.getActivityDiscountTotal()); - } - // 商品 SKU 信息 - itemGroupVO.setItems(new ArrayList<>()); - itemGroupDTO.getItems().forEach(item -> itemGroupVO.getItems().add(CartConvert.INSTANCE.convert(item, - productSkuMap.get(item.getSkuId()), promotionActivityMap.get(item.getActivityId())))); - } - // 查询可用优惠劵信息 - CommonResult> listAvailableCouponCardsResult = couponCardFeign.listAvailableCouponCards( - new CouponCardAvailableListReqDTO().setUserId(userId) - .setItems(TradeOrderConvert.INSTANCE.convertList(calcProductPriceResult.getData().getItemGroups()))); - listAvailableCouponCardsResult.checkError(); - createInfoRespVO.setCouponCards(listAvailableCouponCardsResult.getData()); - return createInfoRespVO; - } - - private Map checkProductSkus(Map skuMap) { - // 获得商品 SKU 列表 - CommonResult> listProductSkusResult = productSkuFeign.listProductSkus(new ProductSkuListQueryReqDTO() - .setProductSkuIds(skuMap.keySet()) - .setFields(Arrays.asList(ProductSkuDetailFieldEnum.SPU.getField(), ProductSkuDetailFieldEnum.ATTR.getField()))); - listProductSkusResult.checkError(); - Map productSkuMap = CollectionUtils.convertMap(listProductSkusResult.getData(), ProductSkuRespDTO::getId); - // 校验商品 SKU 是否合法 - for (Map.Entry entry : skuMap.entrySet()) { - ProductSkuRespDTO productSku = productSkuMap.get(entry.getKey()); - if (productSku == null || !CommonStatusEnum.ENABLE.getValue().equals(productSku.getStatus())) { - throw ServiceExceptionUtil.exception(ORDER_PRODUCT_SKU_NOT_EXISTS); - } - if (productSku.getQuantity() < entry.getValue()) { - throw ServiceExceptionUtil.exception(ORDER_PRODUCT_SKU_QUANTITY_NOT_ENOUGH); - } - } - return productSkuMap; - } - - private Map getPromotionActivityMap(PriceProductCalcRespDTO calcRespDTO) { - // 获得所有促销活动编号 - Set activeIds = new HashSet<>(); - calcRespDTO.getItemGroups().forEach(itemGroup -> { - if (itemGroup.getActivityId() != null) { - activeIds.add(itemGroup.getActivityId()); - } - itemGroup.getItems().forEach(item -> { - if (item.getActivityId() != null) { - activeIds.add(item.getActivityId()); - } - }); - }); - if (CollectionUtils.isEmpty(activeIds)) { - return Collections.emptyMap(); - } - // 查询促销活动列表 - CommonResult> listPromotionActivitiesResult = - promotionActivityFeign.listPromotionActivities(new PromotionActivityListReqDTO().setActiveIds(activeIds)); - listPromotionActivitiesResult.checkError(); - return CollectionUtils.convertMap(listPromotionActivitiesResult.getData(), PromotionActivityRespDTO::getId); - } - - public Integer createTradeOrder(Integer userId, String ip, TradeOrderCreateReqVO createReqVO) { - return tradeOrderClient.createTradeOrder(TradeOrderConvert.INSTANCE.convert(createReqVO) - .setUserId(userId).setIp(ip)); - } - - /** - * 获得交易订单 - * - * @param tradeOrderId 交易订单编号 - * @return 交易订单 - */ - public TradeOrderRespVO getTradeOrder(Integer tradeOrderId) { - return TradeOrderConvert.INSTANCE.convert(tradeOrderClient.getTradeOrder(tradeOrderId, - TradeOrderDetailFieldEnum.ITEM.getField())); - } - - - /** - * 获得交易订单分页 - * - * @param pageVO 订单交易分页查询 - * @return 订单交易分页结果 - */ - public PageResult pageTradeOrder(Integer userId, TradeOrderPageReqVO pageVO) { - PageResult pageTradeOrderResult = tradeOrderClient.pageTradeOrder( - TradeOrderConvert.INSTANCE.convert(pageVO).setUserId(userId) - .setFields(Collections.singleton(TradeOrderDetailFieldEnum.ITEM.getField())) - .setSorts(Collections.singletonList(TradeOrderPageReqDTO.ID_DESC))); - return TradeOrderConvert.INSTANCE.convertPage(pageTradeOrderResult); - } - -} diff --git a/归档/trade-service-project/pom.xml b/归档/trade-service-project/pom.xml deleted file mode 100644 index c5c1866dd..000000000 --- a/归档/trade-service-project/pom.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - onemall - cn.iocoder.mall - 1.0-SNAPSHOT - - 4.0.0 - - trade-service-project - pom - - trade-service-api - trade-service-app - trade-service-integration-test - - - - - - - cn.iocoder.mall - mall-dependencies - 1.0-SNAPSHOT - pom - import - - - - - cn.iocoder.mall - trade-service-api - 1.0-SNAPSHOT - - - - - diff --git a/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/OrderErrorCodeConstants.java b/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/OrderErrorCodeConstants.java deleted file mode 100644 index 20f3261fd..000000000 --- a/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/OrderErrorCodeConstants.java +++ /dev/null @@ -1,46 +0,0 @@ -package cn.iocoder.mall.tradeservice.enums; - -import cn.iocoder.common.framework.exception.ErrorCode; - -/** - * 订单错误码 - *

- * 错误码区间 [1-008-000-000 ~ 1-008-000-000] - * - * @author Sin - * @time 2019-03-23 11:23 - */ -public interface OrderErrorCodeConstants { - - // order - ErrorCode ORDER_NOT_EXISTENT = new ErrorCode(1008000000, "获取订单不存在!"); - ErrorCode ORDER_GET_SKU_FAIL = new ErrorCode(1008000001, "获取商品失败!)"); - ErrorCode ORDER_GET_SKU_NOT_EXISTENT = new ErrorCode(1008000002, "获取的商品不存在!"); - ErrorCode ORDER_PAY_AMOUNT_NOT_NEGATIVE = new ErrorCode(1008000003, "支付金额不能为负数!"); - ErrorCode ORDER_STATUS_NOT_CANCEL = new ErrorCode(1008000004, "订单状态不能取消!)"); - ErrorCode ORDER_DELIVERY_INCORRECT_DATA = new ErrorCode(1008000005, "订单发货数据不正确!"); - ErrorCode ORDER_INSUFFICIENT_INVENTORY = new ErrorCode(1008000006, "库存不足!"); - ErrorCode ORDER_GOODS_AMOUNT_INCORRECT = new ErrorCode(1008000007, "商品金额非法!"); - ErrorCode ORDER_GET_GOODS_INFO_INCORRECT = new ErrorCode(1008000008, "获取额商品信息不正确!"); - ErrorCode ORDER_GET_USER_ADDRESS_FAIL = new ErrorCode(1008000009, "获取用户地址失败!"); - ErrorCode ORDER_GET_PAY_FAIL = new ErrorCode(1008000010, "调用pay失败!"); - ErrorCode ORDER_NOT_USER_ORDER = new ErrorCode(1008000011, "不是该用户的订单!"); - ErrorCode ORDER_UNABLE_CONFIRM_ORDER = new ErrorCode(1008000012, "状态不对不能确认订单!"); - ErrorCode ORDER_CREATE_CART_IS_EMPTY = new ErrorCode(1008000013, "购物车无选中的商品,无法创建订单"); - ErrorCode ORDER_STATUS_NOT_WAITING_PAYMENT = new ErrorCode(1008000014, "订单不处于等待支付状态"); - ErrorCode ORDER_PAY_AMOUNT_ERROR = new ErrorCode(1008000015, "订单金额不正确"); - - // order item - ErrorCode ORDER_ITEM_ONLY_ONE = new ErrorCode(1008000200, "订单Item只有一个!"); - ErrorCode ORDER_ITEM_SOME_NOT_EXISTS = new ErrorCode(1008000201, "有不存在的商品!"); - - // 订单退货 - ErrorCode ORDER_RETURN_NO_RETURN_APPLY = new ErrorCode(1008000400, "未退货申请"); - ErrorCode ORDER_RETURN_NOT_EXISTENT = new ErrorCode(1008000401, "退货订单不存在"); - ErrorCode ORDER_RETURN_REFUND_FAILED = new ErrorCode(1008000402, "退款失败"); - - // 工具类服务 1008004000 - ErrorCode DICT_SERVER_INVOKING_FAIL = new ErrorCode(1008004000, "字典服务调用失败!"); - ErrorCode ORDER_LOGISTICS_INVOKING_FAIL = new ErrorCode(1008004001, "订单物流调用失败!"); - -} diff --git a/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/aftersale/AfterSaleOrderStatusEnum.java b/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/aftersale/AfterSaleOrderStatusEnum.java deleted file mode 100644 index 8f87302c1..000000000 --- a/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/aftersale/AfterSaleOrderStatusEnum.java +++ /dev/null @@ -1,41 +0,0 @@ -package cn.iocoder.mall.tradeservice.enums.aftersale; - -import lombok.Getter; - -/** - * 售后订单的状态枚举 - * - * 整体流程,见 https://www.processon.com/view/link/5fbdf47f07912946156305d7 - * - * 1. 在退款的情况下,需要 1 个来回 - * 2. 在退货退款的情况下,需要 2 个来回,额外增加一个买家退货的过程 - * 3. 在换货的情况下,需要 3 个来回,额外增加一个买家退货 + 卖家发货的过程 - */ -@Getter -public enum AfterSaleOrderStatusEnum { - - WAIT_SELLER_AGREE(10, "售后申请待商家处理"), - WAIT_BUYER_RETURN_GOODS(20, "商家同意售后申请,待买家处理"), - SELLER_REFUSE_BUYER(30, "商家不同意售后申请,待买家处理"), - WAIT_SELLER_CONFIRM_GOODS(40, "买家已退货,待商家确认收货"), - WAIT_BUYER_CONFIRM_GOODS(50, "商家已发货,待买家确认收货"), - SELLER_REFUSE_RETURN_GOODS(60, "商家拒绝收货,待买家处理"), - SUCCESS(70, "售后成功"), - CLOSED(80, "售后失败"), - ; - - /** - * 类型 - */ - private final Integer status; - /** - * 描述 - */ - private final String desc; - - AfterSaleOrderStatusEnum(Integer status, String desc) { - this.status = status; - this.desc = desc; - } - -} diff --git a/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/aftersale/AfterSaleTypeEnum.java b/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/aftersale/AfterSaleTypeEnum.java deleted file mode 100644 index 7dea23d96..000000000 --- a/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/aftersale/AfterSaleTypeEnum.java +++ /dev/null @@ -1,28 +0,0 @@ -package cn.iocoder.mall.tradeservice.enums.aftersale; - -import lombok.Getter; - -/** - * 售后单的类型枚举 - */ -@Getter -public enum AfterSaleTypeEnum { - - IN_SALE(10, "售中退款"), - AFTER_SALE(20, "售后退款"); - - /** - * 类型 - */ - private final Integer type; - /** - * 描述 - */ - private final String desc; - - AfterSaleTypeEnum(Integer type, String desc) { - this.type = type; - this.desc = desc; - } - -} diff --git a/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/aftersale/AfterSaleWayEnum.java b/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/aftersale/AfterSaleWayEnum.java deleted file mode 100644 index 8d06828c4..000000000 --- a/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/aftersale/AfterSaleWayEnum.java +++ /dev/null @@ -1,29 +0,0 @@ -package cn.iocoder.mall.tradeservice.enums.aftersale; - -import lombok.Getter; - -/** - * 售后单的方式枚举 - */ -@Getter -public enum AfterSaleWayEnum { - - REFUND(10, "退款"), - RETURN_AND_REFUND(20, "退货退款"), - EXCHANGE(30, "换货"); - - /** - * 方式 - */ - private final Integer way; - /** - * 描述 - */ - private final String desc; - - AfterSaleWayEnum(Integer way, String desc) { - this.way = way; - this.desc = desc; - } - -} diff --git a/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/logistics/LogisticsDeliveryTypeEnum.java b/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/logistics/LogisticsDeliveryTypeEnum.java deleted file mode 100644 index 2463bb204..000000000 --- a/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/logistics/LogisticsDeliveryTypeEnum.java +++ /dev/null @@ -1,26 +0,0 @@ -package cn.iocoder.mall.tradeservice.enums.logistics; - -import lombok.Getter; - -/** - * 物流的配送类型 - */ -@Getter -public enum LogisticsDeliveryTypeEnum { - - /** - * 无需快递 - */ - NULL(0), - /** - * 传统快递 - */ - EXPRESS(1); - - private final Integer deliveryType; - - LogisticsDeliveryTypeEnum(Integer deliveryType) { - this.deliveryType = deliveryType; - } - -} diff --git a/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/order/TradeOrderAfterSaleStatusEnum.java b/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/order/TradeOrderAfterSaleStatusEnum.java deleted file mode 100644 index bcfe9c1b6..000000000 --- a/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/order/TradeOrderAfterSaleStatusEnum.java +++ /dev/null @@ -1,29 +0,0 @@ -package cn.iocoder.mall.tradeservice.enums.order; - -import lombok.Getter; - -/** - * 交易订单的售后状态的枚举 - */ -@Getter -public enum TradeOrderAfterSaleStatusEnum { - - NULL(0, "无"), - IN_PROCESS(10, "售后中"), - END(10, "售后结束"); - - /** - * 状态 - */ - private final Integer status; - /** - * 描述 - */ - private final String desc; - - TradeOrderAfterSaleStatusEnum(Integer status, String desc) { - this.status = status; - this.desc = desc; - } - -} diff --git a/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/order/TradeOrderDetailFieldEnum.java b/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/order/TradeOrderDetailFieldEnum.java deleted file mode 100644 index 58cb7f621..000000000 --- a/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/order/TradeOrderDetailFieldEnum.java +++ /dev/null @@ -1,30 +0,0 @@ -package cn.iocoder.mall.tradeservice.enums.order; - -import cn.iocoder.mall.tradeservice.rpc.order.dto.TradeOrderRespDTO; - -/** - * 交易订单的明细的字段枚举 - * - * @see TradeOrderRespDTO - */ -public enum TradeOrderDetailFieldEnum { - - /** - * 交易订单项 - */ - ITEM("item"); - - /** - * 字段 - */ - private final String field; - - TradeOrderDetailFieldEnum(String field) { - this.field = field; - } - - public String getField() { - return field; - } - -} diff --git a/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/order/TradeOrderStatusEnum.java b/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/order/TradeOrderStatusEnum.java deleted file mode 100644 index f7a2b4fea..000000000 --- a/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/order/TradeOrderStatusEnum.java +++ /dev/null @@ -1,35 +0,0 @@ -package cn.iocoder.mall.tradeservice.enums.order; - -import lombok.Getter; - -/** - * 交易订单 - 状态蜜桔 - * - * @author Sin - * @time 2019-03-16 14:06 - */ -@Getter -public enum TradeOrderStatusEnum { - - WAITING_PAYMENT(10, "等待付款"), - WAIT_SHIPMENT(20, "等待发货"), - ALREADY_SHIPMENT(30, "已发货"), - COMPLETED(40, "已完成"), - CLOSED(50, "已关闭"); - - /** - * 状态值 - */ - private final Integer value; - /** - * 状态名 - */ - private final String name; - - TradeOrderStatusEnum(int value, String name) { - this.value = value; - this.name = name; - } - -} - diff --git a/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/order/TradeOrderFeign.java b/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/order/TradeOrderFeign.java deleted file mode 100644 index 82405ff58..000000000 --- a/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/order/TradeOrderFeign.java +++ /dev/null @@ -1,65 +0,0 @@ -package cn.iocoder.mall.tradeservice.rpc.order; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.tradeservice.rpc.order.dto.TradeOrderCreateReqDTO; -import cn.iocoder.mall.tradeservice.rpc.order.dto.TradeOrderPageReqDTO; -import cn.iocoder.mall.tradeservice.rpc.order.dto.TradeOrderRespDTO; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestParam; - -import java.util.Collection; - -/** - * Title: - * Description: - * - * @author zhuyang - * @version 1.0 2021/10/9 - */ -@FeignClient(value = "trade-service") -public interface TradeOrderFeign { - - /** - * 创建交易订单 - * - * @param createReqDTO 订单信息 - * @return 订单编号 - */ - @PostMapping("/trade/order/createTradeOrder") - CommonResult createTradeOrder(@RequestBody TradeOrderCreateReqDTO createReqDTO); - - /** - * 获得订单交易 - * - * @param tradeOrderId 订单交易编号 - * @param fields 额外返回字段,可见 {@link cn.iocoder.mall.tradeservice.enums.order.TradeOrderDetailFieldEnum} - * @return 订单交易 - */ - @GetMapping("/trade/order/getTradeOrder") - CommonResult getTradeOrder(@RequestParam("tradeOrderId")Integer tradeOrderId, @RequestParam("fields") Collection fields); - /** - * 获得交易订单分页 - * - * @param pageDTO 订单交易分页查询 - * @return 订单交易分页结果 - */ - @PostMapping("/trade/order/pageTradeOrder") - CommonResult> pageTradeOrder(@RequestBody TradeOrderPageReqDTO pageDTO); - // TODO 芋艿:需要重构成入参是 DTO,方便后续升级;返回是 CommonResult,用于返回失败的原因 - - /** - * 更新交易订单支付成功 - * - * 目前用于对接 pay-service 支付服务,回调该交易订单在三方支付平台,支付成功 - * - * @param tradeOrderId 交易订单编号 - * @param payAmount 支付金额 - * @return 成功 - */ - @PostMapping("/trade/order/updateTradeOrderPaySuccess") - CommonResult updateTradeOrderPaySuccess(@RequestParam("tradeOrderId") String tradeOrderId, @RequestParam("payAmount")Integer payAmount); -} diff --git a/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/order/dto/TradeOrderItemRespDTO.java b/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/order/dto/TradeOrderItemRespDTO.java deleted file mode 100644 index 88c07d7d1..000000000 --- a/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/order/dto/TradeOrderItemRespDTO.java +++ /dev/null @@ -1,101 +0,0 @@ -package cn.iocoder.mall.tradeservice.rpc.order.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 交易订单项 Response DTO - */ -@Data -@Accessors(chain = true) -public class TradeOrderItemRespDTO implements Serializable { - - /** - * id自增长 - */ - private Integer id; - /** - * 订单编号 - */ - private Integer orderId; - /** - * 订单项状态 - */ - private Integer status; - /** - * 商品 SKU 编号 - */ - private Integer skuId; - /** - * 商品 SPU 编号 - */ - private Integer spuId; - /** - * 商品名字 - */ - private String skuName; - /** - * 图片名字 - */ - private String skuImage; - /** - * 商品数量 - */ - private Integer quantity; - /** - * 原始单价,单位:分 - */ - private Integer originPrice; - /** - * 购买单价,单位:分 - */ - private Integer buyPrice; - /** - * 最终价格,单位:分 - */ - private Integer presentPrice; - /** - * 购买总金额,单位:分 - */ - private Integer buyTotal; - /** - * 优惠总金额,单位:分 - */ - private Integer discountTotal; - /** - * 最终总金额,单位:分 - */ - private Integer presentTotal; - /** - * 退款总金额,单位:分 - */ - private Integer refundTotal; - /** - * 物流id - */ - private Integer logisticsId; - /** - * 售后状态 - */ - private Integer afterSaleStatus; - /** - * 售后订单编号 - */ - private Integer afterSaleOrderId; - /** - * 创建时间 - */ - private LocalDateTime createTime; - /** - * 更新时间 - */ - private LocalDateTime updateTime; - /** - * 删除状态 - */ - private Integer deleted; - -} diff --git a/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/order/dto/TradeOrderPageReqDTO.java b/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/order/dto/TradeOrderPageReqDTO.java deleted file mode 100644 index cfac7be60..000000000 --- a/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/order/dto/TradeOrderPageReqDTO.java +++ /dev/null @@ -1,45 +0,0 @@ -package cn.iocoder.mall.tradeservice.rpc.order.dto; - -import cn.iocoder.common.framework.vo.PageParam; -import cn.iocoder.common.framework.vo.SortingField; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -/** - * 交易订单分页 Request DTO - */ -@Data -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -public class TradeOrderPageReqDTO extends PageParam { - - public static final SortingField ID_ASC = new SortingField("id", "asc"); - public static final SortingField ID_DESC = new SortingField("id", "desc"); - - /** - * 用户编号 - */ - private Integer userId; - /** - * 订单状态 - */ - private Integer orderStatus; - - /** - * 排序字段数组 - */ - private List sorts; - - /** - * 额外返回字段 - * - * @see cn.iocoder.mall.tradeservice.enums.order.TradeOrderDetailFieldEnum - */ - private Collection fields = Collections.emptySet(); - -} diff --git a/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/order/dto/TradeOrderRespDTO.java b/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/order/dto/TradeOrderRespDTO.java deleted file mode 100644 index ed354819f..000000000 --- a/归档/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/order/dto/TradeOrderRespDTO.java +++ /dev/null @@ -1,139 +0,0 @@ -package cn.iocoder.mall.tradeservice.rpc.order.dto; - -import cn.iocoder.mall.tradeservice.enums.order.TradeOrderDetailFieldEnum; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; -import java.util.List; - -/** - * 交易订单 Response DTO - */ -@Data -@Accessors(chain = true) -public class TradeOrderRespDTO implements Serializable { - - // ========== 订单基本信息 ========== - /** - * 订单编号 - */ - private Integer id; - /** - * 用户编号 - */ - private Integer userId; - /** - * 订单单号 - */ - private String orderNo; - /** - * 订单状态 - */ - private Integer orderStatus; - /** - * 备注 - */ - private String remark; - /** - * 创建时间 - */ - private LocalDateTime createTime; - - // ========== 价格 + 支付基本信息 ========== - /** - * 订单结束时间 - */ - private LocalDateTime endTime; - /** - * 订单金额(总金额),单位:分 - */ - private Integer buyPrice; - /** - * 优惠总金额,单位:分 - */ - private Integer discountPrice; - /** - * 物流金额,单位:分 - */ - private Integer logisticsPrice; - /** - * 最终金额,单位:分 - */ - private Integer presentPrice; - /** - * 支付金额,单位:分 - */ - private Integer payPrice; - /** - * 退款金额,单位:分 - */ - private Integer refundPrice; - /** - * 付款时间 - */ - private LocalDateTime payTime; - /** - * 支付订单编号 - */ - private Integer payTransactionId; - /** - * 支付渠道 - */ - private Integer payChannel; - - // ========== 收件 + 物流基本信息 ========== - /** - * 配送类型 - */ - private Integer deliveryType; - /** - * 发货时间 - */ - private LocalDateTime deliveryTime; - /** - * 收货时间 - */ - private LocalDateTime receiveTime; - /** - * 收件人名称 - */ - private String receiverName; - /** - * 手机号 - */ - private String receiverMobile; - /** - * 地区编码 - */ - private Integer receiverAreaCode; - /** - * 收件详细地址 - */ - private String receiverDetailAddress; - - // ========== 售后基本信息 ========== - /** - * 售后状态 - */ - private Integer afterSaleStatus; - - // ========== 营销基本信息 ========== - /** - * 优惠劵编号 - */ - private Integer couponCardId; - - // ========== 商品基本信息 ========== - - /** - * 订单项数组 - * - * 需要设置 {@link TradeOrderDetailFieldEnum#ITEM} 才返回 - * - * // TODO 芋艿,后续考虑怎么优化下,目前是内嵌了别的 dto - */ - private List orderItems; - -} diff --git a/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/client/pay/PayTransactionClient.java b/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/client/pay/PayTransactionClient.java deleted file mode 100644 index a739c22d8..000000000 --- a/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/client/pay/PayTransactionClient.java +++ /dev/null @@ -1,21 +0,0 @@ -package cn.iocoder.mall.tradeservice.client.pay; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.payservice.rpc.transaction.PayTransactionFeign; -import cn.iocoder.mall.payservice.rpc.transaction.dto.PayTransactionCreateReqDTO; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -public class PayTransactionClient { - - @Autowired - private PayTransactionFeign payTransactionFeign; - - public Integer createPayTransaction(PayTransactionCreateReqDTO createReqDTO) { - CommonResult createPayTransactionResult = payTransactionFeign.createPayTransaction(createReqDTO); - createPayTransactionResult.checkError(); - return createPayTransactionResult.getData(); - } - -} diff --git a/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/client/product/ProductSkuClient.java b/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/client/product/ProductSkuClient.java deleted file mode 100644 index 1645f365b..000000000 --- a/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/client/product/ProductSkuClient.java +++ /dev/null @@ -1,31 +0,0 @@ -package cn.iocoder.mall.tradeservice.client.product; - -import cn.iocoder.common.framework.util.CollectionUtils; -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.productservice.rpc.sku.ProductSkuFeign; -import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuListQueryReqDTO; -import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuRespDTO; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -@Service -public class ProductSkuClient { - @Autowired - private ProductSkuFeign productSkuFeign; - - public List listProductSkus(Collection productSkuIds, String... fields) { - if (CollectionUtils.isEmpty(productSkuIds)) { - return Collections.emptyList(); - } - CommonResult> listProductSkusResult = productSkuFeign.listProductSkus( - new ProductSkuListQueryReqDTO().setProductSkuIds(productSkuIds).setFields(Arrays.asList(fields))); - listProductSkusResult.checkError(); - return listProductSkusResult.getData(); - } - -} diff --git a/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/client/promotion/CouponCardClient.java b/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/client/promotion/CouponCardClient.java deleted file mode 100644 index 63b56f426..000000000 --- a/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/client/promotion/CouponCardClient.java +++ /dev/null @@ -1,20 +0,0 @@ -package cn.iocoder.mall.tradeservice.client.promotion; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.promotion.api.rpc.coupon.CouponCardFeign; -import cn.iocoder.mall.promotion.api.rpc.coupon.dto.card.CouponCardUseReqDTO; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -public class CouponCardClient { - - @Autowired - private CouponCardFeign couponCardFeign; - public void useCouponCard(Integer userId, Integer couponCardId) { - CommonResult useCouponCardResult = couponCardFeign.useCouponCard(new CouponCardUseReqDTO() - .setUserId(userId).setCouponCardId(couponCardId)); - useCouponCardResult.checkError(); - } - -} diff --git a/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/client/promotion/PriceClient.java b/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/client/promotion/PriceClient.java deleted file mode 100644 index 226de4251..000000000 --- a/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/client/promotion/PriceClient.java +++ /dev/null @@ -1,33 +0,0 @@ -package cn.iocoder.mall.tradeservice.client.promotion; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.promotion.api.rpc.price.PriceFeign; -import cn.iocoder.mall.promotion.api.rpc.price.dto.PriceProductCalcReqDTO; -import cn.iocoder.mall.promotion.api.rpc.price.dto.PriceProductCalcRespDTO; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -@Service -public class PriceClient { - - @Autowired - private PriceFeign priceFeign; - /** - * 计算商品们的价格 - * - * @param userId 用户编号 - * @param items 商品 SKU 集合 - * @param couponCardId 优惠劵编号,允许为空 - * @return 价格 - */ - public PriceProductCalcRespDTO calcProductPrice(Integer userId, List items, - Integer couponCardId) { - CommonResult calcProductPriceResult = priceFeign.calcProductPrice( - new PriceProductCalcReqDTO().setUserId(userId).setItems(items).setCouponCardId(couponCardId)); - calcProductPriceResult.checkError(); - return calcProductPriceResult.getData(); - } - -} diff --git a/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/config/TradeBizProperties.java b/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/config/TradeBizProperties.java deleted file mode 100644 index 13396032d..000000000 --- a/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/config/TradeBizProperties.java +++ /dev/null @@ -1,33 +0,0 @@ -package cn.iocoder.mall.tradeservice.config; - -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; -import org.springframework.validation.annotation.Validated; - -import javax.validation.constraints.NotNull; - -/** - * 交易服务的业务配置项 - */ -@Component -@ConfigurationProperties("biz") -@Validated -@Data -public class TradeBizProperties { - - /** - * 支付应用编号 - * - * 由 pay-service 支付系统提供 - */ - @NotNull(message = "支付应用编号不能为空") - private String payAppId; - - /** - * 支付超时时间,单位:分 - */ - @NotNull(message = "支付超时时间不能为空") - private Integer payExpireTime; - -} diff --git a/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/controller/TradeOrderController.java b/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/controller/TradeOrderController.java deleted file mode 100644 index 98b0fd84b..000000000 --- a/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/controller/TradeOrderController.java +++ /dev/null @@ -1,79 +0,0 @@ -package cn.iocoder.mall.tradeservice.controller; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.tradeservice.rpc.order.dto.TradeOrderCreateReqDTO; -import cn.iocoder.mall.tradeservice.rpc.order.dto.TradeOrderPageReqDTO; -import cn.iocoder.mall.tradeservice.rpc.order.dto.TradeOrderRespDTO; -import cn.iocoder.mall.tradeservice.service.order.TradeOrderService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.Collection; - -import static cn.iocoder.common.framework.vo.CommonResult.success; - -/** - * Title: - * Description: - * - * @author zhuyang - * @version 1.0 2021/10/9 - */ -@RestController -@RequestMapping("/trade/order") -public class TradeOrderController { - - @Autowired - private TradeOrderService tradeOrderService; - - /** - * 创建交易订单 - * - * @param createReqDTO 订单信息 - * @return 订单编号 - */ - @PostMapping("createTradeOrder") - CommonResult createTradeOrder(@RequestBody TradeOrderCreateReqDTO createReqDTO){ - return success(tradeOrderService.createTradeOrder(createReqDTO)); - } - - /** - * 获得订单交易 - * - * @param tradeOrderId 订单交易编号 - * @param fields 额外返回字段,可见 {@link cn.iocoder.mall.tradeservice.enums.order.TradeOrderDetailFieldEnum} - * @return 订单交易 - */ - @GetMapping("getTradeOrder") - CommonResult getTradeOrder( @RequestParam("tradeOrderId")Integer tradeOrderId, @RequestParam("fields") Collection fields){ - return success(tradeOrderService.getTradeOrder(tradeOrderId, fields)); - } - - /** - * 获得交易订单分页 - * - * @param pageDTO 订单交易分页查询 - * @return 订单交易分页结果 - */ - @PostMapping("pageTradeOrder") - CommonResult> pageTradeOrder(@RequestBody TradeOrderPageReqDTO pageDTO){ - return success(tradeOrderService.pageTradeOrder(pageDTO)); - } - - /** - * 更新交易订单支付成功 - * - * 目前用于对接 pay-service 支付服务,回调该交易订单在三方支付平台,支付成功 - * - * @param tradeOrderId 交易订单编号 - * @param payAmount 支付金额 - * @return 成功 - */ - @PostMapping("updateTradeOrderPaySuccess") - CommonResult updateTradeOrderPaySuccess(@RequestParam("tradeOrderId") String tradeOrderId, @RequestParam("payAmount")Integer payAmount){ - tradeOrderService.updateTradeOrderPaySuccess(Integer.valueOf(tradeOrderId), payAmount); - return success(true); - } - -} diff --git a/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/aftersale/AfterSaleOrderDO.java b/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/aftersale/AfterSaleOrderDO.java deleted file mode 100644 index d8db438f0..000000000 --- a/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/aftersale/AfterSaleOrderDO.java +++ /dev/null @@ -1,160 +0,0 @@ -package cn.iocoder.mall.tradeservice.dal.mysql.dataobject.aftersale; - -import cn.iocoder.mall.mybatis.core.dataobject.DeletableDO; -import cn.iocoder.mall.tradeservice.dal.mysql.dataobject.order.TradeOrderDO; -import cn.iocoder.mall.tradeservice.dal.mysql.dataobject.order.TradeOrderItemDO; -import cn.iocoder.mall.tradeservice.enums.aftersale.AfterSaleTypeEnum; -import cn.iocoder.mall.tradeservice.enums.aftersale.AfterSaleWayEnum; -import cn.iocoder.mall.tradeservice.enums.logistics.LogisticsDeliveryTypeEnum; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.time.LocalDateTime; - -/** - * 售后订单,用于处理 {@link TradeOrderDO} 交易订单的退货换流程 - * - * TODO 超时机制 - * TODO 用户(买家)和商家每一个步骤,都需要记录协商记录,多设计一个表 - */ -@TableName(value = "after_sale_order") -@Data -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -public class AfterSaleOrderDO extends DeletableDO { - - /** - * 售后订单编号 - */ - private Integer id; - /** - * 售后状态 - */ - private Integer status; - /** - * 用户编号 - */ - private Integer userId; - /** - * 用户手机 - */ - private String userMobile; - /** - * 售后类型 - * - * 枚举 {@link AfterSaleTypeEnum} - */ - private Integer type; - /** - * 售后方式 - * - * 枚举 {@link AfterSaleWayEnum} - */ - private Integer way; - /** - * 货物状态,是否收到货 - */ - private Boolean logisticsReceived; - /** - * 用户售后原因 - * - * TODO 不同情况下的退款,原因不同 - */ - private Integer reasonType; - /** - * 用户售后说明 - */ - private String reasonMemo; - /** - * 用户售后凭证图片的地址数组 - * - * 数组,以逗号分隔 - */ - private String reasonPicUrls; - /** - * 商家拒绝理由 - */ - private String rejectReasonMemo; - - // ========== 交易订单相关 ========== - /** - * 交易订单编号 - * - * 外键 {@link TradeOrderDO#getId()} - */ - private Integer tradeOrderId; - /** - * 交易订单项编号 - * - * 外键 {@link TradeOrderItemDO#getId()} - */ - private Integer tradeOrderItemId; - /** - * 商品 SKU 编号 - */ - private Integer skuId; - /** - * 商品数量 - */ - private Integer quantity; - - // ========== 退款相关 ========== - /** - * 退款金额,单位:分。 - */ - private Integer refundPrice; - - // ========== 退货相关 ========== - /** - * 退货地址,即商家的收件地址 - */ - private String returnDetailAddress; - /** - * 退货物流公司编号 - * - * 使用 DataDict 数据字典 EXPRESS - */ - private String returnLogisticsExpressId; - /** - * 退货物流单号 - */ - private String returnLogisticsExpressNo; - /** - * 退货物流说明 - */ - private String returnLogisticsReasonMemo; - /** - * 退货物流凭证图片的地址数组 - * - * 数组,以逗号分隔 - */ - private String returnLogisticsPicUrls; - /** - * 退货物流的填写时间 - */ - private LocalDateTime returnLogisticsDate; - - // ========== 换货相关 ========== - /** - * 换货物流的配送方式 - * 这里指的是商家重新给用户(买家)发货 - * - * 枚举 {@link LogisticsDeliveryTypeEnum} - */ - private Integer exchangeLogisticsDeliveryType; - /** - * 换货物流公司编号 - */ - private Integer exchangeLogisticsExpressId; - /** - * 换货物流公司单号 - */ - private String exchangeLogisticsExpressNo; - /** - * 换货物流的填写时间 - */ - private LocalDateTime exchangeLogisticsDate; - -} diff --git a/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/order/OrderPreferentialDO.java b/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/order/OrderPreferentialDO.java deleted file mode 100644 index eb07c2aea..000000000 --- a/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/order/OrderPreferentialDO.java +++ /dev/null @@ -1,48 +0,0 @@ -package cn.iocoder.mall.tradeservice.dal.mysql.dataobject.order; - -/** - * 订单优惠明细 - * - * 可参考 https://jos.jd.com/apilist?apiGroupId=55&apiId=16757&apiName=jingdong.pop.order.coupondetail - */ -// TODO 芋艿 后续在完善 -public class OrderPreferentialDO { - - /** - * 编号 - */ - private Integer id; - /** - * 类型 - * - * 1 - 促销活动 - * 2 - 优惠劵 - */ - private Integer type; - // TODO 芋艿 优惠劵编号 or 促销活动编号 - /** - * 订单编号 - */ - private Integer orderId; - /** - * 商品 SPU 编号 - */ - private Integer spuId; - /** - * 商品 SKU 编号 - */ - private Integer skuId; - /** - * 商品数量 - */ - private Integer quantity; - /** - * 传入时的价格 - */ - private Integer originTotal; - /** - * 总优惠价格 - */ - private Integer discountTotal; - -} diff --git a/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/order/TradeOrderDO.java b/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/order/TradeOrderDO.java deleted file mode 100644 index 2e9affddf..000000000 --- a/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/order/TradeOrderDO.java +++ /dev/null @@ -1,154 +0,0 @@ -package cn.iocoder.mall.tradeservice.dal.mysql.dataobject.order; - -import cn.iocoder.mall.mybatis.core.dataobject.DeletableDO; -import cn.iocoder.mall.tradeservice.enums.logistics.LogisticsDeliveryTypeEnum; -import cn.iocoder.mall.tradeservice.enums.order.TradeOrderAfterSaleStatusEnum; -import cn.iocoder.mall.tradeservice.enums.order.TradeOrderStatusEnum; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.time.LocalDateTime; - -/** - * 交易订单 - * - * idx_userId 索引:基于 {@link #userId} 字段 - * - * @author Sin - * @time 2019-03-16 13:49 - */ -@TableName(value = "trade_order") -@Data -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -public class TradeOrderDO extends DeletableDO { - - // ========== 订单基本信息 ========== - /** - * 订单编号(主键) - */ - private Integer id; - /** - * 用户编号 - */ - private Integer userId; - /** - * 订单编号(业务) - */ - private String orderNo; - /** - * 订单状态。 - * 如果有多个商品分开发货,需要全部商品发完才会改变状态 - * - * 枚举 {@link TradeOrderStatusEnum} - */ - private Integer orderStatus; - /** - * 备注 - */ - private String remark; - /** - * 订单结束时间 - * - * 即交易订单状态变成 {@link TradeOrderStatusEnum#COMPLETED} 和 {@link TradeOrderStatusEnum#CLOSED} 的时间 - */ - private LocalDateTime endTime; - - // ========== 价格 + 支付基本信息 ========== - /** - * 购买(商品)总金额,单位:分 - */ - private Integer buyPrice; - /** - * 优惠总金额,单位:分。 - */ - private Integer discountPrice; - /** - * 物流金额 (分) - */ - private Integer logisticsPrice; - /** - * 最终金额,单位:分 - * - * buyPrice + logisticsPrice - discountPrice = presentPrice - */ - private Integer presentPrice; - /** - * 实际已支付金额,单位:分 - * - * 初始时,金额为 0 。等到支付成功后,会进行更新。 - */ - private Integer payPrice; - /** - * 退款金额,单位:分 - * - * 注意,退款并不会影响 {@link #payPrice} 实际支付金额 - * 也就说,一个订单最终产生多少金额的收入 = payPrice - refundPrice - */ - private Integer refundPrice; - /** - * 付款时间 - */ - private LocalDateTime payTime; - /** - * 支付订单编号 - * - * 对接 pay-service 支付服务的支付订单编号 - */ - private Integer payTransactionId; - /** - * 支付成功的支付渠道 - */ - private Integer payChannel; - - // ========== 收件 + 物流基本信息 ========== - /** - * 配送类型 - * - * 枚举 {@link LogisticsDeliveryTypeEnum} - */ - private Integer deliveryType; - /** - * 发货时间 - */ - private LocalDateTime deliveryTime; - /** - * 收货时间 - */ - private LocalDateTime receiveTime; - /** - * 收件人名称 - */ - private String receiverName; - /** - * 收件人手机 - */ - private String receiverMobile; - /** - * 收件人地区编码 - */ - private Integer receiverAreaCode; - /** - * 收件人详细地址 - */ - private String receiverDetailAddress; - - // ========== 售后基本信息 ========== - /** - * 售后状态 - * - * 枚举 {@link TradeOrderAfterSaleStatusEnum} - */ - private Integer afterSaleStatus; - - // ========== 营销基本信息 ========== - /** - * 优惠劵编号 - */ - private Integer couponCardId; - - // TODO 芋艿,这块还要结合营销和价格计算,在去优化下。 - -} diff --git a/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/order/TradeOrderItemDO.java b/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/order/TradeOrderItemDO.java deleted file mode 100644 index 4d9d272a1..000000000 --- a/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/order/TradeOrderItemDO.java +++ /dev/null @@ -1,133 +0,0 @@ -package cn.iocoder.mall.tradeservice.dal.mysql.dataobject.order; - -import cn.iocoder.mall.mybatis.core.dataobject.DeletableDO; -import cn.iocoder.mall.tradeservice.dal.mysql.dataobject.aftersale.AfterSaleOrderDO; -import cn.iocoder.mall.tradeservice.enums.order.TradeOrderAfterSaleStatusEnum; -import cn.iocoder.mall.tradeservice.enums.order.TradeOrderStatusEnum; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - * 交易订单的商品项,主要是商品信息等等 - * - * idx_orderId 索引:基于 {@link #orderId} 字段 - * - * @author Sin - * @time 2019-03-16 14:03 - */ -@TableName(value = "trade_order_item") -@Data -@Accessors(chain = true) -@EqualsAndHashCode(callSuper = true) -public class TradeOrderItemDO extends DeletableDO { - - // ========== 订单项基本信息 ========== - /** - * 编号 - */ - private Integer id; - /** - * 订单编号 - */ - private Integer orderId; - /** - * 订单项状态 - * - * 枚举 {@link TradeOrderStatusEnum} - */ - private Integer status; - - // ========== 商品基本信息 ========== - /** - * 商品 SPU 编号 - */ - private Integer spuId; - /** - * 商品 SKU 编号 - */ - private Integer skuId; - /** - * 商品名称 - */ - private String skuName; - /** - * 商品图片 - */ - private String skuImage; - /** - * 购买数量 - */ - private Integer quantity; - - // ========== 价格 + 支付基本信息 ========== - /** - * 原始单价,单位:分。 - */ - private Integer originPrice; - /** - * 购买单价,单位:分 - */ - private Integer buyPrice; - /** - * 最终单价,单位:分。 - */ - private Integer presentPrice; - /** - * 购买总金额,单位:分 - * - * 用途类似 {@link #presentTotal} - */ - private Integer buyTotal; - /** - * 优惠总金额,单位:分。 - */ - private Integer discountTotal; - /** - * 最终总金额,单位:分。 - * - * 注意,presentPrice * quantity 不一定等于 presentTotal 。 - * 因为,存在无法整除的情况。 - * 举个例子,presentPrice = 8.33 ,quantity = 3 的情况,presentTotal 有可能是 24.99 ,也可能是 25 。 - * 所以,需要存储一个该字段。 - */ - private Integer presentTotal; - // 如上字段,举个例子: - // 假设购买三个,即 quantity = 3 。 - // originPrice = 15 - // 使用限时折扣(单品优惠)8 折,buyPrice = 12 - // 开始算总的价格 - // buyTotal = buyPrice * quantity = 12 * 3 = 36 - // discountTotal ,假设有满减送(分组优惠)满 20 减 10 ,并且使用优惠劵满 1.01 减 1 ,则 discountTotal = 10 + 1 = 11 - // presentTotal = buyTotal - discountTotal = 24 - 11 = 13 - // 最终 presentPrice = presentTotal / quantity = 13 / 3 = 4.33 - /** - * 退款总金额,单位:分 - */ - private Integer refundTotal; - // TODO 芋艿:退款单和这个的关联。例如说,一个子单可以退款多次;需要额外新增表 - - // ========== 物流基本信息 ========== - /** - * 物流编号 - * - * 外键 {@link TradeOrderLogisticsDO#getId()} - */ - private Integer logisticsId; - - // ========== 售后基本信息 ========== - /** - * 售后状态 - * - * 枚举 {@link TradeOrderAfterSaleStatusEnum} - */ - private Integer afterSaleStatus; - /** - * 售后订单编号 - * - * 外键 {@link AfterSaleOrderDO#getId()} - */ - private Integer afterSaleOrderId; - -} diff --git a/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/order/TradeOrderLogisticsDO.java b/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/order/TradeOrderLogisticsDO.java deleted file mode 100644 index 87f85d455..000000000 --- a/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/order/TradeOrderLogisticsDO.java +++ /dev/null @@ -1,72 +0,0 @@ -package cn.iocoder.mall.tradeservice.dal.mysql.dataobject.order; - -import cn.iocoder.mall.mybatis.core.dataobject.DeletableDO; -import cn.iocoder.mall.tradeservice.enums.logistics.LogisticsDeliveryTypeEnum; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.util.List; - -/** - * 交易订单的物流信息 - */ -@TableName(value = "logistics_order") -@Data -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -public class TradeOrderLogisticsDO extends DeletableDO { - - /** - * 物流订单号 - */ - private Integer id; - /** - * 配送类型 - * - * 枚举 {@link LogisticsDeliveryTypeEnum} - */ - private Integer deliveryType; - /** - * 物流公司编号 - * - * 使用 DataDict 数据字典 EXPRESS - */ - private Integer expressId; - /** - * 物流公司单号 - */ - private String expressNo; - /** - * 交易订单号 - * - * 外键 {@link TradeOrderDO#getId()} - */ - private Integer tradeOrderId; - /** - * 商品列表 - */ - @TableField(typeHandler = FastjsonTypeHandler.class) - private List items; - - /** - * 商品项 - */ - @Data - public static class Item { - - /** - * 商品 SKU 编号 - */ - private Integer skuId; - /** - * 数量 - */ - private Integer quantity; - - } - -} diff --git a/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/mapper/order/TradeOrderItemMapper.java b/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/mapper/order/TradeOrderItemMapper.java deleted file mode 100644 index 0975b87f5..000000000 --- a/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/mapper/order/TradeOrderItemMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -package cn.iocoder.mall.tradeservice.dal.mysql.mapper.order; - -import cn.iocoder.mall.tradeservice.dal.mysql.dataobject.order.TradeOrderItemDO; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.springframework.stereotype.Repository; - -import java.util.Collection; -import java.util.List; - -@Repository -public interface TradeOrderItemMapper extends BaseMapper { - - // TODO 芋艿:后续重构到基础库去支持 - default void insertList(List entities) { - entities.forEach(this::insert); - } - - default List selectListByOrderIds(Collection orderIds) { - return selectList(new QueryWrapper().in("order_id", orderIds)); - } - - default int updateListByOrderId(TradeOrderItemDO update, Integer orderId, Integer whereStatus) { - return update(update, new QueryWrapper().eq("order_id", orderId) - .eq("status", whereStatus)); - } - -} diff --git a/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/mapper/order/TradeOrderMapper.java b/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/mapper/order/TradeOrderMapper.java deleted file mode 100644 index 924f4d7d4..000000000 --- a/归档/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/mapper/order/TradeOrderMapper.java +++ /dev/null @@ -1,26 +0,0 @@ -package cn.iocoder.mall.tradeservice.dal.mysql.mapper.order; - -import cn.iocoder.mall.mybatis.core.query.QueryWrapperX; -import cn.iocoder.mall.mybatis.core.util.PageUtil; -import cn.iocoder.mall.tradeservice.dal.mysql.dataobject.order.TradeOrderDO; -import cn.iocoder.mall.tradeservice.rpc.order.dto.TradeOrderPageReqDTO; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import org.springframework.stereotype.Repository; - -@Repository -public interface TradeOrderMapper extends BaseMapper { - - default IPage selectPage(TradeOrderPageReqDTO pageReqDTO) { - return selectPage(PageUtil.build(pageReqDTO, pageReqDTO.getSorts()), - new QueryWrapperX().eqIfPresent("user_id", pageReqDTO.getUserId()) - .eqIfPresent("status", pageReqDTO.getOrderStatus())); - } - - default int update(TradeOrderDO update, Integer whereOrderStatus) { - return update(update, new QueryWrapper() - .eq("id", update.getId()).eq("order_status", whereOrderStatus)); - } - -}