|
@@ -9,6 +9,7 @@ import com.izouma.nineth.exception.BusinessException;
|
|
|
import com.izouma.nineth.repo.CollectionPrivilegeRepo;
|
|
import com.izouma.nineth.repo.CollectionPrivilegeRepo;
|
|
|
import com.izouma.nineth.repo.CollectionRepo;
|
|
import com.izouma.nineth.repo.CollectionRepo;
|
|
|
import com.izouma.nineth.repo.NewsRepo;
|
|
import com.izouma.nineth.repo.NewsRepo;
|
|
|
|
|
+import com.izouma.nineth.service.AssetService;
|
|
|
import com.izouma.nineth.service.CacheService;
|
|
import com.izouma.nineth.service.CacheService;
|
|
|
import com.izouma.nineth.service.CollectionService;
|
|
import com.izouma.nineth.service.CollectionService;
|
|
|
import com.izouma.nineth.service.LikeService;
|
|
import com.izouma.nineth.service.LikeService;
|
|
@@ -26,6 +27,7 @@ import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
+import javax.naming.Name;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
@@ -124,7 +126,8 @@ public class CollectionController extends BaseController {
|
|
|
@GetMapping("/myLikes")
|
|
@GetMapping("/myLikes")
|
|
|
@ApiOperation("我收藏的")
|
|
@ApiOperation("我收藏的")
|
|
|
public List<CollectionDTO> myLikes(@RequestParam(defaultValue = "1") Long companyId) {
|
|
public List<CollectionDTO> myLikes(@RequestParam(defaultValue = "1") Long companyId) {
|
|
|
- return collectionService.toDTO(collectionRepo.userLikes(SecurityUtils.getAuthenticatedUser().getId(), companyId));
|
|
|
|
|
|
|
+ return collectionService
|
|
|
|
|
+ .toDTO(collectionRepo.userLikes(SecurityUtils.getAuthenticatedUser().getId(), companyId));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PreAuthorize("hasAnyRole('ADMIN','SAAS')")
|
|
@PreAuthorize("hasAnyRole('ADMIN','SAAS')")
|
|
@@ -232,10 +235,15 @@ public class CollectionController extends BaseController {
|
|
|
pageQuery.getQuery().remove("salable");
|
|
pageQuery.getQuery().remove("salable");
|
|
|
pageQuery.getQuery().put("inPaying", true);
|
|
pageQuery.getQuery().put("inPaying", true);
|
|
|
long transactingNum = collectionService.all(pageQuery).getTotal();
|
|
long transactingNum = collectionService.all(pageQuery).getTotal();
|
|
|
|
|
+ Long destroyedAssets = collectionService.countDestroyAssets(search);
|
|
|
|
|
+ Long total = collectionRepo.sumAllByNameLike(search);
|
|
|
|
|
+ Long tranferCount = total - destroyedAssets;
|
|
|
Map<String, String> map = new HashMap<>();
|
|
Map<String, String> map = new HashMap<>();
|
|
|
map.put("onlyShowNum", String.valueOf(onlyShowNum));
|
|
map.put("onlyShowNum", String.valueOf(onlyShowNum));
|
|
|
map.put("consignmentNum", String.valueOf(consignmentNum));
|
|
map.put("consignmentNum", String.valueOf(consignmentNum));
|
|
|
map.put("transactingNum", String.valueOf(transactingNum));
|
|
map.put("transactingNum", String.valueOf(transactingNum));
|
|
|
|
|
+ map.put("totalNum", String.valueOf(total));
|
|
|
|
|
+ map.put("tranferingNum", String.valueOf(tranferCount));
|
|
|
return map;
|
|
return map;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|