From 45684deea50d27ac78f2a8315bdea50d022e01cb Mon Sep 17 00:00:00 2001 From: jiangqs <jiangqs> Date: 星期二, 25 七月 2023 19:06:39 +0800 Subject: [PATCH] bug --- ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/constant/AppErrorConstant.java | 2 ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml | 8 ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/scheduler/OrderScheduler.java | 36 ++++ ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml | 8 ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/member/MemberCouponServiceImpl.java | 4 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/MgtCustomConfigDto.java | 3 ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/order/OrderService.java | 10 + ruoyi-modules/ruoyi-member/src/main/resources/mapper/member/MemberMapper.xml | 2 ruoyi-modules/ruoyi-system/src/main/resources/mapper/sys/SysMenuMapper.xml | 2 ruoyi-modules/ruoyi-goods/src/main/resources/mapper/goods/ShoppingCartMapper.xml | 2 ruoyi-modules/ruoyi-goods/src/main/resources/bootstrap.yml | 8 ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/constant/ConfigEnum.java | 1 ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/service/RemoteActivityService.java | 24 ++ ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/scheduler/SchedulerUtils.java | 48 +++++ ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/goods/GoodsServiceImpl.java | 4 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/CustomConfigServiceImpl.java | 27 +++ ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/RemoteActivityFallbackFactory.java | 11 + ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/mapper/activity/ActivityRecordMapper.java | 2 ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/birthday/BirthdayCardServiceImpl.java | 15 - ruoyi-modules/ruoyi-member/src/main/resources/mapper/member/MemberCouponMapper.xml | 2 ruoyi-modules/ruoyi-order/src/main/resources/bootstrap.yml | 8 ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/concole/ActivityController.java | 27 +++ ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/vo/AppMemberCouponVo.java | 3 ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/activity/ActivityRecordService.java | 11 + ruoyi-gateway/src/main/resources/bootstrap.yml | 12 ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/member/MemberServiceImpl.java | 4 ruoyi-modules/ruoyi-member/src/main/resources/bootstrap.yml | 8 ruoyi-auth/src/main/resources/bootstrap.yml | 8 ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/activity/ActivityRecordServiceImpl.java | 22 ++ ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java | 102 +++++++++-- ruoyi-modules/ruoyi-shop/src/main/resources/bootstrap.yml | 8 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/MgtServiceCodeEditDto.java | 20 ++ ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/domain/dto/MgtCouponEditDto.java | 5 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/management/MgtConfigController.java | 10 + ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/config/CustomConfigService.java | 9 + ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml | 8 ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/poji/activity/ActivityRecord.java | 2 ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/MgtCouponController.java | 3 ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/domain/vo/AppMemberCouponPageVo.java | 4 ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/scheduler/MemberScheduler.java | 2 ruoyi-visual/ruoyi-monitor/src/main/resources/bootstrap.yml | 8 ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/domain/vo/AppGoodsInfoVo.java | 3 ruoyi-modules/ruoyi-job/src/main/resources/bootstrap.yml | 8 43 files changed, 423 insertions(+), 91 deletions(-) diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/constant/AppErrorConstant.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/constant/AppErrorConstant.java index d32ef24..39c5b55 100644 --- a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/constant/AppErrorConstant.java +++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/constant/AppErrorConstant.java @@ -84,6 +84,8 @@ String ACTIVITY_GOODS_NULL = "商品已售罄"; + String ACTIVITY_GOODS_BEYOND = "超出商品购买限制"; + String BIRTHDAY_NULL = "未填写生日"; String BIRTHDAY_ERROR = "只有生日当月领取"; diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/constant/ConfigEnum.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/constant/ConfigEnum.java index eada09c..e753326 100644 --- a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/constant/ConfigEnum.java +++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/constant/ConfigEnum.java @@ -19,6 +19,7 @@ public enum ConfigEnum { PLATFORM_SERVICE_PHONE("PLATFORM_SERVICE_PHONE", 1,"客服电话"), + PLATFORM_SERVICE_CODE("PLATFORM_SERVICE_CODE", 1,"客服二维码"), SHOP_EMERGENCY_DEGREE("SHOP_EMERGENCY_DEGREE", 3,"合作商任务紧急程度"), SHOP_FOLLOW_TYPE("SHOP_FOLLOW_TYPE", 3,"合作商跟进类型"), SHOP_CUSTOM_STATUS("SHOP_CUSTOM_STATUS", 3,"合作商状态"), diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/domain/pojo/activity/ActivityRecord.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/poji/activity/ActivityRecord.java similarity index 96% rename from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/domain/pojo/activity/ActivityRecord.java rename to ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/poji/activity/ActivityRecord.java index 3bf8847..fd50984 100644 --- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/domain/pojo/activity/ActivityRecord.java +++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/poji/activity/ActivityRecord.java @@ -1,4 +1,4 @@ -package com.ruoyi.goods.domain.pojo.activity; +package com.ruoyi.system.api.domain.poji.activity; import com.baomidou.mybatisplus.activerecord.Model; import com.baomidou.mybatisplus.annotation.IdType; diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/vo/AppMemberCouponVo.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/vo/AppMemberCouponVo.java index a64c9c4..0b1a2b1 100644 --- a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/vo/AppMemberCouponVo.java +++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/vo/AppMemberCouponVo.java @@ -1,5 +1,6 @@ package com.ruoyi.system.api.domain.vo; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -39,9 +40,11 @@ private BigDecimal discountPercent; @ApiModelProperty(value="有效开始时间") + @JsonFormat(pattern = "yyyy.MM.dd") private Date validStartTime; @ApiModelProperty(value="使用有效期") + @JsonFormat(pattern = "yyyy.MM.dd") private Date deadlineTime; @ApiModelProperty(value="关联商品ids") diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/RemoteActivityFallbackFactory.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/RemoteActivityFallbackFactory.java index af61e72..57f3bdc 100644 --- a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/RemoteActivityFallbackFactory.java +++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/RemoteActivityFallbackFactory.java @@ -4,6 +4,7 @@ import com.ruoyi.system.api.domain.dto.AGStockChangeDto; import com.ruoyi.system.api.domain.dto.ActivityGoodsGetDto; import com.ruoyi.system.api.domain.dto.ActivityTotalChangeDto; +import com.ruoyi.system.api.domain.poji.activity.ActivityRecord; import com.ruoyi.system.api.domain.vo.ActivityGoodsGetVo; import com.ruoyi.system.api.domain.vo.MgtBulletinBoardVo; import com.ruoyi.system.api.service.RemoteActivityService; @@ -71,6 +72,16 @@ public R endActivity(String activityId) { return null; } + + @Override + public R addActivityRecord(ActivityRecord activityRecord) { + return R.fail("新增活动记录失败:" + throwable.getMessage()); + } + + @Override + public R delActivityRecord(ActivityRecord activityRecord) { + return R.fail("删除活动记录失败:" + throwable.getMessage()); + } }; } } diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/service/RemoteActivityService.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/service/RemoteActivityService.java index 0fe5271..4c87d9d 100644 --- a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/service/RemoteActivityService.java +++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/service/RemoteActivityService.java @@ -6,6 +6,7 @@ import com.ruoyi.system.api.domain.dto.ActivityGoodsGetDto; import com.ruoyi.system.api.domain.dto.ActivityTotalChangeDto; import com.ruoyi.system.api.domain.poji.activity.ActivityGoods; +import com.ruoyi.system.api.domain.poji.activity.ActivityRecord; import com.ruoyi.system.api.domain.vo.ActivityGoodsGetVo; import com.ruoyi.system.api.domain.vo.MgtBulletinBoardVo; import com.ruoyi.system.api.factory.RemoteActivityFallbackFactory; @@ -97,4 +98,27 @@ */ @PostMapping("/activity/endActivity") public R endActivity(@RequestBody String activityId); + + /** + * @description 添加活动记录 + * @author jqs + * @date 2023/7/25 14:00 + * @param activityRecord + * @return R + */ + @PostMapping("/activity/addActivityRecord") + public R addActivityRecord(@RequestBody ActivityRecord activityRecord); + + + /** + * @description 删除活动记录 + * @author jqs + * @date 2023/7/25 14:23 + * @param activityRecord + * @return R + */ + @PostMapping("/activity/delActivityRecord") + public R delActivityRecord(@RequestBody ActivityRecord activityRecord); + + } diff --git a/ruoyi-auth/src/main/resources/bootstrap.yml b/ruoyi-auth/src/main/resources/bootstrap.yml index 8541c04..8439e22 100644 --- a/ruoyi-auth/src/main/resources/bootstrap.yml +++ b/ruoyi-auth/src/main/resources/bootstrap.yml @@ -14,12 +14,12 @@ nacos: discovery: # 服务注册地址 - server-addr: 47.109.78.184:5000 - #server-addr: 127.0.0.1:8848 + #server-addr: 47.109.78.184:5000 + server-addr: 127.0.0.1:8848 config: # 配置中心地址 - server-addr: 47.109.78.184:5000 - #server-addr: 127.0.0.1:8848 + #server-addr: 47.109.78.184:5000 + server-addr: 127.0.0.1:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-gateway/src/main/resources/bootstrap.yml b/ruoyi-gateway/src/main/resources/bootstrap.yml index 4a64425..fdae1b6 100644 --- a/ruoyi-gateway/src/main/resources/bootstrap.yml +++ b/ruoyi-gateway/src/main/resources/bootstrap.yml @@ -14,12 +14,12 @@ nacos: discovery: # 服务注册地址 - server-addr: 47.109.78.184:5000 - #server-addr: 127.0.0.1:8848 + #server-addr: 47.109.78.184:5000 + server-addr: 127.0.0.1:8848 config: # 配置中心地址 - server-addr: 47.109.78.184:5000 - #server-addr: 127.0.0.1:8848 + #server-addr: 47.109.78.184:5000 + server-addr: 127.0.0.1:8848 # 配置文件格式 file-extension: yml # 共享配置 @@ -35,8 +35,8 @@ datasource: ds1: nacos: - server-addr: 47.109.78.184:5000 - #server-addr: 127.0.0.1:8848 + #server-addr: 47.109.78.184:5000 + server-addr: 127.0.0.1:8848 dataId: sentinel-ruoyi-gateway groupId: DEFAULT_GROUP data-type: json diff --git a/ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml index bd0eefb..3345a04 100644 --- a/ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml @@ -19,12 +19,12 @@ nacos: discovery: # 服务注册地址 - server-addr: 47.109.78.184:5000 - #server-addr: 127.0.0.1:8848 + #server-addr: 47.109.78.184:5000 + server-addr: 127.0.0.1:8848 config: # 配置中心地址 - server-addr: 47.109.78.184:5000 - #server-addr: 127.0.0.1:8848 + #server-addr: 47.109.78.184:5000 + server-addr: 127.0.0.1:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml index 1367b5d..c1065bc 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml @@ -14,12 +14,12 @@ nacos: discovery: # 服务注册地址 - server-addr: 47.109.78.184:5000 - #server-addr: 127.0.0.1:8848 + #server-addr: 47.109.78.184:5000 + server-addr: 127.0.0.1:8848 config: # 配置中心地址 - server-addr: 47.109.78.184:5000 - #server-addr: 127.0.0.1:8848 + #server-addr: 47.109.78.184:5000 + server-addr: 127.0.0.1:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/concole/ActivityController.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/concole/ActivityController.java index 1b2d08f..4142726 100644 --- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/concole/ActivityController.java +++ b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/concole/ActivityController.java @@ -8,6 +8,7 @@ import com.ruoyi.system.api.domain.dto.ActivityGoodsGetDto; import com.ruoyi.system.api.domain.dto.ActivityTotalChangeDto; import com.ruoyi.system.api.domain.poji.activity.ActivityGoods; +import com.ruoyi.system.api.domain.poji.activity.ActivityRecord; import com.ruoyi.system.api.domain.vo.ActivityGoodsGetVo; import com.ruoyi.system.api.domain.vo.MgtBulletinBoardVo; import org.springframework.web.bind.annotation.PostMapping; @@ -145,4 +146,30 @@ activityService.changeActivityTotal(activityTotalChangeDto); return R.ok(); } + + /** + * @description 添加活动记录 + * @author jqs + * @date 2023/7/25 14:00 + * @param activityRecord + * @return R + */ + @PostMapping("/addActivityRecord") + public R addActivityRecord(@RequestBody ActivityRecord activityRecord){ + activityRecordService.save(activityRecord); + return R.ok(); + } + + /** + * @description 删除活动记录 + * @author jqs + * @date 2023/7/25 14:23 + * @param activityRecord + * @return R + */ + @PostMapping("/delActivityRecord") + public R delActivityRecord(@RequestBody ActivityRecord activityRecord){ + activityRecordService.delActivityRecord(activityRecord); + return R.ok(); + } } diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/domain/vo/AppGoodsInfoVo.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/domain/vo/AppGoodsInfoVo.java index f6a7ef9..cda2709 100644 --- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/domain/vo/AppGoodsInfoVo.java +++ b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/domain/vo/AppGoodsInfoVo.java @@ -28,6 +28,9 @@ @ApiModelProperty(value = "商品简介") private String goodsIntroduction; + @ApiModelProperty(value = "商品图片") + private String goodsPicture; + @ApiModelProperty(value = "商品视频") private String goodsVideo; diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/mapper/activity/ActivityRecordMapper.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/mapper/activity/ActivityRecordMapper.java index ce5ab27..330032c 100644 --- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/mapper/activity/ActivityRecordMapper.java +++ b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/mapper/activity/ActivityRecordMapper.java @@ -1,6 +1,6 @@ package com.ruoyi.goods.mapper.activity; -import com.ruoyi.goods.domain.pojo.activity.ActivityRecord; +import com.ruoyi.system.api.domain.poji.activity.ActivityRecord; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Param; diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/activity/ActivityRecordService.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/activity/ActivityRecordService.java index 30c1bab..b70f00c 100644 --- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/activity/ActivityRecordService.java +++ b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/activity/ActivityRecordService.java @@ -1,6 +1,6 @@ package com.ruoyi.goods.service.activity; -import com.ruoyi.goods.domain.pojo.activity.ActivityRecord; +import com.ruoyi.system.api.domain.poji.activity.ActivityRecord; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.system.api.domain.vo.MgtBulletinBoardVo; @@ -44,4 +44,13 @@ * @return Integer */ Integer getUserActivityGoodsNum(String goodsId,String activityId,Long userId); + + /** + * @description 删除活动记录 + * @author jqs + * @date 2023/7/25 14:19 + * @param activityRecord + * @return void + */ + void delActivityRecord(ActivityRecord activityRecord); } diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/activity/ActivityRecordServiceImpl.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/activity/ActivityRecordServiceImpl.java index a58c3d6..1270caa 100644 --- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/activity/ActivityRecordServiceImpl.java +++ b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/activity/ActivityRecordServiceImpl.java @@ -1,9 +1,10 @@ package com.ruoyi.goods.service.impl.activity; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.ruoyi.goods.domain.pojo.activity.ActivityRecord; import com.ruoyi.goods.mapper.activity.ActivityRecordMapper; import com.ruoyi.goods.service.activity.ActivityRecordService; +import com.ruoyi.system.api.domain.poji.activity.ActivityRecord; import com.ruoyi.system.api.domain.vo.MgtBulletinBoardVo; import org.springframework.stereotype.Service; @@ -64,4 +65,23 @@ public Integer getUserActivityGoodsNum(String goodsId,String activityId,Long userId){ return activityRecordMapper.getUserActivityGoodsNum(goodsId, activityId, userId); } + + /** + * @description 删除活动记录 + * @author jqs + * @date 2023/7/25 14:19 + * @param activityRecord + * @return void + */ + @Override + public void delActivityRecord(ActivityRecord activityRecord){ + LambdaUpdateWrapper<ActivityRecord> updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(ActivityRecord::getDelFlag,0); + updateWrapper.eq(ActivityRecord::getActivityId,activityRecord.getActivityId()); + updateWrapper.eq(ActivityRecord::getGoodsId,activityRecord.getGoodsId()); + updateWrapper.eq(ActivityRecord::getUserId,activityRecord.getUserId()); + updateWrapper.eq(ActivityRecord::getOrderTime,activityRecord.getOrderTime()); + updateWrapper.set(ActivityRecord::getDelFlag,1); + this.update(updateWrapper); + } } diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/goods/GoodsServiceImpl.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/goods/GoodsServiceImpl.java index 3bdb2d7..1b7de28 100644 --- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/goods/GoodsServiceImpl.java +++ b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/goods/GoodsServiceImpl.java @@ -222,7 +222,9 @@ List<String> bannerList = new ArrayList<>(); if(goodsFileList!=null&&!goodsFileList.isEmpty()){ for(GoodsFile goodsFile : goodsFileList){ - if(goodsFile.getFileType()==2){ + if(goodsFile.getFileType()==1){ + appGoodsInfoVo.setGoodsPicture(goodsFile.getFileUrl()); + }else if(goodsFile.getFileType()==2){ appGoodsInfoVo.setGoodsVideo(goodsFile.getFileUrl()); }else if(goodsFile.getFileType()==3){ bannerList.add(goodsFile.getFileUrl()); diff --git a/ruoyi-modules/ruoyi-goods/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-goods/src/main/resources/bootstrap.yml index 91e477e..b70af9b 100644 --- a/ruoyi-modules/ruoyi-goods/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/ruoyi-goods/src/main/resources/bootstrap.yml @@ -14,12 +14,12 @@ nacos: discovery: # 服务注册地址 - server-addr: 47.109.78.184:5000 - #server-addr: 127.0.0.1:8848 + #server-addr: 47.109.78.184:5000 + server-addr: 127.0.0.1:8848 config: # 配置中心地址 - server-addr: 47.109.78.184:5000 - #server-addr: 127.0.0.1:8848 + #server-addr: 47.109.78.184:5000 + server-addr: 127.0.0.1:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-modules/ruoyi-goods/src/main/resources/mapper/goods/ShoppingCartMapper.xml b/ruoyi-modules/ruoyi-goods/src/main/resources/mapper/goods/ShoppingCartMapper.xml index 0be7bd5..8507e81 100644 --- a/ruoyi-modules/ruoyi-goods/src/main/resources/mapper/goods/ShoppingCartMapper.xml +++ b/ruoyi-modules/ruoyi-goods/src/main/resources/mapper/goods/ShoppingCartMapper.xml @@ -100,7 +100,7 @@ INNER JOIN t_goods tg ON tsc.goods_id = tg.goods_id LEFT JOIN t_goods_file tgf ON tg.goods_id = tgf.goods_id AND tgf.del_flag = 0 AND tgf.file_type = 1 LEFT JOIN t_shop_goods tsg ON tg.goods_id = tsg.goods_id AND tsg.shop_id = #{shopId} - WHERE tsc.del_flag = 0 AND tg.del_flag = 0 AND tsc.shop_id = #{shopId} AND tsc.user_id = #{userId} AND tg.del_flag = 0 AND tg.goods_status = 1 AND tg.recommend_flag = 1 + WHERE tsc.del_flag = 0 AND tg.del_flag = 0 AND tsc.shop_id = #{shopId} AND tsc.user_id = #{userId} AND tg.del_flag = 0 AND tg.goods_status = 1 ORDER BY tg.create_time DESC </select> diff --git a/ruoyi-modules/ruoyi-job/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-job/src/main/resources/bootstrap.yml index e2cda09..89bee3a 100644 --- a/ruoyi-modules/ruoyi-job/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/ruoyi-job/src/main/resources/bootstrap.yml @@ -14,12 +14,12 @@ nacos: discovery: # 服务注册地址 - server-addr: 47.109.78.184:5000 - #server-addr: 127.0.0.1:8848 + #server-addr: 47.109.78.184:5000 + server-addr: 127.0.0.1:8848 config: # 配置中心地址 - server-addr: 47.109.78.184:5000 - #server-addr: 127.0.0.1:8848 + #server-addr: 47.109.78.184:5000 + server-addr: 127.0.0.1:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/MgtCouponController.java b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/MgtCouponController.java index eff2281..8e149fe 100644 --- a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/MgtCouponController.java +++ b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/management/MgtCouponController.java @@ -11,6 +11,7 @@ import com.ruoyi.system.api.domain.dto.MgtBaseGetDto; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @@ -59,7 +60,7 @@ @RequestMapping(value = "/editMgtCoupon", method = RequestMethod.POST) @Log(title = "优惠券管理", businessType = BusinessType.UPDATE,operContent = "编辑优惠券") @ApiOperation(value = "平台编辑优惠券") - public R editMgtCoupon(@RequestBody MgtCouponEditDto mgtCouponEditDto) { + public R editMgtCoupon(@Validated @RequestBody MgtCouponEditDto mgtCouponEditDto) { Long userId = SecurityUtils.getUserId(); mgtCouponEditDto.setUserId(userId); couponService.editMgtCoupon(mgtCouponEditDto); diff --git a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/domain/dto/MgtCouponEditDto.java b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/domain/dto/MgtCouponEditDto.java index 16e98be..4fc08a3 100644 --- a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/domain/dto/MgtCouponEditDto.java +++ b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/domain/dto/MgtCouponEditDto.java @@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import javax.validation.constraints.NotNull; import java.math.BigDecimal; import java.util.Date; import java.util.List; @@ -22,15 +23,19 @@ private String couponId; @ApiModelProperty(value="优惠券类型1.满减2.折扣3.代金4.商品") + @NotNull(message = "优惠券类型不能为空") private Integer couponType; @ApiModelProperty(value="优惠券名称") + @NotNull(message = "优惠券名称不能为空") private String couponName; @ApiModelProperty(value = "发送类型1.手动领取2.指定发放") + @NotNull(message = "发送类型不能为空") private Integer sendType; @ApiModelProperty(value = "发送对象2.全部用户3.会员用户4非会员用户5自定义") + @NotNull(message = "发送对象不能为空") private Integer sendTarget; @ApiModelProperty(value="发送时间类型1立即2定时") diff --git a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/domain/vo/AppMemberCouponPageVo.java b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/domain/vo/AppMemberCouponPageVo.java index 53d6dd9..fb5da35 100644 --- a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/domain/vo/AppMemberCouponPageVo.java +++ b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/domain/vo/AppMemberCouponPageVo.java @@ -47,11 +47,11 @@ @ApiModelProperty(value = "有效开始时间") - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy.MM.dd") private Date validStartTime; @ApiModelProperty(value = "有效结束时间") - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy.MM.dd") private Date deadlineTime; @ApiModelProperty(value = "使用时间") diff --git a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/scheduler/MemberScheduler.java b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/scheduler/MemberScheduler.java index 609417f..682b46a 100644 --- a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/scheduler/MemberScheduler.java +++ b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/scheduler/MemberScheduler.java @@ -43,7 +43,7 @@ /** * 定时检查优惠券过期 */ - @Scheduled(cron="0 0 * * * ?") + @Scheduled(cron="1 0 * * * ?") private void timingCheckMemberCoupon(){ if(schedulerUtils.getSchedulerRun()) { log.info("定时检查优惠券过期任务开始执行"); diff --git a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/birthday/BirthdayCardServiceImpl.java b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/birthday/BirthdayCardServiceImpl.java index f15aace..77d975e 100644 --- a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/birthday/BirthdayCardServiceImpl.java +++ b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/birthday/BirthdayCardServiceImpl.java @@ -11,15 +11,13 @@ import com.ruoyi.member.domain.dto.MgtBirthdayGiftDto; import com.ruoyi.member.domain.pojo.birthday.BirthdayCard; import com.ruoyi.member.domain.pojo.birthday.BirthdayGift; -import com.ruoyi.system.api.domain.poji.member.MemberGiftRecord; import com.ruoyi.member.domain.vo.*; import com.ruoyi.member.mapper.birthday.BirthdayCardMapper; import com.ruoyi.member.service.birthday.BirthdayCardService; import com.ruoyi.member.service.birthday.BirthdayGiftService; import com.ruoyi.member.service.member.MemberGiftRecordService; import com.ruoyi.system.api.domain.dto.BirthdayGiftSendDto; -import com.ruoyi.system.api.service.RemoteCouponService; -import com.ruoyi.system.api.service.RemoteOrderService; +import com.ruoyi.system.api.domain.poji.member.MemberGiftRecord; import com.ruoyi.system.api.service.RemoteShopService; import org.springframework.stereotype.Service; @@ -52,11 +50,6 @@ @Resource private MemberGiftRecordService memberGiftRecordService; - @Resource - private RemoteCouponService remoteCouponService; - - @Resource - private RemoteOrderService remoteOrderService; /** * @description 平台编辑生日卡 @@ -109,13 +102,13 @@ // 如果店铺ID为空,则进行相关设置 if(mgtBirthdayEditDto.getShopId()==null){ birthdayCard.setAreaFlag(mgtBirthdayEditDto.getAreaFlag()); - if(mgtBirthdayEditDto.getAreaFlag()==2){ + if(mgtBirthdayEditDto.getAreaFlag()!=null&&mgtBirthdayEditDto.getAreaFlag()==2){ birthdayCard.setDesignatedArea(mgtBirthdayEditDto.getDesignatedArea()); }else{ birthdayCard.setDesignatedArea(null); } birthdayCard.setShopFlag(mgtBirthdayEditDto.getShopFlag()); - if(mgtBirthdayEditDto.getShopFlag()==2){ + if(mgtBirthdayEditDto.getShopFlag()!=null&&mgtBirthdayEditDto.getShopFlag()==2){ birthdayCard.setApplicableShop(mgtBirthdayEditDto.getApplicableShop()); }else{ birthdayCard.setApplicableShop(null); @@ -129,7 +122,7 @@ List<MgtBirthdayGiftDto> mgtBirthdayGiftDtoList = mgtBirthdayEditDto.getMgtBirthdayGiftDtoList(); List<BirthdayGift> birthdayGiftList = new ArrayList<>(); // 如果生日礼物列表不为空,则进行相关设置 - if(!mgtBirthdayGiftDtoList.isEmpty()) { + if(mgtBirthdayGiftDtoList!=null&&!mgtBirthdayGiftDtoList.isEmpty()) { mgtBirthdayGiftDtoList.forEach(dto -> { BirthdayGift birthdayGift = new BirthdayGift(); birthdayGift.setDelFlag(0); diff --git a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/member/MemberCouponServiceImpl.java b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/member/MemberCouponServiceImpl.java index d1b673c..74b1e5d 100644 --- a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/member/MemberCouponServiceImpl.java +++ b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/member/MemberCouponServiceImpl.java @@ -217,7 +217,9 @@ } } appGetAbleCouponPageVo.setGoodsLimitList(goodsLimitList); - appGetAbleCouponPageVo.setVerifyShopName(shopMap.get(appGetAbleCouponPageVo.getShopId()).getShopName()); + if(appGetAbleCouponPageVo.getShopId()!=null){ + appGetAbleCouponPageVo.setVerifyShopName(shopMap.get(appGetAbleCouponPageVo.getShopId()).getShopName()); + } } } return memberCouponPageVoList; diff --git a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/member/MemberServiceImpl.java b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/member/MemberServiceImpl.java index ac05bc4..2ee588a 100644 --- a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/member/MemberServiceImpl.java +++ b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/member/MemberServiceImpl.java @@ -235,6 +235,7 @@ member.setMemberNo(memberNo); member.setUserId(sysUser.getUserId()); member.setDelFlag(0); + member.setFrozenFlag(0); member.setNickName("鸿瑞堂用户"); member.setRealName("鸿瑞堂用户"); member.setCustomerSource("小程序"); @@ -600,6 +601,7 @@ member.setMemberId(memberId); member.setUserId(sysUser.getUserId()); member.setDelFlag(0); + member.setFrozenFlag(0); member.setNickName(merMemberAddDto.getNickName()); member.setRealName(merMemberAddDto.getNickName()); member.setGender(merMemberAddDto.getGender()); @@ -768,8 +770,8 @@ String memberNo = createMemberNo(); member.setMemberNo(memberNo); member.setDelFlag(0); + member.setFrozenFlag(0); member.setAvatar("https://hongruitang.oss-cn-beijing.aliyuncs.com/default.png"); - member.setBindingFlag(0); member.setCreateTime(new Date()); member.setCustomerSource("商户订单添加"); this.saveOrUpdate(member); diff --git a/ruoyi-modules/ruoyi-member/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-member/src/main/resources/bootstrap.yml index 58dc3e4..73eb18f 100644 --- a/ruoyi-modules/ruoyi-member/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/ruoyi-member/src/main/resources/bootstrap.yml @@ -14,12 +14,12 @@ nacos: discovery: # 服务注册地址 - server-addr: 47.109.78.184:5000 - #server-addr: 127.0.0.1:8848 + #server-addr: 47.109.78.184:5000 + server-addr: 127.0.0.1:8848 config: # 配置中心地址 - server-addr: 47.109.78.184:5000 - #server-addr: 127.0.0.1:8848 + #server-addr: 47.109.78.184:5000 + server-addr: 127.0.0.1:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-modules/ruoyi-member/src/main/resources/mapper/member/MemberCouponMapper.xml b/ruoyi-modules/ruoyi-member/src/main/resources/mapper/member/MemberCouponMapper.xml index cdc9167..3c1a97f 100644 --- a/ruoyi-modules/ruoyi-member/src/main/resources/mapper/member/MemberCouponMapper.xml +++ b/ruoyi-modules/ruoyi-member/src/main/resources/mapper/member/MemberCouponMapper.xml @@ -159,7 +159,7 @@ tuc.money_threshold moneyThreshold, tuc.discount_money discountMoney, tuc.discount_percent discountPercent, - tuc.valid_start_time validStartTime, + IFNULL(tuc.valid_start_time,tuc.receive_time) validStartTime, tuc.deadline_time deadlineTime, tuc.rel_goods_ids relGoodsIds FROM t_member_coupon tuc diff --git a/ruoyi-modules/ruoyi-member/src/main/resources/mapper/member/MemberMapper.xml b/ruoyi-modules/ruoyi-member/src/main/resources/mapper/member/MemberMapper.xml index deb55a3..7d0a45b 100644 --- a/ruoyi-modules/ruoyi-member/src/main/resources/mapper/member/MemberMapper.xml +++ b/ruoyi-modules/ruoyi-member/src/main/resources/mapper/member/MemberMapper.xml @@ -60,7 +60,7 @@ <select id="selectMemberByMobile" parameterType="String" resultMap="MemberResult"> <include refid="selectMemberVo"/> - where mobile = #{mobile} + where mobile = #{mobile} AND del_flag = 0 </select> <insert id="insertMember" parameterType="com.ruoyi.system.api.domain.poji.member.Member"> diff --git a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/scheduler/OrderScheduler.java b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/scheduler/OrderScheduler.java new file mode 100644 index 0000000..1ba5c96 --- /dev/null +++ b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/scheduler/OrderScheduler.java @@ -0,0 +1,36 @@ +package com.ruoyi.order.scheduler; + + +import com.ruoyi.order.service.order.OrderService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; + + +@Component +@Slf4j +public class OrderScheduler { + + + @Autowired + private SchedulerUtils schedulerUtils; + + @Resource + private OrderService orderService; + + + /** + * 定时检查跟进任务状态 + */ + @Scheduled(cron="*/10 * * * *") + private void timingCheckMemberCoupon(){ + if(schedulerUtils.getSchedulerRun()) { + log.info("定时检查订单状态任务开始执行"); + orderService.checkOrderStatus(); + } + } + +} diff --git a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/scheduler/SchedulerUtils.java b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/scheduler/SchedulerUtils.java new file mode 100644 index 0000000..6d171d5 --- /dev/null +++ b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/scheduler/SchedulerUtils.java @@ -0,0 +1,48 @@ +package com.ruoyi.order.scheduler; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.stereotype.Component; + +import java.net.Inet4Address; +import java.net.InetAddress; +import java.net.NetworkInterface; +import java.util.Enumeration; + + +@Component +public class SchedulerUtils { + + @Autowired + private StringRedisTemplate redisTemplate; + + public boolean getSchedulerRun() { + String localIpAddress = getLocalIpAddress(); + return true; + } + + public static String getLocalIpAddress() { + String localIpAddress = ""; + try { + Enumeration<NetworkInterface> allNetInterfaces = NetworkInterface.getNetworkInterfaces(); + InetAddress ip = null; + while (allNetInterfaces.hasMoreElements()) { + NetworkInterface netInterface = (NetworkInterface) allNetInterfaces.nextElement(); + if (netInterface.isLoopback() || netInterface.isVirtual() || !netInterface.isUp()) { + continue; + } else { + Enumeration<InetAddress> addresses = netInterface.getInetAddresses(); + while (addresses.hasMoreElements()) { + ip = addresses.nextElement(); + if (ip != null && ip instanceof Inet4Address) { + return ip.getHostAddress(); + } + } + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return localIpAddress; + } +} diff --git a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java index 4a4ddf8..9cd4c87 100644 --- a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java +++ b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java @@ -28,6 +28,7 @@ import com.ruoyi.system.api.constant.DelayTaskEnum; import com.ruoyi.system.api.constant.SecurityConstant; import com.ruoyi.system.api.domain.dto.*; +import com.ruoyi.system.api.domain.poji.activity.ActivityRecord; import com.ruoyi.system.api.domain.poji.config.DelayTask; import com.ruoyi.system.api.domain.poji.goods.Goods; import com.ruoyi.system.api.domain.poji.goods.GoodsFile; @@ -175,7 +176,10 @@ List<AppMemberCouponVo> appMemberCouponVoList = remoteCouponService.listVoMemberCouponByUserId(merBaseDto).getData(); // 将优惠券列表转换为Map,以优惠券ID为键 - Map<String, AppMemberCouponVo> appMemberCouponVoMap = appMemberCouponVoList.stream().collect(Collectors.toMap(AppMemberCouponVo::getMemberCouponId, Function.identity())); + Map<String, AppMemberCouponVo> appMemberCouponVoMap = new HashMap<>(); + if(appMemberCouponVoList!=null&&!appMemberCouponVoList.isEmpty()){ + appMemberCouponVoMap = appMemberCouponVoList.stream().collect(Collectors.toMap(AppMemberCouponVo::getMemberCouponId, Function.identity())); + } AppMemberCouponVo appMemberCouponVo; Integer couponType; BigDecimal moneyThreshold; @@ -262,7 +266,6 @@ appSureOrderGoodsVo.setGoodsTotalPrice(goodsTotalPrice); appSureOrderGoodsVo.setCouponDiscount(discountMoney); appSureOrderGoodsVo.setGoodsRealPrice(goodsRealPrice); - goodsDeposit = goods.getSubscription(); // 获取商品押金 goodsDeposit = goods.getSubscription(); if (goodsDeposit != null && goodsDeposit.compareTo(BigDecimal.ZERO)>0) { @@ -290,6 +293,8 @@ }else{ entity.setUseFlag(0); } + + } // 过滤商品优惠券列表 List<AppMemberCouponVo> appGoodsMemberCouponVoList; @@ -409,6 +414,9 @@ } if (activityGoodsGetVo.getAvailableBuyNum() < 1) { throw new ServiceException(AppErrorConstant.ACTIVITY_GOODS_NULL); + } + if (activityGoodsGetVo.getAvailableBuyNum() < buyNum) { + throw new ServiceException(AppErrorConstant.ACTIVITY_GOODS_BEYOND); } Goods goods = remoteGoodsService.getGoods(goodsId).getData(); if(goods.getGoodsStatus()!=1){ @@ -726,7 +734,7 @@ //减去优惠券 - if(memberCouponSJ!=null){ + if(memberCouponSJ!=null&&StringUtils.isNotBlank(memberCouponSJ.toString())){ remoteCouponService.useMemberCoupon(memberCouponSJ.toString()); } //生成自动取消订单延时任务 @@ -814,8 +822,8 @@ if (activityGoodsGetVo.getAvailableBuyNum() < 1) { throw new ServiceException(AppErrorConstant.ACTIVITY_GOODS_NULL); } - if (buyNum < activityGoodsGetVo.getAvailableBuyNum()) { - throw new ServiceException(AppErrorConstant.ACTIVITY_GOODS_NULL); + if (activityGoodsGetVo.getAvailableBuyNum() < buyNum) { + throw new ServiceException(AppErrorConstant.ACTIVITY_GOODS_BEYOND); } // 创建订单ID和订单号 String orderId = IdUtils.simpleUUID(); @@ -1000,7 +1008,19 @@ appPlaceOrderVo.setTradeType(res.getSignType()); appPlaceOrderVo.setPaySign(res.getPaySign()); */ - + //生成活动参加记录 + ActivityRecord activityRecord = new ActivityRecord(); + activityRecord.setDelFlag(0); + activityRecord.setActivityId(activityId); + activityRecord.setUserId(userId); + activityRecord.setOrderTime(order.getCreateTime()); + activityRecord.setOrderMoney(order.getOrderMoney()); + activityRecord.setOrderId(orderId); + activityRecord.setCreateTime(new Date()); + activityRecord.setBuyNum(orderGoods.getBuyNum()); + activityRecord.setGoodsId(orderGoods.getGoodsId()); + activityRecord.setActivityMoney(activityGoodsGetVo.getActivityPrice()); + remoteActivityService.addActivityRecord(activityRecord); //生成自动取消订单延时任务 Integer delayTime = 30; if(redisService.hasKey(SecurityConstant.AUTO_CANCEL_ORDER_TIME)){ @@ -1184,9 +1204,9 @@ merVerifyOrderVo.setUseTime(order.getUseTime()); merVerifyOrderVo.setAppUserOrderGoodsPageVoList(appUserOrderGoodsPageVoList); // 根据订单用户ID获取用户信息 - SysUser sysUser = remoteUserService.getSysUser(order.getUserId()).getData(); - merVerifyOrderVo.setUserName(sysUser.getNickName()); - merVerifyOrderVo.setUserMobile(sysUser.getPhonenumber()); + Member member = remoteMemberService.getMember(order.getUserId()).getData(); + merVerifyOrderVo.setUserName(member.getRealName()); + merVerifyOrderVo.setUserMobile(member.getMobile()); merVerifyOrderVo.setCloseFlag(order.getCloseFlag()); // 返回结果 return merVerifyOrderVo; @@ -1210,6 +1230,7 @@ if (order.getOrderStatus() != 2) { throw new ServiceException(AppErrorConstant.VERIFY_USED); } + ShopRelUserVo shopRelUserVo = remoteShopService.getShopByUserId(merVerifyOrderDto.getUserId()).getData(); if(!shopRelUserVo.getShopId().equals(order.getShopId())){ throw new ServiceException(AppErrorConstant.VERIFY_SHOP_ERROR); @@ -1278,9 +1299,10 @@ merVerifyOrderVo.setCreateTime(order.getCreateTime()); merVerifyOrderVo.setPayTime(order.getPayTime()); merVerifyOrderVo.setUseTime(order.getUseTime()); - SysUser sysUser = remoteUserService.getSysUser(order.getUserId()).getData(); - merVerifyOrderVo.setUserName(sysUser.getNickName()); - merVerifyOrderVo.setUserMobile(sysUser.getPhonenumber()); + Member member = remoteMemberService.getMember(order.getUserId()).getData(); + merVerifyOrderVo.setUserName(member.getRealName()); + merVerifyOrderVo.setUserMobile(member.getMobile()); + merVerifyOrderVo.setCloseFlag(order.getCloseFlag()); // if(order.getOrderFrom()==2){ @@ -1312,7 +1334,7 @@ Long userId = verifyCouponGetVo.getUserId(); // 调用remoteMemberService的getMember方法获取Member对象 Member member = remoteMemberService.getMember(userId).getData(); - merVerifyCouponVo.setUserName(member.getNickName()); + merVerifyCouponVo.setUserName(member.getRealName()); merVerifyCouponVo.setUserMobile(member.getMobile()); merVerifyCouponVo.setCouponFrom(verifyCouponGetVo.getCouponFrom()); merVerifyCouponVo.setCouponName(verifyCouponGetVo.getMemberCoupon().getCouponName()); @@ -1404,7 +1426,7 @@ throw new ServiceException(AppErrorConstant.VERIFY_SHOP_ERROR); } Member member = remoteMemberService.getMember(memberGiftRecord.getUserId()).getData(); - merVerifyAwardVo.setUserName(member.getNickName()); + merVerifyAwardVo.setUserName(member.getRealName()); merVerifyAwardVo.setUserMobile(member.getMobile()); if(memberGiftRecord.getGiftFrom()==1){ merVerifyAwardVo.setGiftFrom("平台生日卡"); @@ -1524,6 +1546,8 @@ public void createNewOrder(MerNewOrderDto merNewOrderDto) { Long userId = merNewOrderDto.getBuyUserId(); Date nowTime = new Date(); + Long shopId = merNewOrderDto.getShopId(); + Shop shop = remoteShopService.getShop(shopId).getData(); //如果非指定用户判断是否需要通过手机号创建新用户 if (userId == null) { String name = merNewOrderDto.getName(); @@ -1551,6 +1575,9 @@ member.setMobile(mobile); member.setRealName(name); member.setNickName(name); + member.setBindingFlag(1); + member.setRelationShopId(shopId); + member.setRelationShopName(shop.getShopName()); remoteMemberService.createNewMember(member); } userId = sysUser.getUserId(); @@ -1567,8 +1594,6 @@ BigDecimal goodsPrice; BigDecimal goodsTotalPrice; BigDecimal goodsRealPrice; - Long shopId = merNewOrderDto.getShopId(); - Shop shop = remoteShopService.getShop(shopId).getData(); MerBaseDto merBaseDto = new MerBaseDto(); merBaseDto.setUserId(userId); merBaseDto.setShopId(shopId); @@ -2762,7 +2787,7 @@ Long userId = verifyCouponGetVo.getUserId(); // 调用remoteMemberService的getMember方法获取Member对象 Member member = remoteMemberService.getMember(userId).getData(); - merVerifyCouponVo.setUserName(member.getNickName()); + merVerifyCouponVo.setUserName(member.getRealName()); merVerifyCouponVo.setUserMobile(member.getMobile()); merVerifyCouponVo.setCouponFrom(verifyCouponGetVo.getCouponFrom()); merVerifyCouponVo.setCouponName(verifyCouponGetVo.getMemberCoupon().getCouponName()); @@ -2811,7 +2836,7 @@ throw new ServiceException(AppErrorConstant.VERIFY_SHOP_ERROR); } Member member = remoteMemberService.getMember(memberGiftRecord.getUserId()).getData(); - merVerifyAwardVo.setUserName(member.getNickName()); + merVerifyAwardVo.setUserName(member.getRealName()); merVerifyAwardVo.setUserMobile(member.getMobile()); if(memberGiftRecord.getGiftFrom()==1){ merVerifyAwardVo.setGiftFrom("平台生日卡"); @@ -3177,6 +3202,13 @@ agStockChangeDto.setShopId(order.getShopId()); agStockChangeDto.setUserId(order.getUserId()); remoteActivityService.changeActivityStock(agStockChangeDto); + //删除活动记录 + ActivityRecord activityRecord = new ActivityRecord(); + activityRecord.setActivityId(order.getActivityId()); + activityRecord.setGoodsId(orderGoods.getGoodsId()); + activityRecord.setUserId(order.getUserId()); + activityRecord.setOrderTime(order.getCreateTime()); + remoteActivityService.delActivityRecord(activityRecord); } } }else{ @@ -3394,6 +3426,13 @@ agStockChangeDto.setShopId(order.getShopId()); agStockChangeDto.setUserId(order.getUserId()); remoteActivityService.changeActivityStock(agStockChangeDto); + //删除活动记录 + ActivityRecord activityRecord = new ActivityRecord(); + activityRecord.setActivityId(order.getActivityId()); + activityRecord.setGoodsId(orderGoods.getGoodsId()); + activityRecord.setUserId(order.getUserId()); + activityRecord.setOrderTime(order.getCreateTime()); + remoteActivityService.delActivityRecord(activityRecord); }else{ memberCouponSJ.add(orderGoods.getCouponId()); } @@ -3718,4 +3757,31 @@ } return dateList; } + + /** + * @description 检查订单状态定时任务 + * @author jqs + * @date 2023/7/25 14:40 + * @param + * @return void + */ + @Override + public void checkOrderStatus(){ + Integer delayTime = 30; + if(redisService.hasKey(SecurityConstant.AUTO_CANCEL_ORDER_TIME)){ + delayTime = redisService.getCacheObject(SecurityConstant.AUTO_CANCEL_ORDER_TIME); + } + delayTime = delayTime + 5; + Date checkTime = DateUtils.addMinutes(new Date(),delayTime); + LambdaQueryWrapper<Order> queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(Order::getDelFlag,0); + queryWrapper.lt(Order::getCreateTime,checkTime); + queryWrapper.eq(Order::getOrderStatus,1); + List<Order> orderList = this.list(queryWrapper); + if(orderList!=null&&!orderList.isEmpty()){ + for(Order order : orderList){ + autoCancelOrder(order.getOrderId()); + } + } + } } diff --git a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/order/OrderService.java b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/order/OrderService.java index 997b2f3..b6dc237 100644 --- a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/order/OrderService.java +++ b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/order/OrderService.java @@ -479,4 +479,14 @@ * @return StaffActivityDateMemberTotalVo */ StaffActivityDateMemberTotalVo getStaffActivityMemberTotal(StaffTotalDto staffTotalDto); + + + /** + * @description 检查订单状态定时任务 + * @author jqs + * @date 2023/7/25 14:40 + * @param + * @return void + */ + void checkOrderStatus(); } diff --git a/ruoyi-modules/ruoyi-order/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-order/src/main/resources/bootstrap.yml index 79ddc73..8db7a2e 100644 --- a/ruoyi-modules/ruoyi-order/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/ruoyi-order/src/main/resources/bootstrap.yml @@ -14,12 +14,12 @@ nacos: discovery: # 服务注册地址 - server-addr: 47.109.78.184:5000 - #server-addr: 127.0.0.1:8848 + #server-addr: 47.109.78.184:5000 + server-addr: 127.0.0.1:8848 config: # 配置中心地址 - server-addr: 47.109.78.184:5000 - #server-addr: 127.0.0.1:8848 + #server-addr: 47.109.78.184:5000 + server-addr: 127.0.0.1:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-modules/ruoyi-shop/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-shop/src/main/resources/bootstrap.yml index 5e8dd18..def416e 100644 --- a/ruoyi-modules/ruoyi-shop/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/ruoyi-shop/src/main/resources/bootstrap.yml @@ -14,12 +14,12 @@ nacos: discovery: # 服务注册地址 - server-addr: 47.109.78.184:5000 - #server-addr: 127.0.0.1:8848 + #server-addr: 47.109.78.184:5000 + server-addr: 127.0.0.1:8848 config: # 配置中心地址 - server-addr: 47.109.78.184:5000 - #server-addr: 127.0.0.1:8848 + #server-addr: 47.109.78.184:5000 + server-addr: 127.0.0.1:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/management/MgtConfigController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/management/MgtConfigController.java index e92c90a..c815f3a 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/management/MgtConfigController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/management/MgtConfigController.java @@ -123,6 +123,16 @@ return R.ok(); } + @RequestMapping(value = "/editServiceCode", method = RequestMethod.POST) + @Log(title = "客服二维码管理", businessType = BusinessType.UPDATE,operContent = "修改客服二维码") + @ApiOperation(value = "修改客服二维码") + public R editServiceCode(@RequestBody MgtServiceCodeEditDto mgtServiceCodeEditDto) { + Long userId = SecurityUtils.getUserId(); + mgtServiceCodeEditDto.setUserId(userId); + customConfigService.editServiceCode(mgtServiceCodeEditDto); + return R.ok(); + } + @RequestMapping(value = "/editAgreement", method = RequestMethod.POST) @Log(title = "协议管理", businessType = BusinessType.UPDATE,operContent = "修改协议") @ApiOperation(value = "修改协议") diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/MgtCustomConfigDto.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/MgtCustomConfigDto.java index e6f6764..b8168a0 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/MgtCustomConfigDto.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/MgtCustomConfigDto.java @@ -23,6 +23,7 @@ "MEMBER_LEVEL:会员等级 " + "MEMBER_TYPE:会员类型 " + "NURSE_PROBLEM:调理问题 " + - "PLATFORM_SERVICE_PHONE:客服电话") + "PLATFORM_SERVICE_PHONE:客服电话" + + "PLATFORM_SERVICE_CODE:客服二维码") private String configType; } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/MgtServiceCodeEditDto.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/MgtServiceCodeEditDto.java new file mode 100644 index 0000000..6fff114 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/MgtServiceCodeEditDto.java @@ -0,0 +1,20 @@ +package com.ruoyi.system.domain.dto; + +import com.ruoyi.system.api.domain.dto.MgtBaseDto; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @ClassName MgtServiceCodeEditDto + * @Description TODO + * @Author jqs + * @Date 2023/7/25 16:16 + * @Version 1.0 + */ +@Data +public class MgtServiceCodeEditDto extends MgtBaseDto { + + @ApiModelProperty(value = "客服二维码") + private String serviceCodeUrl; + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/config/CustomConfigService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/config/CustomConfigService.java index 16de6be..fc7a8bf 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/config/CustomConfigService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/config/CustomConfigService.java @@ -40,6 +40,15 @@ void editServiceMobile( MgtServiceMobileEditDto mgtServiceMobileEditDto); /** + * @description 修改客服二维码 + * @author jqs + * @date 2023/7/25 16:17 + * @param mgtServiceCodeEditDto + * @return void + */ + void editServiceCode(MgtServiceCodeEditDto mgtServiceCodeEditDto); + + /** * @description 平台获取自定义配置 * @author jqs * @date 2023/6/7 15:02 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/CustomConfigServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/CustomConfigServiceImpl.java index 202703d..f07fbcc 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/CustomConfigServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/CustomConfigServiceImpl.java @@ -110,6 +110,33 @@ } /** + * @description 修改客服二维码 + * @author jqs + * @date 2023/7/25 16:17 + * @param mgtServiceCodeEditDto + * @return void + */ + @Override + public void editServiceCode(MgtServiceCodeEditDto mgtServiceCodeEditDto){ + // 获取平台服务电话的配置 + CustomConfig customConfig = getByKey(ConfigEnum.PLATFORM_SERVICE_CODE.getKey()); + // 如果配置不存在,则创建一个新的配置 + if (customConfig == null) { + customConfig = new CustomConfig(); + customConfig.setCreateTime(new Date()); + customConfig.setDelFlag(0); + } + // 设置配置的类型、键、名称、值和更新时间 + customConfig.setConfigType(ConfigEnum.PLATFORM_SERVICE_CODE.getKeyType()); + customConfig.setConfigKey(ConfigEnum.PLATFORM_SERVICE_CODE.getKey()); + customConfig.setConfigName(ConfigEnum.PLATFORM_SERVICE_CODE.getKeyName()); + customConfig.setConfigValue(mgtServiceCodeEditDto.getServiceCodeUrl()); + customConfig.setUpdateTime(new Date()); + // 保存或更新配置 + this.saveOrUpdate(customConfig); + } + + /** * @param * @return MgtCustomConfigVo * @description 平台获取自定义配置 diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml index 0cd36c2..a310a03 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml @@ -14,12 +14,12 @@ nacos: discovery: # 服务注册地址 - server-addr: 47.109.78.184:5000 - #server-addr: 127.0.0.1:8848 + #server-addr: 47.109.78.184:5000 + server-addr: 127.0.0.1:8848 config: # 配置中心地址 - server-addr: 47.109.78.184:5000 - #server-addr: 127.0.0.1:8848 + #server-addr: 47.109.78.184:5000 + server-addr: 127.0.0.1:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/sys/SysMenuMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/sys/SysMenuMapper.xml index cfa1985..a1f0247 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/sys/SysMenuMapper.xml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/sys/SysMenuMapper.xml @@ -111,7 +111,7 @@ select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time from sys_menu m left join sys_user_menu rm on m.menu_id = rm.menu_id - where rm.user_id = #{params.userId} AND m.menu_from = 1 AND rm.menu = 1 and m.status = '0' + where rm.user_id = #{params.userId} AND m.menu_from = 1 AND rm.menu_from = 1 and m.status = '0' <if test="menuName != null and menuName != ''"> AND m.menu_name like concat('%', #{menuName}, '%') </if> diff --git a/ruoyi-visual/ruoyi-monitor/src/main/resources/bootstrap.yml b/ruoyi-visual/ruoyi-monitor/src/main/resources/bootstrap.yml index f9c405e..16510ce 100644 --- a/ruoyi-visual/ruoyi-monitor/src/main/resources/bootstrap.yml +++ b/ruoyi-visual/ruoyi-monitor/src/main/resources/bootstrap.yml @@ -14,12 +14,12 @@ nacos: discovery: # 服务注册地址 - server-addr: 47.109.78.184:5000 - #server-addr: 127.0.0.1:8848 + #server-addr: 47.109.78.184:5000 + server-addr: 127.0.0.1:8848 config: # 配置中心地址 - server-addr: 47.109.78.184:5000 - #server-addr: 127.0.0.1:8848 + #server-addr: 47.109.78.184:5000 + server-addr: 127.0.0.1:8848 # 配置文件格式 file-extension: yml # 共享配置 -- Gitblit v1.7.1