Fixing .gitignore

This commit is contained in:
yc13649764453
2023-09-19 17:53:38 +08:00
parent 386e8011f1
commit 649cbc04a8
14 changed files with 57 additions and 8946 deletions

View File

@@ -334,6 +334,7 @@ public class ShopProductController {
public R update(@RequestBody ShopProductEntity shopProduct) {
Integer productId = shopProduct.getProductId();
List<Object> list = new ArrayList<>();
//多个图书id
ArrayList<String> bookId = shopProduct.getBookids();
shopProduct.setCreateTime(new Date());
@@ -348,32 +349,74 @@ public class ShopProductController {
} else {
shopProduct.setBookId("");
}
//查询proudict中不包含传过来的bookid
List<ShopProudictBookEntity> bookEntityList = shopProudictBookService.getBaseMapper().selectList(new QueryWrapper<ShopProudictBookEntity>()
.eq("proudict_id", productId)
.notIn("book_id", bookId)
);
List<ShopProudictBookEntity> bookyList = shopProudictBookService.getBaseMapper().selectList(new QueryWrapper<ShopProudictBookEntity>()
.eq("proudict_id", productId));
for (ShopProudictBookEntity shopProudictBookEntity : bookyList) {
Integer bookId1 = shopProudictBookEntity.getBookId();
list.add(bookId1);
}
List<String> filteredBookIds = new ArrayList<>();
for ( String s : bookId) {
if (!list.contains(s)) {
filteredBookIds.add(s);
}
}
if (bookyList.size() > bookId.size()) {
if ( bookId.size()==0){
List<ShopProudictBookEntity> bookEntityList = shopProudictBookService.getBaseMapper().selectList(new QueryWrapper<ShopProudictBookEntity>()
.eq("proudict_id", productId));
for (ShopProudictBookEntity shopProductBook :bookEntityList) {
Integer id = shopProductBook.getId();
shopProudictBookService.removeById(id);
}
System.out.println("bookEntityList==========" + bookEntityList);
}else {
List<ShopProudictBookEntity> bookEntityList = shopProudictBookService.getBaseMapper().selectList(new QueryWrapper<ShopProudictBookEntity>()
.eq("proudict_id", productId)
.notIn("book_id", bookId)
);
for (ShopProudictBookEntity shopProudictBookEntity : bookEntityList) {
Integer id = shopProudictBookEntity.getId();
shopProudictBookService.removeById(id);
}
for (ShopProudictBookEntity shopProudictBookEntity : bookEntityList) {
Integer id = shopProudictBookEntity.getId();
shopProudictBookService.removeById(id);
}
} else if (bookyList.size() < bookId.size()) {
ShopProudictBookEntity shopProudictBookEntity = new ShopProudictBookEntity();
for (String s : filteredBookIds) {
String bookidlist = s;
Integer proudict = shopProduct.getProductId();
shopProudictBookEntity.setProudictId(proudict);
shopProudictBookEntity.setBookId(Integer.valueOf(bookidlist));
shopProudictBookService.save(shopProudictBookEntity);
}
//查询proudict中不包含传过来的bookid
}
shopProductService.updateById(shopProduct);
return R.ok();
}
/**
* 删除
*/