|
@@ -8,7 +8,10 @@ import com.unis.vis.service.InboundMaterialInfoService;
|
8
|
8
|
import org.springframework.stereotype.Service;
|
9
|
9
|
|
10
|
10
|
import javax.annotation.Resource;
|
|
11
|
+import java.util.Comparator;
|
|
12
|
+import java.util.HashMap;
|
11
|
13
|
import java.util.List;
|
|
14
|
+import java.util.stream.Collectors;
|
12
|
15
|
|
13
|
16
|
@Service
|
14
|
17
|
public class InboundMaterialInfoServiceImpl extends ServiceImpl<InboundMaterialInfoMapper, InboundMaterialInfo> implements InboundMaterialInfoService {
|
|
@@ -27,6 +30,26 @@ public class InboundMaterialInfoServiceImpl extends ServiceImpl<InboundMaterialI
|
27
|
30
|
return inboundMaterialInfoMapper.getMaterialSituation();
|
28
|
31
|
}
|
29
|
32
|
|
|
33
|
+ @Override
|
|
34
|
+ public HashMap<String, List<InboundMaterialInfo>> getWzsyqkpm() {
|
|
35
|
+ HashMap<String, List<InboundMaterialInfo>> wzsyqkpmMap = new HashMap<>();
|
|
36
|
+ List<InboundMaterialInfo> wzsyqkpm = inboundMaterialInfoMapper.getWzsyqkpm();
|
|
37
|
+ //按数量排序
|
|
38
|
+ List<InboundMaterialInfo> quantityList = wzsyqkpm.stream()
|
|
39
|
+ .sorted(Comparator.comparing(InboundMaterialInfo::getQuantity).reversed())
|
|
40
|
+ .collect(Collectors.toList());
|
|
41
|
+
|
|
42
|
+ wzsyqkpmMap.put("quantitySort",quantityList);
|
|
43
|
+ //按价值排序
|
|
44
|
+ List<InboundMaterialInfo> collect = wzsyqkpm.stream()
|
|
45
|
+ .sorted(Comparator.comparing(InboundMaterialInfo::getTotalPrice).reversed())
|
|
46
|
+ .collect(Collectors.toList());
|
|
47
|
+
|
|
48
|
+ wzsyqkpmMap.put("TotalPriceSort",collect);
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+ return wzsyqkpmMap;
|
|
52
|
+ }
|
30
|
53
|
|
31
|
54
|
|
32
|
55
|
}
|