|
@@ -155,12 +155,11 @@ public class PoTetherServiceImpl extends ServiceImpl<PoTetherMapper,PoTether> im
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional
|
|
|
- public void insertPoTetherWithCollection(TetherVo tetherVo) {
|
|
|
+ public void insertPoTetherWithCollection(TetherVo tetherVo,PoTetherandcollection poTetherandcollection) {
|
|
|
//保存套系的基本数据到套系表tether
|
|
|
this.poTetherMapper.insertPoTether(tetherVo);
|
|
|
//套系包含藏品
|
|
|
//保存藏品数据到中间表 批量增加
|
|
|
-
|
|
|
System.out.println(tetherVo.getPoTetherandcollections().size());
|
|
|
for (int i = 0 ; i < tetherVo.getPoTetherandcollections().size();i++) {
|
|
|
System.out.println(tetherVo.getPoTetherandcollections().get(i).getCollectionTitle());
|
|
@@ -198,16 +197,20 @@ public class PoTetherServiceImpl extends ServiceImpl<PoTetherMapper,PoTether> im
|
|
|
//更新po_tether表基本信息
|
|
|
this.poTetherMapper.updatePoTether(tetherVo);
|
|
|
//清理po_collection表数据
|
|
|
-// LambdaQueryWrapper<PoTetherandcollection> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
-// lambdaQueryWrapper.eq(PoTetherandcollection::getTetherId,tetherVo.getTetherId());
|
|
|
-// poTetherandcollectionService.remove(lambdaQueryWrapper);
|
|
|
+ LambdaQueryWrapper<PoTetherandcollection> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ lambdaQueryWrapper.eq(PoTetherandcollection::getTetherId,tetherVo.getTetherId());
|
|
|
+ poTetherandcollectionService.remove(lambdaQueryWrapper);
|
|
|
// //添加当前提交过来的藏品数据--po_Tetherandcollection表的insert操作
|
|
|
-// List<PoTetherandcollection> poTetherandcollections = tetherVo.getPoTetherandcollections();
|
|
|
-// List<PoTetherandcollection> collect = poTetherandcollections.stream().map((item) -> {
|
|
|
-// item.setTetherId(tetherVo.getTetherId());
|
|
|
-// return item;
|
|
|
-// }).collect(Collectors.toList());
|
|
|
-// poTetherandcollectionService.saveBatch(collect);
|
|
|
+ for (int i = 0 ; i < tetherVo.getPoTetherandcollections().size();i++) {
|
|
|
+
|
|
|
+ System.out.println(tetherVo.getPoTetherandcollections().get(i).getCollectionTitle());
|
|
|
+ PoTetherandcollection poTetherandcollection1 = new PoTetherandcollection();
|
|
|
+ poTetherandcollection1.setCollectionTitle(tetherVo.getPoTetherandcollections().get(i).getCollectionTitle());
|
|
|
+ poTetherandcollection1.setCollectionType(tetherVo.getPoTetherandcollections().get(i).getCollectionType());
|
|
|
+ poTetherandcollection1.setTetherId(tetherVo.getTetherId());
|
|
|
+ poTetherandcollectionService.insertPoTetherandcollection(poTetherandcollection1);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|