未完成版本

This commit is contained in:
Van0313
2025-07-29 15:27:54 +08:00
parent 91fcbabfd1
commit a573d71a4f
7 changed files with 425 additions and 247 deletions

4
.idea/jpa.xml generated
View File

@@ -2,8 +2,8 @@
<project version="4"> <project version="4">
<component name="JpaBuddyIdeaProjectConfig" ddlActionDbType="mysql"> <component name="JpaBuddyIdeaProjectConfig" ddlActionDbType="mysql">
<option name="defaultUnitInitialized" value="true" /> <option name="defaultUnitInitialized" value="true" />
<option name="reLastEntityCreationPackage" value="src/main/java/cn/van/business/model" /> <option name="reLastEntityCreationPackage" value="src/main/java/cn/van/business/model/cj" />
<option name="renamerInitialized" value="true" /> <option name="renamerInitialized" value="true" />
<option name="reverseEngineeringLastDbConnectionId" value="d0f6174d-14a9-4a99-9dfa-6f782ed4fa8d__jd" /> <option name="reverseEngineeringLastDbConnectionId" value="31c422ff-86c8-4fe9-ba98-f496d4f1b534" />
</component> </component>
</project> </project>

View File

@@ -0,0 +1,35 @@
package cn.van.business.model.cj;
import jakarta.persistence.*;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDate;
@Getter
@Setter
@Entity
@Table(name = "xb_message")
public class XbMessage {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id", nullable = false)
private Integer id;
@Column(name = "create_date")
private LocalDate createDate;
@Size(max = 100)
@Column(name = "skuId", length = 100)
private String skuId;
@Size(max = 10240)
@Column(name = "tip_original_message", length = 10240)
private String tipOriginalMessage;
@Size(max = 100)
@Column(name = "from_wxid", length = 100)
private String fromWxid;
}

View File

@@ -0,0 +1,71 @@
package cn.van.business.model.cj;
import jakarta.persistence.*;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDate;
@Getter
@Setter
@Entity
@Table(name = "xb_message_item")
public class XbMessageItem {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id", nullable = false)
private Integer id;
@Column(name = "create_date")
private LocalDate createDate;
@Size(max = 100)
@Column(name = "skuId", length = 100)
private String skuId;
@Size(max = 100)
@Column(name = "xb_message_id", length = 100)
private String xbMessageId;
@Lob
@Column(name = "json_query_result")
private String jsonQueryResult;
@Lob
@Column(name = "json_couponList")
private String jsonCouponlist;
@Size(max = 100)
@Column(name = "spuid", length = 100)
private String spuid;
@Size(max = 1024)
@Column(name = "sku_name", length = 1024)
private String skuName;
@Lob
@Column(name = "json_shopInfo")
private String jsonShopinfo;
@Size(max = 1024)
@Column(name = "priceInfo", length = 1024)
private String priceInfo;
@Size(max = 1024)
@Column(name = "json_commissionInfo", length = 1024)
private String jsonCommissioninfo;
@Size(max = 1024)
@Column(name = "json_imageList", length = 1024)
private String jsonImagelist;
@Size(max = 100)
@Column(name = "owner", length = 100)
private String owner;
@Size(max = 1024)
@Column(name = "json_categoryInfo", length = 1024)
private String jsonCategoryinfo;
}

View File

@@ -0,0 +1,18 @@
package cn.van.business.repository;
import cn.van.business.model.cj.XbMessageItem;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* @author Leo
* @version 1.0
* @create 2025/5/2 19:16
* @description评论数据访问层接口
*/
@Repository
public interface XbMessageItemRepository extends JpaRepository<XbMessageItem, Integer> {
}

View File

@@ -0,0 +1,18 @@
package cn.van.business.repository;
import cn.van.business.model.cj.XbMessage;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* @author Leo
* @version 1.0
* @create 2025/5/2 19:16
* @description评论数据访问层接口
*/
@Repository
public interface XbMessageRepository extends JpaRepository<XbMessage, Integer> {
}

