chao 4 tahun lalu
induk
melakukan
45b8bdc4c0

+ 1 - 1
src/main/java/com/caimei365/commodity/controller/PriceApi.java

@@ -22,7 +22,7 @@ import java.util.List;
  * @author : Charles
  * @date : 2021/4/9
  */
-@Api(tags="商品价格API")
+@Api(tags="商品价格API(注意:supplierId更改为shopId)")
 @RestController
 @RequiredArgsConstructor
 @RequestMapping("/commodity/price")

+ 1 - 1
src/main/java/com/caimei365/commodity/mapper/SearchMapper.java

@@ -59,7 +59,7 @@ public interface SearchMapper {
     /**
      * 根据供应商Id查找文档数据
      */
-    SupplierDO searchSupplierById(Integer supplierId);
+    SupplierDO searchSupplierById(Integer shopId);
 
     /**
      * 获取项目仪器数量

+ 1 - 1
src/main/java/com/caimei365/commodity/model/vo/PriceVo.java

@@ -21,7 +21,7 @@ public class PriceVo implements Serializable {
     /**
      * 供应商ID
      */
-    private Integer supplierId;
+    private Integer shopId;
     /**
      * 价格(计算后)
      */

+ 1 - 1
src/main/java/com/caimei365/commodity/model/vo/ProductItemVo.java

@@ -19,7 +19,7 @@ public class ProductItemVo implements Serializable {
     /** 商品Id */
     private Integer productId;
     /** 供应商Id */
-    private Integer supplierId;
+    private Integer shopId;
     /** 商品名称 */
     private String name;
     /** 商品图片 */

+ 1 - 1
src/main/java/com/caimei365/commodity/model/vo/PromotionsVo.java

@@ -58,7 +58,7 @@ public class PromotionsVo implements Serializable {
     /**
      * 店铺id(店铺促销时供应商ID)
      */
-    private Integer supplierId;
+    private Integer shopId;
     /**
      * 商品id
      */

+ 4 - 4
src/main/java/com/caimei365/commodity/service/SearchIndexService.java

@@ -50,10 +50,10 @@ public interface SearchIndexService {
 
     /**
      * 根据供应商Id更新
-     * @param supplierId
+     * @param shopId
      * @return
      */
-    ResponseJson<Integer> updateSupplierIndexById(Integer supplierId);
+    ResponseJson<Integer> updateSupplierIndexById(Integer shopId);
 
     /**
      * 根据项目仪器Id更新
@@ -79,10 +79,10 @@ public interface SearchIndexService {
 
     /**
      * 根据供应商Id删除
-     * @param supplierId
+     * @param shopId
      * @return
      */
-    ResponseJson<Integer> deleteSupplierIndexById(Integer supplierId);
+    ResponseJson<Integer> deleteSupplierIndexById(Integer shopId);
 
     /**
      * 根据项目仪器Id删除

+ 13 - 13
src/main/java/com/caimei365/commodity/service/impl/SearchIndexServiceImpl.java

@@ -228,12 +228,12 @@ public class SearchIndexServiceImpl implements SearchIndexService {
     /**
      * 根据供应商Id更新
      *
-     * @param supplierId int
+     * @param shopId int
      * @return json
      */
     @Override
-    public ResponseJson<Integer> updateSupplierIndexById(Integer supplierId) {
-        SupplierDO supplier = searchMapper.searchSupplierById(supplierId);
+    public ResponseJson<Integer> updateSupplierIndexById(Integer shopId) {
+        SupplierDO supplier = searchMapper.searchSupplierById(shopId);
         if(null != supplier){
              // 定义供应商文档数据
             List<DocumentDTO<SupplierDO>> supplierList = new ArrayList<>();
@@ -242,13 +242,13 @@ public class SearchIndexServiceImpl implements SearchIndexService {
             // 定义主文档入口数据
             List<DocumentDTO<MainDO>> mainList = new ArrayList<>();
             // 主文档设值
-            Integer mainId = searchQueryService.getIdByDocId("shop", supplierId);
+            Integer mainId = searchQueryService.getIdByDocId("shop", shopId);
             if (mainId == -1) {
                 mainId = searchQueryService.getIdByDocId("", null);
                 mainId = mainId == -1 ? 0 : mainId+1;
             }
             // 供应商文档 type=2
-            setMainDocument(2, mainList, mainId, supplierId);
+            setMainDocument(2, mainList, mainId, shopId);
             try {
                 // 将文档列表转换成Json串,并推送到阿里云
                 pushSupplierDocument(mainList, supplierList);
@@ -259,7 +259,7 @@ public class SearchIndexServiceImpl implements SearchIndexService {
                 return ResponseJson.error("添加供应商文档异常", null);
             }
         }else{
-            return deleteSupplierIndexById(supplierId);
+            return deleteSupplierIndexById(shopId);
         }
     }
 
@@ -373,13 +373,13 @@ public class SearchIndexServiceImpl implements SearchIndexService {
     /**
      * 根据供应商Id删除
      *
-     * @param supplierId int
+     * @param shopId int
      * @return json
      */
     @Override
-    public ResponseJson<Integer> deleteSupplierIndexById(Integer supplierId) {
+    public ResponseJson<Integer> deleteSupplierIndexById(Integer shopId) {
         try {
-            deleteDocByTypeId("s_id", supplierId, "search_supplier");
+            deleteDocByTypeId("s_id", shopId, "search_supplier");
             // 返回结果
             return ResponseJson.success(1);
         } catch (OpenSearchClientException | OpenSearchException | JSONException e) {
@@ -661,14 +661,14 @@ public class SearchIndexServiceImpl implements SearchIndexService {
                 // 供应商文档设值
                 setSupplierDocument(supplierList, supplier);
                 // 主文档设值
-                Integer supplierId = supplier.getS_id();
+                Integer shopId = supplier.getS_id();
                 if(initFlag){
                     supplierMainId = mainId+1;
                     mainId+=1;
                 }else{
-                    Integer tempId = idsMap.get(supplierId);
+                    Integer tempId = idsMap.get(shopId);
                     if (null==tempId || tempId<=0){
-                        tempId = searchQueryService.getIdByDocId("shop", supplierId);
+                        tempId = searchQueryService.getIdByDocId("shop", shopId);
                     }
                     if (null!=tempId && tempId>0) {
                         supplierMainId = tempId;
@@ -678,7 +678,7 @@ public class SearchIndexServiceImpl implements SearchIndexService {
                     }
                 }
                 // 供应商文档 type=2
-                setMainDocument(2, mainList, supplierMainId, supplierId);
+                setMainDocument(2, mainList, supplierMainId, shopId);
             }
             try {
                 // 推送到阿里云

+ 2 - 2
src/main/java/com/caimei365/commodity/service/impl/SearchQueryServiceImpl.java

@@ -703,8 +703,8 @@ public class SearchQueryServiceImpl implements SearchQueryService {
                 }
                 for (int i = 0; i < pageData.length(); i++) {
                     JSONObject supplier = pageData.getJSONObject(i);
-                    int supplierId = supplier.getInt("s_id");
-                    String productQuery = "p_supplier:'" + supplierId + "'";
+                    int shopId = supplier.getInt("s_id");
+                    String productQuery = "p_supplier:'" + shopId + "'";
                     SearchParams productSearchParams = searchOpenService.getProductParams(productQuery, "", identity, 1, 3, "", null);
                     // 查询商品
                     JSONObject pResult = searchOpenService.getResultJsonObject(productQuery, productSearchParams);

+ 2 - 2
src/main/resources/mapper/PriceMapper.xml

@@ -16,7 +16,7 @@
             p.costProportional as costProportional,
             p.costCheckFlag as costCheckFlag,
             p.step as step,
-            p.shopID as supplierId,
+            p.shopID as shopId,
             p.taxPoint as taxRate,
             p.includedTax as includedTax,
             p.invoiceType as invoiceType
@@ -35,7 +35,7 @@
             p.costProportional as costProportional,
             p.costCheckFlag as costCheckFlag,
             p.step as step,
-            p.shopID as supplierId,
+            p.shopID as shopId,
             p.includedTax as includedTax,
             p.invoiceType as invoiceType,
             p.taxPoint as taxRate

+ 1 - 1
src/main/resources/mapper/PromotionsMapper.xml

@@ -47,7 +47,7 @@
 		select
 			cpg.id as id,
 			p.productID as productId,
-			p.shopID as supplierId,
+			p.shopID as shopId,
 			p.`name` as `name`,
 			p.mainImage as image,
 			cpg.number as number,

+ 1 - 1
src/main/resources/mapper/SearchMapper.xml

@@ -161,7 +161,7 @@
         <include refid="Supplier_Joins"/>
         where (status = 90 or status = 9)
         and shopID != 1252
-        and s.shopID = #{supplierId}
+        and s.shopID = #{shopId}
     </select>
 
     <!-- 项目仪器 -->