周玉环 21 hodín pred
rodič
commit
d22505894e
49 zmenil súbory, kde vykonal 440 pridanie a 90 odobranie
  1. 53 3
      xinkeaboard-gemini-langgraph_prompt/backend/src/agent/app.py
  2. 51 21
      xinkeaboard-gemini-langgraph_prompt/backend/src/agent/graph.py
  3. 14 5
      xinkeaboard-gemini-langgraph_prompt/backend/src/agent/test.py
  4. 13 0
      xinkeaboard-gemini-langgraph_prompt/backend/xinke-b2b-project-devops-763c6b8c6901.json
  5. 4 1
      xinkeaboard-gemini-langgraph_prompt/docker-compose.yml
  6. 4 0
      xinkeaboard-server/b2b2c-core/src/main/java/com/slodon/b2b2c/core/util/WebUtil.java
  7. 3 0
      xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/dto/GoodsAttributeAddDTO.java
  8. 3 0
      xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/dto/GoodsAttributeUpdateDTO.java
  9. 3 0
      xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/dto/GoodsBrandAddDTO.java
  10. 3 0
      xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/dto/GoodsBrandUpdateDTO.java
  11. 3 0
      xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/dto/GoodsCategoryAddDTO.java
  12. 3 0
      xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/dto/GoodsCategoryUpdateDTO.java
  13. 4 0
      xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/dto/GoodsLabelAddDTO.java
  14. 3 0
      xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/dto/GoodsLabelEditDTO.java
  15. 4 0
      xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/dto/SearchProductDTO.java
  16. 5 0
      xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/example/GoodsAttributeExample.java
  17. 5 0
      xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/example/GoodsLabelExample.java
  18. 3 0
      xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/pojo/GoodsAttribute.java
  19. 3 0
      xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/pojo/GoodsLabel.java
  20. 7 0
      xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/system/example/AgreementExample.java
  21. 3 0
      xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/system/pojo/Agreement.java
  22. 6 1
      xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/controller/goods/admin/GoodsAttributeController.java
  23. 7 0
      xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/controller/goods/admin/GoodsBrandController.java
  24. 36 15
      xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/controller/goods/admin/GoodsCategoryController.java
  25. 3 1
      xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/controller/goods/admin/GoodsController.java
  26. 3 1
      xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/controller/goods/admin/GoodsLabelController.java
  27. 1 1
      xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/controller/seller/seller/SellerStoreController.java
  28. 7 6
      xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/controller/system/admin/AdminAgreementController.java
  29. 19 14
      xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/controller/system/admin/AdminSettingController.java
  30. 3 4
      xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/controller/system/seller/SellerPcDecoController.java
  31. 2 0
      xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/model/goods/ESGoodsModel.java
  32. 3 0
      xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/model/goods/GoodsAttributeModel.java
  33. 3 0
      xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/model/goods/GoodsBrandModel.java
  34. 7 2
      xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/model/goods/GoodsCategoryModel.java
  35. 2 0
      xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/model/goods/GoodsLabelModel.java
  36. 13 9
      xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/model/system/TplPcMallDecoModel.java
  37. 4 0
      xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/vo/goods/FrontGoodsCategoryVO.java
  38. 4 0
      xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/vo/goods/GoodsAttributeVO.java
  39. 4 0
      xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/vo/goods/GoodsBrandApplyVO.java
  40. 4 0
      xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/vo/goods/GoodsBrandVO.java
  41. 4 0
      xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/vo/goods/GoodsLabelVO.java
  42. 1 0
      xinkeaboard-server/b2b2c-web/src/main/resources/application.yml
  43. 4 0
      xinkeaboard-server/b2b2c-web/src/main/resources/mapper/read/goods/GoodsAttributeReadMapper.xml
  44. 4 0
      xinkeaboard-server/b2b2c-web/src/main/resources/mapper/read/goods/GoodsLabelReadMapper.xml
  45. 4 0
      xinkeaboard-server/b2b2c-web/src/main/resources/mapper/read/system/AgreementReadMapper.xml
  46. 16 0
      xinkeaboard-server/b2b2c-web/src/main/resources/mapper/write/goods/GoodsAttributeWriteMapper.xml
  47. 16 0
      xinkeaboard-server/b2b2c-web/src/main/resources/mapper/write/goods/GoodsLabelWriteMapper.xml
  48. 16 0
      xinkeaboard-server/b2b2c-web/src/main/resources/mapper/write/system/AgreementWriteMapper.xml
  49. 50 6
      xinkeaboard-server/doc/DDL/update.sql

+ 53 - 3
xinkeaboard-gemini-langgraph_prompt/backend/src/agent/app.py

@@ -1,13 +1,15 @@
 # mypy: disable - error - code = "no-untyped-def,misc"
-import pathlib
-from fastapi import FastAPI, Response
-from fastapi.staticfiles import StaticFiles
+from fastapi import FastAPI
 from pydantic import BaseModel
 from typing import Optional, List, Dict, Any
 import asyncio
 
 # Import the graph from the agent
 from agent.graph import graph
+# Import ChatVertexAI for translation
+from langchain_google_vertexai import ChatVertexAI
+import os
+
 # Define the FastAPI app
 app = FastAPI()
 
@@ -25,6 +27,17 @@ class ResearchResponse(BaseModel):
     sources: List[Dict[str, Any]]
 
 
+class TranslationRequest(BaseModel):
+    """Request model for the translation endpoint."""
+    text: str
+
+
+class TranslationResponse(BaseModel):
+    """Response model for the translation endpoint."""
+    original_text: str
+    translated_text: str
+
+
 @app.post("/api/research", response_model=ResearchResponse)
 async def research(request: ResearchRequest):
     """Endpoint to perform research using the LangGraph agent.
@@ -69,3 +82,40 @@ async def research(request: ResearchRequest):
 
     return ResearchResponse(answer=answer, sources=sources)
 
+
+@app.post("/api/translate", response_model=TranslationResponse)
+async def translate(request: TranslationRequest):
+    """Endpoint to translate Chinese text to English using ChatVertexAI.
+
+    Args:
+        request: TranslationRequest containing the text to translate.
+
+    Returns:
+        TranslationResponse with the original and translated text.
+    """
+    # Initialize ChatVertexAI
+    llm = ChatVertexAI(
+        model_name="gemini-2.0-flash",
+        temperature=0,
+        max_retries=2,
+        project=os.getenv("GOOGLE_CLOUD_PROJECT"),  # 必填
+        location=os.getenv("GOOGLE_CLOUD_LOCATION")  # 必填
+    )
+    
+    # Create translation prompt
+    prompt = f"Translate the following text to English:\n\n{request.text}\n\nTranslation:"
+    
+    # Run the translation
+    result = await asyncio.get_event_loop().run_in_executor(
+        None,
+        lambda: llm.invoke(prompt)
+    )
+    
+    # Extract the translated text
+    translated_text = result.content if hasattr(result, 'content') else str(result)
+    
+    return TranslationResponse(
+        original_text=request.text,
+        translated_text=translated_text
+    )
+

+ 51 - 21
xinkeaboard-gemini-langgraph_prompt/backend/src/agent/graph.py

@@ -7,7 +7,8 @@ from langgraph.types import Send
 from langgraph.graph import StateGraph
 from langgraph.graph import START, END
 from langchain_core.runnables import RunnableConfig
-from google.genai import Client
+from google import genai
+from google.genai.types import HttpOptions
 
 from agent.state import (
     OverallState,
@@ -23,13 +24,15 @@ from agent.prompts import (
     reflection_instructions,
     answer_instructions,
 )
-from langchain_google_genai import ChatGoogleGenerativeAI
 from agent.utils import (
     get_citations,
     get_research_topic,
     insert_citation_markers,
     resolve_urls,
 )
+
+from langchain_google_vertexai import ChatVertexAI
+
 import logging
 
 load_dotenv()
@@ -41,12 +44,21 @@ logging.basicConfig(
 
 logger = logging.getLogger(__name__)
 
-if os.getenv("GEMINI_API_KEY") is None:
-    raise ValueError("GEMINI_API_KEY is not set")
+# if os.getenv("GEMINI_API_KEY") is None:
+#     raise ValueError("GEMINI_API_KEY is not set")
 
-# Used for Google Search API
-genai_client = Client(api_key=os.getenv("GEMINI_API_KEY"))
+if os.getenv("GOOGLE_APPLICATION_CREDENTIALS") is None:
+    raise ValueError("GOOGLE_APPLICATION_CREDENTIALS is not set")
+if os.getenv("GOOGLE_CLOUD_PROJECT") is None:
+    raise ValueError("GOOGLE_CLOUD_PROJECT is not set")
+if os.getenv("GOOGLE_CLOUD_LOCATION") is None:
+    raise ValueError("GOOGLE_CLOUD_LOCATION is not set")
+if os.getenv("GOOGLE_GENAI_USE_VERTEXAI") is None:
+    raise ValueError("GOOGLE_GENAI_USE_VERTEXAI is not set")
 
+# Used for Google Search API
+# genai_client = Client(api_key=os.getenv("GEMINI_API_KEY"))
+genai_client = genai.Client(http_options=HttpOptions(api_version="v1"))
 
 # Nodes
 def generate_query(state: OverallState, config: RunnableConfig) -> QueryGenerationState:
@@ -64,21 +76,25 @@ def generate_query(state: OverallState, config: RunnableConfig) -> QueryGenerati
     """
     configurable = Configuration.from_runnable_config(config)
     logger.info("开始:generate_query")
-    logger.info("1:generate_query")
     # check for custom initial search query count
     if state.get("initial_search_query_count") is None:
         state["initial_search_query_count"] = configurable.number_of_initial_queries
-    logger.info("2:generate_query")
     # init Gemini 2.0 Flash
