浏览代码

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/com/unis/vis/mapper/InboundMaterialInfoMapper.java
#	src/main/java/com/unis/vis/service/InboundMaterialInfoService.java
#	src/main/java/com/unis/vis/service/impl/InboundMaterialInfoServiceImpl.java
#	src/main/resources/mapper/vis/InboundMaterialInfoMapper.xml
hasan3hasan3 2 年之前
父节点
当前提交
da0fb0155a

+ 34 - 0
src/main/java/com/unis/vis/controller/InboundMaterialInfoController.java

@@ -0,0 +1,34 @@
1
+package com.unis.vis.controller;
2
+
3
+import com.unis.vis.model.InboundMaterialInfo;
4
+import com.unis.vis.service.InboundMaterialInfoService;
5
+import org.springframework.web.bind.annotation.GetMapping;
6
+import org.springframework.web.bind.annotation.RequestMapping;
7
+import org.springframework.web.bind.annotation.RestController;
8
+
9
+import javax.annotation.Resource;
10
+import java.util.HashMap;
11
+import java.util.List;
12
+
13
+/**
14
+ * ClassName: InboundMaterialInfoController
15
+ * Package: com.unis.vis.controller
16
+ * Description:
17
+ *
18
+ * @Author zlq
19
+ * @Create 2024/3/5 11:06
20
+ * @Version 1.0
21
+ */
22
+@RestController
23
+@RequestMapping("/Material")
24
+public class InboundMaterialInfoController {
25
+    @Resource
26
+    private InboundMaterialInfoService inboundMaterialInfoService;
27
+
28
+    /*应用物资大类*/
29
+    @GetMapping("/getWzsyqkpm")
30
+    public HashMap<String, List<InboundMaterialInfo>> getEmergencySuppliesCategory() {
31
+        HashMap<String, List<InboundMaterialInfo>> wzsyqkpmMap = inboundMaterialInfoService.getWzsyqkpm();
32
+        return wzsyqkpmMap;
33
+    }
34
+}

+ 0 - 6
src/main/java/com/unis/vis/mapper/InboundMaterialInfoMapper.java

@@ -13,10 +13,4 @@ public interface InboundMaterialInfoMapper extends BaseMapper<InboundMaterialInf
13 13
      List<InboundMaterialInfo> getEmergencySuppliesCategory();
14 14
 
15 15
      List<InboundMaterialInfo> getMaterialSituation();
16
-
17
-     /**
18
-      * 入库
19
-      * @return
20
-      */
21
-     List<InboundMaterialInfo> getInventoryReceiptStatus();
22 16
 }

+ 0 - 5
src/main/java/com/unis/vis/service/InboundMaterialInfoService.java

@@ -12,10 +12,5 @@ public interface InboundMaterialInfoService extends IService<InboundMaterialInfo
12 12
 
13 13
     List<InboundMaterialInfo> getMaterialSituation();
14 14
 
15
-    /**
16
-     * 物资入库情况
17
-     * @return
18
-     */
19
-    List<InboundMaterialInfo> getInventoryReceiptStatus();
20 15
 
21 16
 }

+ 23 - 0
src/main/java/com/unis/vis/service/impl/InboundMaterialInfoServiceImpl.java

@@ -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 {
@@ -31,6 +34,26 @@ public class InboundMaterialInfoServiceImpl extends ServiceImpl<InboundMaterialI
31 34
     public List<InboundMaterialInfo> getInventoryReceiptStatus() {
32 35
         return inboundMaterialInfoMapper.getInventoryReceiptStatus();
33 36
     }
37
+    @Override
38
+    public HashMap<String, List<InboundMaterialInfo>> getWzsyqkpm() {
39
+        HashMap<String, List<InboundMaterialInfo>> wzsyqkpmMap = new HashMap<>();
40
+        List<InboundMaterialInfo> wzsyqkpm = inboundMaterialInfoMapper.getWzsyqkpm();
41
+        //按数量排序
42
+        List<InboundMaterialInfo> quantityList = wzsyqkpm.stream()
43
+                .sorted(Comparator.comparing(InboundMaterialInfo::getQuantity).reversed())
44
+                .collect(Collectors.toList());
45
+
46
+        wzsyqkpmMap.put("quantitySort",quantityList);
47
+        //按价值排序
48
+        List<InboundMaterialInfo> collect = wzsyqkpm.stream()
49
+                .sorted(Comparator.comparing(InboundMaterialInfo::getTotalPrice).reversed())
50
+                .collect(Collectors.toList());
51
+
52
+        wzsyqkpmMap.put("TotalPriceSort",collect);
53
+
54
+
55
+        return wzsyqkpmMap;
56
+    }
34 57
 
35 58
 
36 59
 }

+ 0 - 14
src/main/resources/mapper/vis/InboundMaterialInfoMapper.xml

@@ -23,19 +23,5 @@
23 23
         where b."status"=5
24 24
         GROUP BY dic.NAME_
25 25
     </select>
26
-    <!-- 物资入库情况 -->
27
-    <select id="getInventoryReceiptStatus" resultType="com.unis.vis.model.InboundMaterialInfo">
28
-        SELECT std.NAME_            as material_type,
29
-               SUM(imi.quantity)    as quantity,
30
-               SUM(imi.total_price) as total_price
31
-        FROM "inbound_material_info" imi
32
-                 LEFT JOIN "inbound_info" ii ON imi."inbound_id" = ii."inbound_id"
33
-                 LEFT JOIN "SYS_TREE_DICT" std ON std."id" = ii."material_type"
34
-        WHERE ii."status" = 5
35
-          AND ii."is_available" = 0
36
-          AND ii."material_type" in (SELECT id FROM SYS_TREE_DICT std WHERE std.DIFFERENCE_ = 2)
37
-        GROUP BY std.NAME_
38
-    </select>
39
-
40 26
 
41 27
 </mapper>