Bläddra i källkod

到期未续费账号;独立规格续费列表

zoujiajian 2 år sedan
förälder
incheckning
acfcbe67d2

+ 4 - 0
netflix-dao/src/main/java/com/cyksj/mapper/GoodsDonSkuMapper.java

@@ -13,4 +13,8 @@ import java.util.List;
 public interface GoodsDonSkuMapper  extends BaseMapper<GoodsDonSku> {
 public interface GoodsDonSkuMapper  extends BaseMapper<GoodsDonSku> {
 
 
 	List<Long> selectAIMonthSkuIds(@Param("list") List<Long> goodsIds);
 	List<Long> selectAIMonthSkuIds(@Param("list") List<Long> goodsIds);
+
+	List<Long> getSpecificSkuIdsByGoodsIds(@Param("list") List<Long> aiGoodsIds, @Param("months") Integer months);
+
+	List<Long> getSpecificSkuIdsByGoodsId(@Param("goodsId") Long goodsId, @Param("num") Integer num, @Param("months") Integer months);
 }
 }

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

@@ -0,0 +1,13 @@
+package com.cyksj.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cyksj.model.entity.TicketPwdViewRecord;
+
+/*
+ *项目名: netflix
+ *文件名: TicketPwdViewRecordMapper
+ *创建者: JavaZou
+ *创建时间:2023/5/17 16:15
+ */
+public interface TicketPwdViewRecordMapper extends BaseMapper<TicketPwdViewRecord> {
+}

+ 26 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/TicketPwdViewRecord.java

@@ -0,0 +1,26 @@
+package com.cyksj.model.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/*
+ *项目名: netflix
+ *文件名: TicketPwdViewRecord
+ *创建者: JavaZou
+ *创建时间:2023/5/17 16:07
+ */
+@Getter
+@Setter
+public class TicketPwdViewRecord extends BaseEntity{
+	private Long userId;
+
+	private Long relationId;
+
+	private String account;
+
+	private String password;
+
+	private Long skuId;
+
+	private String operateLocation;
+}

+ 63 - 0
netflix-dao/src/main/java/com/cyksj/model/views/AccountSpecificView.java

@@ -0,0 +1,63 @@
+package com.cyksj.model.views;
+
+import com.ejlchina.searcher.bean.DbField;
+import com.ejlchina.searcher.bean.SearchBean;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/*
+ *项目名: yhlxj
+ *文件名: AccountSpecificView
+ *创建者: JavaZou
+ *创建时间:2023/9/21 15:03
+ */
+@Getter
+@Setter
+@SearchBean(tables = "account a inner join groups_trips gt on gt.account_id = a.id :condition:" +
+		" left join goods_don g on g.id = a.goods_id" +
+		" left join goods_don_sku sku on sku.id = gt.sku_id")
+public class AccountSpecificView {
+	@DbField("a.id")
+	private Long id;
+
+	@DbField("a.account")
+	private String account;
+
+	@DbField("a.password")
+	private String password;
+
+	@DbField("a.start_time")
+	private Date startTime;
+
+	@DbField("a.expiry_time")
+	private Date expiryTime;
+
+	@DbField("a.goods_id")
+	private Long goodsId;
+
+	@DbField("gt.sku_id")
+	private Long skuId;
+
+	@DbField("g.title")
+	private String title;
+
+	@DbField("sku.spec_val")
+	private String specVal;
+
+	@DbField("gt.num")
+	private Integer num;
+
+	@DbField("gt.available_num")
+	private Integer availableNum;
+
+	@DbField("a.remark")
+	private String remark;
+
+	@DbField("a.created_time")
+	private Date createdTime;
+
+	@DbField("a.update_time")
+	private Date updateTime;
+}

+ 51 - 0
netflix-dao/src/main/java/com/cyksj/model/views/TicketPwdViewRecordView.java

@@ -0,0 +1,51 @@
+package com.cyksj.model.views;
+
+import com.ejlchina.searcher.bean.DbField;
+import com.ejlchina.searcher.bean.SearchBean;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: TicketPwdViewRecordView
+ * 创建者: JavaZou
+ * 创建时间:2024/1/23 13:54
+ */
+@Getter
+@Setter
+@SearchBean(tables = "(select * from ticket_pwd_view_record where account is not null) tpr left join goods_don_sku sku on sku.id = tpr.sku_id" +
+		" left join goods_don g on g.id = sku.goods_id" +
+		" left join user u on u.id = tpr.user_id")
+public class TicketPwdViewRecordView {
+	@DbField("tpr.id")
+	private Long id;
+
+	@DbField("u.id")
+	private Long userId;
+
+	@DbField("u.nickname")
+	private String nickname;
+
+	@DbField("tpr.account")
+	private String account;
+
+	@DbField("tpr.password")
+	private String password;
+
+	@DbField("g.id")
+	private Long goodsId;
+
+	@DbField("g.title")
+	private String title;
+
+	@DbField("sku.id")
+	private Long skuId;
+
+	@DbField("sku.spec_val")
+	private String specVal;
+
+	@DbField("tpr.created_time")
+	private Date createdTime;
+}

