소스 검색

银河新版PC

zoujiajian 2 년 전
부모
커밋
6a2ee821e8
60개의 변경된 파일968개의 추가작업 그리고 155개의 파일을 삭제
  1. 4 0
      netflix-common/src/main/java/com/cyksj/common/constant/Constant.java
  2. 21 0
      netflix-dao/src/main/java/com/cyksj/mapper/UserSysMsgNotifyMapper.java
  3. 28 0
      netflix-dao/src/main/java/com/cyksj/model/dto/RealGoodsConfigDto.java
  4. 5 0
      netflix-dao/src/main/java/com/cyksj/model/entity/GoodsDon.java
  5. 4 0
      netflix-dao/src/main/java/com/cyksj/model/entity/GoodsDonCategory.java
  6. 28 3
      netflix-dao/src/main/java/com/cyksj/model/entity/HomeManagementConfig.java
  7. 15 0
      netflix-dao/src/main/java/com/cyksj/model/entity/Information.java
  8. 5 0
      netflix-dao/src/main/java/com/cyksj/model/entity/OrderDon.java
  9. 1 1
      netflix-dao/src/main/java/com/cyksj/model/entity/SignUser.java
  10. 3 0
      netflix-dao/src/main/java/com/cyksj/model/entity/Task.java
  11. 9 7
      netflix-dao/src/main/java/com/cyksj/model/entity/UserBalanceSourceRecord.java
  12. 30 0
      netflix-dao/src/main/java/com/cyksj/model/entity/UserSysMsgNotify.java
  13. 7 1
      netflix-dao/src/main/java/com/cyksj/model/manage/request/ReqGoodsSkuSpec.java
  14. 2 0
      netflix-dao/src/main/java/com/cyksj/model/manage/request/ReqGoodsSpuInsert.java
  15. 3 0
      netflix-dao/src/main/java/com/cyksj/model/manage/views/GoodsDonViewer.java
  16. 7 0
      netflix-dao/src/main/java/com/cyksj/model/request/HomeManageConfigReq.java
  17. 3 0
      netflix-dao/src/main/java/com/cyksj/model/views/GoodsDonCategoryGoodsView.java
  18. 4 1
      netflix-dao/src/main/java/com/cyksj/model/views/GoodsDonCategoryView.java
  19. 142 0
      netflix-dao/src/main/java/com/cyksj/model/views/GoodsDonDetailFrontView.java
  20. 1 1
      netflix-dao/src/main/java/com/cyksj/model/views/GoodsFrontListCategoryView.java
  21. 6 0
      netflix-dao/src/main/java/com/cyksj/model/views/GoodsFrontListView.java
  22. 13 0
      netflix-dao/src/main/java/com/cyksj/model/views/HomeManagementConfigView.java
  23. 33 5
      netflix-dao/src/main/java/com/cyksj/model/views/HomeManagementFrontView.java
  24. 13 0
      netflix-dao/src/main/java/com/cyksj/model/views/InformationDetailView.java
  25. 4 0
      netflix-dao/src/main/java/com/cyksj/model/views/InformationListView.java
  26. 14 1
      netflix-dao/src/main/java/com/cyksj/model/views/InformationView.java
  27. 5 0
      netflix-dao/src/main/java/com/cyksj/model/views/OrderDonUserCommentView.java
  28. 3 0
      netflix-dao/src/main/java/com/cyksj/model/views/TaskFrontView.java
  29. 3 0
      netflix-dao/src/main/java/com/cyksj/model/views/TaskView.java
  30. 6 0
      netflix-dao/src/main/java/com/cyksj/model/views/YhShopGoodsFrontView.java
  31. 3 3
      netflix-dao/src/main/resources/mapper/InformationMapper.xml
  32. 23 0
      netflix-dao/src/main/resources/mapper/UserSysMsgNotifyMapper.xml
  33. 1 1
      netflix-service/src/main/java/com/cyksj/common/service/CropDutyServiceDateService.java
  34. 15 0
      netflix-service/src/main/java/com/cyksj/service/goods/GoodsDonFrontService.java
  35. 104 0
      netflix-service/src/main/java/com/cyksj/service/goods/impl/GoodsDonFrontServiceImpl.java
  36. 4 0
      netflix-service/src/main/java/com/cyksj/service/home/impl/HomeManagementConfigServiceImpl.java
  37. 1 1
      netflix-service/src/main/java/com/cyksj/service/mange/CmsGroupService.java
  38. 1 1
      netflix-service/src/main/java/com/cyksj/service/mange/goods/CmsGoodsDonSkuServiceImpl.java
  39. 16 3
      netflix-service/src/main/java/com/cyksj/service/mange/group/CmsGroupServiceImpl.java
  40. 3 3
      netflix-service/src/main/java/com/cyksj/service/mange/impl/CmsOrderDonServiceImpl.java
  41. 24 3
      netflix-service/src/main/java/com/cyksj/service/market/impl/MarketFrontServiceImpl.java
  42. 1 1
      netflix-service/src/main/java/com/cyksj/service/market/task/impl/TaskServiceImpl.java
  43. 1 1
      netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonCommentServiceImpl.java
  44. 17 12
      netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java
  45. 7 7
      netflix-service/src/main/java/com/cyksj/service/scheduler/impl/SchedulerServiceImpl.java
  46. 34 27
      netflix-service/src/main/java/com/cyksj/service/template/impl/TemplateCommonServiceImpl.java
  47. 2 8
      netflix-service/src/main/java/com/cyksj/service/user/UserBenefitsService.java
  48. 20 0
      netflix-service/src/main/java/com/cyksj/service/user/UserSysMsgNotifyService.java
  49. 17 32
      netflix-service/src/main/java/com/cyksj/service/user/impl/UserBenefitsServiceImpl.java
  50. 9 10
      netflix-service/src/main/java/com/cyksj/service/user/impl/UserServiceImpl.java
  51. 59 0
      netflix-service/src/main/java/com/cyksj/service/user/impl/UserSysMsgNotifyServiceImpl.java
  52. 40 0
      netflix-web/src/main/java/com/cyksj/web/controller/goods/GoodsDonController.java
  53. 2 12
      netflix-web/src/main/java/com/cyksj/web/controller/information/InformationController.java
  54. 2 2
      netflix-web/src/main/java/com/cyksj/web/controller/manage/CmsUserController.java
  55. 4 2
      netflix-web/src/main/java/com/cyksj/web/controller/manage/account/CmsAccountController.java
  56. 9 0
      netflix-web/src/main/java/com/cyksj/web/controller/manage/goods/CmsGoodsDonCategoryController.java
  57. 30 2
      netflix-web/src/main/java/com/cyksj/web/controller/manage/information/CmsInformationController.java
  58. 2 2
      netflix-web/src/main/java/com/cyksj/web/controller/market/SignFrontController.java
  59. 14 2
      netflix-web/src/main/java/com/cyksj/web/controller/payment/OrderController.java
  60. 81 0
      netflix-web/src/main/java/com/cyksj/web/controller/sys/UserSysMsgController.java

+ 4 - 0
netflix-common/src/main/java/com/cyksj/common/constant/Constant.java

@@ -250,4 +250,8 @@ public interface Constant {
 	 * 获客链接 值班客服更新定时任务id
 	 */
 	Integer CORP_LINK_JOB_ID = 192;
+
+	String ACCOUNT_PWD_UPDATE_SYS_MSG_NOTIFY = "您购买的%s账号,密码已修改";
+
+	String ACCOUNT_SET_SYS_MSG_NOTIFY = "您购买的%s账号,账号已配置";
 }

+ 21 - 0
netflix-dao/src/main/java/com/cyksj/mapper/UserSysMsgNotifyMapper.java

@@ -0,0 +1,21 @@
+package com.cyksj.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cyksj.model.entity.GroupsRelation;
+import com.cyksj.model.entity.UserSysMsgNotify;
+import com.cyksj.model.manage.views.GroupsRelationView;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: UserSysMsgNotifyMapper
+ * 创建者: JavaZou
+ * 创建时间:2024/2/4 16:02
+ */
+public interface UserSysMsgNotifyMapper extends BaseMapper<UserSysMsgNotify> {
+	void recordUserAccountUpdateSysMsg(@Param("goodsId") Long goodsId, @Param("skuId") Long skuId, @Param("list") List<GroupsRelationView> relations, @Param("account") String account, @Param("msg") String msg);
+
+	void recordUserAccountSetSysMsg(@Param("goodsId") Long goodsId, @Param("skuId") Long skuId, @Param("list") List<GroupsRelation> collect, @Param("account") String account, @Param("msg") String msg);
+}

+ 28 - 0
netflix-dao/src/main/java/com/cyksj/model/dto/RealGoodsConfigDto.java

@@ -0,0 +1,28 @@
+package com.cyksj.model.dto;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: RealGoodsConfigDto
+ * 创建者: JavaZou
+ * 创建时间:2023/10/19 17:16
+ */
+@Getter
+@Setter
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class RealGoodsConfigDto {
+	private Long id;
+
+	private String title;
+
+	private String logo;
+
+	private String tags;
+
+	private BigDecimal price;
+}

+ 5 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/GoodsDon.java

