Explorar o código

添加出入库归档查询接口

lvzhikai %!s(int64=5) %!d(string=hai) anos
pai
achega
9f78849f0d

+ 24 - 0
src/main/java/com/chinaitop/depot/agent/archive/controller/ArchiveController.java

@@ -11,6 +11,7 @@ import io.swagger.annotations.Api;
11 11
 import io.swagger.annotations.ApiImplicitParam;
12 12
 import io.swagger.annotations.ApiImplicitParams;
13 13
 import io.swagger.annotations.ApiOperation;
14
+import org.apache.commons.lang.StringUtils;
14 15
 import org.springframework.http.MediaType;
15 16
 import org.springframework.web.bind.annotation.RequestMapping;
16 17
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -20,6 +21,7 @@ import com.chinaitop.utils.ParameterUtil;
20 21
 import com.github.pagehelper.PageHelper;
21 22
 
22 23
 import java.util.*;
24
+import java.util.concurrent.Future;
23 25
 
24 26
 @RestController
25 27
 @RequestMapping(value = "/archive")
@@ -230,4 +232,26 @@ public class ArchiveController {
230 232
         map = archiveService.getArchiveDataList(orgId);
231 233
         return map;
232 234
     }
235
+
236
+    @RequestMapping(value = "/getCRKArchiveList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
237
+    @ApiOperation(value="出入库用归档接口(统一对外接口)", notes = "出入库用归档接口(统一对外接口)")
238
+    @ApiImplicitParams({
239
+            @ApiImplicitParam(name = "orgId", value = "单位ID", paramType = "query")
240
+    })
241
+    public Map<String,Object> getCRKArchiveList(String orgId) throws Exception {
242
+        Map<String,Object> map = new HashMap<String, Object>();
243
+        try {
244
+            //执行任务
245
+            List<Map<String, Object>> archiveList = archiveService.getCRKArchiveList(orgId);
246
+            map.put("success",true);
247
+            map.put("msg","查询成功!");
248
+            map.put("rows",archiveList);
249
+            map.put("totalCount",archiveList.size());
250
+        } catch (Exception e) {
251
+            map.put("success",false);
252
+            map.put("msg","查询失败!");
253
+            return map;
254
+        }
255
+        return map;
256
+    }
233 257
 }

+ 1 - 0
src/main/java/com/chinaitop/depot/agent/archive/mapper/StorageArchiveMapper.java

@@ -39,4 +39,5 @@ public interface StorageArchiveMapper {
39 39
     List<StorageArchive> getArchiveApprovalList(Map<String,Object> map);
40 40
 
41 41
     List<Map<String,Object>> getArchiveDataList(Map<String,Object> map);
42
+    List<Map<String,Object>> getCRKArchiveList(Map<String,Object> map);
42 43
 }

+ 21 - 0
src/main/java/com/chinaitop/depot/agent/archive/mapper/StorageArchiveMapper.xml

@@ -424,4 +424,25 @@
424 424
     WHERE
425 425
         rn = 1
426 426
   </select>
427
+
428
+  <select id="getCRKArchiveList" resultType="java.util.Map" parameterType="java.util.Map">
429
+    SELECT
430
+        *
431
+    FROM
432
+        (
433
+            SELECT
434
+                ROW_NUMBER() OVER(PARTITION BY archive.storehouse_id ORDER BY archive.create_time DESC) rn,
435
+                to_char(archive.create_time, 'yyyy-mm-dd') AS archived_day,
436
+                house.storehouse_name AS store_name,
437
+                house.storehouse_code AS store_code
438
+            FROM
439
+                storage_archive archive
440
+            LEFT JOIN basic_storehouse house ON house.storehouse_id = archive.storehouse_id
441
+            WHERE
442
+                archive.archive_state = '5' AND
443
+                archive.org_id = #{orgId}
444
+        ) a
445
+    WHERE
446
+        rn = 1
447
+  </select>
427 448
 </mapper>

+ 1 - 0
src/main/java/com/chinaitop/depot/agent/archive/service/ArchiveService.java

@@ -27,4 +27,5 @@ public interface ArchiveService {
27 27
     List<StorageArchive> getArchiveViewList(String storehouseId, String startTime, String endTime, String orgId);
28 28
 
29 29
     Map<Integer,Object> getArchiveDataList(String orgId);
30
+    List<Map<String,Object>> getCRKArchiveList(String orgId);
30 31
 }

