Prechádzať zdrojové kódy

Merge branch 'master' of http://8.152.195.41:3000/alien/alien_cloud into zjy

zjy 3 mesiacov pred
rodič
commit
54d96c5c4b
55 zmenil súbory, kde vykonal 1363 pridanie a 261 odobranie
  1. 55 0
      alien-entity/src/main/java/shop/alien/entity/store/ActivityPeriod.java
  2. 63 0
      alien-entity/src/main/java/shop/alien/entity/store/ActivitySignInConfig.java
  3. 59 0
      alien-entity/src/main/java/shop/alien/entity/store/ActivitySignInReward.java
  4. 5 0
      alien-entity/src/main/java/shop/alien/entity/store/LifeBrowseRecord.java
  5. 2 1
      alien-entity/src/main/java/shop/alien/entity/store/LifeGroupBuyCount.java
  6. 28 0
      alien-entity/src/main/java/shop/alien/entity/store/vo/ActivityConfigVo.java
  7. 20 0
      alien-entity/src/main/java/shop/alien/entity/store/vo/ActivityPeriodVo.java
  8. 2 0
      alien-entity/src/main/java/shop/alien/entity/store/vo/LifeNoticeVo.java
  9. 2 0
      alien-entity/src/main/java/shop/alien/entity/store/vo/LifeUserOrderVo.java
  10. 2 0
      alien-entity/src/main/java/shop/alien/entity/store/vo/StoreClockInVo.java
  11. 2 2
      alien-entity/src/main/java/shop/alien/entity/store/vo/StoreInfoVo.java
  12. 1 1
      alien-entity/src/main/java/shop/alien/entity/store/vo/StoreMainInfoVo.java
  13. 15 0
      alien-entity/src/main/java/shop/alien/mapper/ActivityPeriodMapper.java
  14. 13 0
      alien-entity/src/main/java/shop/alien/mapper/ActivitySignInConfigMapper.java
  15. 13 0
      alien-entity/src/main/java/shop/alien/mapper/ActivitySignRewardMapper.java
  16. 18 2
      alien-entity/src/main/java/shop/alien/mapper/LifeBrowseRecordMapper.java
  17. 1 1
      alien-entity/src/main/java/shop/alien/mapper/LifeGroupBuyCountMapper.java
  18. 0 4
      alien-entity/src/main/java/shop/alien/mapper/LifeUserMapper.java
  19. 2 0
      alien-entity/src/main/java/shop/alien/mapper/LifeUserOrderMapper.java
  20. 2 1
      alien-entity/src/main/java/shop/alien/mapper/StoreClockInMapper.java
  21. 1 54
      alien-entity/src/main/resources/mapper/LifeUserMapper.xml
  22. 1 0
      alien-entity/src/main/resources/mapper/PlatformLifeUserMapper.xml
  23. 48 40
      alien-job/src/main/java/shop/alien/job/store/LifeCouponJob.java
  24. 82 0
      alien-job/src/main/java/shop/alien/job/store/LifeGroupBuyCountJob.java
  25. 1 1
      alien-job/src/main/java/shop/alien/job/store/LifeUserOrderJob.java
  26. 8 1
      alien-second/src/main/java/shop/alien/second/service/impl/SecondGoodsReportingServiceImpl.java
  27. 34 0
      alien-second/src/main/java/shop/alien/second/util/JsonUtils.java
  28. 122 0
      alien-store/src/main/java/shop/alien/store/controller/ActivityConfigController.java
  29. 1 1
      alien-store/src/main/java/shop/alien/store/controller/EssentialModuleInformationController.java
  30. 17 16
      alien-store/src/main/java/shop/alien/store/controller/LifeBrowseRecordController.java
  31. 17 10
      alien-store/src/main/java/shop/alien/store/controller/LifeGroupBuyCountController.java
  32. 5 4
      alien-store/src/main/java/shop/alien/store/controller/LifeUserDynamicsController.java
  33. 1 1
      alien-store/src/main/java/shop/alien/store/controller/LifeUserOrderController.java
  34. 32 0
      alien-store/src/main/java/shop/alien/store/controller/PlatformLifeMessageController.java
  35. 2 4
      alien-store/src/main/java/shop/alien/store/controller/PlatformLifeUserController.java
  36. 9 0
      alien-store/src/main/java/shop/alien/store/controller/StoreInfoController.java
  37. 5 2
      alien-store/src/main/java/shop/alien/store/controller/StoreUserController.java
  38. 63 0
      alien-store/src/main/java/shop/alien/store/service/ActivityConfigService.java
  39. 30 9
      alien-store/src/main/java/shop/alien/store/service/LifeBrowseRecordService.java
  40. 6 2
      alien-store/src/main/java/shop/alien/store/service/LifeGroupBuyCountService.java
  41. 13 2
      alien-store/src/main/java/shop/alien/store/service/LifeUserOrderService.java
  42. 30 23
      alien-store/src/main/java/shop/alien/store/service/LifeUserService.java
  43. 11 0
      alien-store/src/main/java/shop/alien/store/service/PlatformLifeMessageService.java
  44. 2 4
      alien-store/src/main/java/shop/alien/store/service/PlatformLifeUserService.java
  45. 6 0
      alien-store/src/main/java/shop/alien/store/service/StoreInfoService.java
  46. 303 0
      alien-store/src/main/java/shop/alien/store/service/impl/ActivityConfigServiceImpl.java
  47. 1 1
      alien-store/src/main/java/shop/alien/store/service/impl/LifeCouponServiceImpl.java
  48. 83 18
      alien-store/src/main/java/shop/alien/store/service/impl/LifeGroupBuyCountServiceImpl.java
  49. 32 0
      alien-store/src/main/java/shop/alien/store/service/impl/LifeNoticeServiceImpl.java
  50. 32 27
      alien-store/src/main/java/shop/alien/store/service/impl/LifeUserViolationServiceImpl.java
  51. 33 0
      alien-store/src/main/java/shop/alien/store/service/impl/PlatformLifeMessageServiceImpl.java
  52. 4 10
      alien-store/src/main/java/shop/alien/store/service/impl/PlatformLifeUserServiceImpl.java
  53. 2 1
      alien-store/src/main/java/shop/alien/store/service/impl/PlatformStoreCouponServiceImpl.java
  54. 16 16
      alien-store/src/main/java/shop/alien/store/service/impl/StoreInfoServiceImpl.java
  55. 5 2
      alien-store/src/main/java/shop/alien/store/service/impl/StoreUserServiceImpl.java

+ 55 - 0
alien-entity/src/main/java/shop/alien/entity/store/ActivityPeriod.java

@@ -0,0 +1,55 @@
+package shop.alien.entity.store;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.util.Date;
+
+@Data
+@JsonInclude
+@TableName("activity_period")
+@ApiModel(value = "ActivityPeriod", description = "活动时间段配置表")
+public class ActivityPeriod {
+    @ApiModelProperty(value = "主键")
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty(value = "活动ID")
+    private Integer activityId;
+
+    @ApiModelProperty(value = "时间段名称")
+    private String periodName;
+
+    @ApiModelProperty(value = "开始时间")
+    private Date startTime;
+
+    @ApiModelProperty(value = "结束时间")
+    private Date endTime;
+
+    @ApiModelProperty(value = "状态:0-未启用,1-启用,2-已结束")
+    private Integer status;
+
+    @ApiModelProperty(value = "创建时间")
+    @TableField(value = "created_time", fill = FieldFill.INSERT)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createdTime;
+
+    @ApiModelProperty(value = "创建人ID")
+    private Integer createdUserId;
+
+    @ApiModelProperty(value = "修改时间")
+    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date updatedTime;
+
+    @ApiModelProperty(value = "修改人ID")
+    private Integer updatedUserId;
+
+    @ApiModelProperty(value = "删除标记, 0:未删除, 1:已删除")
+    @TableField("delete_flag")
+    @TableLogic
+    private Integer deleteFlag;
+}

+ 63 - 0
alien-entity/src/main/java/shop/alien/entity/store/ActivitySignInConfig.java

@@ -0,0 +1,63 @@
+package shop.alien.entity.store;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+@JsonInclude
+@TableName("activity_sign_in_config")
+@ApiModel(value = "ActivitySignInConfig", description = "签到活动配置表")
+public class ActivitySignInConfig {
+    @ApiModelProperty(value = "主键")
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty(value = "活动名称")
+    private String activityName;
+
+    @ApiModelProperty(value = "活动总天数")
+    private Integer totalDays;
+
+    @ApiModelProperty(value = "最大补签次数")
+    private Integer makeupLimit;
+
+    @ApiModelProperty(value = "状态:0-未启用,1-启用,2-已结束")
+    private Integer status;
+
+    @ApiModelProperty(value = "活动规则")
+    private String activityRule;
+
+    @ApiModelProperty(value = "创建时间")
+    @TableField(value = "created_time", fill = FieldFill.INSERT)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createdTime;
+
+    @ApiModelProperty(value = "创建人ID")
+    private Integer createdUserId;
+
+    @ApiModelProperty(value = "修改时间")
+    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date updatedTime;
+
+    @ApiModelProperty(value = "修改人ID")
+    private Integer updatedUserId;
+
+    @ApiModelProperty(value = "删除标记, 0:未删除, 1:已删除")
+    @TableField("delete_flag")
+    @TableLogic
+    private Integer deleteFlag;
+
+    @ApiModelProperty(value = "方案配置类型1,默认方案,2.特殊方案")
+    private Integer planConfigType;
+
+    @ApiModelProperty(value = "返回错误信息")
+    @TableField(exist = false)
+    private String errorMessage;
+}

+ 59 - 0
alien-entity/src/main/java/shop/alien/entity/store/ActivitySignInReward.java

@@ -0,0 +1,59 @@
+package shop.alien.entity.store;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+@JsonInclude
+@TableName("activity_sign_in_reward")
+@ApiModel(value = "ActivitySignInReward", description = "签到奖励配置表")
+public class ActivitySignInReward {
+    @ApiModelProperty(value = "主键")
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty(value = "活动ID")
+    private Integer activityId;
+
+    @ApiModelProperty(value = "连续签到天数(第几天)")
+    private Integer dayOfSequence;
+
+    @ApiModelProperty(value = "积分")
+    private Integer points;
+
+    @ApiModelProperty(value = "奖励类型1,积分,2.其他")
+    private Integer rewardType;
+
+    @ApiModelProperty(value = "签到配置类型1,连续签到,2.基础签到")
+    private Integer signConfigType;
+
+    @ApiModelProperty(value = "方案配置类型1,默认方案,2.特殊方案")
+    private Integer planConfigType;
+
+    @ApiModelProperty(value = "创建时间")
+    @TableField(value = "created_time", fill = FieldFill.INSERT)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createdTime;
+
+    @ApiModelProperty(value = "创建人ID")
+    private Integer createdUserId;
+
+    @ApiModelProperty(value = "修改时间")
+    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date updatedTime;
+
+    @ApiModelProperty(value = "修改人ID")
+    private Integer updatedUserId;
+
+    @ApiModelProperty(value = "删除标记, 0:未删除, 1:已删除")
+    @TableField("delete_flag")
+    @TableLogic
+    private Integer deleteFlag;
+}

+ 5 - 0
alien-entity/src/main/java/shop/alien/entity/store/LifeBrowseRecord.java

