Преглед изворни кода

Merge branch 'information-27' into dev

# Conflicts:
#	netflix-dao/src/main/java/com/cyksj/model/entity/Information.java
#	netflix-dao/src/main/java/com/cyksj/model/views/InformationDetailView.java
#	netflix-dao/src/main/java/com/cyksj/model/views/InformationListView.java
#	netflix-dao/src/main/java/com/cyksj/model/views/InformationView.java
#	netflix-dao/src/main/resources/mapper/OrderDonMapper.xml
#	netflix-service/src/main/java/com/cyksj/service/home/HomeManagementConfigService.java
#	netflix-service/src/main/java/com/cyksj/service/home/impl/HomeManagementConfigServiceImpl.java
#	netflix-web/src/main/java/com/cyksj/web/controller/manage/home/HomeManageConfigController.java
zoujiajian пре 2 година
родитељ
комит
ceadd83173
35 измењених фајлова са 609 додато и 144 уклоњено
  1. 2 2
      netflix-dao/src/main/java/com/cyksj/mapper/OrderDonMapper.java
  2. 3 1
      netflix-dao/src/main/java/com/cyksj/mapper/corp/CorpUserFollowRelationMapper.java
  3. 2 0
      netflix-dao/src/main/java/com/cyksj/mapper/manage/coupon/CouponMapper.java
  4. 13 0
      netflix-dao/src/main/java/com/cyksj/mapper/order/ShoppingCartDonMapper.java
  5. 2 0
      netflix-dao/src/main/java/com/cyksj/model/dto/CorpFollowServiceDto.java
  6. 3 1
      netflix-dao/src/main/java/com/cyksj/model/dto/YhServiceDto.java
  7. 14 3
      netflix-dao/src/main/java/com/cyksj/model/entity/CorpMsgBulkTask.java
  8. 5 0
      netflix-dao/src/main/java/com/cyksj/model/entity/Information.java
  9. 22 0
      netflix-dao/src/main/java/com/cyksj/model/entity/ShoppingCartDon.java
  10. 6 0
      netflix-dao/src/main/java/com/cyksj/model/views/InformationDetailView.java
  11. 5 0
      netflix-dao/src/main/java/com/cyksj/model/views/InformationListView.java
  12. 6 3
      netflix-dao/src/main/java/com/cyksj/model/views/InformationView.java
  13. 63 8
      netflix-dao/src/main/resources/mapper/CorpUserFollowRelationMapper.xml
  14. 7 0
      netflix-dao/src/main/resources/mapper/CouponMapper.xml
  15. 14 21
      netflix-dao/src/main/resources/mapper/OrderDonMapper.xml
  16. 65 0
      netflix-service/src/main/java/com/cyksj/common/service/CropDutyServiceDateService.java
  17. 1 1
      netflix-service/src/main/java/com/cyksj/service/corp/CorpTagService.java
  18. 1 1
      netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpFollowActiveCodeFrontServiceImpl.java
  19. 58 30
      netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpMsgBulkTaskServiceImpl.java
  20. 3 3
      netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpTagServiceImpl.java
  21. 1 0
      netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpUserServiceImpl.java
  22. 4 0
      netflix-service/src/main/java/com/cyksj/service/home/HomeManagementConfigService.java
  23. 12 6
      netflix-service/src/main/java/com/cyksj/service/home/impl/HomeManagementConfigServiceImpl.java
  24. 18 0
      netflix-service/src/main/java/com/cyksj/service/order/ShoppingCartDonService.java
  25. 11 0
      netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java
  26. 79 0
      netflix-service/src/main/java/com/cyksj/service/order/impl/ShoppingCartOrderServiceImpl.java
  27. 1 1
      netflix-service/src/main/java/com/cyksj/service/sys/SysConfigService.java
  28. 48 57
      netflix-service/src/main/java/com/cyksj/service/sys/impl/SysConfigServiceImpl.java
  29. 6 0
      netflix-service/src/main/java/com/cyksj/service/user/UserBenefitsService.java
  30. 20 0
      netflix-service/src/main/java/com/cyksj/service/user/impl/UserBenefitsServiceImpl.java
  31. 4 2
      netflix-web/src/main/java/com/cyksj/web/controller/manage/corp/CorpMsgBulkTaskController.java
  32. 3 3
      netflix-web/src/main/java/com/cyksj/web/controller/manage/corp/CorpTagController.java
  33. 1 1
      netflix-web/src/main/java/com/cyksj/web/controller/manage/group/CmsGroupRelationController.java
  34. 6 0
      netflix-web/src/main/java/com/cyksj/web/controller/manage/home/HomeManageConfigController.java
  35. 100 0
      netflix-web/src/main/java/com/cyksj/web/controller/payment/OrderShopCartController.java

+ 2 - 2
netflix-dao/src/main/java/com/cyksj/mapper/OrderDonMapper.java

@@ -65,7 +65,7 @@ public interface OrderDonMapper extends BaseMapper<OrderDon> {
 
 	BrokenLineObjView selectDsPlatBrokenLineMoney(@Param("sharedId") Long sharedId, @Param("first") String first, @Param("end") String end);
 
-	UserOrderDetailView getTagUserData(@Param("tagName") String tagName, @Param("startTime") String startTime, @Param("endTime") String endTime);
+	UserOrderDetailView getTagUserData(@Param("tagIdStr") String tagIdStr, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
-	Page<UserOrderDetailView> getTagUserDataPage(@Param("page") Page<UserOrderDetailView> page, @Param("tagName") String tagName, @Param("startTime") String startTime, @Param("endTime") String endTime);
+	Page<UserOrderDetailView> getTagUserDataPage(@Param("page") Page<UserOrderDetailView> page, @Param("tagIdStr") String tagIdStr, @Param("startTime") String startTime, @Param("endTime") String endTime);
 }

+ 3 - 1
netflix-dao/src/main/java/com/cyksj/mapper/corp/CorpUserFollowRelationMapper.java

@@ -15,7 +15,9 @@ public interface CorpUserFollowRelationMapper extends BaseMapper<CorpUserFollowR
 
 	String selectCorpCustomers(@Param("unionid") String unionid, @Param("wxCorpId") Long wxCorpId);
 
-	List<CorpUserFollowRelationDto> selectCorpUserFollowRelationByTagIds(@Param("list") List<String> tagIds, @Param("wxCorpId") Long wxCorpId, @Param("followIds") List<String> followIds, @Param("userScope") Integer userScope);
+	List<CorpUserFollowRelationDto> selectCorpUserFollowRelationByTagIds(@Param("list") List<String> tagIds, @Param("wxCorpId") Long wxCorpId, @Param("followIds") List<String> followIds, @Param("userScope") Integer userScope, @Param("consumerScope") Integer consumerScope);
 
 	List<CorpUserFollowRelationDto> selectCorpUserFollowRelation(@Param("wxCorpId") Long wxCorpId, @Param("followIds") List<String> service_follow_ids);
+
+	List<CorpUserFollowRelationDto> selectCorpUserNotUnderTagIds(@Param("list") List<String> tagIds, @Param("wxCorpId") Long wxCorpId, @Param("followIds") List<String> followIds, @Param("userScope") Integer userScope, @Param("consumerScope") Integer consumerScope);
 }

+ 2 - 0
netflix-dao/src/main/java/com/cyksj/mapper/manage/coupon/CouponMapper.java