+ 7 - 0
src/main/java/com/chinaitop/depot/agent/archive/service/impl/ArchiveServiceImpl.java

@@ -202,4 +202,11 @@ public class ArchiveServiceImpl implements ArchiveService {
202 202
         }
203 203
         return objMap;
204 204
     }
205
+
206
+    @Override
207
+    public List<Map<String,Object>> getCRKArchiveList(String orgId) {
208
+        Map<String, Object> map = new HashMap<String, Object>();
209
+        map.put("orgId", orgId);
210
+        return ParameterUtil.slashCapitals(StorageArchiveMapper.getCRKArchiveList(map));
211
+    }
205 212
 }

+ 8 - 57
src/main/resources/bootstrap.yml

@@ -11,7 +11,7 @@ server:
11 11
 eureka:
12 12
   client:
13 13
     service-url:
14
-      defaultZone: http://172.16.0.4:9711/eureka/
14
+      defaultZone: http://localhost:9002/eureka/
15 15
   instance:
16 16
     prefer-ip-address: true
17 17
     # 每隔10s发送一次心跳(默认30s)
@@ -33,65 +33,17 @@ spring:
33 33
     username: gbasedbt
34 34
     password: cDbK2S0go8
35 35
     driver-class-name: com.gbasedbt.jdbc.IfxDriver
36
-  # 缓存配置
37
-  session:
38
-    store-type: redis
39
-  redis:
40
-    database: 4
41
-    host: 172.16.0.46
42
-    port: 6679
43
-    password: 123456
44
-    timeout: 3000
45
-    jedis:
46
-      pool:
47
-        max-active: 8
48
-        max-wait: -1
49
-        max-idle: 8
50
-        min-idle: 0
51
-  # 静态资源配置
52
-  resources:
53
-    static-locations: classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${web.upload-path}
54
-
55
-web:
56
-  upload-path: /upload
57
-
58
----
59
-server:
60
-  port: 9027
61
-  tomcat:
62
-    uri-encoding: utf-8
63
-
64
-# 注册中心配置
65
-eureka:
66
-  client:
67
-    service-url:
68
-      defaultZone: http://192.168.123.98:9002/eureka/
69
-  instance:
70
-    prefer-ip-address: true
71
-    # 每隔10s发送一次心跳(默认30s)
72
-    lease-renewal-interval-in-seconds: 10
73
-    # 告知服务端30秒还未收到心跳的话,就将该服务移除列表(默认90s)
74
-    lease-expiration-duration-in-seconds: 30
75
-
76
-spring:
77
-  profiles: dev
78
-  application:
79
-    name: depot-agent-lv
80
-  # 数据库配置
81
-  datasource:
82
-    type: com.alibaba.druid.pool.DruidDataSource
83
-    url: jdbc:gbasedbt-sqli://192.168.123.38:9099/depot:INFORMIXSERVER=depot;NEWCODESET=GBK,8859-1,819;GL_USEGLU=1;IFX_USE_STRENC=true;characterEncoding=utf8;DB_LOCALE=zh_cn.GB18030-2000
84
-    username: gbasedbt
85
-    password: depot123456
86
-    driver-class-name: com.gbasedbt.jdbc.IfxDriver
36
+  #    url: jdbc:gbasedbt-sqli://111.164.113.172:666/depot:INFORMIXSERVER=gbaseserver;NEWCODESET=GBK,8859-1,819;GL_USEGLU=1;IFX_USE_STRENC=true;characterEncoding=utf8;
37
+  #    username: gbasedbt
38
+  #    password: GBase123
87 39
   # 缓存配置
88 40
   session:
89 41
     store-type: redis
90 42
   redis:
91 43
     database: 2
92
-    host: 192.168.123.98
93
-    port: 6666
94
-    password: depotredis
44
+    host: localhost
45
+    port: 6379
46
+    password:
95 47
     timeout: 3000
96 48
     jedis:
97 49
       pool:
@@ -104,5 +56,4 @@ spring:
104 56
     static-locations: classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${web.upload-path}
105 57
 
106 58
 web:
107
-  upload-path: /upload
108
-logging.level.com.chinaitop.depot.agent.crk.mapper: debug
59
+  upload-path: /upload