View File

@@ -3,14 +3,13 @@ package cn.van.business.util;
import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpResponse;
import cn.van.business.model.cj.XbMessage;
import cn.van.business.model.cj.XbMessageItem;
import cn.van.business.model.jd.JDOrder; import cn.van.business.model.jd.JDOrder;
import cn.van.business.model.jd.OrderRow; import cn.van.business.model.jd.OrderRow;
import cn.van.business.model.pl.Comment; import cn.van.business.model.pl.Comment;
import cn.van.business.model.pl.TaobaoComment; import cn.van.business.model.pl.TaobaoComment;
import cn.van.business.repository.CommentRepository; import cn.van.business.repository.*;
import cn.van.business.repository.JDOrderRepository;
import cn.van.business.repository.OrderRowRepository;
import cn.van.business.repository.TaobaoCommentRepository;
import cn.van.business.util.ds.DeepSeekClientUtil; import cn.van.business.util.ds.DeepSeekClientUtil;
import cn.van.business.util.ds.GPTClientUtil; import cn.van.business.util.ds.GPTClientUtil;
import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSON;
@@ -128,6 +127,9 @@ public class JDUtil {
private final CommentRepository commentRepository; private final CommentRepository commentRepository;
private JDOrderRepository jdOrderRepository; private JDOrderRepository jdOrderRepository;
private final TaobaoCommentRepository taobaoCommentRepository; private final TaobaoCommentRepository taobaoCommentRepository;
private final XbMessageRepository xbMessageRepository;
private final XbMessageItemRepository xbMessageItemRepository;
private final OrderUtil orderUtil; private final OrderUtil orderUtil;
private final DeepSeekClientUtil deepSeekClientUtil; private final DeepSeekClientUtil deepSeekClientUtil;
@@ -142,15 +144,17 @@ public class JDUtil {
// 构造函数中注入StringRedisTemplate // 构造函数中注入StringRedisTemplate
@Autowired @Autowired
public JDUtil(JDOrderRepository jdOrderRepository, StringRedisTemplate redisTemplate, OrderRowRepository orderRowRepository, WXUtil wxUtil, TaobaoCommentRepository taobaoCommentRepository, OrderUtil orderUtil, DeepSeekClientUtil deepSeekClientUtil, CommentRepository commentRepository, GPTClientUtil gptClientUtil) { public JDUtil(JDOrderRepository jdOrderRepository, StringRedisTemplate redisTemplate, OrderRowRepository orderRowRepository, WXUtil wxUtil, TaobaoCommentRepository taobaoCommentRepository, XbMessageItemRepository xbMessageItemRepository, OrderUtil orderUtil, DeepSeekClientUtil deepSeekClientUtil, CommentRepository commentRepository, XbMessageRepository xbMessageRepository, GPTClientUtil gptClientUtil) {
this.jdOrderRepository = jdOrderRepository; this.jdOrderRepository = jdOrderRepository;
this.redisTemplate = redisTemplate; this.redisTemplate = redisTemplate;
this.orderRowRepository = orderRowRepository; this.orderRowRepository = orderRowRepository;
this.wxUtil = wxUtil; this.wxUtil = wxUtil;
this.taobaoCommentRepository = taobaoCommentRepository; this.taobaoCommentRepository = taobaoCommentRepository;
this.xbMessageItemRepository = xbMessageItemRepository;
this.orderUtil = orderUtil; this.orderUtil = orderUtil;
this.deepSeekClientUtil = deepSeekClientUtil; this.deepSeekClientUtil = deepSeekClientUtil;
this.commentRepository = commentRepository; this.commentRepository = commentRepository;
this.xbMessageRepository = xbMessageRepository;
this.gptClientUtil = gptClientUtil; this.gptClientUtil = gptClientUtil;
handleProductWithJF(); handleProductWithJF();
} }
@@ -198,6 +202,7 @@ public class JDUtil {
// 2. 生成推广内容 // 2. 生成推广内容
HashMap<String, List<String>> contentResult = generatePromotionContent(message, true); HashMap<String, List<String>> contentResult = generatePromotionContent(message, true);
// 3. 发送文本内容 // 3. 发送文本内容
for (String text : contentResult.get("text")) { for (String text : contentResult.get("text")) {
wxUtil.sendTextMessage(chatRoom_BY, text, 1, chatRoom_BY, true); wxUtil.sendTextMessage(chatRoom_BY, text, 1, chatRoom_BY, true);
@@ -1164,242 +1169,242 @@ public class JDUtil {
return finallyMessage; return finallyMessage;
} }
/** /*
* { {
* "jd_union_open_goods_query_responce": { "jd_union_open_goods_query_responce": {
* "code": "0", "code": "0",
* "queryResult": { "queryResult": {
* "code": 200, "code": 200,
* "data": [ "data": [
* { {
* "brandCode": "16407", "brandCode": "16407",
* "brandName": "松下Panasonic", "brandName": "松下Panasonic",
* "categoryInfo": { "categoryInfo": {
* "cid1": 737, "cid1": 737,
* "cid1Name": "家用电器", "cid1Name": "家用电器",
* "cid2": 794, "cid2": 794,
* "cid2Name": "大 家 电", "cid2Name": "大 家 电",
* "cid3": 880, "cid3": 880,
* "cid3Name": "洗衣机" "cid3Name": "洗衣机"
* }, },
* "comments": 10000, "comments": 10000,
* "commissionInfo": { "commissionInfo": {
* "commission": 599.95, "commission": 599.95,
* "commissionShare": 5, "commissionShare": 5,
* "couponCommission": 592.95, "couponCommission": 592.95,
* "endTime": 1743609599000, "endTime": 1743609599000,
* "isLock": 1, "isLock": 1,
* "plusCommissionShare": 5, "plusCommissionShare": 5,
* "startTime": 1742486400000 "startTime": 1742486400000
* }, },
* "couponInfo": { "couponInfo": {
* "couponList": [ "couponList": [
* { {
* "bindType": 1, "bindType": 1,
* "couponStatus": 0, "couponStatus": 0,
* "couponStyle": 0, "couponStyle": 0,
* "discount": 100, "discount": 100,
* "getEndTime": 1746028799000, "getEndTime": 1746028799000,
* "getStartTime": 1743436800000, "getStartTime": 1743436800000,
* "isBest": 1, "isBest": 1,
* "isInputCoupon": 1, "isInputCoupon": 1,
* "link": "https://coupon.m.jd.com/coupons/show.action?linkKey=AAROH_xIpeffAs_-naABEFoeVJzBK6Q6mfry4nz4ylRYHXsp_NnipDSrReNwGZGTxXhj94SGi9SkzR_7xaWEXLpO2boqow", "link": "https://coupon.m.jd.com/coupons/show.action?linkKey=AAROH_xIpeffAs_-naABEFoeVJzBK6Q6mfry4nz4ylRYHXsp_NnipDSrReNwGZGTxXhj94SGi9SkzR_7xaWEXLpO2boqow",
* "platformType": 0, "platformType": 0,
* "quota": 5000, "quota": 5000,
* "useEndTime": 1746028799000, "useEndTime": 1746028799000,
* "useStartTime": 1743436800000 "useStartTime": 1743436800000
* }, },
* { {
* "bindType": 1, "bindType": 1,
* "couponStatus": 0, "couponStatus": 0,
* "couponStyle": 0, "couponStyle": 0,
* "discount": 50, "discount": 50,
* "getEndTime": 1746028799000, "getEndTime": 1746028799000,
* "getStartTime": 1743436800000, "getStartTime": 1743436800000,
* "hotValue": 0, "hotValue": 0,
* "isBest": 0, "isBest": 0,
* "isInputCoupon": 0, "isInputCoupon": 0,
* "link": "https://coupon.m.jd.com/coupons/show.action?linkKey=AAROH_xIpeffAs_-naABEFoervD9YaNNXlsj6OBbZoWSFI1sZXw31PSjK04AH6tFP_Iu0YJlePWBT6sZfNvp14W0QK2K6A", "link": "https://coupon.m.jd.com/coupons/show.action?linkKey=AAROH_xIpeffAs_-naABEFoervD9YaNNXlsj6OBbZoWSFI1sZXw31PSjK04AH6tFP_Iu0YJlePWBT6sZfNvp14W0QK2K6A",
* "platformType": 0, "platformType": 0,
* "quota": 5000, "quota": 5000,
* "useEndTime": 1746028799000, "useEndTime": 1746028799000,
* "useStartTime": 1743436800000 "useStartTime": 1743436800000
* }, },
* { {
* "bindType": 1, "bindType": 1,
* "couponStatus": 0, "couponStatus": 0,
* "couponStyle": 0, "couponStyle": 0,
* "discount": 40, "discount": 40,
* "getEndTime": 1746028799000, "getEndTime": 1746028799000,
* "getStartTime": 1743436800000, "getStartTime": 1743436800000,
* "hotValue": 0, "hotValue": 0,
* "isBest": 0, "isBest": 0,
* "isInputCoupon": 0, "isInputCoupon": 0,
* "link": "https://coupon.m.jd.com/coupons/show.action?linkKey=AAROH_xIpeffAs_-naABEFoeqQdmhZbv1TiAn0QqI5gnT4g_zAgV5887llN8j6TatV-zpDfReipMr-hKkwQasE9NNUV2uQ", "link": "https://coupon.m.jd.com/coupons/show.action?linkKey=AAROH_xIpeffAs_-naABEFoeqQdmhZbv1TiAn0QqI5gnT4g_zAgV5887llN8j6TatV-zpDfReipMr-hKkwQasE9NNUV2uQ",
* "platformType": 0, "platformType": 0,
* "quota": 500, "quota": 500,
* "useEndTime": 1746028799000, "useEndTime": 1746028799000,
* "useStartTime": 1743436800000 "useStartTime": 1743436800000
* }, },
* { {
* "bindType": 1, "bindType": 1,
* "couponStatus": 0, "couponStatus": 0,
* "couponStyle": 0, "couponStyle": 0,
* "discount": 20, "discount": 20,
* "getEndTime": 1746028799000, "getEndTime": 1746028799000,
* "getStartTime": 1743436800000, "getStartTime": 1743436800000,
* "hotValue": 0, "hotValue": 0,
* "isBest": 0, "isBest": 0,
* "isInputCoupon": 0, "isInputCoupon": 0,
* "link": "https://coupon.m.jd.com/coupons/show.action?linkKey=AAROH_xIpeffAs_-naABEFoepukjRCuLpbwceODRbBw5HpNLRTVe5Olp99d34Izdo0s9lDtTIdyYZ-uJRCEXnc5N3OZ5LA", "link": "https://coupon.m.jd.com/coupons/show.action?linkKey=AAROH_xIpeffAs_-naABEFoepukjRCuLpbwceODRbBw5HpNLRTVe5Olp99d34Izdo0s9lDtTIdyYZ-uJRCEXnc5N3OZ5LA",
* "platformType": 0, "platformType": 0,
* "quota": 2000, "quota": 2000,
* "useEndTime": 1746028799000, "useEndTime": 1746028799000,
* "useStartTime": 1743436800000 "useStartTime": 1743436800000
* }, },
* { {
* "bindType": 1, "bindType": 1,
* "couponStatus": 0, "couponStatus": 0,
* "couponStyle": 0, "couponStyle": 0,
* "discount": 10, "discount": 10,
* "getEndTime": 1746028799000, "getEndTime": 1746028799000,
* "getStartTime": 1743436800000, "getStartTime": 1743436800000,
* "hotValue": 0, "hotValue": 0,
* "isBest": 0, "isBest": 0,
* "isInputCoupon": 0, "isInputCoupon": 0,
* "link": "https://coupon.m.jd.com/coupons/show.action?linkKey=AAROH_xIpeffAs_-naABEFoeKIIbuvk-VsfJj_m1o3PRHqRaEBIbXHwooEMMt3z44T3cNQTkQsS8TjGnEeIz1obKp_t_mQ", "link": "https://coupon.m.jd.com/coupons/show.action?linkKey=AAROH_xIpeffAs_-naABEFoeKIIbuvk-VsfJj_m1o3PRHqRaEBIbXHwooEMMt3z44T3cNQTkQsS8TjGnEeIz1obKp_t_mQ",
* "platformType": 0, "platformType": 0,
* "quota": 1000, "quota": 1000,
* "useEndTime": 1746028799000, "useEndTime": 1746028799000,
* "useStartTime": 1743436800000 "useStartTime": 1743436800000
* } }
* ] ]
* }, },
* "deliveryType": 1, "deliveryType": 1,
* "eliteType": [], "eliteType": [],
* "forbidTypes": [ "forbidTypes": [
* 0 0
* ], ],
* "goodCommentsShare": 99, "goodCommentsShare": 99,
* "imageInfo": { "imageInfo": {
* "imageList": [ "imageList": [
* { {
* "url": "https://img14.360buyimg.com/pop/jfs/t1/273873/17/14072/113544/67ebd215Feef3f56b/fc5156bf59a25ba3.jpg" "url": "https://img14.360buyimg.com/pop/jfs/t1/273873/17/14072/113544/67ebd215Feef3f56b/fc5156bf59a25ba3.jpg"
* }, },
* { {
* "url": "https://img14.360buyimg.com/pop/jfs/t1/273802/16/14273/84419/67ebd224F72dbcc8d/8ffe6f99aeeeb8fd.jpg" "url": "https://img14.360buyimg.com/pop/jfs/t1/273802/16/14273/84419/67ebd224F72dbcc8d/8ffe6f99aeeeb8fd.jpg"
* }, },
* { {
* "url": "https://img14.360buyimg.com/pop/jfs/t1/278931/40/12819/81341/67ea0227F41ffc604/ab1c6727e5d4f224.jpg" "url": "https://img14.360buyimg.com/pop/jfs/t1/278931/40/12819/81341/67ea0227F41ffc604/ab1c6727e5d4f224.jpg"
* }, },
* { {
* "url": "https://img14.360buyimg.com/pop/jfs/t1/276989/12/13440/79310/67ea0226F68c2ed40/8acdeda05aa3596b.jpg" "url": "https://img14.360buyimg.com/pop/jfs/t1/276989/12/13440/79310/67ea0226F68c2ed40/8acdeda05aa3596b.jpg"
* }, },
* { {
* "url": "https://img14.360buyimg.com/pop/jfs/t1/284503/25/12384/59498/67ea0225F8be60c83/b29ea34abc64346e.jpg" "url": "https://img14.360buyimg.com/pop/jfs/t1/284503/25/12384/59498/67ea0225F8be60c83/b29ea34abc64346e.jpg"
* }, },
* { {
* "url": "https://img14.360buyimg.com/pop/jfs/t1/284667/29/12481/56118/67ea0225F97d9c729/f4c81d77064957bd.jpg" "url": "https://img14.360buyimg.com/pop/jfs/t1/284667/29/12481/56118/67ea0225F97d9c729/f4c81d77064957bd.jpg"
* }, },
* { {
* "url": "https://img14.360buyimg.com/pop/jfs/t1/270959/35/13852/50552/67ea0224F911b8f00/248f9a7751549db7.jpg" "url": "https://img14.360buyimg.com/pop/jfs/t1/270959/35/13852/50552/67ea0224F911b8f00/248f9a7751549db7.jpg"
* }, },
* { {
* "url": "https://img14.360buyimg.com/pop/jfs/t1/274981/3/13326/48019/67ea0224Fe64bca69/b062218fc8db9b29.jpg" "url": "https://img14.360buyimg.com/pop/jfs/t1/274981/3/13326/48019/67ea0224Fe64bca69/b062218fc8db9b29.jpg"
* }, },
* { {
* "url": "https://img14.360buyimg.com/pop/jfs/t1/283691/1/12478/82267/67ea0223Fd4ecb0f5/2c32de327d8aa440.jpg" "url": "https://img14.360buyimg.com/pop/jfs/t1/283691/1/12478/82267/67ea0223Fd4ecb0f5/2c32de327d8aa440.jpg"
* }, },
* { {
* "url": "https://img14.360buyimg.com/pop/jfs/t1/281457/31/12476/94335/67ea0222Fde76593a/cdddcd59b0b20c9a.jpg" "url": "https://img14.360buyimg.com/pop/jfs/t1/281457/31/12476/94335/67ea0222Fde76593a/cdddcd59b0b20c9a.jpg"
* } }
* ] ]
* }, },
* "inOrderComm30Days": 633170.8, "inOrderComm30Days": 633170.8,
* "inOrderCount30Days": 3000, "inOrderCount30Days": 3000,
* "inOrderCount30DaysSku": 100, "inOrderCount30DaysSku": 100,
* "isHot": 1, "isHot": 1,
* "isJdSale": 1, "isJdSale": 1,
* "isOversea": 0, "isOversea": 0,
* "itemId": "BsrqLq5CfIziE7BSl3ItPp8q_3DFaNVYJqfkRRLc7HR", "itemId": "BsrqLq5CfIziE7BSl3ItPp8q_3DFaNVYJqfkRRLc7HR",
* "jxFlags": [], "jxFlags": [],
* "materialUrl": "jingfen.jd.com/detail/BsrqLq5CfIziE7BSl3ItPp8q_3DFaNVYJqfkRRLc7HR.html", "materialUrl": "jingfen.jd.com/detail/BsrqLq5CfIziE7BSl3ItPp8q_3DFaNVYJqfkRRLc7HR.html",
* "oriItemId": "BMrqLq5CfIz9X04KC3ItPp8q_3DFaNVYJqfkRRLc7HR", "oriItemId": "BMrqLq5CfIz9X04KC3ItPp8q_3DFaNVYJqfkRRLc7HR",
* "owner": "g", "owner": "g",
* "pinGouInfo": {}, "pinGouInfo": {},
* "pingGouInfo": {}, "pingGouInfo": {},
* "priceInfo": { "priceInfo": {
* "lowestCouponPrice": 11899, "lowestCouponPrice": 11899,
* "lowestPrice": 11999, "lowestPrice": 11999,
* "lowestPriceType": 1, "lowestPriceType": 1,
* "price": 11999 "price": 11999
* }, },
* "purchasePriceInfo": { "purchasePriceInfo": {
* "basisPriceType": 1, "basisPriceType": 1,
* "code": 200, "code": 200,
* "couponList": [ "couponList": [
* { {
* "bindType": 1, "bindType": 1,
* "couponStatus": 0, "couponStatus": 0,
* "couponStyle": 0, "couponStyle": 0,
* "discount": 100, "discount": 100,
* "isBest": 0, "isBest": 0,
* "link": "https://coupon.m.jd.com/coupons/show.action?linkKey=AAROH_xIpeffAs_-naABEFoeVJzBK6Q6mfry4nz4ylRYHXsp_NnipDSrReNwGZGTxXhj94SGi9SkzR_7xaWEXLpO2boqow", "link": "https://coupon.m.jd.com/coupons/show.action?linkKey=AAROH_xIpeffAs_-naABEFoeVJzBK6Q6mfry4nz4ylRYHXsp_NnipDSrReNwGZGTxXhj94SGi9SkzR_7xaWEXLpO2boqow",
* "platformType": 0, "platformType": 0,
* "quota": 5000 "quota": 5000
* }, },
* { {
* "bindType": 1, "bindType": 1,
* "couponStatus": 0, "couponStatus": 0,
* "couponStyle": 0, "couponStyle": 0,
* "discount": 40, "discount": 40,
* "isBest": 0, "isBest": 0,
* "link": "https://coupon.m.jd.com/coupons/show.action?linkKey=AAROH_xIpeffAs_-naABEFoeqQdmhZbv1TiAn0QqI5gnT4g_zAgV5887llN8j6TatV-zpDfReipMr-hKkwQasE9NNUV2uQ", "link": "https://coupon.m.jd.com/coupons/show.action?linkKey=AAROH_xIpeffAs_-naABEFoeqQdmhZbv1TiAn0QqI5gnT4g_zAgV5887llN8j6TatV-zpDfReipMr-hKkwQasE9NNUV2uQ",
* "platformType": 0, "platformType": 0,
* "quota": 500 "quota": 500
* } }
* ], ],
* "message": "success", "message": "success",
* "purchaseNum": 1, "purchaseNum": 1,
* "purchasePrice": 11859, "purchasePrice": 11859,
* "thresholdPrice": 11999 "thresholdPrice": 11999
* }, },
* "shopInfo": { "shopInfo": {
* "shopId": 1000001741, "shopId": 1000001741,
* "shopLabel": "0", "shopLabel": "0",
* "shopLevel": 4.9, "shopLevel": 4.9,
* "shopName": "松下洗衣机京东自营旗舰店" "shopName": "松下洗衣机京东自营旗舰店"
* }, },
* "skuName": "松下Panasonic白月光4.0Ultra 洗烘套装 10kg滚筒洗衣机+变频热泵烘干机 除毛升级2.0 水氧SPA护理 8532N+8532NR", "skuName": "松下Panasonic白月光4.0Ultra 洗烘套装 10kg滚筒洗衣机+变频热泵烘干机 除毛升级2.0 水氧SPA护理 8532N+8532NR",
* "skuTagList": [ "skuTagList": [
* { {
* "index": 1, "index": 1,
* "name": "自营", "name": "自营",
* "type": 11 "type": 11
* }, },
* { {
* "index": 1, "index": 1,
* "name": "plus", "name": "plus",
* "type": 6 "type": 6
* }, },
* { {
* "index": 3, "index": 3,
* "name": "7天无理由退货", "name": "7天无理由退货",
* "type": 12 "type": 12
* } }
* ], ],
* "spuid": 100137629936, "spuid": 100137629936,
* "videoInfo": {} "videoInfo": {}
* } }
* ], ],
* "message": "success", "message": "success",
* "requestId": "o_0b721560_m8yp5pqj_88394507", "requestId": "o_0b721560_m8yp5pqj_88394507",
* "totalCount": 1 "totalCount": 1
* } }
* } }
* } }
*
* */ */
// 如果需要图片和SKU名称则代表要把图片下载发过去还有对应的skuName // 如果需要图片和SKU名称则代表要把图片下载发过去还有对应的skuName
StringBuilder couponInfo = null; StringBuilder couponInfo = null;
@@ -1407,12 +1412,20 @@ public class JDUtil {
String format = null; String format = null;
DateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日HH时mm分ss秒"); DateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日HH时mm分ss秒");
Integer xbMessageId = 0;
if (!isCj) { if (!isCj) {
try { try {
priceList = extractPrices(message); priceList = extractPrices(message);
finallyMessage.put("priceList", priceList); finallyMessage.put("priceList", priceList);
} catch (Exception ignored) { } catch (Exception ignored) {
} }
}else {
XbMessage xbMessage = new XbMessage();
xbMessage.setCreateDate(LocalDate.now());
xbMessage.setTipOriginalMessage( message);
xbMessage = xbMessageRepository.save(xbMessage);
xbMessageId = xbMessage.getId();
} }
for (String url : urls) { for (String url : urls) {
try { try {
@@ -1427,7 +1440,26 @@ public class JDUtil {
continue; continue;
} }
long totalCount = productInfo.getTotalCount(); long totalCount = productInfo.getTotalCount();
if (isCj){
if (totalCount == 0){
// 优惠券
}else {
// 商品信息
XbMessageItem xbMessageItem = new XbMessageItem();
xbMessageItem.setCreateDate(LocalDate.now());
xbMessageItem.setXbMessageId(String.valueOf(xbMessageId));
xbMessageItem.setJsonQueryResult(JSONObject.toJSONString(productInfo.getData()[0]));
xbMessageItem.setJsonCouponlist(JSONObject.toJSONString(productInfo.getData()[0].getCouponInfo().getCouponList()));
xbMessageItem.setJsonShopinfo(JSONObject.toJSONString(productInfo.getData()[0].getShopInfo()));
xbMessageItem.setJsonCategoryinfo(JSONObject.toJSONString(productInfo.getData()[0].getCategoryInfo()));
xbMessageItem.setJsonImagelist(JSONObject.toJSONString(productInfo.getData()[0].getImageInfo().getImageList()));
xbMessageItem.setSpuid(String.valueOf(productInfo.getData()[0].getSpuid()));
xbMessageItem.setSkuId(String.valueOf(productInfo.getData()[0].getSkuId()));
xbMessageItem.setSkuName(productInfo.getData()[0].getSkuName());
xbMessageItem.setOwner(productInfo.getData()[0].getOwner());
xbMessageItemRepository.save(xbMessageItem);
}
}
if (totalCount == 0) { if (totalCount == 0) {
//couponInfo.append("链接类型:优惠券\n\n"); //couponInfo.append("链接类型:优惠券\n\n");
} else { } else {
@@ -1516,7 +1548,6 @@ public class JDUtil {
finallyMessage.put("data", dataList); finallyMessage.put("data", dataList);
finallyMessage.put("urlList", urlList); finallyMessage.put("urlList", urlList);
} catch (Exception e) { } catch (Exception e) {
logger.error("处理商品链接时发生异常:{}", url, e); logger.error("处理商品链接时发生异常:{}", url, e);
couponInfo.append(" 处理商品链接时发生异常:").append(url).append("\n"); couponInfo.append(" 处理商品链接时发生异常:").append(url).append("\n");
@@ -1543,9 +1574,14 @@ public class JDUtil {
finallyMessage.put("text", textList); finallyMessage.put("text", textList);
finallyMessage.put("images", imagesList); finallyMessage.put("images", imagesList);
finallyMessage.put("finalWenAn", finalWenAn); finallyMessage.put("finalWenAn", finalWenAn);
return finallyMessage; return finallyMessage;
} }
private void cjToDB(){
new Date();
}
/** /**

View File

@@ -48,8 +48,8 @@ public class WXUtil {
// 线报来源群 // 线报来源群
public static Map<String, String> chatRoom_xb = new HashMap<>(); public static Map<String, String> chatRoom_xb = new HashMap<>();
// 搬运群,对外带佣金,不带方案 // 747|23:38:48|wxid_kr145nk7l0an31|收到群聊|群50322578882@chatroomwxid_ytpc72mdoskt221
public static String chatRoom_BY = "50400969285@chatroom"; public static String chatRoom_BY = "50322578882@chatroom";
//群50006079425@chatroomwxid_cfmrk2upjtf3221 //群50006079425@chatroomwxid_cfmrk2upjtf3221
public static List<String> chatRoom_JD_Order = new ArrayList<>(); public static List<String> chatRoom_JD_Order = new ArrayList<>();