|
|
@@ -40,10 +40,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Optional;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/*
|
|
|
@@ -275,7 +272,7 @@ public class DistributePopularizeController {
|
|
|
*/
|
|
|
@GetMapping("/get/general/distribute/detail")
|
|
|
public Result<DistributePopularizeView> getGeneralDistributeDetail() {
|
|
|
- List<GoodsDon> goodsDons = goodsDonMapper.selectList(Wrappers.lambdaQuery(GoodsDon.class).eq(GoodsDon::getDeleted, true).orderByAsc(GoodsDon::getRate).select(GoodsDon::getRate, GoodsDon::getTitle));
|
|
|
+ List<GoodsDon> goodsDons = goodsDonMapper.selectList(Wrappers.lambdaQuery(GoodsDon.class).eq(GoodsDon::getDeleted, true).eq(GoodsDon::getStatus, true).eq(GoodsDon::getType, 1).orderByAsc(GoodsDon::getRate).select(GoodsDon::getRate, GoodsDon::getTitle));
|
|
|
if (goodsDons.isEmpty()) {
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
@@ -291,6 +288,7 @@ public class DistributePopularizeController {
|
|
|
rateView.setGoodsInfo(goodsInfo);
|
|
|
generalDistributes.add(rateView);
|
|
|
});
|
|
|
+ generalDistributes.sort(Comparator.comparing(DistributeGoodsGeneralRateView::getRate).reversed());
|
|
|
distributePopularizeView.setGeneralDistributes(generalDistributes);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(distributePopularizeView);
|
|
|
}
|