refactor project

This commit is contained in:
Cauchy
2023-10-19 15:04:31 +08:00
parent 19a2ef58a9
commit 1994ba60ae
35 changed files with 274 additions and 226 deletions

View File

@@ -93,7 +93,7 @@ public class BookController {
wrapper.eq(ShopProductToLabelEntity::getDelFlag,0);
List<Integer> pIds = shopProductToLabelService.getBaseMapper().selectList(wrapper).stream().map(ShopProductToLabelEntity::getProductId).collect(Collectors.toList());
List<ShopProductEntity> shopProductEntities = shopProductService.getBaseMapper().selectList(new LambdaQueryWrapper<ShopProductEntity>().in(ShopProductEntity::getProductId, pIds));
List<ShopProduct> shopProductEntities = shopProductService.getBaseMapper().selectList(new LambdaQueryWrapper<ShopProduct>().in(ShopProduct::getProductId, pIds));
return R.ok().put("Products",shopProductEntities);
}
@@ -177,10 +177,10 @@ public class BookController {
String publisherId = book.getPublisherId();
String[] publisherIds = publisherId.split(",");
List<String> publisherList = Arrays.asList(publisherIds);
List<PublisherEntity> publisherEntities = publisherService.getBaseMapper().selectList(new QueryWrapper<PublisherEntity>().in("id", publisherList));
List<Publisher> publisherEntities = publisherService.getBaseMapper().selectList(new QueryWrapper<Publisher>().in("id", publisherList));
for (PublisherEntity publisherEntity : publisherEntities) {
publisherName += "," + publisherEntity.getPublisherName();
for (Publisher publisher : publisherEntities) {
publisherName += "," + publisher.getPublisherName();
}
publisherName = publisherName.startsWith(",") ? publisherName.substring(1) : publisherName;
@@ -553,10 +553,10 @@ public class BookController {
String publisherId = book.getPublisherId();
String[] publisherIds = publisherId.split(",");
List<String> publisherList = Arrays.asList(publisherIds);
List<PublisherEntity> publisherEntities = publisherService.getBaseMapper().selectList(new QueryWrapper<PublisherEntity>().in("id", publisherList));
List<Publisher> publisherEntities = publisherService.getBaseMapper().selectList(new QueryWrapper<Publisher>().in("id", publisherList));
for (PublisherEntity publisherEntity : publisherEntities) {
publisherName += "," + publisherEntity.getPublisherName();
for (Publisher publisher : publisherEntities) {
publisherName += "," + publisher.getPublisherName();
}
publisherName = publisherName.startsWith(",") ? publisherName.substring(1) : publisherName;
@@ -594,10 +594,10 @@ public class BookController {
String publisherId = book.getPublisherId();
String[] publisherIds = publisherId.split(",");
List<String> publisherList = Arrays.asList(publisherIds);
List<PublisherEntity> publisherEntities = publisherService.getBaseMapper().selectList(new QueryWrapper<PublisherEntity>().in("id", publisherList));
List<Publisher> publisherEntities = publisherService.getBaseMapper().selectList(new QueryWrapper<Publisher>().in("id", publisherList));
for (PublisherEntity publisherEntity : publisherEntities) {
publisherName += "," + publisherEntity.getPublisherName();
for (Publisher publisher : publisherEntities) {
publisherName += "," + publisher.getPublisherName();
}
publisherName = publisherName.startsWith(",") ? publisherName.substring(1) : publisherName;
@@ -634,10 +634,10 @@ public class BookController {
String publisherId = book.getPublisherId();
String[] publisherIds = publisherId.split(",");
List<String> publisherList = Arrays.asList(publisherIds);
List<PublisherEntity> publisherEntities = publisherService.getBaseMapper().selectList(new QueryWrapper<PublisherEntity>().in("id", publisherList));
List<Publisher> publisherEntities = publisherService.getBaseMapper().selectList(new QueryWrapper<Publisher>().in("id", publisherList));
for (PublisherEntity publisherEntity : publisherEntities) {
publisherName += "," + publisherEntity.getPublisherName();
for (Publisher publisher : publisherEntities) {
publisherName += "," + publisher.getPublisherName();
}
publisherName = publisherName.startsWith(",") ? publisherName.substring(1) : publisherName;