@@ -159,6 +159,11 @@ public class GoodsDon extends BaseEntity {
      */
     private String payDesc;
 
+    /**
+     * 购买说明
+     */
+    private String buyDesc;
+
     /**
      * 特殊类型
      */

+ 4 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/GoodsDonCategory.java

@@ -1,5 +1,6 @@
 package com.cyksj.model.entity;
 
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.cyksj.model.views.GoodsDonCategoryGoodsView;
 import com.ejlchina.searcher.bean.DbIgnore;
@@ -21,6 +22,9 @@ public class GoodsDonCategory extends BaseEntity {
 	@NotEmpty(message = "名称不为空")
 	private String name;
 
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private String icon;
+
 	private Integer sorted;
 
 	private Boolean status;

+ 28 - 3
netflix-dao/src/main/java/com/cyksj/model/entity/HomeManagementConfig.java

@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.math.BigDecimal;
+
 /*
  *项目名: netflix
  *文件名: HomeManagementConfig
@@ -30,6 +32,7 @@ public class HomeManagementConfig extends BaseEntity{
 
 	private Boolean status;
 
+
 	/**
 	 * 定时上下架状态 默认null
 	 */
@@ -42,10 +45,20 @@ public class HomeManagementConfig extends BaseEntity{
 	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private Long time;
 
-	private Boolean deleted;
-
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private AdType adType;
 
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private RgType rgType;
+
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private BigDecimal rgPrice;
+
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private String rgSubTitle;
+
+	private Boolean deleted;
+
 	@Getter
 	public enum Type {
 		ad("广告"),
@@ -73,4 +86,16 @@ public class HomeManagementConfig extends BaseEntity{
 			this.desc = desc;
 		}
 	}
-}
+
+	@Getter
+	public enum RgType {
+		pc("pc"),
+		h5("h5")
+		;
+		String desc;
+
+		RgType(String desc) {
+			this.desc = desc;
+		}
+	}
+}

+ 15 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/Information.java

@@ -1,5 +1,7 @@
 package com.cyksj.model.entity;
 
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
+import com.baomidou.mybatisplus.annotation.TableField;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -20,6 +22,14 @@ public class Information extends BaseEntity{
      */
     private String subTitle;
 
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private String logo;
+
+    /**
+     * 是否是黑色文字 默认false
+     */
+    private Boolean isBlackFont;
+
     /**
      * 缩略图
      */
@@ -50,6 +60,11 @@ public class Information extends BaseEntity{
      */
     private Boolean top;
 
+    /**
+     * 排序
+     */
+    private Integer sorted;
+
     /**
      * true 存在 || false 删除
      */

+ 5 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/OrderDon.java

@@ -282,6 +282,11 @@ public class OrderDon extends BaseEntity implements Serializable {
      */
     private Long yhsId;
 
+    /**
+     * 文章id
+     */
+    private Long infoId;
+
     /**
      * 下单手机号
      */

+ 1 - 1
netflix-dao/src/main/java/com/cyksj/model/entity/SignUser.java

@@ -21,7 +21,7 @@ public class SignUser extends BaseEntity{
     private Integer dayPeriod;
 
     /**
-     * 是否已签 true 签到成功 false 签到
+     * 是否已签 true 签到成功 false 签到
      */
     @TableField(exist = false)
     private Boolean isHadChecked;

+ 3 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/Task.java

@@ -24,6 +24,9 @@ public class Task extends BaseEntity{
 	@NotEmpty(message = "任务名称不能为空")
 	private String name;
 
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private String icon;
+
 	/**
 	 * 类型id
 	 */

+ 9 - 7
netflix-dao/src/main/java/com/cyksj/model/entity/UserBalanceSourceRecord.java

@@ -20,20 +20,22 @@ public class UserBalanceSourceRecord extends BaseEntity{
 
 	private Source source;
 
+	private String detail;
+
+	private Long orderId;
+
 	@Getter
 	public enum Source {
-		payment("下单"),
-		balance("余额支付"),
-		refund("订单退款"),
-		close("订单关闭"),
-		clear_valid("车票未到期清除"),
+		payment("购买"),
+		refund("退款"),
+		clear_valid("未到期车票清除"),
 		ds_transport("分销实物发货"),
 		follow_task("关注引导"),
 		rd_comment("实物评论"),
 		price_differ("订单补差价"),
-		compensate("补偿"),
+		compensate("系统补偿"),
 		manual("手动扣除")
-				;
+		;
 		String desc;
 
 		Source(String desc) {

+ 30 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/UserSysMsgNotify.java

@@ -0,0 +1,30 @@
+package com.cyksj.model.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: UserSysMsgNotify
+ * 创建者: JavaZou
+ * 创建时间:2024/2/4 16:01
+ */
+@Getter
+@Setter
+public class UserSysMsgNotify extends BaseEntity{
+	private Long goodsId;
+
+	private Long skuId;
+
+	private Long userId;
+
+	private Long relationId;
+
+	private String account;
+
+	private String msg;
+
+	private Boolean isView;
+
+	private Boolean deleted;
+}

+ 7 - 1
netflix-dao/src/main/java/com/cyksj/model/manage/request/ReqGoodsSkuSpec.java

@@ -24,8 +24,14 @@ public class ReqGoodsSkuSpec {
 
         private String value;
 
+        private Boolean hide;
+
+        private String logo;
+
         private BigDecimal price;
 
         private String benefitsList;
+
+        private BigDecimal benefitsPrice;
     }
-}
+}

+ 2 - 0
netflix-dao/src/main/java/com/cyksj/model/manage/request/ReqGoodsSpuInsert.java

@@ -126,6 +126,8 @@ public class ReqGoodsSpuInsert {
      */
     private String payDesc;
 
+    private String buyDesc;
+
     private GoodsDon.SpecialType specialType;
 
 

+ 3 - 0
netflix-dao/src/main/java/com/cyksj/model/manage/views/GoodsDonViewer.java

@@ -161,6 +161,9 @@ public class GoodsDonViewer {
     @DbField("g.pay_desc")
     private String payDesc;
 
+    @DbField("g.buy_desc")
+    private String buyDesc;
+
     @DbField("g.special_type")
     private GoodsDon.SpecialType specialType;
 

+ 7 - 0
netflix-dao/src/main/java/com/cyksj/model/request/HomeManageConfigReq.java

@@ -4,6 +4,7 @@ import com.cyksj.model.entity.HomeManagementConfig;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 /*
@@ -32,6 +33,12 @@ public class HomeManageConfigReq {
 
 	private HomeManagementConfig.AdType adType;
 
+	private HomeManagementConfig.RgType rgType;
+
+	private BigDecimal rgPrice;
+
+	private String rgSubTitle;
+
 	private Integer sorted;
 
 	private String tag;

+ 3 - 0
netflix-dao/src/main/java/com/cyksj/model/views/GoodsDonCategoryGoodsView.java

@@ -28,6 +28,9 @@ public class GoodsDonCategoryGoodsView {
 	@DbField("gcr.category")
 	private Long category;
 
+	@DbField("gcr.id")
+	private Long relateId;
+
 	@DbField("g.title")
 	private String title;
 

+ 4 - 1
netflix-dao/src/main/java/com/cyksj/model/views/GoodsDonCategoryView.java

@@ -17,7 +17,7 @@ import java.util.Date;
 @Setter
 @SearchBean(tables = "goods_don_category gc left join goods_don_category_relate gcr on gcr.category = gc.id" +
 		" left join goods_don g on g.id = gcr.goods_id and g.deleted is true",
-		groupBy = "gc.id,gc.name,gc.sorted,gc.update_time")
+		groupBy = "gc.id,gc.name,gc.icon,gc.sorted,gc.update_time")
 public class GoodsDonCategoryView {
 	@DbField("gc.id")
 	private Long id;
@@ -25,6 +25,9 @@ public class GoodsDonCategoryView {
 	@DbField("gc.name")
 	private String name;
 
+	@DbField("gc.icon")
+	private String icon;
+
 	@DbField("gc.sorted")
 	private Integer sorted;
 

+ 142 - 0
netflix-dao/src/main/java/com/cyksj/model/views/GoodsDonDetailFrontView.java

@@ -0,0 +1,142 @@
+package com.cyksj.model.views;
+
+import com.cyksj.model.entity.GoodsDon;
+import com.ejlchina.searcher.bean.DbIgnore;
+import com.ejlchina.searcher.bean.SearchBean;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: GoodsDonDetailFrontView
+ * 创建者: JavaZou
+ * 创建时间:2023/10/19 17:42
+ */
+@Getter
+@Setter
+@SearchBean(tables = "goods_don",
+		where = "deleted is true and status is true")
+public class GoodsDonDetailFrontView {
+	private Integer id;
+
+	/**
+	 * 标签
+	 */
+	private String tags;
+
+	/**
+	 * 商品名称
+	 */
+	private String title;
+
+	/**
+	 * 缩略图
+	 */
+	private String logo;
+
+	/**
+	 * 背景图
+	 */
+	private String img;
+
+	/**
+	 * 详情
+	 */
+	private String detail;
+
+	/**
+	 * 描述
+	 */
+	private String remark;
+
+	private Integer type;
+
+	/**
+	 * 分类
+	 * 1、AI  2、流媒体
+	 */
+	private Integer category;
+
+	/**
+	 * 二级分类
+	 * 虚物品 1邀请制 2非邀请制
+	 */
+	private Integer secondType;
+
+	private String banner;
+
+	/**
+	 * 最小规格价格
+	 */
+	private BigDecimal minPrice;
+
+	/**
+	 * 最小规格价格月份
+	 */
+	private Integer minMonths;
+
+	/**
+	 * 最小规格 天数
+	 */
+	private Integer minDays;
+
+	/**
+	 * 最大规格价格
+	 */
+	private BigDecimal maxPrice;
+
+	/**
+	 * 最大规格价格月份
+	 */
+	private Integer maxMonths;
+
+	/**
+	 * 最大规格 天数
+	 */
+	private Integer maxDays;
+
+	/**
+	 * 付款说明
+	 */
+	private String payDesc;
+
+	/**
+	 * 特殊类型
+	 */
+	private GoodsDon.SpecialType specialType;
+
+	/**
+	 * 视频
+	 */
+	private String video;
+
+	/**
+	 * 推荐标题
+	 */
+	private String recommendTitle;
+
+	/**
+	 * 推荐平台
+	 */
+	private String recommendGoods;
+
+	private Boolean isSp;
+
+	@DbIgnore
+	private List<GoodsDonSkuFrontView> skuList;
+
+	@DbIgnore
+	private GoodsDonSpecFrontView specs;
+
+	@DbIgnore
+	private String giftCards;
+
+	@DbIgnore
+	private List<GoodsSkuGiftCardView> giftCardsView;
+
+	@DbIgnore
+	private OrderCommentFrontView comments;
+}

+ 1 - 1
netflix-dao/src/main/java/com/cyksj/model/views/GoodsFrontListCategoryView.java

@@ -55,7 +55,7 @@ public class GoodsFrontListCategoryView {
 	 * 分类
 	 * 1、AI  2、流媒体
 	 */
-	@DbField("g.category")
+	@DbField("gcr.category")
 	private Long category;
 
 	/**

+ 6 - 0
netflix-dao/src/main/java/com/cyksj/model/views/GoodsFrontListView.java

@@ -51,6 +51,9 @@ public class GoodsFrontListView {
 	@DbField("g.img")
 	private String img;
 
+	@DbField("g.banner")
+	private String banner;
+
 	/**
 	 * 商品搭配图
 	 */
@@ -122,6 +125,9 @@ public class GoodsFrontListView {
 	@DbField("g.pay_desc")
 	private String payDesc;
 
+	@DbField("g.buy_desc")
+	private String buyDesc;
+
 	/**
 	 * 是否是特定价格平台
 	 */

+ 13 - 0
netflix-dao/src/main/java/com/cyksj/model/views/HomeManagementConfigView.java

@@ -7,6 +7,7 @@ import com.ejlchina.searcher.bean.SearchBean;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.math.BigDecimal;
 import java.util.Date;
 
 /*
@@ -41,6 +42,18 @@ public class HomeManagementConfigView {
 	@DbField("hc.type")
 	private HomeManagementConfig.Type type;
 
+	@DbField("hc.ad_type")
+	private HomeManagementConfig.AdType adType;
+
+	@DbField("hc.rg_type")
+	private HomeManagementConfig.AdType rgType;
+
+	@DbField("hc.rg_price")
+	private BigDecimal rgPrice;
+
+	@DbField("hc.rg_sub_title")
+	private String rgSubTitle;
+
 	@DbField("hc.tag")
 	private String tag;
 

+ 33 - 5
netflix-dao/src/main/java/com/cyksj/model/views/HomeManagementFrontView.java

@@ -1,11 +1,13 @@
 package com.cyksj.model.views;
 
+import com.cyksj.model.dto.RealGoodsConfigDto;
 import com.cyksj.model.entity.GoodsDon;
 import com.cyksj.model.entity.GoodsDonSpec;
 import com.cyksj.model.entity.HomeManagementConfig;
 import com.ejlchina.searcher.bean.DbField;
 import com.ejlchina.searcher.bean.DbIgnore;
 import com.ejlchina.searcher.bean.SearchBean;
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import lombok.Getter;
 import lombok.Setter;
@@ -47,6 +49,18 @@ public class HomeManagementFrontView {
 	@DbField("hc.type")
 	private HomeManagementConfig.Type type;
 
+	@DbField("hc.ad_type")
+	private HomeManagementConfig.AdType adType;
+
+	@DbField("hc.rg_type")
+	private HomeManagementConfig.AdType rgType;
+
+	@DbField("hc.rg_price")
+	private BigDecimal rgPrice;
+
+	@DbField("hc.rg_sub_title")
+	private String rgSubTitle;
+
 	@DbField("hc.pic")
 	private String pic;
 
@@ -71,15 +85,19 @@ public class HomeManagementFrontView {
 	@DbField("g.img")
 	private String goodsImg;
 
-	@DbField("g.match_img")
-	private String matchImg;
-
 	/**
 	 * 类型
 	 */
 	@DbField("g.type")
 	private Integer goodsType;
 
+	/**
+	 * 分类
+	 * 1、AI  2、流媒体
+	 */
+	@DbField("g.category")
+	private Long category;
+
 	@DbField("g.second_type")
 	private Integer secondType;
 
@@ -107,9 +125,16 @@ public class HomeManagementFrontView {
 	/**
 	 * 已售
 	 */
-	@DbField("g.virtual_sold")
+	@DbIgnore
 	private Integer sold;
 
+	/**
+	 * 虚拟销量
+	 */
+	@DbField("g.virtual_sold")
+	@JsonIgnore
+	private Integer virtualSold;
+
 	@DbIgnore
 	private BigDecimal specificPrice;
 
@@ -139,4 +164,7 @@ public class HomeManagementFrontView {
 
 	@DbIgnore
 	private OrderCommentFrontView comments;
-}
+
+	@DbIgnore
+	private List<RealGoodsConfigDto> subInfoList;
+}

+ 13 - 0
netflix-dao/src/main/java/com/cyksj/model/views/InformationDetailView.java

@@ -6,6 +6,7 @@ import com.ejlchina.searcher.bean.SearchBean;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -31,6 +32,15 @@ public class InformationDetailView {
     @DbField("i.sub_title")
     private String subTitle;
 
+    /**
+     * 副标题
+     */
+    @DbField("i.logo")
+    private String logo;
+
+    @DbField("i.is_black_font")
+    private Boolean isBlackFont;
+
     /**
      * 缩略图
      */
@@ -79,4 +89,7 @@ public class InformationDetailView {
      */
     @DbIgnore
     private List<GoodsFrontListView> goods;
+
+    @DbField("i.update_time")
+    private Date releaseTime;
 }

+ 4 - 0
netflix-dao/src/main/java/com/cyksj/model/views/InformationListView.java

@@ -26,6 +26,10 @@ public class InformationListView {
      */
     private String subTitle;
 
+    private String logo;
+
+    private Boolean isBlackFont;
+
     /**
      * 缩略图
      */

+ 14 - 1
netflix-dao/src/main/java/com/cyksj/model/views/InformationView.java

@@ -15,7 +15,7 @@ import java.util.List;
  */
 @Getter
 @Setter
-@SearchBean(tables = "information i",where = "i.deleted is true")
+@SearchBean(tables = "information i",where = "i.deleted is true :ct:")
 public class InformationView {
     @DbField("i.id")
     private Long id;
@@ -32,6 +32,16 @@ public class InformationView {
     @DbField("i.sub_title")
     private String subTitle;
 
+
+    /**
+     * 文章标题
+     */
+    @DbField("i.logo")
+    private String logo;
+
+    @DbField("i.is_black_font")
+    private Boolean isBlackFont;
+
     /**
      * 缩略图
      */
@@ -74,6 +84,9 @@ public class InformationView {
     @DbField("i.top")
     private Boolean top;
 
+    @DbField("i.sorted")
+    private Integer sorted;
+
     /**
      * 推荐商品id
      */

+ 5 - 0
netflix-dao/src/main/java/com/cyksj/model/views/OrderDonUserCommentView.java

@@ -6,6 +6,8 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.math.BigDecimal;
+
 /*
  *项目名: netflix
  *文件名: OrderDonUserCommentView
@@ -35,6 +37,9 @@ public class OrderDonUserCommentView {
 	@DbField("sku.picture")
 	private String picture;
 
+	@DbField("sku.price")
+	private BigDecimal price;
+
 	@DbField("g.type")
 	@JsonIgnore
 	private Integer goodsType;

+ 3 - 0
netflix-dao/src/main/java/com/cyksj/model/views/TaskFrontView.java

@@ -28,6 +28,9 @@ public class TaskFrontView {
 	@DbField("t.name")
 	private String name;
 
+	@DbField(("t.icon"))
+	private String icon;
+
 	/**
 	 * 类型id
 	 */

+ 3 - 0
netflix-dao/src/main/java/com/cyksj/model/views/TaskView.java

@@ -34,6 +34,9 @@ public class TaskView {
 	@DbField("tt.name")
 	private String typeName;
 
+	@DbField("t.icon")
+	private String icon;
+
 	@DbField("t.description")
 	private String description;
 

+ 6 - 0
netflix-dao/src/main/java/com/cyksj/model/views/YhShopGoodsFrontView.java

@@ -52,6 +52,9 @@ public class YhShopGoodsFrontView {
 	@DbField("g.img")
 	private String img;
 
+	@DbField("g.banner")
+	private String banner;
+
 	/**
 	 * 类型
 	 */
@@ -104,6 +107,9 @@ public class YhShopGoodsFrontView {
 	@DbField("g.pay_desc")
 	private String payDesc;
 
+	@DbField("g.buy_desc")
+	private String buyDesc;
+
 	/**
 	 * 是否是特定价格平台
 	 */

+ 3 - 3
netflix-dao/src/main/resources/mapper/InformationMapper.xml

@@ -5,7 +5,7 @@
 
 
     <select id="getInformation" resultType="com.cyksj.model.views.InformationListView">
-        select id,title,thumbnail,created_time,content from information where status is true and deleted is true
+        select id,title,thumbnail,created_time,content,sub_title,logo,is_black_font from information where status is true and deleted is true
         <choose>
             <when test="categoryId != null">
                 and JSON_CONTAINS(category_ids,'"${categoryId}"') = 1
@@ -14,11 +14,11 @@
                 and recommend is true
             </otherwise>
         </choose>
-        order by case when top is true then 1 else 2 end,created_time desc
+        order by sorted, case when top is true then 1 else 2 end,created_time desc
     </select>
 
     <select id="getInformationByTitle" resultType="com.cyksj.model.views.InformationListView">
-        select id,title,thumbnail,created_time,content
+        select id,title,thumbnail,created_time,content,sub_title,logo,is_black_font
         from information
         where title like '%${title}%'
           and status is true

+ 23 - 0
netflix-dao/src/main/resources/mapper/UserSysMsgNotifyMapper.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.cyksj.mapper.UserSysMsgNotifyMapper">
+
+    <insert id="recordUserAccountUpdateSysMsg">
+        insert into
+        user_sys_msg_notify(`goods_id`,`sku_id`,`user_id`,`relation_id`,`account`,`msg`,`created_time`,`update_time`)
+        values
+        <foreach collection="list" item="item" separator=",">
+            (#{goodsId},#{skuId},#{item.userId},#{item.id},#{account},#{msg},now(),now())
+        </foreach>
+    </insert>
+
+    <insert id="recordUserAccountSetSysMsg">
+        insert into
+        user_sys_msg_notify(`goods_id`,`sku_id`,`user_id`,`relation_id`,`account`,`msg`,`created_time`,`update_time`)
+        values
+        <foreach collection="list" item="item" separator=",">
+            (#{goodsId},#{skuId},#{item.userId},#{item.id},#{account},#{msg},now(),now())
+        </foreach>
+    </insert>
+</mapper>

+ 1 - 1
netflix-service/src/main/java/com/cyksj/common/service/CropDutyServiceDateService.java

@@ -53,7 +53,7 @@ public class CropDutyServiceDateService {
 		if (holidyDateMap == null) {
 			return null;
 		}
-		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd");
+		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/M/d");
 		String nowDate = now.format(formatter);
 
 		List<YhServiceDto> holidayServices = holidyDateMap.get(nowDate);

+ 15 - 0
netflix-service/src/main/java/com/cyksj/service/goods/GoodsDonFrontService.java

@@ -0,0 +1,15 @@
+package com.cyksj.service.goods;
+
+import com.cyksj.model.views.HomeManagementFrontView;
+
+import java.util.List;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: GoodsDonFrontService
+ * 创建者: JavaZou
+ * 创建时间:2023/10/19 17:53
+ */
+public interface GoodsDonFrontService {
+	List<HomeManagementFrontView> getRealGoodsConfig() throws Exception;
+}

+ 104 - 0
netflix-service/src/main/java/com/cyksj/service/goods/impl/GoodsDonFrontServiceImpl.java

@@ -0,0 +1,104 @@
+package com.cyksj.service.goods.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.cyksj.common.util.Jsons;
+import com.cyksj.mapper.GoodsDonSpecMapper;
+import com.cyksj.model.dto.RealGoodsConfigDto;
+import com.cyksj.model.entity.GoodsDonSpec;
+import com.cyksj.model.entity.HomeManagementConfig;
+import com.cyksj.model.manage.request.ReqGoodsSkuSpec;
+import com.cyksj.model.views.GoodsDonDetailFrontView;
+import com.cyksj.model.views.HomeManagementFrontView;
+import com.cyksj.service.goods.GoodsDonFrontService;
+import com.ejlchina.searcher.BeanSearcher;
+import com.ejlchina.searcher.param.Operator;
+import com.ejlchina.searcher.util.MapUtils;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: GoodsDonFrontServiceImpl
+ * 创建者: JavaZou
+ * 创建时间:2023/10/19 17:53
+ */
+@Service
+@RequiredArgsConstructor
+public class GoodsDonFrontServiceImpl implements GoodsDonFrontService {
+
+	private final BeanSearcher beanSearcher;
+
+	private final GoodsDonSpecMapper goodsDonSpecMapper;
+
+	@Override
+	public List<HomeManagementFrontView> getRealGoodsConfig() throws Exception {
+		List<HomeManagementFrontView> realGoodsConfigList = beanSearcher.searchAll(HomeManagementFrontView.class, MapUtils.builder().field(HomeManagementFrontView::getType, HomeManagementConfig.Type.rg.name()).build());
+		Map<String, List<RealGoodsConfigDto>> map = new HashMap<>();
+		List<ReqGoodsSkuSpec> reqGoodsSkuSpecList = null;
+		for (HomeManagementFrontView realGoodsConfig : realGoodsConfigList) {
+			if (StrUtil.isEmpty(realGoodsConfig.getTitle())) {
+				continue;
+			}
+			boolean isCtRoute = realGoodsConfig.getTitle().contains("路由器");
+			boolean isCtApple = realGoodsConfig.getTitle().contains("Apple");
+			if (isCtRoute || isCtApple) {
+				List<RealGoodsConfigDto> subInfoList = new ArrayList<>();
+				String type = null;
+				if (CollUtil.isEmpty(reqGoodsSkuSpecList)) {
+					GoodsDonSpec goodsDonSpec = goodsDonSpecMapper.selectOne(Wrappers.lambdaQuery(GoodsDonSpec.class)
+							.eq(GoodsDonSpec::getGoodsId, 15).last("limit 1")
+							.select(GoodsDonSpec::getSpecsJson));
+					reqGoodsSkuSpecList = Jsons.parseList(goodsDonSpec.getSpecsJson(), ReqGoodsSkuSpec.class);
+				}
+				if (CollUtil.isEmpty(realGoodsConfigList)) {
+					continue;
+				}
+				for (ReqGoodsSkuSpec reqGoodsSkuSpec : reqGoodsSkuSpecList) {
+					if (StrUtil.isEmpty(reqGoodsSkuSpec.getKey())) {
+						continue;
+					}
+					boolean subIsCtRoute = reqGoodsSkuSpec.getKey().contains("路由器");
+					boolean subIsCtApple = reqGoodsSkuSpec.getKey().contains("机顶盒");
+					if ((isCtRoute && subIsCtRoute) || (isCtApple && subIsCtApple)) {
+						List<ReqGoodsSkuSpec.Node> values = reqGoodsSkuSpec.getValues();
+						for (ReqGoodsSkuSpec.Node value : values) {
+							RealGoodsConfigDto subInfo = new RealGoodsConfigDto();
+							subInfo.setTitle(value.getValue());
+							subInfo.setLogo(value.getLogo());
+							subInfo.setPrice(value.getPrice());
+							subInfoList.add(subInfo);
+						}
+					}
+				}
+				realGoodsConfig.setSubInfoList(subInfoList);
+			}
+			if (realGoodsConfig.getTitle().contains("潮玩")) {
+				List<GoodsDonDetailFrontView> fashionGoodsList = beanSearcher.searchAll(GoodsDonDetailFrontView.class, MapUtils.builder().field(GoodsDonDetailFrontView::getType, 3)
+						.field(GoodsDonDetailFrontView::getId, 27).op(Operator.NotEqual)
+						.onlySelect(GoodsDonDetailFrontView::getTitle, GoodsDonDetailFrontView::getLogo, GoodsDonDetailFrontView::getMinPrice, GoodsDonDetailFrontView::getId, GoodsDonDetailFrontView::getTags)
+						.build());
+				if (CollUtil.isEmpty(fashionGoodsList)) {
+					continue;
+				}
+				List<RealGoodsConfigDto> subInfoList = new ArrayList<>();
+				for (GoodsDonDetailFrontView fashionGoods : fashionGoodsList) {
+					RealGoodsConfigDto subInfo = new RealGoodsConfigDto();
+					subInfo.setLogo(fashionGoods.getLogo());
+					subInfo.setTitle(fashionGoods.getTitle());
+					subInfo.setPrice(fashionGoods.getMinPrice());
+					subInfo.setTags(fashionGoods.getTags());
+					subInfoList.add(subInfo);
+				}
+				realGoodsConfig.setSubInfoList(subInfoList);
+			}
+		}
+		return realGoodsConfigList;
+	}
+}

+ 4 - 0
netflix-service/src/main/java/com/cyksj/service/home/impl/HomeManagementConfigServiceImpl.java

@@ -51,6 +51,10 @@ public class HomeManagementConfigServiceImpl extends ServiceImpl<HomeManagementC
 				if (config.getAdType() == null) {
 					throw BusinessRuntimeException.getInstance("请选择对应的广告配置类型");
 				}
+			}else if (config.getType() == HomeManagementConfig.Type.rg) {
+				if (config.getRgType() == null) {
+					throw BusinessRuntimeException.getInstance("请选择对应的实物配置类型");
+				}
 			}
 			this.saveOrUpdate(homeManagementConfig);
 			return;

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/mange/CmsGroupService.java

@@ -20,5 +20,5 @@ public interface CmsGroupService extends IService<GroupsTrips> {
 
 	Integer getAvailableRelation(Long goodsId, Long skuId);
 
-    void sendChangeAccountMsg(Long groupsId, Long goodsId);
+    void sendChangeAccountMsg(Long groupsId, Long goodsId, String account);
 }

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/mange/goods/CmsGoodsDonSkuServiceImpl.java

@@ -97,7 +97,7 @@ public class CmsGoodsDonSkuServiceImpl extends ServiceImpl<GoodsDonSkuMapper,Goo
 		GoodsDonSku sku = skuMapper.selectOne(Wrappers.lambdaQuery(GoodsDonSku.class)
 				.eq(GoodsDonSku::getId, disSid).last("limit 1"));
 		if (sku == null) {
-			throw BusinessRuntimeException.getInstance("规格不存在");
+			throw BusinessRuntimeException.getInstance("优惠加购规格不存在");
 		}
 		if (!sku.getStatus()) {
 			throw BusinessRuntimeException.getInstance("{0}规格未上架", sku.getSpecVal());

+ 16 - 3
netflix-service/src/main/java/com/cyksj/service/mange/group/CmsGroupServiceImpl.java

@@ -1,5 +1,6 @@
 package com.cyksj.service.mange.group;
 
+import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateField;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
@@ -16,12 +17,14 @@ import com.cyksj.mapper.manage.GroupsTripsAccountReplaceRecordMapper;
 import com.cyksj.mapper.manage.cms.CmsUserMapper;
 import com.cyksj.model.entity.*;
 import com.cyksj.model.manage.views.AccountView;
+import com.cyksj.model.manage.views.GroupsRelationView;
 import com.cyksj.model.request.ReplaceTripsAccountReq;
 import com.cyksj.model.views.GroupsAccountView;
 import com.cyksj.redis.RedisService;
 import com.cyksj.service.mange.AccountCommonService;
 import com.cyksj.service.mange.CmsGroupService;
 import com.cyksj.service.sms.SmsService;
+import com.cyksj.service.user.UserSysMsgNotifyService;
 import com.ejlchina.searcher.BeanSearcher;
 import com.ejlchina.searcher.param.Operator;
 import com.ejlchina.searcher.util.MapBuilder;
@@ -74,6 +77,8 @@ public class CmsGroupServiceImpl extends ServiceImpl<GroupsMapper,GroupsTrips> i
 
     private final GroupsRelationAlertMapper alertMapper;
 
+    private final UserSysMsgNotifyService userSysMsgNotifyService;
+
     private static final GlobalThreadPoolTaskExecutor TASK_EXECUTOR = GlobalThreadPoolTaskExecutor.getInstance();
 
 
@@ -273,6 +278,9 @@ public class CmsGroupServiceImpl extends ServiceImpl<GroupsMapper,GroupsTrips> i
         }
        updateById(groupsTrips);
 
+        GoodsDon goodsDon = goodsDonMapper.selectById(account.getGoodsId());
+        userSysMsgNotifyService.recordUserAccountSetSysMsg(account.getGoodsId(), groupsTrips.getSkuId(), groupsRelations, account.getAccount(), goodsDon.getTitle());
+
         Integer alertCount = alertMapper.selectCount(Wrappers.lambdaQuery(GroupsRelationAlert.class)
                 .eq(GroupsRelationAlert::getSkuId, sku.getId())
                 .last("limit 1"));
@@ -364,7 +372,7 @@ public class CmsGroupServiceImpl extends ServiceImpl<GroupsMapper,GroupsTrips> i
 
         replaceRecordMapper.insert(replaceRecord);
 
-        TASK_EXECUTOR.execute(() -> sendChangeAccountMsg(groupsId, goodsId));;
+        TASK_EXECUTOR.execute(() -> sendChangeAccountMsg(groupsId, goodsId, account));;
     }
 
     @Override
@@ -419,12 +427,17 @@ public class CmsGroupServiceImpl extends ServiceImpl<GroupsMapper,GroupsTrips> i
     }
 
     @Override
-    public void sendChangeAccountMsg(Long groupsId, Long goodsId) {
+    public void sendChangeAccountMsg(Long groupsId, Long goodsId, String account) {
         GoodsDon goodsDon = goodsDonMapper.selectById(goodsId);
         String title = goodsDon != null ? goodsDon.getTitle() : "车票";
         DateTime now = DateTime.now();
         Boolean isPrd = envCommonService.isPrdEnv();
-        List<GroupsRelation> groupsRelations = beanSearcher.searchAll(GroupsRelation.class, MapUtils.builder().field(GroupsRelation::getGroupsId, groupsId).build());
+        List<GroupsRelationView> groupsRelations = beanSearcher.searchAll(GroupsRelationView.class, MapUtils.builder().field(GroupsRelationView::getGroupsId, groupsId).build());
+        if (CollUtil.isEmpty(groupsRelations)) {
+            return;
+        }
+        Long skuId = groupsMapper.selectById(groupsId).getSkuId();
+        userSysMsgNotifyService.recordUserAccountUpdateSysMsg(goodsId, skuId, groupsRelations, account, goodsDon.getTitle());
         groupsRelations.forEach(relation -> {
             if (relation.getExpiryTime() == null) {
                 return;

+ 3 - 3
netflix-service/src/main/java/com/cyksj/service/mange/impl/CmsOrderDonServiceImpl.java

@@ -712,7 +712,7 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
             }
             //若存在余额支付,退还余额
             if (orderDon.getBalance().compareTo(BigDecimal.ZERO) > 0) {
-                userBenefitsService.addUserBalance(orderDon.getUserId(), orderDon.getBalance(), UserBalanceSourceRecord.Source.balance, orderDon.getYhsId());
+                userBenefitsService.addUserBalance(orderDon.getUserId(), orderDon.getBalance(), UserBalanceSourceRecord.Source.refund, orderDon.getYhsId(), orderDon.getId(), goodsDon.getTitle() + UserBalanceSourceRecord.Source.refund.getDesc(), true);
             }
             try {
                 marketFrontService.subSpecificChanceNum(orderDon.getUserId(), orderDon.getId(), orderDon.getGoodsId(), orderDon.getUpdateTime());
@@ -726,7 +726,7 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
             }
             if (OrderDon.Type.BALANCE.getType().equals(refundType)) {
                 if (orderDon.getMoney().compareTo(BigDecimal.ZERO) > 0) {
-                    userBenefitsService.addUserBalance(orderDon.getUserId(), orderDon.getRefundBalance(), UserBalanceSourceRecord.Source.refund, orderDon.getYhsId());
+                    userBenefitsService.addUserBalance(orderDon.getUserId(), orderDon.getRefundBalance(), UserBalanceSourceRecord.Source.refund, orderDon.getYhsId(), orderDon.getId(), goodsDon.getTitle() + UserBalanceSourceRecord.Source.refund.getDesc(), true);
                 }
             } else {
                 //余额退款不需要扣除积分
@@ -951,7 +951,7 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
             if (refundBalance == null || refundBalance.compareTo(BigDecimal.ZERO) <= 0 || refundBalance.compareTo(orderDon.getMoney()) > 0) {
                 throw BusinessRuntimeException.getInstance("请输入正确的差价金额");
             }
-            userBenefitsService.addUserBalance(orderDon.getUserId(), refundBalance, UserBalanceSourceRecord.Source.price_differ, orderDon.getYhsId());
+            userBenefitsService.addUserBalance(orderDon.getUserId(), refundBalance, UserBalanceSourceRecord.Source.price_differ, orderDon.getYhsId(), orderDon.getId(), goodsDon.getTitle() + UserBalanceSourceRecord.Source.price_differ.getDesc(), true);
             orderDon.setRefundBalance(orderDonRefundBalance.add(refundBalance));
             orderDonMapper.updateById(orderDon);
         }

+ 24 - 3
netflix-service/src/main/java/com/cyksj/service/market/impl/MarketFrontServiceImpl.java

@@ -137,8 +137,29 @@ public class MarketFrontServiceImpl implements MarketFrontService {
 
 	@Override
 	public SignUser getUserSignDetail(Long userId) {
-		//未签到时,签到
-		SignUser signUser = signByUserId(userId);
+		SignUser signUser = signUserMapper.selectOne(Wrappers.lambdaQuery(SignUser.class)
+				.eq(SignUser::getUserId, userId).last("limit 1"));
+		if (signUser == null) {
+			signUser = new SignUser();
+			signUser.setUserId(userId);
+			signUser.setDay(0);
+			signUser.setDayPeriod(0);
+			signUser.setIsHadChecked(false);
+			return signUser;
+		}
+		Date updateTime = signUser.getUpdateTime();
+		DateTime signZero = DateUtil.beginOfDay(updateTime);
+		DateTime thisZero = DateUtil.beginOfDay(DateTime.now());
+		if (updateTime.getTime() < thisZero.getTime()) {
+			if (thisZero.getTime() - signZero.getTime() != Constant.DAY_MILLS) {
+				log.info("用户:{}断签,断签天数为:{}", signUser.getUserId(), signUser.getDayPeriod());
+				signUser.setDay(0);
+				signUser.setDayPeriod(0);
+			}
+			signUser.setIsHadChecked(false);
+		} else {
+			signUser.setIsHadChecked(true);
+		}
 		return signUser;
 	}
 
@@ -361,7 +382,7 @@ public class MarketFrontServiceImpl implements MarketFrontService {
 		DateTime signZero = DateUtil.beginOfDay(updateTime);
 		DateTime thisZero = DateUtil.beginOfDay(DateTime.now());
 		if (updateTime.getTime() >= thisZero.getTime()) {
-			signUser.setIsHadChecked(false);
+			signUser.setIsHadChecked(true);
 //            throw BusinessRuntimeException.getInstance("您已签到");
 		} else {
 			if (updateTime.before(thisZero) && thisZero.getTime() - signZero.getTime() == Constant.DAY_MILLS) {

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/market/task/impl/TaskServiceImpl.java

@@ -154,7 +154,7 @@ public class TaskServiceImpl implements TaskService {
 						if (taskView != null) {
 							if ("关注引导".equals(taskView.getTypeName()) && taskView.getBalance().compareTo(BigDecimal.ZERO) > 0) {
 								//发送余额
-								userBenefitsService.addUserBalance(dbPlatVerify.getUserId(), taskView.getBalance(), UserBalanceSourceRecord.Source.follow_task, 0l);
+								userBenefitsService.addUserBalance(dbPlatVerify.getUserId(), taskView.getBalance(), UserBalanceSourceRecord.Source.follow_task, 0l, null, taskView.getName(), true);
 								record.setBalance(taskView.getBalance());
 							}
 						}

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonCommentServiceImpl.java

@@ -64,7 +64,7 @@ public class OrderDonCommentServiceImpl implements OrderDonCommentService {
 						.eq(OrderCommentRewardConfig::getGoodsId, goodsId).last("limit 1"));
 				if (orderCommentRewardConfig != null) {
 					BigDecimal balance = orderCommentRewardConfig.getBalance();
-					userBenefitsService.addUserBalance(orderComment.getUserId(), balance, UserBalanceSourceRecord.Source.rd_comment, 0l);
+					userBenefitsService.addUserBalance(orderComment.getUserId(), balance, UserBalanceSourceRecord.Source.rd_comment, 0l, orderComment.getOrderId(), UserBalanceSourceRecord.Source.rd_comment.getDesc(), true);
 					log.info("审核订单:{}评价成功,发放余额:{}", orderComment.getOrderId(), balance.divide(BigDecimal.valueOf(100)));
 					orderCommentMapper.update(null, Wrappers.lambdaUpdate(OrderComment.class)
 							.set(OrderComment::getBalance, balance)

+ 17 - 12
netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java

@@ -255,6 +255,8 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 
 	private final UserPayOrderBlockMapper userPayOrderBlockMapper;
 
+	private final InformationClickUserRecordMapper informationClickUserRecordMapper;
+
 	private final List<String> noChekGoodsTemp = List.of("Apple One", "Youtube", "Spotify");
 
 	@Transactional(rollbackFor = Throwable.class)
@@ -597,6 +599,13 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 			}
 			corpInteractiveUserOrderRelationMapper.insert(corpInteractiveUserOrderRelation);
 		}
+		//记录文章下单量
+		if (payRequest.getInfoId() != null){
+			InformationClickUserRecord informationClickUserRecord = new InformationClickUserRecord();
+			informationClickUserRecord.setInfoId(payRequest.getInfoId());
+			informationClickUserRecord.setInfoId(orderDon.getId());
+			informationClickUserRecordMapper.insert(informationClickUserRecord);
+		}
 		return orderDon;
 	}
 
@@ -812,7 +821,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 				}
 				//返还余额
 				if (orderDon.getBalance().compareTo(BigDecimal.ZERO) > 0) {
-					userBenefitsService.addUserBalance(orderDon.getUserId(), orderDon.getBalance(), UserBalanceSourceRecord.Source.close, orderDon.getYhsId());
+					userBenefitsService.addUserBalance(orderDon.getUserId(), orderDon.getBalance(), null, null, null, null, false);
 				}
 
 				//是否是礼品卡 现金支付订单
@@ -1213,24 +1222,16 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 		if (orderDon.getMoney().compareTo(BigDecimal.ZERO) > 0) {
 			throw BusinessRuntimeException.getInstance("订单异常");
 		}
-		if (orderDon.getStatus() != OrderDon.Status.noPayment) {
-			throw BusinessRuntimeException.getInstance("订单状态已修改");
-		}
 		GoodsDon goodsDon = goodsDonMapper.selectById(orderDon.getGoodsId());
 		GoodsDonSku sku = null;
 		if (orderDon.getSkuId() != null) {
 			sku = goodsDonSkuMapper.selectById(orderDon.getSkuId());
 		}
-		orderDon.setStatus(goodsDon.getType() == 1 && goodsDon.getSecondType() == 2 ? OrderDon.Status.complete : OrderDon.Status.hasPayment);
-		updateGroupsTicket(orderDon, goodsDon, sku);
 		if (orderDon.getBalance().compareTo(BigDecimal.ZERO) > 0) {
 			orderDon.setType(OrderDon.Type.BALANCE);
 			orderDon.setPayTime(DateTime.now());
 		}
-		this.updateById(orderDon);
-
-		//调整指定规格车队下次可 停用车位数的时间
-		groupRelationFrontService.adjustGroupsParkingTime(orderDon.getRelationId(), sku);
+		unifiedHandlerOrderNotify(orderDon, goodsDon, sku);
 	}
 
 	public void updateCarParkAndSendMsg(GoodsDon goodsDon, GoodsDonSku sku, OrderDon order) {
@@ -2177,7 +2178,6 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 			Integer success = userMapper.deductBalance(user.getId(), subBalance, userBalance);
 			if (success != 1) throw BusinessRuntimeException.getInstance("您的余额不足!");
 			orderDon.setBalance(subBalance);
-			userBenefitsService.recordBalanceBySource(user.getId(), BigDecimal.valueOf(-subBalance.longValue()), UserBalanceSourceRecord.Source.payment);
 		}
 	}
 
@@ -2261,7 +2261,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 				.in(OrderDon::getStatus, List.of(OrderDon.Status.noPayment, OrderDon.Status.close))
 				.eq(OrderDon::getId, orderDon.getId()));
 		if (!isSuccess) {
-			log.info("支付宝回调商家订单号:{}订单状态已修改", orderDon.getOrderNo());
+			log.info("该订单{}状态已修改", orderDon.getOrderNo());
 			return;
 		}
 
@@ -2284,6 +2284,11 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 		//调整指定规格车队下次可 停用车位数的时间
 		groupRelationFrontService.adjustGroupsParkingTime(orderDon.getRelationId(), sku);
 
+		//余额使用记录
+		if (orderDon.getBalance().compareTo(BigDecimal.ZERO) > 0) {
+			userBenefitsService.recordBalanceBySource(orderDon.getUserId(), orderDon.getBalance().negate(), UserBalanceSourceRecord.Source.payment, orderDon.getId(), goodsDon.getTitle() + UserBalanceSourceRecord.Source.payment.getDesc());
+		}
+
 		TASK_POOL.execute(()->{
 			try {
 				//发放积分

+ 7 - 7
netflix-service/src/main/java/com/cyksj/service/scheduler/impl/SchedulerServiceImpl.java

@@ -201,19 +201,19 @@ public class SchedulerServiceImpl implements SchedulerService {
 							log.info("user_id:{},relationId:{}返回余额为0", userId, change_relationId);
 							return;
 						}
-						userBenefitsService.addUserBalance(userId, re_balance, UserBalanceSourceRecord.Source.clear_valid, relationView.getYhsId());
-						log.info("车票未到期清除,退款至用户user_id:{}余额:{}成功", userId, re_balance);
-						//修改订单状态 为退款
-						orderDon.setStatus(OrderDon.Status.refund);
-						orderDon.setRefundBalance(re_balance);
-						orderDon.setRefundMoney(BigDecimal.ZERO);
-						orderDonMapper.updateById(orderDon);
 						GoodsDon goodsDon = goodsMap.get(relationView.getGoodsId());
 						if (goodsDon == null) {
 							goodsDon = goodsDonMapper.selectById(relationView.getGoodsId());
 							if (goodsDon == null) return;
 							goodsMap.putIfAbsent(relationView.getGoodsId(), goodsDon);
 						}
+						userBenefitsService.addUserBalance(userId, re_balance, UserBalanceSourceRecord.Source.clear_valid, relationView.getYhsId(), orderDon.getId(), goodsDon.getTitle() + UserBalanceSourceRecord.Source.clear_valid.getDesc(), true);
+						log.info("车票未到期清除,退款至用户user_id:{}余额:{}成功", userId, re_balance);
+						//修改订单状态 为退款
+						orderDon.setStatus(OrderDon.Status.refund);
+						orderDon.setRefundBalance(re_balance);
+						orderDon.setRefundMoney(BigDecimal.ZERO);
+						orderDonMapper.updateById(orderDon);
 						GoodsDonSku sku = skuMap.get(orderDon.getSkuId());
 						if (sku == null) {
 							sku = skuMapper.selectById(orderDon.getSkuId());

+ 34 - 27
netflix-service/src/main/java/com/cyksj/service/template/impl/TemplateCommonServiceImpl.java

@@ -1,5 +1,6 @@
 package com.cyksj.service.template.impl;
 
+import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
@@ -23,9 +24,9 @@ import com.cyksj.model.manage.views.GroupsRelationView;
 import com.cyksj.model.views.WxAppTemplateView;
 import com.cyksj.service.sms.SmsService;
 import com.cyksj.service.template.TemplateCommonService;
+import com.cyksj.service.user.UserSysMsgNotifyService;
 import com.cyksj.service.wechat.WeChatService;
 import com.ejlchina.searcher.BeanSearcher;
-import com.ejlchina.searcher.param.Operator;
 import com.ejlchina.searcher.util.MapBuilder;
 import com.ejlchina.searcher.util.MapUtils;
 import lombok.RequiredArgsConstructor;
@@ -65,6 +66,8 @@ public class TemplateCommonServiceImpl implements TemplateCommonService {
 
 	private final SmsService smsService;
 
+	private final UserSysMsgNotifyService userSysMsgNotifyService;
+
 	public void newOderSendMsgByType(OrderDon order, GoodsDon goodsDon, User user, String toPeople, Boolean isCustomer) throws Exception {
 		if (!EnvCommonService.active.equals(envCommonService.getEnv())) {
 			String openId = toPeople;
@@ -209,32 +212,36 @@ public class TemplateCommonServiceImpl implements TemplateCommonService {
 
 	@Override
 	public void sendAccountTemplateMsg(Account account) throws Exception {
-		if (!EnvCommonService.active.equals(envCommonService.getEnv())) {
-			List<GroupsRelationView> relations = beanSearcher.searchList(GroupsRelationView.class, MapUtils.builder()
-					.field(GroupsRelationView::getAccountId, account.getId()).op(Operator.Equal)
-					.field(GroupsRelationView::getStatus, "validity").op(Operator.Equal)
-					.build());
-			Boolean isPrdEnv = envCommonService.isPrdEnv();
-			GoodsDon goodsDon = goodsDonMapper.selectById(account.getGoodsId());
-			String title = goodsDon != null ? goodsDon.getTitle() : "车票";
-			DateTime now = DateTime.now();
-			log.info("开始发送账号修改密码模板消息,大小:{}", relations.size());
-			for (GroupsRelationView relation : relations) {
-				if (relation.getExpiryTime() == null) {
-					return;
-				}
-				//账号有效期小于5天的人,不发账号替换/改密码短信提醒
-				if (now.after(DateUtil.offsetDay(relation.getExpiryTime(), -5))) {
-					return;
-				}
-				//去掉GPT过滤平台
-				if (Constant.CHANGE_ACCOUNT_PWD_FILTER_GIDS.get(1) == account.getGoodsId()) {
-					return;
-				}
-				if (relation.getUserId() != 0 && isPrdEnv && relation.getYhsId() == 0) {
-					String msg = String.format(Constant.CHANGE_GROUPS_TRIPS_ACCOUNT, title);
-					smsService.sendSmsToRelationUser(relation.getUserId(), msg);
-				}
+		boolean isPrd = envCommonService.isPrdEnv();
+		List<GroupsRelationView> relations = beanSearcher.searchList(GroupsRelationView.class, MapUtils.builder()
+				.field(GroupsRelationView::getAccountId, account.getId())
+				.field(GroupsRelationView::getStatus, "validity")
+				.build());
+		if (CollUtil.isEmpty(relations)) {
+			return;
+		}
+		Boolean isPrdEnv = envCommonService.isPrdEnv();
+		GoodsDon goodsDon = goodsDonMapper.selectById(account.getGoodsId());
+		String title = goodsDon != null ? goodsDon.getTitle() : "车票";
+		DateTime now = DateTime.now();
+		log.info("开始发送账号修改密码模板消息,大小:{}", relations.size());
+		Long skuId = relations.get(0).getSkuId();
+		userSysMsgNotifyService.recordUserAccountUpdateSysMsg(account.getGoodsId(), skuId, relations, account.getAccount(), goodsDon.getTitle());
+		for (GroupsRelationView relation : relations) {
+			if (relation.getExpiryTime() == null) {
+				return;
+			}
+			//账号有效期小于5天的人,不发账号替换/改密码短信提醒
+			if (now.after(DateUtil.offsetDay(relation.getExpiryTime(), -5))) {
+				return;
+			}
+			//去掉GPT过滤平台
+			if (Constant.CHANGE_ACCOUNT_PWD_FILTER_GIDS.get(1) == account.getGoodsId()) {
+				return;
+			}
+			if (relation.getUserId() != 0 && isPrdEnv && relation.getYhsId() == 0 && isPrd) {
+				String msg = String.format(Constant.CHANGE_GROUPS_TRIPS_ACCOUNT, title);
+				smsService.sendSmsToRelationUser(relation.getUserId(), msg);
 			}
 		}
 	}

+ 2 - 8
netflix-service/src/main/java/com/cyksj/service/user/UserBenefitsService.java

@@ -1,7 +1,6 @@
 package com.cyksj.service.user;
 
 import com.cyksj.model.entity.UserBalanceSourceRecord;
-import com.cyksj.model.entity.UserGalaxycoinRecord;
 
 import java.math.BigDecimal;
 
@@ -27,7 +26,7 @@ public interface UserBenefitsService {
 	/**
 	 * 增加用户余额
 	 */
-	void addUserBalance(Long userId, BigDecimal addBalance, UserBalanceSourceRecord.Source source, Long yhsId);
+	void addUserBalance(Long userId, BigDecimal addBalance, UserBalanceSourceRecord.Source source, Long yhsId, Long orderId, String detail, Boolean isRecord);
 
 	/**
 	 * 扣除用户余额
@@ -37,7 +36,7 @@ public interface UserBenefitsService {
 	/**
 	 * 记录用于余额来源
 	 */
-	void recordBalanceBySource(Long userId, BigDecimal balance, UserBalanceSourceRecord.Source source);
+	void recordBalanceBySource(Long userId, BigDecimal balance, UserBalanceSourceRecord.Source source, Long orderId, String detail);
 
 	void addYhsMoney(Long userId, BigDecimal money);
 
@@ -45,9 +44,4 @@ public interface UserBenefitsService {
 	 * 扣除店铺主用户 提成金额
 	 */
 	void deductYhShopTakeMoney(Long orderId, Long shopUserId, BigDecimal deductMoney);
-
-	/**
-	 * 修改用户银河币
-	 */
-	void updateGalaxycoin(Long userId, BigDecimal addGalaxycoin, UserGalaxycoinRecord.Source source);
 }

+ 20 - 0
netflix-service/src/main/java/com/cyksj/service/user/UserSysMsgNotifyService.java

@@ -0,0 +1,20 @@
+package com.cyksj.service.user;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.cyksj.model.entity.GroupsRelation;
+import com.cyksj.model.entity.UserSysMsgNotify;
+import com.cyksj.model.manage.views.GroupsRelationView;
+
+import java.util.List;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: UserSysMsgNotifyService
+ * 创建者: JavaZou
+ * 创建时间:2024/2/4 16:03
+ */
+public interface UserSysMsgNotifyService extends IService<UserSysMsgNotify> {
+	void recordUserAccountUpdateSysMsg(Long goodsId, Long skuId, List<GroupsRelationView> relations, String account, String title);
+
+	void recordUserAccountSetSysMsg(Long goodsId, Long skuId, List<GroupsRelation> groupsRelations, String account, String title);
+}

+ 17 - 32
netflix-service/src/main/java/com/cyksj/service/user/impl/UserBenefitsServiceImpl.java

@@ -7,7 +7,10 @@ import com.cyksj.mapper.UserBalanceSourceRecordMapper;
 import com.cyksj.mapper.UserGalaxycoinRecordMapper;
 import com.cyksj.mapper.UserMapper;
 import com.cyksj.mapper.shop.YhShopDistributeOrdersDeductPointsRecordMapper;
-import com.cyksj.model.entity.*;
+import com.cyksj.model.entity.DistributeOrdersDeductPointsRecord;
+import com.cyksj.model.entity.User;
+import com.cyksj.model.entity.UserBalanceSourceRecord;
+import com.cyksj.model.entity.YhShopDistributeOrdersDeductPointsRecord;
 import com.cyksj.service.sms.SmsService;
 import com.cyksj.service.user.UserBenefitsService;
 import lombok.RequiredArgsConstructor;
@@ -72,7 +75,7 @@ public class UserBenefitsServiceImpl implements UserBenefitsService {
 	}
 
 	@Override
-	public void addUserBalance(Long userId, BigDecimal addBalance, UserBalanceSourceRecord.Source source,Long yhsId) {
+	public void addUserBalance(Long userId, BigDecimal addBalance, UserBalanceSourceRecord.Source source, Long yhsId, Long orderId, String detail, Boolean isRecord) {
 		if (addBalance.compareTo(BigDecimal.ZERO) <= 0) {
 			return;
 		}
@@ -82,15 +85,15 @@ public class UserBenefitsServiceImpl implements UserBenefitsService {
 			BigDecimal balance = user.getBalance();
 			Integer success = userMapper.addUserBalance(user.getId(), balance, addBalance);
 			if (success == 1) {
-				recordBalanceBySource(userId, addBalance, source);
-				if (envCommonService.isPrdEnv()) {
-					if (source != UserBalanceSourceRecord.Source.close && source != UserBalanceSourceRecord.Source.balance && yhsId == 0) {
-						try {
-							//短信到账提醒
-							String msg = String.format(Constant.BALANCE_NOTIFY_MSG, addBalance.divide(BigDecimal.valueOf(100)));
-							smsService.sendSmsToRelationUser(userId, msg);
-						} catch (Exception e) {
-						}
+				if (isRecord) {
+					recordBalanceBySource(userId, addBalance, source, orderId, detail);
+				}
+				if (envCommonService.isPrdEnv() && isRecord && yhsId == 0) {
+					try {
+						//短信到账提醒
+						String msg = String.format(Constant.BALANCE_NOTIFY_MSG, addBalance.divide(BigDecimal.valueOf(100)));
+						smsService.sendSmsToRelationUser(userId, msg);
+					} catch (Exception e) {
 					}
 				}
 				break;
@@ -125,11 +128,13 @@ public class UserBenefitsServiceImpl implements UserBenefitsService {
 	}
 
 	@Override
-	public void recordBalanceBySource(Long userId, BigDecimal balance, UserBalanceSourceRecord.Source source) {
+	public void recordBalanceBySource(Long userId, BigDecimal balance, UserBalanceSourceRecord.Source source, Long orderId, String detail) {
 		UserBalanceSourceRecord userBalanceSourceRecord = new UserBalanceSourceRecord();
 		userBalanceSourceRecord.setUserId(userId);
 		userBalanceSourceRecord.setBalance(balance);
 		userBalanceSourceRecord.setSource(source);
+		userBalanceSourceRecord.setOrderId(orderId);
+		userBalanceSourceRecord.setDetail(detail);
 		userBalanceSourceRecordMapper.insert(userBalanceSourceRecord);
 	}
 
@@ -178,24 +183,4 @@ public class UserBenefitsServiceImpl implements UserBenefitsService {
 
 		}
 	}
-
-
-	@Override
-	public void updateGalaxycoin(Long userId, BigDecimal addGalaxycoin, UserGalaxycoinRecord.Source source) {
-		if (addGalaxycoin.compareTo(BigDecimal.ZERO) == 0) {
-			return;
-		}
-		while (true) {
-			User user = userMapper.selectById(userId);
-			if (user == null) break;
-			Integer success = userMapper.updateGalaxycoin(user.getId(), addGalaxycoin, user.getGalaxycoin());
-			if (success == 1) break;
-			UserGalaxycoinRecord record = new UserGalaxycoinRecord();
-			record.setUserId(userId);
-			record.setGalaxycoin(addGalaxycoin);
-			record.setSource(source);
-			record.setRemark(source.getDesc());
-			userGalaxycoinRecordMapper.insert(record);
-		}
-	}
 }

+ 9 - 10
netflix-service/src/main/java/com/cyksj/service/user/impl/UserServiceImpl.java

@@ -224,16 +224,15 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
 	    }
 	    BeanUtil.copyProperties(user, userWhoami);
 
-	    if (StrUtil.isEmpty(user.getLoginPhone())) {
-		    UserBindDetail bindPhone = userBindDetailMapper.selectOne(Wrappers.lambdaQuery(UserBindDetail.class)
-				    .eq(StrUtil.isNotEmpty(user.getOpenId()), UserBindDetail::getUserId, userId)
-				    .eq(StrUtil.isNotEmpty(user.getEmail()), UserBindDetail::getEmailUserId, userId).last("limit 1"));
-		    //手机号
-		    if (bindPhone != null) {
-			    userWhoami.setBindPhone(bindPhone.getPhone());
-			    userWhoami.setBindEmail(bindPhone.getEmail());
-		    }
-	    }
+		UserBindDetail bindPhone = userBindDetailMapper.selectOne(Wrappers.lambdaQuery(UserBindDetail.class)
+				.eq(StrUtil.isNotEmpty(user.getOpenId()), UserBindDetail::getUserId, userId)
+				.eq(StrUtil.isNotBlank(user.getLoginPhone()), UserBindDetail::getPhoneUserId, userId)
+				.eq(StrUtil.isNotEmpty(user.getEmail()), UserBindDetail::getEmailUserId, userId).last("limit 1"));
+		//手机号
+		if (bindPhone != null) {
+			userWhoami.setBindPhone(bindPhone.getPhone());
+			userWhoami.setBindEmail(bindPhone.getEmail());
+		}
 	    Integer type = 3;
 	    if (StrUtil.isNotBlank(user.getLoginPhone())) {
 		    type = 1;

+ 59 - 0
netflix-service/src/main/java/com/cyksj/service/user/impl/UserSysMsgNotifyServiceImpl.java

@@ -0,0 +1,59 @@
+package com.cyksj.service.user.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.cyksj.common.constant.Constant;
+import com.cyksj.mapper.UserSysMsgNotifyMapper;
+import com.cyksj.model.entity.GroupsRelation;
+import com.cyksj.model.entity.UserSysMsgNotify;
+import com.cyksj.model.manage.views.GroupsRelationView;
+import com.cyksj.service.user.UserSysMsgNotifyService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: UserSysMsgNotifyServiceImpl
+ * 创建者: JavaZou
+ * 创建时间:2024/2/4 16:03
+ */
+@Service
+@RequiredArgsConstructor
+@Slf4j
+public class UserSysMsgNotifyServiceImpl extends ServiceImpl<UserSysMsgNotifyMapper, UserSysMsgNotify> implements UserSysMsgNotifyService {
+	private final UserSysMsgNotifyMapper userSysMsgNotifyMapper;
+
+
+	@Override
+	public void recordUserAccountUpdateSysMsg(Long goodsId, Long skuId, List<GroupsRelationView> relations, String account, String title) {
+		String sysMsg = String.format(Constant.ACCOUNT_PWD_UPDATE_SYS_MSG_NOTIFY, title);
+		Set<Long> userSet = new HashSet<>();
+		List<GroupsRelationView> collect = relations.stream().filter(e -> {
+			if (userSet.contains(e.getUserId())) {
+				return false;
+			}
+			userSet.add(e.getUserId());
+			return true;
+		}).collect(Collectors.toList());
+		userSysMsgNotifyMapper.recordUserAccountUpdateSysMsg(goodsId, skuId, collect, account, sysMsg);
+	}
+
+	@Override
+	public void recordUserAccountSetSysMsg(Long goodsId, Long skuId, List<GroupsRelation> relations, String account, String title) {
+		String sysMsg = String.format(Constant.ACCOUNT_SET_SYS_MSG_NOTIFY, title);
+		Set<Long> userSet = new HashSet<>();
+		List<GroupsRelation> collect = relations.stream().filter(e -> {
+			if (userSet.contains(e.getUserId())) {
+				return false;
+			}
+			userSet.add(e.getUserId());
+			return true;
+		}).collect(Collectors.toList());
+		userSysMsgNotifyMapper.recordUserAccountSetSysMsg(goodsId, skuId, collect, account, sysMsg);
+	}
+}

+ 40 - 0
netflix-web/src/main/java/com/cyksj/web/controller/goods/GoodsDonController.java

@@ -22,6 +22,7 @@ import com.cyksj.model.entity.*;
 import com.cyksj.model.request.ClickRecordReq;
 import com.cyksj.model.views.*;
 import com.cyksj.redis.RedisService;
+import com.cyksj.service.goods.GoodsDonFrontService;
 import com.cyksj.service.home.ClickRecordFrontService;
 import com.cyksj.service.shop.YhShopFrontService;
 import com.cyksj.web.util.StpUserUtil;
@@ -69,6 +70,8 @@ public class GoodsDonController {
 
 	private final YhShopFrontService yhShopFrontService;
 
+	private final GoodsDonFrontService goodsDonFrontService;
+
 	/**
      * 获取平台商品分类
      */
@@ -906,4 +909,41 @@ public class GoodsDonController {
 		});
 		return GatewayResponse.SUCCESS.newBuilder().toResult(list);
 	}
+
+	/**
+	 * 获取pc广告配置
+	 */
+	@GetMapping("/get/pc/homeManage")
+	public Result<Map<String, List<HomeManagementFrontView>>> getPcHomeManagementFrontPage() {
+		String key = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "pc:homeManage";
+		Object o = redisService.get(key);
+		if (o == null) {
+			MapBuilder builder = MapUtils.builder()
+					.field(HomeManagementFrontView::getAdType, List.of(HomeManagementConfig.AdType.pc.name(), HomeManagementConfig.AdType.pcSec.name(), HomeManagementConfig.AdType.pcDis.name())).op(Operator.InList);
+			List<HomeManagementFrontView> homeManagementFrontViews = beanSearcher.searchAll(HomeManagementFrontView.class, builder.build());
+			Map<HomeManagementConfig.AdType, List<HomeManagementFrontView>> map = homeManagementFrontViews.stream().collect(Collectors.groupingBy(HomeManagementFrontView::getAdType));
+			redisService.setNx(key, map, 50 * 60l);
+			o = redisService.get(key);
+		}
+		Map<String, List<HomeManagementFrontView>> map = Jsons.parseObject(o, Map.class);
+		return GatewayResponse.SUCCESS.newBuilder().toResult(map);
+	}
+
+	/**
+	 * 获取pc实物配置
+	 */
+	@GetMapping("/get/pc/realGoodsConfig")
+	public Result<? extends Object> getPcRealGoodsConfig() throws Exception {
+		String key = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "pc:realHomePage";
+		Object o = redisService.get(key);
+		List<HomeManagementFrontView> list = null;
+		if (o == null) {
+			list = goodsDonFrontService.getRealGoodsConfig();
+			redisService.setNx(key, list, RedisService.key.YH_HOME_PAGHE_CACHE.getTimeout() + 300);
+		}
+		if (list == null && o != null) {
+			list = Jsons.parseList(o, HomeManagementFrontView.class);
+		}
+		return GatewayResponse.SUCCESS.newBuilder().toResult(list);
+	}
 }

+ 2 - 12
netflix-web/src/main/java/com/cyksj/web/controller/information/InformationController.java

@@ -1,12 +1,9 @@
 package com.cyksj.web.controller.information;
 
-import cn.hutool.core.collection.CollUtil;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.cyksj.common.util.Jsons;
 import com.cyksj.dto.Result;
 import com.cyksj.enums.GatewayResponse;
-import com.cyksj.model.entity.Information;
 import com.cyksj.model.entity.InformationCategory;
 import com.cyksj.model.views.GoodsFrontListView;
 import com.cyksj.model.views.InformationDetailView;
@@ -14,7 +11,6 @@ import com.cyksj.model.views.InformationListView;
 import com.cyksj.redis.RedisService;
 import com.cyksj.service.information.InformationCategoryService;
 import com.cyksj.service.information.InformationService;
-import com.cyksj.web.util.StpUserUtil;
 import com.ejlchina.searcher.BeanSearcher;
 import com.ejlchina.searcher.param.Operator;
 import com.ejlchina.searcher.util.MapUtils;
@@ -24,7 +20,6 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.List;
-import java.util.Optional;
 
 /**
  * @author zwhui
@@ -49,13 +44,8 @@ public class InformationController {
      * 查询发现页文章列表
      */
     @GetMapping("/get")
-    public Result<IPage<InformationListView>> getInformation(Long categoryId, @RequestParam(defaultValue = "0") Integer start, @RequestParam(defaultValue = "5") Integer limit){
-        String key = RedisService.key.INFORMATION_KEY.getEnvName() + "categoryId:" + categoryId;
-        IPage<InformationListView> information = (IPage<InformationListView>) redisService.get(key);
-        if (information == null) {
-            information = informationService.getInformation(categoryId, start, limit);
-            redisService.setNx(key, information, RedisService.key.INFORMATION_KEY.getTimeout());
-        }
+    public Result<IPage<InformationListView>> getInformation(Long categoryId, @RequestParam(defaultValue = "0") Integer start, @RequestParam(defaultValue = "5") Integer limit) {
+        IPage<InformationListView> information = informationService.getInformation(categoryId, start, limit);
         return GatewayResponse.SUCCESS.newBuilder().toResult(information);
     }
 

+ 2 - 2
netflix-web/src/main/java/com/cyksj/web/controller/manage/CmsUserController.java

@@ -75,7 +75,7 @@ public class CmsUserController{
 
     private final OrderDonMapper orderDonMapper;
 
-    private final UserBenefitsService UserBenefitsService;
+    private final UserBenefitsService userBenefitsService;
 
     private final UserPayOrderBlockService userPayOrderBlockService;
 
@@ -334,7 +334,7 @@ public class CmsUserController{
         if (update == 0) {
             throw BusinessRuntimeException.getInstance("扣除用户余额失败,请重试...");
         }
-        UserBenefitsService.recordBalanceBySource(userId, deductBalance.negate(), UserBalanceSourceRecord.Source.manual);
+        userBenefitsService.recordBalanceBySource(userId, deductBalance.negate(), UserBalanceSourceRecord.Source.manual, null, UserBalanceSourceRecord.Source.manual.getDesc());
         return GatewayResponse.SUCCESS.newBuilder().toResult();
     }
 

+ 4 - 2
netflix-web/src/main/java/com/cyksj/web/controller/manage/account/CmsAccountController.java

@@ -467,7 +467,7 @@ public class CmsAccountController {
     @PutMapping("/update")
     @SaCheckPermission("account:update")
     @Log(module = "平台管理/编辑账号", businessType = BusinessType.PUT, isSaveRequestData = true)
-    public Result<String> update(@RequestBody Account account){
+    public Result<String> update(@RequestBody Account account) throws Exception {
 	    Account db = accountService.getById(account.getId());
 	    if (db == null) {
 		    throw BusinessRuntimeException.getInstance("该账号不存在");
@@ -533,6 +533,7 @@ public class CmsAccountController {
 		    //清除gpt token
 		    redisService.del(RedisKey.CHATGPT_ACCESS_TOKEN + dbAccount);
 		    redisService.del(RedisService.key.CHAT_GPT_TOKEN_EXCEPTION_KEY.getName() + dbAccount);
+		    templateCommonService.sendAccountTemplateMsg(account);
 	    }
 	    //时间有效
 	    if (account.getExpiryTime() != null && account.getExpiryTime().after(DateTime.now())) {
@@ -1006,7 +1007,8 @@ public class CmsAccountController {
 					GroupsTrips groupsTrips = groupsMapper.selectOne(Wrappers.lambdaQuery(GroupsTrips.class)
 							.eq(GroupsTrips::getAccountId, accountId).last("limit 1"));
 					if (groupsTrips != null) {
-						cmsGroupService.sendChangeAccountMsg(groupsTrips.getId(), goodsId);
+						Account byId = accountService.getById(accountId);
+						cmsGroupService.sendChangeAccountMsg(groupsTrips.getId(), goodsId, byId.getAccount());
 					}
 				});
 			});

+ 9 - 0
netflix-web/src/main/java/com/cyksj/web/controller/manage/goods/CmsGoodsDonCategoryController.java

@@ -176,6 +176,15 @@ public class CmsGoodsDonCategoryController {
 		return GatewayResponse.SUCCESS.newBuilder().toResult();
 	}
 
+	/**
+	 * 移除分类下的平台
+	 */
+	@DeleteMapping("/delete/{relateId}")
+	public Result<String> deleteCategoryByRelateId(@PathVariable Long relateId) {
+		goodsDonCategoryRelateService.removeById(relateId);
+		return GatewayResponse.SUCCESS.newBuilder().toResult();
+	}
+
 	/**
 	 * 获取所有分类列表
 	 */

+ 30 - 2
netflix-web/src/main/java/com/cyksj/web/controller/manage/information/CmsInformationController.java

@@ -15,6 +15,7 @@ import com.cyksj.service.information.InformationCategoryService;
 import com.cyksj.service.information.InformationService;
 import com.ejlchina.searcher.BeanSearcher;
 import com.ejlchina.searcher.SearchResult;
+import com.ejlchina.searcher.util.MapBuilder;
 import com.ejlchina.searcher.util.MapUtils;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
@@ -75,12 +76,39 @@ public class CmsInformationController {
         return GatewayResponse.SUCCESS.newBuilder().toResult();
     }
 
+
+    /**
+     * 文章排序
+     */
+    @PutMapping("/sorted")
+    public Result<String> sortedInformation(@RequestBody Information information) {
+        if (information.getId() == null) {
+            throw BusinessRuntimeException.getInstance("请指定要排序的文章");
+        }
+        Integer sorted = information.getSorted();
+        if (sorted != null && sorted >= 0) {
+            Information byId = informationService.getById(information.getId());
+            if (byId != null && byId.getSorted() != sorted) {
+                byId.setSorted(sorted);
+                informationService.updateById(byId);
+                Set<String> keys = redisService.keys(RedisService.key.INFORMATION_KEY.getName() + "*");
+                redisService.del(keys.toArray(String[]::new));
+            }
+        }
+        return GatewayResponse.SUCCESS.newBuilder().toResult();
+    }
+
+
     /**
      * 获取文章
      */
     @GetMapping("/get")
-    public Result<SearchResult<InformationView>> getInformation() {
-        SearchResult<InformationView> list = beanSearcher.search(InformationView.class, MapUtils.flatBuilder(request.getParameterMap()).build());
+    public Result<SearchResult<InformationView>> getInformation(Long category) {
+        MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
+        if (category != null) {
+            builder.put("ct", String.format(" and JSON_CONTAINS(i.category_ids,'\"%s\"')", category));
+        }
+        SearchResult<InformationView> list = beanSearcher.search(InformationView.class, builder.build());
         list.getDataList().forEach(data -> {
             try {
                 List<Long> goodsIds = Jsons.parseList(data.getGoodsIds(), Long.class);

+ 2 - 2
netflix-web/src/main/java/com/cyksj/web/controller/market/SignFrontController.java

@@ -52,10 +52,10 @@ public class SignFrontController {
      * 每日签到
      */
     @PostMapping("/post")
-    public Result<Integer> sign() {
+    public Result<SignUser> sign() {
         Long userId = StpUserUtil.getLoginIdAsLong();
         SignUser signUser = marketFrontService.signByUserId(userId);
-        return GatewayResponse.SUCCESS.newBuilder().setMsg("签到成功").toResult(signUser.getDayPeriod());
+        return GatewayResponse.SUCCESS.newBuilder().setMsg("签到成功").toResult(signUser);
     }
 
     /**

+ 14 - 2
netflix-web/src/main/java/com/cyksj/web/controller/payment/OrderController.java

@@ -626,6 +626,18 @@ public class OrderController {
         return "";
     }
 
-
-
+    /**
+     * 余额明细
+     */
+    @GetMapping("/get/balance/detail")
+    public Result<SearchResult<UserBalanceSourceRecord>> getUserBalanceSourceRecord() {
+        long userId = StpUserUtil.getLoginIdAsLong();
+        SearchResult<UserBalanceSourceRecord> search = beanSearcher.search(UserBalanceSourceRecord.class, MapUtils.flatBuilder(request.getParameterMap())
+                .field(UserBalanceSourceRecord::getUserId, userId)
+                .field(UserBalanceSourceRecord::getDetail).op(Operator.NotNull)
+                .orderBy(UserBalanceSourceRecord::getId).desc()
+                .onlySelect(UserBalanceSourceRecord::getBalance, UserBalanceSourceRecord::getDetail, UserBalanceSourceRecord::getCreatedTime)
+                .build());
+        return GatewayResponse.SUCCESS.newBuilder().toResult(search);
+    }
 }

+ 81 - 0
netflix-web/src/main/java/com/cyksj/web/controller/sys/UserSysMsgController.java

@@ -0,0 +1,81 @@
+package com.cyksj.web.controller.sys;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.cyksj.dto.Result;
+import com.cyksj.enums.GatewayResponse;
+import com.cyksj.mapper.UserSysMsgNotifyMapper;
+import com.cyksj.model.entity.UserSysMsgNotify;
+import com.cyksj.service.user.UserBindRelationService;
+import com.cyksj.web.util.StpUserUtil;
+import com.ejlchina.searcher.BeanSearcher;
+import com.ejlchina.searcher.SearchResult;
+import com.ejlchina.searcher.param.Operator;
+import com.ejlchina.searcher.util.MapUtils;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+import java.util.Optional;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: UserSysMsgController
+ * 创建者: JavaZou
+ * 创建时间:2024/2/4 16:58
+ */
+@RequestMapping("/sys/msg")
+@RestController
+@RequiredArgsConstructor
+public class UserSysMsgController {
+
+	private final BeanSearcher beanSearcher;
+
+	private final UserBindRelationService userBindRelationService;
+
+	private final UserSysMsgNotifyMapper userSysMsgNotifyMapper;
+
+	private final HttpServletRequest request;
+
+
+	/**
+	 * 用户系统消息
+	 */
+	@GetMapping("/get")
+	public Result<SearchResult<UserSysMsgNotify>> getSysMsg() {
+		long userId = StpUserUtil.getLoginIdAsLong();
+		List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
+		SearchResult<UserSysMsgNotify> search = beanSearcher.search(UserSysMsgNotify.class, MapUtils.flatBuilder(request.getParameterMap()).field(UserSysMsgNotify::getUserId, userIdList).op(Operator.InList).field(UserSysMsgNotify::getDeleted, 1).orderBy(UserSysMsgNotify::getIsView).orderBy(UserSysMsgNotify::getCreatedTime).desc().onlySelect(UserSysMsgNotify::getId, UserSysMsgNotify::getAccount, UserSysMsgNotify::getRelationId, UserSysMsgNotify::getMsg, UserSysMsgNotify::getIsView).build());
+		return GatewayResponse.SUCCESS.newBuilder().toResult(search);
+	}
+
+	/**
+	 * 查看消息
+	 */
+	@GetMapping("/view/detail/{id}")
+	public Result viewMsgDetail(@PathVariable Long id) {
+		long userId = StpUserUtil.getLoginIdAsLong();
+		List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
+		Optional.ofNullable(userSysMsgNotifyMapper.selectOne(Wrappers.lambdaQuery(UserSysMsgNotify.class).eq(UserSysMsgNotify::getId, id).in(UserSysMsgNotify::getUserId, userIdList).eq(UserSysMsgNotify::getDeleted, 1))).ifPresent(e -> {
+			if (!e.getIsView()) {
+				e.setIsView(false);
+				userSysMsgNotifyMapper.updateById(e);
+			}
+		});
+		return GatewayResponse.SUCCESS.newBuilder().toResult();
+	}
+
+	/**
+	 * 删除消息
+	 */
+	@DeleteMapping("/del/{id}")
+	public Result delMsg(@PathVariable Long id) {
+		long userId = StpUserUtil.getLoginIdAsLong();
+		List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
+		Optional.ofNullable(userSysMsgNotifyMapper.selectOne(Wrappers.lambdaQuery(UserSysMsgNotify.class).eq(UserSysMsgNotify::getId, id).in(UserSysMsgNotify::getUserId, userIdList).eq(UserSysMsgNotify::getDeleted, 1))).ifPresent(e -> {
+			e.setDeleted(false);
+			userSysMsgNotifyMapper.updateById(e);
+		});
+		return GatewayResponse.SUCCESS.newBuilder().toResult();
+	}
+}