+ 16 - 0
netflix-dao/src/main/resources/mapper/GoodsDonSkuMapper.xml

@@ -9,4 +9,20 @@
         </foreach>
         </foreach>
         and `months` = 1
         and `months` = 1
     </select>
     </select>
+
+    <select id="getSpecificSkuIdsByGoodsIds" resultType="java.lang.Long">
+        select id from goods_don_sku where goods_id in
+        <foreach collection="list" item="item" open="(" separator="," close=")">
+            #{item}
+        </foreach>
+        and `months` = #{months}
+    </select>
+
+    <select id="getSpecificSkuIdsByGoodsId" resultType="java.lang.Long">
+        select id
+        from goods_don_sku
+        where goods_id = #{goodsId}
+          and num = #{num}
+          and `months` = #{months}
+    </select>
 </mapper>
 </mapper>

+ 11 - 9
netflix-web/src/main/java/com/cyksj/web/controller/group/GroupRelationController.java

@@ -18,7 +18,6 @@ import com.cyksj.common.snowflake.Sequence;
 import com.cyksj.common.task.GlobalThreadPoolTaskExecutor;
 import com.cyksj.common.task.GlobalThreadPoolTaskExecutor;
 import com.cyksj.common.util.GoogleGenerator;
 import com.cyksj.common.util.GoogleGenerator;
 import com.cyksj.common.util.Jsons;
 import com.cyksj.common.util.Jsons;
-import com.cyksj.common.util.StringUtil;
 import com.cyksj.dto.Result;
 import com.cyksj.dto.Result;
 import com.cyksj.enums.GatewayResponse;
 import com.cyksj.enums.GatewayResponse;
 import com.cyksj.mapper.*;
 import com.cyksj.mapper.*;
@@ -102,6 +101,8 @@ public class GroupRelationController {
 
 
     private final ChatGptAuthService chatGptAuthService;
     private final ChatGptAuthService chatGptAuthService;
 
 
+    private final TicketPwdViewRecordMapper ticketPwdViewRecordMapper;
+
     private final static Sequence SEQUENCE = new Sequence(0);
     private final static Sequence SEQUENCE = new Sequence(0);
 
 
     @RequestMapping("/get/renewal")
     @RequestMapping("/get/renewal")
@@ -187,17 +188,19 @@ public class GroupRelationController {
                 .field(GroupsRelationView::getId, relationId).build());
                 .field(GroupsRelationView::getId, relationId).build());
         if (groupsRelationView == null) {
         if (groupsRelationView == null) {
             log.info("userId:{}查看relationId:{}车票不存在", userId, relationId);
             log.info("userId:{}查看relationId:{}车票不存在", userId, relationId);
-            throw BusinessRuntimeException.getInstance(I18nMessageUtil.getI18nMsg("sys_error"));
+            throw BusinessRuntimeException.getInstance("该车票已不存在");
         }
         }
-        if (groupsRelationView.getAccountId() == null) throw BusinessRuntimeException.getInstance(I18nMessageUtil.getI18nMsg("account_not_set"));
-        if (groupRelationFrontService == null) throw BusinessRuntimeException.getInstance(I18nMessageUtil.getI18nMsg("sys_error"));
-        ChatGptPwdViewRecord viewRecord = new ChatGptPwdViewRecord();
+        if (groupsRelationView.getAccountId() == null) throw BusinessRuntimeException.getInstance("该车队未配置账号");
+        if (groupRelationFrontService == null) throw BusinessRuntimeException.getInstance("车票已不存在");
+        TicketPwdViewRecord viewRecord = new TicketPwdViewRecord();
         viewRecord.setUserId(userId);
         viewRecord.setUserId(userId);
         viewRecord.setRelationId(relationId);
         viewRecord.setRelationId(relationId);
         viewRecord.setSkuId(groupsRelationView.getSkuId());
         viewRecord.setSkuId(groupsRelationView.getSkuId());
