Bladeren bron

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	mall-service/src/main/java/com/txz/mall/controller/OrderController.java
#	mall-service/src/main/java/com/txz/mall/service/impl/StoreOrderServiceImpl.java
#	mall-service/src/main/java/com/txz/mall/service/impl/StorePinkServiceImpl.java
#	mall-service/src/main/java/com/txz/mall/service/impl/StoreProductServiceImpl.java
yubin 1 week geleden
bovenliggende
commit
913edf035e
43 gewijzigde bestanden met toevoegingen van 2033 en 813 verwijderingen
  1. 32 13
      mall-service/src/main/java/com/txz/mall/configurer/MybatisConfigurer.java
  2. 0 3
      mall-service/src/main/java/com/txz/mall/controller/BannerController.java
  3. 114 0
      mall-service/src/main/java/com/txz/mall/controller/NoticeController.java
  4. 58 14
      mall-service/src/main/java/com/txz/mall/controller/OrderController.java
  5. 96 88
      mall-service/src/main/java/com/txz/mall/controller/appcontroller/AppCombinationController.java
  6. 136 0
      mall-service/src/main/java/com/txz/mall/controller/appcontroller/AppNoticeController.java
  7. 66 72
      mall-service/src/main/java/com/txz/mall/controller/appcontroller/AppOrderController.java
  8. 126 121
      mall-service/src/main/java/com/txz/mall/controller/appcontroller/AppProductController.java
  9. 33 28
      mall-service/src/main/java/com/txz/mall/core/AuthService.java
  10. 0 7
      mall-service/src/main/java/com/txz/mall/core/UserUtil.java
  11. 7 0
      mall-service/src/main/java/com/txz/mall/dao/MidFavoriteMapper.java
  12. 13 0
      mall-service/src/main/java/com/txz/mall/dao/NoticeMapper.java
  13. 13 0
      mall-service/src/main/java/com/txz/mall/dao/OtherNoticeMapper.java
  14. 13 0
      mall-service/src/main/java/com/txz/mall/dao/StoreCombinationMapper.java
  15. 9 0
      mall-service/src/main/java/com/txz/mall/dao/StorePinkMapper.java
  16. 16 0
      mall-service/src/main/java/com/txz/mall/dao/impl/MidFavoriteMapperImpl.java
  17. 29 0
      mall-service/src/main/java/com/txz/mall/dao/impl/StoreCombinationMapperImpl.java
  18. 20 0
      mall-service/src/main/java/com/txz/mall/dao/impl/StorePinkMapperImpl.java
  19. 5 2
      mall-service/src/main/java/com/txz/mall/dubbo/client/CifUserDubboServiceClient.java
  20. 102 0
      mall-service/src/main/java/com/txz/mall/enums/NoticeEnum.java
  21. 45 0
      mall-service/src/main/java/com/txz/mall/enums/NoticeGroupEnum.java
  22. 12 0
      mall-service/src/main/java/com/txz/mall/enums/PinkOrderStatusEnum.java
  23. 80 0
      mall-service/src/main/java/com/txz/mall/model/Notice.java
  24. 57 0
      mall-service/src/main/java/com/txz/mall/model/OtherNotice.java
  25. 40 0
      mall-service/src/main/java/com/txz/mall/service/NoticeService.java
  26. 12 0
      mall-service/src/main/java/com/txz/mall/service/OtherNoticeService.java
  27. 4 3
      mall-service/src/main/java/com/txz/mall/service/StoreOrderService.java
  28. 3 0
      mall-service/src/main/java/com/txz/mall/service/StorePinkService.java
  29. 82 0
      mall-service/src/main/java/com/txz/mall/service/impl/NoticeServiceImpl.java
  30. 19 0
      mall-service/src/main/java/com/txz/mall/service/impl/OtherNoticeServiceImpl.java
  31. 366 354
      mall-service/src/main/java/com/txz/mall/service/impl/StoreOrderServiceImpl.java
  32. 58 11
      mall-service/src/main/java/com/txz/mall/service/impl/StorePinkServiceImpl.java
  33. 52 25
      mall-service/src/main/java/com/txz/mall/service/impl/StoreProductServiceImpl.java
  34. 38 0
      mall-service/src/main/java/com/txz/mall/util/excel/converter/OrderStatucConverter.java
  35. 37 0
      mall-service/src/main/java/com/txz/mall/web/ro/OtherNoticeRO.java
  36. 33 0
      mall-service/src/main/java/com/txz/mall/web/ro/SendNoticeRO.java
  37. 34 0
      mall-service/src/main/java/com/txz/mall/web/vo/ProductCarouselVO.java
  38. 17 0
      mall-service/src/main/java/dto/FavoriteDTO.java
  39. 43 0
      mall-service/src/main/java/dto/NoticeDTO.java
  40. 23 0
      mall-service/src/main/java/dto/ProductCarouselDTO.java
  41. 27 19
      mall-service/src/main/java/po/StoreOrderExportPO.java
  42. 62 52
      mall-service/src/main/java/vo/StoreProductInfoVO.java
  43. 1 1
      mall-service/src/main/resources/bootstrap.properties

+ 32 - 13
mall-service/src/main/java/com/txz/mall/configurer/MybatisConfigurer.java

@@ -1,8 +1,8 @@
 package com.txz.mall.configurer;
 
+import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
 import com.txz.mall.core.ProjectConstant;
 import org.apache.ibatis.session.SqlSessionFactory;
