浏览代码

新增上传excel导入数据品牌表新增供应商更新

赵冬冬 4 年之前
父节点
当前提交
47676ccc0d

+ 1 - 1
forest-admin/admin-server/src/main/java/com/hwrj/cloud/admin/controller/UploadCompanyInfoAndProductController.java

@@ -614,7 +614,7 @@ public class UploadCompanyInfoAndProductController {
         productExcelDao.updateBigType(compName);
         productExcelDao.updateSimType(compName);
         productExcelDao.updateMemberOrigin(compName);
-
+        productExcelDao.updateBrandComp(compName);
     }
 
 

+ 1 - 2
forest-admin/admin-server/src/main/java/com/hwrj/cloud/admin/dao/PmsProductExcelDao.java

@@ -31,6 +31,5 @@ public interface PmsProductExcelDao {
     void updateMemberOrigin(List<String> list);
 
 
-
-
+    void updateBrandComp(List<String> list);
 }

+ 12 - 1
forest-admin/admin-server/src/main/resources/dao/ProductExcelDao.xml

@@ -275,7 +275,7 @@
     <update id="updateBrand">
         UPDATE pms_product a
         LEFT JOIN pms_brand f ON a.brand_name = f.`name`
-        SET a.brand_id = f.id
+        SET a.brand_id = f.id,a.
         WHERE
         1 = 1
         AND a.comp_name in
@@ -320,5 +320,16 @@
             #{compName}
         </foreach>
     </update>
+    <update id="updateBrandComp">
+        UPDATE pms_brand a
+        JOIN pms_product b on a.id = b.brand_id
+        SET a.comp_id = b.comp_id,
+         a.comp_name = b.comp_name
+        WHERE 1=1
+        AND b.comp_name in
+        <foreach collection="list" item="compName" open="(" separator="," close=")">
+            #{compName}
+        </foreach>
+    </update>
 
 </mapper>

+ 1 - 1
sql/表结构变化语句/更新sql.sql

@@ -203,7 +203,7 @@ ALTER TABLE `pms_brand` ADD INDEX idx_comp_id ( `comp_id` );
 
 # 更新语句
 UPDATE pms_brand a
-JOIN pms_product b
+JOIN pms_product b on
 SET a.comp_id = b.comp_id,
  a.comp_name = b.comp_name
 WHERE