-        viewRecord.setOperateLocation(StringUtil.getRealAddressByIP(ServletUtil.getClientIP(request)));
-        chatGptPwdViewRecordMapper.insert(viewRecord);
-        if (StrUtil.isEmpty(groupsRelationView.getApiSecret())) {
+        viewRecord.setOperateLocation(ServletUtil.getClientIP(request));
+        viewRecord.setAccount(groupsRelationView.getTripsAccount());
+        viewRecord.setPassword(groupsRelationView.getTripsPassword());
+        ticketPwdViewRecordMapper.insert(viewRecord);
+        if (groupsRelationView.getGoodsId() == 18 && StrUtil.isEmpty(groupsRelationView.getApiSecret())) {
             THREAD_POOL.execute(() -> {
             THREAD_POOL.execute(() -> {
                 //车队所有人查看密码
                 //车队所有人查看密码
                 Integer num = groupsRelationView.getGtNum();
                 Integer num = groupsRelationView.getGtNum();
@@ -223,7 +226,6 @@ public class GroupRelationController {
         }
         }
         return GatewayResponse.SUCCESS.newBuilder().toResult(groupsRelationView.getTripsPassword());
         return GatewayResponse.SUCCESS.newBuilder().toResult(groupsRelationView.getTripsPassword());
     }
     }
-
     /**
     /**
      * 获取AI类 ChatGPT产品谷歌验证码
      * 获取AI类 ChatGPT产品谷歌验证码
      */
      */

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

@@ -1,5 +1,6 @@
 package com.cyksj.web.controller.manage.account;
 package com.cyksj.web.controller.manage.account;
 
 
+import com.cyksj.common.constant.Constant;
 import com.cyksj.web.util.StpAbroadUtil;
 import com.cyksj.web.util.StpAbroadUtil;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateTime;
@@ -56,10 +57,7 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.IOException;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Optional;
-import java.util.Set;
+import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
 /**
 /**
@@ -104,6 +102,8 @@ public class CmsAccountController {
 
 
 	private final SysEmailMapper sysEmailMapper;
 	private final SysEmailMapper sysEmailMapper;
 
 
+	private final GoodsDonSkuMapper goodsDonSkuMapper;
+
 	@GetMapping("/get")
 	@GetMapping("/get")
 	public Result<SearchResult<AccountView>> get(Long userId, String showId, String nickName, String submitAccount, String expiryStartTime, String expiryEndTime, Boolean expiredAll, Boolean existsExpired, Boolean existsExpiredToday, Integer noChangeMonths) {
 	public Result<SearchResult<AccountView>> get(Long userId, String showId, String nickName, String submitAccount, String expiryStartTime, String expiryEndTime, Boolean expiredAll, Boolean existsExpired, Boolean existsExpiredToday, Integer noChangeMonths) {
 		MapBuilder mapBuilder = MapUtils.flatBuilder(request.getParameterMap());
 		MapBuilder mapBuilder = MapUtils.flatBuilder(request.getParameterMap());
@@ -871,6 +871,39 @@ public class CmsAccountController {
 		return GatewayResponse.SUCCESS.newBuilder().toResult(search);
 		return GatewayResponse.SUCCESS.newBuilder().toResult(search);
 	}
 	}
 
 
+	/**
+	 * 用户车看车票账号密码 记录列表
+	 */
+	@GetMapping("/get/ticket/pwd/view")
+	public Result<SearchResult<TicketPwdViewRecordView>> getTicketPwdView() {
+		SearchResult<TicketPwdViewRecordView> search = beanSearcher.search(TicketPwdViewRecordView.class, MapUtils.flatBuilder(request.getParameterMap())
+				.orderBy(TicketPwdViewRecordView::getId).desc()
+				.build());
+		return GatewayResponse.SUCCESS.newBuilder().toResult(search);
+	}
+
+	/**
+	 * MidJourney、ChatGPT年付 ChatGpt独立月付未续费列表
+	 */
+	@GetMapping("/get/specific/account")
+	public Result<SearchResult<AccountSpecificView>> getSpecificAccount() {
+		//获取MidJourney、ChatGPT年付 ChatGpt独立月付 规格id
+		Long chatGptPlusGid = Constant.AI_goodsIds.get(0);
+		//年付
+		List<Long> yearSkuIds = goodsDonSkuMapper.getSpecificSkuIdsByGoodsIds(Constant.AI_goodsIds, 12);
+		//ChatGpt Plus 独立月付
+		List<Long> monthSkuIds = goodsDonSkuMapper.getSpecificSkuIdsByGoodsId(chatGptPlusGid, 1, 1);
+		Collection<Long> skuIds = CollUtil.addAll(yearSkuIds, monthSkuIds);
+		if (skuIds.isEmpty()) {
+			return GatewayResponse.SUCCESS.newBuilder().toResult();
+		}
+		SearchResult<AccountSpecificView> search = beanSearcher.search(AccountSpecificView.class, MapUtils.flatBuilder(request.getParameterMap())
+				.put("condition", String.format("and (select count(*) from groups_relation gr where gr.groups_id = gt.id and gr.user_id != 0 and gr.status in ('validity','outside')) > 0"))
+				.field(AccountSpecificView::getExpiryTime, DateTime.now()).op(Operator.LessThan)
+				.field(AccountSpecificView::getSkuId, skuIds).op(Operator.InList).build());
+		return GatewayResponse.SUCCESS.newBuilder().toResult(search);
+	}
+
 	/**
 	/**
 	 * 批量导入系统邮箱
 	 * 批量导入系统邮箱
 	 */
 	 */