@@ -31,5 +31,7 @@ public interface CouponMapper extends BaseMapper<Coupon> {
 	@Select("select name from coupon where id = #{couponId}")
 	String getCouponNameById(Long couponId);
 
+	String getCouponNameByIds(List<Long> couponIds);
+
 	Coupon getRenewCouponBySkuId(@Param("skuId") Long skuId, @Param("couponIds") Set<Long> couponIds, @Param("userId") Long userId);
 }

+ 13 - 0
netflix-dao/src/main/java/com/cyksj/mapper/order/ShoppingCartDonMapper.java

@@ -0,0 +1,13 @@
+package com.cyksj.mapper.order;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cyksj.model.entity.ShoppingCartDon;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: ShoppingCartDonMapper
+ * 创建者: JavaZou
+ * 创建时间:2023/10/12 15:47
+ */
+public interface ShoppingCartDonMapper extends BaseMapper<ShoppingCartDon> {
+}

+ 2 - 0
netflix-dao/src/main/java/com/cyksj/model/dto/CorpFollowServiceDto.java

@@ -15,5 +15,7 @@ public class CorpFollowServiceDto {
 
 	private String name;
 
+	private Integer indx;
+
 	private String followId;
 }

+ 3 - 1
netflix-dao/src/main/java/com/cyksj/model/dto/YhServiceDto.java

