zhangyang 2 жил өмнө
parent
commit
0b605e47b7

+ 5 - 6
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PoTetherServiceImpl.java

@@ -158,12 +158,11 @@ public class PoTetherServiceImpl extends ServiceImpl<PoTetherMapper,PoTether> im
 
 
             for (int i = 0; i < tetherVo.getPoTetherandcollections().size(); i++) {
-                System.out.println(tetherVo.getPoTetherandcollections().get(i).getCollectionTitle());
-                PoCollection poTetherandcollection1 = new PoCollection();
-                poTetherandcollection1.setCollectionTitle(tetherVo.getPoTetherandcollections().get(i).getCollectionTitle());
-                poTetherandcollection1.setCollectionType(tetherVo.getPoTetherandcollections().get(i).getCollectionType());
-                poTetherandcollection1.setTetherId(tetherVo.getTetherId());
-                poCollectionService.insertCollection(poTetherandcollection1);
+                PoCollection poCollection = new PoCollection();
+                poCollection.setCollectionTitle(tetherVo.getPoTetherandcollections().get(i).getCollectionTitle());
+                poCollection.setCollectionType(tetherVo.getPoTetherandcollections().get(i).getCollectionType());
+                poCollection.setTetherId(tetherVo.getTetherId());
+                poCollectionService.insertCollection(poCollection);
             }
         }
     }

+ 1 - 1
ruoyi-system/src/main/resources/mapper/system/PoCollectionMapper.xml

@@ -64,7 +64,7 @@
         </where>
     </select>
 
-    <insert id="insertPoCollection" parameterType="PoCollection">
+    <insert id="insertPoCollection" parameterType="PoCollection" useGeneratedKeys="true" keyProperty="collectionId">
         insert into po_collection (
         <if test="collectionTitle != null and collectionTitle != '' ">collection_title,</if>
         <if test="collectionType != null and collectionType != '' ">collection_type,</if>