-import org.mybatis.spring.SqlSessionFactoryBean;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
@@ -17,33 +17,52 @@ import java.util.Properties;
  */
 @Configuration
 public class MybatisConfigurer {
-
+    
     @Bean
     public SqlSessionFactory sqlSessionFactoryBean(DataSource dataSource) throws Exception {
-        SqlSessionFactoryBean factory = new SqlSessionFactoryBean();
+        // 使用MyBatis-Plus的SqlSessionFactoryBean以支持两个框架
+        MybatisSqlSessionFactoryBean factory = new MybatisSqlSessionFactoryBean();
         factory.setDataSource(dataSource);
         factory.setTypeAliasesPackage(ProjectConstant.MODEL_PACKAGE);
-
-        //添加XML目录
+        
+        // 添加XML目录
         ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
         factory.setMapperLocations(resolver.getResources("classpath:mapper/*.xml"));
         return factory.getObject();
     }
-
-    @Bean
-    public MapperScannerConfigurer mapperScannerConfigurer() {
+    
+    @Bean("tkMapperScannerConfigurer")
+    public MapperScannerConfigurer tkMapperScannerConfigurer() {
         MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
         mapperScannerConfigurer.setSqlSessionFactoryBeanName("sqlSessionFactoryBean");
         mapperScannerConfigurer.setBasePackage(ProjectConstant.MAPPER_PACKAGE);
-
-        //配置通用Mapper,详情请查阅官方文档
+        
+        // 配置通用Mapper,详情请查阅官方文档
         Properties properties = new Properties();
         properties.setProperty("mappers", ProjectConstant.MAPPER_INTERFACE_REFERENCE);
-        properties.setProperty("notEmpty", "false");//insert、update是否判断字符串类型!='' 即 test="str != null"表达式内是否追加 and str != ''
+        properties.setProperty("notEmpty", "false");// insert、update是否判断字符串类型!='' 即 test="str != null"表达式内是否追加 and str != ''
         properties.setProperty("IDENTITY", "MYSQL");
         mapperScannerConfigurer.setProperties(properties);
-
+        
         return mapperScannerConfigurer;
     }
-
+    
+    /**
+     * MyBatis-Plus Mapper扫描配置
+     */
+    @Bean("mybatisPlusMapperScannerConfigurer")
+    public MapperScannerConfigurer mybatisPlusMapperScannerConfigurer() {
+        MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
+        mapperScannerConfigurer.setSqlSessionFactoryBeanName("sqlSessionFactoryBean");
+        // 只扫描特定包下的MyBatis-Plus Mapper
+        mapperScannerConfigurer.setBasePackage("com.txz.mall.dao");
+        
+        Properties properties = new Properties();
+        properties.setProperty("notEmpty", "false");
+        properties.setProperty("IDENTITY", "MYSQL");
+        mapperScannerConfigurer.setProperties(properties);
+        
+        return mapperScannerConfigurer;
+    }
+    
 }

+ 0 - 3
mall-service/src/main/java/com/txz/mall/controller/BannerController.java

@@ -1,13 +1,10 @@
 package com.txz.mall.controller;
 
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.extension.api.R;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.txz.mall.core.RedisUtil;
 import com.txz.mall.core.Result;
 import com.txz.mall.core.ResultCode;
-import com.txz.mall.core.UserUtil;
 import com.txz.mall.model.Banner;
 import com.txz.mall.service.BannerService;
 import com.txz.mall.web.param.BannerParam;

+ 114 - 0
mall-service/src/main/java/com/txz/mall/controller/NoticeController.java

@@ -0,0 +1,114 @@
+package com.txz.mall.controller;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.txz.mall.core.Result;
+import com.txz.mall.model.OtherNotice;
+import com.txz.mall.service.NoticeService;
+import com.txz.mall.service.OtherNoticeService;
+import com.txz.mall.web.param.BasePageParam;
+import com.txz.mall.web.ro.OtherNoticeRO;
+import com.txz.mall.web.ro.SendNoticeRO;
+import lombok.RequiredArgsConstructor;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * [后台]通知模板
+ *
+ * @author: MTD®️
+ * @date: 2025/8/26
+ */
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("notice")
+public class NoticeController {
+    
+    private final OtherNoticeService otherNoticeService;
+    
+    private final NoticeService noticeService;
+    
+    /**
+     * 分页
+     */
+    @GetMapping("page")
+    public Result<Page<OtherNotice>> page(BasePageParam page, String queryStr) {
+        Page queryPage = new Page(page.getPage(), page.getSize());
+        return Result.success(
+                otherNoticeService.page(queryPage, Wrappers.<OtherNotice>lambdaQuery()
+                        .and(StrUtil.isNotBlank(queryStr),
+                                item -> item
+                                        .like(OtherNotice::getTitle, queryStr)
+                                        .or()
+                                        .like(OtherNotice::getMessage, queryStr)
+                        )
+                        .eq(OtherNotice::getIsDelete, Boolean.FALSE)
+                )
+        );
+    }
+    
+    /**
+     * 新增
+     */
+    @PostMapping("save")
+    public Result save(@Validated({OtherNoticeRO.Add.class}) @RequestBody OtherNoticeRO ro) {
+        OtherNotice otherNotice = BeanUtil.copyProperties(ro, OtherNotice.class);
+        otherNoticeService.save(otherNotice);
+        return Result.success();
+    }
+    
+    /**
+     * 详情
+     */
+    @GetMapping("info/{id:^\\d+$}")
+    public Result info(@PathVariable("id") Long id) {
+        OtherNotice info = otherNoticeService.getById(id);
+        if (ObjectUtil.isEmpty(info)) {
+            return Result.fail("数据不存在");
+        }
+        return Result.success(info);
+    }
+    
+    /**
+     * 删除
+     */
+    @DeleteMapping("delete/{id:^\\d+$}")
+    public Result delete(@PathVariable("id") Long id) {
+        otherNoticeService.update(Wrappers.<OtherNotice>lambdaUpdate().eq(OtherNotice::getId, id).set(OtherNotice::getIsDelete, 1));
+        return Result.success();
+    }
+    
+    /**
+     * 更新
+     */
+    @PatchMapping("update/{id:^\\d+$}")
+    public Result update(@Validated({OtherNoticeRO.Update.class}) @RequestBody OtherNoticeRO ro, @PathVariable("id") Long id) {
+        OtherNotice info = otherNoticeService.getById(id);
+        if (ObjectUtil.isEmpty(info)) {
+            return Result.fail("数据不存在");
+        }
+        if (info.getIsDelete() == 1) {
+            return Result.fail("数据已删除");
+        }
+        BeanUtil.copyProperties(ro, info);
+        otherNoticeService.updateById(info);
+        return Result.success();
+    }
+    
+    /**
+     * 发送消息
+     */
+    @PostMapping("sendNotice")
+    public Result otherNoticeId(@Validated({SendNoticeRO.Send.class}) @RequestBody SendNoticeRO ro) {
+        OtherNotice info = otherNoticeService.getById(ro.getId());
+        if (ObjectUtil.isEmpty(info)) {
+            return Result.fail("数据不存在");
+        }
+        noticeService.addOtherNotice(info.getId(), info.getTitle(), info.getMessage(), info.getPages(), ro.getUids().stream().toArray(Long[]::new));
+        return Result.success();
+    }
+    
+}

+ 58 - 14
mall-service/src/main/java/com/txz/mall/controller/OrderController.java

@@ -1,15 +1,17 @@
 package com.txz.mall.controller;
 
 import com.alibaba.fastjson.annotation.JSONField;
-import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.txz.mall.business.OrderServiceBusiness;
 import com.txz.mall.core.AuthService;
 import com.txz.mall.core.Result;
 import com.txz.mall.core.ResultCode;
+import com.txz.mall.enums.PinkOrderStatusEnum;
 import com.txz.mall.model.StoreOrder;
 import com.txz.mall.service.StoreOrderService;
-import dto.*;
+import dto.CreateOrderRequest;
+import dto.StoreOrderDTO;
+import dto.StoreOrderDeliveryDTO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.slf4j.Logger;
@@ -41,6 +43,7 @@ public class OrderController {
     @Resource
     private OrderServiceBusiness orderServiceBusiness;
 
+
     @PostMapping("/add")
     @ApiOperation(value = "创建订单")
     public Result add(@Validated @RequestBody CreateOrderRequest orderRequest) {
@@ -84,7 +87,7 @@ public class OrderController {
         }
         try {
             storeOrder.setUpdateTime(new Date());
-//    		storeOrder.setUpdateUserId(userId);
+            //    		storeOrder.setUpdateUserId(userId);
             storeOrderService.update(storeOrder);
         } catch (Exception e) {
             log.error("更新对象操作异常e:{}", e);
@@ -105,17 +108,13 @@ public class OrderController {
 
     @PostMapping("/list")
     @ApiOperation(value = "订单获取列表")
-    public Result<List<StoreOrderVO>> list(@RequestBody StoreOrderDTO dto) {
-        PageHelper.startPage(dto.getPage(), dto.getSize());
-        PageInfo pageInfo = null;
+    public Result<PageInfo<StoreOrderVO>> list(@RequestBody StoreOrderDTO dto) {
         try {
-            List<StoreOrderVO> arrayList = storeOrderService.orderList(dto);
-            pageInfo = new PageInfo(arrayList);
+            return Result.success(storeOrderService.orderList(dto));
         } catch (Exception e) {
             log.error("查询对象操作异常e:{}", e);
             return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
         }
-        return Result.success(pageInfo);
     }
 
 //    @PostMapping("/app/list")
@@ -144,9 +143,16 @@ public class OrderController {
 
     @ApiOperation("导出订单")
     @PostMapping("/export")
-    public Result exportFile(@RequestBody StoreOrderDTO dto, HttpServletResponse response) {
+    public void exportFile(@RequestBody StoreOrderDTO dto, HttpServletResponse response) {
+        storeOrderService.exportFile(dto, response);
+    }
+
+    @ApiOperation("导出发货单")
+    @PostMapping("/exportDelivery")
+    public void exportDelivery(@RequestBody StoreOrderDTO dto, HttpServletResponse response) {
+        // dto.setPaid(1);
+        dto.setStatus(PinkOrderStatusEnum.GROUP_ORDER_TO_SHIP.getKey());
         storeOrderService.exportFile(dto, response);
-        return Result.success();
     }
 
     @ApiOperation("退款")
@@ -173,6 +179,7 @@ public class OrderController {
 
 
 
+
     @ApiOperation("取消订单")
     @PostMapping("/cancel")
     public Result cancel(@RequestParam("id") Long id) {
@@ -183,7 +190,7 @@ public class OrderController {
     @ApiOperation("联系用户")
     @PostMapping("/contactUser")
     public Result contactUser(@RequestParam("userId") Long userId) {
-//        storeOrderService.contactUser(userId);
+        //        storeOrderService.contactUser(userId);
         return Result.success();
     }
 
@@ -245,10 +252,47 @@ public class OrderController {
         return Result.success();
     }
 
+
+    //    @ApiOperation(value = "预下单")
+    //    @PostMapping(value = "/pre/order")
+    //    public Result preOrder(@RequestBody @Validated PreOrderRequest request) {
+    //        Long tokenUserId = AuthService.getTokenUserId(null);
+    //        request.setUserId(tokenUserId);
+    //        return Result.success(storeOrderService.preOrder(request));
+    //
+    //    }
+    //    @ApiOperation(value = "加载预下单")
+    //    @PostMapping(value = "load/pre")
+    //    public Result<PreOrderResponse> loadPreOrder(@RequestParam String preOrderNo) {
+    //
+    //        Long tokenUserId = AuthService.getTokenUserId(null);
+    //        return Result.success(storeOrderService.loadPreOrder(preOrderNo));
+    //    }
+
+    //    @ApiOperation(value = "计算订单价格")
+    //    @PostMapping(value = "/computed/price")
+    //    public Result<ComputedOrderPriceResponse> computedPrice(@Validated @RequestBody OrderComputedPriceRequest request) {
+    //
+    //        Long tokenUserId = AuthService.getTokenUserId(null);
+    //        request.setUserId(tokenUserId);
+    //        return Result.success(storeOrderService.computedOrderPrice(request));
+    //    }
+
+    //    @ApiOperation(value = "去支付")
+    //    @PostMapping(value = "/goPay")
+    //    public Result getPayResult(@RequestBody GoPinkDTO dto) {
+    //
+    //        Long tokenUserId = AuthService.getTokenUserId(null);
+    //        dto.setUserId(tokenUserId);
+    //        Boolean result = storeOrderService.goPay(dto);
+    //        return Result.success(result);
+    //    }
+
     @ApiOperation("导入发货单")
     @PostMapping("/importDelivery")
-    public Result importDelivery(@JSONField(serialize = false) @RequestParam("file") MultipartFile file) {
-        storeOrderService.importDelivery(file);
+    public Result importDelivery(@JSONField(serialize = false) @RequestParam("file") MultipartFile file, HttpServletResponse response) {
+        storeOrderService.importDelivery(file, response);
         return Result.success();
     }
+
 }

+ 96 - 88
mall-service/src/main/java/com/txz/mall/controller/appcontroller/AppCombinationController.java

@@ -35,86 +35,86 @@ import java.util.stream.Collectors;
 @RestController
 @RequestMapping("/app/combination")
 public class AppCombinationController {
-
+    
     private static Logger log = LoggerFactory.getLogger(AppCombinationController.class);
-
+    
     @Resource
     private StoreCombinationService storeCombinationService;
     @Resource
     private StoreOrderService storeOrderService;
     @Resource
     private OrderServiceBusiness orderServiceBusiness;
-
-//    @PostMapping("/add")
-//    @ApiOperation(value = "拼团商品表新增")
-//    public Result add(@RequestBody StoreCombination storeCombination) {
-//        if (storeCombination == null) {
-//            return Result.fail(ResultCode.OBJECT_IS_NULL);
-//        }
-//        try {
-//            storeCombination.setCreateTime(new Date());
-////            storeCombination.setCreateUserId(userId);
-//            storeCombinationService.save(storeCombination);
-//        } catch (Exception e) {
-//            log.error("新增对象操作异常e:{}", e);
-//            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
-//        }
-//        return Result.success();
-//    }
-
-//    @DeleteMapping("/delete")
-//    @ApiOperation(value = "拼团商品表删除")
-//    public Result delete(@RequestParam Long id) {
-//        if (id == null) {
-//            return Result.fail(ResultCode.ID_IS_NULL);
-//        }
-//        StoreCombination combination = storeCombinationService.findById(id);
-//        if (combination == null) {
-//            return Result.fail(ResultCode.OBJECT_IS_NULL);
-//        }
-//        Date date = new Date();
-//        if (combination.getIsShow().equals(1) && combination.getStartTime().before(date) && combination.getStopTime().after(date)) {
-//            throw new ServiceException("活动开启中,商品不支持删除");
-//        }
-//        try {
-//            StoreCombination storeCombination = new StoreCombination();
-//            storeCombination.setId(id);
-//            storeCombination.setIsDelete(1);
-//            storeCombinationService.update(storeCombination);
-//        } catch (Exception e) {
-//            log.error("删除对象操作异常e:{}", e);
-//            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
-//        }
-//        return Result.success();
-//    }
-
-//    @PutMapping("/update")
-//    @ApiOperation(value = "拼团商品表更新")
-//    public Result update(@RequestBody StoreCombination storeCombination) {
-//        if (storeCombination == null) {
-//            return Result.fail(ResultCode.OBJECT_IS_NULL);
-//        }
-//        if (storeCombination.getId() == null) {
-//            return Result.fail(ResultCode.ID_IS_NULL);
-//        }
-//        try {
-//            storeCombination.setUpdateTime(new Date());
-////            storeCombination.setUpdateUserId(userId);
-//            storeCombinationService.update(storeCombination);
-//        } catch (Exception e) {
-//            log.error("更新对象操作异常e:{}", e);
-//            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
-//        }
-//        return Result.success();
-//    }
-
+    
+    //    @PostMapping("/add")
+    //    @ApiOperation(value = "拼团商品表新增")
+    //    public Result add(@RequestBody StoreCombination storeCombination) {
+    //        if (storeCombination == null) {
+    //            return Result.fail(ResultCode.OBJECT_IS_NULL);
+    //        }
+    //        try {
+    //            storeCombination.setCreateTime(new Date());
+    ////            storeCombination.setCreateUserId(userId);
+    //            storeCombinationService.save(storeCombination);
+    //        } catch (Exception e) {
+    //            log.error("新增对象操作异常e:{}", e);
+    //            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
+    //        }
+    //        return Result.success();
+    //    }
+    
+    //    @DeleteMapping("/delete")
+    //    @ApiOperation(value = "拼团商品表删除")
+    //    public Result delete(@RequestParam Long id) {
+    //        if (id == null) {
+    //            return Result.fail(ResultCode.ID_IS_NULL);
+    //        }
+    //        StoreCombination combination = storeCombinationService.findById(id);
+    //        if (combination == null) {
+    //            return Result.fail(ResultCode.OBJECT_IS_NULL);
+    //        }
+    //        Date date = new Date();
+    //        if (combination.getIsShow().equals(1) && combination.getStartTime().before(date) && combination.getStopTime().after(date)) {
+    //            throw new ServiceException("活动开启中,商品不支持删除");
+    //        }
+    //        try {
+    //            StoreCombination storeCombination = new StoreCombination();
+    //            storeCombination.setId(id);
+    //            storeCombination.setIsDelete(1);
+    //            storeCombinationService.update(storeCombination);
+    //        } catch (Exception e) {
+    //            log.error("删除对象操作异常e:{}", e);
+    //            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
+    //        }
+    //        return Result.success();
+    //    }
+    
+    //    @PutMapping("/update")
+    //    @ApiOperation(value = "拼团商品表更新")
+    //    public Result update(@RequestBody StoreCombination storeCombination) {
+    //        if (storeCombination == null) {
+    //            return Result.fail(ResultCode.OBJECT_IS_NULL);
+    //        }
+    //        if (storeCombination.getId() == null) {
+    //            return Result.fail(ResultCode.ID_IS_NULL);
+    //        }
+    //        try {
+    //            storeCombination.setUpdateTime(new Date());
+    
+    /// /            storeCombination.setUpdateUserId(userId);
+    //            storeCombinationService.update(storeCombination);
+    //        } catch (Exception e) {
+    //            log.error("更新对象操作异常e:{}", e);
+    //            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
+    //        }
+    //        return Result.success();
+    //    }
     @GetMapping("/detail")
     @ApiOperation(value = "拼团商品表获取详情")
     public Result<StoreCombination> detail(@RequestParam Long id) {
         if (id == null) {
             return Result.fail(ResultCode.ID_IS_NULL);
         }
-
+        
         StoreCombination storeCombination = null;
         try {
             storeCombination = storeCombinationService.findById(id);
@@ -124,17 +124,17 @@ public class AppCombinationController {
         }
         return Result.success(storeCombination);
     }
-
+    
     @PostMapping("/app/list")
     @ApiOperation(value = "拼团商品表获取列表")
     public Result<List<StoreCombination>> list(@RequestBody StoreProductDTO dto) {
         PageHelper.startPage(dto.getPage(), dto.getSize());
-
+        
         Condition condition = new Condition(StoreCombination.class);
         Example.Criteria criteria = condition.createCriteria();
         criteria.andEqualTo("isDelete", 0);
         criteria.andEqualTo("isShow", 1);
-
+        
         if (dto.getSortWay() == null) {
             dto.setSortWay(0);
         }
@@ -155,13 +155,21 @@ public class AppCombinationController {
                 condition.setOrderByClause("create_time DESC");
                 break;
         }
-        if (dto.getIsNew() != null) {
-            criteria.andEqualTo("isNew", 1);
-        }
-
-        if (dto.getMinPrice() != null && dto.getMaxPrice() != null) {
-            criteria.andBetween("price", dto.getMinPrice(), dto.getMaxPrice());
+        
+        // if (dto.getIsNew() != null) {
+        //     criteria.andEqualTo("isNew", 1);
+        // }
+        
+        // if (dto.getMinPrice() != null && dto.getMaxPrice() != null) {
+        //     criteria.andBetween("price", dto.getMinPrice(), dto.getMaxPrice());
+        // }
+        if (dto.getMaxPrice() != null) {
+            criteria.andEqualTo("price", dto.getMaxPrice());
         }
+        Date now = new Date();
+        criteria.andLessThanOrEqualTo("startTime", now);
+        criteria.andGreaterThanOrEqualTo("stopTime", now);
+        
         PageInfo pageInfo = null;
         try {
             List<StoreCombination> list = storeCombinationService.findByCondition(condition);
@@ -172,7 +180,7 @@ public class AppCombinationController {
         }
         return Result.success(pageInfo);
     }
-
+    
     @PostMapping("/addActivityProduct")
     @ApiOperation(value = "添加活动商品")
     public Result addActivityProduct(@RequestBody StoreCombinationAddParam storeCombinationAddParam) {
@@ -185,7 +193,7 @@ public class AppCombinationController {
         storeCombinationService.addActivityProduct(storeCombinationAddParam.getList(), storeCombinationAddParam.getActivityId());
         return Result.success();
     }
-
+    
     @GetMapping("/getActivityProductIds")
     @ApiOperation(value = "获取活动商品ids")
     public Result<List<Long>> getActivityProductIds(@RequestParam("activityId") Long activityId) {
@@ -197,22 +205,22 @@ public class AppCombinationController {
         List<Long> arrayList = combinationList.stream().map(StoreCombination::getProductId).collect(Collectors.toList());
         return Result.success(arrayList);
     }
-
+    
     /**
      * 去开团
      */
-//    @ApiOperation(value = "支付成功-去开团")
-//    @PostMapping(value = "/open")
+    //    @ApiOperation(value = "支付成功-去开团")
+    //    @PostMapping(value = "/open")
     public Result goOpen(@RequestParam("orderId") String orderId) {
         storeOrderService.goOpen(orderId);
         return Result.success();
     }
-
+    
     /**
      * 去拼团
      */
-//    @ApiOperation(value = "去拼团")
-//    @PostMapping(value = "/pink")
+    //    @ApiOperation(value = "去拼团")
+    //    @PostMapping(value = "/pink")
     public Result goPink(@Validated @RequestBody GoPinkDTO dto) {
         if (dto.getPinkId() == null && dto.getCid() == null) {
             return Result.fail(ResultCode.ID_IS_NULL);
@@ -220,7 +228,7 @@ public class AppCombinationController {
         storeOrderService.goPink(dto);
         return Result.success();
     }
-
+    
     /**
      * 更多拼团
      */
@@ -238,7 +246,7 @@ public class AppCombinationController {
         }
         return Result.success(pageInfo);
     }
-
+    
     @ApiOperation(value = "排行榜")
     @GetMapping(value = "/rank")
     public Result<List<StoreCombinationRankVO>> getRank(@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer size) {
@@ -253,6 +261,6 @@ public class AppCombinationController {
         }
         return Result.success(pageInfo);
     }
-
-
+    
+    
 }

+ 136 - 0
mall-service/src/main/java/com/txz/mall/controller/appcontroller/AppNoticeController.java

@@ -0,0 +1,136 @@
+package com.txz.mall.controller.appcontroller;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.txz.mall.core.AuthService;
+import com.txz.mall.core.Result;
+import com.txz.mall.enums.NoticeGroupEnum;
+import com.txz.mall.model.Notice;
+import com.txz.mall.service.NoticeService;
+import com.txz.mall.web.param.BasePageParam;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * app端通知
+ *
+ * @author: MTD®️
+ * @date: 2025/8/26
+ */
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("app/notice")
+public class AppNoticeController {
+    
+    private final NoticeService noticeService;
+    
+    /**
+     * 获取未读条数
+     */
+    @GetMapping("unread")
+    public Result unread() {
+        Long userId;
+        try {
+            userId = AuthService.getTokenUserId(null);
+        } catch (Exception e) {
+            return Result.success(0);
+        }
+        return Result.success(noticeService.count(Wrappers.<Notice>lambdaQuery()
+                        .eq(Notice::getUid, userId)
+                        .eq(Notice::getUserDel, Boolean.FALSE)
+                        .eq(Notice::getReadFlag, Boolean.FALSE)
+                )
+        );
+    }
+    
+    /**
+     * 获取消息分页
+     */
+    @GetMapping("page")
+    public Result<Page<Notice>> page(NoticeGroupEnum type, BasePageParam page) {
+        Page queryPage = new Page(page.getPage(), page.getSize());
+        LambdaQueryWrapper<Notice> eq = Wrappers.<Notice>lambdaQuery()
+                // .likeRight(ObjectUtil.isNotEmpty(type), Notice::getNoticeType, type.getData())
+                .eq(Notice::getUid, AuthService.getTokenUserId(null))
+                .eq(Notice::getUserDel, Boolean.FALSE)
+                .orderByAsc(Notice::getReadFlag)
+                .orderByDesc(Notice::getCreateTime);
+        if (ObjectUtil.isNotEmpty(type)) {
+            eq.likeRight(Notice::getNoticeType, type.getData());
+        }
+        return Result.success(
+                noticeService.page(queryPage, eq)
+        );
+    }
+    
+    /**
+     * 已读
+     */
+    @PutMapping("read/{id:^\\d+$}")
+    public Result read(@PathVariable("id") Long id) {
+        Notice readInfo = noticeService.getOne(Wrappers.<Notice>lambdaQuery()
+                .eq(Notice::getId, id)
+                .eq(Notice::getUid, AuthService.getTokenUserId(null))
+                .eq(Notice::getUserDel, Boolean.FALSE)
+                .eq(Notice::getReadFlag, Boolean.FALSE)
+        );
+        if (ObjectUtil.isNotEmpty(readInfo)) {
+            readInfo.setReadFlag(Boolean.TRUE);
+            noticeService.updateById(readInfo);
+        }
+        return Result.success();
+    }
+    
+    /**
+     * 一键已读
+     */
+    @PutMapping("readAll")
+    public Result readAll(NoticeGroupEnum type) {
+        LambdaUpdateWrapper<Notice> updateWrapper = Wrappers.<Notice>lambdaUpdate()
+                .eq(Notice::getUid, AuthService.getTokenUserId(null))
+                .eq(Notice::getUserDel, Boolean.FALSE)
+                .eq(Notice::getReadFlag, Boolean.FALSE)
+                .set(Notice::getReadFlag, Boolean.TRUE);
+        // .likeRight(ObjectUtil.isNotEmpty(type), Notice::getNoticeType, type.getData());
+        if (ObjectUtil.isNotEmpty(type)) {
+            updateWrapper.likeRight(Notice::getNoticeType, type.getData());
+        }
+        noticeService.update(updateWrapper);
+        return Result.success();
+    }
+    
+    /**
+     * 删除消息
+     */
+    @DeleteMapping("delete/{id:^\\d+$}")
+    public Result delete(@PathVariable("id") Long id) {
+        noticeService.update(Wrappers.<Notice>lambdaUpdate()
+                .eq(Notice::getId, id)
+                .eq(Notice::getUid, AuthService.getTokenUserId(null))
+                .set(Notice::getUserDel, Boolean.TRUE)
+                .set(Notice::getReadFlag, Boolean.TRUE)
+        );
+        return Result.success();
+    }
+    
+    /**
+     * 一键删除消息
+     */
+    @DeleteMapping("delete")
+    public Result delete(NoticeGroupEnum type) {
+        LambdaUpdateWrapper<Notice> updateWrapper = Wrappers.<Notice>lambdaUpdate()
+                // .likeRight(ObjectUtil.isNotEmpty(type), Notice::getNoticeType, type.getData())
+                .eq(Notice::getUid, AuthService.getTokenUserId(null))
+                .set(Notice::getUserDel, Boolean.TRUE)
+                .set(Notice::getReadFlag, Boolean.TRUE);
+        if (ObjectUtil.isNotEmpty(type)) {
+            updateWrapper.likeRight(Notice::getNoticeType, type.getData());
+        }
+        noticeService.update(updateWrapper);
+        return Result.success();
+    }
+    
+}

+ 66 - 72
mall-service/src/main/java/com/txz/mall/controller/appcontroller/AppOrderController.java

@@ -1,6 +1,5 @@
 package com.txz.mall.controller.appcontroller;
 
-import com.alibaba.fastjson.annotation.JSONField;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.txz.mall.business.OrderServiceBusiness;
@@ -18,13 +17,11 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
 import vo.MyRecord;
 import vo.StoreOrderCountItemVO;
 import vo.StoreOrderVO;
 
 import javax.annotation.Resource;
-import javax.servlet.http.HttpServletResponse;
 import java.util.Date;
 import java.util.List;
 
@@ -35,19 +32,19 @@ import java.util.List;
 @RestController
 @RequestMapping("/app/order")
 public class AppOrderController {
-
+    
     private static Logger log = LoggerFactory.getLogger(AppOrderController.class);
-
+    
     @Resource
     private StoreOrderService storeOrderService;
     @Resource
     private OrderServiceBusiness orderServiceBusiness;
-
+    
     @PostMapping("/add")
     @ApiOperation(value = "创建订单")
     public Result add(@Validated @RequestBody CreateOrderRequest orderRequest) {
-
-
+        
+        
         if (orderRequest == null) {
             return Result.fail(ResultCode.OBJECT_IS_NULL);
         }
@@ -56,7 +53,7 @@ public class AppOrderController {
         MyRecord record = storeOrderService.createOrder(orderRequest);
         return Result.success(record);
     }
-
+    
     @DeleteMapping("/delete")
     @ApiOperation(value = "订单删除")
     public Result delete(@RequestParam Long id) {
@@ -74,7 +71,7 @@ public class AppOrderController {
         }
         return Result.success();
     }
-
+    
     @PutMapping("/update")
     @ApiOperation(value = "订单更新")
     public Result update(@RequestBody StoreOrder storeOrder) {
@@ -86,7 +83,7 @@ public class AppOrderController {
         }
         try {
             storeOrder.setUpdateTime(new Date());
-//    		storeOrder.setUpdateUserId(userId);
+            //    		storeOrder.setUpdateUserId(userId);
             storeOrderService.update(storeOrder);
         } catch (Exception e) {
             log.error("更新对象操作异常e:{}", e);
@@ -94,17 +91,17 @@ public class AppOrderController {
         }
         return Result.success();
     }
-
+    
     @PutMapping("/binding/address")
     @ApiOperation(value = "订单绑定地址")
     public Result update(@RequestBody StoreOrderUpdateParam storeOrderUpdateParam) {
-
+        
         try {
             StoreOrder storeOrder = new StoreOrder();
             storeOrder.setOrderId(storeOrderUpdateParam.getOrderId());
             storeOrder.setAddressId(storeOrderUpdateParam.getAddressId());
-            EasyToUseUtil.appUpdateAssignment(new Date(),storeOrder);
-
+            EasyToUseUtil.appUpdateAssignment(new Date(), storeOrder);
+            
             storeOrderService.bindingAddress(storeOrder);
         } catch (Exception e) {
             log.error("更新对象操作异常e:{}", e);
@@ -112,8 +109,8 @@ public class AppOrderController {
         }
         return Result.success();
     }
-
-
+    
+    
     @GetMapping("/detail")
     @ApiOperation(value = "订单获取详情")
     public Result<StoreOrderVO> detail(@RequestParam Long id) {
@@ -123,26 +120,22 @@ public class AppOrderController {
         StoreOrderVO vo = orderServiceBusiness.orderDetail(id);
         return Result.success(vo);
     }
-
+    
     @PostMapping("/list")
     @ApiOperation(value = "订单获取列表")
     public Result<List<StoreOrderVO>> list(@RequestBody StoreOrderDTO dto) {
-        PageHelper.startPage(dto.getPage(), dto.getSize());
-        PageInfo pageInfo = null;
         try {
-            List<StoreOrderVO> arrayList = storeOrderService.orderList(dto);
-            pageInfo = new PageInfo(arrayList);
+            return Result.success(storeOrderService.orderList(dto));
         } catch (Exception e) {
             log.error("查询对象操作异常e:{}", e);
             return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
         }
-        return Result.success(pageInfo);
     }
-
+    
     @PostMapping("/app/list")
     @ApiOperation(value = "订单获取列表")
     public Result<List<StoreOrderVO>> appList(@RequestBody StoreOrderAppDTO dto) {
-
+        
         Long tokenUserId = AuthService.getTokenUserId(null);
         dto.setUserId(tokenUserId);
         PageHelper.startPage(dto.getPage(), dto.getSize());
@@ -156,101 +149,102 @@ public class AppOrderController {
         }
         return Result.success(pageInfo);
     }
-
+    
     @ApiOperation(value = "获取订单各状态数量")
     @GetMapping(value = "/status/num")
     public Result<StoreOrderCountItemVO> getOrderStatusNum() {
         return Result.success(storeOrderService.getOrderStatusNum());
     }
-
-//    @ApiOperation("导出订单")
-//    @PostMapping("/export")
-//    public Result exportFile(@RequestBody StoreOrderDTO dto, HttpServletResponse response) {
-//        storeOrderService.exportFile(dto, response);
-//        return Result.success();
-//    }
-//
-//    @ApiOperation("退款")
-//    @PostMapping("/refund")
-//    public Result refund(@RequestParam("id") Long id) {
-//        storeOrderService.refund(id);
-//        return Result.success();
-//    }
-
+    
+    //    @ApiOperation("导出订单")
+    //    @PostMapping("/export")
+    //    public Result exportFile(@RequestBody StoreOrderDTO dto, HttpServletResponse response) {
+    //        storeOrderService.exportFile(dto, response);
+    //        return Result.success();
+    //    }
+    //
+    //    @ApiOperation("退款")
+    //    @PostMapping("/refund")
+    //    public Result refund(@RequestParam("id") Long id) {
+    //        storeOrderService.refund(id);
+    //        return Result.success();
+    //    }
+    
     @ApiOperation("关闭订单")
     @PostMapping("/close")
     public Result close(@RequestParam("id") Long id) {
         storeOrderService.close(id);
         return Result.success();
     }
-
+    
     @ApiOperation("取消订单")
     @PostMapping("/cancel")
     public Result cancel(@RequestParam("id") Long id) {
         storeOrderService.cancel(id);
         return Result.success();
     }
-
+    
     @ApiOperation("联系用户")
     @PostMapping("/contactUser")
     public Result contactUser(@RequestParam("userId") Long userId) {
-//        storeOrderService.contactUser(userId);
+        //        storeOrderService.contactUser(userId);
         return Result.success();
     }
-
-//    @ApiOperation("批量发货")
-//    @PostMapping("/batchDelivery")
-//    public Result batchDelivery(@RequestBody List<StoreOrderDeliveryDTO> list) {
-//        storeOrderService.batchDelivery(list);
-//        return Result.success();
-//    }
-
+    
+    //    @ApiOperation("批量发货")
+    //    @PostMapping("/batchDelivery")
+    //    public Result batchDelivery(@RequestBody List<StoreOrderDeliveryDTO> list) {
+    //        storeOrderService.batchDelivery(list);
+    //        return Result.success();
+    //    }
+    
     @ApiOperation(value = "预下单")
     @PostMapping(value = "/pre/order")
     public Result preOrder(@RequestBody @Validated PreOrderRequest request) {
         Long tokenUserId = AuthService.getTokenUserId(null);
         request.setUserId(tokenUserId);
         return Result.success(storeOrderService.preOrder(request));
-
+        
     }
+    
     @ApiOperation(value = "加载预下单")
     @PostMapping(value = "load/pre")
     public Result<PreOrderResponse> loadPreOrder(@RequestParam String preOrderNo) {
-
+        
         Long tokenUserId = AuthService.getTokenUserId(null);
         return Result.success(storeOrderService.loadPreOrder(preOrderNo));
     }
-
+    
     @ApiOperation(value = "计算订单价格")
     @PostMapping(value = "/computed/price")
     public Result<ComputedOrderPriceResponse> computedPrice(@Validated @RequestBody OrderComputedPriceRequest request) {
-
+        
         Long tokenUserId = AuthService.getTokenUserId(null);
         request.setUserId(tokenUserId);
         return Result.success(storeOrderService.computedOrderPrice(request));
     }
-
+    
     @ApiOperation(value = "去支付")
     @PostMapping(value = "/goPay")
     public Result getPayResult(@RequestBody GoPinkDTO dto) {
-
+        
         Long tokenUserId = AuthService.getTokenUserId(null);
         dto.setUserId(tokenUserId);
         Boolean result = storeOrderService.goPay(dto);
         return Result.success(result);
     }
-
-//    @ApiOperation("导出发货单")
-//    @PostMapping("/exportDelivery")
-//    public Result exportDelivery(HttpServletResponse response) {
-//        storeOrderService.exportDelivery(response);
-//        return Result.success();
-//    }
-
-//    @ApiOperation("导入发货单")
-//    @PostMapping("/importDelivery")
-//    public Result importDelivery(@JSONField(serialize = false) @RequestParam("file") MultipartFile file) {
-//        storeOrderService.importDelivery(file);
-//        return Result.success();
-//    }
+    
+    //    @ApiOperation("导出发货单")
+    //    @PostMapping("/exportDelivery")
+    //    public Result exportDelivery(HttpServletResponse response) {
+    //        storeOrderService.exportDelivery(response);
+    //        return Result.success();
+    //    }
+    
+    //    @ApiOperation("导入发货单")
+    //    @PostMapping("/importDelivery")
+    //    public Result importDelivery(@JSONField(serialize = false) @RequestParam("file") MultipartFile file) {
+    //        storeOrderService.importDelivery(file);
+    //        return Result.success();
+    //    }
 }

+ 126 - 121
mall-service/src/main/java/com/txz/mall/controller/appcontroller/AppProductController.java

@@ -1,31 +1,26 @@
 package com.txz.mall.controller.appcontroller;
 
-import com.alibaba.fastjson.annotation.JSONField;
-import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.txz.mall.core.Result;
 import com.txz.mall.core.ResultCode;
 import com.txz.mall.model.StoreProduct;
+import com.txz.mall.service.StorePinkService;
 import com.txz.mall.service.StoreProductService;
-import dto.StoreProductAddRequest;
+import com.txz.mall.web.vo.ProductCarouselVO;
 import dto.StoreProductDTO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
 import tk.mybatis.mapper.entity.Condition;
 import tk.mybatis.mapper.entity.Example.Criteria;
 import vo.StoreProductCountItemVO;
 import vo.StoreProductInfoVO;
 
 import javax.annotation.Resource;
-import javax.servlet.http.HttpServletResponse;
-import java.util.Date;
 import java.util.List;
 
 /**
@@ -35,77 +30,80 @@ import java.util.List;
 @RestController
 @RequestMapping("/app/product")
 public class AppProductController {
-
+    
     private static Logger log = LoggerFactory.getLogger(AppProductController.class);
-
+    
     @Resource
     private StoreProductService storeProductService;
-
-//    @DeleteMapping("/delete")
-//    @ApiOperation(value = "商品删除")
-//    public Result delete(@RequestParam("ids") List<Long> ids) {
-//        if (CollectionUtils.isEmpty(ids)) {
-//            return Result.fail(ResultCode.ID_IS_NULL);
-//        }
-//        try {
-//            ids.forEach(id -> {
-//                StoreProduct storeProduct = new StoreProduct();
-//                storeProduct.setId(id);
-////                storeProduct.setIsRecycle(1);
-//                storeProduct.setIsDelete(1);
-//                storeProduct.setUpdateTime(new Date());
-//                storeProductService.update(storeProduct);
-//            });
-//        } catch (Exception e) {
-//            log.error("删除对象操作异常e:{}", e);
-//            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
-//        }
-//        return Result.success();
-//    }
-
-//    @PutMapping("/update")
-//    @ApiOperation(value = "商品更新")
-//    public Result update(@RequestBody @Validated StoreProductAddRequest request) {
-//        if (request == null) {
-//            return Result.fail(ResultCode.OBJECT_IS_NULL);
-//        }
-//        if (request.getId() == null) {
-//            return Result.fail(ResultCode.ID_IS_NULL);
-//        }
-//        storeProductService.update(request);
-//        return Result.success();
-//    }
-
-//    @PostMapping("/updateShowStatus")
-//    @ApiOperation(value = "商品上下架")
-//    public Result updateShowStatus(@RequestParam Long id, @RequestParam Integer ShowStatus) {
-//        if (ShowStatus == null) {
-//            return Result.fail(ResultCode.OBJECT_IS_NULL);
-//        }
-//        if (id == null) {
-//            return Result.fail(ResultCode.ID_IS_NULL);
-//        }
-//
-//        try {
-//            StoreProduct storeProduct = new StoreProduct();
-//            storeProduct.setUpdateTime(new Date());
-////            storeProduct.setUpdateUserId(userId);
-//            storeProduct.setId(id);
-//            storeProduct.setIsShow(ShowStatus);
-//            storeProductService.update(storeProduct);
-//        } catch (Exception e) {
-//            log.error("更新对象操作异常e:{}", e);
-//            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
-//        }
-//        return Result.success();
-//    }
-
+    
+    @Resource
+    private StorePinkService storePinkService;
+    
+    //    @DeleteMapping("/delete")
+    //    @ApiOperation(value = "商品删除")
+    //    public Result delete(@RequestParam("ids") List<Long> ids) {
+    //        if (CollectionUtils.isEmpty(ids)) {
+    //            return Result.fail(ResultCode.ID_IS_NULL);
+    //        }
+    //        try {
+    //            ids.forEach(id -> {
+    //                StoreProduct storeProduct = new StoreProduct();
+    //                storeProduct.setId(id);
+    ////                storeProduct.setIsRecycle(1);
+    //                storeProduct.setIsDelete(1);
+    //                storeProduct.setUpdateTime(new Date());
+    //                storeProductService.update(storeProduct);
+    //            });
+    //        } catch (Exception e) {
+    //            log.error("删除对象操作异常e:{}", e);
+    //            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
+    //        }
+    //        return Result.success();
+    //    }
+    
+    //    @PutMapping("/update")
+    //    @ApiOperation(value = "商品更新")
+    //    public Result update(@RequestBody @Validated StoreProductAddRequest request) {
+    //        if (request == null) {
+    //            return Result.fail(ResultCode.OBJECT_IS_NULL);
+    //        }
+    //        if (request.getId() == null) {
+    //            return Result.fail(ResultCode.ID_IS_NULL);
+    //        }
+    //        storeProductService.update(request);
+    //        return Result.success();
+    //    }
+    
+    //    @PostMapping("/updateShowStatus")
+    //    @ApiOperation(value = "商品上下架")
+    //    public Result updateShowStatus(@RequestParam Long id, @RequestParam Integer ShowStatus) {
+    //        if (ShowStatus == null) {
+    //            return Result.fail(ResultCode.OBJECT_IS_NULL);
+    //        }
+    //        if (id == null) {
+    //            return Result.fail(ResultCode.ID_IS_NULL);
+    //        }
+    //
+    //        try {
+    //            StoreProduct storeProduct = new StoreProduct();
+    //            storeProduct.setUpdateTime(new Date());
+    
+    /// /            storeProduct.setUpdateUserId(userId);
+    //            storeProduct.setId(id);
+    //            storeProduct.setIsShow(ShowStatus);
+    //            storeProductService.update(storeProduct);
+    //        } catch (Exception e) {
+    //            log.error("更新对象操作异常e:{}", e);
+    //            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
+    //        }
+    //        return Result.success();
+    //    }
     @PostMapping("/list")
     @ApiOperation(value = "商品获取列表")
     public Result<List<StoreProduct>> list(@RequestBody StoreProductDTO dto) {
-
+        
         PageHelper.startPage(dto.getPage(), dto.getSize());
-
+        
         Condition condition = new Condition(StoreProduct.class);
         Criteria criteria = condition.createCriteria();
         criteria.andEqualTo("isDelete", 0);
@@ -138,64 +136,71 @@ public class AppProductController {
         }
         return Result.success(pageInfo);
     }
-
-//    @ApiOperation("商品导入")
-//    @PostMapping("/import")
-//    public Result importFile(@JSONField(serialize = false) @RequestParam("file") MultipartFile file) {
-//        storeProductService.importFile(file);
-//        return Result.success();
-//    }
-
-//    @ApiOperation("商品导入模版")
-//    @PostMapping("/export")
-//    public Result exportFile(HttpServletResponse response) {
-//        storeProductService.exportFile(response);
-//        return Result.success();
-//    }
-
+    
+    //    @ApiOperation("商品导入")
+    //    @PostMapping("/import")
+    //    public Result importFile(@JSONField(serialize = false) @RequestParam("file") MultipartFile file) {
+    //        storeProductService.importFile(file);
+    //        return Result.success();
+    //    }
+    
+    //    @ApiOperation("商品导入模版")
+    //    @PostMapping("/export")
+    //    public Result exportFile(HttpServletResponse response) {
+    //        storeProductService.exportFile(response);
+    //        return Result.success();
+    //    }
+    
     @ApiOperation(value = "商品详情")
     @GetMapping(value = "/detail")
     public Result<StoreProductInfoVO> info(@RequestParam Long id) {
         return Result.success(storeProductService.getInfo(id));
     }
-
-//    @PostMapping("/batchShowStatus")
-//    @ApiOperation(value = "批量商品上下架")
-//    public Result batchShowStatus(@RequestParam("ids") List<Long> ids, @RequestParam("showStatus") Integer showStatus) {
-//        if (showStatus == null) {
-//            return Result.fail(ResultCode.OBJECT_IS_NULL);
-//        }
-//        if (CollectionUtils.isEmpty(ids)) {
-//            return Result.fail(ResultCode.ID_IS_NULL);
-//        }
-//
-//        try {
-//            ids.forEach(id -> {
-//                StoreProduct storeProduct = new StoreProduct();
-//                storeProduct.setUpdateTime(new Date());
-////                storeProduct.setUpdateUserId(userId);
-//                storeProduct.setId(id);
-//                storeProduct.setIsShow(showStatus);
-//                storeProductService.update(storeProduct);
-//            });
-//        } catch (Exception e) {
-//            log.error("更新对象操作异常e:{}", e);
-//            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
-//        }
-//        return Result.success();
-//    }
-
+    
+    //    @PostMapping("/batchShowStatus")
+    //    @ApiOperation(value = "批量商品上下架")
+    //    public Result batchShowStatus(@RequestParam("ids") List<Long> ids, @RequestParam("showStatus") Integer showStatus) {
+    //        if (showStatus == null) {
+    //            return Result.fail(ResultCode.OBJECT_IS_NULL);
+    //        }
+    //        if (CollectionUtils.isEmpty(ids)) {
+    //            return Result.fail(ResultCode.ID_IS_NULL);
+    //        }
+    //
+    //        try {
+    //            ids.forEach(id -> {
+    //                StoreProduct storeProduct = new StoreProduct();
+    //                storeProduct.setUpdateTime(new Date());
+    
+    /// /                storeProduct.setUpdateUserId(userId);
+    //                storeProduct.setId(id);
+    //                storeProduct.setIsShow(showStatus);
+    //                storeProductService.update(storeProduct);
+    //            });
+    //        } catch (Exception e) {
+    //            log.error("更新对象操作异常e:{}", e);
+    //            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
+    //        }
+    //        return Result.success();
+    //    }
     @ApiOperation(value = "获取商品各状态数量")
     @GetMapping(value = "/status/num")
     public Result<StoreProductCountItemVO> getOrderStatusNum() {
         return Result.success(storeProductService.getOrderStatusNum());
     }
-
-//    @ApiOperation(value = "新增商品")
-//    @PostMapping(value = "/add")
-//    public Result<String> save(@RequestBody @Validated StoreProductAddRequest request) {
-//        storeProductService.save(request);
-//        return Result.success();
-//    }
-
+    
+    //    @ApiOperation(value = "新增商品")
+    //    @PostMapping(value = "/add")
+    //    public Result<String> save(@RequestBody @Validated StoreProductAddRequest request) {
+    //        storeProductService.save(request);
+    //        return Result.success();
+    //    }
+    
+    /**
+     * 商品轮播
+     */
+    @GetMapping("carousel/{productId:^\\d+$}")
+    public Result<List<ProductCarouselVO>> carousel(@PathVariable("productId") Long productId) {
+        return Result.success(storePinkService.carousel(productId));
+    }
 }

+ 33 - 28
mall-service/src/main/java/com/txz/mall/core/AuthService.java

@@ -25,38 +25,42 @@ import java.util.UUID;
 @Service
 @Slf4j
 public class AuthService {
-
+    
     private static final String BEARER = "Bearer ";
-
+    
     /**
      * jwt token 密钥,主要用于token解析,签名验证
      */
     @Value("${spring.security.oauth2.jwt.signingKey}")
     private static String signingKey = "txz123456";
-
+    
     private static Claims getJwt(String jwtToken) {
-        if (jwtToken.startsWith(BEARER)) {
-            jwtToken = StringUtils.substring(jwtToken, BEARER.length());
-        }
-        Claims claims;
         try {
-            claims = Jwts.parser()
-                    .setSigningKey(signingKey.getBytes())
-                    .parseClaimsJws(jwtToken).getBody();
-        } catch (ExpiredJwtException e) {
-            claims = e.getClaims();
+            if (jwtToken.startsWith(BEARER)) {
+                jwtToken = StringUtils.substring(jwtToken, BEARER.length());
+            }
+            Claims claims;
+            try {
+                claims = Jwts.parser()
+                        .setSigningKey(signingKey.getBytes())
+                        .parseClaimsJws(jwtToken).getBody();
+            } catch (ExpiredJwtException e) {
+                claims = e.getClaims();
+            }
+            return claims;
+        } catch (Exception e) {
+            throw new ServiceException("请先登录");
         }
-
-        return claims;
+        
     }
-
+    
     public String buildJwtToken(Long userId) {
         String KEY = "txz123456";
         Date now = DateUtil.date();
         Date exp = DateUtil.offset(now, DateField.DAY_OF_YEAR, 30);
         Map<String, Object> claims = new HashMap<String, Object>();
         claims.put("userId", userId);
-
+        
         String jwtToken = Jwts.builder()
                 .setClaims(claims)
                 .setId(UUID.randomUUID().toString())
@@ -64,10 +68,10 @@ public class AuthService {
                 .setSubject("sawa")
                 .signWith(SignatureAlgorithm.HS256, KEY.getBytes())
                 .setExpiration(exp).compact();
-
+        
         return "Bearer " + jwtToken;
     }
-
+    
     public String buildJwtTokenWithRole(Long userId, Integer role, Integer day) {
         String KEY = "123456";
         Date now = DateUtil.date();
@@ -75,7 +79,7 @@ public class AuthService {
         Map<String, Object> claims = new HashMap<String, Object>();
         claims.put("userId", userId);
         claims.put("role", role);
-
+        
         String jwtToken = Jwts.builder()
                 .setClaims(claims)
                 .setId(UUID.randomUUID().toString())
@@ -83,10 +87,10 @@ public class AuthService {
                 .setSubject("sawa")
                 .signWith(SignatureAlgorithm.HS256, KEY.getBytes())
                 .setExpiration(exp).compact();
-
+        
         return "Bearer " + jwtToken;
     }
-
+    
     public Claims getClaimsFromToken(String authentication) {
         try {
             final Claims claims = this.getJwt(authentication);
@@ -99,7 +103,7 @@ public class AuthService {
         }
         return null;
     }
-
+    
     public static Long getTokenUserId(HttpServletRequest request) {
         if (request == null) {
             ServletRequestAttributes sra = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
@@ -113,11 +117,12 @@ public class AuthService {
         Claims claims = getJwt(token);
         return Long.valueOf(claims.get("userId").toString());
     }
-
+    
     /**
      * 验证 JWT token 的有效性
      *
      * @param token 待验证的 token 字符串(可带或不带 "Bearer " 前缀)
+     *
      * @return 验证结果对象,包含:
      * - 是否有效(boolean)
      * - 如果无效,错误信息(String)
@@ -129,20 +134,20 @@ public class AuthService {
             if (StringUtils.isBlank(token)) {
                 return ImmutableTriple.of(false, "Token不能为空", null);
             }
-
+            
             // 2. 解析token获取Claims
             Claims claims = getJwt(token);
-
+            
             // 3. 检查token是否过期
             if (DateUtil.compare(DateUtil.date(), claims.getExpiration()) >= 0) {
                 return ImmutableTriple.of(false, "Token已过期", claims);
             }
-
+            
             // 4. 检查必要字段(根据业务需求)
             if (claims.get("userId") == null) {
                 return ImmutableTriple.of(false, "无效Token: 缺少userId字段", claims);
             }
-
+            
             // 5. 所有检查通过,返回有效
             return ImmutableTriple.of(true, null, claims);
         } catch (ExpiredJwtException e) {
@@ -153,7 +158,7 @@ public class AuthService {
             return ImmutableTriple.of(false, "无效Token: " + e.getMessage(), null);
         }
     }
-
+    
 }
 
 

+ 0 - 7
mall-service/src/main/java/com/txz/mall/core/UserUtil.java

@@ -1,12 +1,6 @@
 package com.txz.mall.core;
 
-import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.extension.api.R;
-import com.txz.mall.core.cache.CacheKey;
-import com.txz.mall.core.cache.CacheType;
-import com.txz.mall.util.EasyToUseUtil;
-import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Component;
 import org.springframework.util.ObjectUtils;
 import org.springframework.web.context.request.RequestContextHolder;
@@ -15,7 +9,6 @@ import org.springframework.web.context.request.ServletRequestAttributes;
 import javax.annotation.PostConstruct;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
-import java.util.Set;
 
 /**
  * @Date: 2019/10/10 10:12

+ 7 - 0
mall-service/src/main/java/com/txz/mall/dao/MidFavoriteMapper.java

@@ -1,7 +1,14 @@
 package com.txz.mall.dao;
 
 import com.txz.mall.core.Mapper;
+import com.txz.mall.dao.impl.MidFavoriteMapperImpl;
 import com.txz.mall.model.MidFavorite;
+import dto.FavoriteDTO;
+import org.apache.ibatis.annotations.SelectProvider;
 
 public interface MidFavoriteMapper extends Mapper<MidFavorite> {
+    
+    @SelectProvider(type = MidFavoriteMapperImpl.class, method = "getFavoriteFlag")
+    int getFavoriteFlag(FavoriteDTO dto);
+    
 }

+ 13 - 0
mall-service/src/main/java/com/txz/mall/dao/NoticeMapper.java

@@ -0,0 +1,13 @@
+package com.txz.mall.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.txz.mall.model.Notice;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @author: MTD®️
+ * @date: 2025/8/26
+ */
+@Mapper
+public interface NoticeMapper extends BaseMapper<Notice> {
+}

+ 13 - 0
mall-service/src/main/java/com/txz/mall/dao/OtherNoticeMapper.java

@@ -0,0 +1,13 @@
+package com.txz.mall.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.txz.mall.model.OtherNotice;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @author: MTD®️
+ * @date: 2025/8/26
+ */
+@Mapper
+public interface OtherNoticeMapper extends BaseMapper<OtherNotice> {
+}

+ 13 - 0
mall-service/src/main/java/com/txz/mall/dao/StoreCombinationMapper.java

@@ -1,7 +1,20 @@
 package com.txz.mall.dao;
 
 import com.txz.mall.core.Mapper;
+import com.txz.mall.dao.impl.StoreCombinationMapperImpl;
 import com.txz.mall.model.StoreCombination;
+import dto.StoreProductAddRequest;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.SelectProvider;
+import org.apache.ibatis.annotations.UpdateProvider;
+
+import java.util.List;
 
 public interface StoreCombinationMapper extends Mapper<StoreCombination> {
+    
+    @UpdateProvider(type = StoreCombinationMapperImpl.class, method = "updateCombinationByProductId")
+    int updateCombinationByProductId(StoreProductAddRequest request);
+    
+    @SelectProvider(type = StoreCombinationMapperImpl.class, method = "getIdByProductId")
+    Long getIdByProductId(Long productId);
 }

+ 9 - 0
mall-service/src/main/java/com/txz/mall/dao/StorePinkMapper.java

@@ -1,7 +1,16 @@
 package com.txz.mall.dao;
 
 import com.txz.mall.core.Mapper;
+import com.txz.mall.dao.impl.StorePinkMapperImpl;
 import com.txz.mall.model.StorePink;
+import dto.ProductCarouselDTO;
+import org.apache.ibatis.annotations.SelectProvider;
+
+import java.util.List;
 
 public interface StorePinkMapper extends Mapper<StorePink> {
+    
+    @SelectProvider(type = StorePinkMapperImpl.class, method = "pinkByProductId")
+    List<ProductCarouselDTO> pinkByProductId(Long productId);
+    
 }

+ 16 - 0
mall-service/src/main/java/com/txz/mall/dao/impl/MidFavoriteMapperImpl.java

@@ -0,0 +1,16 @@
+package com.txz.mall.dao.impl;
+
+import dto.FavoriteDTO;
+
+/**
+ * @author: MTD®️
+ * @date: 2025/8/27
+ */
+
+public class MidFavoriteMapperImpl {
+    
+    public String getFavoriteFlag(FavoriteDTO dto) {
+        return "select count(id) from m_mid_favorite  where user_id = #{userId} and product_id = #{productId} and is_valid = 1";
+    }
+    
+}

+ 29 - 0
mall-service/src/main/java/com/txz/mall/dao/impl/StoreCombinationMapperImpl.java

@@ -0,0 +1,29 @@
+package com.txz.mall.dao.impl;
+
+import dto.StoreProductAddRequest;
+import org.apache.ibatis.jdbc.SQL;
+
+/**
+ * @author: MTD®️
+ * @date: 2025/8/25
+ */
+
+public class StoreCombinationMapperImpl {
+    
+    public String updateCombinationByProductId(StoreProductAddRequest request) {
+        return new SQL() {{
+            UPDATE("m_store_combination")
+                    .SET("product_name=#{storeName}")
+                    .SET("image=#{image}")
+                    .SET("images=#{sliderImage}")
+                    .SET("info=#{storeInfo}")
+                    .WHERE("product_id = #{id}")
+            ;
+        }}.toString();
+    }
+    
+    public String getIdByProductId(Long productId) {
+        return "select id from m_store_combination where product_id = #{productId} and is_delete = 0 and start_time <= now() and stop_time >= now() and is_show = 1 order by start_time limit 1 ";
+    }
+    
+}

+ 20 - 0
mall-service/src/main/java/com/txz/mall/dao/impl/StorePinkMapperImpl.java

@@ -0,0 +1,20 @@
+package com.txz.mall.dao.impl;
+
+import cn.hutool.core.util.ObjectUtil;
+
+/**
+ * @author: MTD®️
+ * @date: 2025/8/27
+ */
+
+public class StorePinkMapperImpl {
+    
+    public String pinkByProductId(Long productId) {
+        if (ObjectUtil.isNotEmpty(productId)) {
+            return "SELECT uid, k_id FROM m_store_pink WHERE pid = #{productId} GROUP BY uid ORDER BY create_time DESC LIMIT 10";
+        } else {
+            return "SELECT uid, k_id FROM m_store_pink GROUP BY uid ORDER BY create_time DESC LIMIT 10";
+        }
+        
+    }
+}

+ 5 - 2
mall-service/src/main/java/com/txz/mall/dubbo/client/CifUserDubboServiceClient.java

@@ -3,11 +3,10 @@ package com.txz.mall.dubbo.client;
 import com.txz.cif.dto.UserDTO;
 import com.txz.cif.service.UserDubboService;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.dubbo.config.annotation.DubboReference;
 import org.apache.dubbo.config.annotation.Reference;
 import org.springframework.stereotype.Component;
 
-import java.io.Serializable;
+import java.util.List;
 
 @Slf4j
 @Component
@@ -26,4 +25,8 @@ public class CifUserDubboServiceClient {
     public UserDTO getUser(Long userId) {
         return userDubboService.getUser(userId);
     }
+    
+    public List<UserDTO> getUsersByIds(List<Long> userIds){
+        return userDubboService.getUsersByIds(userIds);
+    }
 }

+ 102 - 0
mall-service/src/main/java/com/txz/mall/enums/NoticeEnum.java

@@ -0,0 +1,102 @@
+package com.txz.mall.enums;
+
+import com.baomidou.mybatisplus.annotation.EnumValue;
+import com.fasterxml.jackson.annotation.JsonValue;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author: MTD®️
+ * @date: 2025/8/26
+ */
+@AllArgsConstructor
+public enum NoticeEnum {
+    
+    /**
+     * 订单通知_拼团支付成功
+     */
+    ORDER_GROUP_BUY_PAYMENT_SUCCESS("ORDER_GROUP_BUY_PAYMENT_SUCCESS", "订单通知_拼团支付成功"),
+    
+    /**
+     * 订单通知_订单拼团成功&抽中
+     */
+    ORDER_GROUP_BUY_SUCCESS_WIN("ORDER_GROUP_BUY_SUCCESS_WIN", "订单通知_订单拼团成功&抽中"),
+    
+    /**
+     * 订单通知_订单拼团成功&未抽中
+     */
+    ORDER_GROUP_BUY_SUCCESS_LOSE("ORDER_GROUP_BUY_SUCCESS_LOSE", "订单通知_订单拼团成功&未抽中"),
+    
+    /**
+     * 订单通知_订单补充收货地址
+     */
+    ORDER_PROVIDE_SHIPPING_ADDRESS("ORDER_PROVIDE_SHIPPING_ADDRESS", "订单通知_订单补充收货地址"),
+    
+    /**
+     * 订单通知_订单拼团失败
+     */
+    ORDER_GROUP_BUY_FAIL("ORDER_GROUP_BUY_FAIL", "订单通知_订单拼团失败"),
+    
+    /**
+     * 订单通知_订单发货
+     */
+    ORDER_SHIPPED_SUCCESS("ORDER_SHIPPED_SUCCESS", "订单通知_订单发货"),
+    
+    /**
+     * 收益通知_邀请好友奖励
+     */
+    REWARD_REFER_FRIENDS("REWARD_REFER_FRIENDS", "收益通知_邀请好友奖励"),
+    
+    /**
+     * 收益通知_拼团/开团奖励
+     */
+    REWARD_GROUP_BUY("REWARD_GROUP_BUY", "收益通知_拼团/开团奖励"),
+    
+    /**
+     * 收益通知_邀请好友奖励
+     */
+    REWARD_DIRECT_REFERRAL("REWARD_DIRECT_REFERRAL", "收益通知_邀请好友奖励"),
+    
+    /**
+     * 收益通知_签到奖励
+     */
+    REWARD_CHECKIN("REWARD_CHECKIN", "收益通知_签到奖励"),
+    
+    /**
+     * 充值/提现通知_充值成功
+     */
+    MONEY_RECHARGE_SUCCESS("MONEY_RECHARGE_SUCCESS", "充值/提现通知_充值成功"),
+    
+    /**
+     * 充值/提现通知_提现成功-收益
+     */
+    MONEY_WITHDRAWAL_ACCOUNT_SUCCESS("MONEY_WITHDRAWAL_ACCOUNT_SUCCESS", "充值/提现通知_提现成功-收益"),
+    
+    /**
+     * 充值/提现通知_提现成功-钱包
+     */
+    MONEY_WITHDRAWAL_WALLET_SUCCESS("MONEY_WITHDRAWAL_WALLET_SUCCESS", "充值/提现通知_提现成功-钱包"),
+    
+    /**
+     * 充值/提现通知_提现失败
+     */
+    MONEY_WITHDRAWAL_FAIL("MONEY_WITHDRAWAL_FAIL", "充值/提现通知_提现失败"),
+    
+    /**
+     * 其他
+     */
+    OTHER("OTHER", "其他"),
+    
+    ;
+    
+    @JsonValue
+    @EnumValue
+    @Getter
+    @Setter
+    private String data;
+    
+    @Getter
+    @Setter
+    private String description;
+}

+ 45 - 0
mall-service/src/main/java/com/txz/mall/enums/NoticeGroupEnum.java

@@ -0,0 +1,45 @@
+package com.txz.mall.enums;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author: MTD®️
+ * @date: 2025/8/26
+ */
+@AllArgsConstructor
+public enum NoticeGroupEnum {
+    
+    /**
+     * 订单通知
+     */
+    ORDER("ORDER", "订单通知"),
+    
+    /**
+     * 收益通知
+     */
+    REWARD("REWARD", "收益通知"),
+    
+    /**
+     * 充值/提现通知
+     */
+    MONEY("MONEY", "充值/提现通知"),
+    
+    /**
+     * 其他
+     */
+    OTHER("OTHER", "其他"),
+    
+    ;
+    
+    @JsonValue
+    @Getter
+    @Setter
+    private String data;
+    
+    @Getter
+    @Setter
+    private String description;
+}

+ 12 - 0
mall-service/src/main/java/com/txz/mall/enums/PinkOrderStatusEnum.java

@@ -41,6 +41,18 @@ public enum PinkOrderStatusEnum {
         }
         return null;
     }
+    
+    public static PinkOrderStatusEnum getEnum(String value) {
+        if (value == null) {
+            return null;
+        }
+        for (PinkOrderStatusEnum temp : values()) {
+            if (Objects.equals(temp.value, value)) {
+                return temp;
+            }
+        }
+        return null;
+    }
 
     public Integer getKey() {
         return key;

+ 80 - 0
mall-service/src/main/java/com/txz/mall/model/Notice.java

@@ -0,0 +1,80 @@
+package com.txz.mall.model;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.txz.mall.enums.NoticeEnum;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Date;
+
+/**
+ * @author: MTD®️
+ * @date: 2025/8/26
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@TableName("m_notice")
+public class Notice extends Model<Notice> {
+    
+    /**
+     * null
+     */
+    @TableId(type = IdType.AUTO)
+    private Long id;
+    
+    /**
+     * 用户id
+     */
+    private Long uid;
+    
+    /**
+     * 通知类型
+     */
+    private NoticeEnum noticeType;
+    
+    /**
+     * 其他类型通知模板id
+     */
+    private Long otherId;
+    
+    /**
+     * 通知标题
+     */
+    private String noticeTitle;
+    
+    /**
+     * 通知内容 模板类型是订单号,其他类型完整展示内容
+     */
+    private String noticeMessage;
+    
+    /**
+     * 页面跳转路径
+     */
+    private String pages;
+    
+    /**
+     * 已读标识
+     */
+    private Boolean readFlag;
+    
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+    
+    /**
+     * 用户删除标识
+     */
+    private Boolean userDel;
+    
+}

+ 57 - 0
mall-service/src/main/java/com/txz/mall/model/OtherNotice.java

@@ -0,0 +1,57 @@
+package com.txz.mall.model;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * @author: MTD®️
+ * @date: 2025/8/26
+ */
+
+@Data
+@TableName("m_other_notice")
+@EqualsAndHashCode(callSuper = true)
+public class OtherNotice extends Model<OtherNotice> {
+    
+    /**
+     * null
+     */
+    @TableId(type = IdType.AUTO)
+    private Long id;
+    
+    /**
+     * 标题
+     */
+    private String title;
+    
+    /**
+     * 内容
+     */
+    private String message;
+    
+    /**
+     * 页面跳转路径
+     */
+    private String pages;
+    
+    /**
+     * null
+     */
+    private Integer isDelete;
+    
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+}

+ 40 - 0
mall-service/src/main/java/com/txz/mall/service/NoticeService.java

@@ -0,0 +1,40 @@
+package com.txz.mall.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.txz.mall.enums.NoticeEnum;
+import com.txz.mall.model.Notice;
+import dto.NoticeDTO;
+
+/**
+ * @author: MTD®️
+ * @date: 2025/8/26
+ */
+
+public interface NoticeService extends IService<Notice> {
+    
+    /**
+     * 添加通知消息
+     */
+    void addNotice(NoticeDTO notice, Long... uids);
+    
+    /**
+     * 添加自定义消息
+     */
+    void addOtherNotice(Long otherId, String noticeTitle, String noticeMessage, String pages, Long... uids);
+    
+    /**
+     * 添加订单通知
+     */
+    void addOrderNotice(NoticeEnum noticeType, String noticeMessage, Long... uids);
+    
+    /**
+     * 添加收益通知
+     */
+    void addRewardNotice(NoticeEnum noticeType, Long... uids);
+    
+    /**
+     * 添加充值/提现通知
+     */
+    void addMoneyNotice(NoticeEnum noticeType, Long... uids);
+    
+}

+ 12 - 0
mall-service/src/main/java/com/txz/mall/service/OtherNoticeService.java

@@ -0,0 +1,12 @@
+package com.txz.mall.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.txz.mall.model.OtherNotice;
+
+/**
+ * @author: MTD®️
+ * @date: 2025/8/26
+ */
+
+public interface OtherNoticeService extends IService<OtherNotice> {
+}

+ 4 - 3
mall-service/src/main/java/com/txz/mall/service/StoreOrderService.java

@@ -1,5 +1,6 @@
 package com.txz.mall.service;
 
+import com.github.pagehelper.PageInfo;
 import com.txz.mall.core.Service;
 import com.txz.mall.model.StoreOrder;
 import dto.*;
@@ -75,7 +76,7 @@ public interface StoreOrderService extends Service<StoreOrder> {
      *
      * @return 订单列表
      */
-    List<StoreOrderVO> orderList(StoreOrderDTO dto);
+    PageInfo<StoreOrderVO> orderList(StoreOrderDTO dto);
 
     /**
      * 获取订单列表
@@ -143,12 +144,12 @@ public interface StoreOrderService extends Service<StoreOrder> {
     /**
      * 导出发货单
      */
-    void exportDelivery(HttpServletResponse response);
+    // void exportDelivery(HttpServletResponse response);
 
     /**
      * 导入发货单
      */
-    void importDelivery(MultipartFile file);
+    void importDelivery(MultipartFile file, HttpServletResponse response);
 
     /**
      * 订单状态机

+ 3 - 0
mall-service/src/main/java/com/txz/mall/service/StorePinkService.java

@@ -3,6 +3,7 @@ package com.txz.mall.service;
 import com.txz.mall.core.Service;
 import com.txz.mall.model.StoreOrder;
 import com.txz.mall.model.StorePink;
+import com.txz.mall.web.vo.ProductCarouselVO;
 import vo.StorePinkOngoingVO;
 
 import java.util.Date;
@@ -40,4 +41,6 @@ public interface StorePinkService extends Service<StorePink> {
      * 已存在拼团列表
      */
     List<StorePinkOngoingVO> ongoingList(StorePink storePink);
+    
+    List<ProductCarouselVO> carousel(Long productId);
 }

+ 82 - 0
mall-service/src/main/java/com/txz/mall/service/impl/NoticeServiceImpl.java

@@ -0,0 +1,82 @@
+package com.txz.mall.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.collection.CollectionUtil;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.txz.mall.dao.NoticeMapper;
+import com.txz.mall.enums.NoticeEnum;
+import com.txz.mall.model.Notice;
+import com.txz.mall.service.NoticeService;
+import dto.NoticeDTO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author: MTD®️
+ * @date: 2025/8/26
+ */
+@Slf4j
+@Service
+public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> implements NoticeService {
+    
+    @Override
+    public void addNotice(NoticeDTO notice, Long... uids) {
+        if (CollectionUtil.isEmpty(Arrays.asList(uids))) {
+            return;
+        }
+        List<Notice> saveBatch = new ArrayList<>();
+        Notice info = BeanUtil.copyProperties(notice, Notice.class);
+        Arrays.stream(uids).forEach(uid -> {
+            info.setUid(uid);
+            info.setReadFlag(Boolean.FALSE);
+            info.setUserDel(Boolean.FALSE);
+            saveBatch.add(info);
+        });
+        this.saveBatch(saveBatch);
+    }
+    
+    @Override
+    public void addOtherNotice(Long otherId, String noticeTitle, String noticeMessage, String pages, Long... uids) {
+        this.addNotice(NoticeDTO.builder()
+                        .noticeType(NoticeEnum.OTHER)
+                        .otherId(otherId)
+                        .noticeTitle(noticeTitle)
+                        .noticeMessage(noticeMessage)
+                        .pages(pages)
+                        .build()
+                , uids
+        );
+    }
+    
+    @Override
+    public void addOrderNotice(NoticeEnum noticeType, String noticeMessage, Long... uids) {
+        this.addNotice(NoticeDTO.builder()
+                        .noticeType(noticeType)
+                        .noticeMessage(noticeMessage)
+                        .build()
+                , uids
+        );
+    }
+    
+    @Override
+    public void addRewardNotice(NoticeEnum noticeType, Long... uids) {
+        this.addNotice(NoticeDTO.builder()
+                        .noticeType(noticeType)
+                        .build()
+                , uids
+        );
+    }
+    
+    @Override
+    public void addMoneyNotice(NoticeEnum noticeType, Long... uids) {
+        this.addNotice(NoticeDTO.builder()
+                        .noticeType(noticeType)
+                        .build()
+                , uids
+        );
+    }
+}

+ 19 - 0
mall-service/src/main/java/com/txz/mall/service/impl/OtherNoticeServiceImpl.java

@@ -0,0 +1,19 @@
+package com.txz.mall.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.txz.mall.dao.OtherNoticeMapper;
+import com.txz.mall.model.OtherNotice;
+import com.txz.mall.service.OtherNoticeService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author: MTD®️
+ * @date: 2025/8/26
+ */
+@Slf4j
+@Service
+public class OtherNoticeServiceImpl extends ServiceImpl<OtherNoticeMapper, OtherNotice> implements OtherNoticeService {
+
+
+}

File diff suppressed because it is too large
+ 366 - 354
mall-service/src/main/java/com/txz/mall/service/impl/StoreOrderServiceImpl.java


+ 58 - 11
mall-service/src/main/java/com/txz/mall/service/impl/StorePinkServiceImpl.java

@@ -1,9 +1,11 @@
 package com.txz.mall.service.impl;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
-import com.github.pagehelper.PageHelper;
+import com.txz.cif.dto.UserDTO;
 import com.txz.cif.param.AccomplishParam;
 import com.txz.mall.constants.Constants;
 import com.txz.mall.core.AbstractService;
@@ -11,6 +13,7 @@ import com.txz.mall.core.ServiceException;
 import com.txz.mall.dao.StorePinkMapper;
 import com.txz.mall.dubbo.client.CifAccountDubboServiceClient;
 import com.txz.mall.enums.OrderEventsEnum;
+import com.txz.mall.dubbo.client.CifUserDubboServiceClient;
 import com.txz.mall.enums.PinkOrderStatusEnum;
 import com.txz.mall.enums.StorePinkStatusEnum;
 import com.txz.mall.model.StoreOrder;
@@ -19,10 +22,11 @@ import com.txz.mall.model.StorePinkSummary;
 import com.txz.mall.service.*;
 import com.txz.mall.util.OrderStateMachine;
 import com.txz.mall.util.RandomUtil;
+import com.txz.mall.web.vo.ProductCarouselVO;
+import dto.ProductCarouselDTO;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.ObjectUtils;
 import tk.mybatis.mapper.entity.Condition;
@@ -43,13 +47,11 @@ import java.util.stream.Collectors;
 public class StorePinkServiceImpl extends AbstractService<StorePink> implements StorePinkService {
 
 
-
-
     @Resource
     private StorePinkMapper storePinkMapper;
 
     @Resource
-    private CifAccountDubboServiceClient accountDubboServiceClient;
+    private CifUserDubboServiceClient userDubboServiceClient;
 
     @Override
     public List<StorePink> getListByCidAndKid(Long cid, Long kid) {
@@ -63,7 +65,6 @@ public class StorePinkServiceImpl extends AbstractService<StorePink> implements
     }
 
 
-
     @Resource
     private StorePinkSummaryService storePinkSummaryService;
 
@@ -72,7 +73,7 @@ public class StorePinkServiceImpl extends AbstractService<StorePink> implements
     public void pinkSuccess(Long id, StoreOrder storeOrder) {
 
 
-        //现在这个方法每次支付的时候都会执行一次
+        // 现在这个方法每次支付的时候都会执行一次
         Date date = new Date();
         if (ObjectUtil.isNull(id)) {
             return;
@@ -195,6 +196,7 @@ public class StorePinkServiceImpl extends AbstractService<StorePink> implements
             throw new ServiceException("已有天选");
         }
 
+
         Map<Long, StorePink> idStorePinkMap = list.stream().collect(Collectors.toMap(StorePink::getId, a -> a, (b, c) -> c));
 
         List<Long> idCollect = list.stream().map(StorePink::getId).collect(Collectors.toList());
@@ -266,7 +268,7 @@ public class StorePinkServiceImpl extends AbstractService<StorePink> implements
     @Override
     public List<StorePinkOngoingVO> ongoingList(StorePink storePink) {
 
-       // PageHelper.startPage(1, 3);
+        // PageHelper.startPage(1, 3);
         List<StorePinkOngoingVO> list = new ArrayList<>();
         Condition storePinkSummarycondition = new Condition(StorePinkSummary.class);
         Example.Criteria storePinkSummarycriteria = storePinkSummarycondition.createCriteria();
@@ -277,7 +279,7 @@ public class StorePinkServiceImpl extends AbstractService<StorePink> implements
         List<StorePinkSummary> byCondition = storePinkSummaryService.findByCondition(storePinkSummarycondition);
 
 
-        if(!CollectionUtils.isEmpty(byCondition)){
+        if (!CollectionUtils.isEmpty(byCondition)) {
 
             Map<Long, StorePinkSummary> storePinkSummaryMap = byCondition.stream().collect(Collectors.toMap(StorePinkSummary::getId, a -> a, (b, c) -> c));
 
@@ -287,12 +289,12 @@ public class StorePinkServiceImpl extends AbstractService<StorePink> implements
             Example.Criteria criteria = condition.createCriteria();
             criteria.andEqualTo("isDelete", 0);
             criteria.andEqualTo("cid", storePink.getCid());
-          //  criteria.andEqualTo("kid", 0);
+            //  criteria.andEqualTo("kid", 0);
             criteria.andIn("spsId", spsIdList);
             List<StorePink> pinkList = findByCondition(condition);
 
             Map<Long, List<StorePink>> collect = pinkList.stream().collect(Collectors.groupingBy(StorePink::getSpsId));
-            list = pinkList.stream().filter(a->a.getKId().equals(0)).map(a -> {
+            list = pinkList.stream().filter(a -> a.getKId().equals(0)).map(a -> {
                 List<StorePink> storePinks = collect.get(a.getSpsId());
 
                 StorePinkOngoingVO pinkOngoingVO = new StorePinkOngoingVO();
@@ -313,4 +315,49 @@ public class StorePinkServiceImpl extends AbstractService<StorePink> implements
         return list;
     }
 
+    @Override
+    public List<ProductCarouselVO> carousel(Long productId) {
+        List<ProductCarouselDTO> pinks = storePinkMapper.pinkByProductId(productId);
+        // 兜底
+        if (CollectionUtil.isEmpty(pinks)) {
+            pinks = storePinkMapper.pinkByProductId(null);
+        }
+        // 还是空那也没办法了
+        if (CollectionUtil.isEmpty(pinks)) {
+            return new ArrayList<>();
+        }
+        List<UserDTO> users = userDubboServiceClient.getUsersByIds(pinks.stream().map(ProductCarouselDTO::getUid).collect(Collectors.toList()));
+        // 无用户信息
+        if (CollectionUtil.isEmpty(users)) {
+            return new ArrayList<>();
+        }
+        Map<Long, UserDTO> userMap = users.stream().collect(Collectors.toMap(UserDTO::getId, user -> user));
+
+        List<ProductCarouselVO> carousel = new ArrayList<>();
+        pinks.forEach(item -> {
+            UserDTO user = userMap.get(item.getUid());
+            if (user != null) {
+                String name = user.getName();
+                switch (name.length()) {
+                    case 1:
+                        break;
+                    case 2:
+                        name = StrUtil.hide(name, 1, name.length());
+                        break;
+                    default:
+                        name = StrUtil.hide(name, 1, name.length() - 1);
+                        break;
+                }
+                carousel.add(ProductCarouselVO.builder()
+                        .headPic(user.getHeadPic())
+                        .name(name)
+                        .kId(item.getKId())
+                        .time(cn.hutool.core.util.RandomUtil.randomInt(1, 51))
+                        .build()
+                );
+            }
+        });
+        return carousel;
+    }
+
 }

+ 52 - 25
mall-service/src/main/java/com/txz/mall/service/impl/StoreProductServiceImpl.java

@@ -13,8 +13,10 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.txz.mall.constants.Constants;
 import com.txz.mall.core.AbstractService;
+import com.txz.mall.core.AuthService;
 import com.txz.mall.core.ServiceException;
-import com.txz.mall.dao.StoreProductMapper;
+import com.txz.mall.dao.MidFavoriteMapper;
+import com.txz.mall.dao.StoreCombinationMapper;
 import com.txz.mall.model.ProductAttr;
 import com.txz.mall.model.ProductAttrValue;
 import com.txz.mall.model.StoreOrder;
@@ -23,6 +25,7 @@ import com.txz.mall.service.ProductAttrService;
 import com.txz.mall.service.ProductAttrValueService;
 import com.txz.mall.service.StoreProductService;
 import com.txz.mall.util.EasyExcelUtil;
+import dto.FavoriteDTO;
 import dto.StoreProductAddRequest;
 import dto.StoreProductAttrAddRequest;
 import dto.StoreProductAttrValueAddRequest;
@@ -60,9 +63,16 @@ public class StoreProductServiceImpl extends AbstractService<StoreProduct> imple
     private StoreProductMapper storeProductMapper;
     @Resource
     private ProductAttrService attrService;
+
     @Resource
     private ProductAttrValueService attrValueService;
 
+    @Resource
+    private StoreCombinationMapper combinationMapper;
+
+    @Resource
+    private MidFavoriteMapper midFavoriteMapper;
+
     @Override
     public void importFile(MultipartFile file) {
         String name = file.getOriginalFilename();
@@ -134,17 +144,30 @@ public class StoreProductServiceImpl extends AbstractService<StoreProduct> imple
         }).collect(Collectors.toList());
         storeProductResponse.setAttrValue(valueResponseList);
 
-//        StoreProductDescription sd = storeProductDescriptionService.getByProductIdAndType(storeProduct.getId(), Constants.PRODUCT_TYPE_NORMAL);
-//        if (ObjectUtil.isNotNull(sd)) {
-//            storeProductResponse.setContent(ObjectUtil.isNull(sd.getDescription()) ? "" : sd.getDescription());
-//        }
-//
-//        // 获取已关联的优惠券
-//        List<StoreProductCoupon> storeProductCoupons = storeProductCouponService.getListByProductId(storeProduct.getId());
-//        if (CollUtil.isNotEmpty(storeProductCoupons)) {
-//            List<Integer> ids = storeProductCoupons.stream().map(StoreProductCoupon::getIssueCouponId).collect(Collectors.toList());
-//            storeProductResponse.setCouponIds(ids);
-//        }
+        //        StoreProductDescription sd = storeProductDescriptionService.getByProductIdAndType(storeProduct.getId(), Constants.PRODUCT_TYPE_NORMAL);
+        //        if (ObjectUtil.isNotNull(sd)) {
+        //            storeProductResponse.setContent(ObjectUtil.isNull(sd.getDescription()) ? "" : sd.getDescription());
+        //        }
+        //
+        //        // 获取已关联的优惠券
+        //        List<StoreProductCoupon> storeProductCoupons = storeProductCouponService.getListByProductId(storeProduct.getId());
+        //        if (CollUtil.isNotEmpty(storeProductCoupons)) {
+        //            List<Integer> ids = storeProductCoupons.stream().map(StoreProductCoupon::getIssueCouponId).collect(Collectors.toList());
+        //            storeProductResponse.setCouponIds(ids);
+        //        }
+        Long cid = combinationMapper.getIdByProductId(storeProduct.getId());
+        storeProductResponse.setCid(cid);
+
+        try {
+            Long tokenUserId = AuthService.getTokenUserId(null);
+            int favoriteFlag = midFavoriteMapper.getFavoriteFlag(FavoriteDTO.builder().productId(storeProduct.getId()).userId(tokenUserId).build());
+            storeProductResponse.setFavoriteFlag(
+                    (favoriteFlag == 0) ? (Boolean.FALSE) : (Boolean.TRUE)
+            );
+        } catch (Exception e) {
+
+        }
+
         return storeProductResponse;
     }
 
@@ -152,6 +175,7 @@ public class StoreProductServiceImpl extends AbstractService<StoreProduct> imple
      * 商品活动字符列表
      *
      * @param activityStr 商品活动字符串
+     *
      * @return 商品活动字符列表
      */
     private List<String> getProductActivityList(String activityStr) {
@@ -224,9 +248,9 @@ public class StoreProductServiceImpl extends AbstractService<StoreProduct> imple
         BeanUtils.copyProperties(request, storeProduct);
         // 设置activity活动
         storeProduct.setActivity(getProductActivityStr(request.getActivity()));
-        //主图
+        // 主图
         storeProduct.setImage(storeProduct.getImage());
-        //轮播图
+        // 轮播图
         storeProduct.setSliderImage(storeProduct.getSliderImage());
         // 展示图
         if (StrUtil.isNotEmpty(storeProduct.getFlatPattern())) {
@@ -234,7 +258,7 @@ public class StoreProductServiceImpl extends AbstractService<StoreProduct> imple
         }
 
         List<StoreProductAttrValueAddRequest> attrValueAddRequestList = request.getAttrValue();
-        //计算价格
+        // 计算价格
         StoreProductAttrValueAddRequest minAttrValue = attrValueAddRequestList.stream().min(Comparator.comparing(StoreProductAttrValueAddRequest::getPrice)).get();
         storeProduct.setPrice(minAttrValue.getPrice());
         storeProduct.setOtPrice(minAttrValue.getOtPrice());
@@ -309,21 +333,22 @@ public class StoreProductServiceImpl extends AbstractService<StoreProduct> imple
         attrService.save(attrList);
         attrValueService.save(attrValueList);
 
-        //优惠券
-//            if (CollUtil.isNotEmpty(request.getCouponIds())) {
-//                List<StoreProductCoupon> couponList = new ArrayList<>();
-//                for (Integer couponId : request.getCouponIds()) {
-//                    StoreProductCoupon spc = new StoreProductCoupon(storeProduct.getId(), couponId, DateUtil.getNowTime());
-//                    couponList.add(spc);
-//                }
-//                storeProductCouponService.saveBatch(couponList);
-//            }
+        // 优惠券
+        //            if (CollUtil.isNotEmpty(request.getCouponIds())) {
+        //                List<StoreProductCoupon> couponList = new ArrayList<>();
+        //                for (Integer couponId : request.getCouponIds()) {
+        //                    StoreProductCoupon spc = new StoreProductCoupon(storeProduct.getId(), couponId, DateUtil.getNowTime());
+        //                    couponList.add(spc);
+        //                }
+        //                storeProductCouponService.saveBatch(couponList);
+        //            }
     }
 
     @Override
     @Transactional
     public void update(StoreProductAddRequest request) {
         assignAttributes(request, 1);
+        combinationMapper.updateCombinationByProductId(request);
     }
 
     @Override
@@ -390,6 +415,7 @@ public class StoreProductServiceImpl extends AbstractService<StoreProduct> imple
      * 商品sku
      *
      * @param attrValue json字符串
+     *
      * @return sku
      */
     private String getSku(String attrValue) {
@@ -400,7 +426,7 @@ public class StoreProductServiceImpl extends AbstractService<StoreProduct> imple
             Map.Entry<String, String> next = iterator.next();
             strings.add(next.getValue());
         }
-//        List<String> strings = jsonObject.values().stream().map(o -> (String) o).collect(Collectors.toList());
+        //        List<String> strings = jsonObject.values().stream().map(o -> (String) o).collect(Collectors.toList());
         return String.join(",", strings);
     }
 
@@ -408,6 +434,7 @@ public class StoreProductServiceImpl extends AbstractService<StoreProduct> imple
      * 商品活动字符串
      *
      * @param activityList 活动数组
+     *
      * @return 商品活动字符串
      */
     private String getProductActivityStr(List<String> activityList) {

+ 38 - 0
mall-service/src/main/java/com/txz/mall/util/excel/converter/OrderStatucConverter.java

@@ -0,0 +1,38 @@
+package com.txz.mall.util.excel.converter;
+
+import com.alibaba.excel.converters.Converter;
+import com.alibaba.excel.converters.ReadConverterContext;
+import com.alibaba.excel.enums.CellDataTypeEnum;
+import com.alibaba.excel.metadata.GlobalConfiguration;
+import com.alibaba.excel.metadata.data.WriteCellData;
+import com.alibaba.excel.metadata.property.ExcelContentProperty;
+import com.txz.mall.enums.PinkOrderStatusEnum;
+
+/**
+ * @author: MTD®️
+ * @date: 2025/8/25
+ */
+
+public class OrderStatucConverter implements Converter<Integer> {
+    
+    @Override
+    public Class<?> supportJavaTypeKey() {
+        return Converter.super.supportJavaTypeKey();
+    }
+    
+    @Override
+    public CellDataTypeEnum supportExcelTypeKey() {
+        return Converter.super.supportExcelTypeKey();
+    }
+    
+    @Override
+    public Integer convertToJavaData(ReadConverterContext<?> context) throws Exception {
+        return PinkOrderStatusEnum.getEnum(context.getReadCellData().getStringValue()).getKey();
+    }
+    
+    
+    @Override
+    public WriteCellData<String> convertToExcelData(Integer integer, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
+        return new WriteCellData<>(PinkOrderStatusEnum.getEnum(integer).getValue());
+    }
+}

+ 37 - 0
mall-service/src/main/java/com/txz/mall/web/ro/OtherNoticeRO.java

@@ -0,0 +1,37 @@
+package com.txz.mall.web.ro;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * @author: MTD®️
+ * @date: 2025/8/26
+ */
+@Data
+public class OtherNoticeRO {
+    
+    /**
+     * 标题
+     */
+    @NotBlank(message = "标题不能为空", groups = {Add.class, Update.class})
+    private String title;
+    
+    /**
+     * 内容
+     */
+    @NotBlank(message = "内容不能为空", groups = {Add.class, Update.class})
+    private String message;
+    
+    /**
+     * 页面路径
+     */
+    private String pages;
+    
+    public interface Add {
+    }
+    
+    public interface Update {
+    }
+    
+}

+ 33 - 0
mall-service/src/main/java/com/txz/mall/web/ro/SendNoticeRO.java

@@ -0,0 +1,33 @@
+package com.txz.mall.web.ro;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import java.util.List;
+
+/**
+ * @author: MTD®️
+ * @date: 2025/8/26
+ */
+@Data
+public class SendNoticeRO {
+    
+    /**
+     * 消息模板id
+     */
+    @NotNull(message = "消息模板id不能为空", groups = {Send.class})
+    private Long id;
+    
+    /**
+     * 用户id
+     */
+    @NotNull(message = "用户id不能为空", groups = {Send.class})
+    @Size(min = 1, message = "用户id不能为空", groups = {Send.class})
+    private List<Long> uids;
+    
+    public interface Send {
+    }
+    
+    
+}

+ 34 - 0
mall-service/src/main/java/com/txz/mall/web/vo/ProductCarouselVO.java

@@ -0,0 +1,34 @@
+package com.txz.mall.web.vo;
+
+import lombok.Builder;
+import lombok.Data;
+
+/**
+ * @author: MTD®️
+ * @date: 2025/8/27
+ */
+@Data
+@Builder
+public class ProductCarouselVO {
+    
+    /**
+     * 头像
+     */
+    private String headPic;
+    
+    /**
+     * 昵称
+     */
+    private String name;
+    
+    /**
+     * 时间
+     */
+    private Integer time;
+    
+    /**
+     * 0为团长
+     */
+    private Integer kId;
+    
+}

+ 17 - 0
mall-service/src/main/java/dto/FavoriteDTO.java

@@ -0,0 +1,17 @@
+package dto;
+
+import lombok.Builder;
+import lombok.Data;
+
+/**
+ * @author: MTD®️
+ * @date: 2025/8/27
+ */
+@Data
+@Builder
+public class FavoriteDTO {
+    
+    private Long productId;
+    
+    private Long userId;
+}

+ 43 - 0
mall-service/src/main/java/dto/NoticeDTO.java

@@ -0,0 +1,43 @@
+package dto;
+
+import com.txz.mall.enums.NoticeEnum;
+import lombok.Builder;
+import lombok.Data;
+
+/**
+ * @author: MTD®️
+ * @date: 2025/8/26
+ */
+@Data
+@Builder
+public class NoticeDTO {
+    
+    /**
+     * 通知类型
+     */
+    private NoticeEnum noticeType;
+    
+    /**
+     * 其他类型通知模板id
+     */
+    private Long otherId;
+    
+    /**
+     * 通知内容
+     * 订单相关的传订单号
+     * 自定义传 自定义字符串
+     */
+    private String noticeTitle;
+    
+    /**
+     * 通知内容
+     * 订单相关的传订单号
+     * 自定义传 自定义字符串
+     */
+    private String noticeMessage;
+    
+    /**
+     * 页面跳转路径
+     */
+    private String pages;
+}

+ 23 - 0
mall-service/src/main/java/dto/ProductCarouselDTO.java

@@ -0,0 +1,23 @@
+package dto;
+
+import lombok.Data;
+
+/**
+ * @author: MTD®️
+ * @date: 2025/8/27
+ */
+
+@Data
+public class ProductCarouselDTO {
+    
+    /**
+     * 用户id
+     */
+    private Long uid;
+    
+    /**
+     * 0为团长
+     */
+    private Integer kId;
+    
+}

+ 27 - 19
mall-service/src/main/java/po/StoreOrderExportPO.java

@@ -6,6 +6,8 @@
  */
 package po;
 
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.txz.mall.util.excel.converter.OrderStatucConverter;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -15,59 +17,65 @@ import java.util.Date;
 
 @Data
 public class StoreOrderExportPO implements Serializable {
-
+    
     @ApiModelProperty(value = "id")
     private Long id;
-
+    
     @ApiModelProperty(value = "订单号")
     private String orderId;
-
+    
     @ApiModelProperty(value = "用户id")
     private Long uid;
-
+    
     @ApiModelProperty(value = "用户注册手机号")
     private String userPhone;
-
+    
     @ApiModelProperty(value = "订单状态")
+    @ExcelProperty(converter = OrderStatucConverter.class)
     private Integer status;
-
+    
     @ApiModelProperty(value = "订单金额")
     private BigDecimal payPrice;
-
+    
     @ApiModelProperty(value = "下单时间")
     private Date createTime;
-
+    
     @ApiModelProperty(value = "支付时间")
     private Date payTime;
-
+    
     @ApiModelProperty(value = "商品ID")
     private Long productId;
-
+    
     @ApiModelProperty(value = "商品名称")
     private String productName;
-
+    
     @ApiModelProperty(value = "商品规格")
     private String productAttr;
-
+    
     @ApiModelProperty(value = "购买数量")
     private Integer payNum;
-
+    
     @ApiModelProperty(value = "收件人姓名")
     private String realName;
-
+    
     @ApiModelProperty(value = "收件人电话")
     private String phone;
-
+    
     @ApiModelProperty(value = "收件人地址")
     private String userAddress;
-
+    
     @ApiModelProperty(value = "邮编")
     private String postCode;
-
+    
     @ApiModelProperty(value = "快递公司")
     private String deliveryName;
-
+    
     @ApiModelProperty(value = "快递单号")
     private String deliveryId;
-
+    
+    /**
+     * 失败原因
+     */
+    private String errorMsg;
+    
 }

+ 62 - 52
mall-service/src/main/java/vo/StoreProductInfoVO.java

@@ -16,158 +16,168 @@ import java.util.List;
 @Accessors(chain = true)
 @ApiModel(value = "StoreProductInfoResponse对象", description = "商品详情响应对象")
 public class StoreProductInfoVO implements Serializable {
-
+    
     private static final long serialVersionUID = 9215241889318610262L;
-
+    
     @ApiModelProperty(value = "商品id")
     private Long id;
-
+    
     @ApiModelProperty(value = "商品图片")
     private String image;
-
+    
     @ApiModelProperty(value = "轮播图")
     private String sliderImage;
-
+    
     @ApiModelProperty(value = "商品名称")
     private String storeName;
-
+    
     @ApiModelProperty(value = "商品简介")
     private String storeInfo;
-
+    
     @ApiModelProperty(value = "关键字")
     private String keyword;
-
+    
     @ApiModelProperty(value = "分类id")
     private String cateId;
-
+    
     @ApiModelProperty(value = "分类中文")
     private String cateStr;
-
+    
     @ApiModelProperty(value = "单位名")
     private String unitName;
-
+    
     @ApiModelProperty(value = "排序")
     private Integer sort;
-
+    
     @ApiModelProperty(value = "是否热卖")
     private Integer isHot;
-
+    
     @ApiModelProperty(value = "是否优惠")
     private Integer isBenefit;
-
+    
     @ApiModelProperty(value = "是否精品")
     private Integer isBest;
-
+    
     @ApiModelProperty(value = "是否新品")
     private Integer isNew;
-
+    
     @ApiModelProperty(value = "获得积分")
     private Integer giveIntegral;
-
+    
     @ApiModelProperty(value = "是否优品推荐")
     private Integer isGood;
-
+    
     @ApiModelProperty(value = "是否单独分佣")
     private Integer isSub;
-
+    
     @ApiModelProperty(value = "虚拟销量")
     private Integer ficti;
-
+    
     @ApiModelProperty(value = "运费模板ID")
     private Integer tempId;
-
+    
     @ApiModelProperty(value = "规格 0单 1多")
     private Integer specType;
-
+    
     @ApiModelProperty(value = "活动显示排序 0=默认,1=秒杀,2=砍价,3=拼团")
     private List<String> activity;
-
+    
     @ApiModelProperty(value = "商品属性")
     private List<AttrVO> attr;
-
+    
     @ApiModelProperty(value = "商品属性详情")
     private List<AttrValueVO> attrValue;
-
+    
     @ApiModelProperty(value = "商品描述")
     private String content;
-
+    
     @ApiModelProperty(value = "产品ID")
     private Integer productId;
-
+    
     @ApiModelProperty(value = "优惠券Ids")
     private List<Integer> couponIds;
-
+    
     // 以下为活动商品部分
-
+    
     @ApiModelProperty(value = "状态 0=关闭 1=开启|营销商品用")
     private Integer status;
-
+    
     @ApiModelProperty(value = "运费模板ID|秒杀商品专用")
     private Integer timeId;
-
+    
     @ApiModelProperty(value = "秒杀开启时间|秒杀专用")
     private String startTimeStr;
-
+    
     @ApiModelProperty(value = "秒杀结束时间|秒杀专用")
     private String stopTimeStr;
-
+    
     @ApiModelProperty(value = "当天参与秒杀次数|秒杀专用")
     private Integer num;
-
+    
     @ApiModelProperty(value = "砍价开启时间|砍价专用")
     private Long startTime;
-
+    
     @ApiModelProperty(value = "砍价结束时间|砍价专用")
     private Long stopTime;
-
+    
     @ApiModelProperty(value = "砍价活动名称|砍价专用")
     private String title;
-
+    
     @ApiModelProperty(value = "帮砍次数|砍价专用")
     private Integer bargainNum;
-
+    
     @ApiModelProperty(value = "帮助砍价好友人数|砍价专用")
     private Integer peopleNum;
-
+    
     @ApiModelProperty(value = "拼团订单有效时间(小时)|拼团专用")
     private Integer effectiveTime;
-
+    
     @ApiModelProperty(value = "每个订单可购买数量|拼团专用")
     private Integer onceNum;
-
+    
     @ApiModelProperty(value = "虚拟成团百分比|拼团专用")
     private Integer virtualRation;
-
+    
     @ApiModelProperty(value = "参团人数|拼团专用")
     private Integer people;
-
+    
     @ApiModelProperty(value = "简介|拼团专用")
     private String info;
-
+    
     @ApiModelProperty(value = "展示图")
     private String flatPattern;
-
+    
     @ApiModelProperty("品牌")
     private String itemBrand;
-
+    
     @ApiModelProperty("货号")
     private String itemNumber;
-
+    
     @ApiModelProperty(value = "商品价格")
     private BigDecimal price;
-
+    
     @ApiModelProperty(value = "市场价")
     private BigDecimal otPrice;
-
+    
     @ApiModelProperty(value = "库存")
     private Integer stock;
-
+    
     @ApiModelProperty(value = "状态 (0:未上架,1:上架)")
     private Integer isShow;
-
+    
     @ApiModelProperty("供应商")
     private String itemSupplier;
-
+    
     @ApiModelProperty(value = "销量")
     private Integer sales;
+    
+    /**
+     * 拼团商品id
+     */
+    private Long cid;
+    
+    /**
+     * 收藏标识
+     */
+    private Boolean favoriteFlag = Boolean.FALSE;
 }

+ 1 - 1
mall-service/src/main/resources/bootstrap.properties

@@ -51,7 +51,7 @@ dubbo.scan.base-packages=com.txz.${spring.application.name}.dubbo.impl
 #dubbo.cloud.subscribed-services=cif
 dubbo.application.qos.enable=false
 dubbo.application.qos.port=28201
-dubbo.application.qos.accept.foreign.ip=true
+dubbo.application.qos.accept.foreign.ip=false
 dubbo.registry.group=
 
 dubbo.reference.com.foo.BarService.check=false

Some files were not shown because too many files changed in this diff