-    llm = ChatGoogleGenerativeAI(
-        model=configurable.query_generator_model,
+    # llm = ChatGoogleGenerativeAI(
+    #     model=configurable.query_generator_model,
+    #     temperature=1.0,
+    #     max_retries=2,
+    #     api_key=os.getenv("GEMINI_API_KEY"),
+    # )
+
+    llm = ChatVertexAI(
+        model_name=configurable.query_generator_model,  # 如 "gemini-pro"
         temperature=1.0,
         max_retries=2,
-        api_key=os.getenv("GEMINI_API_KEY"),
+        project=os.getenv("GOOGLE_CLOUD_PROJECT"),  # 必填
+        location=os.getenv("GOOGLE_CLOUD_LOCATION")  # 必填
     )
-    logger.info("3:generate_query")
     structured_llm = llm.with_structured_output(SearchQueryList)
-    logger.info("4:generate_query")
     # Format the prompt
     current_date = get_current_date()
     formatted_prompt = query_writer_instructions.format(
@@ -139,7 +155,7 @@ def web_research(state: WebSearchState, config: RunnableConfig) -> OverallState:
     # for chunk in chunks:
     #     print(chunk["title"])
     #     print(chunk["url"])
-    #     print(chunk["content"]) 
+    #     print(chunk["content"])
     # resolve the urls to short urls for saving tokens and time
     resolved_urls = resolve_urls(
         response.candidates[0].grounding_metadata.grounding_chunks, state["id"]
@@ -184,11 +200,18 @@ def reflection(state: OverallState, config: RunnableConfig) -> ReflectionState:
         summaries="\n\n---\n\n".join(state["web_research_result"]),
     )
     # init Reasoning Model
-    llm = ChatGoogleGenerativeAI(
-        model=reasoning_model,
+    # llm = ChatGoogleGenerativeAI(
+    #     model=reasoning_model,
+    #     temperature=1.0,
+    #     max_retries=2,
+    #     api_key=os.getenv("GEMINI_API_KEY"),
+    # )
+    llm = ChatVertexAI(
+        model_name=configurable.query_generator_model,  # 如 "gemini-pro"
         temperature=1.0,
         max_retries=2,
-        api_key=os.getenv("GEMINI_API_KEY"),
+        project=os.getenv("GOOGLE_CLOUD_PROJECT"),  # 必填
+        location=os.getenv("GOOGLE_CLOUD_LOCATION")  # 必填
     )
     result = llm.with_structured_output(Reflection).invoke(formatted_prompt)
     logger.info("结束:reflection")
@@ -266,11 +289,18 @@ def finalize_answer(state: OverallState, config: RunnableConfig):
     )
 
     # init Reasoning Model, default to Gemini 2.5 Flash
-    llm = ChatGoogleGenerativeAI(
-        model=reasoning_model,
-        temperature=0,
+    # llm = ChatGoogleGenerativeAI(
+    #     model=reasoning_model,
+    #     temperature=0,
+    #     max_retries=2,
+    #     api_key=os.getenv("GEMINI_API_KEY"),
+    # )
+    llm = ChatVertexAI(
+        model_name=configurable.query_generator_model,  # 如 "gemini-pro"
+        temperature=1.0,
         max_retries=2,
-        api_key=os.getenv("GEMINI_API_KEY"),
+        project=os.getenv("GOOGLE_CLOUD_PROJECT"),  # 必填
+        location=os.getenv("GOOGLE_CLOUD_LOCATION")  # 必填
     )
     logger.info("开始:llm.invoke")
     result = llm.invoke(formatted_prompt)

+ 14 - 5
xinkeaboard-gemini-langgraph_prompt/backend/src/agent/test.py

@@ -1,6 +1,15 @@
-import agent.prompts
-import sys
-sys.path.insert(0, "/Users/joeychen/Desktop/Weichi_proj/gemini-langgraph_prompt_engineering/backend/src")
+import os
+from google import genai
+from google.genai.types import HttpOptions
 
-print(">>> PROMPT MODULE PATH:", agent.prompts.__file__)
-print(">>> answer_instructions PREVIEW:\n", agent.prompts.answer_instructions[:300])
+os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = r"D:\project\advich\xinkeaboard\xinkeaboard-gemini-langgraph_prompt\backend\xinke-b2b-project-devops-763c6b8c6901.json"
+os.environ["GOOGLE_CLOUD_PROJECT"] = r"xinke-b2b-project-devops"
+os.environ["GOOGLE_CLOUD_LOCATION"] = r"global"
+os.environ["GOOGLE_GENAI_USE_VERTEXAI"] = r"True"
+
+client = genai.Client(http_options=HttpOptions(api_version="v1"))
+response = client.models.generate_content(
+    model="gemini-2.5-flash",
+    contents="How does AI work? in 10 words",
+)
+print(response.text)

+ 13 - 0
xinkeaboard-gemini-langgraph_prompt/backend/xinke-b2b-project-devops-763c6b8c6901.json

@@ -0,0 +1,13 @@
+{
+  "type": "service_account",
+  "project_id": "xinke-b2b-project-devops",
+  "private_key_id": "763c6b8c69017856d8781ce4a5f4e84707ef931a",
+  "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCqoGGS1VKZNGU/\nV7a8IJntaRV62qX2cey6f2aEiAJoi88WoMYGIjjj5XbXTTGXS5JxfYYldt2ieEzU\niamGQEcjk7aS6tbEd57aDqfsPTTdIaRGx6JhtksdYOJv0ggZbEkQA9RNj/Y/dWU6\nc+tE7/MN+zS6zUryi8UN7rNS7o+vzUG+5MWtJ4GBMUA5aSAAFuw+n9DaQQywGxFe\nUnnH98xloCcjFzOvrHcVlmYsxWWnJmRpqnnlA5An/I+rZoQmjaicXGYU9r+Ke8zm\nGOdh3m5FAzUPQV9PAzPzRbWbmVx0q9pWOcu40WmW5px7IXea0VJDyjLYKQi2iEWc\nlMNOyX69AgMBAAECggEAFjKTPxT9j+zfFySEI2liXR6EqtzzJmKf14tnfOps1ckK\ngfkcigO9vvhFQ7FJOFOek6Eu6ITURKS96hCWu151Ys1+vRJMKncddWTet78mt3X+\n9y5Vk7yxfPrzunRqlVQfFTRKVGTcNllBeB9IhklpJ3J846h9jZxdYHijX7ClhMtK\n1xPHNZ5rEsx/AgiYhH4uQuzgReapbvRXifuwoejRC7tEt0Dao6iRYzGYcZODF+G+\nBU6R6TPGuqrp/ZtjqkAmMqFM/YfKdi7A6BpkzEU6MoA2/pc4yBu3rLFg+OksiNf1\n5naW+Ax7Ib8wPWDLRW4gXVPVzxrjk1YajV7r/zdLSQKBgQDRPC7cEdGrVs1xbaZa\nz2kR3o7tvvpymzO9v2l6gW3WbP9zsWasFcrTJQveVxPBMsH/me4er8YDw/Yi7RcG\ns6yBmrgMQU805X9v0vUBwb7MxJP+PzsKRU/biQGyei+9z+CjV8hFaigaF8dzJ0Pg\ndUHMBFpPOrmiopxBD+hPWuCi0wKBgQDQwyCdmXwg9A5cM5oZSi4Zwaz8Pq2cQUnb\nRH7eFDtx11mGwAKA3CRi6S9xddpWWIDNFvBxy1GbkgkMGs8AXz+KP5H8iqsVuYwI\ny/ClWa6o5W3JvBTDbs//GyVlXcKSogQ907tnuMoA0na3kqYF72mElS9MrVPvSfpf\nmoBVgKG+LwKBgQCwaWW49u0o4U7mS+Tuu+GCx3sKyPKwnlrJqRFt0KKjH9Nh4DkI\n7nbL/3g6RoDJa9pVf5tdFCaIFjj4yZ2YcPUJcUGsU4RMvRLtXZhlms0cKMH+o6FL\nz5S9LI7ZxFtsVlC4Z9Lbc93L4jCvznNUVIjdUu4xzvmlPiUwVhEwlxa/MQKBgFFT\notIip/vCeBGtPJwbjOgVzkkaNdIIkTgtb+seIKZRyZu4E4GVwUsTIptl2SAILG05\nQYRjO7CKbKHdk8TGVl+KMloav1mgRhBrOp1/2Y4Miv+rGL+l3Lu6HJBnvVQYb+SS\nJpDaqT82vm73X1wyj33KDHonj+pJfJNgAhzNFrWbAoGBAKmCJB4FPz9T8sOMRaog\nHG8W6KK6xqDl5MumHGAzyoO+bCaiWYK4UFKX2wZpd2y5S57n9Y3ZKsb+FV4PDely\nc873HuflApdS0WxXqIvLa+xzbrppfNAwVQKRDZdXO5CJdsJCIb4SFowQsx5x4pDp\nY0jc7SKqyv1q4xyTHkcEuPfk\n-----END PRIVATE KEY-----\n",
+  "client_email": "xinke-vertex-ai@xinke-b2b-project-devops.iam.gserviceaccount.com",
+  "client_id": "111297466545525410293",
+  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
+  "token_uri": "https://oauth2.googleapis.com/token",
+  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
+  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/xinke-vertex-ai%40xinke-b2b-project-devops.iam.gserviceaccount.com",
+  "universe_domain": "googleapis.com"
+}

+ 4 - 1
xinkeaboard-gemini-langgraph_prompt/docker-compose.yml

@@ -38,7 +38,10 @@ services:
       langgraph-postgres:
         condition: service_healthy
     environment:
-      GEMINI_API_KEY: ${GEMINI_API_KEY}
       LANGSMITH_API_KEY: ${LANGSMITH_API_KEY}
+      GOOGLE_APPLICATION_CREDENTIALS: ${GOOGLE_APPLICATION_CREDENTIALS}
+      GOOGLE_CLOUD_PROJECT: ${GOOGLE_CLOUD_PROJECT}
+      GOOGLE_CLOUD_LOCATION: ${GOOGLE_CLOUD_LOCATION}
+      GOOGLE_GENAI_USE_VERTEXAI: ${GOOGLE_GENAI_USE_VERTEXAI}
       REDIS_URI: redis://langgraph-redis:6379
       POSTGRES_URI: postgres://postgres:postgres@langgraph-postgres:5432/postgres?sslmode=disable

+ 4 - 0
xinkeaboard-server/b2b2c-core/src/main/java/com/slodon/b2b2c/core/util/WebUtil.java

@@ -23,6 +23,10 @@ public class WebUtil {
         }
         Map<String, String> postMap = new HashMap<>();
         for (Map.Entry<String, String[]> entry : params.entrySet()) {
+            // 排除 webSite 参数
+            if ("webSite".equals(entry.getKey())) {
+                continue;
+            }
             if (entry.getKey().length() == 0 || entry.getValue() == null || entry.getValue().length <= 0) {
                 continue;
             }

+ 3 - 0
xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/dto/GoodsAttributeAddDTO.java

@@ -13,6 +13,9 @@ public class GoodsAttributeAddDTO implements Serializable {
 
     private static final long serialVersionUID = 3423864674236761014L;
 
+    @ApiModelProperty(value ="站点",required = true)
+    private String webSite;
+
     @ApiModelProperty(value ="属性名称",required = true)
     private String attributeName;
 

+ 3 - 0
xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/dto/GoodsAttributeUpdateDTO.java

@@ -16,6 +16,9 @@ public class GoodsAttributeUpdateDTO implements Serializable {
     @ApiModelProperty(value ="属性id",required = true)
     private Integer attributeId;
 
+    @ApiModelProperty(value ="站点")
+    private String webSite;
+
     @ApiModelProperty(value ="属性名称")
     private String attributeName;
 

+ 3 - 0
xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/dto/GoodsBrandAddDTO.java

@@ -13,6 +13,9 @@ public class GoodsBrandAddDTO implements Serializable {
 
     private static final long serialVersionUID = 3423864674236321014L;
 
+    @ApiModelProperty(value ="站点")
+    private String webSite;
+
     @ApiModelProperty(value ="品牌名称",required = true)
     private String brandName;
 

+ 3 - 0
xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/dto/GoodsBrandUpdateDTO.java

@@ -13,6 +13,9 @@ public class GoodsBrandUpdateDTO implements Serializable {
 
     private static final long serialVersionUID = 4858417634557750983L;
 
+    @ApiModelProperty(value ="站点")
+    private String webSite;
+
     @ApiModelProperty(value ="品牌id",required = true)
     private Integer brandId;
 

+ 3 - 0
xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/dto/GoodsCategoryAddDTO.java

@@ -14,6 +14,9 @@ public class GoodsCategoryAddDTO implements Serializable {
 
     private static final long serialVersionUID = 9023343554244761014L;
 
+    @ApiModelProperty(value ="站点")
+    private String webSite;
+
     @ApiModelProperty(value ="分类名称",required = true)
     private String categoryName;
 

+ 3 - 0
xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/dto/GoodsCategoryUpdateDTO.java

@@ -18,6 +18,9 @@ public class GoodsCategoryUpdateDTO implements Serializable {
     @ApiModelProperty(value = "分类id",required = true)
     private Integer categoryId;
 
+    @ApiModelProperty(value = "站点")
+    private String webSite;
+
     @ApiModelProperty(value ="分类名称")
     private String categoryName;
 

+ 4 - 0
xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/dto/GoodsLabelAddDTO.java

@@ -12,6 +12,10 @@ import java.io.Serializable;
 public class GoodsLabelAddDTO implements Serializable {
 
     private static final long serialVersionUID = 8684723449208103379L;
+
+    @ApiModelProperty(value = "站点")
+    private String webSite;
+
     @ApiModelProperty(value = "标签名称",required = true)
     private String labelName;
 

+ 3 - 0
xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/dto/GoodsLabelEditDTO.java

@@ -16,6 +16,9 @@ public class GoodsLabelEditDTO implements Serializable {
     @ApiModelProperty("标签id")
     private Integer labelId;
 
+    @ApiModelProperty("站点")
+    private String webSite;
+
     @ApiModelProperty("标签名称")
     private String labelName;
 

+ 4 - 0
xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/dto/SearchProductDTO.java

@@ -10,7 +10,9 @@ public class SearchProductDTO implements Serializable {
 
     private static final long serialVersionUID = 4869522769556435643L;
     private String goodsId;                                     //商品ID
+    private String webSite;                                     //发布渠道 1-海外站;2-国内站
     private String goodsName;                                   //商品名称
+    private String goodsNameCn;                                 //商品中文名称
     private String brandId;                                     //品牌id
     private String brandName;                                   //品牌名称
     private String storeId;                                     //店铺id
@@ -45,7 +47,9 @@ public class SearchProductDTO implements Serializable {
     private String goodsSummary;                                //商品简介
 
     public final static String ID_ = "goodsId";
+    public final static String WEB_SITE = "webSite";
     public final static String GOODS_NAME_ = "goodsName";
+    public final static String GOODS_NAME_CN_ = "goodsNameCn";
     public final static String BRAND_ID_ = "brandId";
     public final static String BRAND_NAME_ = "brandName";
     public final static String STORE_ID_ = "storeId";

+ 5 - 0
xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/example/GoodsAttributeExample.java

@@ -26,6 +26,11 @@ public class GoodsAttributeExample implements Serializable {
     private Integer attributeId;
 
     /**
+     * 站点
+     */
+    private String webSite;
+
+    /**
      * 属性名称
      */
     private String attributeName;

+ 5 - 0
xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/example/GoodsLabelExample.java

@@ -28,6 +28,11 @@ public class GoodsLabelExample implements Serializable {
     private Integer labelId;
 
     /**
+     * 站点
+     */
+    private String webSite;
+
+    /**
      * 标签名称
      */
     private String labelName;

+ 3 - 0
xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/pojo/GoodsAttribute.java

@@ -16,6 +16,9 @@ public class GoodsAttribute implements Serializable {
     @ApiModelProperty("属性id")
     private Integer attributeId;
 
+    @ApiModelProperty("站点")
+    private String webSite;
+
     @ApiModelProperty("属性名称")
     private String attributeName;
 

+ 3 - 0
xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/pojo/GoodsLabel.java

@@ -15,6 +15,9 @@ public class GoodsLabel implements Serializable {
     @ApiModelProperty("标签id")
     private Integer labelId;
 
+    @ApiModelProperty("站点")
+    private String webSite;
+
     @ApiModelProperty("标签名称")
     private String labelName;
 

+ 7 - 0
xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/system/example/AgreementExample.java

@@ -19,11 +19,18 @@ public class AgreementExample implements Serializable {
      */
     private String agreementCodeIn;
 
+
     /**
      * 协议编码
      */
     private String agreementCode;
 
+
+    /**
+     * 站点
+     */
+    private String webSite;
+
     /**
      * 标题
      */

+ 3 - 0
xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/system/pojo/Agreement.java

@@ -15,6 +15,9 @@ public class Agreement implements Serializable {
     @ApiModelProperty("协议编码")
     private String agreementCode;
 
+    @ApiModelProperty("站点")
+    private String webSite;
+
     @ApiModelProperty("标题")
     private String title;
 

+ 6 - 1
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/controller/goods/admin/GoodsAttributeController.java

@@ -44,14 +44,16 @@ public class GoodsAttributeController {
 
     @ApiOperation("属性列表")
     @ApiImplicitParams({
+            @ApiImplicitParam(name = "webSite", value = "站点", defaultValue = "1", paramType = "query"),
             @ApiImplicitParam(name = "attributeName", value = "属性名称", paramType = "query"),
             @ApiImplicitParam(name = "pageSize", value = "分页大小", defaultValue = "20", paramType = "query"),
             @ApiImplicitParam(name = "current", value = "当前页面位置", defaultValue = "1", paramType = "query")
     })
     @GetMapping("list")
-    public JsonResult<PageVO<GoodsAttributeVO>> getList(HttpServletRequest request, String attributeName, Integer isShow) {
+    public JsonResult<PageVO<GoodsAttributeVO>> getList(HttpServletRequest request,String webSite, String attributeName, Integer isShow) {
         PagerInfo pager = WebUtil.handlerPagerInfo(request);
         GoodsAttributeExample example = new GoodsAttributeExample();
+        example.setWebSite(webSite);
         example.setAttributeNameLike(attributeName);
         //不为空说明是查询显示的,需要排序
         if (!StringUtils.isEmpty(isShow)) {
@@ -75,16 +77,19 @@ public class GoodsAttributeController {
 
     @ApiOperation("获取可用属性列表")
     @ApiImplicitParams({
+            @ApiImplicitParam(name = "webSite", value = "站点", defaultValue = "1", paramType = "query"),
             @ApiImplicitParam(name = "attributeName", value = "属性名称", paramType = "query"),
             @ApiImplicitParam(name = "pageSize", value = "分页大小", defaultValue = "20", paramType = "query"),
             @ApiImplicitParam(name = "current", value = "当前页面位置", defaultValue = "1", paramType = "query")
     })
     @GetMapping("canUseList")
     public JsonResult<PageVO<GoodsAttributeVO>> canUseList(HttpServletRequest request,
+                                                           @RequestParam(value = "webSite", required = false) String webSite,
                                                            @RequestParam(value = "attributeName", required = false) String attributeName) {
         PagerInfo pager = WebUtil.handlerPagerInfo(request);
         GoodsAttributeValueExample goodsAttributeValueExample = new GoodsAttributeValueExample();
         GoodsAttributeExample goodsAttributeExample = new GoodsAttributeExample();
+        goodsAttributeExample.setWebSite(webSite);
         goodsAttributeExample.setAttributeNameLike(attributeName);
         goodsAttributeExample.setIsShow(GoodsConst.IS_ATTRIBUTE_YES);
         goodsAttributeExample.setPager(pager);

+ 7 - 0
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/controller/goods/admin/GoodsBrandController.java

@@ -50,15 +50,18 @@ public class GoodsBrandController {
 
     @ApiOperation("品牌列表")
     @ApiImplicitParams({
+            @ApiImplicitParam(name = "webSite", value = "站点", paramType = "query"),
             @ApiImplicitParam(name = "brandName", value = "品牌名称", paramType = "query"),
             @ApiImplicitParam(name = "pageSize", value = "分页大小", defaultValue = "20", paramType = "query"),
             @ApiImplicitParam(name = "current", value = "当前页面位置", defaultValue = "1", paramType = "query")
     })
     @GetMapping("list")
     public JsonResult<PageVO<GoodsBrandVO>> getList(HttpServletRequest request,
+                                                    @RequestParam(value = "webSite", required = false, defaultValue = "1") String webSite,
                                                     @RequestParam(value = "brandName", required = false) String brandName) {
         PagerInfo pager = WebUtil.handlerPagerInfo(request);
         GoodsBrandExample goodsBrandExample = new GoodsBrandExample();
+        goodsBrandExample.setWebSite(webSite);
         goodsBrandExample.setBrandNameLike(brandName);
         //只查询审核通过的(因为待审核和审核失败的有单独接口--applyList)
         goodsBrandExample.setState(GoodsConst.BRAND_STATE_1);
@@ -68,6 +71,7 @@ public class GoodsBrandController {
             brandList.forEach(brand -> {
                 GoodsBrandVO vo = new GoodsBrandVO(brand);
                 GoodsExample example = new GoodsExample();
+                example.setWebSite(brand.getWebSite());
                 example.setBrandId(brand.getBrandId());
                 //查询全部商品数
                 example.setStateNotEquals(GoodsConst.GOODS_STATE_DELETE);
@@ -183,6 +187,7 @@ public class GoodsBrandController {
 
     @ApiOperation("获取待审核的品牌列表")
     @ApiImplicitParams({
+            @ApiImplicitParam(name = "webSite", value = "站点", paramType = "query"),
             @ApiImplicitParam(name = "brandName", value = "品牌名称", paramType = "query"),
             @ApiImplicitParam(name = "storeName", value = "店铺名称", paramType = "query"),
             @ApiImplicitParam(name = "state", value = "审核状态:2-待审核,3-审核失败", paramType = "query"),
@@ -191,11 +196,13 @@ public class GoodsBrandController {
     })
     @GetMapping("applyList")
     public JsonResult<PageVO<GoodsBrandApplyVO>> getApplyList(HttpServletRequest request,
+                                                              @RequestParam(value = "webSite", required = false) String webSite,
                                                               @RequestParam(value = "brandName", required = false) String brandName,
                                                               @RequestParam(value = "storeName", required = false) String storeName,
                                                               @RequestParam(value = "state", required = false) Integer state) {
         PagerInfo pager = WebUtil.handlerPagerInfo(request);
         GoodsBrandExample example = new GoodsBrandExample();
+        example.setWebSite(webSite);
         example.setBrandNameLike(brandName);
         example.setState(state);
         example.setStoreNameLike(storeName);

+ 36 - 15
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/controller/goods/admin/GoodsCategoryController.java

@@ -69,16 +69,19 @@ public class GoodsCategoryController {
     @ApiOperation("分类列表,获取当前分类的下级分类,0代表获取所有1级分类")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "categoryId", value = "分类Id", required = true, paramType = "query"),
+            @ApiImplicitParam(name = "webSite", value = "站点", paramType = "query"),
             @ApiImplicitParam(name = "isSort", value = "是否排序:true-排序,false-不显示", paramType = "query"),
             @ApiImplicitParam(name = "pageSize", value = "分页大小", defaultValue = "20", paramType = "query"),
             @ApiImplicitParam(name = "current", value = "当前页面位置", defaultValue = "1", paramType = "query")
     })
     @GetMapping("list")
     public JsonResult<PageVO<GoodsCategoryListVO>> getList(HttpServletRequest request, @RequestParam(value = "categoryId") Integer categoryId,
+                                                           @RequestParam(value = "webSite", required = false, defaultValue = "1") String webSite,
                                                            @RequestParam(value = "isSort", defaultValue = "false", required = false) Boolean isSort) {
         PagerInfo pager = WebUtil.handlerPagerInfo(request);
         GoodsCategoryExample goodsCategoryExample = new GoodsCategoryExample();
         goodsCategoryExample.setPid(categoryId);
+        goodsCategoryExample.setWebSite(webSite);
         if (isSort) {
             goodsCategoryExample.setOrderBy("sort asc, create_time desc");
         }
@@ -124,8 +127,12 @@ public class GoodsCategoryController {
 
     @ApiOperation("二级商品分类列表")
     @GetMapping("getSecondGoodsCategory")
-    public JsonResult<List<FrontGoodsCategoryVO>> getSecondGoodsCategory(HttpServletRequest request){
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "webSite", value = "站点", paramType = "query")
+    })
+    public JsonResult<List<FrontGoodsCategoryVO>> getSecondGoodsCategory(HttpServletRequest request, @RequestParam(value = "webSite", required = false, defaultValue = "1") String webSite) {
         GoodsCategoryExample goodsCategoryExample = new GoodsCategoryExample();
+        goodsCategoryExample.setWebSite(webSite);
         goodsCategoryExample.setGrade(GoodsCategoryConst.CATEGORY_GRADE_2);
         List<GoodsCategory> goodsCategoryList = goodsCategoryModel.getGoodsCategoryList(goodsCategoryExample, null);
         List<FrontGoodsCategoryVO> vos = new ArrayList<>();
@@ -148,8 +155,12 @@ public class GoodsCategoryController {
 
     @ApiOperation("商品分类列表")
     @GetMapping("newList")
-    public JsonResult<List<FrontGoodsCategoryVO>> getNewList(HttpServletRequest request) {
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "webSite", value = "站点", paramType = "query")
+    })
+    public JsonResult<List<FrontGoodsCategoryVO>> getNewList(HttpServletRequest request,@RequestParam(value = "webSite", required = false, defaultValue = "1") String webSite) {
         GoodsCategoryExample goodsCategoryExample = new GoodsCategoryExample();
+        goodsCategoryExample.setWebSite(webSite);
         List<GoodsCategory> goodsCategoryList = goodsCategoryModel.getGoodsCategoryList(goodsCategoryExample, null);
         List<FrontGoodsCategoryVO> vos = new ArrayList<>();
         if (!CollectionUtils.isEmpty(goodsCategoryList)) {
@@ -166,29 +177,33 @@ public class GoodsCategoryController {
 
     @ApiOperation("获取商品分类树接口")
     @ApiImplicitParams({
+            @ApiImplicitParam(name = "webSite", value = "站点", paramType = "query"),
             @ApiImplicitParam(name = "pId", value = "父分类id", paramType = "query", required = true),
             @ApiImplicitParam(name = "grade", value = "查询层数", paramType = "query"),
     })
     @GetMapping("getCateTree")
     public JsonResult<List<GoodsCategoryListVO>> getCateTree(HttpServletRequest request,
+                                                             @RequestParam(value = "webSite", required = false, defaultValue = "1") String webSite,
                                                              @RequestParam(value = "pId") Integer pId,
                                                              @RequestParam(value = "grade") Integer grade) {
-        return SldResponse.success(this.getGoodsCategoryTree(pId, grade));
+        return SldResponse.success(this.getGoodsCategoryTree(webSite, pId, grade));
     }
 
     /**
      * 获取商品分类树
      *
+     * @param webSite 站点
      * @param pId   父id
      * @param grade 获取级别,比如 pid=0,grade=3时,获取1、2、3级分类;pid=0,grade=2时,获取1、2级分类;pid=0,grade=1时,获取1级分类;
      * @return
      */
-    private List<GoodsCategoryListVO> getGoodsCategoryTree(Integer pId, Integer grade) {
+    private List<GoodsCategoryListVO> getGoodsCategoryTree(String webSite, Integer pId, Integer grade) {
         if (grade == 0) {
             return null;
         }
         GoodsCategoryExample goodsCategoryExample = new GoodsCategoryExample();
         goodsCategoryExample.setPid(pId);
+        goodsCategoryExample.setWebSite(webSite);
         List<GoodsCategory> goodsCategoryList = goodsCategoryModel.getGoodsCategoryList(goodsCategoryExample, null);
         if (CollectionUtils.isEmpty(goodsCategoryList)) {
             return new ArrayList<>();
@@ -213,7 +228,7 @@ public class GoodsCategoryController {
             //查询在售商品数
             example.setState(GoodsConst.GOODS_STATE_UPPER);
             vo.setOnSaleGoodsNum(goodsModel.getGoodsCount(example));
-            vo.setChildren(getGoodsCategoryTree(goodsCategory.getCategoryId(), grade - 1));
+            vo.setChildren(getGoodsCategoryTree(webSite,goodsCategory.getCategoryId(), grade - 1));
             this.dealGoodsCategoryBindBrandAndAttribute(vo);
             vos.add(vo);
         });
@@ -418,8 +433,9 @@ public class GoodsCategoryController {
 
     @ApiOperation("获取商品分类列表接口")
     @GetMapping("categoryList")
-    public JsonResult<List<RankGoodsCategoryVO>> getCateTree(HttpServletRequest request) {
-        return SldResponse.success(this.getGoodsCategoryList(0, 3));
+    @ApiImplicitParams(@ApiImplicitParam(name = "webSite", value = "站点", paramType = "query"))
+    public JsonResult<List<RankGoodsCategoryVO>> getCateTree(HttpServletRequest request,@RequestParam(value = "webSite", required = false, defaultValue = "1") String webSite) {
+        return SldResponse.success(this.getGoodsCategoryList(webSite, 0, 3));
     }
 
     /**
@@ -429,10 +445,11 @@ public class GoodsCategoryController {
      * @param grade 获取级别,比如 pid=0,grade=3时,获取1、2、3级分类;pid=0,grade=2时,获取1、2级分类;pid=0,grade=1时,获取1级分类;
      * @return
      */
-    private List<RankGoodsCategoryVO> getGoodsCategoryList(Integer pId, Integer grade) {
+    private List<RankGoodsCategoryVO> getGoodsCategoryList(String webSite,Integer pId, Integer grade) {
         List<RankGoodsCategoryVO> vos = new ArrayList<>();
         GoodsCategoryExample example = new GoodsCategoryExample();
         example.setPid(pId);
+        example.setWebSite(webSite);
         example.setQueryGrade(grade);
         example.setOrderBy("sort asc, create_time desc");
         List<GoodsCategory> goodsCategoryList = goodsCategoryModel.getGoodsCategoryList(example, null);
@@ -441,7 +458,7 @@ public class GoodsCategoryController {
         }
         goodsCategoryList.forEach(goodsCategory -> {
             RankGoodsCategoryVO vo = new RankGoodsCategoryVO(goodsCategory);
-            vo.setChildren(getGoodsCategoryList(goodsCategory.getCategoryId(), grade - 1));
+            vo.setChildren(getGoodsCategoryList(webSite,goodsCategory.getCategoryId(), grade - 1));
             vos.add(vo);
         });
         return vos;
@@ -449,13 +466,15 @@ public class GoodsCategoryController {
 
     @ApiOperation("初始化分类缓存")
     @OperationLogger(option = "初始化分类缓存")
+    @ApiImplicitParams(@ApiImplicitParam(name = "webSite", value = "站点", paramType = "query"))
     @GetMapping("categoryInit")
-    public JsonResult categoryInit(HttpServletRequest request) {
+    public JsonResult categoryInit(HttpServletRequest request, @RequestParam(value = "webSite", required = false, defaultValue = "1") String webSite) {
         Admin admin = UserUtil.getUser(request, Admin.class);
 
         //缓存一级分类信息
         GoodsCategoryExample example = new GoodsCategoryExample();
         example.setPid(0);
+        example.setWebSite(webSite);
         example.setState(GoodsCategoryConst.CATEGORY_STATE_1);
         example.setOrderBy("sort asc, create_time desc");
         List<GoodsCategory> list = goodsCategoryModel.getGoodsCategoryList(example, null);
@@ -472,7 +491,7 @@ public class GoodsCategoryController {
                 vos.add(new FrontGoodsCategoryVO(goodsCategory));
             }
             //更新缓存中的数据
-            stringRedisTemplate.opsForValue().set(RedisConst.GOODS_CATEGORY, JSONArray.toJSONString(vos));
+            stringRedisTemplate.opsForValue().set(RedisConst.GOODS_CATEGORY + "_" + webSite, JSONArray.toJSONString(vos));
         }
 
         //缓存全部分类信息
@@ -486,7 +505,7 @@ public class GoodsCategoryController {
                 }
                 vos.add(tree);
             }
-            stringRedisTemplate.opsForValue().set(RedisConst.FRONT_GOODS_CATEGORY, JSONArray.toJSONString(vos));
+            stringRedisTemplate.opsForValue().set(RedisConst.FRONT_GOODS_CATEGORY + "_" + webSite, JSONArray.toJSONString(vos));
         }
         return SldResponse.success("缓存更新成功");
     }
@@ -553,14 +572,15 @@ public class GoodsCategoryController {
 
     @ApiOperation("根据一级分类id获取二三级分类")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "categoryId1", value = "一级分类Id", required = true)
+            @ApiImplicitParam(name = "categoryId1", value = "一级分类Id", required = true),
+            @ApiImplicitParam(name = "webSite", value = "站点")
     })
     @GetMapping("bottomCategory")
-    public JsonResult<List<FrontGoodsCategoryVO>> bottomCategory(HttpServletRequest request, Integer categoryId1) {
+    public JsonResult<List<FrontGoodsCategoryVO>> bottomCategory(HttpServletRequest request, Integer categoryId1, @RequestParam(value = "webSite", required = false, defaultValue = "1") String webSite) {
         List<FrontGoodsCategoryVO> vos = new ArrayList<>();
 
         //查询redis缓存
-        String dataJson = stringRedisTemplate.opsForValue().get(RedisConst.FRONT_GOODS_CATEGORY);
+        String dataJson = stringRedisTemplate.opsForValue().get(RedisConst.FRONT_GOODS_CATEGORY + "_" + webSite);
         if (!StringUtils.isEmpty(dataJson)) {
             JSONArray jsonArray = JSONArray.parseArray(dataJson);
             for (int i = 0; i < jsonArray.size(); i++) {
@@ -572,6 +592,7 @@ public class GoodsCategoryController {
                         for (int j = 0; j < array2.size(); j++) {
                             JSONObject object = array2.getJSONObject(j);
                             FrontGoodsCategoryVO categoryVO = new FrontGoodsCategoryVO();
+                            categoryVO.setWebSite(object.getString("webSite"));
                             categoryVO.setCategoryId(object.getInteger("categoryId"));
                             categoryVO.setCategoryName(object.getString("categoryName"));
                             categoryVO.setPid(object.getInteger("pid"));

+ 3 - 1
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/controller/goods/admin/GoodsController.java

@@ -70,6 +70,7 @@ public class GoodsController extends BaseController {
 
     @ApiOperation("获取商品列表")
     @ApiImplicitParams({
+            @ApiImplicitParam(name = "webSite", value = "站点", paramType = "query"),
             @ApiImplicitParam(name = "goodsName", value = "商品名称", paramType = "query"),
             @ApiImplicitParam(name = "storeName", value = "店铺名称", paramType = "query"),
             @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query"),
@@ -82,10 +83,11 @@ public class GoodsController extends BaseController {
             @ApiImplicitParam(name = "goodsCategoryId", value = "商品分类Id", paramType = "query")
     })
     @GetMapping("list")
-    public JsonResult<PageVO<GoodsVO>> getList(HttpServletRequest request, String goodsName, String storeName,
+    public JsonResult<PageVO<GoodsVO>> getList(HttpServletRequest request,String webSite, String goodsName, String storeName,
                                                Date startTime, Date endTime,Date updateStartTime, Date updateEndTime, Integer state, Integer auditState, Integer isVirtualGoods,Integer goodsCategoryId) {
         PagerInfo pager = WebUtil.handlerPagerInfo(request);
         GoodsExample example = new GoodsExample();
+        example.setWebSite(webSite);
         example.setGoodsNameLike(goodsName);
         example.setStoreNameLike(storeName);
         example.setCreateTimeAfter(startTime);

+ 3 - 1
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/controller/goods/admin/GoodsLabelController.java

@@ -38,17 +38,19 @@ public class GoodsLabelController extends BaseController {
 
     @ApiOperation("商品标签列表")
     @ApiImplicitParams({
+            @ApiImplicitParam(name = "webSite", value = "站点", defaultValue = "1", paramType = "query"),
             @ApiImplicitParam(name = "labelName", value = "标签名称", paramType = "query"),
             @ApiImplicitParam(name = "pageSize", value = "分页大小", defaultValue = "20", paramType = "query"),
             @ApiImplicitParam(name = "current", value = "当前页面位置", defaultValue = "1", paramType = "query")
     })
     @GetMapping("list")
-    public JsonResult<PageVO<GoodsLabelVO>> getList(HttpServletRequest request, String labelName) {
+    public JsonResult<PageVO<GoodsLabelVO>> getList(HttpServletRequest request,String webSite, String labelName) {
         //分页设置
         PagerInfo pager = WebUtil.handlerPagerInfo(request);
 
         //根据标签名称查询商品标签集合
         GoodsLabelExample example = new GoodsLabelExample();
+        example.setWebSite(webSite);
         example.setLabelNameLike(labelName);
         List<GoodsLabel> list = goodsLabelModel.getGoodsLabelList(example, pager);
 

+ 1 - 1
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/controller/seller/seller/SellerStoreController.java

@@ -347,7 +347,7 @@ public class SellerStoreController extends BaseController {
             storeModel.updateSeo(sysSeo,sysSeo.getTargetId(),sysSeo.getType());
 //            storeModel.updateSeoByTargetIdAndType(sysSeo,sysSeo.getTargetId(),sysSeo.getType());
         }else{
-            sysSeo.setCode(SeoTypeConstant.SEO_TYPE_SHOP+"_"+vendor.getStoreId());
+            sysSeo.setCode(SeoTypeConstant.SEO_TYPE_SHOP + "_" + vendor.getStoreId());
             sysSeo.setCreateUid(vendor.getVendorId());
             sysSeo.setCreateTime(time);
             storeModel.saveSeo(sysSeo);

+ 7 - 6
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/controller/system/admin/AdminAgreementController.java

@@ -16,10 +16,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
@@ -36,13 +33,15 @@ public class AdminAgreementController extends BaseController {
 
     @ApiOperation("协议列表")
     @ApiImplicitParams({
+            @ApiImplicitParam(name = "webSite", value = "站点", paramType = "query"),
             @ApiImplicitParam(name = "pageSize", value = "分页大小", defaultValue = "20", paramType = "query"),
             @ApiImplicitParam(name = "current", value = "当前页面位置", defaultValue = "1", paramType = "query")
     })
     @GetMapping("list")
-    public JsonResult<PageVO<Agreement>> list(HttpServletRequest request) {
+    public JsonResult<PageVO<Agreement>> list(HttpServletRequest request,@RequestParam(value = "webSite", required = false,defaultValue = "1") String webSite) {
         PagerInfo pager = WebUtil.handlerPagerInfo(request);
         AgreementExample example = new AgreementExample();
+        example.setWebSite(webSite);
         List<Agreement> list = agreementModel.getAgreementList(example, pager);
         return SldResponse.success(new PageVO<>(list, pager));
     }
@@ -60,16 +59,18 @@ public class AdminAgreementController extends BaseController {
     @ApiOperation("修改协议")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "agreementCode", value = "协议编码", required = true),
+            @ApiImplicitParam(name = "webSite", value = "站点", required = false),
             @ApiImplicitParam(name = "title", value = "标题", required = true),
             @ApiImplicitParam(name = "content", value = "内容", required = true)
     })
     @OperationLogger(option = "修改协议")
     @PostMapping("update")
-    public JsonResult update(HttpServletRequest request, String agreementCode, String title, String content) {
+    public JsonResult update(HttpServletRequest request, String agreementCode,@RequestParam (value = "webSite", required = false,defaultValue = "1") String webSite, String title, String content) {
         Admin adminUser = UserUtil.getUser(request, Admin.class);
 
         Agreement agreement = new Agreement();
         agreement.setAgreementCode(agreementCode);
+        agreement.setWebSite(webSite);
         agreement.setTitle(title);
         agreement.setContent(content);
         agreement.setUpdateAdminId(adminUser.getAdminId());

+ 19 - 14
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/controller/system/admin/AdminSettingController.java

@@ -112,13 +112,13 @@ public class AdminSettingController extends BaseController {
             settingModel.updateSetting(setting, webSite);
 
 
-            if("sys_seo_title".equals(entry.getKey())){
+            if ("sys_seo_title".equals(entry.getKey())) {
                 sysSeo.setTitle(entry.getValue());
             }
-            if("sys_seo_desc".equals(entry.getKey())){
+            if ("sys_seo_desc".equals(entry.getKey())) {
                 sysSeo.setRemark(entry.getValue());
             }
-            if("sys_seo_keywords".equals(entry.getKey())){
+            if ("sys_seo_keywords".equals(entry.getKey())) {
                 sysSeo.setKeywords(entry.getValue());
             }
 
@@ -137,7 +137,12 @@ public class AdminSettingController extends BaseController {
             }
 
             //更新缓存配置
-            stringRedisTemplate.opsForValue().set(entry.getKey(), entry.getValue());
+            if (!WebSiteConstant.MEMBER_OVERSEA.equals(webSite)) {
+                stringRedisTemplate.opsForValue().set(entry.getKey() + "_" + webSite, entry.getValue());
+            } else {
+                stringRedisTemplate.opsForValue().set(entry.getKey(), entry.getValue());
+            }
+
         }
 
         //判断此条对应的记录是否为空
@@ -154,12 +159,6 @@ public class AdminSettingController extends BaseController {
             storeModel.saveSeo(sysSeo);
         }
 
-        List<Setting> settingList = settingModel.getSettingList(new SettingExample(), null);
-        AssertUtil.notEmpty(settingList, "配置信息不存在");
-        settingList.forEach(setting -> {
-            stringRedisTemplate.opsForValue().set(setting.getName(), setting.getValue());
-        });
-
         return SldResponse.success("更新成功");
     }
 
@@ -177,16 +176,17 @@ public class AdminSettingController extends BaseController {
 
     @ApiOperation("获取配置信息")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "str", value = "要查询的键组合,以逗号分割", paramType = "query")
+            @ApiImplicitParam(name = "str", value = "要查询的键组合,以逗号分割", paramType = "query"),
+            @ApiImplicitParam(name = "webSite", value = "站点", paramType = "query")
     })
     @GetMapping("getSettingList")
-    public JsonResult<List<Setting>> getSettingList(HttpServletRequest request, String str) {
+    public JsonResult<List<Setting>> getSettingList(HttpServletRequest request, String str, String webSite) {
         AssertUtil.isTrue(StringUtils.isEmpty(str), "请输入正确的参数");
 
         //从请求头中获取语言类型
         String languageType = request.getHeader("Language");
 
-        List<Setting> list = getSetting(str);
+        List<Setting> list = getSetting(str, webSite);
         AssertUtil.notNull(list, "请输入正确的参数");
         list.forEach(setting -> {
             //翻译
@@ -863,9 +863,14 @@ public class AdminSettingController extends BaseController {
             if (StringUtils.isEmpty(s)) {
                 continue;
             }
-            Setting setting = settingModel.getSettingByName(s);
+            Setting setting;
             if (!WebSiteConstant.MEMBER_OVERSEA.equals(webSite)) {
                 setting = settingModel.getSettingByName(s + "_" + webSite);
+                if (setting != null) {
+                    setting.setName(s);
+                }
+            }else {
+                setting = settingModel.getSettingByName(s);
             }
             if (setting == null) {
                 continue;

+ 3 - 4
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/controller/system/seller/SellerPcDecoController.java

@@ -111,14 +111,13 @@ public class SellerPcDecoController extends BaseController {
     @ApiImplicitParams({
             @ApiImplicitParam(name = "decoId", value = "装修页id", required = true),
             @ApiImplicitParam(name = "decoType", value = "装修页类型", required = true),
-            @ApiImplicitParam(name = "webSite", value = "装修页站点"),
             @ApiImplicitParam(name = "decoName", value = "装修页名称", required = true),
             @ApiImplicitParam(name = "data", value = "装修页数据"),
             @ApiImplicitParam(name = "isEnable", value = "是否启用该装修页;0==不启用,1==启用")
     })
     @VendorLogger(option = "编辑装修页")
     @PostMapping("update")
-    public JsonResult<Integer> update(HttpServletRequest request, Integer decoId, String decoType,@RequestParam (value = "webSite", required = false,defaultValue = "1") String webSite, String decoName, String data, Integer isEnable) {
+    public JsonResult<Integer> update(HttpServletRequest request, Integer decoId, String decoType, String decoName, String data, Integer isEnable) {
         Vendor vendor = UserUtil.getUser(request, Vendor.class);
 
         TplPcMallDeco tplPcMallDecoDb = tplPcMallDecoModel.getTplPcMallDecoByDecoId(decoId);
@@ -128,7 +127,7 @@ public class SellerPcDecoController extends BaseController {
         TplPcMallDeco tplPcMallDeco = new TplPcMallDeco();
         tplPcMallDeco.setDecoId(decoId);
         tplPcMallDeco.setDecoType(decoType);
-        tplPcMallDeco.setWebSite(webSite);
+        tplPcMallDeco.setWebSite(tplPcMallDecoDb.getWebSite());
         tplPcMallDeco.setDecoName(decoName);
         tplPcMallDeco.setData(data);
         tplPcMallDeco.setIsEnable(isEnable);
@@ -143,7 +142,7 @@ public class SellerPcDecoController extends BaseController {
             //关闭其他开启的装修页
             TplPcMallDecoExample example = new TplPcMallDecoExample();
             example.setDecoIdNotEquals(decoId);
-            example.setWebSite(webSite);
+            example.setWebSite(tplPcMallDecoDb.getWebSite());
             example.setDecoType(tplPcMallDecoDb.getDecoType());
             example.setIsEnable(TplPcConst.IS_ENABLE_YES);
             example.setStoreId(vendor.getStoreId());

+ 2 - 0
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/model/goods/ESGoodsModel.java

@@ -175,6 +175,8 @@ public class ESGoodsModel {
         for (Goods goods : goodsList) {
             searchProductDTO = new SearchProductDTO();
             searchProductDTO.setGoodsId(goods.getGoodsId().toString());
+            searchProductDTO.setWebSite(goods.getWebSite());
+            searchProductDTO.setGoodsNameCn(goods.getGoodsNameCn());
             searchProductDTO.setGoodsName(goods.getGoodsName());
             searchProductDTO.setBrandId(StringUtil.isNullOrZero(goods.getBrandId()) ? "" : goods.getBrandId().toString());
             searchProductDTO.setBrandName(goods.getBrandName());

+ 3 - 0
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/model/goods/GoodsAttributeModel.java

@@ -62,6 +62,7 @@ public class GoodsAttributeModel {
     public Integer saveGoodsAttribute(Integer adminId, GoodsAttributeAddDTO goodsAttributeAddDTO) {
         //判断属性名称是否重复
         GoodsAttributeExample goodsAttributeExample = new GoodsAttributeExample();
+        goodsAttributeExample.setWebSite(goodsAttributeAddDTO.getWebSite());
         goodsAttributeExample.setAttributeName(goodsAttributeAddDTO.getAttributeName());
         List<GoodsAttribute> goodsAttributes = goodsAttributeReadMapper.listByExample(goodsAttributeExample);
         if (!CollectionUtils.isEmpty(goodsAttributes)) {
@@ -69,6 +70,7 @@ public class GoodsAttributeModel {
         }
         //插入属性表
         GoodsAttribute goodsAttributeInsert = new GoodsAttribute();
+        goodsAttributeInsert.setWebSite(goodsAttributeAddDTO.getWebSite());
         goodsAttributeInsert.setAttributeName(goodsAttributeAddDTO.getAttributeName());
         goodsAttributeInsert.setSort(goodsAttributeAddDTO.getSort());
         goodsAttributeInsert.setIsShow(goodsAttributeAddDTO.getIsShow());
@@ -165,6 +167,7 @@ public class GoodsAttributeModel {
         if (!StringUtils.isEmpty(goodsAttributeUpdateDTO.getAttributeName())) {
             //判断属性名称是否重复
             GoodsAttributeExample goodsAttributeExample = new GoodsAttributeExample();
+            goodsAttributeExample.setWebSite(goodsAttributeUpdateDTO.getWebSite());
             goodsAttributeExample.setAttributeName(goodsAttributeUpdateDTO.getAttributeName());
             goodsAttributeExample.setAttributeIdNotEquals(goodsAttributeUpdateDTO.getAttributeId());
             List<GoodsAttribute> goodsAttributes = goodsAttributeReadMapper.listByExample(goodsAttributeExample);

+ 3 - 0
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/model/goods/GoodsBrandModel.java

@@ -70,6 +70,7 @@ public class GoodsBrandModel {
         //判断品牌名称是否重复
         GoodsBrandExample example = new GoodsBrandExample();
         example.setBrandName(goodsBrandAddDTO.getBrandName());
+        example.setWebSite(goodsBrandAddDTO.getWebSite());
         List<GoodsBrand> list = goodsBrandReadMapper.listByExample(example);
         if (!CollectionUtils.isEmpty(list)) {
             throw new MallException("品牌名称已存在,请重新填写");
@@ -77,6 +78,7 @@ public class GoodsBrandModel {
 
         //插入品牌表
         GoodsBrand goodsBrandInsert = new GoodsBrand();
+        goodsBrandInsert.setWebSite(goodsBrandAddDTO.getWebSite());
         goodsBrandInsert.setBrandName(goodsBrandAddDTO.getBrandName());
         goodsBrandInsert.setBrandDesc(goodsBrandAddDTO.getBrandDesc());
         goodsBrandInsert.setImage(goodsBrandAddDTO.getImage());
@@ -204,6 +206,7 @@ public class GoodsBrandModel {
     public Integer updateGoodsBrand(Integer adminId, GoodsBrandUpdateDTO goodsBrandUpdateDTO) throws Exception {
         //判断品牌名称是否重复
         GoodsBrandExample example = new GoodsBrandExample();
+        example.setWebSite(goodsBrandUpdateDTO.getWebSite());
         example.setBrandName(goodsBrandUpdateDTO.getBrandName());
         example.setBrandIdNotEquals(goodsBrandUpdateDTO.getBrandId());
         List<GoodsBrand> list = goodsBrandReadMapper.listByExample(example);

+ 7 - 2
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/model/goods/GoodsCategoryModel.java

@@ -138,6 +138,7 @@ public class GoodsCategoryModel {
         //插入分类表
         GoodsCategory goodsCategoryInsert = new GoodsCategory();
         goodsCategoryInsert.setCategoryName(goodsCategoryAddDTO.getCategoryName());
+        goodsCategoryInsert.setWebSite(goodsCategoryAddDTO.getWebSite());
         goodsCategoryInsert.setPid(goodsCategoryAddDTO.getPid());
         String path;
         Integer grade;
@@ -169,7 +170,7 @@ public class GoodsCategoryModel {
         count = goodsCategoryWriteMapper.insert(goodsCategoryInsert);
 
 
-        int seoCount = goodsCategoryModel.addAndUpdateSeoForGoodsCategory(seoTitle,seoDesc,seoKeyWords,admin,goodsCategoryInsert.getCategoryId());
+        int seoCount = goodsCategoryModel.addAndUpdateSeoForGoodsCategory(seoTitle,seoDesc,seoKeyWords,admin,goodsCategoryInsert.getCategoryId(),goodsCategoryInsert.getWebSite());
         if(seoCount == 0){
             throw new MallException("添加seo表失败,请重试");
         }
@@ -209,10 +210,11 @@ public class GoodsCategoryModel {
      * @param admin
      * @return
      */
-    public Integer addAndUpdateSeoForGoodsCategory(String seoTitle, String seoDesc, String seoKeyWords,Admin admin,Integer categoryId){
+    public Integer addAndUpdateSeoForGoodsCategory(String seoTitle, String seoDesc, String seoKeyWords,Admin admin,Integer categoryId,String webSite){
         //以下为新增SEO表
         SysSeo sysSeo = new SysSeo();
         sysSeo.setTenant(0L);
+        sysSeo.setWebSite(webSite);
         sysSeo.setType(SeoTypeConstant.SEO_TYPE_GOODS_CATEGORY);
         sysSeo.setName("商品分类SEO");
 //        sysSeo.setCode(SeoTypeConstant.SEO_TYPE_GOODS_CATEGORY+"_"+Integer.valueOf(storeInnerLabel.getInnerLabelId()).longValue());
@@ -259,6 +261,7 @@ public class GoodsCategoryModel {
         //以下为新增SEO表
         SysSeo sysSeo = new SysSeo();
         sysSeo.setTenant(0L);
+        sysSeo.setWebSite(goodsCategoryUpdateDTO.getWebSite());
         sysSeo.setType(SeoTypeConstant.SEO_TYPE_GOODS_CATEGORY);
         sysSeo.setName("商品分类SEO");
 //        sysSeo.setCode(SeoTypeConstant.SEO_TYPE_GOODS_CATEGORY+"_"+Integer.valueOf(storeInnerLabel.getInnerLabelId()).longValue());
@@ -410,6 +413,7 @@ public class GoodsCategoryModel {
 
             //判断该pid下的子分类中有没有分类名称重复的
             GoodsCategoryExample goodsCategoryExample = new GoodsCategoryExample();
+            goodsCategoryExample.setWebSite(goodsCategoryUpdateDTO.getWebSite());
             goodsCategoryExample.setPid(goodsCategoryUpdateDTO.getPid());
             goodsCategoryExample.setCategoryIdNotEquals(goodsCategoryUpdateDTO.getCategoryId());
             goodsCategoryExample.setCategoryName(goodsCategoryUpdateDTO.getCategoryName());
@@ -421,6 +425,7 @@ public class GoodsCategoryModel {
 
         GoodsCategory goodsCategoryUpdate = new GoodsCategory();
         goodsCategoryUpdate.setCategoryId(goodsCategoryUpdateDTO.getCategoryId());
+        goodsCategoryUpdate.setWebSite(goodsCategoryUpdateDTO.getWebSite());
         goodsCategoryUpdate.setCategoryName(goodsCategoryUpdateDTO.getCategoryName());
         goodsCategoryUpdate.setScaling(goodsCategoryUpdateDTO.getScaling());
         goodsCategoryUpdate.setUpdateAdminId(admin.getAdminId());

+ 2 - 0
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/model/goods/GoodsLabelModel.java

@@ -57,6 +57,7 @@ public class GoodsLabelModel {
 
         //根据标签名称查重
         GoodsLabelExample example = new GoodsLabelExample();
+        example.setWebSite(goodsLabelAddDTO.getWebSite());
         example.setLabelName(goodsLabelAddDTO.getLabelName());
         List<GoodsLabel> list = goodsLabelReadMapper.listByExample(example);
         if (!CollectionUtils.isEmpty(list)) {
@@ -124,6 +125,7 @@ public class GoodsLabelModel {
     public Integer updateGoodsLabel(GoodsLabelEditDTO goodsLabelEditDTO, Integer adminId) throws Exception {
         //根据标签名称查重
         GoodsLabelExample example = new GoodsLabelExample();
+        example.setWebSite(goodsLabelEditDTO.getWebSite());
         example.setLabelIdNotEquals(goodsLabelEditDTO.getLabelId());
         example.setLabelName(goodsLabelEditDTO.getLabelName());
         List<GoodsLabel> list = goodsLabelReadMapper.listByExample(example);

+ 13 - 9
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/model/system/TplPcMallDecoModel.java

@@ -4,6 +4,7 @@ import com.slodon.b2b2c.core.constant.TplPcConst;
 import com.slodon.b2b2c.core.exception.MallException;
 import com.slodon.b2b2c.core.response.PagerInfo;
 import com.slodon.b2b2c.core.util.AssertUtil;
+import com.slodon.b2b2c.core.util.StringUtil;
 import com.slodon.b2b2c.dao.read.system.TplPcMallDecoReadMapper;
 import com.slodon.b2b2c.dao.write.system.TplPcMallDecoWriteMapper;
 import com.slodon.b2b2c.system.example.TplPcMallDecoExample;
@@ -91,15 +92,18 @@ public class TplPcMallDecoModel {
         if (StringUtils.isEmpty(tplPcMallDeco.getDecoId())) {
             throw new MallException("请选择要修改的数据");
         }
-        //名称查重
-        TplPcMallDecoExample example = new TplPcMallDecoExample();
-        example.setDecoIdNotEquals(tplPcMallDeco.getDecoId());
-        example.setDecoName(tplPcMallDeco.getDecoName());
-        example.setDecoType(tplPcMallDeco.getDecoType());
-        example.setWebSite(tplPcMallDeco.getWebSite());
-        example.setStoreId(tplPcMallDeco.getStoreId());
-        List<TplPcMallDeco> tplPcMallDecos = tplPcMallDecoReadMapper.listByExample(example);
-        AssertUtil.isTrue(!CollectionUtils.isEmpty(tplPcMallDecos), "名称重复,请重试");
+
+        if (!StringUtil.isEmpty(tplPcMallDeco.getDecoName())) {
+            //名称查重
+            TplPcMallDecoExample example = new TplPcMallDecoExample();
+            example.setDecoIdNotEquals(tplPcMallDeco.getDecoId());
+            example.setDecoName(tplPcMallDeco.getDecoName());
+            example.setDecoType(tplPcMallDeco.getDecoType());
+            example.setWebSite(tplPcMallDeco.getWebSite());
+            example.setStoreId(tplPcMallDeco.getStoreId());
+            List<TplPcMallDeco> tplPcMallDecos = tplPcMallDecoReadMapper.listByExample(example);
+            AssertUtil.isTrue(!CollectionUtils.isEmpty(tplPcMallDecos), "名称重复,请重试");
+        }
 
         int count = tplPcMallDecoWriteMapper.updateByPrimaryKeySelective(tplPcMallDeco);
         if (count == 0) {

+ 4 - 0
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/vo/goods/FrontGoodsCategoryVO.java

@@ -19,6 +19,9 @@ public class FrontGoodsCategoryVO {
     @ApiModelProperty("分类id")
     private Integer categoryId;
 
+    @ApiModelProperty("站点")
+    private String webSite;
+
     @ApiModelProperty("分类名称")
     private String categoryName;
 
@@ -45,6 +48,7 @@ public class FrontGoodsCategoryVO {
 
     public FrontGoodsCategoryVO(GoodsCategory category) {
         this.categoryId = category.getCategoryId();
+        this.webSite = category.getWebSite();
         this.categoryName = category.getCategoryName();
         this.pid = category.getPid();
         this.grade = category.getGrade();

+ 4 - 0
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/vo/goods/GoodsAttributeVO.java

@@ -20,6 +20,9 @@ public class GoodsAttributeVO {
     @ApiModelProperty("属性id")
     private Integer attributeId;
 
+    @ApiModelProperty("站点")
+    private String webSite;
+
     @ApiModelProperty("属性名称")
     private String attributeName;
 
@@ -40,6 +43,7 @@ public class GoodsAttributeVO {
 
     public GoodsAttributeVO(GoodsAttribute attribute, List<GoodsAttributeValue> goodsAttributeValueList) {
         this.attributeId=attribute.getAttributeId();
+        this.webSite=attribute.getWebSite();
         this.attributeName=attribute.getAttributeName();
         this.sort=attribute.getSort();
         this.isShow=attribute.getIsShow();

+ 4 - 0
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/vo/goods/GoodsBrandApplyVO.java

@@ -19,6 +19,9 @@ public class GoodsBrandApplyVO {
     @ApiModelProperty("品牌id")
     private Integer brandId;
 
+    @ApiModelProperty("站点")
+    private String webSite;
+
     @ApiModelProperty("品牌名称")
     private String brandName;
 
@@ -57,6 +60,7 @@ public class GoodsBrandApplyVO {
 
     public GoodsBrandApplyVO(GoodsBrand brand) {
         this.brandId = brand.getBrandId();
+        this.webSite = brand.getWebSite();
         this.brandName = brand.getBrandName();
         this.brandDesc = brand.getBrandDesc();
         this.image = brand.getImage();

+ 4 - 0
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/vo/goods/GoodsBrandVO.java

@@ -18,6 +18,9 @@ public class GoodsBrandVO {
     @ApiModelProperty("品牌id")
     private Integer brandId;
 
+    @ApiModelProperty("站点")
+    private String webSite;
+
     @ApiModelProperty("品牌名称")
     private String brandName;
 
@@ -41,6 +44,7 @@ public class GoodsBrandVO {
 
     public GoodsBrandVO(GoodsBrand brand) {
         this.brandId = brand.getBrandId();
+        this.webSite = brand.getWebSite();
         this.brandName = brand.getBrandName();
         this.brandDesc = brand.getBrandDesc();
         this.image = brand.getImage();

+ 4 - 0
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/vo/goods/GoodsLabelVO.java

@@ -21,6 +21,9 @@ public class GoodsLabelVO {
     @ApiModelProperty("标签id")
     private Integer labelId;
 
+    @ApiModelProperty("站点")
+    private String webSite;
+
     @ApiModelProperty("标签名称")
     private String labelName;
 
@@ -38,6 +41,7 @@ public class GoodsLabelVO {
 
     public GoodsLabelVO(GoodsLabel goodsLabel) {
         this.labelId = goodsLabel.getLabelId();
+        this.webSite = goodsLabel.getWebSite();
         this.labelName =goodsLabel.getLabelName();
         this.description =goodsLabel.getDescription();
         this.sort =goodsLabel.getSort();

+ 1 - 0
xinkeaboard-server/b2b2c-web/src/main/resources/application.yml

@@ -42,6 +42,7 @@ secure:
       - "/v3/goods/front/goods/searchWords/list"
       - "/v3/member/front/active/**"
       - "/v3/open/api/sso/login/**"
+      - "/v3/system/seller/setting/getSiteSettingList"
       - "/openapi/**"
     #      - "/v3/seller/seller/enquiry/sendMsgStr"
     login-urls: #登录接口

+ 4 - 0
xinkeaboard-server/b2b2c-web/src/main/resources/mapper/read/goods/GoodsAttributeReadMapper.xml

@@ -3,6 +3,7 @@
 <mapper namespace="com.slodon.b2b2c.dao.read.goods.GoodsAttributeReadMapper">
   <resultMap id="resultMap" type="com.slodon.b2b2c.goods.pojo.GoodsAttribute">
     <id column="attribute_id" property="attributeId" />
+    <result column="web_site" property="webSite" />
     <result column="attribute_name" property="attributeName" />
     <result column="create_admin_id" property="createAdminId" />
     <result column="create_time" property="createTime" />
@@ -23,6 +24,9 @@
         <if test="example.attributeIdIn != null">
           AND `attribute_id` in (${example.attributeIdIn})
         </if>
+        <if test="example.webSite != null">
+          AND `web_site` = #{example.webSite}
+        </if>
         <if test="example.attributeName != null">
           AND `attribute_name` = #{example.attributeName}
         </if>

+ 4 - 0
xinkeaboard-server/b2b2c-web/src/main/resources/mapper/read/goods/GoodsLabelReadMapper.xml

@@ -3,6 +3,7 @@
 <mapper namespace="com.slodon.b2b2c.dao.read.goods.GoodsLabelReadMapper">
   <resultMap id="resultMap" type="com.slodon.b2b2c.goods.pojo.GoodsLabel">
     <id column="label_id" property="labelId" />
+    <result column="web_site" property="webSite" />
     <result column="label_name" property="labelName" />
     <result column="description" property="description" />
     <result column="sort" property="sort" />
@@ -25,6 +26,9 @@
         <if test="example.labelIdIn != null">
           AND `label_id` in (${example.labelIdIn})
         </if>
+        <if test="example.webSite != null">
+          AND `web_site` = #{example.webSite}
+        </if>
         <if test="example.labelName != null">
           AND `label_name` = #{example.labelName}
         </if>

+ 4 - 0
xinkeaboard-server/b2b2c-web/src/main/resources/mapper/read/system/AgreementReadMapper.xml

@@ -3,6 +3,7 @@
 <mapper namespace="com.slodon.b2b2c.dao.read.system.AgreementReadMapper">
   <resultMap id="resultMap" type="com.slodon.b2b2c.system.pojo.Agreement">
     <id column="agreement_code" property="agreementCode" />
+    <result column="web_site" property="webSite" />
     <result column="title" property="title" />
     <result column="update_time" property="updateTime" />
     <result column="update_admin_id" property="updateAdminId" />
@@ -23,6 +24,9 @@
         <if test="example.agreementCodeIn != null">
           AND `agreement_code` in (${example.agreementCodeIn})
         </if>
+        <if test="example.webSite != null">
+          AND `web_site` = #{example.webSite}
+        </if>
         <if test="example.title != null">
           AND `title` = #{example.title}
         </if>

+ 16 - 0
xinkeaboard-server/b2b2c-web/src/main/resources/mapper/write/goods/GoodsAttributeWriteMapper.xml

@@ -3,6 +3,7 @@
 <mapper namespace="com.slodon.b2b2c.dao.write.goods.GoodsAttributeWriteMapper">
   <resultMap id="resultMap" type="com.slodon.b2b2c.goods.pojo.GoodsAttribute">
     <id column="attribute_id" property="attributeId" />
+    <result column="web_site" property="webSite" />
     <result column="attribute_name" property="attributeName" />
     <result column="create_admin_id" property="createAdminId" />
     <result column="create_time" property="createTime" />
@@ -12,6 +13,9 @@
   <!--除主键外的所有字段,用于插入操作-->
   <sql id="columns">
     <trim suffixOverrides=",">
+      <if test="webSite != null">
+        `web_site`,
+      </if>
       <if test="attributeName != null">
         `attribute_name`,
       </if>
@@ -43,6 +47,9 @@
         <if test="example.attributeIdIn != null">
           AND `attribute_id` in (${example.attributeIdIn})
         </if>
+        <if test="example.webSite != null">
+          AND `web_site` = #{example.webSite}
+        </if>
         <if test="example.attributeName != null">
           AND `attribute_name` = #{example.attributeName}
         </if>
@@ -189,6 +196,9 @@
     )
     VALUES(
     <trim suffixOverrides=",">
+      <if test="webSite != null">
+        #{webSite},
+      </if>
       <if test="attributeName != null">
         #{attributeName},
       </if>
@@ -211,6 +221,9 @@
   <update id="updateByExampleSelective">
     UPDATE `goods_attribute`
     <trim prefix="SET" suffixOverrides=",">
+      <if test="record.webSite != null">
+        `web_site` = #{record.webSite},
+      </if>
       <if test="record.attributeName != null">
         `attribute_name` = #{record.attributeName},
       </if>
@@ -233,6 +246,9 @@
   <update id="updateByPrimaryKeySelective">
     UPDATE `goods_attribute`
     <trim prefix="SET" suffixOverrides=",">
+      <if test="webSite !=null">
+        `web_site` = #{webSite},
+      </if>
       <if test="attributeName != null">
         `attribute_name` = #{attributeName},
       </if>

+ 16 - 0
xinkeaboard-server/b2b2c-web/src/main/resources/mapper/write/goods/GoodsLabelWriteMapper.xml

@@ -3,6 +3,7 @@
 <mapper namespace="com.slodon.b2b2c.dao.write.goods.GoodsLabelWriteMapper">
   <resultMap id="resultMap" type="com.slodon.b2b2c.goods.pojo.GoodsLabel">
     <id column="label_id" property="labelId" />
+    <result column="web_site" property="webSite" />
     <result column="label_name" property="labelName" />
     <result column="description" property="description" />
     <result column="sort" property="sort" />
@@ -14,6 +15,9 @@
   <!--除主键外的所有字段,用于插入操作-->
   <sql id="columns">
     <trim suffixOverrides=",">
+      <if test="webSite != null">
+        `web_site`,
+      </if>
       <if test="labelName != null">
         `label_name`,
       </if>
@@ -51,6 +55,9 @@
         <if test="example.labelIdIn != null">
           AND `label_id` in (${example.labelIdIn})
         </if>
+        <if test="example.webSite != null">
+          AND `web_site` = #{example.webSite}
+        </if>
         <if test="example.labelName != null">
           AND `label_name` = #{example.labelName}
         </if>
@@ -206,6 +213,9 @@
     )
     VALUES(
     <trim suffixOverrides=",">
+      <if test="webSite != null">
+        #{webSite}
+      </if>
       <if test="labelName != null">
         #{labelName},
       </if>
@@ -234,6 +244,9 @@
   <update id="updateByExampleSelective">
     UPDATE `goods_label`
     <trim prefix="SET" suffixOverrides=",">
+      <if test="record.webSite != null">
+        `web_site` = #{record.webSite},
+      </if>
       <if test="record.labelName != null">
         `label_name` = #{record.labelName},
       </if>
@@ -262,6 +275,9 @@
   <update id="updateByPrimaryKeySelective">
     UPDATE `goods_label`
     <trim prefix="SET" suffixOverrides=",">
+      <if test="webSite != null">
+        `web_site` = #{webSite},
+      </if>
       <if test="labelName != null">
         `label_name` = #{labelName},
       </if>

+ 16 - 0
xinkeaboard-server/b2b2c-web/src/main/resources/mapper/write/system/AgreementWriteMapper.xml

@@ -3,6 +3,7 @@
 <mapper namespace="com.slodon.b2b2c.dao.write.system.AgreementWriteMapper">
   <resultMap id="resultMap" type="com.slodon.b2b2c.system.pojo.Agreement">
     <id column="agreement_code" property="agreementCode" />
+    <result column="web_site" property="webSite" />
     <result column="title" property="title" />
     <result column="update_time" property="updateTime" />
     <result column="update_admin_id" property="updateAdminId" />
@@ -15,6 +16,9 @@
       <if test="agreementCode != null">
         `agreement_code`,
       </if>
+      <if test="webSite != null">
+        `web_site`,
+      </if>
       <if test="title != null">
         `title`,
       </if>
@@ -46,6 +50,9 @@
         <if test="example.agreementCodeIn != null">
           AND `agreement_code` in (${example.agreementCodeIn})
         </if>
+        <if test="example.webSite != null">
+          AND `web_site` = #{example.webSite}
+        </if>
         <if test="example.title != null">
           AND `title` = #{example.title}
         </if>
@@ -201,6 +208,9 @@
       <if test="agreementCode != null">
         #{agreementCode},
       </if>
+      <if test="webSite != null">
+        #{webSite},
+      </if>
       <if test="title != null">
         #{title},
       </if>
@@ -223,6 +233,9 @@
   <update id="updateByExampleSelective">
     UPDATE `sys_agreement`
     <trim prefix="SET" suffixOverrides=",">
+      <if test="record.webSite != null">
+        `web_site` = #{record.webSite},
+      </if>
       <if test="record.title != null">
         `title` = #{record.title},
       </if>
@@ -245,6 +258,9 @@
   <update id="updateByPrimaryKeySelective">
     UPDATE `sys_agreement`
     <trim prefix="SET" suffixOverrides=",">
+      <if test="webSite != null">
+        `web_site` = #{webSite},
+      </if>
       <if test="title != null">
         `title` = #{title},
       </if>

+ 50 - 6
xinkeaboard-server/doc/DDL/update.sql

@@ -152,11 +152,12 @@ ALTER TABLE  stats_platform_week ADD COLUMN web_site TINYINT NOT NULL DEFAULT 1
 ALTER TABLE stats_platform_year ADD COLUMN web_site TINYINT NOT NULL DEFAULT 1 COMMENT '站点 1:海外门户 2:国内分销门户' AFTER stats_time;
 
 
-INSERT INTO sys_setting (name, title, value, description)
+INSERT INTO sys_setting (name, title, value, description, type)
 SELECT CONCAT(name, '_2') AS name,
        title,
        value,
-       description
+       description,
+       type
 FROM sys_setting
 WHERE name IN (
                'basic_site_name', 'basic_site_icp', 'basic_site_copyright', 'basic_site_technical_support',
@@ -168,11 +169,12 @@ WHERE name IN (
     );
 
 
-INSERT INTO sys_setting (name, title, value, description)
+INSERT INTO sys_setting (name, title, value, description,type)
 SELECT CONCAT(name, '_2') AS name,
        title,
        value,
-       description
+       description,
+       type
 FROM sys_setting
 WHERE name IN (
                'main_site_logo', 'main_user_center_logo', 'main_user_logon_bg', 'main_user_register_bg',
@@ -181,23 +183,65 @@ WHERE name IN (
                'main_admin_top_logo', 'admin_login_left_bg', 'admin_login_bg'
     );
 
-INSERT INTO sys_setting (name, title, value, description)
+INSERT INTO sys_setting (name, title, value, description,type)
 SELECT CONCAT(name, '_2') AS name,
        title,
        value,
-       description
+       description,
+       type
 FROM sys_setting
 WHERE name IN (
                'default_image_store_logo', 'default_image_user_portrait', 'default_image_store_banner_pc',
                'default_image_store_list_top'
     );
 
+INSERT INTO sys_setting (name, title, value, description,type)
+SELECT CONCAT(name, '_2') AS name,
+       title,
+       value,
+       description,
+       type
+FROM sys_setting
+WHERE name = 'seller_center_entrance_is_enable';
+
+INSERT INTO sys_setting (name, title, value, description,type)
+SELECT CONCAT(name, '_2') AS name,
+       title,
+       value,
+       description,
+       type
+FROM sys_setting
+WHERE name = 'pay_test_enable';
+
+ALTER TABLE sys_seo DROP INDEX code_UNIQUE;
 
 ALTER TABLE sys_seo ADD COLUMN web_site TINYINT NOT NULL DEFAULT 1 COMMENT '站点 1:海外门户 2:国内分销门户' AFTER id;
 
 
+ALTER TABLE sys_agreement ADD COLUMN web_site TINYINT NOT NULL DEFAULT 1 COMMENT '站点 1:海外门户 2:国内分销门户' AFTER agreement_code;
+INSERT INTO sys_agreement (agreement_code, web_site, title, update_time, update_admin_id, update_admin_name, content)
+SELECT CONCAT(agreement_code, '_2') AS agreement_code,
+       '2',
+       title,
+       update_time,
+       update_admin_id,
+       update_admin_name,
+       ''
+FROM sys_agreement;
+
+INSERT INTO sys_setting (name, title, value, description,type)
+SELECT CONCAT(name, '_2') AS name,
+       title,
+       value,
+       description,
+       type
+FROM sys_setting
+WHERE name = 'goods_publish_need_audit';
+
 ALTER TABLE goods_category ADD COLUMN web_site TINYINT NOT NULL DEFAULT 1 COMMENT '站点 1:海外门户 2:国内分销门户' AFTER category_id;
 
+ALTER TABLE goods_attribute ADD COLUMN web_site TINYINT NOT NULL DEFAULT 1 COMMENT '站点 1:海外门户 2:国内分销门户' AFTER attribute_id;
+