@@ -30,6 +30,11 @@ public class LifeBrowseRecord {
     private String orderId;
 
     private String expertId;
+    @TableField("dynamics_id")
+    private String dynamicsId;
+
+    @TableField("coupon_id")
+    private String couponId;
 
     @ApiModelProperty("浏览类型 1:用户端, 2:商家端")
     @TableField("browse_type")

+ 2 - 1
alien-entity/src/main/java/shop/alien/entity/store/LifeGroupBuyCount.java

@@ -1,5 +1,6 @@
 package shop.alien.entity.store;
 
+import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -21,7 +22,7 @@ public class LifeGroupBuyCount {
     /**
      * 主键id
      */
-    @TableId
+    @TableId(value = "id", type = IdType.AUTO)
     private Integer id;
 
     /**

+ 28 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/ActivityConfigVo.java

@@ -0,0 +1,28 @@
+package shop.alien.entity.store.vo;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import shop.alien.entity.store.ActivityPeriod;
+import shop.alien.entity.store.ActivitySignInConfig;
+import shop.alien.entity.store.ActivitySignInReward;
+
+import java.util.List;
+
+/**
+ * @author zhangchen
+ * @version 1.0
+ * @date 2025/9/8 10:00
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@JsonInclude
+public class ActivityConfigVo extends ActivitySignInConfig {
+
+    @ApiModelProperty(value = "签到奖励配置列表")
+    private List<ActivityPeriod> activityPeriodList;
+
+    @ApiModelProperty(value = "签到奖励配置列表")
+    private List<ActivitySignInReward> rewards;
+}

+ 20 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/ActivityPeriodVo.java

@@ -0,0 +1,20 @@
+package shop.alien.entity.store.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import shop.alien.entity.store.ActivityPeriod;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+@JsonInclude
+public class ActivityPeriodVo extends ActivityPeriod {
+    /**
+     * 活动名称
+     */
+    @ApiModelProperty(value = "活动名称")
+    @TableField("activity_name")
+    private String activityName;
+}

+ 2 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/LifeNoticeVo.java

@@ -25,4 +25,6 @@ public class LifeNoticeVo extends LifeNotice {
     @ApiModelProperty(value = "订单提醒数量")
     private Long orderNum;
 
+    @ApiModelProperty(value = "平台类型,1,默认平台,2,其他")
+    private String platformType;
 }

+ 2 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/LifeUserOrderVo.java

@@ -142,6 +142,8 @@ public class LifeUserOrderVo {
     private String storeType;
     @ApiModelProperty(value = "团购/代金券结束时间")
     private Date endDate;
+    @ApiModelProperty(value = "是否评论")
+    private Boolean hasComment;
 
 
 

+ 2 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/StoreClockInVo.java

@@ -60,6 +60,8 @@ public class StoreClockInVo extends StoreClockIn {
     @ApiModelProperty(value = "经营类型")
     private String businessTypesName;
 
+    @ApiModelProperty(value = "商家入口图")
+    private String entranceImage;
     //    @ApiModelProperty(value = "商家是否打卡")
 //    @ApiModelProperty(value = "该用户是否在该店铺打过卡")
 //    private String clockInStore;

+ 2 - 2
alien-entity/src/main/java/shop/alien/entity/store/vo/StoreInfoVo.java

@@ -100,7 +100,7 @@ public class StoreInfoVo extends StoreInfo {
     @ApiModelProperty(value = "营业执照图片地址")
     private List<String> businessLicenseAddress;
 
-    @ApiModelProperty(value = "营业执照图片地址")
+    @ApiModelProperty(value = "合同图片地址")
     private List<String> contractImageList;
 
     @ApiModelProperty(value = "续签合同图片地址")
@@ -184,7 +184,7 @@ public class StoreInfoVo extends StoreInfo {
     private String verificationCode;
 
     @ApiModelProperty(value = "经营许可证到期时间")
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date foodLicenceExpirationTime;
 
     @ApiModelProperty(value = "变更经营许可证提交时间")

+ 1 - 1
alien-entity/src/main/java/shop/alien/entity/store/vo/StoreMainInfoVo.java

@@ -90,7 +90,7 @@ public class StoreMainInfoVo extends StoreInfo {
     private long countdown;
 
     @ApiModelProperty(value = "经营许可证到期时间")
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy/MM/dd", timezone = "GMT+8")
     private Date foodLicenceExpirationTime;
 
 }

+ 15 - 0
alien-entity/src/main/java/shop/alien/mapper/ActivityPeriodMapper.java

@@ -0,0 +1,15 @@
+package shop.alien.mapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import shop.alien.entity.store.ActivityPeriod;
+import shop.alien.entity.store.vo.ActivityPeriodVo;
+import java.util.List;
+@Mapper
+public interface ActivityPeriodMapper extends BaseMapper<ActivityPeriod> {
+    @Select("select asic.id, asic.activity_name, ap.start_time, ap.end_time from activity_period ap " +
+            "left join activity_sign_in_config asic on asic.id = ap.activity_id " +
+            "where asic.delete_flag = 0 and ap.delete_flag = 0 and ap.start_time < #{endTime} and ap.end_time > #{startTime}")
+    List<ActivityPeriodVo> getActivityPeriodList(@Param("startTime") String startTime, @Param("endTime") String endTime);
+}

+ 13 - 0
alien-entity/src/main/java/shop/alien/mapper/ActivitySignInConfigMapper.java

@@ -0,0 +1,13 @@
+package shop.alien.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import shop.alien.entity.store.ActivitySignInConfig;
+import shop.alien.entity.store.LifeClassManage;
+
+/**
+ * 签到活动配置mapper
+ */
+@Mapper
+public interface ActivitySignInConfigMapper extends BaseMapper<ActivitySignInConfig> {
+}

+ 13 - 0
alien-entity/src/main/java/shop/alien/mapper/ActivitySignRewardMapper.java

@@ -0,0 +1,13 @@
+package shop.alien.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import shop.alien.entity.store.ActivitySignInConfig;
+import shop.alien.entity.store.ActivitySignInReward;
+
+/**
+ * 签到奖励配置mapper
+ */
+@Mapper
+public interface ActivitySignRewardMapper extends BaseMapper<ActivitySignInReward> {
+}

+ 18 - 2
alien-entity/src/main/java/shop/alien/mapper/LifeBrowseRecordMapper.java

@@ -11,8 +11,8 @@ import java.util.Map;
 @Mapper
 public interface LifeBrowseRecordMapper extends BaseMapper<LifeBrowseRecord> {
 
-    @Select("SELECT a.liulan_date liulanDate, b.store_type storeType, b.store_position storePosition, a.liulan_time liulanTime, " +
-            "c.img_url image, b.store_name storeName, b.store_address storeDetailAddress, b.id storeId, a.created_time, d.img_url entranceImage, dict.dict_detail storeTypeStr " +
+    @Select("SELECT a.id,a.liulan_date liulanDate, b.store_type storeType, b.store_position storePosition, a.liulan_time liulanTime, " +
+            "c.img_url image, b.store_name storeName, b.store_address storeDetailAddress, b.id storeId, a.created_time, d.img_url entranceImage, dict.dict_detail storeTypeStr,b.score_avg scoreAvg,b.business_types_name businessTypesName " +
             "FROM life_browse_record a " +
             "LEFT JOIN store_info b ON a.store_id = b.id " +
             "LEFT JOIN store_img c on b.id = c.store_id and c.img_type = 11 and c.delete_flag = 0 " +
@@ -20,5 +20,21 @@ public interface LifeBrowseRecordMapper extends BaseMapper<LifeBrowseRecord> {
             "left join store_dictionary dict on dict.type_name = 'storeType' and dict.dict_id = b.store_type and dict.delete_flag = 0 " +
             "WHERE a.user_id = #{userId} AND a.delete_flag = 0 AND b.delete_flag = 0 ORDER BY a.liulan_time desc")
     List<Map<String, Object>> getBrowseRecordByUserId(String userId);
+    @Select("select lbr.id,lgbm.group_name groupName,lgbm.id couponId,si.id storeId,original_price originalPrice,preferential_price preferentialPrice,lbr.liulan_date liulanDate,si.store_name storeName,si2.img_url\n" +
+            "from life_browse_record lbr \n" +
+            "inner join life_group_buy_main lgbm on lgbm.id = lbr.coupon_id \n" +
+            "and lgbm.delete_flag = 0 and lbr.delete_flag = 0\n" +
+            "left join store_info si on si.id = lgbm.store_id and si.delete_flag = 0\n" +
+            "left join store_img si2 on si2.id = SUBSTRING_INDEX(lgbm.image_id, ',', 1) and si2.delete_flag = 0\n" +
+            "where lbr.user_id = #{userId} and lbr.coupon_id is not null\n" +
+            "Order by lbr.liulan_time desc")
+    List<Map<String, Object>> getGroupBuyBrowseRecordByUserId(String userId);
 
+    @Select("select lbr.id,lud.*,lud.id dynamicsId,lbr.liulan_date liulanDate\n" +
+            "from life_browse_record lbr \n" +
+            "inner join life_user_dynamics lud on lud.id = lbr.dynamics_id \n" +
+            "and lud.delete_flag = 0 and lbr.delete_flag = 0 \n" +
+            "where lbr.user_id = #{userId} and lbr.dynamics_id is not null\n" +
+            "Order by lbr.liulan_time desc")
+    List<Map<String, Object>> getDynamicsBrowseRecordByUserId(String userId);
 }

+ 1 - 1
alien-entity/src/main/java/shop/alien/mapper/LifeGroupBuyCountMapper.java

@@ -38,7 +38,7 @@ public interface LifeGroupBuyCountMapper extends BaseMapper<LifeGroupBuyCount> {
             "(select count(DISTINCT(user_id)) from life_group_buy_count where count_type = '0' and group_id = groupId group by count_date) spfks, " +
             "(select count(0) from life_collect where coupon_id = groupId and business_type is null and delete_flag = 0) spscl, " +
             "(select count(DISTINCT(luo.user_id)) from life_user_order luo left join order_coupon_middle ocm on luo.id = ocm.order_id  where luo.coupon_type = 2 and luo.status = '7' and ocm.coupon_id = groupId) jgrs, " +
-            "(select count(0) from life_user_order luo left join order_coupon_middle ocm on luo.id = ocm.order_id  where luo.coupon_type = 2 and luo.status = '7' and ocm.coupon_id = groupId) xfrs " +
+            "(select count(0) from order_coupon_middle ocm left join life_user_order luo on luo.id = ocm.order_id  where luo.coupon_type = 2 and luo.status = '7' and ocm.coupon_id = groupId) xfrs " +
             "from life_group_buy_main where store_id = #{storeId} order by spfwl desc")
     List<LifeGroupBuyCountDateVo> selectDpzbpmListByStoreId(@Param("storeId") String storeId);
 }

+ 0 - 4
alien-entity/src/main/java/shop/alien/mapper/LifeUserMapper.java

@@ -8,13 +8,10 @@ import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import shop.alien.entity.store.LifeUser;
-import shop.alien.entity.store.StoreImg;
 import shop.alien.entity.store.vo.LifeFansVo;
-import shop.alien.entity.store.vo.LifeUserOrderVo;
 import shop.alien.entity.store.vo.LifeUserVo;
 
 import java.util.List;
-import java.util.Map;
 
 /**
  * 用户
@@ -38,7 +35,6 @@ public interface LifeUserMapper extends BaseMapper<LifeUser> {
 
     LifeFansVo getUserInfoByPhoneIdList(@Param("phoneId") String phoneId);
 
-    List<LifeUserOrderVo> getUserOrderDetail(Integer userId);
 
     @Select("select * from ( " +
             "    select store.id, concat('store_', user.phone) phoneId, img.img_url imgUrl, store_blurb blurb, store.store_name storeUserName " +

+ 2 - 0
alien-entity/src/main/java/shop/alien/mapper/LifeUserOrderMapper.java

@@ -47,6 +47,7 @@ public interface LifeUserOrderMapper extends BaseMapper<LifeUserOrder> {
             "count(ocm.coupon_code) coupon_count,\n" +
             "simg.img_url,\n" +
             "lu.user_phone,\n" +
+            "IF(sc.id is null,false,true) as hasComment,\n" +
             "tc.*\n" +
             "from life_user_order luo\n" +
             "left join store_info si on si.id = luo.store_id and si.delete_flag = 0 -- 查询店铺相关 \n" +
@@ -54,6 +55,7 @@ public interface LifeUserOrderMapper extends BaseMapper<LifeUserOrder> {
             "left join order_coupon_middle ocm on ocm.order_id = luo.id and ocm.delete_flag = 0\n" +
             "inner join total_coupon tc on tc.coupon_id = ocm.coupon_id and tc.coupon_type = luo.coupon_type\n" +
             "left join  store_img simg on simg.id = tc.image_id and simg.delete_flag = 0 \n" +
+            "left join  store_comment sc on sc.business_id = luo.id and sc.delete_flag = 0 and sc.business_type = 5\n" +
             "${ew.customSqlSegment}")
     IPage<LifeUserOrderVo> queryUserOrderList(IPage<LifeUserOrderVo> brandedPage,@Param(Constants.WRAPPER) QueryWrapper<LifeUserOrderVo> lifeUserOrderQueryWrapper);
 

+ 2 - 1
alien-entity/src/main/java/shop/alien/mapper/StoreClockInMapper.java

@@ -23,7 +23,7 @@ import java.util.Map;
 public interface StoreClockInMapper extends BaseMapper<StoreClockIn> {
 
     @Select("select clock.id, clock.user_id, clock.store_id, clock.permission, user.user_name, store.store_name,store.score_avg score, clock.like_count, store.store_position, clock.content, clock.created_time, clock.img_url clockImg, img.img_url storeImg, user.user_image userImg," +
-            "store.administrative_region_district_name region, dict.dict_detail storeType, concat('user_', user.user_phone) phoneId, store.business_section,business_types_name," +
+            "store.administrative_region_district_name region, dict.dict_detail storeType, concat('user_', user.user_phone) phoneId, store.business_section,business_types_name,img1.img_url entranceImage," +
             "( " +
             " select ifnull(round(sum(uorder.price) / count(1), 0), 0) " +
             " from life_user_order uorder " +
@@ -38,6 +38,7 @@ public interface StoreClockInMapper extends BaseMapper<StoreClockIn> {
             "join life_user user on user.id = clock.user_id " +
             "join store_info store on store.id = clock.store_id " +
             "left join store_img img on img.store_id = clock.store_id and img.img_type = '10' and img.delete_flag = 0 " +
+            "left join store_img img1 on img1.store_id = clock.store_id and img1.img_type = '1' and img1.delete_flag = 0 " +
             "left join store_dictionary dict on dict.type_name = 'storeType' and store.store_type = dict.dict_id and dict.delete_flag = 0 " +
             "${ew.customSqlSegment} ")
     IPage<StoreClockInVo> getStoreClockInList(IPage<StoreClockIn> page, @Param(Constants.WRAPPER) QueryWrapper<StoreClockIn> queryWrapper);

+ 1 - 54
alien-entity/src/main/resources/mapper/LifeUserMapper.xml

@@ -4,60 +4,7 @@
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="shop.alien.mapper.LifeUserMapper">
 
-    <!-- 查询用户列表,支持分页和动态条件 -->
-    <select id="getUserOrderDetail" resultType="shop.alien.entity.store.vo.LifeUserOrderVo">
-        WITH OrderDetails AS (
-        SELECT
-        uo.user_id,
-        coupon.id AS couponId,
-        coupon.NAME AS couponName,
-        store.store_name,
-        su.phone,
-        uo.buy_time,
-        uo.used_time,
-        uo.final_price,
-        uo.status,
-        CASE
-        WHEN coupon.type = 1 THEN '代金券'
-        WHEN coupon.type = 2 THEN '团购(套餐)'
-        ELSE '其他类型'
-        END AS type
-        FROM
-        life_user_order uo
-        LEFT JOIN life_coupon coupon ON uo.quan_id = coupon.id
-        LEFT JOIN store_info store ON coupon.store_id = store.id
-        LEFT JOIN store_user su ON su.store_id = store.id
-        WHERE
-        1 = 1
-        <if test="userId != null and userId != ''">
-            and uo.user_id = #{userId}
-        </if>
-        )
-        SELECT
-        COUNT(1) AS purchaseQuantity,
-        user_id,
-        couponId,
-        couponName,
-        store_name,
-        phone as user_phone,
-        buy_time,
-        status,
-        used_time,
-        ROUND(SUM(final_price), 2) AS total_final_price,
-        type
-        FROM
-        OrderDetails
-        GROUP BY
-        user_id,
-        couponId,
-        couponName,
-        store_name,
-        phone,
-        buy_time,
-        status,
-        used_time,
-        type;
-    </select>
+
 
     <!-- 查询已删除的用户 -->
     <select id="getRemoveUser" resultType="shop.alien.entity.store.vo.LifeUserVo">

+ 1 - 0
alien-entity/src/main/resources/mapper/PlatformLifeUserMapper.xml

@@ -23,6 +23,7 @@
         user.user_name,
         user.real_name,
         user.user_phone,
+        concat('user_', user.user_phone) phoneId,
         user.created_time,
         ifnull(orders.consume_num, 0) consume_num,
         ifnull(orders.consume_price, 0) consume_price,

+ 48 - 40
alien-job/src/main/java/shop/alien/job/store/LifeCouponJob.java

@@ -218,16 +218,18 @@ public class LifeCouponJob {
                 }
             }
         }
-        // 创建一个 LambdaUpdateWrapper 用于更新生活优惠券的状态
-        LambdaUpdateWrapper<LifeCoupon> updateWrapper = new LambdaUpdateWrapper<>();
-        // 设置更新条件,根据优惠券的 ID 进行更新
-        updateWrapper.in(LifeCoupon::getId,endCouponIds)
-                // 设置要更新的字段,将优惠券的状态更新为 3
-                .set(LifeCoupon::getStatus, CouponStatusEnum.ENDED.getCode());
-        // 调用 lifeCouponMapper 的 update 方法,根据上述条件更新优惠券的状态
-        int updateNum = lifeCouponMapper.update(null, updateWrapper);
-        System.out.println("执行修改代金券状态 ===> 已结束 优惠券列表 ===> " + endCouponIds);
-        System.out.println("执行修改代金券状态 ===> 已结束 优惠券数量 ===> " + updateNum);
+        if(!endCouponIds.isEmpty()){
+            // 创建一个 LambdaUpdateWrapper 用于更新生活优惠券的状态
+            LambdaUpdateWrapper<LifeCoupon> updateWrapper = new LambdaUpdateWrapper<>();
+            // 设置更新条件,根据优惠券的 ID 进行更新
+            updateWrapper.in(LifeCoupon::getId,endCouponIds)
+                    // 设置要更新的字段,将优惠券的状态更新为 3
+                    .set(LifeCoupon::getStatus, CouponStatusEnum.ENDED.getCode());
+            // 调用 lifeCouponMapper 的 update 方法,根据上述条件更新优惠券的状态
+            int updateNum = lifeCouponMapper.update(null, updateWrapper);
+            System.out.println("执行修改代金券状态 ===> 已结束 优惠券列表 ===> " + endCouponIds);
+            System.out.println("执行修改代金券状态 ===> 已结束 优惠券数量 ===> " + updateNum);
+        }
 // --------------------------------------------------------------------------------------------------------
         // 创建另一个 LambdaUpdateWrapper 用于查询状态为 0 的生活优惠券
         LambdaUpdateWrapper<LifeCoupon> selectWrapper2 = new LambdaUpdateWrapper<>();
@@ -250,16 +252,18 @@ public class LifeCouponJob {
                 }
             }
         }
-        // 创建一个 LambdaUpdateWrapper 用于更新生活优惠券的状态
-        LambdaUpdateWrapper<LifeCoupon> updateWrapper2 = new LambdaUpdateWrapper<>();
-        // 设置更新条件,根据优惠券的 ID 进行更新
-        updateWrapper.eq(LifeCoupon::getId, startCouponIds)
-                // 设置要更新的字段,将优惠券的状态更新为 1
-                .set(LifeCoupon::getStatus, CouponStatusEnum.ONGOING.getCode());
-        // 调用 lifeCouponMapper 的 update 方法,根据上述条件更新优惠券的状态
-        int updateNum2 = lifeCouponMapper.update(null, updateWrapper2);
-        System.out.println("执行修改代金券状态 ===> 进行中 优惠券列表 ===> " + startCouponIds);
-        System.out.println("执行修改代金券状态 ===> 进行中 优惠券数量 ===> " + updateNum2);
+        if(!startCouponIds.isEmpty()){
+            // 创建一个 LambdaUpdateWrapper 用于更新生活优惠券的状态
+            LambdaUpdateWrapper<LifeCoupon> updateWrapper2 = new LambdaUpdateWrapper<>();
+            // 设置更新条件,根据优惠券的 ID 进行更新
+            updateWrapper2.in(LifeCoupon::getId, startCouponIds)
+                    // 设置要更新的字段,将优惠券的状态更新为 1
+                    .set(LifeCoupon::getStatus, CouponStatusEnum.ONGOING.getCode());
+            // 调用 lifeCouponMapper 的 update 方法,根据上述条件更新优惠券的状态
+            int updateNum2 = lifeCouponMapper.update(null, updateWrapper2);
+            System.out.println("执行修改代金券状态 ===> 进行中 优惠券列表 ===> " + startCouponIds);
+            System.out.println("执行修改代金券状态 ===> 进行中 优惠券数量 ===> " + updateNum2);
+        }
     }
 
     /**
@@ -314,16 +318,18 @@ public class LifeCouponJob {
                 }
             }
         }
-        // 创建一个 LambdaUpdateWrapper 用于更新生活优惠券的状态
-        LambdaUpdateWrapper<LifeGroupBuyMain> updateWrapper = new LambdaUpdateWrapper<>();
-        // 设置更新条件,根据优惠券的 ID 进行更新
-        updateWrapper.in(LifeGroupBuyMain::getId,endCouponIds)
-                // 设置要更新的字段,将优惠券的状态更新为 7
-                .set(LifeGroupBuyMain::getStatus, CouponStatusEnum.ENDED.getCode());
-        // 调用 lifeCouponMapper 的 update 方法,根据上述条件更新优惠券的状态
-        int updateNum = lifeGroupBuyMainMapper.update(null, updateWrapper);
-        System.out.println("执行修改团购状态 ===> 已结束 优惠券列表 ===> " + endCouponIds);
-        System.out.println("执行修改团购状态 ===> 已结束 优惠券数量 ===> " + updateNum);
+        if(!endCouponIds.isEmpty()) {
+            // 创建一个 LambdaUpdateWrapper 用于更新生活优惠券的状态
+            LambdaUpdateWrapper<LifeGroupBuyMain> updateWrapper = new LambdaUpdateWrapper<>();
+            // 设置更新条件,根据优惠券的 ID 进行更新
+            updateWrapper.in(LifeGroupBuyMain::getId, endCouponIds)
+                    // 设置要更新的字段,将优惠券的状态更新为 7
+                    .set(LifeGroupBuyMain::getStatus, CouponStatusEnum.ENDED.getCode());
+            // 调用 lifeCouponMapper 的 update 方法,根据上述条件更新优惠券的状态
+            int updateNum = lifeGroupBuyMainMapper.update(null, updateWrapper);
+            System.out.println("执行修改团购状态 ===> 已结束 优惠券列表 ===> " + endCouponIds);
+            System.out.println("执行修改团购状态 ===> 已结束 优惠券数量 ===> " + updateNum);
+        }
 // --------------------------------------------------------------------------------------------------------
         // 创建另一个 LambdaUpdateWrapper 用于查询状态为 0 的生活优惠券
         LambdaUpdateWrapper<LifeGroupBuyMain> selectWrapper2 = new LambdaUpdateWrapper<>();
@@ -346,15 +352,17 @@ public class LifeCouponJob {
                 }
             }
         }
-        // 创建一个 LambdaUpdateWrapper 用于更新生活优惠券的状态
-        LambdaUpdateWrapper<LifeGroupBuyMain> updateWrapper2 = new LambdaUpdateWrapper<>();
-        // 设置更新条件,根据优惠券的 ID 进行更新
-        updateWrapper.eq(LifeGroupBuyMain::getId, startCouponIds)
-                // 设置要更新的字段,将优惠券的状态更新为 1
-                .set(LifeGroupBuyMain::getStatus, CouponStatusEnum.ONGOING.getCode());
-        // 调用 lifeCouponMapper 的 update 方法,根据上述条件更新优惠券的状态
-        int updateNum2 = lifeGroupBuyMainMapper.update(null, updateWrapper2);
-        System.out.println("执行修改团购状态 ===> 进行中 优惠券列表 ===> " + startCouponIds);
-        System.out.println("执行修改团购状态 ===> 进行中 优惠券数量 ===> " + updateNum2);
+        if (!startCouponIds.isEmpty()) {
+            // 创建一个 LambdaUpdateWrapper 用于更新生活优惠券的状态
+            LambdaUpdateWrapper<LifeGroupBuyMain> updateWrapper2 = new LambdaUpdateWrapper<>();
+            // 设置更新条件,根据优惠券的 ID 进行更新
+            updateWrapper2.in(LifeGroupBuyMain::getId, startCouponIds)
+                    // 设置要更新的字段,将优惠券的状态更新为 1
+                    .set(LifeGroupBuyMain::getStatus, CouponStatusEnum.ONGOING.getCode());
+            // 调用 lifeCouponMapper 的 update 方法,根据上述条件更新优惠券的状态
+            int updateNum2 = lifeGroupBuyMainMapper.update(null, updateWrapper2);
+            System.out.println("执行修改团购状态 ===> 进行中 优惠券列表 ===> " + startCouponIds);
+            System.out.println("执行修改团购状态 ===> 进行中 优惠券数量 ===> " + updateNum2);
+        }
     }
 }

+ 82 - 0
alien-job/src/main/java/shop/alien/job/store/LifeGroupBuyCountJob.java

@@ -0,0 +1,82 @@
+package shop.alien.job.store;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+import shop.alien.entity.store.*;
+import shop.alien.entity.store.vo.LifeUserOrderVo;
+import shop.alien.job.feign.AlienStoreFeign;
+import shop.alien.mapper.*;
+import shop.alien.util.common.UniqueRandomNumGenerator;
+import shop.alien.util.common.constant.DiscountCouponEnum;
+import shop.alien.util.common.constant.OrderStatusEnum;
+
+import java.math.BigDecimal;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.time.LocalDateTime;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * 团购上下架数据统计
+ *
+ * @author jyc
+ * @date 2023/12/20 14:20
+ * @see LifeUserOrder
+ */
+
+@Slf4j
+@Component
+@RequiredArgsConstructor
+public class LifeGroupBuyCountJob {
+
+    private final LifeGroupBuyCountMapper lifeGroupBuyCountMapper;
+    private final LifeGroupBuyMainMapper lifeGroupBuyMainMapper;
+
+    /**
+     * 待支付订单超时处理
+     */
+    @XxlJob("countSxjGroupBuy")
+    @Transactional(rollbackFor = Exception.class)
+    public void autoCancelUnpaidOrders() {
+        List<LifeGroupBuyCount> list = new ArrayList<>();
+        //上架数据
+        LambdaQueryWrapper<LifeGroupBuyMain> sjQuery = new LambdaQueryWrapper<>();
+        sjQuery.eq(LifeGroupBuyMain::getStatus, "5").eq(LifeGroupBuyMain::getDeleteFlag, 0).eq(LifeGroupBuyMain::getGroupType, 1);
+        Map<String, List<LifeGroupBuyMain>> sjCollect = lifeGroupBuyMainMapper.selectList(sjQuery).stream().collect(Collectors.groupingBy(LifeGroupBuyMain::getStoreId));
+        for (String s : sjCollect.keySet()) {
+            LifeGroupBuyCount sj = new LifeGroupBuyCount();
+            sj.setStoreId(Integer.valueOf(sjCollect.get(s).get(0).getStoreId()));
+            sj.setCountType("2");
+            sj.setCountNum(sjCollect.get(s).size());
+            sj.setCountDate(new Date());
+            list.add(sj);
+        }
+
+        //下架数据
+        LambdaQueryWrapper<LifeGroupBuyMain> xjQuery = new LambdaQueryWrapper<>();
+        xjQuery.in(LifeGroupBuyMain::getStatus, "7", "8").eq(LifeGroupBuyMain::getDeleteFlag, 0).eq(LifeGroupBuyMain::getGroupType, 1);
+        Map<String, List<LifeGroupBuyMain>> xjCollect = lifeGroupBuyMainMapper.selectList(xjQuery).stream().collect(Collectors.groupingBy(LifeGroupBuyMain::getStoreId));
+        for (String s : xjCollect.keySet()) {
+            LifeGroupBuyCount xj = new LifeGroupBuyCount();
+            xj.setStoreId(Integer.valueOf(xjCollect.get(s).get(0).getStoreId()));
+            xj.setCountType("3");
+            xj.setCountNum(xjCollect.get(s).size());
+            xj.setCountDate(new Date());
+            list.add(xj);
+        }
+        if (ObjectUtils.isNotEmpty(list)) {
+            lifeGroupBuyCountMapper.insertList(list);
+        }
+    }
+}
+

+ 1 - 1
alien-job/src/main/java/shop/alien/job/store/LifeUserOrderJob.java

@@ -58,7 +58,7 @@ public class LifeUserOrderJob {
         //1.查询待支付超时订单
         List<LifeUserOrder> lifeUserOrders = lifeUserOrderMapper.selectList(new LambdaQueryWrapper<LifeUserOrder>()
                 .eq(LifeUserOrder::getStatus, OrderStatusEnum.WAIT_PAY.getStatus())
-                .le(LifeUserOrder::getBuyTime, LocalDateTime.now().minusMinutes(15)));
+                .le(LifeUserOrder::getBuyTime, LocalDateTime.now().minusMinutes(30)));
         if (CollectionUtils.isEmpty(lifeUserOrders)) {
             return "无待支付超时订单";
         }

+ 8 - 1
alien-second/src/main/java/shop/alien/second/service/impl/SecondGoodsReportingServiceImpl.java

@@ -3,6 +3,7 @@ package shop.alien.second.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import shop.alien.entity.second.SecondGoods;
@@ -16,6 +17,7 @@ import shop.alien.mapper.StoreDictionaryMapper;
 import shop.alien.mapper.second.SecondGoodsMapper;
 import shop.alien.mapper.second.SecondGoodsRecordMapper;
 import shop.alien.second.service.SecondGoodsReportingService;
+import shop.alien.second.util.JsonUtils;
 
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
@@ -93,8 +95,13 @@ public class SecondGoodsReportingServiceImpl implements SecondGoodsReportingServ
             String context = "您于" + dateTime.format(targetFormatter) + "举报“" + lifeUser.getUserName() + "”“" + storeDictionary.getDictDetail() + "”举报内容为“"
                     + lifeUserViolation.getOtherReasonContent()  + "”";
             secondReportingVo.setReportingContext(context);
+        } else if (lifeUserViolation.getReportContextType().equals("1") || lifeUserViolation.getReportContextType().equals("2") || lifeUserViolation.getReportContextType().equals("3")) {
+            // 用户信息
+            if (StringUtils.isNotBlank(lifeNotice.getContext())) {
+                String context = JsonUtils.getJsonValue(lifeNotice.getContext(), "message");
+                secondReportingVo.setReportingContext(context);
+            }
         }
-
         secondReportingVo.setFeedbackContext("平台已受理,感谢您的反馈!");
         secondReportingVo.setReportingTime(lifeNotice.getCreatedTime());
         secondReportingVo.setFeedbackTime(lifeNotice.getCreatedTime());

+ 34 - 0
alien-second/src/main/java/shop/alien/second/util/JsonUtils.java

@@ -0,0 +1,34 @@
+package shop.alien.second.util;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+public class JsonUtils {
+    private static final ObjectMapper objectMapper = new ObjectMapper();
+
+    /**
+     * 从JSON字符串中获取指定key的值
+     */
+    public static String getJsonValue(String jsonString, String key) {
+        try {
+            JsonNode jsonNode = objectMapper.readTree(jsonString);
+            JsonNode valueNode = jsonNode.get(key);
+            return valueNode != null ? valueNode.asText() : null;
+        } catch (Exception e) {
+            throw new RuntimeException("解析JSON失败", e);
+        }
+    }
+
+    /**
+     * 获取指定key的值(支持各种数据类型)
+     */
+    public static <T> T getJsonValue(String jsonString, String key, Class<T> valueType) {
+        try {
+            JsonNode jsonNode = objectMapper.readTree(jsonString);
+            JsonNode valueNode = jsonNode.get(key);
+            return objectMapper.treeToValue(valueNode, valueType);
+        } catch (Exception e) {
+            throw new RuntimeException("解析JSON失败", e);
+        }
+    }
+}

+ 122 - 0
alien-store/src/main/java/shop/alien/store/controller/ActivityConfigController.java

@@ -0,0 +1,122 @@
+package shop.alien.store.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.swagger.annotations.*;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.web.bind.annotation.*;
+import shop.alien.entity.result.R;
+import shop.alien.entity.store.ActivitySignInConfig;
+import shop.alien.entity.store.vo.ActivityConfigVo;
+import shop.alien.entity.store.vo.ActivityPeriodVo;
+import shop.alien.store.service.ActivityConfigService;
+
+import java.util.Date;
+import java.util.List;
+
+@Api(tags = {"二期-签到活动"})
+@Slf4j
+@CrossOrigin
+@RestController
+@RequestMapping("/activity")
+@RequiredArgsConstructor
+public class ActivityConfigController {
+
+    private final ActivityConfigService activityConfigService;
+
+    /**
+     * 创建签到活动
+     */
+    @ApiOperation("创建签到活动")
+    @ApiOperationSupport(order = 1)
+    @PostMapping("createOrUpdateActivity")
+    public R<ActivityConfigVo> createOrUpdateActivity(@RequestBody ActivityConfigVo configVO) {
+        ActivityConfigVo activity = activityConfigService.createOrUpdateActivity(configVO);
+        if(activity == null) {
+            return R.fail("插入/更新失败");
+        }
+        if(StringUtils.isNotBlank(activity.getErrorMessage())){
+            return R.fail(activity.getErrorMessage());
+        }
+        return R.data(activity);
+    }
+
+    /**
+     * web-分页查询店铺信息
+     */
+    @ApiOperation("分页查询活动列表")
+    @ApiOperationSupport(order = 2)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
+            @ApiImplicitParam(name = "pageSize", value = "页容", dataType = "int", paramType = "query", required = true),
+            @ApiImplicitParam(name = "activityName", value = "活动名称", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "status", value = "状态", dataType = "Integer", paramType = "query")
+
+    })
+    @GetMapping("/getActivityConfigList")
+    public R<IPage<ActivitySignInConfig>> getActivityList(@RequestParam(defaultValue = "1") int pageNum,
+                                                            @RequestParam(defaultValue = "10") int pageSize,
+                                                            @RequestParam(required = false) String activityName,
+                                                          @RequestParam(required = false) Integer status){
+        IPage<ActivitySignInConfig> activitySignInConfigList = activityConfigService.getActivityList(pageNum, pageSize, activityName, status);
+        return R.data(activitySignInConfigList);
+    }
+
+    @ApiOperation("获取签到活动详情")
+    @ApiOperationSupport(order = 3)
+    @GetMapping("/getActivitySignInConfigById")
+    public R<ActivityConfigVo> getActivitySignInConfigById(@RequestParam(required = true) Long activityId) {
+        log.info("ActivityConfigController.getActivitySignInConfigById={}", activityId);
+        ActivityConfigVo activityConfigVO = activityConfigService.getActivitySignInConfigById(activityId);
+        return R.data(activityConfigVO);
+    }
+
+    @ApiOperation("获取默认方案签到活动详情")
+    @ApiOperationSupport(order = 4)
+    @GetMapping("/getDefaultActivitySignInConfigById")
+    public R<ActivityConfigVo> getDefaultActivitySignInConfigById() {
+        log.info("ActivityConfigController.getDefaultActivitySignInConfigById");
+        ActivityConfigVo activityConfigVO = activityConfigService.getDefaultActivitySignInConfigById();
+        return R.data(activityConfigVO);
+    }
+
+    /**
+     * 修改签到活动状态
+     *
+     * @param id     主键
+     * @param status 状态
+     * @return boolean
+     */
+    @ApiOperation("更新签到活动状态")
+    @ApiOperationSupport(order = 5)
+    @GetMapping("/updateActivityStatus")
+    public R<Boolean> updateActivityStatus(@RequestParam("id") Integer id, @RequestParam("status") Integer status) {
+        log.info("ActivityConfigController.updateActivityStatus?id={}&status={}", id, status);
+        if (activityConfigService.updateActivityStatus(id, status)) {
+            return R.success("成功");
+        }
+        return R.fail("失败");
+    }
+
+    @ApiOperation("删除活动")
+    @ApiOperationSupport(order = 6)
+    @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "活动ID", dataType = "Integer", paramType = "query", required = true)})
+    @GetMapping("/deleteActivity")
+    public R<Boolean> deleteActivity(Integer id) {
+        return R.data(activityConfigService.deleteActivity(id));
+    }
+
+    @ApiOperation("校验是否时间重叠")
+    @ApiOperationSupport(order = 5)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "startTime", value = "开始时间", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "endTime", value = "结束时间", dataType = "String", paramType = "query")
+    })
+    @GetMapping("/checkOverlapTime")
+    public R<List<ActivityPeriodVo>> checkOverlapTime(@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime) {
+        log.info("ActivityConfigController.checkOverlapTime");
+        List<ActivityPeriodVo> activityPeriodVoList = activityConfigService.checkOverlapTime(startTime, endTime);
+        return R.data(activityPeriodVoList);
+    }
+}