@@ -25,7 +25,7 @@ public class YhServiceDto {
 	private Integer index;
 
 	/**
-	 * workday工作日 Saturday周六 Sunday周日
+	 * workday工作日 Saturday周六 Sunday周日 holiday节假日
 	 */
 	private String sign;
 
@@ -37,6 +37,8 @@ public class YhServiceDto {
 
 	private String sortTime;
 
+	private String date;
+
 
 	@Getter
 	@Setter

+ 14 - 3
netflix-dao/src/main/java/com/cyksj/model/entity/CorpMsgBulkTask.java

@@ -9,7 +9,6 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.Getter;
 
-import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
 import java.io.Serializable;
 import java.util.Arrays;
@@ -54,7 +53,7 @@ public class CorpMsgBulkTask implements Serializable {
 	/**
 	 * 群发任务选择标签
 	 */
-	@NotEmpty(message = "标签不能为空")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private String chooseTagStr;
 
 	/**
@@ -67,6 +66,7 @@ public class CorpMsgBulkTask implements Serializable {
 	/**
 	 * 标签组
 	 */
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private String tagGroups;
 
 	/**
@@ -97,7 +97,7 @@ public class CorpMsgBulkTask implements Serializable {
 	 * 优惠券id
 	 */
 	@TableField(updateStrategy = FieldStrategy.IGNORED)
-	private Long couponId;
+	private String couponIds;
 
 	@DbIgnore
 	@TableField(exist = false)
@@ -137,6 +137,17 @@ public class CorpMsgBulkTask implements Serializable {
 	 */
 	private Integer userScope;
 
+	/** 发送范围 默认2标签用户
+	 * 1.全部用户、2标签用户
+	 */
+	private Integer sendScope;
+
+	/**
+	 * 消费范围
+	 * 1全部 2消费 3未消费
+	 */
+	private Integer consumerScope;
+
 	private Boolean deleted;
 
 	/**

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

@@ -15,6 +15,11 @@ public class Information extends BaseEntity{
      */
     private String title;
 
+    /**
+     * 副标题
+     */
+    private String subTitle;
+
     /**
      * 缩略图
      */

+ 22 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/ShoppingCartDon.java

@@ -0,0 +1,22 @@
+package com.cyksj.model.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: ShoppingCartDon
+ * 创建者: JavaZou
+ * 创建时间:2023/10/12 15:47
+ */
+@Getter
+@Setter
+public class ShoppingCartDon extends BaseEntity{
+	private Long userId;
+
+	private Long goodsId;
+
+	private Long skuId;
+
+	private Integer num;
+}

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

@@ -25,6 +25,12 @@ public class InformationDetailView {
     @DbField("i.title")
     private String title;
 
+    /**
+     * 副标题
+     */
+    @DbField("i.sub_title")
+    private String subTitle;
+
     /**
      * 缩略图
      */

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

@@ -21,6 +21,11 @@ public class InformationListView {
      */
     private String title;
 
+    /**
+     * 副标题
+     */
+    private String subTitle;
+
     /**
      * 缩略图
      */

+ 6 - 3
netflix-dao/src/main/java/com/cyksj/model/views/InformationView.java

@@ -1,8 +1,5 @@
 package com.cyksj.model.views;
 
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.cyksj.model.entity.InformationClickUserRecord;
-import com.cyksj.model.entity.OrderDon;
 import com.ejlchina.searcher.bean.DbField;
 import com.ejlchina.searcher.bean.DbIgnore;
 import com.ejlchina.searcher.bean.SearchBean;
@@ -29,6 +26,12 @@ public class InformationView {
     @DbField("i.title")
     private String title;
 
+    /**
+     * 文章标题
+     */
+    @DbField("i.sub_title")
+    private String subTitle;
+
     /**
      * 缩略图
      */

+ 63 - 8
netflix-dao/src/main/resources/mapper/CorpUserFollowRelationMapper.xml

@@ -26,14 +26,25 @@
         left join `corp_user_auth` ca on ca.external_userid = cufr.corp_user_id
         left join `corp_user` cu on cu.id = ca.corp_user_id
         where cufr.wx_corp_id = #{wxCorpId}
-          <choose>
-              <when test="userScope == 2">
-                  and cu.user_id != 0
-              </when>
-              <when test="userScope == 3">
-                  and cu.user_id = 0
-              </when>
-          </choose>
+        <choose>
+            <when test="userScope == 2">
+                and cu.user_id != 0
+            </when>
+            <when test="userScope == 3">
+                and cu.user_id = 0
+            </when>
+        </choose>
+        <choose>
+            <when test="consumerScope == 2">
+                and exists (select id from order_don o where o.user_id != 0 and o.user_id = cu.user_id and status not in
+                ('close','noPayment','refund') limit 1)
+            </when>
+            <when test="consumerScope == 3">
+                and not exists (select id from order_don o where o.user_id != 0 and o.user_id = cu.user_id and status
+                not in
+                ('close','noPayment','refund') limit 1)
+            </when>
+        </choose>
         and ca.wx_corp_id = #{wxCorpId}
         <if test="followIds != null and followIds.size() > 0">
             and cufr.follow_id in
@@ -60,4 +71,48 @@
         </if>
         group by cufr.corp_user_id
     </select>
+
+    <select id="selectCorpUserNotUnderTagIds" resultType="com.cyksj.model.dto.CorpUserFollowRelationDto">
+        select cufr.corp_user_id,
+        any_value(cufr.follow_id) as follow_id,
+        any_value(cu.user_id) as user_id
+        from corp_user cu inner join corp_user_auth ca on ca.corp_user_id = cu.id
+        and ca.wx_corp_id = #{wxCorpId}
+        <choose>
+            <when test="userScope == 2">
+                and cu.user_id != 0
+            </when>
+            <when test="userScope == 3">
+                and cu.user_id = 0
+            </when>
+        </choose>
+        <choose>
+            <when test="consumerScope == 2">
+                and exists (select id from order_don o where o.user_id != 0 and o.user_id = cu.user_id and status not in
+                ('close','noPayment','refund') limit 1)
+            </when>
+            <when test="consumerScope == 3">
+                and not exists (select id from order_don o where o.user_id != 0 and o.user_id = cu.user_id and status
+                not in
+                ('close','noPayment','refund') limit 1)
+            </when>
+        </choose>
+        inner join corp_user_follow_relation cufr on cufr.corp_user_id = ca.external_userid
+        and cufr.wx_corp_id = #{wxCorpId}
+        <if test="followIds != null and followIds.size() > 0">
+            and cufr.follow_id in
+            <foreach collection="followIds" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="list != null and list.size() > 0">
+            and not exists (select s.corp_user_id from (select corp_user_id from corp_user_follow_relation cufr inner
+            join `corp_user_tag` ct on ct.relation_id = cufr.id and ct.tag_id in
+            <foreach collection="list" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+            group by cufr.corp_user_id) s where s.corp_user_id = cufr.corp_user_id limit 1)
+        </if>
+        group by cufr.corp_user_id
+    </select>
 </mapper>

+ 7 - 0
netflix-dao/src/main/resources/mapper/CouponMapper.xml

@@ -57,4 +57,11 @@
         and (select count(*) from coupon_user where user_id = #{userId} and coupon_id = c.id) = 0
         order by discount desc limit 1
     </select>
+
+    <select id="getCouponNameByIds" resultType="java.lang.String">
+        select group_concat(name) from coupon where id in
+        <foreach collection="list" item="item" open="(" separator="," close=")">
+            #{item}
+        </foreach>
+    </select>
 </mapper>

+ 14 - 21
netflix-dao/src/main/resources/mapper/OrderDonMapper.xml

@@ -316,11 +316,10 @@
     <select id="getTagUserData" resultType="com.cyksj.model.views.UserOrderDetailView">
         select count(if(status != 'refund', 1, NULL)) as numOfOrder, (sum(money) - sum(ifnull(refund_money, 0))) / 100
         as orderMoney
-        from `order_don` o
-        where exists (select cu.user_id
+        from (select cu.user_id
         from (select relation_id
         from `corp_user_tag` ct
-        where tag_name = #{tagName}
+        where tag_id = #{tagIdStr}
         <if test="startTime != null">
             and ct.created_time >= #{startTime}
         </if>
@@ -329,20 +328,19 @@
         </if>) s
         left join corp_user_follow_relation cufr on cufr.id = s.relation_id
         left join corp_user_auth ca on ca.external_userid = cufr.corp_user_id
-        left join corp_user cu on cu.id = ca.corp_user_id
-        where cu.user_id != 0 and cu.user_id = o.user_id )
-        and status not in ('close', 'noPayment')
-        and money > 0
+        left join corp_user cu on cu.id = ca.corp_user_id where cu.user_id != 0) s inner join order_don o on o.user_id =
+        s.user_id
+        and o.status not in ('close', 'noPayment')
+        and o.money > 0
+        and o.money > ifnull(o.refund_money,0)
     </select>
 
     <select id="getTagUserDataPage" resultType="com.cyksj.model.views.UserOrderDetailView">
         select count(if(status != 'refund', 1, NULL)) as numOfOrder, (sum(money) - sum(ifnull(refund_money, 0))) / 100
-        as orderMoney,date_format(o.created_time,'%Y-%m-%d') as date
-        from `order_don` o
-        where exists (select cu.user_id
+        as orderMoney,date_format(o.created_time,'%Y-%m-%d') as date from (select cu.user_id
         from (select relation_id
         from `corp_user_tag` ct
-        where tag_name = #{tagName}
+        where tag_id = #{tagIdStr}
         <if test="startTime != null">
             and ct.created_time >= #{startTime}
         </if>
@@ -351,16 +349,11 @@
         </if>) s
         left join corp_user_follow_relation cufr on cufr.id = s.relation_id
         left join corp_user_auth ca on ca.external_userid = cufr.corp_user_id
-        left join corp_user cu on cu.id = ca.corp_user_id
-        where cu.user_id != 0 and cu.user_id = o.user_id )
-        and status not in ('close', 'noPayment')
-        <if test="startTime != null">
-            and o.created_time >= #{startTime}
-        </if>
-        <if test="endTime != null">
-            and o.created_time &lt; #{endTime}
-        </if>
-        and money > 0
+        left join corp_user cu on cu.id = ca.corp_user_id where cu.user_id != 0) s inner join order_don o on o.user_id =
+        s.user_id
+        and o.status not in ('close', 'noPayment')
+        and o.money > 0
+        and o.money > ifnull(o.refund_money,0)
         group by date_format(o.created_time,'%Y-%m-%d')
         order by date_format(o.created_time,'%Y-%m-%d') desc
     </select>

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

@@ -0,0 +1,65 @@
+package com.cyksj.common.service;
+
+
+import cn.hutool.core.collection.CollUtil;
+import com.cyksj.model.dto.YhServiceDto;
+
+import java.time.DayOfWeek;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+/**
+ * 项目名: netflix-job
+ * 文件名: DateUtils
+ * 创建者: JavaZou
+ * 创建时间:2023/12/25 13:52
+ */
+public class CropDutyServiceDateService {
+
+	public static DayOfWeek getNextWorkDay(DayOfWeek currentDay) {
+		// 如果当前是周五,下一个工作日是周一;否则,是当前星期的下一天
+		if (currentDay == DayOfWeek.FRIDAY) {
+			return DayOfWeek.SATURDAY;
+		}
+		if (currentDay == DayOfWeek.SATURDAY) {
+			return DayOfWeek.SUNDAY;
+		}
+		return DayOfWeek.MONDAY;
+	}
+
+
+	/**
+	 * 返回明天星期几 用户获取对应周期工作客服
+	 */
+	public static List<YhServiceDto> getDutyService(DayOfWeek nextWorkDay, List<YhServiceDto> workday, List<YhServiceDto> sunday, List<YhServiceDto> saturday, Map<String, List<YhServiceDto>> holidyDateMap, LocalDateTime now) {
+		List<YhServiceDto> holidayServiceIfHoliday = getHolidayServiceIfHoliday(now, holidyDateMap);
+		if (holidayServiceIfHoliday != null) {
+			return holidayServiceIfHoliday;
+		}
+		if (nextWorkDay == DayOfWeek.SATURDAY) {
+			return Optional.ofNullable(saturday).orElse(Optional.ofNullable(sunday).orElse(workday));
+		}
+		if (nextWorkDay == DayOfWeek.SUNDAY) {
+			return Optional.ofNullable(sunday).orElse(workday);
+		}
+		return workday;
+	}
+
+
+	public static List<YhServiceDto> getHolidayServiceIfHoliday(LocalDateTime now, Map<String, List<YhServiceDto>> holidyDateMap) {
+		if (holidyDateMap == null) {
+			return null;
+		}
+		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd");
+		String nowDate = now.format(formatter);
+
+		List<YhServiceDto> holidayServices = holidyDateMap.get(nowDate);
+		if (CollUtil.isNotEmpty(holidayServices)) {
+			return holidayServices;
+		}
+		return null;
+	}
+}

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/corp/CorpTagService.java

@@ -45,5 +45,5 @@ public interface CorpTagService {
 	 */
 	CorpTagGroupView addGroup(CorpTagGroupView tagGroup) throws Exception;
 
-	UserOrderDetailView getTagUserData(Integer start, Integer limit, String tagName, String startTime, String endTime);
+	UserOrderDetailView getTagUserData(Integer start, Integer limit, String tagIdStr, String startTime, String endTime);
 }

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpFollowActiveCodeFrontServiceImpl.java

@@ -87,7 +87,7 @@ public class CorpFollowActiveCodeFrontServiceImpl implements CorpFollowActiveCod
 	/**
 	 * 获取对应值班客服的二维码
 	 */
-	public String getDutyServiceCode(List<CorpFollowActiveCodeDto> activeCodeDtos) {
+	public String getDutyServiceCode(List<CorpFollowActiveCodeDto> activeCodeDtos) throws Exception {
 		if (activeCodeDtos.size() == 1) {
 			return activeCodeDtos.get(0).getQrCode();
 		}

+ 58 - 30
netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpMsgBulkTaskServiceImpl.java

@@ -102,6 +102,20 @@ public class CorpMsgBulkTaskServiceImpl extends ServiceImpl<CorpMsgBulkTaskMappe
 				XxlJobUtil.stopJob(dbCorpMsgBulkTask.getJobId());
 			}
 		}
+		Optional.ofNullable(corpMsgBulkTask.getSendScope()).ifPresent(sendScope -> {
+			//发送全部用户范围
+			if (sendScope == 1) {
+				if (StrUtil.isEmpty(corpMsgBulkTask.getChooseTagStr())) {
+					corpMsgBulkTask.setChooseTagStr(null);
+					corpMsgBulkTask.setTagGroups(null);
+				}
+			} else if (StrUtil.isEmpty(corpMsgBulkTask.getChooseTagStr())) {
+				throw BusinessRuntimeException.getInstance("标签筛选发送范围下,标签不能为空");
+			}
+		});
+		if (StrUtil.isAllEmpty(corpMsgBulkTask.getText(), corpMsgBulkTask.getAttachmentsStr())) {
+			throw BusinessRuntimeException.getInstance("群发消息文本和附件不能同时为空");
+		}
 		this.saveOrUpdate(corpMsgBulkTask);
 		//处理群发任务和标签的关系
 		handleTaskTagRelation(corpMsgBulkTask);
@@ -246,7 +260,18 @@ public class CorpMsgBulkTaskServiceImpl extends ServiceImpl<CorpMsgBulkTaskMappe
 		}
 		Integer userScope = corpMsgBulkTask.getUserScope();
 
-		List<CorpUserFollowRelationDto> corpUserFollowRelations = corpUserFollowRelationMapper.selectCorpUserFollowRelationByTagIds(tagIds, wxCorpApp.getId(), service_follow_ids, userScope);
+		Integer sendScope = corpMsgBulkTask.getSendScope();
+
+		Integer consumerScope = corpMsgBulkTask.getConsumerScope();
+
+		List<CorpUserFollowRelationDto> corpUserFollowRelations = null;
+		//全部用户
+		if (sendScope == 1) {
+			//此时tagIds是 需要过滤的用户标签
+			corpUserFollowRelations = corpUserFollowRelationMapper.selectCorpUserNotUnderTagIds(tagIds, wxCorpApp.getId(), service_follow_ids, userScope, consumerScope);
+		} else {
+			corpUserFollowRelations = corpUserFollowRelationMapper.selectCorpUserFollowRelationByTagIds(tagIds, wxCorpApp.getId(), service_follow_ids, userScope, consumerScope);
+		}
 		//将成员与客户相同关联聚合
 		Map<String, List<CorpUserFollowRelationDto>> userRelationMap = corpUserFollowRelations.stream().collect(Collectors.groupingBy(CorpUserFollowRelationDto::getFollowId));
 		//附件
@@ -314,7 +339,7 @@ public class CorpMsgBulkTaskServiceImpl extends ServiceImpl<CorpMsgBulkTaskMappe
 			try {
 				List<String> extendIds = new ArrayList<>(val.size());
 				List<Long> userIds = null;
-				if (corpMsgBulkTask.getCouponId() != null) {
+				if (StrUtil.isNotEmpty(corpMsgBulkTask.getCouponIds())) {
 					userIds = new ArrayList<>(val.size());
 				}
 				for (CorpUserFollowRelationDto dto : val) {
@@ -356,24 +381,27 @@ public class CorpMsgBulkTaskServiceImpl extends ServiceImpl<CorpMsgBulkTaskMappe
 				}
 				//若需要发优惠券
 				if (CollUtil.isNotEmpty(userIds)) {
-					Long couponId = corpMsgBulkTask.getCouponId();
-					Coupon coupon = couponMapper.getCouponById(couponId);
-					Date validStartTime = null;
-					Date validEndTime = null;
-					if (coupon != null) {
-						if (coupon.getIsValidTime()) {
-							validStartTime = coupon.getValidStartTime();
-							validEndTime = coupon.getValidEndTime();
-						} else {
-							validStartTime = DateTime.now();
-							validEndTime = DateUtil.offsetDay(validStartTime, coupon.getValidDays());
+					String couponIds = corpMsgBulkTask.getCouponIds();
+					List<Long> couponIdList = Jsons.parseList(couponIds, Long.class);
+					for (Long couponId : couponIdList) {
+						Coupon coupon = couponMapper.getCouponById(couponId);
+						Date validStartTime = null;
+						Date validEndTime = null;
+						if (coupon != null) {
+							if (coupon.getIsValidTime()) {
+								validStartTime = coupon.getValidStartTime();
+								validEndTime = coupon.getValidEndTime();
+							} else {
+								validStartTime = DateTime.now();
+								validEndTime = DateUtil.offsetDay(validStartTime, coupon.getValidDays());
+							}
 						}
-					}
-					if (userIds.size() <= 500) {
-						couponMapper.batchSendCouponToUsers(userIds, corpMsgBulkTask.getCouponId(), CouponUser.Channel.corp_bulk_task, CouponUser.Status.unused, validStartTime, validEndTime);
-					} else {
-						for (List<Long> userIdsList : Lists.partition(userIds, 500)) {
-							couponMapper.batchSendCouponToUsers(userIdsList, corpMsgBulkTask.getCouponId(), CouponUser.Channel.corp_bulk_task, CouponUser.Status.unused, validStartTime, validEndTime);
+						if (userIds.size() <= 500) {
+							couponMapper.batchSendCouponToUsers(userIds, couponId, CouponUser.Channel.corp_bulk_task, CouponUser.Status.unused, validStartTime, validEndTime);
+						} else {
+							for (List<Long> userIdsList : Lists.partition(userIds, 500)) {
+								couponMapper.batchSendCouponToUsers(userIdsList, couponId, CouponUser.Channel.corp_bulk_task, CouponUser.Status.unused, validStartTime, validEndTime);
+							}
 						}
 					}
 				}
@@ -407,17 +435,17 @@ public class CorpMsgBulkTaskServiceImpl extends ServiceImpl<CorpMsgBulkTaskMappe
 			}
 		}
 
-		if (CollectionUtil.isNotEmpty(failList)) {
-			List<CorpUserSendRecord> corpUserSendRecords = corpMsgBulkTaskMapper.getsSuccessCorpUser(failList);
-			if (CollectionUtil.isNotEmpty(corpUserSendRecords)) {
-				corpUserSendRecords.forEach(corpUserSendRecord -> {
-					log.info("失败群发记录大小:{}", corpUserSendRecords.size());
-					corpUserSendRecord.setCorpMsgRecordId(corpMsgBulkTaskRecord.getId());
-					corpMsgBulkTaskRecord.setTaskId(corpMsgBulkTaskRecord.getTaskId());
-					corpUserSendRecordService.saveBatch(corpUserSendRecords);
-				});
-			}
-		}
+//		if (CollectionUtil.isNotEmpty(failList)) {
+//			List<CorpUserSendRecord> corpUserSendRecords = corpMsgBulkTaskMapper.getsSuccessCorpUser(failList);
+//			if (CollectionUtil.isNotEmpty(corpUserSendRecords)) {
+//				corpUserSendRecords.forEach(corpUserSendRecord -> {
+//					log.info("失败群发记录大小:{}", corpUserSendRecords.size());
+//					corpUserSendRecord.setCorpMsgRecordId(corpMsgBulkTaskRecord.getId());
+//					corpMsgBulkTaskRecord.setTaskId(corpMsgBulkTaskRecord.getTaskId());
+//					corpUserSendRecordService.saveBatch(corpUserSendRecords);
+//				});
+//			}
+//		}
 	}
 
 	/**

+ 3 - 3
netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpTagServiceImpl.java

@@ -419,10 +419,10 @@ public class CorpTagServiceImpl implements CorpTagService {
 	}
 
 	@Override
-	public UserOrderDetailView getTagUserData(Integer start, Integer limit, String tagName, String startTime, String endTime) {
-		UserOrderDetailView u = orderDonMapper.getTagUserData(tagName, startTime, endTime);
+	public UserOrderDetailView getTagUserData(Integer start, Integer limit, String tagIdStr, String startTime, String endTime) {
+		UserOrderDetailView u = orderDonMapper.getTagUserData(tagIdStr, startTime, endTime);
 
-		Page<UserOrderDetailView> records = orderDonMapper.getTagUserDataPage(new Page<>(start, limit), tagName, startTime, endTime);
+		Page<UserOrderDetailView> records = orderDonMapper.getTagUserDataPage(new Page<>(start, limit), tagIdStr, startTime, endTime);
 
 		u.setRecords(records);
 		return u;

+ 1 - 0
netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpUserServiceImpl.java

@@ -147,6 +147,7 @@ public class CorpUserServiceImpl implements CorpUserService {
 		}
 		User user = userMapper.selectOne(Wrappers.lambdaQuery(User.class).eq(User::getUnionid, corpUser.getUnionid()).last("limit 1"));
 		if (user == null) {
+			user = new User();
 			user.setNickname(corpUser.getName());
 			user.setHeadimgurl(corpUser.getAvatar());
 			user.setUnionid(corpUser.getUnionid());

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

@@ -5,6 +5,8 @@ import com.cyksj.model.entity.HomeManagementConfig;
 import com.cyksj.model.request.HomeConfigTimingReq;
 import com.cyksj.model.request.HomeManageConfigReq;
 
+import java.util.List;
+
 /*
  *项目名: netflix
  *文件名: HomeManagementConfigService
@@ -17,4 +19,6 @@ public interface HomeManagementConfigService extends IService<HomeManagementConf
 	void timingUpdateStatus(HomeConfigTimingReq req);
 
 	void timingCancel(Long id);
+
+	void batchCancelTimingStatus(List<Long> ids);
 }

+ 12 - 6
netflix-service/src/main/java/com/cyksj/service/home/impl/HomeManagementConfigServiceImpl.java

@@ -126,7 +126,7 @@ public class HomeManagementConfigServiceImpl extends ServiceImpl<HomeManagementC
 		this.updateById(config);
 
 		//删除之前设置的定时任务
-		cancelTimingJob(id);
+		cancelTimingJob(List.of(id));
 
 		if (timingJob) {
 			SysFuncTimingShelf timingShelf = new SysFuncTimingShelf();
@@ -150,7 +150,7 @@ public class HomeManagementConfigServiceImpl extends ServiceImpl<HomeManagementC
 			throw BusinessRuntimeException.getInstance("对应配置不存在..");
 		}
 		//删除之前设置的定时任务
-		cancelTimingJob(id);
+		cancelTimingJob(List.of(id));
 
 		if (config.getTime() != null) {
 			config.setTime(null);
@@ -159,18 +159,24 @@ public class HomeManagementConfigServiceImpl extends ServiceImpl<HomeManagementC
 		}
 	}
 
-	public void cancelTimingJob(Long id) {
+	@Override
+	@Transactional(rollbackFor = Throwable.class)
+	public void batchCancelTimingStatus(List<Long> ids) {
+		cancelTimingJob(ids);
+	}
+
+	public void cancelTimingJob(List<Long> ids) {
 		Integer count = sysFuncTimingShelfService.count(Wrappers.lambdaQuery(SysFuncTimingShelf.class)
 				.eq(SysFuncTimingShelf::getType, SysFuncTimingShelf.Type.hc)
-				.eq(SysFuncTimingShelf::getFuncId, id)
+				.in(SysFuncTimingShelf::getFuncId, ids)
 				.eq(SysFuncTimingShelf::getDeleted, 1));
 		if (count > 0) {
 			sysFuncTimingShelfService.update(null, Wrappers.lambdaUpdate(SysFuncTimingShelf.class)
 					.set(SysFuncTimingShelf::getDeleted, 0)
 					.eq(SysFuncTimingShelf::getType, SysFuncTimingShelf.Type.hc)
-					.eq(SysFuncTimingShelf::getFuncId, id)
+					.in(SysFuncTimingShelf::getFuncId, ids)
 					.eq(SysFuncTimingShelf::getDeleted, 1));
-			log.info("将之前设置的同配置下{},id:{}的定时上下架删除", SysFuncTimingShelf.Type.hc.getDesc(), id);
+			log.info("将之前设置的同配置下{},ids:{}的定时上下架删除", SysFuncTimingShelf.Type.hc.getDesc(), ids.toString());
 		}
 	}
 }

+ 18 - 0
netflix-service/src/main/java/com/cyksj/service/order/ShoppingCartDonService.java

@@ -0,0 +1,18 @@
+package com.cyksj.service.order;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.cyksj.model.entity.ShoppingCartDon;
+import com.cyksj.model.request.UnifiedOrderPayReq;
+import com.cyksj.model.views.ShoppingCartDonPayDetailView;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: ShoppingCartDonService
+ * 创建者: JavaZou
+ * 创建时间:2023/10/12 16:01
+ */
+public interface ShoppingCartDonService extends IService<ShoppingCartDon> {
+	void addGoodsShoppingCart(ShoppingCartDon goodsCartDon);
+
+	ShoppingCartDonPayDetailView unifiedPayShoppingCartGoods(UnifiedOrderPayReq unifiedOrderPayReq);
+}

+ 11 - 0
netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java

@@ -600,6 +600,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;
 	}
 
@@ -860,6 +867,10 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 		}
 		GoodsDonSku sku = adjustGoodsDonSku(yhsId, false, renewSkuId);
 
+		if (sku == null || !sku.getStatus()) {
+			throw BusinessRuntimeException.getInstance("该规格已下架,无法续费..");
+		}
+
 		GroupsRelation relation = groupsRelationMapper.selectById(relationId);
 		if (relation == null) {
 			throw new BusinessRuntimeException("");

+ 79 - 0
netflix-service/src/main/java/com/cyksj/service/order/impl/ShoppingCartOrderServiceImpl.java

@@ -0,0 +1,79 @@
+package com.cyksj.service.order.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.cyksj.common.exception.BusinessRuntimeException;
+import com.cyksj.mapper.order.ShoppingCartDonMapper;
+import com.cyksj.model.entity.ShoppingCartDon;
+import com.cyksj.model.request.OrderPayRequest;
+import com.cyksj.model.request.UnifiedOrderPayReq;
+import com.cyksj.model.views.GoodsDonSkuDetailView;
+import com.cyksj.model.views.ShoppingCartDonPayDetailView;
+import com.cyksj.service.order.OrderDonService;
+import com.cyksj.service.order.ShoppingCartDonService;
+import com.ejlchina.searcher.BeanSearcher;
+import com.ejlchina.searcher.util.MapUtils;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: ShoppingCartOrderServiceImpl
+ * 创建者: JavaZou
+ * 创建时间:2023/10/12 16:01
+ */
+@Service
+@RequiredArgsConstructor
+public class ShoppingCartOrderServiceImpl extends ServiceImpl<ShoppingCartDonMapper, ShoppingCartDon> implements ShoppingCartDonService {
+	private final BeanSearcher beanSearcher;
+
+	private final OrderDonService orderDonService;
+	@Override
+	public void addGoodsShoppingCart(ShoppingCartDon goodsCartDon) {
+		//最多添加购物车数量30
+		int count = this.count(Wrappers.lambdaQuery(ShoppingCartDon.class)
+				.eq(ShoppingCartDon::getUserId, goodsCartDon.getUserId()));
+		if (count >= 30) {
+			throw BusinessRuntimeException.getInstance("最多添加30件商品至购物车");
+		}
+		Long skuId = goodsCartDon.getSkuId();
+		if (skuId == null) {
+			throw BusinessRuntimeException.getInstance("请指定商品添加至购物车");
+		}
+		GoodsDonSkuDetailView goodsDonSkuDetailView = beanSearcher.searchFirst(GoodsDonSkuDetailView.class, MapUtils.builder()
+				.field(GoodsDonSkuDetailView::getSkuId, skuId).build());
+		if (goodsDonSkuDetailView == null) {
+			throw BusinessRuntimeException.getInstance("该商品已不存在..");
+		}
+		if (!goodsDonSkuDetailView.getGoodsStatus()) {
+			throw BusinessRuntimeException.getInstance("该商品已下架..");
+		}
+		if (!goodsDonSkuDetailView.getGoodsSkuStatus()) {
+			throw BusinessRuntimeException.getInstance("该商品规格已下架..");
+		}
+		if (goodsCartDon.getNum() == null) {
+			goodsCartDon.setNum(1);
+		}
+		goodsCartDon.setGoodsId(goodsDonSkuDetailView.getGoodsId());
+		goodsCartDon.setSkuId(skuId);
+		this.save(goodsCartDon);
+	}
+
+	@Override
+	public ShoppingCartDonPayDetailView unifiedPayShoppingCartGoods(UnifiedOrderPayReq unifiedOrderPayReq) {
+		Long userId = unifiedOrderPayReq.getUserId();
+		//处理订单
+		List<OrderPayRequest> payGoods = unifiedOrderPayReq.getPayGoods();
+		if (CollUtil.isEmpty(payGoods)) {
+			throw BusinessRuntimeException.getInstance("请选择商品后再进行下单..");
+		}
+		ShoppingCartDonPayDetailView payDetailView = new ShoppingCartDonPayDetailView();
+//		String orderNo = ;
+//		String payTitle = ;
+//		orderDonService.submit();
+		return null;
+	}
+}

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/sys/SysConfigService.java

@@ -17,5 +17,5 @@ public interface SysConfigService extends IService<SysConfig> {
 	 */
 	String getDefaultShopConfigByType(String type);
 
-	List<String> getDutyServices();
+	List<String> getDutyServices() throws Exception;
 }

+ 48 - 57
netflix-service/src/main/java/com/cyksj/service/sys/impl/SysConfigServiceImpl.java

@@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.cyksj.common.constant.Constant;
+import com.cyksj.common.service.CropDutyServiceDateService;
 import com.cyksj.common.util.Jsons;
 import com.cyksj.mapper.sys.SysConfigMapper;
 import com.cyksj.model.dto.DefaultShopConfig;
@@ -60,85 +61,74 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper,SysConfig>
 
 
 	@Override
-	public List<String> getDutyServices() {
+	public List<String> getDutyServices() throws Exception {
 		SysConfig sysConfig = this.getOne(Wrappers.lambdaQuery(SysConfig.class)
 				.eq(SysConfig::getSysKey, Constant.serviceKeys.get(0))
 				.last("limit 1"));
-		// 用当前日期时间创建一个 LocalDateTime 对象
-		LocalDateTime now = LocalDateTime.now();
 
-		// 获取当前时间
-		LocalTime currentTime = now.toLocalTime();
+		List<YhServiceDto> yhServiceDtos = null;
 
-		if (sysConfig != null) {
-			String sysValue = sysConfig.getSysValue();
-			if (StrUtil.isNotEmpty(sysValue)) {
-				try {
-					List<YhServiceDto> yhServiceDtos = Jsons.parseList(sysValue, YhServiceDto.class);
-					Map<String, List<YhServiceDto>> dutyServices = yhServiceDtos.stream().collect(Collectors.groupingBy(YhServiceDto::getSign));
-					DayOfWeek currentDayOfWeek = now.getDayOfWeek();
-					List<YhServiceDto> workdayService = dutyServices.get("workday");
-
-					if (CollUtil.isNotEmpty(workdayService)) {
-						List<YhServiceDto> saturdayService = dutyServices.get("Saturday");
-						List<YhServiceDto> sundayServices = dutyServices.get("Sunday");
-
-						List<YhServiceDto> carryServices = getDutyService(currentDayOfWeek, workdayService, saturdayService, sundayServices);
-						//获取值班客服
-						List<YhServiceDto> dutyServiceCodes = getDutyServiceCode(carryServices, workdayService, saturdayService, sundayServices, currentDayOfWeek, currentTime);
-						if (CollUtil.isNotEmpty(dutyServiceCodes)) {
-							Set<String> collectFollow = new HashSet<>();
-							for (YhServiceDto dutyServiceCode : dutyServiceCodes) {
-								dutyServiceCode.getSelect().stream().filter(e -> StrUtil.isNotBlank(e.getFollowId())).forEach(cs -> collectFollow.add(cs.getFollowId()));
-							}
-							return new ArrayList<>(collectFollow);
-						}
-					}
-				} catch (Exception e) {
-				}
-			}
+		if (sysConfig != null && StrUtil.isNotBlank(sysConfig.getSysValue())) {
+			yhServiceDtos = Jsons.parseList(sysConfig.getSysValue(), YhServiceDto.class);
 		}
-		return null;
-	}
 
+		final List<YhServiceDto> dtoCs = yhServiceDtos;
 
+		List<YhServiceDto> workdayServices = null;
+		List<YhServiceDto> saturdayServices = null;
+		List<YhServiceDto> sundayServices = null;
+		Map<String, List<YhServiceDto>> holidayDateMap = null;
 
-	/**
-	 * 返回明天星期几 用户获取对应周期工作客服
-	 */
-	private static DayOfWeek getNextWorkDay(DayOfWeek currentDay) {
-		// 如果当前是周五,下一个工作日是周一;否则,是当前星期的下一天
-		if (currentDay == java.time.DayOfWeek.FRIDAY) {
-			return java.time.DayOfWeek.SATURDAY;
-		}
-		if (currentDay == DayOfWeek.SATURDAY) {
-			return DayOfWeek.SUNDAY;
+		if (CollUtil.isNotEmpty(dtoCs)) {
+			Map<String, List<YhServiceDto>> dutyServices = yhServiceDtos.stream().collect(Collectors.groupingBy(YhServiceDto::getSign));
+			workdayServices = dutyServices.get("workday");
+			saturdayServices = dutyServices.get("Saturday");
+			sundayServices = dutyServices.get("Sunday");
+
+			List<YhServiceDto> holidayServices = dutyServices.get("holiday");
+			if (CollUtil.isNotEmpty(holidayServices)) {
+				holidayDateMap = holidayServices.stream().collect(Collectors.groupingBy(YhServiceDto::getDate));
+			}
 		}
-		return DayOfWeek.MONDAY;
+		LocalDateTime now = LocalDateTime.now();
+		List<String> dutyServices = getDutyServices(workdayServices, saturdayServices, sundayServices, holidayDateMap, now);
+		return dutyServices;
 	}
 
-	private List<YhServiceDto> getDutyService(DayOfWeek nextWorkDay, List<YhServiceDto> workday, List<YhServiceDto> saturday, List<YhServiceDto> sunday) {
-		if (nextWorkDay == DayOfWeek.SATURDAY) {
-			return Optional.ofNullable(saturday).orElse(Optional.ofNullable(sunday).orElse(workday));
-		}
-		if (nextWorkDay == DayOfWeek.SUNDAY) {
-			return Optional.ofNullable(sunday).orElse(workday);
+
+
+	public List<String> getDutyServices(List<YhServiceDto> workday, List<YhServiceDto> saturday, List<YhServiceDto> sunday, Map<String, List<YhServiceDto>> holidayDateMap, LocalDateTime now) {
+		if (CollUtil.isNotEmpty(workday)) {
+			DayOfWeek currentDayOfWeek = now.getDayOfWeek();
+
+			List<YhServiceDto> carryServices = CropDutyServiceDateService.getDutyService(currentDayOfWeek, workday, saturday, sunday, holidayDateMap, now);
+			//获取值班客服
+			List<YhServiceDto> dutyServiceCodes = getTimeDutyServices(carryServices, workday, saturday, sunday, holidayDateMap, currentDayOfWeek, now);
+			if (CollUtil.isNotEmpty(dutyServiceCodes)) {
+				Set<String> collectFollow = new HashSet<>();
+				for (YhServiceDto dutyServiceCode : dutyServiceCodes) {
+					dutyServiceCode.getSelect().stream().filter(e -> StrUtil.isNotBlank(e.getFollowId())).forEach(cs -> collectFollow.add(cs.getFollowId()));
+				}
+				return new ArrayList<>(collectFollow);
+			}
 		}
-		return workday;
+		return null;
 	}
 
-
 	/**
-	 * 获取工作日
+	 * 获取当前时间段值班的客服
 	 */
-	public List<YhServiceDto> getDutyServiceCode(List<YhServiceDto> carryServices, List<YhServiceDto> workday, List<YhServiceDto> saturday, List<YhServiceDto> sunday, DayOfWeek currentDayOfWeek, LocalTime currentTime) {
+	public List<YhServiceDto> getTimeDutyServices(List<YhServiceDto> carryServices, List<YhServiceDto> workday, List<YhServiceDto> saturday, List<YhServiceDto> sunday, Map<String, List<YhServiceDto>> holidayDateMap, DayOfWeek currentDayOfWeek, LocalDateTime now) {
+		// 获取当前时间
+		LocalTime currentTime = now.toLocalTime();
+
 		List<YhServiceDto> collect = carryServices.stream().filter(time -> time.isBetween(currentTime)).collect(Collectors.toList());
 		if (CollUtil.isEmpty(collect)) {
 			collect = carryServices.stream().filter(time -> time.isAfter(currentTime)).collect(Collectors.toList());
 			if (CollUtil.isEmpty(collect)) {
 				// 如果没有下一个时间段,获取下一个工作时间段的开始时间
-				DayOfWeek nextWorkDay = getNextWorkDay(currentDayOfWeek);
-				collect = getDutyService(nextWorkDay, workday, saturday, sunday);
+				DayOfWeek nextWorkDay = CropDutyServiceDateService.getNextWorkDay(currentDayOfWeek);
+				collect = CropDutyServiceDateService.getDutyService(nextWorkDay, workday, saturday, sunday, holidayDateMap, now.plusDays(1));
 			}
 			collect.sort(Comparator.comparing(e -> DateUtil.parse(e.getSortTime() == null ? e.getStartTime() : e.getSortTime(), "HH:mm")));
 			//获取下一天的早时
@@ -146,4 +136,5 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper,SysConfig>
 		}
 		return collect;
 	}
+
 }

+ 6 - 0
netflix-service/src/main/java/com/cyksj/service/user/UserBenefitsService.java

@@ -1,6 +1,7 @@
 package com.cyksj.service.user;
 
 import com.cyksj.model.entity.UserBalanceSourceRecord;
+import com.cyksj.model.entity.UserGalaxycoinRecord;
 
 import java.math.BigDecimal;
 
@@ -44,4 +45,9 @@ 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/impl/UserBenefitsServiceImpl.java

@@ -178,4 +178,24 @@ 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);
+		}
+	}
 }

+ 4 - 2
netflix-web/src/main/java/com/cyksj/web/controller/manage/corp/CorpMsgBulkTaskController.java

@@ -106,6 +106,7 @@ public class CorpMsgBulkTaskController {
 		}
 		SearchResult<CorpMsgBulkTask> search = beanSearcher.search(CorpMsgBulkTask.class, builder
 				.field(CorpMsgBulkTask::getDeleted, true)
+				.orderBy(CorpMsgBulkTask::getId).desc()
 				.build());
 		search.getDataList().forEach(data -> {
 			try {
@@ -124,8 +125,9 @@ public class CorpMsgBulkTaskController {
 				if (StrUtil.isNotBlank(data.getAttachmentsStr())) {
 					data.setAttachments(Jsons.parseList(data.getAttachmentsStr(), Attachments.class));
 				}
-				if (data.getCouponId() != null) {
-					data.setCouponName(couponMapper.getCouponNameById(data.getCouponId()));
+				if (StrUtil.isNotEmpty(data.getCouponIds())) {
+					List<Long> couponIds = Jsons.parseList(data.getCouponIds(), Long.class);
+					data.setCouponName(couponMapper.getCouponNameByIds(couponIds));
 				}
 				if (data.getCategory() != null && data.getCategory() > 0) {
 					Optional.ofNullable(corpMsgBulkTaskCategoryMapper.selectById(data.getCategory())).ifPresent(e -> data.setCategoryName(e.getName()));

+ 3 - 3
netflix-web/src/main/java/com/cyksj/web/controller/manage/corp/CorpTagController.java

@@ -173,9 +173,9 @@ public class CorpTagController {
 	 * 通过标签 查找对应用户订单数据
 	 */
 	@GetMapping("/get/tagUser/data")
-	public Result<UserOrderDetailView> getTagUserData(@RequestParam(defaultValue = "1") Integer start, @RequestParam(defaultValue = "10") Integer limit, @RequestParam(required = true) String tagName, String startTime, String endTime) {
-		Assert.notEmpty(tagName, "请输入对应标签");
-		UserOrderDetailView userOrderDetailView = corpTagService.getTagUserData(start, limit, tagName, startTime, endTime);
+	public Result<UserOrderDetailView> getTagUserData(@RequestParam(defaultValue = "1") Integer start, @RequestParam(defaultValue = "10") Integer limit, @RequestParam(required = true) String tagIdStr, String startTime, String endTime) {
+		Assert.notEmpty(tagIdStr, "请输入对应标签");
+		UserOrderDetailView userOrderDetailView = corpTagService.getTagUserData(start, limit, tagIdStr, startTime, endTime);
 		return GatewayResponse.SUCCESS.newBuilder().toResult(userOrderDetailView);
 	}
 }

+ 1 - 1
netflix-web/src/main/java/com/cyksj/web/controller/manage/group/CmsGroupRelationController.java

@@ -191,7 +191,7 @@ public class CmsGroupRelationController {
             if (groupsTrips != null) {
                 e.setAccount(groupsTrips.getAccount());
                 e.setPassword(groupsTrips.getPassword());
-                e.setAccountExpiryTime(e.getExpiryTime());
+                e.setAccountExpiryTime(groupsTrips.getExpiryTime());
             }
         });
         return GatewayResponse.SUCCESS.newBuilder().toResult(search);

+ 6 - 0
netflix-web/src/main/java/com/cyksj/web/controller/manage/home/HomeManageConfigController.java

@@ -73,6 +73,8 @@ public class HomeManageConfigController {
 		HomeManagementConfig byId = homeManagementConfigService.getById(id);
 		Assert.notNull(byId, "配置不存在");
 		byId.setStatus(!byId.getStatus());
+		byId.setTime(null);
+		byId.setPreStatus(null);
 		homeManagementConfigService.updateById(byId);
 		Set<String> keys = redisService.keys(RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "*");
 		redisService.del(keys.toArray(String[]::new));
@@ -85,8 +87,12 @@ public class HomeManageConfigController {
 	@PutMapping("/batch/update/status/{status}")
 	public Result<String> batchUpdateStatus(@RequestBody List<Long> ids, @PathVariable Boolean status) {
 		homeManagementConfigService.update(null, Wrappers.lambdaUpdate(HomeManagementConfig.class)
+				.set(HomeManagementConfig::getTime, null)
+				.set(HomeManagementConfig::getPreStatus, null)
 				.set(HomeManagementConfig::getStatus, status)
 				.in(HomeManagementConfig::getId, ids));
+		//批量取消定时上下架状态
+		homeManagementConfigService.batchCancelTimingStatus(ids);
 		Set<String> keys = redisService.keys(RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "*");
 		redisService.del(keys.toArray(String[]::new));
 		return GatewayResponse.SUCCESS.newBuilder().toResult();

+ 100 - 0
netflix-web/src/main/java/com/cyksj/web/controller/payment/OrderShopCartController.java

@@ -0,0 +1,100 @@
+package com.cyksj.web.controller.payment;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.cyksj.dto.Result;
+import com.cyksj.enums.GatewayResponse;
+import com.cyksj.model.entity.ShoppingCartDon;
+import com.cyksj.model.request.OrderPayRequest;
+import com.cyksj.model.request.UnifiedOrderPayReq;
+import com.cyksj.model.views.ShoppingCartDonPayDetailView;
+import com.cyksj.model.views.ShoppingCartDonView;
+import com.cyksj.service.order.ShoppingCartDonService;
+import com.cyksj.web.util.StpUserUtil;
+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 org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: OrderShopCartController
+ * 创建者: JavaZou
+ * 创建时间:2023/10/12 11:05
+ */
+@RestController
+@RequestMapping("/applet/order/shopCart")
+@RequiredArgsConstructor
+public class OrderShopCartController {
+	private final ShoppingCartDonService shoppingCartDonService;
+
+	private final BeanSearcher beanSearcher;
+
+	private final HttpServletRequest request;
+
+	/**
+	 * 将商品添加至购物车
+	 */
+	@PostMapping("/add")
+	public Result<String> addGoodsShoppingCart(@RequestBody ShoppingCartDon goods) {
+		long userId = StpUserUtil.getLoginIdAsLong();
+		goods.setUserId(userId);
+		shoppingCartDonService.addGoodsShoppingCart(goods);
+		return GatewayResponse.SUCCESS.newBuilder().toResult();
+	}
+
+
+	/**
+	 * 将商品 移除购物车
+	 */
+	@DeleteMapping("/remove/{id}")
+	public Result<String> removeShoppingCartGoodsById(@PathVariable Long id) {
+		long userId = StpUserUtil.getLoginIdAsLong();
+		shoppingCartDonService.remove(Wrappers.lambdaQuery(ShoppingCartDon.class)
+				.eq(ShoppingCartDon::getUserId, userId)
+				.eq(ShoppingCartDon::getId, id));
+		return GatewayResponse.SUCCESS.newBuilder().toResult();
+	}
+
+	/**
+	 * 一键清空 购物车
+	 */
+	@DeleteMapping("/clean")
+	public Result<String> cleanShoppingCart() {
+		long userId = StpUserUtil.getLoginIdAsLong();
+		shoppingCartDonService.remove(Wrappers.lambdaQuery(ShoppingCartDon.class)
+				.eq(ShoppingCartDon::getUserId, userId));
+		return GatewayResponse.SUCCESS.newBuilder().toResult();
+	}
+
+
+	/**
+	 * 个人 购物车列表
+	 */
+	@DeleteMapping("/get")
+	public Result<SearchResult<ShoppingCartDonView>> getShoppingCartGoods() {
+		long userId = StpUserUtil.getLoginIdAsLong();
+		MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
+		builder.put("uid", String.format(" where user_id = %s", userId));
+		SearchResult<ShoppingCartDonView> search = beanSearcher.search(ShoppingCartDonView.class, builder.build());
+		return GatewayResponse.SUCCESS.newBuilder().toResult(search);
+	}
+
+
+	/**
+	 * 购物车 下单
+	 */
+	@PostMapping("/unified/pay")
+	public Result<ShoppingCartDonPayDetailView> unifiedPayShoppingCartGoods(@RequestBody UnifiedOrderPayReq unifiedOrderPayReq) {
+		long userId = StpUserUtil.getLoginIdAsLong();
+		unifiedOrderPayReq.setUserId(userId);
+		ShoppingCartDonPayDetailView payDetailView = shoppingCartDonService.unifiedPayShoppingCartGoods(unifiedOrderPayReq);
+		return GatewayResponse.SUCCESS.newBuilder().toResult(payDetailView);
+	}
+
+
+}