ZeroLiYi 2 роки тому
батько
коміт
85d8c531b7

+ 5 - 3
src/main/java/com/unis/vis/controller/VisController.java

@@ -81,9 +81,10 @@ public class VisController {
81 81
     }
82 82
 
83 83
     /*物资调用情况*/
84
+    /*调用:1 调出:2*/
84 85
     @GetMapping("/getMaterialCallSituation")
85 86
     public List<OutboundMaterialInfo> getMaterialCallSituation(@RequestParam("type") String type,
86
-                                                               @RequestParam("action")String action) {
87
+                                                               @RequestParam("action")Integer action) {
87 88
 
88 89
         List<OutboundMaterialInfo> list = outboundMaterialInfoService.getMaterialCallSituation(type,action);
89 90
         return list;
@@ -107,8 +108,9 @@ public class VisController {
107 108
      * @return
108 109
      */
109 110
     @GetMapping("/entry_exit_records")
110
-    public List<OutAndInboundRecord> getEnterExitRecords(@RequestParam(value = "type", required = false) Integer type){
111
-        return inboundMaterialInfoService.getEnterExitRecords(type);
111
+    public List<OutAndInboundRecord> getEnterExitRecords(@RequestParam(value = "type", required = false) Integer type,
112
+                                                         @RequestParam(value = "name", required = false) String name){
113
+        return inboundMaterialInfoService.getEnterExitRecords(type,name);
112 114
     }
113 115
 
114 116
     /*损耗记录*/

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

@@ -28,7 +28,7 @@ public interface InboundMaterialInfoMapper extends BaseMapper<InboundMaterialInf
28 28
       * 出入库记录
29 29
       * @return
30 30
       */
31
-     List<OutAndInboundRecord> getEnterExitRecords(@Param("type") Integer type);
31
+     List<OutAndInboundRecord> getEnterExitRecords(@Param("type") Integer type,@Param("name")String name);
32 32
 
33 33
 
34 34
 }

+ 4 - 1
src/main/java/com/unis/vis/mapper/OutboundMaterialInfoMapper.java

@@ -2,6 +2,7 @@ package com.unis.vis.mapper;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import com.unis.vis.model.OutboundMaterialInfo;
5
+import org.apache.ibatis.annotations.Param;
5 6
 import org.springframework.stereotype.Repository;
6 7
 
7 8
 import java.util.List;
@@ -10,7 +11,9 @@ import java.util.List;
10 11
 @Repository
11 12
 public interface OutboundMaterialInfoMapper extends BaseMapper<OutboundMaterialInfo> {
12 13
 
13
-    List<OutboundMaterialInfo> getMaterialCallSituation(String type,String action);
14
+    List<OutboundMaterialInfo> getMaterialCallSituationDY(@Param("type") String type);
15
+
16
+    List<OutboundMaterialInfo> getMaterialCallSituationDC(@Param("type") String type);
14 17
 
15 18
     List<OutboundMaterialInfo> getInventoryDispatchStatus();
16 19
 

+ 2 - 0
src/main/java/com/unis/vis/model/OutAndInboundRecord.java

@@ -40,4 +40,6 @@ public class OutAndInboundRecord {
40 40
      * 出入库日期
41 41
      */
42 42
     private String boundTime;
43
+
44
+    private Integer parentID;
43 45
 }

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

@@ -20,6 +20,6 @@ public interface InboundMaterialInfoService extends IService<InboundMaterialInfo
20 20
 
21 21
     HashMap<String, List<InboundMaterialInfo>> getWzsyqkpm();
22 22
 
23
-    List<OutAndInboundRecord> getEnterExitRecords(Integer type);
23
+    List<OutAndInboundRecord> getEnterExitRecords(Integer type,String name);
24 24
     Map<String,List<MaterialReserveSituationVO>> selectWarehouseForMaterialType(String warehouse);
25 25
 }

+ 1 - 1
src/main/java/com/unis/vis/service/OutboundMaterialInfoService.java

@@ -9,7 +9,7 @@ import java.util.List;
9 9
 public interface OutboundMaterialInfoService extends IService<OutboundMaterialInfo> {
10 10
 
11 11
 
12
-    List<OutboundMaterialInfo>  getMaterialCallSituation(String type,String action);
12
+    List<OutboundMaterialInfo>  getMaterialCallSituation(String type,Integer action);
13 13
 
14 14
     List<OutboundMaterialInfo> getLossRecord();
15 15
 

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

@@ -74,8 +74,8 @@ public class InboundMaterialInfoServiceImpl extends ServiceImpl<InboundMaterialI
74 74
      * @return
75 75
      */
76 76
     @Override
77
-    public List<OutAndInboundRecord> getEnterExitRecords(Integer type) {
78
-        return inboundMaterialInfoMapper.getEnterExitRecords(type);
77
+    public List<OutAndInboundRecord> getEnterExitRecords(Integer type,String name) {
78
+        return inboundMaterialInfoMapper.getEnterExitRecords(type,name);
79 79
     }
80 80
 
81 81
 }

+ 7 - 2
src/main/java/com/unis/vis/service/impl/OutboundMaterialInfoServiceImpl.java

@@ -17,9 +17,14 @@ public class OutboundMaterialInfoServiceImpl extends ServiceImpl<OutboundMateria
17 17
     private OutboundMaterialInfoMapper outboundMaterialInfoMapper;
18 18
 
19 19
     @Override
20
-    public List<OutboundMaterialInfo> getMaterialCallSituation(String type,String action) {
20
+    public List<OutboundMaterialInfo> getMaterialCallSituation(String type,Integer action) {
21
+        /*调用:1 调出:2*/
22
+        if(action==1){
23
+            return outboundMaterialInfoMapper.getMaterialCallSituationDY(type);
24
+        }
25
+            return outboundMaterialInfoMapper.getMaterialCallSituationDC(type);
26
+
21 27
 
22
-        return outboundMaterialInfoMapper.getMaterialCallSituation(type,action);
23 28
     }
24 29
 
25 30
     @Override

+ 9 - 6
src/main/resources/mapper/vis/InboundMaterialInfoMapper.xml

@@ -45,18 +45,20 @@
45 45
         GROUP BY std.NAME_
46 46
     </select>
47 47
     <!-- 出入库记录 -->
48
-    <select id="getEnterExitRecords" parameterType="integer" resultType="com.unis.vis.model.OutAndInboundRecord">
48
+    <select id="getEnterExitRecords"  resultType="com.unis.vis.model.OutAndInboundRecord">
49 49
         SELECT record.type,
50 50
         record.shengName,
51 51
         record.material_name as materialName,
52 52
         record.quantity,
53 53
         record.specs,
54
-        record.bound_time as boundTime
54
+        record.bound_time as boundTime,
55
+        record.PARENT_ID as parentID
55 56
         FROM (
56 57
         SELECT
57 58
         1 AS type,
58 59
         null as shengName,
59 60
         std.NAME_ as material_name,
61
+        std.PARENT_ID as PARENT_ID,
60 62
         ruku.quantity,
61 63
         ruku.specs,
62 64
         ruku.inbound_time AS bound_time
@@ -69,8 +71,8 @@
69 71
         AND ruku.is_available = 0
70 72
         <!-- 审核通过的 -->
71 73
         AND flow."status" = 5
72
-        <if test="type != null">
73
-            AND ii.name = #{name}
74
+        <if test="name != null">
75
+            AND ii.warehouse = #{name}
74 76
         </if>
75 77
         UNION ALL
76 78
 
@@ -80,12 +82,13 @@
80 82
         std.NAME_ as material_name,
81 83
         chuku.quantity,
82 84
         chuku.specs,
85
+        std.PARENT_ID as PARENT_ID,
83 86
         chuku.outbound_time AS bound_time
84 87
         FROM "outbound_status" flow
85 88
         LEFT JOIN "outbound_material_info" chuku ON chuku."outbound_id" = flow."outbound_id"
86 89
         LEFT JOIN SYS_DICT_ITEM dict ON dict.ITEM_VALUE  = chuku."province"
87 90
         LEFT JOIN SYS_TREE_DICT std ON std.id = chuku.material_name
88
-        LEFT JOIN inbound_info ii ON ii.outbound_id = chuku.outbound_id
91
+        LEFT JOIN outbound_info ii ON ii.outbound_id = chuku.outbound_id
89 92
         WHERE
90 93
         flow.is_invalid = 0
91 94
         AND chuku.is_available = 0
@@ -93,7 +96,7 @@
93 96
         AND flow."status" = 5
94 97
         AND dict.DICT_TYPE = 'province_ch'
95 98
         <if test="name != null">
96
-            AND ii.name = #{name}
99
+            AND ii.warehouse = #{name}
97 100
         </if>
98 101
         ) record
99 102
         <where>

+ 45 - 1
src/main/resources/mapper/vis/OutboundMaterialInfoMapper.xml

@@ -13,7 +13,7 @@
13 13
         GROUP BY dic.NAME_
14 14
     </select>-->
15 15
     <!-- 物资调用情况 -->
16
-    <select id="getMaterialCallSituation" resultType="com.unis.vis.model.OutboundMaterialInfo">
16
+    <select id="getMaterialCallSituationDY" resultType="com.unis.vis.model.OutboundMaterialInfo">
17 17
         SELECT dic.NAME_ as material_type,
18 18
                SUM(CASE WHEN iif.is_available = 0 THEN iif.quantity ELSE 0 END) AS yes_quantity,
19 19
                SUM(CASE WHEN iif.is_available = 1 THEN iif.quantity ELSE 0 END) AS no_quantity
@@ -48,10 +48,54 @@
48 48
         <if test="type == 12">
49 49
             AND iif.material_type = 12
50 50
         </if>
51
+        GROUP BY dic.NAME_
51 52
 
53
+    </select>
54
+    <!-- 物资调用情况 -->
55
+    <select id="getMaterialCallSituationDC" resultType="com.unis.vis.model.OutboundMaterialInfo">
56
+        SELECT --dic.NAME_ as material_type,
57
+        iif.province,b.warehouse,sum(total_price)as total_price,
58
+        SUM(CASE WHEN iif.is_available = 0 THEN iif.quantity ELSE 0 END) AS quantity
59
+        -- SUM(CASE WHEN iif.is_available = 1 THEN iif.quantity ELSE 0 END) AS no_quantity
60
+        from outbound_material_info iif
61
+        left JOIN SYS_TREE_DICT dic on iif.material_type=DIC.ID
62
+        left join outbound_info b ON iif."outbound_id"=B."outbound_id"
63
+        left JOIN SYS_DICT_ITEM c on iif."province"=c.ITEM_VALUE
64
+        where b."status"=5 and C.dict_type='province_ch'
65
+        GROUP BY b.warehouse
66
+        <if test="type == 4">
67
+            AND iif.material_type = 4
68
+        </if>
69
+        <if test="type == 5">
70
+            AND iif.material_type = 5
71
+        </if>
72
+        <if test="type == 6">
73
+            AND iif.material_type = 6
74
+        </if>
75
+        <if test="type == 7">
76
+            AND iif.material_type = 7
77
+        </if>
78
+        <if test="type == 8">
79
+            AND iif.material_type = 8
80
+        </if>
81
+        <if test="type == 9">
82
+            AND iif.material_type = 9
83
+        </if>
84
+        <if test="type == 10">
85
+            AND iif.material_type = 10
86
+        </if>
87
+        <if test="type == 11">
88
+            AND iif.material_type = 11
89
+        </if>
90
+        <if test="type == 12">
91
+            AND iif.material_type = 12
92
+        </if>
52 93
         GROUP BY dic.NAME_
53 94
 
54 95
     </select>
96
+
97
+
98
+
55 99
     <!-- 物资出库情况 -->
56 100
     <select id="getInventoryDispatchStatus" resultType="com.unis.vis.model.OutboundMaterialInfo">
57 101
         SELECT std.NAME_            as material_type,