+ 1 - 1
alien-store/src/main/java/shop/alien/store/controller/EssentialModuleInformationController.java

@@ -48,7 +48,7 @@ public class EssentialModuleInformationController {
     @GetMapping(value = "getChildByParentId")
     private R<List<EssentialModuleInformation>> getPrimaryData(@RequestParam(value = "parentId", required = false) String parentId) {
         List<EssentialModuleInformation> essentialModuleInformationList = essentialModuleInformationService.list(
-                new LambdaQueryWrapper<EssentialModuleInformation>().eq(EssentialModuleInformation::getParentId, parentId));
+                new LambdaQueryWrapper<EssentialModuleInformation>().eq(EssentialModuleInformation::getParentId, parentId).eq(EssentialModuleInformation::getDeleteFlag, 0));
         return R.data(essentialModuleInformationList);
     }
 

+ 17 - 16
alien-store/src/main/java/shop/alien/store/controller/LifeBrowseRecordController.java

@@ -16,7 +16,7 @@ import java.util.stream.Collectors;
 /**
  * 浏览记录
  */
-@Api(tags = {"期-浏览记录"})
+@Api(tags = {"2.5期-浏览记录"})
 @Slf4j
 @CrossOrigin
 @RestController
@@ -31,19 +31,17 @@ public class LifeBrowseRecordController {
     @ApiImplicitParams({
             @ApiImplicitParam(name = "userId", value = "用户id", dataType = "String", paramType = "query"),
             @ApiImplicitParam(name = "storeId", value = "门店id", dataType = "String", paramType = "query"),
-            @ApiImplicitParam(name = "orderId", value = "订单id", dataType = "String", paramType = "query"),
-            @ApiImplicitParam(name = "expertId", value = "达人id", dataType = "String", paramType = "query"),
-            @ApiImplicitParam(name = "browseType", value = "浏览类型 1:用户端, 2:商家端", dataType = "Integer", paramType = "query")
+            @ApiImplicitParam(name = "dynamicsId", value = "动态id", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "couponId", value = "团购id", dataType = "String", paramType = "query")
     })
     @PostMapping("/save")
-    public R<Boolean> save(@RequestParam("userId") String userId, @RequestParam("storeId") String storeId, String orderId, String expertId, Integer browseType) {
-        log.info("LifeBrowseRecordController.save?userId={}&storeId={}&browseType={}", userId, storeId, browseType);
+    public R<Boolean> save(@RequestParam(value = "userId",required = false) String userId, @RequestParam(value = "storeId",required = false) String storeId, @RequestParam(value = "dynamicsId",required = false) String dynamicsId,@RequestParam(value = "couponId",required = false) String couponId) {
+        log.info("LifeBrowseRecordController.save?userId={},storeId={},dynamicsId={},couponId={}", userId,storeId, dynamicsId, couponId);
         LifeBrowseRecord record = new LifeBrowseRecord();
         record.setUserId(userId);
         record.setStoreId(storeId);
-        record.setBrowseType(browseType);
-        record.setOrderId(orderId);
-        record.setExpertId(expertId);
+        record.setDynamicsId(dynamicsId);
+        record.setCouponId(couponId);
         if (lifeBrowseRecordService.save(record) > 0) {
             return R.success("操作成功");
         }
@@ -54,12 +52,13 @@ public class LifeBrowseRecordController {
     @ApiOperationSupport(order = 2)
     @ApiImplicitParams({@ApiImplicitParam(name = "page", value = "分页页数", dataType = "String", paramType = "query", required = true),
             @ApiImplicitParam(name = "size", value = "分页条数", dataType = "String", paramType = "query", required = true),
+            @ApiImplicitParam(name = "type", value = "类型 1:商家;2:团购;3:动态", dataType = "String", paramType = "query", required = true),
             @ApiImplicitParam(name = "userId", value = "用户id", dataType = "String", paramType = "query")})
     @GetMapping("/getBrowseRecord")
-    public R<IPage<Map<String, Object>>> getBrowseRecord(@RequestParam("userId") String userId, @RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int size) {
-        log.info("LifeBrowseRecordController.getBrowseRecord?userId={},page={},size={}", userId, page, size);
+    public R<IPage<Map<String, Object>>> getBrowseRecord(@RequestParam("userId") String userId,@RequestParam("type") String type, @RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int size) {
+        log.info("LifeBrowseRecordController.getBrowseRecord?userId={},type={},page={},size={}", userId,type, page, size);
         List<Map<String, Object>> dataList = new ArrayList<>();
-        Map<String, List<Map<String, Object>>> map = lifeBrowseRecordService.getBrowseRecord(userId);
+        Map<String, List<Map<String, Object>>> map = lifeBrowseRecordService.getBrowseRecord(userId,type);
         for (Map.Entry<String, List<Map<String, Object>>> entry : map.entrySet()) {
             String year = entry.getKey();
             List<Map<String, Object>> records = entry.getValue();
@@ -77,11 +76,13 @@ public class LifeBrowseRecordController {
 
     @ApiOperation("清除浏览记录")
     @ApiOperationSupport(order = 3)
-    @ApiImplicitParams({@ApiImplicitParam(name = "userId", value = "用户id", dataType = "String", paramType = "query")})
+    @ApiImplicitParams({@ApiImplicitParam(name = "userId", value = "用户id", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "recordId", value = "浏览记录id", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "type", value = "类型:1店铺,2团购,3动态", dataType = "String", paramType = "query")})
     @PostMapping("/clearBrowseRecord")
-    public R<Boolean> clearBrowseRecord(@RequestParam("userId") String userId) {
-        log.info("LifeBrowseRecordController.clearBrowseRecord?userId={}", userId);
-        int num = lifeBrowseRecordService.clearBrowseRecord(userId);
+    public R<Boolean> clearBrowseRecord(@RequestParam("userId") String userId, @RequestParam(value = "recordId",required = false) String recordId,@RequestParam(value = "type",required = false) String type) {
+        log.info("LifeBrowseRecordController.clearBrowseRecord?userId={}&recordId={}&type={}", userId, recordId,type);
+        int num = lifeBrowseRecordService.clearBrowseRecord(userId, recordId,type);
         if (num == 0) {
             return R.fail("操作失败");
         }

+ 17 - 10
alien-store/src/main/java/shop/alien/store/controller/LifeGroupBuyCountController.java

@@ -1,6 +1,5 @@
 package shop.alien.store.controller;
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -9,11 +8,12 @@ import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.web.bind.annotation.*;
 import shop.alien.entity.result.R;
-import shop.alien.entity.store.LifeGroupBuyCount;
-import shop.alien.entity.store.dto.LifeGroupBuyDto;
-import shop.alien.entity.store.vo.LifeGroupBuyThaliVo;
+import shop.alien.entity.store.vo.LifeGroupBuyCountDateVo;
+import shop.alien.entity.store.vo.LifeGroupBuyCountVo;
 import shop.alien.store.service.LifeGroupBuyCountService;
 
+import java.util.List;
+
 /**
  * 团购统计
  */
@@ -29,13 +29,13 @@ public class LifeGroupBuyCountController {
 
     @ApiOperation("插入团购统计")
     @PostMapping("/insertGroupBuyCount")
-    public R insertGroupBuyCount(@RequestBody LifeGroupBuyCount lifeGroupBuyCount) {
-        log.info("LifeGroupBuyCountController.insertGroupBuyCount?lifeGroupBuyCount={}", lifeGroupBuyCount.toString());
+    public R insertGroupBuyCount(@RequestParam(value = "storeId") Integer storeId,@RequestParam(value = "groupId") Integer groupId,@RequestParam(value = "userId") Integer userId,@RequestParam(value = "countType") String countType) {
+        log.info("LifeGroupBuyCountController.insertGroupBuyCount?storeId={},groupId={},userId={},countType={}", storeId,groupId,userId,countType);
         try {
-            lifeGroupBuyCountService.insertGroupBuyCount(lifeGroupBuyCount);
+            lifeGroupBuyCountService.insertGroupBuyCount(storeId, groupId, userId, countType);
             return R.success("成功");
         }catch (Exception e){
-            log.error("LifeGroupBuyCountController.insertGroupBuyCount?lifeGroupBuyCount={}", lifeGroupBuyCount.toString(), e);
+            log.error("LifeGroupBuyCountController.insertGroupBuyCount?storeId={},groupId={},userId={},countType={}", storeId,groupId,userId,countType,e);
             return R.fail("失败");
         }
     }
@@ -51,7 +51,7 @@ public class LifeGroupBuyCountController {
     @ApiOperation("团购统计-商品核心指标趋势")
     @ApiImplicitParams({@ApiImplicitParam(name = "storeId", value = "门店id", dataType = "String", paramType = "query", required = true)})
     @GetMapping("/getSphxzb")
-    private R getSphxzb(@RequestParam(value = "storeId") String storeId) {
+    private R<List<LifeGroupBuyCountDateVo>> getSphxzb(@RequestParam(value = "storeId") String storeId) {
         log.info("LifeGroupBuyCountController.getSphxzb?storeId={}", storeId);
         return R.data(lifeGroupBuyCountService.getSphxzb(storeId));
     }
@@ -59,8 +59,15 @@ public class LifeGroupBuyCountController {
     @ApiOperation("团购统计-单品指标排名")
     @ApiImplicitParams({@ApiImplicitParam(name = "storeId", value = "门店id", dataType = "String", paramType = "query", required = true)})
     @GetMapping("/getDpzbpm")
-    private R getDpzbpm(@RequestParam(value = "storeId") String storeId) {
+    private R<List<LifeGroupBuyCountDateVo>> getDpzbpm(@RequestParam(value = "storeId") String storeId) {
         log.info("LifeGroupBuyCountController.getDpzbpm?storeId={}", storeId);
         return R.data(lifeGroupBuyCountService.getDpzbpm(storeId));
     }
+
+    /*@ApiOperation("团购统计-测试")
+    @GetMapping("/test")
+    private R test() {
+        lifeGroupBuyCountService.test();
+        return R.success("成功");
+    }*/
 }

+ 5 - 4
alien-store/src/main/java/shop/alien/store/controller/LifeUserDynamicsController.java

@@ -15,8 +15,6 @@ import shop.alien.entity.store.vo.LifePinglunVo;
 import shop.alien.entity.store.vo.LifeUserDynamicsVo;
 import shop.alien.store.service.LifeUserDynamicsService;
 import shop.alien.util.common.ListToPage;
-import shop.alien.util.common.netease.ImageCheckUtil;
-import shop.alien.util.common.netease.TextCheckUtil;
 import shop.alien.util.common.safe.*;
 
 import java.util.ArrayList;
@@ -158,9 +156,12 @@ public class LifeUserDynamicsController {
     }
 
     @PostMapping("addLiulanShu")
-    public int dianzan(String id) {
+    public R dianzan(String id) {
         log.info("LifeUserDynamicsController.addLiulanShu?id={}", id);
-        return lifeUserDynamicsService.addLiulanCount(id);
+        if (lifeUserDynamicsService.addLiulanCount(id) == 0){
+            return R.fail("操作失败");
+        }
+        return R.success("操作成功");
     }
 
     @ApiOperation("草稿列表")

+ 1 - 1
alien-store/src/main/java/shop/alien/store/controller/LifeUserOrderController.java

@@ -92,7 +92,7 @@ public class LifeUserOrderController {
             @ApiImplicitParam(name = "userId", value = "用户id", required = false),
             @ApiImplicitParam(name = "storeId", value = "商户id", required = false),
             @ApiImplicitParam(name = "couponType", value = "订单类型,-1,全部(可以不传),1,代金券;2,团购;", required = false),
-            @ApiImplicitParam(name = "orderStatus", value = "订单状态,-1,全部(可以不传);0,待支付;1,已支付/待使用;2,已核销;3,已过期;4,已取消;5.已退款,全退款了才算;6,退款失败;7,已完成", required = false),
+            @ApiImplicitParam(name = "orderStatus", value = "订单状态,-1,全部(可以不传);1,已支付/待使用;2,已完成;5,退款/售后", required = false),
             @ApiImplicitParam(name = "name", value = "订单名称", required = false)
     })
     @GetMapping("/queryUserOrderList")

+ 32 - 0
alien-store/src/main/java/shop/alien/store/controller/PlatformLifeMessageController.java

@@ -0,0 +1,32 @@
+package shop.alien.store.controller;
+
+import io.swagger.annotations.*;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.*;
+import shop.alien.entity.result.R;
+import shop.alien.entity.store.vo.LifeMessageVo;
+import shop.alien.store.service.PlatformLifeMessageService;
+
+import java.util.List;
+
+@Api(tags = {"平台-消息管理"})
+@Slf4j
+@RestController
+@CrossOrigin
+@RequestMapping("/platformLifeMessage")
+@RequiredArgsConstructor
+public class PlatformLifeMessageController {
+
+    private final PlatformLifeMessageService lifeMessageService;
+
+    @ApiOperation("消息列表")
+    @ApiOperationSupport(order = 1)
+    @ApiImplicitParams({@ApiImplicitParam(name = "receiverId", value = "用户phoneId", dataType = "String", paramType = "query")})
+    @GetMapping("/getMessageList")
+    public R<List<LifeMessageVo>> getMessageList(@RequestParam String receiverId) throws Exception {
+        log.info("LifeMessageController.getMessageList?receiverId={}", receiverId);
+        return R.data(lifeMessageService.getMessageList(receiverId));
+    }
+
+}

+ 2 - 4
alien-store/src/main/java/shop/alien/store/controller/PlatformLifeUserController.java

@@ -9,12 +9,10 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import shop.alien.entity.result.R;
-import shop.alien.entity.store.vo.LifeUserOrderVo;
+import shop.alien.entity.store.LifeUser;
 import shop.alien.entity.store.vo.LifeUserVo;
 import shop.alien.store.service.PlatformLifeUserService;
 
-import java.util.List;
-
 @Api(tags = {"平台-用户管理"})
 @Slf4j
 @RestController
@@ -42,7 +40,7 @@ public class PlatformLifeUserController {
     @ApiOperationSupport(order = 2)
     @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "用户id", dataType = "Integer", paramType = "query", required = true)})
     @GetMapping("/getUserById")
-    public R<List<LifeUserOrderVo>> getUserById(Integer id) {
+    public R<LifeUser> getUserById(Integer id) {
         log.info("PlatformLifeUserController.getUserById?id={}", id);
         return R.data(platformLifeUserService.getUserById(id));
     }

+ 9 - 0
alien-store/src/main/java/shop/alien/store/controller/StoreInfoController.java

@@ -10,6 +10,7 @@ import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartRequest;
 import shop.alien.entity.result.R;
+import shop.alien.entity.store.StoreBusinessInfo;
 import shop.alien.entity.store.StoreImg;
 import shop.alien.entity.store.StoreInfo;
 import shop.alien.entity.store.StoreInfoDraft;
@@ -599,6 +600,14 @@ public class StoreInfoController {
         return R.data(storeInfoService.getDecorationDetail(id));
     }
 
+    @ApiOperation(value = "门店装修-门店营业时间")
+    @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "门店id", dataType = "Long", paramType = "query", required = true)})
+    @GetMapping("/getStoreInfoBusinessHours")
+    public R<List<StoreBusinessInfo>> getStoreInfoBusinessHours(Integer id) {
+        log.info("StoreInfoController.getStoreInfoBusinessHours?id={}", id);
+        return R.data(storeInfoService.getStoreInfoBusinessHours(id));
+    }
+
     @ApiOperation(value = "门店装修-续签合同")
     @PostMapping("/uploadRenewalContract")
     public R<String> uploadRenewalContract(@RequestBody List<StoreImg> storeImgList) {

+ 5 - 2
alien-store/src/main/java/shop/alien/store/controller/StoreUserController.java

@@ -114,8 +114,11 @@ public class StoreUserController {
     @GetMapping("/changePhoneVerification")
     public R<Map<String, String>> changePhoneVerification(String phone, String oldPassword, String verificationCode) {
         log.info("StoreUserController.changePhoneVerification?phone={}&oldPassword={}&verificationCode={}", phone,  oldPassword,  verificationCode);
-        return R.data(storeUserService.changePhoneVerification(phone, oldPassword, verificationCode));
-
+        try {
+            return R.data(storeUserService.changePhoneVerification(phone, oldPassword, verificationCode));
+        } catch (Exception e) {
+            return R.fail(e.getMessage());
+        }
     }
 
     @ApiOperation("修改用户信息")

+ 63 - 0
alien-store/src/main/java/shop/alien/store/service/ActivityConfigService.java

@@ -0,0 +1,63 @@
+package shop.alien.store.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import shop.alien.entity.store.ActivitySignInConfig;
+import shop.alien.entity.store.ActivitySignInReward;
+import shop.alien.entity.store.vo.ActivityConfigVo;
+import shop.alien.entity.store.vo.ActivityPeriodVo;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author zhangchen
+ * @version 1.0
+ * @date 2025/09/05 10:00
+ */
+public interface ActivityConfigService extends IService<ActivitySignInConfig> {
+    /**
+     * 创建签到活动
+     */
+    ActivityConfigVo createOrUpdateActivity(ActivityConfigVo configVO);
+
+    /**
+     * 更新签到活动
+     */
+    ActivitySignInConfig updateActivity(Long id, ActivityConfigVo configVO);
+
+    /**
+     * 获取活动详情
+     */
+    ActivityConfigVo getActivitySignInConfigById(Long id);
+
+    /**
+     * 获取活动列表
+     */
+    IPage<ActivitySignInConfig> getActivityList(int pageNum, int pageSize, String activityName, Integer status);
+
+    /**
+     * 更新活动状态
+     */
+    boolean updateActivityStatus(Integer id, Integer status);
+
+    /**
+     * 保存活动奖励配置
+     */
+    void saveActivityRewards(Long activityId, List<ActivitySignInReward> rewards);
+
+    /**
+     * 删除活动
+     */
+    boolean deleteActivity(Integer id);
+
+    /**
+     * 获取默认方案
+     */
+    ActivityConfigVo getDefaultActivitySignInConfigById();
+
+    /**
+     * 校验时间段重复
+     */
+    List<ActivityPeriodVo> checkOverlapTime(String startTime, String endTime);
+}

+ 30 - 9
alien-store/src/main/java/shop/alien/store/service/LifeBrowseRecordService.java

@@ -3,16 +3,14 @@ package shop.alien.store.service;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import lombok.RequiredArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 import shop.alien.entity.store.LifeBrowseRecord;
 import shop.alien.mapper.LifeBrowseRecordMapper;
 
 import java.time.LocalDate;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -29,8 +27,10 @@ public class LifeBrowseRecordService {
 
         LambdaQueryWrapper<LifeBrowseRecord> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(LifeBrowseRecord::getUserId, record.getUserId());
-        wrapper.eq(LifeBrowseRecord::getStoreId, record.getStoreId());
-        wrapper.eq(LifeBrowseRecord::getLiulanDate, now.toString());
+        wrapper.eq(record.getStoreId() != null, LifeBrowseRecord::getStoreId, record.getStoreId());
+        wrapper.eq(record.getCouponId() != null, LifeBrowseRecord::getCouponId, record.getCouponId());
+        wrapper.eq(record.getDynamicsId() != null, LifeBrowseRecord::getDynamicsId, record.getDynamicsId());
+//        wrapper.eq(LifeBrowseRecord::getLiulanDate, now.toString());
         List<LifeBrowseRecord> recordList = lifeBrowseRecordMapper.selectList(wrapper);
 
         if (!CollectionUtils.isEmpty(recordList)) {
@@ -42,8 +42,15 @@ public class LifeBrowseRecordService {
         return lifeBrowseRecordMapper.insert(record);
     }
 
-    public Map<String, List<Map<String, Object>>> getBrowseRecord(String userId) {
-        List<Map<String, Object>> list = lifeBrowseRecordMapper.getBrowseRecordByUserId(userId);
+    public Map<String, List<Map<String, Object>>> getBrowseRecord(String userId, String type) {
+        List<Map<String, Object>> list = new ArrayList<>();
+        if("1".equals(type)){
+            list = lifeBrowseRecordMapper.getBrowseRecordByUserId(userId);
+        }else if("2".equals(type)){
+            list = lifeBrowseRecordMapper.getGroupBuyBrowseRecordByUserId(userId);
+        }else if("3".equals(type)){
+            list = lifeBrowseRecordMapper.getDynamicsBrowseRecordByUserId(userId);
+        }
         Map<String, List<Map<String, Object>>> listMap = new HashMap<>();
         if (!CollectionUtils.isEmpty(list)) {
             listMap = list.stream().collect(Collectors.groupingBy(
@@ -53,10 +60,24 @@ public class LifeBrowseRecordService {
         return listMap;
     }
 
-    public int clearBrowseRecord(String userId) {
+    public int clearBrowseRecord(String userId, String recordId,String type) {
+        if(StringUtils.isNotBlank(recordId)){
+            return lifeBrowseRecordMapper.deleteById(recordId);
+        }
         LambdaUpdateWrapper<LifeBrowseRecord> wrapper = new LambdaUpdateWrapper<>();
         wrapper.eq(LifeBrowseRecord::getUserId, userId);
         wrapper.set(LifeBrowseRecord::getDeleteFlag, 1);
+        switch (type){
+            case "1":
+                wrapper.isNotNull(LifeBrowseRecord::getStoreId);
+                break;
+            case "2":
+                wrapper.isNotNull(LifeBrowseRecord::getCouponId);
+                break;
+            case "3":
+                wrapper.isNotNull(LifeBrowseRecord::getDynamicsId);
+                break;
+        }
         return lifeBrowseRecordMapper.update(null, wrapper);
     }
 }

+ 6 - 2
alien-store/src/main/java/shop/alien/store/service/LifeGroupBuyCountService.java

@@ -1,22 +1,26 @@
 package shop.alien.store.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.springframework.web.bind.annotation.RequestParam;
 import shop.alien.entity.store.LifeGroupBuyCount;
 import shop.alien.entity.store.vo.LifeGroupBuyCountDateVo;
 import shop.alien.entity.store.vo.LifeGroupBuyCountVo;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 团购统计
  */
 public interface LifeGroupBuyCountService extends IService<LifeGroupBuyCount> {
 
-    void insertGroupBuyCount(LifeGroupBuyCount lifeGroupBuyCount);
+    void insertGroupBuyCount(Integer storeId, Integer groupId, Integer userId, String countType);
 
-    List<LifeGroupBuyCountVo> getJysj(String storeId);
+    Map<String, LifeGroupBuyCountVo> getJysj(String storeId);
 
     List<LifeGroupBuyCountDateVo> getSphxzb(String storeId);
 
     List<LifeGroupBuyCountDateVo> getDpzbpm(String storeId);
+
+    void test();
 }

+ 13 - 2
alien-store/src/main/java/shop/alien/store/service/LifeUserOrderService.java

@@ -836,10 +836,21 @@ public class LifeUserOrderService extends ServiceImpl<LifeUserOrderMapper, LifeU
 
         // 提取SQL基础部分,避免重复定义
         String baseSql = "select DISTINCT ocm1.order_id from order_coupon_middle ocm1 where 1=1";
-
+        // TODO 应该可以直接判断总表
         if (!"-1".equals(orderStatus)) {
             // 非-1状态:直接添加状态条件
-            String sql = baseSql + " and ocm1.status = " + orderStatus;
+                String sql = baseSql + " and ocm1.status = " + orderStatus;
+            if("2".equals(orderStatus)){
+                // 已完成进行特殊处理,
+                sql = sql + " and ocm1.order_id not in (\n" +
+                        "\tselect\n" +
+                        "\tDISTINCT ocm2.order_id\n" +
+                        "from\n" +
+                        "\torder_coupon_middle ocm2\n" +
+                        "where\n" +
+                        "\t ocm2.status = 1\n" +
+                        "\t)";
+            }
             lifeUserOrderQueryWrapper.inSql("luo.id", sql);
         } else {
             // -1状态且storeId不为空时添加条件

+ 30 - 23
alien-store/src/main/java/shop/alien/store/service/LifeUserService.java

@@ -155,7 +155,9 @@ public class LifeUserService extends ServiceImpl<LifeUserMapper, LifeUser> {
                 tokenMap.put("userId", lifeUser.getId().toString());
                 tokenMap.put("userType", "user");
 //                userVo.setToken(JWTUtils1.createToken(tokenMap));
-                baseRedisService.setString("user_" + phoneNum, userVo.getToken());
+                String token = getToken(phoneNum, userVo.getUserName(), tokenMap);
+                userVo.setToken(token);
+                baseRedisService.setString("user_" + phoneNum, token);
                 return userVo;
             } else {
                 return null;
@@ -168,34 +170,39 @@ public class LifeUserService extends ServiceImpl<LifeUserMapper, LifeUser> {
             tokenMap.put("userName", user.getUserName());
             tokenMap.put("userId", user.getId().toString());
             tokenMap.put("userType", "user");
-            int effectiveTimeInt = Integer.parseInt(effectiveTime.substring(0, effectiveTime.length() - 1));
-            String effectiveTimeUnit = effectiveTime.substring(effectiveTime.length() - 1);
-            long effectiveTimeIntLong = 0L;
-            switch (effectiveTimeUnit) {
-                case "s": {
-                    effectiveTimeIntLong = effectiveTimeInt * 1000L;
-                    break;
-                }
-                case "m": {
-                    effectiveTimeIntLong = effectiveTimeInt * 60L * 1000L;
-                    break;
-                }
-                case "h": {
-                    effectiveTimeIntLong = effectiveTimeInt * 60L * 60L * 1000L;
-                    break;
-                }
-                case "d": {
-                    effectiveTimeIntLong = effectiveTimeInt * 24L * 60L * 60L * 1000L;
-                    break;
-                }
-            }
-            String token = JwtUtil.createJWT("user_" + phoneNum, user.getUserName(), JSONObject.toJSONString(tokenMap), effectiveTimeIntLong);
+            String token = getToken(phoneNum, user.getUserName(), tokenMap);
             userVo.setToken(token);
             baseRedisService.setString("user_" + phoneNum, token);
             return userVo;
         }
     }
 
+    private String getToken(String phoneNum, String userVo, Map<String, String> tokenMap) {
+        int effectiveTimeInt = Integer.parseInt(effectiveTime.substring(0, effectiveTime.length() - 1));
+        String effectiveTimeUnit = effectiveTime.substring(effectiveTime.length() - 1);
+        long effectiveTimeIntLong = 0L;
+        switch (effectiveTimeUnit) {
+            case "s": {
+                effectiveTimeIntLong = effectiveTimeInt * 1000L;
+                break;
+            }
+            case "m": {
+                effectiveTimeIntLong = effectiveTimeInt * 60L * 1000L;
+                break;
+            }
+            case "h": {
+                effectiveTimeIntLong = effectiveTimeInt * 60L * 60L * 1000L;
+                break;
+            }
+            case "d": {
+                effectiveTimeIntLong = effectiveTimeInt * 24L * 60L * 60L * 1000L;
+                break;
+            }
+        }
+        String token = JwtUtil.createJWT("user_" + phoneNum, userVo, JSONObject.toJSONString(tokenMap), effectiveTimeIntLong);
+        return token;
+    }
+
     public LifeUser getUserByPhone(String phoneNum) {
         LambdaQueryWrapper<LifeUser> lambdaQueryWrapper = new LambdaQueryWrapper<>();
         lambdaQueryWrapper.eq(LifeUser::getUserPhone, phoneNum);

+ 11 - 0
alien-store/src/main/java/shop/alien/store/service/PlatformLifeMessageService.java

@@ -0,0 +1,11 @@
+package shop.alien.store.service;
+
+import org.springframework.web.bind.annotation.RequestParam;
+import shop.alien.entity.store.vo.LifeMessageVo;
+
+import java.util.List;
+
+public interface PlatformLifeMessageService {
+
+    List<LifeMessageVo> getMessageList(String receiverId) throws Exception;
+}

+ 2 - 4
alien-store/src/main/java/shop/alien/store/service/PlatformLifeUserService.java

@@ -1,15 +1,13 @@
 package shop.alien.store.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import shop.alien.entity.store.vo.LifeUserOrderVo;
+import shop.alien.entity.store.LifeUser;
 import shop.alien.entity.store.vo.LifeUserVo;
 
-import java.util.List;
-
 public interface PlatformLifeUserService {
 
     IPage<LifeUserVo> getUserList(Integer page, Integer size, String name, String phone);
 
-    List<LifeUserOrderVo> getUserById(Integer id);
+    LifeUser getUserById(Integer id);
 
 }

+ 6 - 0
alien-store/src/main/java/shop/alien/store/service/StoreInfoService.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.multipart.MultipartRequest;
 import shop.alien.entity.result.R;
+import shop.alien.entity.store.StoreBusinessInfo;
 import shop.alien.entity.store.StoreImg;
 import shop.alien.entity.store.StoreInfo;
 import shop.alien.entity.store.StoreInfoDraft;
@@ -39,6 +40,11 @@ public interface StoreInfoService extends IService<StoreInfo> {
     StoreMainInfoVo getDecorationDetail(Integer id);
 
     /**
+     *
+     */
+    List<StoreBusinessInfo>  getStoreInfoBusinessHours(Integer id);
+
+    /**
      * 门店信息-修改后展示
      *
      * @param id 门店id

+ 303 - 0
alien-store/src/main/java/shop/alien/store/service/impl/ActivityConfigServiceImpl.java

@@ -0,0 +1,303 @@
+package shop.alien.store.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+import shop.alien.entity.store.ActivityPeriod;
+import shop.alien.entity.store.ActivitySignInConfig;
+import shop.alien.entity.store.ActivitySignInReward;
+import shop.alien.entity.store.vo.ActivityConfigVo;
+import shop.alien.entity.store.vo.ActivityPeriodVo;
+import shop.alien.mapper.ActivityPeriodMapper;
+import shop.alien.mapper.ActivitySignRewardMapper;
+import shop.alien.store.service.ActivityConfigService;
+import shop.alien.mapper.ActivitySignInConfigMapper;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+
+/**
+ *
+ * 签到类型活动服务
+ * @author zhangchen
+ * @since 2025-9-8
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class ActivityConfigServiceImpl extends ServiceImpl<ActivitySignInConfigMapper, ActivitySignInConfig> implements ActivityConfigService {
+
+    private final ActivitySignInConfigMapper activitySignInConfigMapper;
+    private final ActivitySignRewardMapper activitySignRewardMapper;
+    private final ActivityPeriodMapper activityPeriodMapper;
+
+    @Override
+    public ActivityConfigVo createOrUpdateActivity(ActivityConfigVo configVO) {
+        log.info("创建活动开始执行,请求参数: {}", configVO);
+        if(configVO == null) {
+            log.error("创建活动configVO为空。");
+            configVO = new ActivityConfigVo();
+            configVO.setErrorMessage("参数为空");
+            return configVO;
+        }
+        List<ActivitySignInReward> activitySignInRewardList = configVO.getRewards();
+        if(CollectionUtils.isEmpty(activitySignInRewardList)) {
+            log.error("创建活动奖励配置为空。");
+            configVO.setErrorMessage("活动奖励配置为空");
+            return configVO;
+        }
+
+        // 校验是否存在重复时间段的方案
+        List<ActivityPeriod> activityPeriodList = configVO.getActivityPeriodList();
+        if(!CollectionUtils.isEmpty(activityPeriodList)){
+            boolean checkPeriodResult= checkPeriodTime(activityPeriodList);
+            if(!checkPeriodResult){
+                configVO.setErrorMessage("方案时间重叠");
+                return configVO;
+            }
+        }
+
+        ActivitySignInConfig activitySignInConfig = new ActivitySignInConfig();
+
+        if(configVO.getId() == null) {
+            if(configVO.getPlanConfigType()!=null && configVO.getPlanConfigType() == 1){
+                // 创建默认活动,先check是否已经存在默认数据
+                LambdaQueryWrapper<ActivitySignInConfig> activitySignInConfigLambdaQueryWrapper = new LambdaQueryWrapper<>();
+                activitySignInConfigLambdaQueryWrapper.eq(ActivitySignInConfig::getDeleteFlag, 0);
+                activitySignInConfigLambdaQueryWrapper.eq(ActivitySignInConfig::getPlanConfigType, 1);
+                int count = activitySignInConfigMapper.selectCount(activitySignInConfigLambdaQueryWrapper);
+                if(count > 0){
+                    log.error("已经存在默认方案,请不要重复创建。");
+                    configVO.setErrorMessage("已经存在默认方案,请不要重复创建。");
+                    return configVO;
+                }
+            }
+
+            //创建活动操作
+            BeanUtils.copyProperties(configVO, activitySignInConfig);
+            int configInsertResult = activitySignInConfigMapper.insert(activitySignInConfig);
+            if(configInsertResult == 0){
+                //插入活动配置数据失败,返回
+                log.error("插入活动配置数据失败, {}", configVO);
+                configVO.setErrorMessage("插入活动配置数据失败");
+                return configVO;
+            }
+
+            // 创建时间段数据
+            if(!CollectionUtils.isEmpty(activityPeriodList)) {
+                activityPeriodList.forEach(item -> {
+                    item.setActivityId(activitySignInConfig.getId());
+                    activityPeriodMapper.insert(item);
+                });
+            }
+
+            // 创建活动奖励记录
+            activitySignInRewardList.forEach(item -> {
+                item.setActivityId(activitySignInConfig.getId());
+                activitySignRewardMapper.insert(item);
+            });
+        } else {
+            //更新操作
+            BeanUtils.copyProperties(configVO, activitySignInConfig);
+            int configUpdateResult =  activitySignInConfigMapper.updateById(activitySignInConfig);
+            if(configUpdateResult == 0){
+                //更新活动配置数据失败,返回
+                log.error("更新活动配置数据失败, {}", configVO);
+                configVO.setErrorMessage("更新活动配置数据失败");
+                return configVO;
+            }
+            int activityId = configVO.getId();
+
+            //更新时间段信息
+            LambdaQueryWrapper<ActivityPeriod> deletePeriodWrapper = new LambdaQueryWrapper<>();
+            deletePeriodWrapper.eq(ActivityPeriod::getActivityId, configVO.getId());
+            activityPeriodMapper.delete(deletePeriodWrapper);
+            if(!CollectionUtils.isEmpty(activityPeriodList)){
+                activityPeriodList.forEach(item -> {
+                    item.setActivityId(activityId);
+                    activityPeriodMapper.insert(item);
+                });
+            }
+
+            //更新活动奖励
+            LambdaQueryWrapper<ActivitySignInReward> deleteRewardWrapper = new LambdaQueryWrapper<>();
+            deleteRewardWrapper.eq(ActivitySignInReward::getActivityId, configVO.getId());
+            activitySignRewardMapper.delete(deleteRewardWrapper);
+            if(!CollectionUtils.isEmpty(activitySignInRewardList)){
+                activitySignInRewardList.forEach(item -> {
+                item.setActivityId(activityId);
+                activitySignRewardMapper.insert(item);
+            });
+
+            }
+        }
+        return configVO;
+    }
+
+    private boolean  checkPeriodTime(List<ActivityPeriod> activityPeriodList){
+        if (activityPeriodList == null || activityPeriodList.size() <= 1) {
+            return true;
+        }
+
+        // 按开始时间排序
+        List<ActivityPeriod> sorted = new ArrayList<>(activityPeriodList);
+        sorted.sort(Comparator.comparing(ActivityPeriod::getStartTime));
+        for (int i = 0; i < sorted.size() - 1; i++) {
+            ActivityPeriod current = sorted.get(i);
+            ActivityPeriod next = sorted.get(i + 1);
+
+            // 检查重叠条件:当前结束时间 > 下一个开始时间
+            if (current.getEndTime().compareTo(next.getStartTime()) > 0) {
+                return false; // 存在重叠
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public ActivitySignInConfig updateActivity(Long id, ActivityConfigVo configVO) {
+        return null;
+    }
+
+    @Override
+    public ActivityConfigVo getActivitySignInConfigById(Long id) {
+        ActivityConfigVo activityConfigVO = new ActivityConfigVo();
+        if(id == null || id == 0){
+            //id为空
+            return activityConfigVO;
+        }
+
+        // 查询签到活动配置信息
+        ActivitySignInConfig activitySignInConfig = activitySignInConfigMapper.selectById(id);
+        if(activitySignInConfig == null){
+            return activityConfigVO;
+        }
+        BeanUtils.copyProperties(activitySignInConfig, activityConfigVO);
+
+        // 查询活动奖励列表
+        LambdaQueryWrapper<ActivitySignInReward> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(ActivitySignInReward::getActivityId, id);
+        wrapper.eq(ActivitySignInReward::getDeleteFlag,0);
+        List <ActivitySignInReward> activitySignInRewardList = activitySignRewardMapper.selectList(wrapper);
+        if(!CollectionUtils.isEmpty(activitySignInRewardList)){
+            activityConfigVO.setRewards(activitySignInRewardList);
+        }
+        // 查询活动时间段列表
+        LambdaQueryWrapper<ActivityPeriod> activityPeriodWrapper = new LambdaQueryWrapper<>();
+        activityPeriodWrapper.eq(ActivityPeriod::getActivityId, id);
+        activityPeriodWrapper.eq(ActivityPeriod::getDeleteFlag,0);
+        List <ActivityPeriod> activityPeriodList = activityPeriodMapper.selectList(activityPeriodWrapper);
+        if(!CollectionUtils.isEmpty(activityPeriodList)){
+            activityConfigVO.setActivityPeriodList(activityPeriodList);
+        }
+
+        return activityConfigVO;
+    }
+
+    @Override
+    public ActivityConfigVo getDefaultActivitySignInConfigById() {
+        ActivityConfigVo activityConfigVO = new ActivityConfigVo();
+
+        // 查询签到活动配置信息
+        LambdaQueryWrapper<ActivitySignInConfig> activitySignInConfigLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        activitySignInConfigLambdaQueryWrapper.eq(ActivitySignInConfig::getDeleteFlag, 0);
+        activitySignInConfigLambdaQueryWrapper.eq(ActivitySignInConfig::getPlanConfigType,1);
+        ActivitySignInConfig activitySignInConfig = activitySignInConfigMapper.selectOne(activitySignInConfigLambdaQueryWrapper);
+        if(activitySignInConfig == null){
+            return activityConfigVO;
+        }
+        BeanUtils.copyProperties(activitySignInConfig, activityConfigVO);
+
+        // 查询活动奖励列表
+        LambdaQueryWrapper<ActivitySignInReward> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(ActivitySignInReward::getActivityId, activitySignInConfig.getId());
+        wrapper.eq(ActivitySignInReward::getDeleteFlag,0);
+        List <ActivitySignInReward> activitySignInRewardList = activitySignRewardMapper.selectList(wrapper);
+        if(!CollectionUtils.isEmpty(activitySignInRewardList)){
+            activityConfigVO.setRewards(activitySignInRewardList);
+        }
+        // 查询活动时间段列表
+        LambdaQueryWrapper<ActivityPeriod> activityPeriodWrapper = new LambdaQueryWrapper<>();
+        activityPeriodWrapper.eq(ActivityPeriod::getActivityId, activitySignInConfig.getId());
+        activityPeriodWrapper.eq(ActivityPeriod::getDeleteFlag,0);
+        List <ActivityPeriod> activityPeriodList = activityPeriodMapper.selectList(activityPeriodWrapper);
+        if(!CollectionUtils.isEmpty(activityPeriodList)){
+            activityConfigVO.setActivityPeriodList(activityPeriodList);
+        }
+
+        return activityConfigVO;
+    }
+
+    @Override
+    public List<ActivityPeriodVo> checkOverlapTime(String startTime, String endTime) {
+        List<ActivityPeriodVo> activityPeriodVoList = new ArrayList<>();
+        if(startTime != null && endTime != null){
+
+            activityPeriodVoList =  activityPeriodMapper.getActivityPeriodList(startTime, endTime);
+        }
+        return activityPeriodVoList;
+    }
+
+    @Override
+    public IPage<ActivitySignInConfig> getActivityList(int pageNum, int pageSize, String activityName, Integer status) {
+        IPage<ActivitySignInConfig> iPage = new Page<>(pageNum, pageSize);
+        LambdaQueryWrapper<ActivitySignInConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+        if(StringUtils.isNotBlank(activityName)){
+            lambdaQueryWrapper.like(ActivitySignInConfig::getActivityName, activityName);
+        }
+        if(status != null){
+            lambdaQueryWrapper.eq(ActivitySignInConfig::getStatus, status);
+        }
+        lambdaQueryWrapper.eq(ActivitySignInConfig::getDeleteFlag, 0);
+        lambdaQueryWrapper.eq(ActivitySignInConfig::getPlanConfigType, 2);
+        return activitySignInConfigMapper.selectPage(iPage, lambdaQueryWrapper);
+    }
+
+    @Override
+    public boolean updateActivityStatus(Integer id, Integer status) {
+        if(id == null || status == null){
+            return false;
+        }
+        ActivitySignInConfig activitySignInConfig = new ActivitySignInConfig();
+        activitySignInConfig.setId(id);
+        activitySignInConfig.setStatus(status);
+        int result = activitySignInConfigMapper.updateById(activitySignInConfig);
+        return result > 0;
+    }
+
+    @Override
+    public void saveActivityRewards(Long activityId, List<ActivitySignInReward> rewards) {
+
+    }
+
+    @Override
+    public boolean deleteActivity(Integer id) {
+        if(id != null){
+            // 删除活动信息
+            int configResult = activitySignInConfigMapper.deleteById(id);
+            if(configResult == 0){
+                return false;
+            }
+
+            // 删除活动奖励信息
+            LambdaQueryWrapper<ActivitySignInReward> activitySignInRewardWrapper = new LambdaQueryWrapper<>();
+            activitySignInRewardWrapper.eq(ActivitySignInReward::getActivityId, id);
+            activitySignRewardMapper.delete(activitySignInRewardWrapper);
+
+            // 删除活动时间信息
+            LambdaQueryWrapper<ActivityPeriod> activityPeriodLambdaQueryWrapper = new LambdaQueryWrapper<>();
+            activityPeriodLambdaQueryWrapper.eq(ActivityPeriod::getActivityId, id);
+            activityPeriodMapper.delete(activityPeriodLambdaQueryWrapper);
+        }
+        return true;
+    }
+}

+ 1 - 1
alien-store/src/main/java/shop/alien/store/service/impl/LifeCouponServiceImpl.java

@@ -274,11 +274,11 @@ public class LifeCouponServiceImpl extends ServiceImpl<LifeCouponMapper, LifeCou
             // 计算总退款金额(orderCouponMiddle金额按实际的存)
             BigDecimal refundAmount = couponMiddleList.stream().filter(x -> x.getStatus() == OrderStatusEnum.REFUND.getStatus()).map(x -> x.getPrice()).reduce(BigDecimal.ZERO, BigDecimal::add);
             StoreInfo storeInfo = storeInfoMapper.selectOne(new LambdaQueryWrapper<StoreInfo>().eq(StoreInfo::getId, lifeUserOrder.getStoreId()));
-            // TODO 抽成比例应该从商户里
             BigDecimal amounts = new BigDecimal(lifeUserOrder.getFinalPrice()).multiply(new BigDecimal(100)).subtract(refundAmount);
             // 先将抽成比例转换为BigDecimal,再除以100
             BigDecimal commissionRate = new BigDecimal(storeInfo.getCommissionRate())
                     .divide(new BigDecimal(100));
+            // 感觉有问题。HALF_UP有问题。
             BigDecimal commission = amounts.multiply(commissionRate).setScale(0, RoundingMode.HALF_UP);
             BigDecimal money = amounts.subtract(commission);
 

+ 83 - 18
alien-store/src/main/java/shop/alien/store/service/impl/LifeGroupBuyCountServiceImpl.java

@@ -10,18 +10,19 @@ import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import shop.alien.entity.store.LifeGroupBuyCount;
+import shop.alien.entity.store.LifeGroupBuyMain;
 import shop.alien.entity.store.LifeUserOrder;
 import shop.alien.entity.store.vo.LifeGroupBuyCountDateVo;
 import shop.alien.entity.store.vo.LifeGroupBuyCountVo;
 import shop.alien.mapper.LifeGroupBuyCountMapper;
+import shop.alien.mapper.LifeGroupBuyMainMapper;
 import shop.alien.mapper.LifeUserOrderMapper;
 import shop.alien.store.service.LifeGroupBuyCountService;
 
 import java.math.BigDecimal;
+import java.math.MathContext;
 import java.math.RoundingMode;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -37,33 +38,42 @@ public class LifeGroupBuyCountServiceImpl extends ServiceImpl<LifeGroupBuyCountM
     @Autowired
     private LifeUserOrderMapper lifeUserOrderMapper;
 
+    @Autowired
+    private LifeGroupBuyMainMapper lifeGroupBuyMainMapper;
+
     @Override
-    public void insertGroupBuyCount(LifeGroupBuyCount lifeGroupBuyCount) {
+    public void insertGroupBuyCount(Integer storeId, Integer groupId, Integer userId, String countType) {
         LambdaQueryWrapper<LifeGroupBuyCount> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(LifeGroupBuyCount::getCountType, lifeGroupBuyCount.getCountType())
-                .eq(LifeGroupBuyCount::getStoreId, lifeGroupBuyCount.getStoreId())
-                .eq(LifeGroupBuyCount::getGroupId, lifeGroupBuyCount.getGroupId())
-                .eq(LifeGroupBuyCount::getUserId, lifeGroupBuyCount.getUserId())
+        queryWrapper.eq(LifeGroupBuyCount::getCountType, countType)
+                .eq(LifeGroupBuyCount::getStoreId, storeId)
+                .eq(LifeGroupBuyCount::getGroupId, groupId)
+                .eq(LifeGroupBuyCount::getUserId, userId)
                 .eq(LifeGroupBuyCount::getCountDate, DateUtils.format(new Date(), "yyyy-MM-dd"));
         Integer count = lifeGroupBuyCountMapper.selectCount(queryWrapper);
         if (count > 0) {
             List<LifeGroupBuyCount> lifeGroupBuyCounts = lifeGroupBuyCountMapper.selectList(queryWrapper);
             LambdaUpdateWrapper<LifeGroupBuyCount> updateWrapper = new LambdaUpdateWrapper<>();
-            updateWrapper.eq(LifeGroupBuyCount::getCountType, lifeGroupBuyCount.getCountType())
-                    .eq(LifeGroupBuyCount::getStoreId, lifeGroupBuyCount.getStoreId())
-                    .eq(LifeGroupBuyCount::getGroupId, lifeGroupBuyCount.getGroupId())
-                    .eq(LifeGroupBuyCount::getUserId, lifeGroupBuyCount.getUserId())
+            updateWrapper.eq(LifeGroupBuyCount::getCountType, countType)
+                    .eq(LifeGroupBuyCount::getStoreId, storeId)
+                    .eq(LifeGroupBuyCount::getGroupId, groupId)
+                    .eq(LifeGroupBuyCount::getUserId, userId)
                     .eq(LifeGroupBuyCount::getCountDate, DateUtils.format(new Date(), "yyyy-MM-dd"))
                     .set(LifeGroupBuyCount::getCountNum, lifeGroupBuyCounts.get(0).getCountNum() + 1);
-            lifeGroupBuyCountMapper.update(null, queryWrapper);
+            lifeGroupBuyCountMapper.update(null, updateWrapper);
         } else {
+            LifeGroupBuyCount lifeGroupBuyCount = new LifeGroupBuyCount();
+            lifeGroupBuyCount.setCountDate(new Date());
+            lifeGroupBuyCount.setCountType(countType);
+            lifeGroupBuyCount.setStoreId(storeId);
+            lifeGroupBuyCount.setGroupId(groupId);
+            lifeGroupBuyCount.setUserId(userId);
             lifeGroupBuyCount.setCountNum(1);
             lifeGroupBuyCountMapper.insert(lifeGroupBuyCount);
         }
     }
 
     @Override
-    public List<LifeGroupBuyCountVo> getJysj(String storeId) {
+    public Map<String, LifeGroupBuyCountVo> getJysj(String storeId) {
         String today = DateUtils.format(new Date(), "yyyy-MM-dd");
         String yesterday = DateUtils.format(shop.alien.util.common.DateUtils.calcDays(new Date(), -1), "yyyy-MM-dd");
 
@@ -108,27 +118,82 @@ public class LifeGroupBuyCountServiceImpl extends ServiceImpl<LifeGroupBuyCountM
         countVo.setYesCountNum(yesterdayOrderNum.toString());
         todayList.add(countVo);
         bfb(todayList);
-        return todayList.stream().sorted(Comparator.comparing(LifeGroupBuyCountVo::getCountType)).collect(Collectors.toList());
+
+        Map<String, LifeGroupBuyCountVo> map = new HashMap<>();
+        LifeGroupBuyCountVo tcfwl = new LifeGroupBuyCountVo();
+        tcfwl.setCountType("0");
+        LifeGroupBuyCountVo tcfks = new LifeGroupBuyCountVo();
+        tcfks.setCountType("1");
+        LifeGroupBuyCountVo sjtcs = new LifeGroupBuyCountVo();
+        sjtcs.setCountType("2");
+        LifeGroupBuyCountVo xjtcs = new LifeGroupBuyCountVo();
+        xjtcs.setCountType("3");
+        LifeGroupBuyCountVo sfrs = new LifeGroupBuyCountVo();
+        sfrs.setCountType("4");
+        map.put("tcfwl", tcfwl);
+        map.put("tcfks", tcfks);
+        map.put("sjtcs", sjtcs);
+        map.put("xjtcs", xjtcs);
+        map.put("sfrs", sfrs);
+        todayList.stream().filter(item -> "0".equals(item.getCountType())).findFirst().ifPresent(item -> map.put("tcfwl", item));
+        todayList.stream().filter(item -> "1".equals(item.getCountType())).findFirst().ifPresent(item -> map.put("tcfks", item));
+        todayList.stream().filter(item -> "2".equals(item.getCountType())).findFirst().ifPresent(item -> map.put("sjtcs", item));
+        todayList.stream().filter(item -> "3".equals(item.getCountType())).findFirst().ifPresent(item -> map.put("xjtcs", item));
+        todayList.stream().filter(item -> "4".equals(item.getCountType())).findFirst().ifPresent(item -> map.put("sfrs", item));
+        return map;
     }
 
     @Override
     public List<LifeGroupBuyCountDateVo> getSphxzb(String storeId) {
-        return lifeGroupBuyCountMapper.selectSphxzbListByStoreId(storeId, DateUtils.format(new Date(), "yyyy-MM-dd"), DateUtils.format(shop.alien.util.common.DateUtils.calcDays(new Date(), -7), "yyyy-MM-dd"));
+        List<LifeGroupBuyCountDateVo> lifeGroupBuyCountDateVos = lifeGroupBuyCountMapper.selectSphxzbListByStoreId(storeId, DateUtils.format(shop.alien.util.common.DateUtils.calcDays(new Date(), -6), "yyyy-MM-dd"), DateUtils.format(new Date(), "yyyy-MM-dd"));
+        lifeGroupBuyCountDateVos.forEach(i -> i.setCountDate(DateUtils.format(DateUtils.parseDate(i.getCountDate()), "MM-dd")));
+        return lifeGroupBuyCountDateVos;
     }
 
     @Override
     public List<LifeGroupBuyCountDateVo> getDpzbpm(String storeId) {
         List<LifeGroupBuyCountDateVo> lifeGroupBuyCountDateVos = lifeGroupBuyCountMapper.selectDpzbpmListByStoreId(storeId);
         for (LifeGroupBuyCountDateVo lifeGroupBuyCountDateVo : lifeGroupBuyCountDateVos) {
-            lifeGroupBuyCountDateVo.setRjfws(StringUtils.isNotEmpty(lifeGroupBuyCountDateVo.getSpfks()) ? new BigDecimal(lifeGroupBuyCountDateVo.getSpfwl()).divide(new BigDecimal(lifeGroupBuyCountDateVo.getSpfks()), 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)) + "%" : "0.0%");
+            lifeGroupBuyCountDateVo.setRjfws(StringUtils.isNotEmpty(lifeGroupBuyCountDateVo.getSpfks()) ? (new BigDecimal(lifeGroupBuyCountDateVo.getSpfwl()).divide(new BigDecimal(lifeGroupBuyCountDateVo.getSpfks()), 0, RoundingMode.HALF_UP)).toString() : "0");
             lifeGroupBuyCountDateVo.setScl(StringUtils.isNotEmpty(lifeGroupBuyCountDateVo.getSpfks()) ? new BigDecimal(lifeGroupBuyCountDateVo.getSpscl()).divide(new BigDecimal(lifeGroupBuyCountDateVo.getSpfks()), 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)) + "%" : "0.0%");
         }
         return lifeGroupBuyCountDateVos;
     }
 
+    @Override
+    public void test() {
+        List<LifeGroupBuyCount> list = new ArrayList<>();
+        LambdaQueryWrapper<LifeGroupBuyMain> sjQuery = new LambdaQueryWrapper<>();
+        sjQuery.eq(LifeGroupBuyMain::getStatus, "5").eq(LifeGroupBuyMain::getDeleteFlag, 0).eq(LifeGroupBuyMain::getGroupType, 1);
+        Map<String, List<LifeGroupBuyMain>> sjCollect = lifeGroupBuyMainMapper.selectList(sjQuery).stream().collect(Collectors.groupingBy(LifeGroupBuyMain::getStoreId));
+        for (String s : sjCollect.keySet()) {
+            LifeGroupBuyCount sj = new LifeGroupBuyCount();
+            sj.setStoreId(Integer.valueOf(sjCollect.get(s).get(0).getStoreId()));
+            sj.setCountType("2");
+            sj.setCountNum(sjCollect.get(s).size());
+            sj.setCountDate(new Date());
+            list.add(sj);
+        }
+
+        LambdaQueryWrapper<LifeGroupBuyMain> xjQuery = new LambdaQueryWrapper<>();
+        xjQuery.in(LifeGroupBuyMain::getStatus, "7", "8").eq(LifeGroupBuyMain::getDeleteFlag, 0).eq(LifeGroupBuyMain::getGroupType, 1);
+        Map<String, List<LifeGroupBuyMain>> xjCollect = lifeGroupBuyMainMapper.selectList(xjQuery).stream().collect(Collectors.groupingBy(LifeGroupBuyMain::getStoreId));
+        for (String s : xjCollect.keySet()) {
+            LifeGroupBuyCount xj = new LifeGroupBuyCount();
+            xj.setStoreId(Integer.valueOf(xjCollect.get(s).get(0).getStoreId()));
+            xj.setCountType("3");
+            xj.setCountNum(xjCollect.get(s).size());
+            xj.setCountDate(new Date());
+            list.add(xj);
+        }
+        if (ObjectUtils.isNotEmpty(list)) {
+            lifeGroupBuyCountMapper.insertList(list);
+        }
+    }
+
     private void bfb(List<LifeGroupBuyCountVo> list) {
         for (LifeGroupBuyCountVo item : list) {
-                item.setJqrBfb(StringUtils.isNotEmpty(item.getYesCountNum()) && !"0".equals(item.getYesCountNum()) ? new BigDecimal(item.getYesCountNum()).subtract(new BigDecimal(item.getCountNum())).divide(new BigDecimal(item.getYesCountNum()), 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)) + "%" : "0.0%");
+            item.setJqrBfb(StringUtils.isNotEmpty(item.getYesCountNum()) && !"0".equals(item.getYesCountNum()) ? new BigDecimal(item.getYesCountNum()).subtract(new BigDecimal(item.getCountNum())).divide(new BigDecimal(item.getYesCountNum()), 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%" : "0.00%");
         }
     }
 }

+ 32 - 0
alien-store/src/main/java/shop/alien/store/service/impl/LifeNoticeServiceImpl.java

@@ -8,13 +8,16 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.RequiredArgsConstructor;
+import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import shop.alien.entity.result.R;
 import shop.alien.entity.store.LifeNotice;
+import shop.alien.entity.store.LifeUserViolation;
 import shop.alien.entity.store.vo.*;
 import shop.alien.mapper.LifeMessageMapper;
 import shop.alien.mapper.LifeNoticeMapper;
+import shop.alien.mapper.LifeUserViolationMapper;
 import shop.alien.store.service.LifeNoticeService;
 
 import java.util.*;
@@ -28,6 +31,8 @@ public class LifeNoticeServiceImpl extends ServiceImpl<LifeNoticeMapper, LifeNot
 
     private final LifeMessageMapper lifeMessageMapper;
 
+    private final LifeUserViolationMapper lifeUserViolationMapper;
+
     @Override
     public R<IPage<LifeNoticeVo>> getNoticeList(int pageNum, int pageSize, String receiverId, int noticeType) {
         IPage<LifeNotice> ipage = new Page<>(pageNum, pageSize);
@@ -41,6 +46,7 @@ public class LifeNoticeServiceImpl extends ServiceImpl<LifeNoticeMapper, LifeNot
 
         List<String> senderIdList = new ArrayList<>();
         Map<String, List<String>> collect = new HashMap<>();
+        List<Integer> businessIdList = new ArrayList<>();
         if (CollectionUtil.isNotEmpty(lifeNoticeList)) {
             collect = lifeNoticeList.stream()
                     .map(LifeNotice::getSenderId)
@@ -51,6 +57,23 @@ public class LifeNoticeServiceImpl extends ServiceImpl<LifeNoticeMapper, LifeNot
                                     item -> item.split("_")[1],  // 提取每个分组中的第二部分
                                     Collectors.toList()
                             )));
+            businessIdList = lifeNoticeList.stream()
+                    .map(LifeNotice::getBusinessId)
+                    .collect(Collectors.toList());
+        }
+
+        List<LifeUserViolation> lifeUserViolationList = new ArrayList<>();
+        if(CollectionUtil.isNotEmpty(businessIdList)){
+            lifeUserViolationList = lifeUserViolationMapper.selectBatchIds(businessIdList);
+        }
+        Map<Integer,String> lifeUserViolationMap = new HashMap<>();
+        if(CollectionUtil.isNotEmpty(lifeUserViolationList)){
+            lifeUserViolationMap = lifeUserViolationList.stream()
+                    .collect(Collectors.toMap(
+                            LifeUserViolation::getId,
+                            LifeUserViolation::getReportContextType,
+                            (existing, replacement) -> existing
+                    ));
         }
 
 
@@ -72,6 +95,15 @@ public class LifeNoticeServiceImpl extends ServiceImpl<LifeNoticeMapper, LifeNot
             });
         }
 
+        for(LifeNoticeVo lifeNoticeVo : noticeVoList){
+            if(lifeNoticeVo!=null && lifeNoticeVo.getBusinessId() != null && lifeUserViolationMap.containsKey(lifeNoticeVo.getBusinessId())){
+                String reportContextType = lifeUserViolationMap.get(lifeNoticeVo.getBusinessId());
+                if(StringUtils.isNotBlank(reportContextType) && "1,2,3".contains(reportContextType)){
+                    lifeNoticeVo.setPlatformType("1");
+                }
+            }
+        }
+
         List<LifeNoticeVo> pageList = noticeVoList.stream()
                 .skip((pageNum - 1) * pageSize)
                 .limit(pageSize)

+ 32 - 27
alien-store/src/main/java/shop/alien/store/service/impl/LifeUserViolationServiceImpl.java

@@ -119,17 +119,19 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
                     webSocketProcess.sendMessage(lifeNotice.getReceiverId(), com.alibaba.fastjson2.JSONObject.from(websocketVo).toJSONString());
 
                     // 被举报人消息
-                    LifeNotice lifeNoticeReported = getLifeReportedNotice(lifeuserViolation);
-                    if (lifeNoticeReported != null) {
-                        lifeNoticeMapper.insert(lifeNoticeReported);
-                        WebSocketVo websocketVoReported = new WebSocketVo();
-                        websocketVoReported.setSenderId("system");
-                        websocketVoReported.setReceiverId(lifeNoticeReported.getReceiverId());
-                        websocketVoReported.setCategory("notice");
-                        websocketVoReported.setNoticeType("1");
-                        websocketVoReported.setIsRead(0);
-                        websocketVoReported.setText(com.alibaba.fastjson2.JSONObject.from(lifeNoticeReported).toJSONString());
-                        webSocketProcess.sendMessage(lifeNoticeReported.getReceiverId(), com.alibaba.fastjson2.JSONObject.from(websocketVoReported).toJSONString());
+                    if(StringUtils.isNotEmpty(lifeuserViolation.getReportContextType()) && "1,2,3".contains(lifeuserViolation.getReportContextType())){
+                        LifeNotice lifeNoticeReported = getLifeReportedNotice(lifeuserViolation);
+                        if (lifeNoticeReported != null) {
+                            lifeNoticeMapper.insert(lifeNoticeReported);
+                            WebSocketVo websocketVoReported = new WebSocketVo();
+                            websocketVoReported.setSenderId("system");
+                            websocketVoReported.setReceiverId(lifeNoticeReported.getReceiverId());
+                            websocketVoReported.setCategory("notice");
+                            websocketVoReported.setNoticeType("1");
+                            websocketVoReported.setIsRead(0);
+                            websocketVoReported.setText(com.alibaba.fastjson2.JSONObject.from(lifeNoticeReported).toJSONString());
+                            webSocketProcess.sendMessage(lifeNoticeReported.getReceiverId(), com.alibaba.fastjson2.JSONObject.from(websocketVoReported).toJSONString());
+                        }
                     }
                 return result;
             }
@@ -152,22 +154,9 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
         lifeNotice.setTitle("举报通知");
         JSONObject jsonObject = new JSONObject();
         String message = "平台已受理,感谢您的反馈!";
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        SimpleDateFormat simpleDateFormats = new SimpleDateFormat("yyyy-MM-dd");
-        String storeDate = simpleDateFormat.format(new Date());
+
         String reportContextType = lifeuserViolation.getReportContextType();
         String reportUserId = lifeuserViolation.getReportingUserId();
-        String reportedUserId = lifeuserViolation.getReportedUserId();
-        String storeOrUserName = "";
-        // 查询被举报用户信息
-
-        if ("1".equals(lifeuserViolation.getReportedUserType())) {
-            StoreUser storeUser = storeUserMapper.selectById(reportedUserId);
-            storeOrUserName = storeUser.getNickName();
-        } else {
-            LifeUser lifeUser = lifeUserMapper.selectById(reportedUserId);
-            storeOrUserName = lifeUser.getUserName();
-        }
 
         if ("1".equals(lifeuserViolation.getReportingUserType())) {
             StoreUser storeUsers = storeUserMapper.selectById(reportUserId);
@@ -179,10 +168,25 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
 
         lifeNotice.setReceiverId(phoneId);
 
-
-        if(StringUtils.isNotEmpty(reportContextType)){
+        if(StringUtils.isNotEmpty(reportContextType) && "1,2,3".contains(reportContextType)){
             String violationType = StringUtils.isNotEmpty(lifeuserViolation.getViolationType())?lifeuserViolation.getViolationType():"13";
             String violationText = EnumUtil.getStatusValue(Integer.parseInt(violationType));
+
+            String storeOrUserName = "";
+            // 查询被举报用户信息
+            String reportedUserId = lifeuserViolation.getReportedUserId();
+            if ("1".equals(lifeuserViolation.getReportedUserType())) {
+                StoreUser storeUser = storeUserMapper.selectById(reportedUserId);
+                storeOrUserName = storeUser.getNickName();
+            } else {
+                LifeUser lifeUser = lifeUserMapper.selectById(reportedUserId);
+                storeOrUserName = lifeUser.getUserName();
+            }
+
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            SimpleDateFormat simpleDateFormats = new SimpleDateFormat("yyyy-MM-dd");
+            String storeDate = simpleDateFormat.format(new Date());
+
             switch (reportContextType) {
                 case "1":
                     message = "您在" + storeDate + "举报用户“" + storeOrUserName + "”,涉嫌"+violationText+",已提交至平台审核,1-3个工作日会将审核结果发送到您应用内的消息-通知中,请注意查收。";
@@ -208,6 +212,7 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
             }
         }
 
+        jsonObject.put("title", "平台已受理");
         jsonObject.put("message", message);
         lifeNotice.setContext(jsonObject.toJSONString());
         lifeNotice.setNoticeType(1);

+ 33 - 0
alien-store/src/main/java/shop/alien/store/service/impl/PlatformLifeMessageServiceImpl.java

@@ -0,0 +1,33 @@
+package shop.alien.store.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import shop.alien.entity.store.vo.LifeFansVo;
+import shop.alien.entity.store.vo.LifeMessageVo;
+import shop.alien.mapper.LifeMessageMapper;
+import shop.alien.store.service.PlatformLifeMessageService;
+
+import java.util.List;
+
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class PlatformLifeMessageServiceImpl implements PlatformLifeMessageService {
+
+    private final LifeMessageMapper lifeMessageMapper;
+
+    @Override
+    public List<LifeMessageVo> getMessageList(String receiverId) throws Exception {
+        try {
+            QueryWrapper<LifeFansVo> wrapper = new QueryWrapper<>();
+            wrapper.eq("message.num", 1);
+            wrapper.orderByDesc("message.created_time");
+            return lifeMessageMapper.getLifeMessagePageByPhoneId(receiverId, wrapper);
+        } catch (Exception e) {
+            log.error("LifeMessageServiceImpl.getMessageList Error Msg={}", e.getMessage());
+            throw new Exception("获取消息列表失败");
+        }
+    }
+}

+ 4 - 10
alien-store/src/main/java/shop/alien/store/service/impl/PlatformLifeUserServiceImpl.java

@@ -1,22 +1,16 @@
 package shop.alien.store.service.impl;
 
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.RequiredArgsConstructor;
 import org.springframework.stereotype.Service;
-import shop.alien.entity.store.LifeLikeRecord;
-import shop.alien.entity.store.LifeUserDynamics;
-import shop.alien.entity.store.StoreComment;
-import shop.alien.entity.store.vo.LifeUserOrderVo;
+import shop.alien.entity.store.LifeUser;
 import shop.alien.entity.store.vo.LifeUserVo;
 import shop.alien.mapper.*;
 import shop.alien.store.service.PlatformLifeUserService;
 
-import java.util.List;
-
 @Service
 @RequiredArgsConstructor
 public class PlatformLifeUserServiceImpl implements PlatformLifeUserService {
@@ -67,8 +61,8 @@ public class PlatformLifeUserServiceImpl implements PlatformLifeUserService {
     }
 
     @Override
-    public List<LifeUserOrderVo> getUserById(Integer id) {
-        List<LifeUserOrderVo> userOrderDetail = lifeUserMapper.getUserOrderDetail(id);
-        return userOrderDetail;
+    public LifeUser getUserById(Integer id) {
+        LifeUser lifeUser = lifeUserMapper.selectById(id);
+        return lifeUser;
     }
 }

+ 2 - 1
alien-store/src/main/java/shop/alien/store/service/impl/PlatformStoreCouponServiceImpl.java

@@ -237,12 +237,13 @@ public class PlatformStoreCouponServiceImpl implements PlatformStoreCouponServic
             if (status == 2 && coupon.getStartDate().before(now) && coupon.getEndDate().after(now)) {
                 status = 5;
             }
-            coupon.setStatus(status);
             coupon.setApprovalComments(comment);
             // 审核后开始
             if ("0".equals(coupon.getSaleTimeStrType())) {
                 coupon.setStartDate(new Date());
+                status = 5;
             }
+            coupon.setStatus(status);
             // 将待办列表状态设置为已审核
             LambdaUpdateWrapper<WebAudit> wrapper = new LambdaUpdateWrapper<>();
             wrapper.eq(WebAudit::getCouponId, id);

+ 16 - 16
alien-store/src/main/java/shop/alien/store/service/impl/StoreInfoServiceImpl.java

@@ -208,7 +208,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
     public StoreMainInfoVo getDecorationDetail(Integer id) {
         StoreInfo storeInfo = storeInfoMapper.selectById(id);
         StoreMainInfoVo storeMainInfoVo = storeInfoMapper.getStoreInfo(id);
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
         String expirationDate = sdf.format(storeMainInfoVo.getExpirationTime());
         storeMainInfoVo.setExpirationDate(expirationDate);
         //审核通过给前台反显未提交
@@ -235,7 +235,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         //营业时间
         List<StoreBusinessInfo> storeBusinessInfoList = storeBusinessInfoMapper.selectList(new LambdaQueryWrapper<StoreBusinessInfo>().eq(StoreBusinessInfo::getStoreId, id));
         storeMainInfoVo.setStoreBusinessInfo(storeBusinessInfoList);
-        storeMainInfoVo.setStoreBusinessInfo(storeBusinessInfoMapper.selectList(new LambdaQueryWrapper<StoreBusinessInfo>().eq(StoreBusinessInfo::getStoreId, id)));
         //营业执照
         storeMainInfoVo.setBusinessLicenseList(storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getImgType, 14).eq(StoreImg::getStoreId, id)));
         //合同照片
@@ -249,6 +248,13 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         return storeMainInfoVo;
     }
 
+    @Override
+    public List<StoreBusinessInfo> getStoreInfoBusinessHours(Integer id) {
+        //营业时间
+        List<StoreBusinessInfo> storeBusinessInfoList = storeBusinessInfoMapper.selectList(new LambdaQueryWrapper<StoreBusinessInfo>().eq(StoreBusinessInfo::getStoreId, id));
+        return storeBusinessInfoList;
+    }
+
     /**
      * 门店信息-修改后展示
      *
@@ -320,12 +326,13 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         }
         // 获取当前时间
         LocalDate nowDay = LocalDate.now();
+        //经营许可证到期状态筛选 0 查询食品经营许可证已到期
         if(CommonConstant.FOOD_LICENCE_EXPIRE_STATUS.equals(foodLicenceWhetherExpiredStatus)){
             queryWrapper.lt("a.food_licence_expiration_time",nowDay);
-        } else if(CommonConstant.FOOD_LICENCE_ABOUT_TO_EXPIRE_STATUS.equals(foodLicenceWhetherExpiredStatus)){
+        } else if(CommonConstant.FOOD_LICENCE_ABOUT_TO_EXPIRE_STATUS.equals(foodLicenceWhetherExpiredStatus)){//经营许可证筛选状态 1 查询食品经营许可证即将到期 距离到期时间30天内
             queryWrapper.lt("a.food_licence_expiration_time",nowDay.plusDays(31))
                     .ge("a.food_licence_expiration_time",nowDay);
-        }else if(CommonConstant.FOOD_LICENCE_NOT_EXPIRED_STATUS.equals(foodLicenceWhetherExpiredStatus)){
+        }else if(CommonConstant.FOOD_LICENCE_NOT_EXPIRED_STATUS.equals(foodLicenceWhetherExpiredStatus)){//经营许可证筛选状态 2 查询食品经营许可证未到期 距离到期时间大于30天以上
             queryWrapper.gt("a.food_licence_expiration_time",nowDay.plusDays(31));
         }
         IPage<StoreInfoVo> storeInfoVoPage = storeInfoMapper.getStoreInfoVoPage(iPage, queryWrapper);
@@ -394,7 +401,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
                     long daysToExpire = ChronoUnit.DAYS.between(nowLocal, expDate);
                     record.setDaysToExpire(daysToExpire);
                 }
-                // 处理经营许可证到期时间回显状态
+                // 处理经营许可证到期时间回显状态 根据经营许可证筛选状态筛选
                 Date foodDate = record.getFoodLicenceExpirationTime();
                 if(foodDate != null){
                     // 获取当前时间
@@ -983,13 +990,13 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         for (StoreImg storeImg : storeImgs) {
             storeImgPaths.add(storeImg.getImgUrl());
         }
+        result.setBusinessLicenseAddress(storeImgPaths);
         //存入合同图片地址
         List<StoreImg> storeContractImageImgs = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getStoreId, storeId).eq(StoreImg::getImgType, 15));
         List<String> storeContractImagePathImgs = new ArrayList<>();
         for (StoreImg storeImg : storeContractImageImgs) {
             storeContractImagePathImgs.add(storeImg.getImgUrl());
         }
-        result.setBusinessLicenseAddress(storeImgPaths);
         result.setContractImageList(storeContractImagePathImgs);
         //存入续签合同地址
         List<StoreImg> renewContractImgs = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getStoreId, storeId).eq(StoreImg::getImgType, 22));
@@ -1163,6 +1170,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         // 获取店铺动态列表
         QueryWrapper<LifeUserDynamics> dynamicsWrapper = new QueryWrapper<>();
         dynamicsWrapper.eq("phone_id", "store_" + result.getStorePhone()).orderByDesc("lud.created_time");
+        dynamicsWrapper.eq("lud.delete_flag",0);
         List<LifeUserDynamicsVo> storeDynamicslist = lifeUserDynamicsMapper.getStoreDynamicslist(userId, dynamicsWrapper);
         List<LifeUserDynamicsVo> storeDynamicslist2 = storeDynamicslist.stream().limit(10).collect(Collectors.toList());
         result.setDynamicsList(storeDynamicslist2);
@@ -1539,6 +1547,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
 
         queryWrapper.eq("a.delete_flag", 0);
         queryWrapper.eq("a.logout_flag", 0);
+        queryWrapper.ne("a.status", 0);
         queryWrapper.like(StringUtils.isNotEmpty(vo.getFoodType()), "a.business_types_name", vo.getFoodType());
         queryWrapper.like(StringUtils.isNotEmpty(vo.getStoreName()), "a.store_name", vo.getStoreName());
 
@@ -2036,20 +2045,11 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
             map.put("foodLicenceStatus", storeInfo.getFoodLicenceStatus());
         }
         //食品经营许可证照片列表
-        if(storeInfo.getFoodLicenceStatus()==2||storeInfo.getFoodLicenceStatus()==3){
-            List<StoreImg> storeImgList = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getImgType, 24).eq(StoreImg::getStoreId, id));
+        List<StoreImg> storeImgList = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getImgType, 24).eq(StoreImg::getStoreId, id));
             if (!CollectionUtils.isEmpty(storeImgList)) {
                 map.put("foodLicenceImgList", storeImgList);
             } else {
                 map.put("foodLicenceImgList", "");
-            }
-        }else if(storeInfo.getFoodLicenceStatus()==1){
-            List<StoreImg> storeImgList = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getImgType, 25).eq(StoreImg::getStoreId, id));
-            if (!CollectionUtils.isEmpty(storeImgList)) {
-                map.put("foodLicenceImgList", storeImgList);
-            } else {
-                map.put("foodLicenceImgList", "");
-            }
         }
         if (storeInfo.getFoodLicenceReason() != null) {
             map.put("foodLicenceReason", storeInfo.getFoodLicenceReason());

+ 5 - 2
alien-store/src/main/java/shop/alien/store/service/impl/StoreUserServiceImpl.java

@@ -260,6 +260,9 @@ public class StoreUserServiceImpl extends ServiceImpl<StoreUserMapper, StoreUser
             String oldPhoneVerification = "verification_" + phone;
             //获取新手机号验证码
             String redisVerificationCode = baseRedisService.getString(oldPhoneVerification);
+            if(StringUtils.isEmpty(redisVerificationCode)){
+                throw new RuntimeException("验证码已失效 请重新获取验证码");
+            }
             if (redisVerificationCode.equals(verificationCode)) {
                 changePhoneMap.put("verificationStatus", "1");
                 return changePhoneMap;
@@ -285,8 +288,8 @@ public class StoreUserServiceImpl extends ServiceImpl<StoreUserMapper, StoreUser
             wrapperFans.eq(StoreUser::getPassword, password);
             StoreUser storeUserPw = this.getOne(wrapperFans);
             if (storeUserPw == null || storeUserPw.getPassword().equals("")) {
-                log.info("密码输入错误 请重新输入");
-                throw new RuntimeException("密码输入错误 请重新输入");
+                log.info("密码错误");
+                throw new RuntimeException("密码错误");
             }
         }
     }