fanxw 6 years ago
commit
41a4aca091
100 changed files with 31157 additions and 0 deletions
  1. 5 0
      Dockerfile
  2. 279 0
      pom.xml
  3. 169 0
      src/main/java/com/chinaitop/depot/DatePermissionInterceptor.java
  4. 67 0
      src/main/java/com/chinaitop/depot/DepotBusinessApplication.java
  5. 13 0
      src/main/java/com/chinaitop/depot/HelloWebXml.java
  6. 35 0
      src/main/java/com/chinaitop/depot/SwaggerConfig.java
  7. 182 0
      src/main/java/com/chinaitop/depot/act/controller/ActDynamicFormController.java
  8. 176 0
      src/main/java/com/chinaitop/depot/act/controller/ActModelController.java
  9. 233 0
      src/main/java/com/chinaitop/depot/act/controller/ActProcessController.java
  10. 82 0
      src/main/java/com/chinaitop/depot/act/controller/ActRoleController.java
  11. 176 0
      src/main/java/com/chinaitop/depot/act/controller/ActTaskController.java
  12. 51 0
      src/main/java/com/chinaitop/depot/act/controller/ActTemplateController.java
  13. 8 0
      src/main/java/com/chinaitop/depot/act/mapper/ActMapper.java
  14. 11 0
      src/main/java/com/chinaitop/depot/act/mapper/ActMapper.xml
  15. 368 0
      src/main/java/com/chinaitop/depot/act/model/Act.java
  16. 128 0
      src/main/java/com/chinaitop/depot/act/model/DeploymentList.java
  17. 69 0
      src/main/java/com/chinaitop/depot/act/model/HistoryList.java
  18. 28 0
      src/main/java/com/chinaitop/depot/act/model/RoleInfoVo.java
  19. 483 0
      src/main/java/com/chinaitop/depot/act/rest/diagram/services/BaseProcessDefinitionDiagramLayoutResource.java
  20. 22 0
      src/main/java/com/chinaitop/depot/act/rest/diagram/services/ProcessDefinitionDiagramLayoutResource.java
  21. 22 0
      src/main/java/com/chinaitop/depot/act/rest/diagram/services/ProcessInstanceDiagramLayoutResource.java
  22. 279 0
      src/main/java/com/chinaitop/depot/act/rest/diagram/services/ProcessInstanceHighlightsResource.java
  23. 27 0
      src/main/java/com/chinaitop/depot/act/rest/editor/main/StencilsetRestResource.java
  24. 59 0
      src/main/java/com/chinaitop/depot/act/rest/editor/model/ModelEditorJsonRestResource.java
  25. 122 0
      src/main/java/com/chinaitop/depot/act/rest/editor/model/ModelSaveRestResource.java
  26. 45 0
      src/main/java/com/chinaitop/depot/act/rest/servlet/FilterServletOutputStream.java
  27. 53 0
      src/main/java/com/chinaitop/depot/act/rest/servlet/GenericResponseWrapper.java
  28. 66 0
      src/main/java/com/chinaitop/depot/act/rest/servlet/JsonpCallbackFilter.java
  29. 19 0
      src/main/java/com/chinaitop/depot/act/rest/servlet/filterBean.java
  30. 62 0
      src/main/java/com/chinaitop/depot/act/service/ActDynamicFormService.java
  31. 183 0
      src/main/java/com/chinaitop/depot/act/service/ActModelService.java
  32. 276 0
      src/main/java/com/chinaitop/depot/act/service/ActProcessService.java
  33. 745 0
      src/main/java/com/chinaitop/depot/act/service/ActTaskService.java
  34. 123 0
      src/main/java/com/chinaitop/depot/act/service/ActTemplateService.java
  35. 28 0
      src/main/java/com/chinaitop/depot/act/service/DeleteService.java
  36. 55 0
      src/main/java/com/chinaitop/depot/act/service/cmd/JumpTaskCmd.java
  37. 49 0
      src/main/java/com/chinaitop/depot/act/service/creator/ChainedActivitiesCreator.java
  38. 45 0
      src/main/java/com/chinaitop/depot/act/service/creator/CreateAndTakeTransitionCmd.java
  39. 58 0
      src/main/java/com/chinaitop/depot/act/service/creator/MultiInstanceActivityCreator.java
  40. 11 0
      src/main/java/com/chinaitop/depot/act/service/creator/RuntimeActivityCreator.java
  41. 90 0
      src/main/java/com/chinaitop/depot/act/service/creator/RuntimeActivityCreatorSupport.java
  42. 65 0
      src/main/java/com/chinaitop/depot/act/service/creator/RuntimeActivityDefinitionEntity.java
  43. 81 0
      src/main/java/com/chinaitop/depot/act/service/creator/RuntimeActivityDefinitionEntityIntepreter.java
  44. 88 0
      src/main/java/com/chinaitop/depot/act/service/creator/SimpleRuntimeActivityDefinitionEntity.java
  45. 64 0
      src/main/java/com/chinaitop/depot/agile/mapper/BusinessSceduleMapper.java
  46. 81 0
      src/main/java/com/chinaitop/depot/agile/mapper/BusinessSceduleMapper.xml
  47. 102 0
      src/main/java/com/chinaitop/depot/agile/model/BusinessScedule.java
  48. 54 0
      src/main/java/com/chinaitop/depot/agile/service/BusinessSceduleService.java
  49. 62 0
      src/main/java/com/chinaitop/depot/agile/service/impl/BusinessSceduleServiceImpl.java
  50. 183 0
      src/main/java/com/chinaitop/depot/business/controller/ApprovalController.java
  51. 850 0
      src/main/java/com/chinaitop/depot/business/controller/BusinessContractController.java
  52. 101 0
      src/main/java/com/chinaitop/depot/business/controller/BusinessContractPayController.java
  53. 472 0
      src/main/java/com/chinaitop/depot/business/controller/BusinessDeliveryStorageNoticeController.java
  54. 99 0
      src/main/java/com/chinaitop/depot/business/controller/BusinessFileController.java
  55. 129 0
      src/main/java/com/chinaitop/depot/business/controller/BusinessLadingController.java
  56. 648 0
      src/main/java/com/chinaitop/depot/business/controller/BusinessPlanController.java
  57. 222 0
      src/main/java/com/chinaitop/depot/business/controller/BusinessStoreWareDetailController.java
  58. 72 0
      src/main/java/com/chinaitop/depot/business/controller/OrgInfoController.java
  59. 482 0
      src/main/java/com/chinaitop/depot/business/controller/UserInfoController.java
  60. 480 0
      src/main/java/com/chinaitop/depot/business/controller/audit/BusinessContractAuditController.java
  61. 168 0
      src/main/java/com/chinaitop/depot/business/controller/audit/BusinessDeliveryStorageNoticeAuditController.java
  62. 279 0
      src/main/java/com/chinaitop/depot/business/controller/audit/BusinessPlanAuditController.java
  63. 34 0
      src/main/java/com/chinaitop/depot/business/mapper/BusinessApprovalMapper.java
  64. 744 0
      src/main/java/com/chinaitop/depot/business/mapper/BusinessApprovalMapper.xml
  65. 60 0
      src/main/java/com/chinaitop/depot/business/mapper/BusinessContractMapper.java
  66. 1098 0
      src/main/java/com/chinaitop/depot/business/mapper/BusinessContractMapper.xml
  67. 30 0
      src/main/java/com/chinaitop/depot/business/mapper/BusinessContractPayReceviceMapper.java
  68. 258 0
      src/main/java/com/chinaitop/depot/business/mapper/BusinessContractPayReceviceMapper.xml
  69. 58 0
      src/main/java/com/chinaitop/depot/business/mapper/BusinessDeliveryStorageNoticeMapper.java
  70. 947 0
      src/main/java/com/chinaitop/depot/business/mapper/BusinessDeliveryStorageNoticeMapper.xml
  71. 32 0
      src/main/java/com/chinaitop/depot/business/mapper/BusinessFileMapper.java
  72. 338 0
      src/main/java/com/chinaitop/depot/business/mapper/BusinessFileMapper.xml
  73. 34 0
      src/main/java/com/chinaitop/depot/business/mapper/BusinessLadingMapper.java
  74. 519 0
      src/main/java/com/chinaitop/depot/business/mapper/BusinessLadingMapper.xml
  75. 50 0
      src/main/java/com/chinaitop/depot/business/mapper/BusinessPlanMapper.java
  76. 837 0
      src/main/java/com/chinaitop/depot/business/mapper/BusinessPlanMapper.xml
  77. 49 0
      src/main/java/com/chinaitop/depot/business/mapper/BusinessSceduleMapper.java
  78. 47 0
      src/main/java/com/chinaitop/depot/business/mapper/BusinessSceduleMapper.xml
  79. 69 0
      src/main/java/com/chinaitop/depot/business/mapper/BusinessStoreWareDetailMapper.java
  80. 575 0
      src/main/java/com/chinaitop/depot/business/mapper/BusinessStoreWareDetailMapper.xml
  81. 30 0
      src/main/java/com/chinaitop/depot/business/mapper/OrgInfoMapper.java
  82. 845 0
      src/main/java/com/chinaitop/depot/business/mapper/OrgInfoMapper.xml
  83. 31 0
      src/main/java/com/chinaitop/depot/business/mapper/RoleInfoMapper.java
  84. 228 0
      src/main/java/com/chinaitop/depot/business/mapper/RoleInfoMapper.xml
  85. 34 0
      src/main/java/com/chinaitop/depot/business/mapper/UserInfoMapper.java
  86. 485 0
      src/main/java/com/chinaitop/depot/business/mapper/UserInfoMapper.xml
  87. 33 0
      src/main/java/com/chinaitop/depot/business/mapper/UserRoleMapper.java
  88. 184 0
      src/main/java/com/chinaitop/depot/business/mapper/UserRoleMapper.xml
  89. 559 0
      src/main/java/com/chinaitop/depot/business/model/BusinessApproval.java
  90. 2159 0
      src/main/java/com/chinaitop/depot/business/model/BusinessApprovalExample.java
  91. 923 0
      src/main/java/com/chinaitop/depot/business/model/BusinessContract.java
  92. 3609 0
      src/main/java/com/chinaitop/depot/business/model/BusinessContractExample.java
  93. 149 0
      src/main/java/com/chinaitop/depot/business/model/BusinessContractPayRecevice.java
  94. 729 0
      src/main/java/com/chinaitop/depot/business/model/BusinessContractPayReceviceExample.java
  95. 357 0
      src/main/java/com/chinaitop/depot/business/model/BusinessDeliveryNoticeDetail.java
  96. 993 0
      src/main/java/com/chinaitop/depot/business/model/BusinessDeliveryNoticeDetailExample.java
  97. 828 0
      src/main/java/com/chinaitop/depot/business/model/BusinessDeliveryStorageNotice.java
  98. 3179 0
      src/main/java/com/chinaitop/depot/business/model/BusinessDeliveryStorageNoticeExample.java
  99. 239 0
      src/main/java/com/chinaitop/depot/business/model/BusinessFile.java
  100. 0 0
      src/main/java/com/chinaitop/depot/business/model/BusinessFileExample.java

+ 5 - 0
Dockerfile

@@ -0,0 +1,5 @@
1
+FROM 192.168.123.25:31104/unis/java:8
2
+ 
3
+ADD ./target/depot-business.jar /root
4
+CMD ["sh", "-c", "cd /root; java -Djava.security.egd=file:/dev/./urandom -jar /root/depot-business.jar --depot-business.server.enable-self-preservation=false"]
5
+EXPOSE 9002

+ 279 - 0
pom.xml

@@ -0,0 +1,279 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4
+	<modelVersion>4.0.0</modelVersion>
5
+
6
+	<groupId>com.chinaitop</groupId>
7
+	<artifactId>depot-business</artifactId>
8
+	<version>0.0.1-SNAPSHOT</version>
9
+	<packaging>jar</packaging>
10
+
11
+	<name>depot-business</name>
12
+	<description>Demo project for Spring Boot</description>
13
+
14
+	<parent>
15
+		<groupId>org.springframework.boot</groupId>
16
+		<artifactId>spring-boot-starter-parent</artifactId>
17
+		<version>2.0.0.RELEASE</version>
18
+		<relativePath/> <!-- lookup parent from repository -->
19
+	</parent>
20
+
21
+	<properties>
22
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
23
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
24
+        <java.version>1.8</java.version>
25
+        <spring-cloud.version>Finchley.M8</spring-cloud.version>
26
+    </properties>
27
+
28
+	<dependencies>
29
+		<dependency>
30
+			<groupId>org.springframework.boot</groupId>
31
+			<artifactId>spring-boot-starter-web</artifactId>
32
+		</dependency>
33
+		<dependency>
34
+			<groupId>org.mybatis.spring.boot</groupId>
35
+			<artifactId>mybatis-spring-boot-starter</artifactId>
36
+			<version>1.3.1</version>
37
+		</dependency>
38
+		
39
+		<dependency>
40
+			<groupId>mysql</groupId>
41
+			<artifactId>mysql-connector-java</artifactId>
42
+		</dependency>
43
+		
44
+		<dependency>
45
+		    <groupId>org.springframework.boot</groupId>
46
+		    <artifactId>spring-boot-autoconfigure</artifactId>
47
+		</dependency>
48
+		
49
+		
50
+		<!--activiti新增的jar包   开始  -->
51
+		<dependency>
52
+			<groupId>org.activiti</groupId>
53
+			<artifactId>activiti-json-converter</artifactId>
54
+			<version>5.21.0</version>
55
+		</dependency>
56
+ 		<dependency> 
57
+ 			<groupId>org.activiti</groupId>
58
+ 			<artifactId>activiti-spring-boot-starter-basic</artifactId>
59
+ 			<version>5.21.0</version>
60
+		</dependency>
61
+		<dependency>
62
+			<groupId>commons-io</groupId>
63
+			<artifactId>commons-io</artifactId>
64
+			<version>2.4</version>
65
+		</dependency>
66
+		
67
+		<dependency>
68
+		    <groupId>org.apache.xmlgraphics</groupId>
69
+		    <artifactId>batik-transcoder</artifactId>
70
+		    <version>1.7</version>
71
+		</dependency>
72
+		<dependency>
73
+		    <groupId>org.apache.xmlgraphics</groupId>
74
+		    <artifactId>batik-codec</artifactId>
75
+		    <version>1.7</version>
76
+		</dependency>
77
+		
78
+		<!-- <dependency>
79
+		    <groupId>com.google.guava</groupId>
80
+		    <artifactId>guava</artifactId>
81
+		    <version>17.0</version>
82
+		</dependency> -->
83
+		
84
+		<dependency>
85
+		    <groupId>commons-codec</groupId>
86
+		    <artifactId>commons-codec</artifactId>
87
+		    <version>1.9</version>
88
+		</dependency>
89
+		
90
+		<dependency>
91
+		    <groupId>commons-beanutils</groupId>
92
+		    <artifactId>commons-beanutils</artifactId>
93
+		    <version>1.9.1</version>
94
+		</dependency>
95
+		
96
+		<dependency>
97
+		    <groupId>org.apache.xmlgraphics</groupId>
98
+		    <artifactId>fop</artifactId>
99
+		    <version>1.0</version>
100
+		</dependency>
101
+		
102
+		<dependency>
103
+		    <groupId>joda-time</groupId>
104
+		    <artifactId>joda-time</artifactId>
105
+		    <version>2.1</version>
106
+		</dependency>
107
+		<!--activiti新增的jar包   结束 -->
108
+		
109
+		<!-- 阿里巴巴json -->
110
+		<dependency>
111
+		    <groupId>com.alibaba</groupId>
112
+		    <artifactId>fastjson</artifactId>
113
+		    <version>1.2.37</version>
114
+		</dependency>
115
+		
116
+		<!--添加webservice-->
117
+        <dependency>
118
+            <groupId>org.springframework.boot</groupId>
119
+            <artifactId>spring-boot-starter-web-services</artifactId>
120
+        </dependency>
121
+        <dependency>
122
+            <groupId>org.apache.cxf</groupId>
123
+            <artifactId>cxf-rt-frontend-jaxws</artifactId>
124
+            <version>3.1.6</version>
125
+        </dependency>
126
+        <dependency>
127
+            <groupId>org.apache.cxf</groupId>
128
+            <artifactId>cxf-rt-transports-http</artifactId>
129
+            <version>3.1.6</version>
130
+        </dependency>
131
+        <!--添加webservice end-->
132
+        
133
+		<!-- 引入spring boot自带的pagehelper插件 -->
134
+		<dependency>
135
+			<groupId>com.github.pagehelper</groupId>
136
+			<artifactId>pagehelper-spring-boot-starter</artifactId>
137
+			<version>1.2.3</version>
138
+		</dependency>
139
+		
140
+		<!-- 导入Eureka服务的依赖 -->
141
+        <dependency>
142
+			<groupId>org.springframework.cloud</groupId>
143
+			<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
144
+		</dependency>
145
+		
146
+		<dependency>
147
+            <groupId>org.springframework.cloud</groupId>
148
+            <artifactId>spring-cloud-starter-config</artifactId>
149
+        </dependency>
150
+		<dependency>
151
+			<groupId>org.apache.commons</groupId>
152
+			<artifactId>commons-lang3</artifactId>
153
+			<version>3.7</version>
154
+		</dependency>
155
+
156
+		<!-- swagger2 -->
157
+		<dependency>
158
+			<groupId>io.springfox</groupId>
159
+			<artifactId>springfox-swagger2</artifactId>
160
+			<version>2.6.1</version>
161
+		</dependency>
162
+		<dependency>
163
+			<groupId>io.springfox</groupId>
164
+			<artifactId>springfox-swagger-ui</artifactId>
165
+			<version>2.6.1</version>
166
+		</dependency>
167
+		
168
+		<dependency>
169
+            <groupId>org.springframework.boot</groupId>
170
+            <artifactId>spring-boot-starter-data-redis</artifactId>
171
+        </dependency>
172
+        <dependency>
173
+            <groupId>org.springframework.session</groupId>
174
+            <artifactId>spring-session-data-redis</artifactId>
175
+        </dependency>
176
+
177
+		<dependency>
178
+			<groupId>org.springframework.boot</groupId>
179
+			<artifactId>spring-boot-starter-test</artifactId>
180
+			<scope>test</scope>
181
+		</dependency>
182
+		
183
+		<dependency>
184
+			<groupId>org.apache.poi</groupId>
185
+			<artifactId>poi-ooxml</artifactId>
186
+			<version>3.9</version>
187
+		</dependency>
188
+		
189
+		<!--<dependency>
190
+		    <groupId>org.apache.httpcomponents</groupId>
191
+		    <artifactId>httpclient</artifactId>
192
+		    <version>4.5.3</version>
193
+		</dependency>-->
194
+		
195
+		<dependency>  
196
+	       <groupId>log4j</groupId>  
197
+	       <artifactId>log4j</artifactId>  
198
+	       <version>1.2.15</version>  
199
+	       <exclusions>  
200
+	         <exclusion>  
201
+	           <groupId>javax.mail</groupId>  
202
+	           <artifactId>mail</artifactId>  
203
+	         </exclusion>  
204
+	         <exclusion>  
205
+	           <groupId>javax.jms</groupId>  
206
+	           <artifactId>jms</artifactId>  
207
+	         </exclusion>  
208
+	         <exclusion>  
209
+	           <groupId>com.sun.jdmk</groupId>  
210
+	           <artifactId>jmxtools</artifactId>  
211
+	         </exclusion>  
212
+	         <exclusion>  
213
+	           <groupId>com.sun.jmx</groupId>  
214
+	           <artifactId>jmxri</artifactId>  
215
+	         </exclusion>  
216
+	       </exclusions>  
217
+	       <scope>compile</scope>  
218
+	     </dependency>
219
+		
220
+	</dependencies>
221
+
222
+	<!-- 导入Spring Cloud的依赖管理 -->
223
+    <dependencyManagement>
224
+        <dependencies>
225
+            <dependency>
226
+                <groupId>org.springframework.cloud</groupId>
227
+                <artifactId>spring-cloud-dependencies</artifactId>
228
+                <version>${spring-cloud.version}</version>
229
+                <type>pom</type>
230
+                <scope>import</scope>
231
+            </dependency>
232
+        </dependencies>
233
+    </dependencyManagement>
234
+
235
+	 <build>
236
+        <finalName>${project.artifactId}</finalName>
237
+        <plugins>
238
+			<plugin>
239
+				<groupId>org.springframework.boot</groupId>
240
+				<artifactId>spring-boot-maven-plugin</artifactId>
241
+			</plugin>
242
+			<!-- <plugin>
243
+            	<groupId>org.apache.maven.plugins</groupId>
244
+            	<artifactId>maven-war-plugin</artifactId>
245
+            	<version>2.6</version>
246
+            	<configuration>
247
+                	<failOnMissingWebXml>false</failOnMissingWebXml>
248
+            	</configuration>
249
+        	</plugin> -->
250
+		</plugins>
251
+        <!-- 如果不添加此节点mybatis的mapper.xml文件都会被漏掉。 -->
252
+        <resources>
253
+            <resource>
254
+                <directory>src/main/java</directory>
255
+                <includes>
256
+                    <include>**/*.properties</include>
257
+					<include>**/*.xml</include>
258
+					<include>**/*.store</include>
259
+                </includes>
260
+                <filtering>false</filtering>
261
+            </resource>
262
+            <resource>
263
+                <directory>src/main/resources</directory>
264
+            </resource>
265
+        </resources>
266
+    </build>
267
+    
268
+    <repositories>
269
+		<repository>
270
+			<id>spring-milestones</id>
271
+			<name>Spring Milestones</name>
272
+			<url>https://repo.spring.io/milestone</url>
273
+			<snapshots>
274
+				<enabled>false</enabled>
275
+			</snapshots>
276
+		</repository>
277
+	</repositories>
278
+    
279
+</project>

+ 169 - 0
src/main/java/com/chinaitop/depot/DatePermissionInterceptor.java

@@ -0,0 +1,169 @@
1
+package com.chinaitop.depot;
2
+
3
+import com.chinaitop.depot.utils.DataPolicyEngine;
4
+import com.chinaitop.depot.utils.RedisUtil;
5
+import net.sf.jsqlparser.parser.CCJSqlParserUtil;
6
+import net.sf.jsqlparser.statement.Statement;
7
+import net.sf.jsqlparser.statement.select.Select;
8
+import net.sf.jsqlparser.util.TablesNamesFinder;
9
+import org.apache.commons.lang.ObjectUtils;
10
+import org.apache.ibatis.executor.statement.StatementHandler;
11
+import org.apache.ibatis.mapping.BoundSql;
12
+import org.apache.ibatis.mapping.MappedStatement;
13
+import org.apache.ibatis.plugin.*;
14
+import org.apache.ibatis.reflection.DefaultReflectorFactory;
15
+import org.apache.ibatis.reflection.MetaObject;
16
+import org.apache.ibatis.reflection.ReflectorFactory;
17
+import org.apache.ibatis.reflection.factory.DefaultObjectFactory;
18
+import org.apache.ibatis.reflection.factory.ObjectFactory;
19
+import org.apache.ibatis.reflection.wrapper.DefaultObjectWrapperFactory;
20
+import org.apache.ibatis.reflection.wrapper.ObjectWrapperFactory;
21
+import org.springframework.beans.factory.annotation.Autowired;
22
+import org.springframework.stereotype.Component;
23
+
24
+import java.lang.reflect.Field;
25
+import java.sql.Connection;
26
+import java.util.HashSet;
27
+import java.util.List;
28
+import java.util.Properties;
29
+import java.util.Set;
30
+
31
+/**
32
+ * Sql执行时间记录拦截器
33
+ */
34
+@Intercepts({ @Signature(type = StatementHandler.class, method = "prepare", args = { Connection.class, Integer.class })})
35
+@Component
36
+public class DatePermissionInterceptor implements Interceptor {
37
+	
38
+	private static final ObjectFactory DEFAULT_OBJECT_FACTORY = new DefaultObjectFactory();
39
+    private static final ObjectWrapperFactory DEFAULT_OBJECT_WRAPPER_FACTORY = new DefaultObjectWrapperFactory();
40
+    private static final ReflectorFactory DEFAULT_REFLECTOR_FACTORY = new DefaultReflectorFactory();
41
+
42
+	@Autowired
43
+	private RedisUtil redisUtil;
44
+	
45
+	@Override
46
+	public Object intercept(Invocation invocation) throws Throwable {
47
+		
48
+		StatementHandler statementHandler = (StatementHandler) invocation.getTarget();
49
+        MetaObject metaStatementHandler = MetaObject.forObject(statementHandler, DEFAULT_OBJECT_FACTORY,
50
+                DEFAULT_OBJECT_WRAPPER_FACTORY, DEFAULT_REFLECTOR_FACTORY);
51
+        
52
+        MappedStatement mappedStatement = (MappedStatement) metaStatementHandler.getValue("delegate.mappedStatement");
53
+        
54
+		final BoundSql boundSql = statementHandler.getBoundSql();
55
+		String bouString = boundSql.getSql();// 获取执行sql 
56
+		
57
+		//sql是查询的才进行权限过滤且不过滤t_url_config表的数据
58
+	    if(mappedStatement.getSqlCommandType().toString().equals("select".toUpperCase()) && 
59
+	    		!bouString.contains("t_url_config")) {
60
+			//通过本地线程获取库id
61
+			Object threadLocalObj = DataPolicyEngine.get();
62
+			String orgId = null;
63
+			if(threadLocalObj != null) {
64
+				orgId = ObjectUtils.toString(threadLocalObj);
65
+			}
66
+			if(orgId!=null) {
67
+				//机构单独查询时使用递归查询,可以查询机构下级机构
68
+				if("com.chinaitop.depot.system.mapper.OrgInfoMapper.selectByExample".equals(mappedStatement.getId())) {
69
+					bouString = bouString.replaceAll("org_info", "(SELECT * from org_info"
70
+							+ " WHERE FIND_IN_SET(org_id,getChildrenOrg("+orgId+"))) org_info ");
71
+				}else if(!"com.chinaitop.depot.business.mapper.RoleInfoMapper.selectByPrimaryKey".equals(mappedStatement.getId()) &&
72
+						!"com.chinaitop.depot.business.mapper.UserRoleMapper.selectByExample".equals(mappedStatement.getId()) &&
73
+						!"com.chinaitop.depot.business.mapper.UserInfoMapper.selectByPrimaryKey".equals(mappedStatement.getId()) &&
74
+						!"com.chinaitop.depot.business.mapper.OrgInfoMapper.selectByPrimaryKey".equals(mappedStatement.getId()) &&
75
+						!"com.chinaitop.depot.business.mapper.OrgInfoMapper.selectByExample".equals(mappedStatement.getId()) &&
76
+						!"com.chinaitop.depot.business.mapper.UserInfoMapper.selectByExample".equals(mappedStatement.getId()) &&
77
+						!"com.chinaitop.depot.business.mapper.BusinessStoreWareDetailMapper.selectByExample".equals(mappedStatement.getId()) &&
78
+						!"com.chinaitop.depot.business.mapper.BusinessDeliveryStorageNoticeMapper.selectByPrimaryKey".equals(mappedStatement.getId()) &&
79
+						!"com.chinaitop.depot.business.mapper.BusinessDeliveryStorageNoticeMapper.selectByExample_COUNT".equals(mappedStatement.getId()) &&
80
+						!"com.chinaitop.depot.business.mapper.BusinessDeliveryStorageNoticeMapper.selectByExample".equals(mappedStatement.getId()) 
81
+						){
82
+					//解析sql中的表名
83
+					Statement statement = CCJSqlParserUtil.parse(bouString);
84
+					Select selectStatement = (Select)statement;
85
+					TablesNamesFinder tablesNamesFinder = new TablesNamesFinder();
86
+					List<String> result = tablesNamesFinder.getTableList(selectStatement);
87
+					
88
+					Set<String> tableNames = new HashSet<String>();// 定义需要替换的table信息列表
89
+					//获取业务表信息数据
90
+					List<String> tableList = (List<String>)redisUtil.lGetAll("tableList").get(0);
91
+					for(int i=0;i<result.size();i++) {
92
+						for (int j = 0; j < tableList.size(); j++) {// 处理查看sql中是否有业务表
93
+							if (result.get(i).equals(ObjectUtils.toString(tableList.get(j)))) {// 是否存在业务表
94
+								tableNames.add(result.get(i));
95
+							}
96
+						}
97
+					}
98
+					
99
+					if (tableNames != null && tableNames.size() > 0) {// sql中存在业务表进行sql拼接数据重新检索
100
+						if(result.size() >= 2) {//sql中存在2张及以上表
101
+							for (String table : tableNames) {// 进行业务表的数据权限替换
102
+								table += " ";//表名后面加空格,防止两个表名一部分相似,导致替换出错
103
+								bouString = bouString.replaceAll(table, "(SELECT * from " + table
104
+										+ " WHERE org_id = '"+orgId+"') ");
105
+							}
106
+						}else {//sql中是单表
107
+							for (String table : tableNames) {// 进行业务表的数据权限替换
108
+								if(bouString.contains(table+" ")) {//防止是单表查询,表后面没有空格的时候替换不了
109
+									table += " ";//表名后面加空格,防止两个表名一部分相似,导致替换出错
110
+								}
111
+								bouString = bouString.replaceAll(table, "(SELECT * from " + table
112
+										+ " WHERE org_id = '"+orgId+"') "+table+" ");
113
+							}
114
+						}
115
+						
116
+						/*bouString = bouString.replaceAll(table, "(SELECT b.* from " + table
117
+						+ " b,user_business u WHERE b.org_id = u.org_id AND u .user_id ='"+userId+"' AND u.business_type = '"+table+"') ");*/
118
+						
119
+					}
120
+				}
121
+				
122
+				
123
+				//metaStatementHandler.setValue("delegate.boundSql.sql", bouString);
124
+				
125
+				Field field = getField(boundSql, "sql");
126
+				if (field != null) {
127
+					try {
128
+						field.setAccessible(true);
129
+						field.set(boundSql, bouString);
130
+					} catch (IllegalArgumentException e) {
131
+						// TODO Auto-generated catch block
132
+						e.printStackTrace();
133
+					} catch (IllegalAccessException e) {
134
+						// TODO Auto-generated catch block
135
+						e.printStackTrace();
136
+					}
137
+				}
138
+			}
139
+		
140
+	    }
141
+			
142
+		return invocation.proceed();
143
+		
144
+
145
+	}
146
+
147
+	private static Field getField(Object obj, String fieldName) {
148
+		Field field = null;
149
+		for (Class<?> clazz = obj.getClass(); clazz != Object.class; clazz = clazz.getSuperclass()) {
150
+			try {
151
+				field = clazz.getDeclaredField(fieldName);
152
+				break;
153
+			} catch (NoSuchFieldException e) {
154
+				// 这里不用做处理,子类没有该字段可能对应的父类有,都没有就返回null。
155
+			}
156
+		}
157
+		return field;
158
+	}
159
+
160
+	@Override
161
+	public Object plugin(Object target) {
162
+		return Plugin.wrap(target, this);
163
+	}
164
+
165
+	@Override
166
+	public void setProperties(Properties properties) {
167
+	}
168
+
169
+}

+ 67 - 0
src/main/java/com/chinaitop/depot/DepotBusinessApplication.java

@@ -0,0 +1,67 @@
1
+package com.chinaitop.depot;
2
+
3
+import org.activiti.spring.boot.SecurityAutoConfiguration;
4
+import org.mybatis.spring.annotation.MapperScan;
5
+import org.springframework.boot.SpringApplication;
6
+import org.springframework.boot.autoconfigure.SpringBootApplication;
7
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
8
+import org.springframework.boot.web.servlet.ServletRegistrationBean;
9
+import org.springframework.cache.annotation.EnableCaching;
10
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
11
+import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
12
+import org.springframework.context.annotation.Bean;
13
+import org.springframework.context.annotation.ComponentScan;
14
+import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
15
+import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
16
+import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
17
+import org.springframework.web.servlet.DispatcherServlet;
18
+
19
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
20
+
21
+
22
+@EnableEurekaClient
23
+@EnableDiscoveryClient
24
+@EnableCaching
25
+@EnableRedisHttpSession
26
+@EnableSwagger2
27
+@SpringBootApplication(
28
+		//exclude = {DataSourceAutoConfiguration.class}	// 禁止自动配置数据源,多数据源需采用手动配置
29
+		exclude = SecurityAutoConfiguration.class
30
+
31
+	)
32
+@MapperScan(basePackages = {"com.chinaitop.depot.*.mapper"})
33
+public class DepotBusinessApplication {
34
+
35
+	public static void main(String[] args) {
36
+		SpringApplication.run(DepotBusinessApplication.class, args);
37
+	}
38
+	
39
+	
40
+	/**
41
+	 * 注册一个dispatcherServlet,解决增加ws之后https接口访问不了问题
42
+	 */
43
+	@Bean
44
+	public ServletRegistrationBean restServlet(){
45
+		//注解扫描上下文
46
+		AnnotationConfigWebApplicationContext applicationContext = new AnnotationConfigWebApplicationContext();
47
+		//base package
48
+		applicationContext.scan("com.chinaitop.depot.unissoft");
49
+		//通过构造函数指定dispatcherServlet的上下文
50
+		DispatcherServlet rest_dispatcherServlet = new DispatcherServlet(applicationContext);
51
+		//用ServletRegistrationBean包装servlet
52
+		ServletRegistrationBean registrationBean = new ServletRegistrationBean(rest_dispatcherServlet);
53
+		registrationBean.setLoadOnStartup(1);
54
+		//指定urlmapping
55
+		registrationBean.addUrlMappings("/*");
56
+		//指定name,如果不指定默认为dispatcherServlet
57
+		registrationBean.setName("rest");
58
+		return registrationBean;
59
+	}
60
+
61
+	@Bean
62
+	public ThreadPoolTaskScheduler threadPoolTaskScheduler() {
63
+		return new ThreadPoolTaskScheduler();
64
+	}
65
+	
66
+
67
+}

+ 13 - 0
src/main/java/com/chinaitop/depot/HelloWebXml.java

@@ -0,0 +1,13 @@
1
+package com.chinaitop.depot;
2
+
3
+
4
+import org.springframework.boot.builder.SpringApplicationBuilder;
5
+import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
6
+ 
7
+public class HelloWebXml extends SpringBootServletInitializer {
8
+    @Override
9
+    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
10
+        return application.sources(DepotBusinessApplication.class);
11
+    }
12
+ 
13
+}

+ 35 - 0
src/main/java/com/chinaitop/depot/SwaggerConfig.java

@@ -0,0 +1,35 @@
1
+package com.chinaitop.depot;
2
+
3
+import org.springframework.context.annotation.Bean;
4
+import org.springframework.context.annotation.Configuration;
5
+ 
6
+import springfox.documentation.builders.ApiInfoBuilder;
7
+import springfox.documentation.builders.PathSelectors;
8
+import springfox.documentation.builders.RequestHandlerSelectors;
9
+import springfox.documentation.service.ApiInfo;
10
+import springfox.documentation.spi.DocumentationType;
11
+import springfox.documentation.spring.web.plugins.Docket;
12
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
13
+ 
14
+@Configuration
15
+@EnableSwagger2
16
+public class SwaggerConfig {
17
+ 
18
+    @Bean
19
+    public Docket createRestApi() {
20
+        return new Docket(DocumentationType.SWAGGER_2)
21
+                .apiInfo(apiInfo())
22
+                .select()
23
+                .apis(RequestHandlerSelectors.basePackage("com.chinaitop.depot.business.controller"))
24
+                .paths(PathSelectors.any())
25
+                .build();
26
+    }
27
+    private ApiInfo apiInfo() {
28
+        return new ApiInfoBuilder()
29
+                .title("智能粮库管理平台api文档")
30
+                .description("经营业务")
31
+                .termsOfServiceUrl("http://10.10.25:9001")
32
+                .version("1.0")
33
+                .build();
34
+    }
35
+}

+ 182 - 0
src/main/java/com/chinaitop/depot/act/controller/ActDynamicFormController.java

@@ -0,0 +1,182 @@
1
+package com.chinaitop.depot.act.controller;
2
+
3
+import java.io.IOException;
4
+import java.lang.reflect.Field;
5
+import java.util.ArrayList;
6
+import java.util.HashMap;
7
+import java.util.List;
8
+import java.util.Map;
9
+import java.util.Map.Entry;
10
+import javax.annotation.Resource;
11
+import javax.servlet.http.HttpServletRequest;
12
+import org.activiti.engine.FormService;
13
+import org.activiti.engine.HistoryService;
14
+import org.activiti.engine.IdentityService;
15
+import org.activiti.engine.RepositoryService;
16
+import org.activiti.engine.RuntimeService;
17
+import org.activiti.engine.TaskService;
18
+import org.activiti.engine.form.FormProperty;
19
+import org.activiti.engine.impl.form.StartFormDataImpl;
20
+import org.activiti.engine.repository.ProcessDefinition;
21
+import org.activiti.engine.repository.ProcessDefinitionQuery;
22
+import org.activiti.engine.runtime.ProcessInstance;
23
+import org.slf4j.Logger;
24
+import org.slf4j.LoggerFactory;
25
+import org.springframework.beans.factory.annotation.Autowired;
26
+import org.springframework.ui.Model;
27
+import org.springframework.web.bind.annotation.RequestMapping;
28
+import org.springframework.web.bind.annotation.RequestParam;
29
+import org.springframework.web.bind.annotation.ResponseBody;
30
+import org.springframework.web.bind.annotation.RestController;
31
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
32
+import com.alibaba.fastjson.JSON;
33
+import com.alibaba.fastjson.JSONObject;
34
+import com.chinaitop.depot.act.model.DeploymentList;
35
+import com.chinaitop.depot.act.service.ActTaskService;
36
+import com.chinaitop.depot.business.model.UserInfo;
37
+import com.chinaitop.depot.utils.activiti.PageUtils;
38
+import com.fasterxml.jackson.core.JsonParseException;
39
+import com.fasterxml.jackson.databind.JsonMappingException;
40
+import com.github.pagehelper.PageHelper;
41
+import com.github.pagehelper.PageInfo;
42
+
43
+/**
44
+ * 动态表单Controller
45
+ *
46
+ * @author xujh
47
+ */
48
+@RestController
49
+@RequestMapping(value = "/act/form/dynamic")
50
+public class ActDynamicFormController {
51
+	private Logger logger = LoggerFactory.getLogger(getClass());
52
+    @Autowired
53
+    private RepositoryService repositoryService;
54
+    @Autowired
55
+    private FormService formService;
56
+    @Autowired
57
+    private TaskService taskService;
58
+    @Autowired
59
+    private IdentityService identityService;
60
+    @Autowired
61
+    private HistoryService historyService;
62
+    @Autowired
63
+    private RuntimeService runtimeService;
64
+    /*@Resource
65
+    private ActTaskService actTaskService;*/
66
+    
67
+    /**
68
+     * 动态form流程列表
69
+     *
70
+     * @param model
71
+     * @return
72
+     */
73
+    @RequestMapping(value = {"process-list", ""})
74
+    public PageInfo<DeploymentList> processDefinitionList(Integer pageNum, Integer pageSize,Model model, @RequestParam(value = "processType", required = false) String processType, HttpServletRequest request) {
75
+        PageHelper.startPage(pageNum, pageSize);
76
+
77
+        // 读取所有流程
78
+        ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().active().orderByDeploymentId().desc();
79
+        List<ProcessDefinition> list = query.list();
80
+        
81
+        List<DeploymentList> deploymentlist=new ArrayList<DeploymentList>();
82
+		if(list!=null&&list.size()>0){
83
+			for(ProcessDefinition m: list){
84
+				DeploymentList deploymentLists=new DeploymentList();
85
+				deploymentLists.setId(m.getId());
86
+				deploymentLists.setName(m.getName());
87
+				deploymentLists.setKey(m.getKey());
88
+				deploymentLists.setVersion(m.getVersion());
89
+				deploymentLists.setResourceName(m.getResourceName());
90
+				deploymentLists.setDiagramResourceName(m.getDiagramResourceName());
91
+				deploymentLists.setDeploymentId(m.getDeploymentId());
92
+				deploymentlist.add(deploymentLists);
93
+			}
94
+			
95
+		}
96
+		PageInfo<DeploymentList> pageInfo = PageUtils.page2(deploymentlist, pageNum, pageSize);
97
+        return pageInfo;
98
+    }
99
+    
100
+    
101
+    /**
102
+     * 初始化启动流程,读取启动流程的表单字段来渲染start form
103
+     */
104
+    @RequestMapping(value = "get-form/start")
105
+    @ResponseBody
106
+    @SuppressWarnings("unchecked")
107
+    public Map<String, Object> findStartForm(String processDefinitionId,String key) throws Exception {
108
+        Map<String, Object> result = new HashMap<String, Object>();
109
+        StartFormDataImpl startFormData = (StartFormDataImpl) formService.getStartFormData(processDefinitionId);
110
+        startFormData.setProcessDefinition(null);
111
+
112
+	    /*
113
+	     * 读取enum类型数据,用于下拉框
114
+	     */
115
+        List<FormProperty> formProperties = startFormData.getFormProperties();
116
+        for (FormProperty formProperty : formProperties) {
117
+            Map<String, String> values = (Map<String, String>) formProperty.getType().getInformation("values");
118
+            if (values != null) {
119
+                for (Entry<String, String> enumEntry : values.entrySet()) {
120
+                    logger.debug("enum, key: {}, value: {}", enumEntry.getKey(), enumEntry.getValue());
121
+                }
122
+                result.put("enum_" + formProperty.getId(), values);
123
+            }
124
+        }
125
+
126
+        result.put("form", startFormData);
127
+        result.put("key", key);
128
+        result.put("processDefinitionId", processDefinitionId);
129
+
130
+        return result;
131
+    }
132
+    
133
+    public static Map<String, Object> objectToMap(Object obj) throws IllegalAccessException {
134
+    	         Map<String, Object> map = new HashMap<>();
135
+    	         Class<?> clazz = obj.getClass();
136
+    	          for (Field field : clazz.getDeclaredFields()) {
137
+    	              field.setAccessible(true);
138
+    	              String fieldName = field.getName();
139
+    	             Object value = field.get(obj);
140
+    	             map.put(fieldName, value);
141
+    	         }
142
+    	          return map;
143
+    	      }
144
+    
145
+    /**
146
+     * 办理任务,提交task的并保存form
147
+     * @throws IOException 
148
+     * @throws JsonMappingException 
149
+     * @throws JsonParseException 
150
+     */
151
+    @RequestMapping(value = "task/complete")
152
+    public String completeTask(RedirectAttributes redirectAttributes, HttpServletRequest request, String formJson,String keys,String processDefinitionId) throws JsonParseException, JsonMappingException, IOException {
153
+    	
154
+    	UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
155
+		// 把字符串转换为JSONArray对象
156
+//		Object parse = JSON.parse(formJson);
157
+		Map<String, String> formProperties = new HashMap<String, String>();
158
+		List<JSONObject> array = JSON.parseArray(formJson, JSONObject.class);
159
+		for(JSONObject obj : array) {
160
+			String id = obj.getString("id");
161
+			String value = obj.getString("value");
162
+			formProperties.put(id, value);
163
+		}
164
+		
165
+
166
+        logger.debug("start form parameters: {}", formProperties);
167
+        ProcessInstance processInstance = null;
168
+        try {
169
+            //设置提交人的名字
170
+			identityService.setAuthenticatedUserId(userInfo.getUserId().toString());
171
+//            formService.saveFormData(processDefinitionId, formProperties);
172
+            processInstance = formService.submitStartFormData(processDefinitionId, formProperties);
173
+//            formService.submitStartFormData(processDefinition.getId(), formProperties);
174
+        } finally {
175
+            identityService.setAuthenticatedUserId(userInfo.getUserId().toString());
176
+        }
177
+
178
+        String processType = null;
179
+		//        redirectAttributes.addFlashAttribute("message", "任务完成:taskId=" + taskId);
180
+        return processType;
181
+    }
182
+}

+ 176 - 0
src/main/java/com/chinaitop/depot/act/controller/ActModelController.java

@@ -0,0 +1,176 @@
1
+package com.chinaitop.depot.act.controller;
2
+
3
+import java.util.HashMap;
4
+import java.util.List;
5
+import java.util.Map;
6
+
7
+import javax.servlet.http.HttpServletRequest;
8
+import javax.servlet.http.HttpServletResponse;
9
+
10
+import org.activiti.engine.repository.Model;
11
+import org.apache.commons.lang.ObjectUtils;
12
+import org.springframework.beans.factory.annotation.Autowired;
13
+import org.springframework.http.MediaType;
14
+import org.springframework.web.bind.annotation.RequestMapping;
15
+import org.springframework.web.bind.annotation.RequestMethod;
16
+import org.springframework.web.bind.annotation.RestController;
17
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
18
+
19
+import com.chinaitop.depot.act.model.Act;
20
+import com.chinaitop.depot.act.model.DeploymentList;
21
+import com.chinaitop.depot.act.service.ActModelService;
22
+import com.chinaitop.depot.business.model.UserInfo;
23
+import com.chinaitop.depot.utils.activiti.PageUtils;
24
+import com.fasterxml.jackson.databind.ObjectMapper;
25
+import com.github.pagehelper.PageHelper;
26
+import com.github.pagehelper.PageInfo;
27
+import com.github.pagehelper.util.StringUtil;
28
+
29
+/**
30
+ * 流程模型相关Controller
31
+ * @author xujh
32
+ * @version 2017-09-30
33
+ */
34
+@RestController
35
+@RequestMapping(value = "act/model")
36
+public class ActModelController {
37
+	@Autowired
38
+	private ActModelService actModelService;
39
+	
40
+	
41
+	/**
42
+	 * 查找用户信息
43
+	 * @param pageNum 页码
44
+	 * @param pageSize 页码显示条数
45
+	 * @return
46
+	 */
47
+	/*@RequestMapping(value="/getModel", produces = MediaType.APPLICATION_JSON_VALUE)
48
+	public PageInfo<Model> getUser(Integer pageNum, Integer pageSize) {
49
+		PageHelper.startPage(pageNum, pageSize);
50
+		List<Model> list = actModelService.queryByExample();
51
+		
52
+		PageInfo<Model> pageInfo = new PageInfo<Model>(list);
53
+		return pageInfo;
54
+	}*/
55
+	@RequestMapping(value="/getModel", produces = MediaType.APPLICATION_JSON_VALUE)
56
+	public PageInfo<Model> getUser(Integer pageNum, Integer pageSize, HttpServletRequest request) {
57
+		//UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
58
+		Integer orgId= (Integer) request.getSession().getAttribute("orgId");
59
+		//ObjectMapper mapper = new ObjectMapper();
60
+		//String userInfoObject = ObjectUtils.toString(request.getSession().getAttribute("userInfo"),"");
61
+		/*if(!userInfoObject.isEmpty()) {
62
+			UserInfo userInfo = mapper.readValue(userInfoObject, UserInfo.class);
63
+			//UserInfo userInfo = (UserInfo)request.getSession().getAttribute("userInfo");
64
+			modelMap.put("userInfo", userInfo);
65
+		}*/
66
+		
67
+		
68
+		
69
+		//Integer orgId = userInfo.getOrgId();
70
+		//Integer orgId = 12;
71
+		//Integer depotId = (Integer)request.getSession().getAttribute("depotId");
72
+		Integer depotId = orgId;
73
+		if (StringUtil.isNotEmpty(depotId.toString())) {
74
+			String category=depotId.toString();
75
+			PageHelper.startPage(pageNum, pageSize);
76
+			List<Model> list = actModelService.modelList(category);
77
+			PageInfo<Model> pageInfo = PageUtils.page2(list, pageNum, pageSize);
78
+//			PageInfo<Model> pageInfo = new PageInfo<Model>(list);
79
+			return pageInfo;
80
+		}else {
81
+			String category=orgId.toString();
82
+			PageHelper.startPage(pageNum, pageSize);
83
+			List<Model> list = actModelService.modelList(category);
84
+			PageInfo<Model> pageInfo = PageUtils.page2(list, pageNum, pageSize);
85
+//			PageInfo<Model> pageInfo = new PageInfo<Model>(list);
86
+			return pageInfo;
87
+		}
88
+	}
89
+	
90
+	
91
+	
92
+	/**
93
+	 * 创建模型
94
+	 * @param name流程图的名字
95
+	 * @param key 流程启动的key值
96
+	 * @param description 流程描述
97
+	 * @param category 流程图
98
+	 * @return
99
+	 */
100
+	@RequestMapping(value = "create", method = RequestMethod.POST)
101
+	public void create(String name, String key, String description, 
102
+			HttpServletRequest request, HttpServletResponse response) {
103
+		try {
104
+			Integer depotId =(Integer) request.getSession().getAttribute("depotId");
105
+			UserInfo userInfo = (UserInfo)request.getSession().getAttribute("userInfo");
106
+			Integer orgId = userInfo.getOrgId();
107
+			if(StringUtil.isNotEmpty(depotId.toString())){
108
+				String category = depotId.toString();
109
+				org.activiti.engine.repository.Model modelData = actModelService.create(name, key, description, category);
110
+				String modelId = modelData.getId();
111
+				response.getWriter().write(modelId);
112
+			}else {
113
+				org.activiti.engine.repository.Model modelData = actModelService.create(name, key, description, orgId.toString());
114
+				String modelId = modelData.getId();
115
+				response.getWriter().write(modelId);
116
+			}
117
+			
118
+		} catch (Exception e) {
119
+			e.printStackTrace();
120
+		}
121
+	}
122
+	
123
+	/**
124
+	 * 
125
+	 * @param id 根据编号查找用户信息
126
+	 * 
127
+	 * @return
128
+	 */
129
+	@RequestMapping(value="/edit", produces = MediaType.APPLICATION_JSON_VALUE)
130
+	public Act edit(Integer id) {
131
+		Act act = new Act();
132
+		if (id != null) {
133
+//			user = userService.findById(id);
134
+		}
135
+		return act;
136
+	}
137
+	
138
+	/**
139
+	 * 删除Model
140
+	 * @param id 根据id删除
141
+	 * @param redirectAttributes 返回信息
142
+	 * @return
143
+	 */
144
+	@RequestMapping(value = "delete")
145
+	public String delete(String id, RedirectAttributes redirectAttributes) {
146
+		actModelService.delete(id);
147
+		redirectAttributes.addFlashAttribute("message", "删除成功,模型ID=" + id);
148
+		return null;
149
+	}
150
+	
151
+	/**
152
+	 * 导出model的xml文件
153
+	 * @param id根据id导出xml文件
154
+	 * 
155
+	 */
156
+	@RequestMapping(value = "export")
157
+	public void export(String id, HttpServletResponse response) {
158
+		actModelService.export(id, response);
159
+	}
160
+	
161
+	/**
162
+	 * 根据Model部署流程
163
+	 * @param id根据id部署流程定义
164
+	 * @param redirectAttributes 返回信息
165
+	 */
166
+	@RequestMapping(value = "deploy")
167
+	public Map<String, Object> deploy(String id, RedirectAttributes redirectAttributes) {
168
+		String message = actModelService.deploy(id);
169
+		Map<String, Object> modelMap = new HashMap<String, Object>();
170
+		modelMap.put("status", message);
171
+		redirectAttributes.addFlashAttribute("message", message);
172
+//		return "redirect:" + adminPath + "/act/process";
173
+		return modelMap;
174
+	}
175
+	
176
+}

+ 233 - 0
src/main/java/com/chinaitop/depot/act/controller/ActProcessController.java

@@ -0,0 +1,233 @@
1
+package com.chinaitop.depot.act.controller;
2
+
3
+import java.io.IOException;
4
+import java.io.InputStream;
5
+import java.io.OutputStream;
6
+import java.io.UnsupportedEncodingException;
7
+import java.util.ArrayList;
8
+import java.util.List;
9
+
10
+import javax.annotation.Resource;
11
+import javax.servlet.http.HttpServletRequest;
12
+import javax.servlet.http.HttpServletResponse;
13
+import javax.xml.stream.XMLStreamException;
14
+
15
+import org.activiti.engine.repository.ProcessDefinition;
16
+import org.springframework.beans.factory.annotation.Value;
17
+import org.springframework.ui.Model;
18
+import org.springframework.web.bind.annotation.PathVariable;
19
+import org.springframework.web.bind.annotation.RequestMapping;
20
+import org.springframework.web.bind.annotation.RequestMethod;
21
+import org.springframework.web.bind.annotation.ResponseBody;
22
+import org.springframework.web.bind.annotation.RestController;
23
+import org.springframework.web.multipart.MultipartFile;
24
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
25
+
26
+import com.chinaitop.depot.act.model.DeploymentList;
27
+import com.chinaitop.depot.act.service.ActProcessService;
28
+import com.chinaitop.depot.act.service.DeleteService;
29
+import com.chinaitop.depot.utils.activiti.PageUtils;
30
+import com.github.pagehelper.PageHelper;
31
+import com.github.pagehelper.PageInfo;
32
+
33
+/**
34
+ * 流程定义相关Controller
35
+ * @author xujh
36
+ * @version 2017-10-10
37
+ */
38
+@RestController
39
+@RequestMapping(value = "/act/process")
40
+public class ActProcessController{
41
+
42
+	@Resource
43
+	private ActProcessService actProcessService;
44
+	@Resource
45
+	private DeleteService deleteService;
46
+
47
+	/**
48
+	 * 流程定义列表
49
+	 * @param pageNum 页数
50
+	 * @param pageSize 每页多少条数
51
+	 * @return
52
+	 */
53
+	@RequestMapping(value="/processList")
54
+	public PageInfo<DeploymentList> processList(Integer pageNum, Integer pageSize, HttpServletRequest request) {
55
+		PageHelper.startPage(pageNum, pageSize);
56
+		List<ProcessDefinition> processList = actProcessService.processList(request);
57
+		List<DeploymentList> deploymentlist=new ArrayList<DeploymentList>();
58
+		if(processList!=null&&processList.size()>0){
59
+			for(ProcessDefinition m: processList){
60
+				DeploymentList deploymentLists=new DeploymentList();
61
+				deploymentLists.setId(m.getId());
62
+				deploymentLists.setName(m.getName());
63
+				deploymentLists.setKey(m.getKey());
64
+				deploymentLists.setVersion(m.getVersion());
65
+				deploymentLists.setResourceName(m.getResourceName());
66
+				deploymentLists.setDiagramResourceName(m.getDiagramResourceName());
67
+				deploymentLists.setDeploymentId(m.getDeploymentId());
68
+				deploymentlist.add(deploymentLists);
69
+			}
70
+			
71
+		}
72
+		PageInfo<DeploymentList> pageInfo = PageUtils.page2(deploymentlist, pageNum, pageSize);
73
+//		PageInfo<DeploymentList> pageInfo = new PageInfo<DeploymentList>(deploymentlist);
74
+		return pageInfo;
75
+	}
76
+	
77
+	/**
78
+	 * 运行中的实例列表
79
+	 */
80
+	@RequestMapping(value = "running")
81
+	public String runningList(String procInsId, String procDefKey, HttpServletRequest request, HttpServletResponse response, Model model) {
82
+	    /*Page<ProcessInstance> page = actProcessService.runningList(new Page<ProcessInstance>(request, response), procInsId, procDefKey);
83
+		model.addAttribute("page", page);
84
+		model.addAttribute("procInsId", procInsId);
85
+		model.addAttribute("procDefKey", procDefKey);*/
86
+		return "modules/act/actProcessRunningList";
87
+	}
88
+
89
+	/**
90
+	 * 部署流程
91
+	 */
92
+	@RequestMapping(value = "/deploy", method=RequestMethod.GET)
93
+	public String deploy(Model model) {
94
+		return "modules/act/actProcessDeploy";
95
+	}
96
+	
97
+	/**
98
+	 * 部署流程 - 保存
99
+	 */
100
+	@RequestMapping(value = "/deploy", method=RequestMethod.POST)
101
+	public String deploy(@Value("#{APP_PROP['activiti.export.diagram.path']}") String exportDir, 
102
+			String category, MultipartFile file, RedirectAttributes redirectAttributes) {
103
+
104
+		String fileName = file.getOriginalFilename();
105
+		
106
+		if (fileName==null){
107
+			redirectAttributes.addFlashAttribute("message", "请选择要部署的流程文件");
108
+		}else{
109
+			String message = actProcessService.deploy(exportDir, category, file);
110
+			redirectAttributes.addFlashAttribute("message", message);
111
+		}
112
+
113
+//		return "redirect:" + adminPath + "/act/process";
114
+		return null;
115
+	}
116
+	
117
+	/**
118
+	 * 设置流程分类
119
+	 */
120
+	@RequestMapping(value = "updateCategory")
121
+	public String updateCategory(String procDefId, String category, RedirectAttributes redirectAttributes) {
122
+		actProcessService.updateCategory(procDefId, category);
123
+//		return "redirect:" + adminPath + "/act/process";
124
+		return null;
125
+	}
126
+
127
+	/**
128
+	 * 挂起、激活流程实例
129
+	 */
130
+	@RequestMapping(value = "update/{state}")
131
+	public String updateState(@PathVariable("state") String state, String procDefId, RedirectAttributes redirectAttributes) {
132
+		String message = actProcessService.updateState(state, procDefId);
133
+		redirectAttributes.addFlashAttribute("message", message);
134
+//		return "redirect:" + adminPath + "/act/process";
135
+		return null;
136
+	}
137
+	
138
+	/**
139
+	 * 将部署的流程转换为模型
140
+	 */
141
+	@RequestMapping(value = "convert/toModel")
142
+	public String convertToModel(String procDefId, RedirectAttributes redirectAttributes) throws UnsupportedEncodingException, XMLStreamException {
143
+		org.activiti.engine.repository.Model modelData = actProcessService.convertToModel(procDefId);
144
+		redirectAttributes.addFlashAttribute("message", "转换模型成功,模型ID="+modelData.getId());
145
+//		return "redirect:" + adminPath + "/act/model";
146
+		return null;
147
+	}
148
+	
149
+	/**
150
+	 * 导出图片文件到硬盘
151
+	 */
152
+	@RequestMapping(value = "export/diagrams")
153
+	@ResponseBody
154
+	public List<String> exportDiagrams(@Value("#{APP_PROP['activiti.export.diagram.path']}") String exportDir) throws IOException {
155
+		List<String> files = actProcessService.exportDiagrams(exportDir);
156
+		return files;
157
+	}
158
+
159
+	/**
160
+	 * 删除部署的流程,级联删除流程实例
161
+	 * @param deploymentId 流程部署ID
162
+	 * @param redirectAttributes 返回信息
163
+	 */
164
+	@RequestMapping(value = "delete")
165
+	public String delete(String deploymentId,RedirectAttributes redirectAttributes) {
166
+		deleteService.deleteDeployment(deploymentId);
167
+		redirectAttributes.addFlashAttribute("message", "删除成功,模型ID=" + deploymentId);
168
+		return null;
169
+	}
170
+	
171
+	/**
172
+	 * 删除流程实例
173
+	 * @param procInsId 流程实例ID
174
+	 * @param reason 删除原因
175
+	 * @param redirectAttributes 返回信息
176
+	 */
177
+	@RequestMapping(value = "deleteProcIns")
178
+	public String deleteProcIns(String procInsId, String reason, RedirectAttributes redirectAttributes) {
179
+		if (reason==null){
180
+			addMessage(redirectAttributes, "请填写删除原因");
181
+		}else{
182
+			actProcessService.deleteProcIns(procInsId, reason);
183
+			addMessage(redirectAttributes, "删除流程实例成功,实例ID=" + procInsId);
184
+		}
185
+//		return "redirect:" + adminPath + "/act/process/running/";
186
+		return null;
187
+	}
188
+	
189
+	/**
190
+	 * 添加Flash消息
191
+	 */
192
+	protected void addMessage(RedirectAttributes redirectAttributes, String... messages) {
193
+		StringBuilder sb = new StringBuilder();
194
+		for (String message : messages){
195
+			sb.append(message).append(messages.length>1?"<br/>":"");
196
+		}
197
+		redirectAttributes.addFlashAttribute("message", sb.toString());
198
+	}
199
+	
200
+	/**
201
+	 * 查看流程图
202
+	 * @throws IOException 
203
+	 * @throws Exception 
204
+	 * @param deploymentId 流程定义的id
205
+	 * @param imageName 定义流程图的名字
206
+	 */
207
+	@RequestMapping(value = "viewImage")
208
+	public String viewImage(String deploymentId,String imageName,HttpServletResponse response) throws IOException{
209
+		InputStream in  = deleteService.findImageInputStream(deploymentId, imageName);
210
+		//3:从response对象获取输出流
211
+		OutputStream out = response.getOutputStream();
212
+//		OutputStream out = ServletActionContext.getResponse().getOutputStream();
213
+		//4:将输入流中的数据读取出来,写到输出流中
214
+		for(int b=-1;(b=in.read())!=-1;){
215
+			out.write(b);
216
+		}
217
+		out.close();
218
+		in.close();
219
+		return null;
220
+	}
221
+	
222
+	@RequestMapping(value = "resource/read")
223
+	public void resourceRead(String procDefId, String proInsId, String resType, HttpServletResponse response) throws Exception {
224
+		resType="xml";
225
+		InputStream resourceAsStream = actProcessService.resourceRead(procDefId, proInsId, resType);
226
+		byte[] b = new byte[1024];
227
+		int len = -1;
228
+		while ((len = resourceAsStream.read(b, 0, 1024)) != -1) {
229
+			response.getOutputStream().write(b, 0, len);
230
+		}
231
+	}
232
+	
233
+}

+ 82 - 0
src/main/java/com/chinaitop/depot/act/controller/ActRoleController.java

@@ -0,0 +1,82 @@
1
+package com.chinaitop.depot.act.controller;
2
+
3
+import com.chinaitop.depot.act.service.ActTaskService;
4
+import com.chinaitop.depot.business.model.RoleInfo;
5
+import com.chinaitop.depot.business.model.RoleInfoExample;
6
+import com.chinaitop.depot.business.model.UserInfo;
7
+import com.chinaitop.depot.business.service.RoleInfoService;
8
+import org.activiti.engine.delegate.Expression;
9
+import org.activiti.engine.impl.task.TaskDefinition;
10
+import org.springframework.web.bind.annotation.RequestMapping;
11
+import org.springframework.web.bind.annotation.RestController;
12
+
13
+import javax.annotation.Resource;
14
+import java.util.*;
15
+
16
+@RestController
17
+@RequestMapping(value = "/act/roleList")
18
+public class ActRoleController {
19
+	@Resource
20
+	private ActTaskService actTaskService;
21
+
22
+	@Resource
23
+	private RoleInfoService roleInfoService;
24
+	/**
25
+	 * 查看下一个流程定义的人
26
+	 * @throws Exception
27
+	 * @param procInstId 流程定义的id
28
+	 */
29
+	@RequestMapping(value="/getUserList")
30
+	public Map<String, Object> getUserList(String procInstId, String type,Integer orgId) throws Exception{
31
+		/*procInstId = "190075";*/
32
+		int roleId = 0 ;
33
+		Map <String, Object> modelMap = new HashMap<String, Object>();
34
+		TaskDefinition nextTaskDefinition = actTaskService.nextTaskDefinition(procInstId);
35
+		if(nextTaskDefinition!=null){
36
+			Set<Expression> candidateGroupIdExpressions = nextTaskDefinition.getCandidateGroupIdExpressions();
37
+
38
+			List<RoleInfo> roleInfoList = new ArrayList<RoleInfo>();
39
+			for (Expression expression : candidateGroupIdExpressions) {
40
+				String string = expression.toString();
41
+				roleId = Integer.parseInt(string);
42
+				RoleInfo roleInfo = roleInfoService.findById(roleId);
43
+				if(roleInfo != null){
44
+					RoleInfoExample example = new RoleInfoExample();
45
+					RoleInfoExample.Criteria createCriteria = example.createCriteria();
46
+					createCriteria.andRoleNameEqualTo(roleInfo.getRoleName());
47
+					createCriteria.andOrgIdEqualTo(orgId);
48
+					roleInfoList.addAll(roleInfoService.queryByExample(example));
49
+				}
50
+			}
51
+			List<UserInfo> userByRoleId = new ArrayList<UserInfo>();
52
+			if(type.equals("transferContract")){
53
+				for(RoleInfo r : roleInfoList){
54
+					if(r.getRoleName().equals("中转部经理") || r.getRoleName().equals("库领导") ){
55
+						userByRoleId = actTaskService.getUserByRoleId(r.getRoleId(),orgId);
56
+						break;
57
+					}
58
+				}
59
+			}else{
60
+				for(RoleInfo r : roleInfoList){
61
+					if(r.getRoleName().equals("经营部经理") || r.getRoleName().equals("库领导") || r.getRoleName().equals("财务") ){
62
+						userByRoleId = actTaskService.getUserByRoleId(r.getRoleId(),orgId);
63
+						break;
64
+					}
65
+				}
66
+			}
67
+
68
+			if(userByRoleId.size()>0&&userByRoleId!=null){
69
+				modelMap.put("userByRoleId", userByRoleId);
70
+			}else {
71
+				modelMap.put("isEnd", true);
72
+			}
73
+
74
+		}else {
75
+			modelMap.put("isEnd", true);
76
+
77
+		}
78
+		return modelMap;
79
+
80
+	}
81
+
82
+}

+ 176 - 0
src/main/java/com/chinaitop/depot/act/controller/ActTaskController.java

@@ -0,0 +1,176 @@
1
+package com.chinaitop.depot.act.controller;
2
+import java.util.ArrayList;
3
+import java.util.HashMap;
4
+import java.util.List;
5
+import java.util.Map;
6
+import javax.annotation.Resource;
7
+import javax.servlet.http.HttpServletRequest;
8
+import javax.servlet.http.HttpServletResponse;
9
+import org.springframework.http.MediaType;
10
+import org.springframework.ui.Model;
11
+import org.springframework.web.bind.annotation.RequestMapping;
12
+import org.springframework.web.bind.annotation.ResponseBody;
13
+import org.springframework.web.bind.annotation.RestController;
14
+import com.chinaitop.depot.act.model.Act;
15
+import com.chinaitop.depot.act.model.DeploymentList;
16
+import com.chinaitop.depot.act.model.HistoryList;
17
+import com.chinaitop.depot.act.service.ActTaskService;
18
+import com.chinaitop.depot.business.model.BusinessPlan;
19
+import com.chinaitop.depot.business.model.enums.TaskType;
20
+import com.chinaitop.depot.business.service.BusinessPlanService;
21
+import com.github.pagehelper.PageHelper;
22
+import com.github.pagehelper.PageInfo;
23
+
24
+
25
+/**
26
+ * 流程个人任务相关Controller
27
+ * @author xujh
28
+ * @version 2017-10-10
29
+ */
30
+@RestController
31
+@RequestMapping(value = "/act/task")
32
+public class ActTaskController {
33
+
34
+	@Resource
35
+	private ActTaskService actTaskService;
36
+	@Resource
37
+	private BusinessPlanService planService;
38
+	
39
+	/**
40
+	 * 获取待办列表
41
+	 * @param name 名字
42
+	 * @param act 实体类
43
+	 * @param pageNum 页数
44
+	 * @param pageSize 每页显示多少条
45
+	 * @param taskType  任务类型
46
+	 * @return
47
+	 */
48
+	@RequestMapping(value="/todoList", produces = MediaType.APPLICATION_JSON_VALUE)
49
+	public PageInfo<DeploymentList> todoList(String name,Act act,HttpServletResponse response, Integer pageNum, Integer pageSize,TaskType taskType) {
50
+		PageHelper.startPage(pageNum, pageSize);
51
+		name="1";
52
+		List<DeploymentList> todoList = actTaskService.todoList(name,taskType);
53
+		
54
+		PageInfo<DeploymentList> pageInfo = new PageInfo<DeploymentList>(todoList);
55
+		return pageInfo;
56
+	}
57
+	
58
+	
59
+	/**
60
+	 * 获取已办任务
61
+	 * @param name名字
62
+	 * @param taskType 任务类型
63
+	 * @param pageNum 页数
64
+	 * @param pageSize 每页显示多少条
65
+	 * @return
66
+	 */
67
+	@RequestMapping(value = "historic")
68
+	public PageInfo<DeploymentList> historicList(String name,String taskType, Integer pageNum, Integer pageSize) throws Exception {
69
+		PageHelper.startPage(pageNum, pageSize);
70
+		List<DeploymentList> historicList = actTaskService.historicList(name, taskType);
71
+		
72
+		PageInfo<DeploymentList> pageInfo = new PageInfo<DeploymentList>(historicList);
73
+		return pageInfo;
74
+	}
75
+
76
+	
77
+	/**
78
+	 * 获取流程表单
79
+	 * @param act	流程实体类
80
+	 * @param request	
81
+	 * @param model 
82
+	 * @param startAct 开始
83
+	 * @param endAct 结束
84
+	 */
85
+	@RequestMapping(value = "form")
86
+	public Map<String, Object> form(Act act, HttpServletRequest request, Model model, String startAct, String endAct){
87
+		
88
+		// 获取流程XML上的表单KEY
89
+		String formKey = actTaskService.getFormKey(act.getProcDefId(), act.getTaskDefKey());
90
+
91
+		// 获取流程实例对象
92
+		if (act.getProcInsId() != null){
93
+			act.setProcIns(actTaskService.getProcIns(act.getProcInsId()));
94
+		}
95
+		Map<String, Object> modelMap = new HashMap<String, Object>();
96
+		modelMap.put("url", formKey);
97
+		modelMap.put("taskId", act.getTaskId());
98
+		modelMap.put("taskName", act.getTaskName());
99
+		modelMap.put("taskDefKey", act.getTaskDefKey());
100
+		modelMap.put("procInsId", act.getProcInsId());
101
+		modelMap.put("procDefId", act.getProcDefId());
102
+		modelMap.put("status", act.getStatus());
103
+		modelMap.put("id", act.getBusinessId());
104
+		//得到流程对应的业务id
105
+		String businessId = act.getBusinessId();
106
+		Integer id = Integer.valueOf(businessId);
107
+		BusinessPlan plan = planService.findById(id);
108
+		//根据procInsId查找历史审批意见
109
+		String procInsId = act.getProcInsId();
110
+		
111
+		List<HistoryList> histoicFlowList = actTaskService.histoicFlowList(procInsId, startAct, endAct);
112
+		
113
+		List<HistoryList> historyList=new ArrayList<HistoryList>();
114
+		
115
+		if(histoicFlowList!=null&&histoicFlowList.size()>0){
116
+			for(HistoryList m: histoicFlowList){
117
+				HistoryList historyLists=new HistoryList();
118
+				historyLists.setAssigneeName(m.getAssigneeName());
119
+				historyLists.setComment(m.getComment());
120
+				historyList.add(historyLists);
121
+			}
122
+		}
123
+		modelMap.put("plan", plan);
124
+		modelMap.put("histoicFlowList", historyList);
125
+		return modelMap;
126
+//		return "redirect:" + ActUtils.getFormUrl(formKey, act);
127
+	}
128
+	
129
+
130
+	/**
131
+	 * 完成任务
132
+	 * @param act 流程定义的实体类
133
+	 * @param procInsId 流程实例ID
134
+	 * @param comment 任务提交意见的内容
135
+	 */
136
+	@RequestMapping(value = "complete")
137
+	@ResponseBody
138
+	public String complete(Act act,String taskId,String procInsId,String comment) {
139
+//		actTaskService.complete(act.getTaskId(), act.getProcInsId(), act.getComment(), act.getVars().getVariableMap());
140
+		return "true";//adminPath + "/act/task";
141
+	}
142
+	
143
+
144
+	/**
145
+	 * 获取历史审批意见
146
+	 * @param procInsId	流程实例ID
147
+	 * @param startAct	开始
148
+	 * @param endAct 结束
149
+	 * @param pageNum 页数
150
+	 * @param pageSize 每页显示多少条
151
+	 */
152
+	@RequestMapping(value = "/historyList")
153
+	public Map<String, Object> historyList(String procInsId,String startAct, String endAct,Integer pageNum, Integer pageSize){
154
+		List<HistoryList> histoicFlowList = actTaskService.histoicFlowList(procInsId, startAct, endAct);
155
+		Map<String, Object> modelMap = new HashMap<String, Object>();
156
+		List<HistoryList> historyList=new ArrayList<HistoryList>();
157
+		if(histoicFlowList!=null&&histoicFlowList.size()>0){
158
+			for(HistoryList m: histoicFlowList){
159
+				HistoryList historyLists=new HistoryList();
160
+				historyLists.setAssigneeName(m.getAssigneeName());
161
+				historyLists.setComment(m.getComment());
162
+				historyList.add(historyLists);
163
+			}
164
+		}
165
+		modelMap.put("histoicFlowList", historyList);
166
+		return modelMap;
167
+	}
168
+	
169
+	@RequestMapping(value = "/submintAgent")
170
+	public Map<String, Object> SubmintAgent(String processInstanceId,String userId){
171
+		Map<String, Object> modelMap = new HashMap<String, Object>();
172
+		String mgs = actTaskService.setAssigneeTask(processInstanceId, userId);
173
+		modelMap.put("mgs", mgs);
174
+		return modelMap;
175
+	}
176
+}

+ 51 - 0
src/main/java/com/chinaitop/depot/act/controller/ActTemplateController.java

@@ -0,0 +1,51 @@
1
+package com.chinaitop.depot.act.controller;
2
+
3
+import java.io.UnsupportedEncodingException;
4
+
5
+import javax.servlet.http.HttpServletRequest;
6
+import javax.xml.stream.XMLStreamException;
7
+
8
+import org.apache.commons.lang3.StringUtils;
9
+import org.springframework.beans.factory.annotation.Autowired;
10
+import org.springframework.http.MediaType;
11
+import org.springframework.web.bind.annotation.RequestMapping;
12
+import org.springframework.web.bind.annotation.RequestMethod;
13
+import org.springframework.web.bind.annotation.RestController;
14
+import org.springframework.web.multipart.MultipartFile;
15
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
16
+
17
+import com.chinaitop.depot.act.service.ActTemplateService;
18
+@RestController
19
+@RequestMapping(value = "/act/template")
20
+public class ActTemplateController {
21
+	@Autowired
22
+	private ActTemplateService actTemplateService;
23
+	
24
+	@RequestMapping(value = "/deploy", method=RequestMethod.POST)
25
+	public String deploy( MultipartFile file, RedirectAttributes redirectAttributes, HttpServletRequest request) {
26
+
27
+		String fileName = file.getOriginalFilename();
28
+		
29
+		if (StringUtils.isBlank(fileName)){
30
+			redirectAttributes.addFlashAttribute("message", "请选择要部署的流程文件");
31
+		}else{
32
+			String message = actTemplateService.deploy(file,request);
33
+			return message;
34
+		}
35
+		return null;
36
+	}
37
+	
38
+	/**
39
+	 * 将部署的流程转换为模型
40
+	 * @param procDefId
41
+	 * @param redirectAttributes
42
+	 * @return
43
+	 * @throws UnsupportedEncodingException
44
+	 * @throws XMLStreamException
45
+	 */
46
+	@RequestMapping(value = "convert/toModel")
47
+	public String convertToModel(String procDefId, RedirectAttributes redirectAttributes ) throws UnsupportedEncodingException, XMLStreamException {
48
+		org.activiti.engine.repository.Model modelData = actTemplateService.convertToModel(procDefId);
49
+		return "转换模型成功,模型ID="+modelData.getId();
50
+	}
51
+}

+ 8 - 0
src/main/java/com/chinaitop/depot/act/mapper/ActMapper.java

@@ -0,0 +1,8 @@
1
+package com.chinaitop.depot.act.mapper;
2
+
3
+import com.chinaitop.depot.act.model.Act;
4
+
5
+
6
+public interface ActMapper {
7
+	public int updateProcInsIdByBusinessId(Act act);
8
+}

+ 11 - 0
src/main/java/com/chinaitop/depot/act/mapper/ActMapper.xml

@@ -0,0 +1,11 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.chinaitop.depot.act.mapper.ActMapper">
4
+    
5
+	<update id="updateProcInsIdByBusinessId">
6
+		UPDATE ${businessTable} SET 
7
+			proc_ins_id = #{procInsId}
8
+		WHERE id = #{businessId}
9
+	</update>
10
+	
11
+</mapper>

+ 368 - 0
src/main/java/com/chinaitop/depot/act/model/Act.java

@@ -0,0 +1,368 @@
1
+package com.chinaitop.depot.act.model;
2
+
3
+import java.io.Serializable;
4
+import java.util.Date;
5
+import java.util.List;
6
+import java.util.Map;
7
+import org.activiti.engine.history.HistoricActivityInstance;
8
+import org.activiti.engine.history.HistoricTaskInstance;
9
+import org.activiti.engine.repository.ProcessDefinition;
10
+import org.activiti.engine.runtime.ProcessInstance;
11
+import org.activiti.engine.task.Task;
12
+import com.chinaitop.depot.utils.activiti.StringUtils;
13
+import com.chinaitop.depot.utils.activiti.TimeUtils;
14
+import com.chinaitop.depot.utils.activiti.Variable;
15
+import com.fasterxml.jackson.annotation.JsonFormat;
16
+import com.fasterxml.jackson.annotation.JsonIgnore;
17
+
18
+/**
19
+ * 工作流Entity
20
+ * @author xujh
21
+ * @version 2017-10-11
22
+ */
23
+public class Act implements Serializable{
24
+	
25
+	private static final long serialVersionUID = 1L;
26
+	
27
+	/**
28
+	 * 实体编号(唯一标识)
29
+	 */
30
+	private String id;
31
+	private String taskId; 		// 任务编号
32
+	private String taskName; 	// 任务名称
33
+	private String taskDefKey; 	// 任务定义Key(任务环节标识)
34
+	private String procInsId; 	// 流程实例ID
35
+	private String procDefId; 	// 流程定义ID
36
+	private String procDefKey; 	// 流程定义Key(流程定义标识)
37
+	private String businessTable;	// 业务绑定Table
38
+	private String businessId;		// 业务绑定ID
39
+	private String title; 		// 任务标题
40
+	private String status; 		// 任务状态(todo/claim/finish)
41
+	private String comment; 	// 任务意见
42
+	private String flag; 		// 意见状态
43
+	private Task task; 			// 任务对象
44
+	private ProcessDefinition procDef; 	// 流程定义对象
45
+	private ProcessInstance procIns;	// 流程实例对象
46
+	private HistoricTaskInstance histTask; // 历史任务
47
+	private HistoricActivityInstance histIns;	//历史活动任务
48
+	private String assignee; // 任务执行人编号
49
+	private String assigneeName; // 任务执行人名称
50
+	private Variable vars; 		// 流程变量
51
+	private Date beginDate;	// 开始查询日期
52
+	private Date endDate;	// 结束查询日期
53
+	private List<Act> list; // 任务列表
54
+	private Date startDate;
55
+	private Long usedDate;
56
+	
57
+	
58
+	public String getId() {
59
+		return id;
60
+	}
61
+
62
+	public void setId(String id) {
63
+		this.id = id;
64
+	}
65
+
66
+	public Act() {
67
+		super();
68
+	}
69
+
70
+	public String getTaskId() {
71
+		if (taskId == null && task != null){
72
+			taskId = task.getId();
73
+		}
74
+		return taskId;
75
+	}
76
+
77
+	public void setTaskId(String taskId) {
78
+		this.taskId = taskId;
79
+	}
80
+
81
+	public String getTaskName() {
82
+		if (taskName == null && task != null){
83
+			taskName = task.getName();
84
+		}
85
+		return taskName;
86
+	}
87
+
88
+	public void setTaskName(String taskName) {
89
+		this.taskName = taskName;
90
+	}
91
+
92
+	public String getTaskDefKey() {
93
+		if (taskDefKey == null && task != null){
94
+			taskDefKey = task.getTaskDefinitionKey();
95
+		}
96
+		return taskDefKey;
97
+	}
98
+
99
+	public void setTaskDefKey(String taskDefKey) {
100
+		this.taskDefKey = taskDefKey;
101
+	}
102
+	
103
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
104
+	public Date getTaskCreateDate() {
105
+		if (task != null){
106
+			return task.getCreateTime();
107
+		}
108
+		return null;
109
+	}
110
+	
111
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
112
+	public Date getTaskEndDate() {
113
+		if (histTask != null){
114
+			return histTask.getEndTime();
115
+		}
116
+		return null;
117
+	}
118
+	
119
+	@JsonIgnore
120
+	public Task getTask() {
121
+		return task;
122
+	}
123
+
124
+	public void setTask(Task task) {
125
+		this.task = task;
126
+	}
127
+
128
+	@JsonIgnore
129
+	public ProcessDefinition getProcDef() {
130
+		return procDef;
131
+	}
132
+
133
+	public void setProcDef(ProcessDefinition procDef) {
134
+		this.procDef = procDef;
135
+	}
136
+	
137
+	public String getProcDefName() {
138
+		return procDef.getName();
139
+	}
140
+
141
+	@JsonIgnore
142
+	public ProcessInstance getProcIns() {
143
+		return procIns;
144
+	}
145
+
146
+	public void setProcIns(ProcessInstance procIns) {
147
+		this.procIns = procIns;
148
+		if (procIns != null && procIns.getBusinessKey() != null){
149
+			String[] ss = procIns.getBusinessKey().split(":");
150
+			setBusinessTable(ss[0]);
151
+			setBusinessId(ss[1]);
152
+		}
153
+	}
154
+
155
+	public String getTitle() {
156
+		return title;
157
+	}
158
+
159
+	public void setTitle(String title) {
160
+		this.title = title;
161
+	}
162
+	
163
+	public String getStatus() {
164
+		return status;
165
+	}
166
+
167
+	public void setStatus(String status) {
168
+		this.status = status;
169
+	}
170
+
171
+	@JsonIgnore
172
+	public HistoricTaskInstance getHistTask() {
173
+		return histTask;
174
+	}
175
+
176
+	public void setHistTask(HistoricTaskInstance histTask) {
177
+		this.histTask = histTask;
178
+	}
179
+
180
+	@JsonIgnore
181
+	public HistoricActivityInstance getHistIns() {
182
+		return histIns;
183
+	}
184
+
185
+	public void setHistIns(HistoricActivityInstance histIns) {
186
+		this.histIns = histIns;
187
+	}
188
+
189
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
190
+	public Date getBeginDate() {
191
+		return beginDate;
192
+	}
193
+
194
+	public void setBeginDate(Date beginDate) {
195
+		this.beginDate = beginDate;
196
+	}
197
+
198
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
199
+	public Date getEndDate() {
200
+		return endDate;
201
+	}
202
+
203
+	public void setEndDate(Date endDate) {
204
+		this.endDate = endDate;
205
+	}
206
+
207
+	public String getComment() {
208
+		return comment;
209
+	}
210
+
211
+	public void setComment(String comment) {
212
+		this.comment = comment;
213
+	}
214
+
215
+	public String getFlag() {
216
+		return flag;
217
+	}
218
+
219
+	public void setFlag(String flag) {
220
+		this.flag = flag;
221
+	}
222
+
223
+	public String getProcDefId() {
224
+		if (procDefId == null && task != null){
225
+			procDefId = task.getProcessDefinitionId();
226
+		}
227
+		return procDefId;
228
+	}
229
+
230
+	public void setProcDefId(String procDefId) {
231
+		this.procDefId = procDefId;
232
+	}
233
+
234
+	public String getProcInsId() {
235
+		if (procInsId == null && task != null){
236
+			procInsId = task.getProcessInstanceId();
237
+		}
238
+		return procInsId;
239
+	}
240
+
241
+	public void setProcInsId(String procInsId) {
242
+		this.procInsId = procInsId;
243
+	}
244
+
245
+	public String getBusinessId() {
246
+		return businessId;
247
+	}
248
+
249
+	public void setBusinessId(String businessId) {
250
+		this.businessId = businessId;
251
+	}
252
+
253
+	public String getBusinessTable() {
254
+		return businessTable;
255
+	}
256
+
257
+	public void setBusinessTable(String businessTable) {
258
+		this.businessTable = businessTable;
259
+	}
260
+
261
+	public String getAssigneeName() {
262
+		return assigneeName;
263
+	}
264
+
265
+	public void setAssigneeName(String assigneeName) {
266
+		this.assigneeName = assigneeName;
267
+	}
268
+
269
+	public String getAssignee() {
270
+		if (assignee == null && task != null){
271
+			assignee = task.getAssignee();
272
+		}
273
+		return assignee;
274
+	}
275
+
276
+	public void setAssignee(String assignee) {
277
+		this.assignee = assignee;
278
+	}
279
+
280
+	public List<Act> getList() {
281
+		return list;
282
+	}
283
+
284
+	public void setList(List<Act> list) {
285
+		this.list = list;
286
+	}
287
+
288
+	public Variable getVars() {
289
+		return vars;
290
+	}
291
+
292
+	public void setVars(Variable vars) {
293
+		this.vars = vars;
294
+	}
295
+	
296
+	/**
297
+	 * 通过Map设置流程变量值
298
+	 * @param map
299
+	 */
300
+	public void setVars(Map<String, Object> map) {
301
+		this.vars = new Variable(map);
302
+	}
303
+
304
+	/**
305
+	 * 获取流程定义KEY
306
+	 * @return
307
+	 */
308
+	public String getProcDefKey() {
309
+		/*if (StringUtils.isBlank(procDefKey) && StringUtils.isNotBlank(procDefId)){
310
+			procDefKey = StringUtils.split(procDefId, ":")[0];
311
+		}*/
312
+		if (procDefKey==null&& procDefId!=null){
313
+			procDefKey = StringUtils.split(procDefId, ":")[0];
314
+		}
315
+		return procDefKey;
316
+	}
317
+
318
+	public void setProcDefKey(String procDefKey) {
319
+		this.procDefKey = procDefKey;
320
+	}
321
+	
322
+	/**
323
+	 * 获取过去的任务历时
324
+	 * @return
325
+	 */
326
+	public String getDurationTime(){
327
+		if (histIns!=null && histIns.getDurationInMillis() != null){
328
+			return TimeUtils.toTimeString(histIns.getDurationInMillis());
329
+		}
330
+		return "";
331
+	}
332
+	
333
+	/**
334
+	 * 是否是一个待办任务
335
+	 * @return
336
+	 */
337
+	public boolean isTodoTask(){
338
+		return "todo".equals(status) || "claim".equals(status);
339
+	}
340
+	
341
+	/**
342
+	 * 是否是已完成任务
343
+	 * @return
344
+	 */
345
+	public boolean isFinishTask(){
346
+		return "finish".equals(status) || StringUtils.isBlank(taskId);
347
+	}
348
+
349
+	public Date getStartDate() {
350
+		return startDate;
351
+	}
352
+
353
+	public void setStartDate(Date startDate) {
354
+		this.startDate = startDate;
355
+	}
356
+
357
+	public Long getUsedDate() {
358
+		return usedDate;
359
+	}
360
+
361
+	public void setUsedDate(Long usedDate) {
362
+		this.usedDate = usedDate;
363
+	}
364
+
365
+
366
+}
367
+
368
+

+ 128 - 0
src/main/java/com/chinaitop/depot/act/model/DeploymentList.java

@@ -0,0 +1,128 @@
1
+package com.chinaitop.depot.act.model;
2
+
3
+import java.util.Date;
4
+
5
+/**
6
+ * 工作流ProcessDefinition展示内容
7
+ * @author xujh
8
+ * @version 2017-10-11
9
+ */
10
+public class DeploymentList {
11
+	
12
+	private String id;
13
+	private String key; 
14
+	private String name;
15
+	private Integer version;
16
+	private Date createTime;
17
+	private Date lastUpdateTime;
18
+	private String resourceName;
19
+	private String diagramResourceName;
20
+	private String deploymentId;
21
+	private String taskDefKey;
22
+	private String procInsId;
23
+	private String procDefId;
24
+	private String status;
25
+	private String taskName;
26
+	private String taskId;
27
+	private String describe;
28
+	
29
+	public String getId() {
30
+		return id;
31
+	}
32
+	public void setId(String id) {
33
+		this.id = id;
34
+	}
35
+	public String getKey() {
36
+		return key;
37
+	}
38
+	public void setKey(String key) {
39
+		this.key = key;
40
+	}
41
+	public String getName() {
42
+		return name;
43
+	}
44
+	public void setName(String name) {
45
+		this.name = name;
46
+	}
47
+	public Integer getVersion() {
48
+		return version;
49
+	}
50
+	public void setVersion(Integer version) {
51
+		this.version = version;
52
+	}
53
+	
54
+	public Date getCreateTime() {
55
+		return createTime;
56
+	}
57
+	public void setCreateTime(Date createTime) {
58
+		this.createTime = createTime;
59
+	}
60
+	
61
+	public Date getLastUpdateTime() {
62
+		return lastUpdateTime;
63
+	}
64
+	public void setLastUpdateTime(Date lastUpdateTime) {
65
+		this.lastUpdateTime = lastUpdateTime;
66
+	}
67
+	public String getResourceName() {
68
+		return resourceName;
69
+	}
70
+	public void setResourceName(String resourceName) {
71
+		this.resourceName = resourceName;
72
+	}
73
+	public String getDiagramResourceName() {
74
+		return diagramResourceName;
75
+	}
76
+	public void setDiagramResourceName(String diagramResourceName) {
77
+		this.diagramResourceName = diagramResourceName;
78
+	}
79
+	public String getDeploymentId() {
80
+		return deploymentId;
81
+	}
82
+	public void setDeploymentId(String deploymentId) {
83
+		this.deploymentId = deploymentId;
84
+	}
85
+	public String getTaskDefKey() {
86
+		return taskDefKey;
87
+	}
88
+	public void setTaskDefKey(String taskDefKey) {
89
+		this.taskDefKey = taskDefKey;
90
+	}
91
+	public String getProcInsId() {
92
+		return procInsId;
93
+	}
94
+	public void setProcInsId(String procInsId) {
95
+		this.procInsId = procInsId;
96
+	}
97
+	public String getProcDefId() {
98
+		return procDefId;
99
+	}
100
+	public void setProcDefId(String procDefId) {
101
+		this.procDefId = procDefId;
102
+	}
103
+	public String getStatus() {
104
+		return status;
105
+	}
106
+	public void setStatus(String status) {
107
+		this.status = status;
108
+	}
109
+	public String getTaskName() {
110
+		return taskName;
111
+	}
112
+	public void setTaskName(String taskName) {
113
+		this.taskName = taskName;
114
+	}
115
+	public String getTaskId() {
116
+		return taskId;
117
+	}
118
+	public void setTaskId(String taskId) {
119
+		this.taskId = taskId;
120
+	}
121
+	public String getDescribe() {
122
+		return describe;
123
+	}
124
+	public void setDescribe(String describe) {
125
+		this.describe = describe;
126
+	}
127
+	
128
+}

+ 69 - 0
src/main/java/com/chinaitop/depot/act/model/HistoryList.java

@@ -0,0 +1,69 @@
1
+package com.chinaitop.depot.act.model;
2
+
3
+import java.util.Date;
4
+
5
+/**
6
+ * 审批历史意见
7
+ * */
8
+public class HistoryList {
9
+	private String assigneeName;//审批人
10
+	//意见
11
+	private String comment;//审批意见
12
+	
13
+	private Date startTime;//开始时间
14
+	
15
+	private Date EndDate;//结束时间
16
+	
17
+	private String activityName;//审批人岗位
18
+	
19
+	private String department;//申请人部门
20
+
21
+	public String getAssigneeName() {
22
+		return assigneeName;
23
+	}
24
+
25
+	public void setAssigneeName(String assigneeName) {
26
+		this.assigneeName = assigneeName;
27
+	}
28
+
29
+	public String getComment() {
30
+		return comment;
31
+	}
32
+
33
+	public void setComment(String comment) {
34
+		this.comment = comment;
35
+	}
36
+
37
+	public Date getStartTime() {
38
+		return startTime;
39
+	}
40
+
41
+	public void setStartTime(Date startTime) {
42
+		this.startTime = startTime;
43
+	}
44
+
45
+	public Date getEndDate() {
46
+		return EndDate;
47
+	}
48
+
49
+	public void setEndDate(Date endDate) {
50
+		EndDate = endDate;
51
+	}
52
+
53
+	public String getActivityName() {
54
+		return activityName;
55
+	}
56
+
57
+	public void setActivityName(String activityName) {
58
+		this.activityName = activityName;
59
+	}
60
+
61
+	public String getDepartment() {
62
+		return department;
63
+	}
64
+
65
+	public void setDepartment(String department) {
66
+		this.department = department;
67
+	}
68
+	
69
+}

+ 28 - 0
src/main/java/com/chinaitop/depot/act/model/RoleInfoVo.java

@@ -0,0 +1,28 @@
1
+package com.chinaitop.depot.act.model;
2
+
3
+import com.chinaitop.depot.business.model.RoleInfo;
4
+
5
+public class RoleInfoVo extends RoleInfo{
6
+
7
+	private Integer id;
8
+	
9
+	private String name;
10
+
11
+	public Integer getId() {
12
+		return id;
13
+	}
14
+
15
+	public void setId(Integer id) {
16
+		this.id = id;
17
+	}
18
+
19
+	public String getName() {
20
+		return name;
21
+	}
22
+
23
+	public void setName(String name) {
24
+		this.name = name;
25
+	}
26
+	
27
+	
28
+}

+ 483 - 0
src/main/java/com/chinaitop/depot/act/rest/diagram/services/BaseProcessDefinitionDiagramLayoutResource.java

@@ -0,0 +1,483 @@
1
+package com.chinaitop.depot.act.rest.diagram.services;
2
+
3
+import java.util.ArrayList;
4
+import java.util.Collections;
5
+import java.util.HashMap;
6
+import java.util.List;
7
+import java.util.Map;
8
+
9
+import org.activiti.engine.ActivitiException;
10
+import org.activiti.engine.ActivitiObjectNotFoundException;
11
+import org.activiti.engine.HistoryService;
12
+import org.activiti.engine.RepositoryService;
13
+import org.activiti.engine.RuntimeService;
14
+import org.activiti.engine.history.HistoricActivityInstance;
15
+import org.activiti.engine.impl.bpmn.behavior.BoundaryEventActivityBehavior;
16
+import org.activiti.engine.impl.bpmn.behavior.CallActivityBehavior;
17
+import org.activiti.engine.impl.bpmn.parser.BpmnParse;
18
+import org.activiti.engine.impl.bpmn.parser.ErrorEventDefinition;
19
+import org.activiti.engine.impl.bpmn.parser.EventSubscriptionDeclaration;
20
+import org.activiti.engine.impl.jobexecutor.TimerDeclarationImpl;
21
+import org.activiti.engine.impl.persistence.entity.ExecutionEntity;
22
+import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity;
23
+import org.activiti.engine.impl.pvm.PvmTransition;
24
+import org.activiti.engine.impl.pvm.delegate.ActivityBehavior;
25
+import org.activiti.engine.impl.pvm.process.ActivityImpl;
26
+import org.activiti.engine.impl.pvm.process.Lane;
27
+import org.activiti.engine.impl.pvm.process.LaneSet;
28
+import org.activiti.engine.impl.pvm.process.ParticipantProcess;
29
+import org.activiti.engine.impl.pvm.process.TransitionImpl;
30
+import org.activiti.engine.repository.ProcessDefinition;
31
+import org.activiti.engine.runtime.Execution;
32
+import org.activiti.engine.runtime.ProcessInstance;
33
+import org.apache.commons.lang3.StringUtils;
34
+import org.springframework.beans.factory.annotation.Autowired;
35
+
36
+import com.fasterxml.jackson.databind.JsonNode;
37
+import com.fasterxml.jackson.databind.ObjectMapper;
38
+import com.fasterxml.jackson.databind.node.ArrayNode;
39
+import com.fasterxml.jackson.databind.node.ObjectNode;
40
+/**
41
+ * 查看流程图工具
42
+ * @author xujh
43
+ * @version 2017-10-17
44
+ */
45
+public class BaseProcessDefinitionDiagramLayoutResource {
46
+
47
+	@Autowired
48
+	private RuntimeService runtimeService;
49
+
50
+	@Autowired
51
+	private RepositoryService repositoryService;
52
+
53
+	@Autowired
54
+	private HistoryService historyService;
55
+
56
+	@SuppressWarnings("deprecation")
57
+	public ObjectNode getDiagramNode(String processInstanceId, String processDefinitionId) {
58
+		List<String> highLightedFlows = Collections.<String> emptyList();
59
+		List<String> highLightedActivities = Collections.<String> emptyList();
60
+
61
+		Map<String, ObjectNode> subProcessInstanceMap = new HashMap<String, ObjectNode>();
62
+
63
+		ProcessInstance processInstance = null;
64
+		if (processInstanceId != null) {
65
+			processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
66
+			if (processInstance == null) {
67
+				throw new ActivitiObjectNotFoundException("Process instance could not be found");
68
+			}
69
+			processDefinitionId = processInstance.getProcessDefinitionId();
70
+
71
+			List<ProcessInstance> subProcessInstances = runtimeService.createProcessInstanceQuery().superProcessInstanceId(processInstanceId).list();
72
+
73
+			for (ProcessInstance subProcessInstance : subProcessInstances) {
74
+				String subDefId = subProcessInstance.getProcessDefinitionId();
75
+
76
+				String superExecutionId = ((ExecutionEntity) subProcessInstance).getSuperExecutionId();
77
+				ProcessDefinitionEntity subDef = (ProcessDefinitionEntity) repositoryService.getProcessDefinition(subDefId);
78
+
79
+				ObjectNode processInstanceJSON = new ObjectMapper().createObjectNode();
80
+				processInstanceJSON.put("processInstanceId", subProcessInstance.getId());
81
+				processInstanceJSON.put("superExecutionId", superExecutionId);
82
+				processInstanceJSON.put("processDefinitionId", subDef.getId());
83
+				processInstanceJSON.put("processDefinitionKey", subDef.getKey());
84
+				processInstanceJSON.put("processDefinitionName", subDef.getName());
85
+
86
+				subProcessInstanceMap.put(superExecutionId, processInstanceJSON);
87
+			}
88
+		}
89
+
90
+		if (processDefinitionId == null) {
91
+			throw new ActivitiObjectNotFoundException("No process definition id provided");
92
+		}
93
+
94
+		ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) repositoryService.getProcessDefinition(processDefinitionId);
95
+
96
+		if (processDefinition == null) {
97
+			throw new ActivitiException("Process definition " + processDefinitionId + " could not be found");
98
+		}
99
+
100
+		ObjectNode responseJSON = new ObjectMapper().createObjectNode();
101
+
102
+		// Process definition
103
+		JsonNode pdrJSON = getProcessDefinitionResponse(processDefinition);
104
+
105
+		if (pdrJSON != null) {
106
+			responseJSON.put("processDefinition", pdrJSON);
107
+		}
108
+
109
+		// Highlighted activities
110
+		if (processInstance != null) {
111
+			ArrayNode activityArray = new ObjectMapper().createArrayNode();
112
+			ArrayNode flowsArray = new ObjectMapper().createArrayNode();
113
+
114
+			highLightedActivities = runtimeService.getActiveActivityIds(processInstanceId);
115
+			highLightedFlows = getHighLightedFlows(processInstanceId, processDefinition);
116
+
117
+			for (String activityName : highLightedActivities) {
118
+				activityArray.add(activityName);
119
+			}
120
+
121
+			for (String flow : highLightedFlows)
122
+				flowsArray.add(flow);
123
+
124
+			responseJSON.put("highLightedActivities", activityArray);
125
+			responseJSON.put("highLightedFlows", flowsArray);
126
+		}
127
+
128
+		// Pool shape, if process is participant in collaboration
129
+		if (processDefinition.getParticipantProcess() != null) {
130
+			ParticipantProcess pProc = processDefinition.getParticipantProcess();
131
+
132
+			ObjectNode participantProcessJSON = new ObjectMapper().createObjectNode();
133
+			participantProcessJSON.put("id", pProc.getId());
134
+			if (StringUtils.isNotEmpty(pProc.getName())) {
135
+				participantProcessJSON.put("name", pProc.getName());
136
+			} else {
137
+				participantProcessJSON.put("name", "");
138
+			}
139
+			participantProcessJSON.put("x", pProc.getX());
140
+			participantProcessJSON.put("y", pProc.getY());
141
+			participantProcessJSON.put("width", pProc.getWidth());
142
+			participantProcessJSON.put("height", pProc.getHeight());
143
+
144
+			responseJSON.put("participantProcess", participantProcessJSON);
145
+		}
146
+
147
+		// Draw lanes
148
+
149
+		if (processDefinition.getLaneSets() != null && !processDefinition.getLaneSets().isEmpty()) {
150
+			ArrayNode laneSetArray = new ObjectMapper().createArrayNode();
151
+			for (LaneSet laneSet : processDefinition.getLaneSets()) {
152
+				ArrayNode laneArray = new ObjectMapper().createArrayNode();
153
+				if (laneSet.getLanes() != null && !laneSet.getLanes().isEmpty()) {
154
+					for (Lane lane : laneSet.getLanes()) {
155
+						ObjectNode laneJSON = new ObjectMapper().createObjectNode();
156
+						laneJSON.put("id", lane.getId());
157
+						if (StringUtils.isNotEmpty(lane.getName())) {
158
+							laneJSON.put("name", lane.getName());
159
+						} else {
160
+							laneJSON.put("name", "");
161
+						}
162
+						laneJSON.put("x", lane.getX());
163
+						laneJSON.put("y", lane.getY());
164
+						laneJSON.put("width", lane.getWidth());
165
+						laneJSON.put("height", lane.getHeight());
166
+
167
+						List<String> flowNodeIds = lane.getFlowNodeIds();
168
+						ArrayNode flowNodeIdsArray = new ObjectMapper().createArrayNode();
169
+						for (String flowNodeId : flowNodeIds) {
170
+							flowNodeIdsArray.add(flowNodeId);
171
+						}
172
+						laneJSON.put("flowNodeIds", flowNodeIdsArray);
173
+
174
+						laneArray.add(laneJSON);
175
+					}
176
+				}
177
+				ObjectNode laneSetJSON = new ObjectMapper().createObjectNode();
178
+				laneSetJSON.put("id", laneSet.getId());
179
+				if (StringUtils.isNotEmpty(laneSet.getName())) {
180
+					laneSetJSON.put("name", laneSet.getName());
181
+				} else {
182
+					laneSetJSON.put("name", "");
183
+				}
184
+				laneSetJSON.put("lanes", laneArray);
185
+
186
+				laneSetArray.add(laneSetJSON);
187
+			}
188
+
189
+			if (laneSetArray.size() > 0)
190
+				responseJSON.put("laneSets", laneSetArray);
191
+		}
192
+
193
+		ArrayNode sequenceFlowArray = new ObjectMapper().createArrayNode();
194
+		ArrayNode activityArray = new ObjectMapper().createArrayNode();
195
+
196
+		// Activities and their sequence-flows
197
+
198
+		for (ActivityImpl activity : processDefinition.getActivities()) {
199
+			getActivity(processInstanceId, activity, activityArray, sequenceFlowArray, processInstance, highLightedFlows, subProcessInstanceMap);
200
+		}
201
+
202
+		responseJSON.put("activities", activityArray);
203
+		responseJSON.put("sequenceFlows", sequenceFlowArray);
204
+
205
+		return responseJSON;
206
+	}
207
+
208
+	private List<String> getHighLightedFlows(String processInstanceId, ProcessDefinitionEntity processDefinition) {
209
+
210
+		List<String> highLightedFlows = new ArrayList<String>();
211
+		List<HistoricActivityInstance> historicActivityInstances = historyService.createHistoricActivityInstanceQuery()
212
+				.processInstanceId(processInstanceId).orderByHistoricActivityInstanceStartTime().asc().list();
213
+
214
+		List<String> historicActivityInstanceList = new ArrayList<String>();
215
+		for (HistoricActivityInstance hai : historicActivityInstances) {
216
+			historicActivityInstanceList.add(hai.getActivityId());
217
+		}
218
+
219
+		// add current activities to list
220
+		List<String> highLightedActivities = runtimeService.getActiveActivityIds(processInstanceId);
221
+		historicActivityInstanceList.addAll(highLightedActivities);
222
+
223
+		// activities and their sequence-flows
224
+		for (ActivityImpl activity : processDefinition.getActivities()) {
225
+			int index = historicActivityInstanceList.indexOf(activity.getId());
226
+
227
+			if (index >= 0 && index + 1 < historicActivityInstanceList.size()) {
228
+				List<PvmTransition> pvmTransitionList = activity.getOutgoingTransitions();
229
+				for (PvmTransition pvmTransition : pvmTransitionList) {
230
+					String destinationFlowId = pvmTransition.getDestination().getId();
231
+					if (destinationFlowId.equals(historicActivityInstanceList.get(index + 1))) {
232
+						highLightedFlows.add(pvmTransition.getId());
233
+					}
234
+				}
235
+			}
236
+		}
237
+		return highLightedFlows;
238
+	}
239
+
240
+	@SuppressWarnings("deprecation")
241
+	private void getActivity(String processInstanceId, ActivityImpl activity, ArrayNode activityArray, ArrayNode sequenceFlowArray,
242
+			ProcessInstance processInstance, List<String> highLightedFlows, Map<String, ObjectNode> subProcessInstanceMap) {
243
+
244
+		ObjectNode activityJSON = new ObjectMapper().createObjectNode();
245
+
246
+		// Gather info on the multi instance marker
247
+		String multiInstance = (String) activity.getProperty("multiInstance");
248
+		if (multiInstance != null) {
249
+			if (!"sequential".equals(multiInstance)) {
250
+				multiInstance = "parallel";
251
+			}
252
+		}
253
+
254
+		ActivityBehavior activityBehavior = activity.getActivityBehavior();
255
+		// Gather info on the collapsed marker
256
+		Boolean collapsed = (activityBehavior instanceof CallActivityBehavior);
257
+		Boolean expanded = (Boolean) activity.getProperty(BpmnParse.PROPERTYNAME_ISEXPANDED);
258
+		if (expanded != null) {
259
+			collapsed = !expanded;
260
+		}
261
+
262
+		Boolean isInterrupting = null;
263
+		if (activityBehavior instanceof BoundaryEventActivityBehavior) {
264
+			isInterrupting = ((BoundaryEventActivityBehavior) activityBehavior).isInterrupting();
265
+		}
266
+
267
+		// Outgoing transitions of activity
268
+		for (PvmTransition sequenceFlow : activity.getOutgoingTransitions()) {
269
+			String flowName = (String) sequenceFlow.getProperty("name");
270
+			boolean isHighLighted = (highLightedFlows.contains(sequenceFlow.getId()));
271
+			boolean isConditional = sequenceFlow.getProperty(BpmnParse.PROPERTYNAME_CONDITION) != null
272
+					&& !((String) activity.getProperty("type")).toLowerCase().contains("gateway");
273
+			boolean isDefault = sequenceFlow.getId().equals(activity.getProperty("default"))
274
+					&& ((String) activity.getProperty("type")).toLowerCase().contains("gateway");
275
+
276
+			List<Integer> waypoints = ((TransitionImpl) sequenceFlow).getWaypoints();
277
+			ArrayNode xPointArray = new ObjectMapper().createArrayNode();
278
+			ArrayNode yPointArray = new ObjectMapper().createArrayNode();
279
+			for (int i = 0; i < waypoints.size(); i += 2) { // waypoints.size()
280
+															// minimally 4: x1, y1,
281
+															// x2, y2
282
+				xPointArray.add(waypoints.get(i));
283
+				yPointArray.add(waypoints.get(i + 1));
284
+			}
285
+
286
+			ObjectNode flowJSON = new ObjectMapper().createObjectNode();
287
+			flowJSON.put("id", sequenceFlow.getId());
288
+			flowJSON.put("name", flowName);
289
+			flowJSON.put("flow", "(" + sequenceFlow.getSource().getId() + ")--" + sequenceFlow.getId() + "-->("
290
+					+ sequenceFlow.getDestination().getId() + ")");
291
+
292
+			if (isConditional)
293
+				flowJSON.put("isConditional", isConditional);
294
+			if (isDefault)
295
+				flowJSON.put("isDefault", isDefault);
296
+			if (isHighLighted)
297
+				flowJSON.put("isHighLighted", isHighLighted);
298
+
299
+			flowJSON.put("xPointArray", xPointArray);
300
+			flowJSON.put("yPointArray", yPointArray);
301
+
302
+			sequenceFlowArray.add(flowJSON);
303
+		}
304
+
305
+		// Nested activities (boundary events)
306
+		ArrayNode nestedActivityArray = new ObjectMapper().createArrayNode();
307
+		for (ActivityImpl nestedActivity : activity.getActivities()) {
308
+			nestedActivityArray.add(nestedActivity.getId());
309
+		}
310
+
311
+		Map<String, Object> properties = activity.getProperties();
312
+		ObjectNode propertiesJSON = new ObjectMapper().createObjectNode();
313
+		for (String key : properties.keySet()) {
314
+			Object prop = properties.get(key);
315
+			if (prop instanceof String)
316
+				propertiesJSON.put(key, (String) properties.get(key));
317
+			else if (prop instanceof Integer)
318
+				propertiesJSON.put(key, (Integer) properties.get(key));
319
+			else if (prop instanceof Boolean)
320
+				propertiesJSON.put(key, (Boolean) properties.get(key));
321
+			else if ("initial".equals(key)) {
322
+				ActivityImpl act = (ActivityImpl) properties.get(key);
323
+				propertiesJSON.put(key, act.getId());
324
+			} else if ("timerDeclarations".equals(key)) {
325
+				@SuppressWarnings("unchecked")
326
+				ArrayList<TimerDeclarationImpl> timerDeclarations = (ArrayList<TimerDeclarationImpl>) properties.get(key);
327
+				ArrayNode timerDeclarationArray = new ObjectMapper().createArrayNode();
328
+
329
+				if (timerDeclarations != null)
330
+					for (TimerDeclarationImpl timerDeclaration : timerDeclarations) {
331
+						ObjectNode timerDeclarationJSON = new ObjectMapper().createObjectNode();
332
+
333
+						timerDeclarationJSON.put("isExclusive", timerDeclaration.isExclusive());
334
+						if (timerDeclaration.getRepeat() != null)
335
+							timerDeclarationJSON.put("repeat", timerDeclaration.getRepeat());
336
+
337
+						timerDeclarationJSON.put("retries", String.valueOf(timerDeclaration.getRetries()));
338
+						timerDeclarationJSON.put("type", timerDeclaration.getJobHandlerType());
339
+						timerDeclarationJSON.put("configuration", timerDeclaration.getJobHandlerConfiguration());
340
+						//timerDeclarationJSON.put("expression", timerDeclaration.getDescription());
341
+
342
+						timerDeclarationArray.add(timerDeclarationJSON);
343
+					}
344
+				if (timerDeclarationArray.size() > 0)
345
+					propertiesJSON.put(key, timerDeclarationArray);
346
+				// TODO: implement getting description
347
+			} else if ("eventDefinitions".equals(key)) {
348
+				@SuppressWarnings("unchecked")
349
+				ArrayList<EventSubscriptionDeclaration> eventDefinitions = (ArrayList<EventSubscriptionDeclaration>) properties.get(key);
350
+				ArrayNode eventDefinitionsArray = new ObjectMapper().createArrayNode();
351
+
352
+				if (eventDefinitions != null) {
353
+					for (EventSubscriptionDeclaration eventDefinition : eventDefinitions) {
354
+						ObjectNode eventDefinitionJSON = new ObjectMapper().createObjectNode();
355
+
356
+						if (eventDefinition.getActivityId() != null)
357
+							eventDefinitionJSON.put("activityId", eventDefinition.getActivityId());
358
+
359
+						eventDefinitionJSON.put("eventName", eventDefinition.getEventName());
360
+						eventDefinitionJSON.put("eventType", eventDefinition.getEventType());
361
+						eventDefinitionJSON.put("isAsync", eventDefinition.isAsync());
362
+						eventDefinitionJSON.put("isStartEvent", eventDefinition.isStartEvent());
363
+						eventDefinitionsArray.add(eventDefinitionJSON);
364
+					}
365
+				}
366
+
367
+				if (eventDefinitionsArray.size() > 0)
368
+					propertiesJSON.put(key, eventDefinitionsArray);
369
+
370
+				// TODO: implement it
371
+			} else if ("errorEventDefinitions".equals(key)) {
372
+				@SuppressWarnings("unchecked")
373
+				ArrayList<ErrorEventDefinition> errorEventDefinitions = (ArrayList<ErrorEventDefinition>) properties.get(key);
374
+				ArrayNode errorEventDefinitionsArray = new ObjectMapper().createArrayNode();
375
+
376
+				if (errorEventDefinitions != null) {
377
+					for (ErrorEventDefinition errorEventDefinition : errorEventDefinitions) {
378
+						ObjectNode errorEventDefinitionJSON = new ObjectMapper().createObjectNode();
379
+
380
+						if (errorEventDefinition.getErrorCode() != null)
381
+							errorEventDefinitionJSON.put("errorCode", errorEventDefinition.getErrorCode());
382
+						else
383
+							errorEventDefinitionJSON.putNull("errorCode");
384
+
385
+						errorEventDefinitionJSON.put("handlerActivityId", errorEventDefinition.getHandlerActivityId());
386
+
387
+						errorEventDefinitionsArray.add(errorEventDefinitionJSON);
388
+					}
389
+				}
390
+
391
+				if (errorEventDefinitionsArray.size() > 0)
392
+					propertiesJSON.put(key, errorEventDefinitionsArray);
393
+			}
394
+
395
+		}
396
+
397
+		if ("callActivity".equals(properties.get("type"))) {
398
+			CallActivityBehavior callActivityBehavior = null;
399
+
400
+			if (activityBehavior instanceof CallActivityBehavior) {
401
+				callActivityBehavior = (CallActivityBehavior) activityBehavior;
402
+			}
403
+
404
+			if (callActivityBehavior != null) {
405
+				propertiesJSON.put("processDefinitonKey", callActivityBehavior.getProcessDefinitonKey());
406
+
407
+				// get processDefinitonId from execution or get last processDefinitonId
408
+				// by key
409
+				ArrayNode processInstanceArray = new ObjectMapper().createArrayNode();
410
+				if (processInstance != null) {
411
+					List<Execution> executionList = runtimeService.createExecutionQuery().processInstanceId(processInstanceId)
412
+							.activityId(activity.getId()).list();
413
+					if (!executionList.isEmpty()) {
414
+						for (Execution execution : executionList) {
415
+							ObjectNode processInstanceJSON = subProcessInstanceMap.get(execution.getId());
416
+							processInstanceArray.add(processInstanceJSON);
417
+						}
418
+					}
419
+				}
420
+
421
+				// If active activities nas no instance of this callActivity then add
422
+				// last definition
423
+				if (processInstanceArray.size() == 0 && StringUtils.isNotEmpty(callActivityBehavior.getProcessDefinitonKey())) {
424
+					// Get last definition by key
425
+					ProcessDefinition lastProcessDefinition = repositoryService.createProcessDefinitionQuery()
426
+							.processDefinitionKey(callActivityBehavior.getProcessDefinitonKey()).latestVersion().singleResult();
427
+
428
+					// TODO: unuseful fields there are processDefinitionName, processDefinitionKey
429
+					if (lastProcessDefinition != null) {
430
+						ObjectNode processInstanceJSON = new ObjectMapper().createObjectNode();
431
+						processInstanceJSON.put("processDefinitionId", lastProcessDefinition.getId());
432
+						processInstanceJSON.put("processDefinitionKey", lastProcessDefinition.getKey());
433
+						processInstanceJSON.put("processDefinitionName", lastProcessDefinition.getName());
434
+						processInstanceArray.add(processInstanceJSON);
435
+					}
436
+				}
437
+
438
+				if (processInstanceArray.size() > 0) {
439
+					propertiesJSON.put("processDefinitons", processInstanceArray);
440
+				}
441
+			}
442
+		}
443
+
444
+		activityJSON.put("activityId", activity.getId());
445
+		activityJSON.put("properties", propertiesJSON);
446
+		if (multiInstance != null)
447
+			activityJSON.put("multiInstance", multiInstance);
448
+		if (collapsed)
449
+			activityJSON.put("collapsed", collapsed);
450
+		if (nestedActivityArray.size() > 0)
451
+			activityJSON.put("nestedActivities", nestedActivityArray);
452
+		if (isInterrupting != null)
453
+			activityJSON.put("isInterrupting", isInterrupting);
454
+
455
+		activityJSON.put("x", activity.getX());
456
+		activityJSON.put("y", activity.getY());
457
+		activityJSON.put("width", activity.getWidth());
458
+		activityJSON.put("height", activity.getHeight());
459
+
460
+		activityArray.add(activityJSON);
461
+
462
+		// Nested activities (boundary events)
463
+		for (ActivityImpl nestedActivity : activity.getActivities()) {
464
+			getActivity(processInstanceId, nestedActivity, activityArray, sequenceFlowArray, processInstance, highLightedFlows, subProcessInstanceMap);
465
+		}
466
+	}
467
+
468
+	private JsonNode getProcessDefinitionResponse(ProcessDefinitionEntity processDefinition) {
469
+		ObjectMapper mapper = new ObjectMapper();
470
+		ObjectNode pdrJSON = mapper.createObjectNode();
471
+		pdrJSON.put("id", processDefinition.getId());
472
+		pdrJSON.put("name", processDefinition.getName());
473
+		pdrJSON.put("key", processDefinition.getKey());
474
+		pdrJSON.put("version", processDefinition.getVersion());
475
+		pdrJSON.put("deploymentId", processDefinition.getDeploymentId());
476
+		pdrJSON.put("isGraphicNotationDefined", isGraphicNotationDefined(processDefinition));
477
+		return pdrJSON;
478
+	}
479
+
480
+	private boolean isGraphicNotationDefined(ProcessDefinitionEntity processDefinition) {
481
+		return ((ProcessDefinitionEntity) repositoryService.getProcessDefinition(processDefinition.getId())).isGraphicalNotationDefined();
482
+	}
483
+}

+ 22 - 0
src/main/java/com/chinaitop/depot/act/rest/diagram/services/ProcessDefinitionDiagramLayoutResource.java

@@ -0,0 +1,22 @@
1
+package com.chinaitop.depot.act.rest.diagram.services;
2
+
3
+import org.springframework.web.bind.annotation.PathVariable;
4
+import org.springframework.web.bind.annotation.RequestMapping;
5
+import org.springframework.web.bind.annotation.RequestMethod;
6
+import org.springframework.web.bind.annotation.RestController;
7
+
8
+import com.fasterxml.jackson.databind.node.ObjectNode;
9
+/**
10
+ * 查看流程图工具
11
+ * @author xujh
12
+ * @version 2017-10-17
13
+ */
14
+@RestController
15
+public class ProcessDefinitionDiagramLayoutResource extends BaseProcessDefinitionDiagramLayoutResource {
16
+	
17
+	@RequestMapping(value = "/act/service/process-definition/{processDefinitionId}/diagram-layout", method = RequestMethod.GET, produces = "application/json")
18
+	public ObjectNode getDiagram(@PathVariable String processDefinitionId) {
19
+		return getDiagramNode(null, processDefinitionId);
20
+	}
21
+	
22
+}

+ 22 - 0
src/main/java/com/chinaitop/depot/act/rest/diagram/services/ProcessInstanceDiagramLayoutResource.java

@@ -0,0 +1,22 @@
1
+package com.chinaitop.depot.act.rest.diagram.services;
2
+
3
+import org.springframework.web.bind.annotation.PathVariable;
4
+import org.springframework.web.bind.annotation.RequestMapping;
5
+import org.springframework.web.bind.annotation.RequestMethod;
6
+import org.springframework.web.bind.annotation.RestController;
7
+
8
+import com.fasterxml.jackson.databind.node.ObjectNode;
9
+/**
10
+ * 查看流程图工具
11
+ * @author xujh
12
+ * @version 2017-10-17
13
+ */
14
+@RestController
15
+public class ProcessInstanceDiagramLayoutResource extends BaseProcessDefinitionDiagramLayoutResource {
16
+
17
+	@RequestMapping(value = "/act/service/process-instance/{processInstanceId}/diagram-layout", method = RequestMethod.GET, produces = "application/json")
18
+	public ObjectNode getDiagram(@PathVariable String processInstanceId) {
19
+		return getDiagramNode(processInstanceId, null);
20
+	}
21
+	
22
+}

+ 279 - 0
src/main/java/com/chinaitop/depot/act/rest/diagram/services/ProcessInstanceHighlightsResource.java

@@ -0,0 +1,279 @@
1
+package com.chinaitop.depot.act.rest.diagram.services;
2
+
3
+import java.util.ArrayList;
4
+import java.util.HashMap;
5
+import java.util.LinkedList;
6
+import java.util.List;
7
+import java.util.Map;
8
+
9
+import org.activiti.engine.HistoryService;
10
+import org.activiti.engine.RepositoryService;
11
+import org.activiti.engine.RuntimeService;
12
+import org.activiti.engine.history.HistoricActivityInstance;
13
+import org.activiti.engine.history.HistoricProcessInstance;
14
+import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity;
15
+import org.activiti.engine.impl.pvm.PvmTransition;
16
+import org.activiti.engine.impl.pvm.process.ActivityImpl;
17
+import org.activiti.engine.runtime.ProcessInstance;
18
+import org.springframework.beans.factory.annotation.Autowired;
19
+import org.springframework.web.bind.annotation.PathVariable;
20
+import org.springframework.web.bind.annotation.RequestMapping;
21
+import org.springframework.web.bind.annotation.RequestMethod;
22
+import org.springframework.web.bind.annotation.RestController;
23
+
24
+import com.fasterxml.jackson.databind.ObjectMapper;
25
+import com.fasterxml.jackson.databind.node.ArrayNode;
26
+import com.fasterxml.jackson.databind.node.ObjectNode;
27
+/**
28
+ * 查看流程图工具
29
+ * @author xujh
30
+ * @version 2017-10-17
31
+ */
32
+@RestController
33
+public class ProcessInstanceHighlightsResource {
34
+
35
+	@Autowired
36
+	private RuntimeService runtimeService;
37
+
38
+	@Autowired
39
+	private RepositoryService repositoryService;
40
+
41
+	@Autowired
42
+	private HistoryService historyService;
43
+
44
+	protected ObjectMapper objectMapper = new ObjectMapper();
45
+
46
+	@SuppressWarnings("deprecation")
47
+	@RequestMapping(value = "/act/service/process-instance/{processInstanceId}/highlights", method = RequestMethod.GET, produces = "application/json")
48
+	public ObjectNode getHighlighted(@PathVariable String processInstanceId) {
49
+		ObjectNode responseJSON = objectMapper.createObjectNode();
50
+
51
+		responseJSON.put("processInstanceId", processInstanceId);
52
+
53
+		ArrayNode activitiesArray = objectMapper.createArrayNode();
54
+		ArrayNode flowsArray = objectMapper.createArrayNode();
55
+
56
+		try {
57
+			ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
58
+			/*ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) repositoryService.getProcessDefinition(processInstance
59
+					.getProcessDefinitionId());
60
+
61
+			responseJSON.put("processDefinitionId", processInstance.getProcessDefinitionId());
62
+
63
+			List<String> highLightedActivities = runtimeService.getActiveActivityIds(processInstanceId);
64
+			List<String> highLightedFlows = getHighLightedFlows(processDefinition, processInstanceId);
65
+
66
+			for (String activityId : highLightedActivities) {
67
+				activitiesArray.add(activityId);
68
+			}
69
+
70
+			for (String flow : highLightedFlows) {
71
+				flowsArray.add(flow);
72
+			}*/
73
+			
74
+			if(processInstance!=null) {
75
+				ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) repositoryService.getProcessDefinition(processInstance
76
+						.getProcessDefinitionId());
77
+
78
+				responseJSON.put("processDefinitionId", processInstance.getProcessDefinitionId());
79
+
80
+				List<String> highLightedActivities = runtimeService.getActiveActivityIds(processInstanceId);
81
+				List<String> highLightedFlows = getHighLightedFlows(processDefinition, processInstanceId);
82
+
83
+				for (String activityId : highLightedActivities) {
84
+					activitiesArray.add(activityId);
85
+				}
86
+
87
+				for (String flow : highLightedFlows) {
88
+					flowsArray.add(flow);
89
+				}
90
+			} else {
91
+				HistoricProcessInstance processDefinition2 = historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
92
+				ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) repositoryService.getProcessDefinition(processDefinition2
93
+						.getProcessDefinitionId());
94
+				responseJSON.put("processDefinitionId", processDefinition2.getProcessDefinitionId());
95
+				List<String> highLightedFlows = getHighLightedFlows(processDefinition, processInstanceId);
96
+
97
+				for (String flow : highLightedFlows) {
98
+					flowsArray.add(flow);
99
+				}
100
+
101
+			}
102
+
103
+		} catch (Exception e) {
104
+			e.printStackTrace();
105
+		}
106
+
107
+		responseJSON.put("activities", activitiesArray);
108
+		responseJSON.put("flows", flowsArray);
109
+
110
+		return responseJSON;
111
+	}
112
+
113
+	/**
114
+	 * getHighLightedFlows
115
+	 * 
116
+	 * @param processDefinition
117
+	 * @param processInstanceId
118
+	 * @return
119
+	 */
120
+	private List<String> getHighLightedFlows(ProcessDefinitionEntity processDefinition, String processInstanceId) {
121
+
122
+		List<String> highLightedFlows = new ArrayList<String>();
123
+
124
+		List<HistoricActivityInstance> historicActivityInstances = historyService.createHistoricActivityInstanceQuery()
125
+				.processInstanceId(processInstanceId)
126
+				//order by startime asc is not correct. use default order is correct.
127
+				//.orderByHistoricActivityInstanceStartTime().asc()/*.orderByActivityId().asc()*/
128
+				.list();
129
+
130
+		LinkedList<HistoricActivityInstance> hisActInstList = new LinkedList<HistoricActivityInstance>();
131
+		hisActInstList.addAll(historicActivityInstances);
132
+
133
+		getHighlightedFlows(processDefinition.getActivities(), hisActInstList, highLightedFlows);
134
+
135
+		return highLightedFlows;
136
+	}
137
+
138
+	/**
139
+	 * getHighlightedFlows
140
+	 * 
141
+	 * code logic: 1. Loop all activities by id asc order; 2. Check each activity's outgoing transitions and eventBoundery outgoing transitions, if
142
+	 * outgoing transitions's destination.id is in other executed activityIds, add this transition to highLightedFlows List; 3. But if activity is not
143
+	 * a parallelGateway or inclusiveGateway, only choose the earliest flow.
144
+	 * 
145
+	 * @param activityList
146
+	 * @param hisActInstList
147
+	 * @param highLightedFlows
148
+	 */
149
+	private void getHighlightedFlows(List<ActivityImpl> activityList, LinkedList<HistoricActivityInstance> hisActInstList,
150
+			List<String> highLightedFlows) {
151
+
152
+		//check out startEvents in activityList
153
+		List<ActivityImpl> startEventActList = new ArrayList<ActivityImpl>();
154
+		Map<String, ActivityImpl> activityMap = new HashMap<String, ActivityImpl>(activityList.size());
155
+		for (ActivityImpl activity : activityList) {
156
+
157
+			activityMap.put(activity.getId(), activity);
158
+
159
+			String actType = (String) activity.getProperty("type");
160
+			if (actType != null && actType.toLowerCase().indexOf("startevent") >= 0) {
161
+				startEventActList.add(activity);
162
+			}
163
+		}
164
+
165
+		//These codes is used to avoid a bug: 
166
+		//ACT-1728 If the process instance was started by a callActivity, it will be not have the startEvent activity in ACT_HI_ACTINST table 
167
+		//Code logic:
168
+		//Check the first activity if it is a startEvent, if not check out the startEvent's highlight outgoing flow.
169
+		HistoricActivityInstance firstHistActInst = hisActInstList.getFirst();
170
+		String firstActType = (String) firstHistActInst.getActivityType();
171
+		if (firstActType != null && firstActType.toLowerCase().indexOf("startevent") < 0) {
172
+			PvmTransition startTrans = getStartTransaction(startEventActList, firstHistActInst);
173
+			if (startTrans != null) {
174
+				highLightedFlows.add(startTrans.getId());
175
+			}
176
+		}
177
+
178
+		while (!hisActInstList.isEmpty()) {
179
+			HistoricActivityInstance histActInst = hisActInstList.removeFirst();
180
+			ActivityImpl activity = activityMap.get(histActInst.getActivityId());
181
+			if (activity != null) {
182
+				boolean isParallel = false;
183
+				String type = histActInst.getActivityType();
184
+				if ("parallelGateway".equals(type) || "inclusiveGateway".equals(type)) {
185
+					isParallel = true;
186
+				} else if ("subProcess".equals(histActInst.getActivityType())) {
187
+					getHighlightedFlows(activity.getActivities(), hisActInstList, highLightedFlows);
188
+				}
189
+
190
+				List<PvmTransition> allOutgoingTrans = new ArrayList<PvmTransition>();
191
+				allOutgoingTrans.addAll(activity.getOutgoingTransitions());
192
+				allOutgoingTrans.addAll(getBoundaryEventOutgoingTransitions(activity));
193
+				List<String> activityHighLightedFlowIds = getHighlightedFlows(allOutgoingTrans, hisActInstList, isParallel);
194
+				highLightedFlows.addAll(activityHighLightedFlowIds);
195
+			}
196
+		}
197
+	}
198
+
199
+	/**
200
+	 * Check out the outgoing transition connected to firstActInst from startEventActList
201
+	 * 
202
+	 * @param startEventActList
203
+	 * @param firstActInst
204
+	 * @return
205
+	 */
206
+	private PvmTransition getStartTransaction(List<ActivityImpl> startEventActList, HistoricActivityInstance firstActInst) {
207
+		for (ActivityImpl startEventAct : startEventActList) {
208
+			for (PvmTransition trans : startEventAct.getOutgoingTransitions()) {
209
+				if (trans.getDestination().getId().equals(firstActInst.getActivityId())) {
210
+					return trans;
211
+				}
212
+			}
213
+		}
214
+		return null;
215
+	}
216
+
217
+	/**
218
+	 * getBoundaryEventOutgoingTransitions
219
+	 * 
220
+	 * @param activity
221
+	 * @return
222
+	 */
223
+	private List<PvmTransition> getBoundaryEventOutgoingTransitions(ActivityImpl activity) {
224
+		List<PvmTransition> boundaryTrans = new ArrayList<PvmTransition>();
225
+		for (ActivityImpl subActivity : activity.getActivities()) {
226
+			String type = (String) subActivity.getProperty("type");
227
+			if (type != null && type.toLowerCase().indexOf("boundary") >= 0) {
228
+				boundaryTrans.addAll(subActivity.getOutgoingTransitions());
229
+			}
230
+		}
231
+		return boundaryTrans;
232
+	}
233
+
234
+	/**
235
+	 * find out single activity's highlighted flowIds
236
+	 * 
237
+	 * @param activity
238
+	 * @param hisActInstList
239
+	 * @param isExclusive if true only return one flowId(Such as exclusiveGateway, BoundaryEvent On Task)
240
+	 * @return
241
+	 */
242
+	private List<String> getHighlightedFlows(List<PvmTransition> pvmTransitionList, LinkedList<HistoricActivityInstance> hisActInstList,
243
+			boolean isParallel) {
244
+
245
+		List<String> highLightedFlowIds = new ArrayList<String>();
246
+
247
+		PvmTransition earliestTrans = null;
248
+		HistoricActivityInstance earliestHisActInst = null;
249
+
250
+		for (PvmTransition pvmTransition : pvmTransitionList) {
251
+
252
+			String destActId = pvmTransition.getDestination().getId();
253
+			HistoricActivityInstance destHisActInst = findHisActInst(hisActInstList, destActId);
254
+			if (destHisActInst != null) {
255
+				if (isParallel) {
256
+					highLightedFlowIds.add(pvmTransition.getId());
257
+				} else if (earliestHisActInst == null || (earliestHisActInst.getId().compareTo(destHisActInst.getId()) > 0)) {
258
+					earliestTrans = pvmTransition;
259
+					earliestHisActInst = destHisActInst;
260
+				}
261
+			}
262
+		}
263
+
264
+		if ((!isParallel) && earliestTrans != null) {
265
+			highLightedFlowIds.add(earliestTrans.getId());
266
+		}
267
+
268
+		return highLightedFlowIds;
269
+	}
270
+
271
+	private HistoricActivityInstance findHisActInst(LinkedList<HistoricActivityInstance> hisActInstList, String actId) {
272
+		for (HistoricActivityInstance hisActInst : hisActInstList) {
273
+			if (hisActInst.getActivityId().equals(actId)) {
274
+				return hisActInst;
275
+			}
276
+		}
277
+		return null;
278
+	}
279
+}

+ 27 - 0
src/main/java/com/chinaitop/depot/act/rest/editor/main/StencilsetRestResource.java

@@ -0,0 +1,27 @@
1
+package com.chinaitop.depot.act.rest.editor.main;
2
+
3
+import java.io.InputStream;
4
+
5
+import org.activiti.engine.ActivitiException;
6
+import org.apache.commons.io.IOUtils;
7
+import org.springframework.web.bind.annotation.RequestMapping;
8
+import org.springframework.web.bind.annotation.RequestMethod;
9
+import org.springframework.web.bind.annotation.ResponseBody;
10
+import org.springframework.web.bind.annotation.RestController;
11
+
12
+/**
13
+ * @author xujh
14
+ */
15
+@RestController
16
+public class StencilsetRestResource {
17
+	
18
+	@RequestMapping(value = "/act/service/editor/stencilset", method = RequestMethod.GET, produces = "application/json;charset=utf-8")
19
+	public @ResponseBody String getStencilset() {
20
+		InputStream stencilsetStream = this.getClass().getClassLoader().getResourceAsStream("stencilset.json");
21
+		try {
22
+			return IOUtils.toString(stencilsetStream, "utf-8");
23
+		} catch (Exception e) {
24
+			throw new ActivitiException("Error while loading stencil set", e);
25
+		}
26
+	}
27
+}

+ 59 - 0
src/main/java/com/chinaitop/depot/act/rest/editor/model/ModelEditorJsonRestResource.java

@@ -0,0 +1,59 @@
1
+package com.chinaitop.depot.act.rest.editor.model;
2
+
3
+import org.activiti.editor.constants.ModelDataJsonConstants;
4
+import org.activiti.engine.ActivitiException;
5
+import org.activiti.engine.RepositoryService;
6
+import org.activiti.engine.repository.Model;
7
+import org.apache.commons.lang3.StringUtils;
8
+import org.slf4j.Logger;
9
+import org.slf4j.LoggerFactory;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.web.bind.annotation.PathVariable;
12
+import org.springframework.web.bind.annotation.RequestMapping;
13
+import org.springframework.web.bind.annotation.RequestMethod;
14
+import org.springframework.web.bind.annotation.RestController;
15
+
16
+import com.fasterxml.jackson.databind.ObjectMapper;
17
+import com.fasterxml.jackson.databind.node.ObjectNode;
18
+
19
+/**
20
+ * @author xujh
21
+ */
22
+@RestController
23
+public class ModelEditorJsonRestResource implements ModelDataJsonConstants {
24
+
25
+	protected static final Logger LOGGER = LoggerFactory.getLogger(ModelEditorJsonRestResource.class);
26
+
27
+	@Autowired
28
+	private RepositoryService repositoryService;
29
+
30
+	protected ObjectMapper objectMapper = new ObjectMapper();
31
+
32
+	@SuppressWarnings("deprecation")
33
+	@RequestMapping(value = "/act/service/model/{modelId}/json", method = RequestMethod.GET, produces = "application/json")
34
+	public ObjectNode getEditorJson(@PathVariable String modelId) {
35
+		ObjectNode modelNode = null;
36
+
37
+		Model model = repositoryService.getModel(modelId);
38
+
39
+		if (model != null) {
40
+			try {
41
+				if (StringUtils.isNotEmpty(model.getMetaInfo())) {
42
+					modelNode = (ObjectNode) objectMapper.readTree(model.getMetaInfo());
43
+				} else {
44
+					modelNode = objectMapper.createObjectNode();
45
+					modelNode.put(MODEL_NAME, model.getName());
46
+				}
47
+				modelNode.put(MODEL_ID, model.getId());
48
+				ObjectNode editorJsonNode = (ObjectNode) objectMapper.readTree(new String(repositoryService.getModelEditorSource(model.getId()),
49
+						"utf-8"));
50
+				modelNode.put("model", editorJsonNode);
51
+
52
+			} catch (Exception e) {
53
+				LOGGER.error("Error creating model JSON", e);
54
+				throw new ActivitiException("Error creating model JSON", e);
55
+			}
56
+		}
57
+		return modelNode;
58
+	}
59
+}

+ 122 - 0
src/main/java/com/chinaitop/depot/act/rest/editor/model/ModelSaveRestResource.java

@@ -0,0 +1,122 @@
1
+package com.chinaitop.depot.act.rest.editor.model;
2
+
3
+import java.io.ByteArrayInputStream;
4
+import java.io.ByteArrayOutputStream;
5
+import java.io.InputStream;
6
+
7
+import javax.servlet.http.HttpServletRequest;
8
+
9
+import org.activiti.editor.constants.ModelDataJsonConstants;
10
+import org.activiti.engine.ActivitiException;
11
+import org.activiti.engine.RepositoryService;
12
+import org.activiti.engine.repository.Model;
13
+import org.apache.batik.transcoder.TranscoderInput;
14
+import org.apache.batik.transcoder.TranscoderOutput;
15
+import org.apache.batik.transcoder.image.PNGTranscoder;
16
+import org.apache.log4j.Logger;
17
+import org.springframework.beans.factory.annotation.Autowired;
18
+import org.springframework.http.HttpStatus;
19
+import org.springframework.web.bind.annotation.PathVariable;
20
+import org.springframework.web.bind.annotation.RequestMapping;
21
+import org.springframework.web.bind.annotation.ResponseStatus;
22
+import org.springframework.web.bind.annotation.RestController;
23
+
24
+import com.chinaitop.depot.business.model.UserInfo;
25
+import com.fasterxml.jackson.databind.ObjectMapper;
26
+import com.fasterxml.jackson.databind.node.ObjectNode;
27
+import com.github.pagehelper.util.StringUtil;
28
+
29
+/**
30
+ * @author xujh
31
+ */
32
+@RestController
33
+public class ModelSaveRestResource implements ModelDataJsonConstants {
34
+
35
+	protected static final Logger LOGGER = Logger.getLogger(ModelSaveRestResource.class);
36
+
37
+	@Autowired
38
+	private RepositoryService repositoryService;
39
+	protected ObjectMapper objectMapper = new ObjectMapper();
40
+
41
+	@RequestMapping(value = "/act/service/model/{modelId}/save")
42
+	@ResponseStatus(value = HttpStatus.OK)
43
+	public void saveModel(@PathVariable String modelId, String json_xml,String svg_xml,String name,String description,HttpServletRequest request) {
44
+		try {
45
+			Model model = repositoryService.getModel(modelId);
46
+			
47
+			ObjectNode modelJson = (ObjectNode) objectMapper.readTree(model.getMetaInfo());
48
+			
49
+			modelJson.put(MODEL_NAME, name);
50
+			modelJson.put(MODEL_DESCRIPTION, description);
51
+			model.setMetaInfo(modelJson.toString());
52
+			model.setName(name);
53
+			repositoryService.saveModel(model);
54
+			UserInfo userInfo = (UserInfo)request.getSession().getAttribute("userInfo");
55
+			Integer orgId = userInfo.getOrgId();
56
+			Integer depotId =(Integer) request.getSession().getAttribute("depotId");
57
+			
58
+			String[] split = json_xml.split("process_id");
59
+			
60
+			for (String string : split) {
61
+				System.out.println(string);
62
+			}
63
+			//得到第一个字符串
64
+			String string = split[0];
65
+			String string2 =string+="process_id";
66
+			
67
+			//得到后边的字符串
68
+			String string1 = split[1];
69
+			
70
+			int indexOf = string1.indexOf(",");
71
+			//取到第一个字符
72
+			String substring1 = string1.substring(0,indexOf);
73
+			//用"分开,得到想要拼接的值
74
+			String[] split2 = substring1.split("\"");
75
+			//得到processId的值,用于拼接
76
+			String processIdValue = split2[2];
77
+			System.out.println(substring1);
78
+			
79
+//			if(StringUtil.isNotEmpty(depotId.toString())){
80
+//				String process_id_value = "\":\""+  processIdValue+depotId + "\"";
81
+//				//把值拼接进去
82
+//				String substring2 = string1.substring(indexOf);
83
+//				
84
+//				String json_xmls=string2+=process_id_value+=substring2;
85
+//				repositoryService.addModelEditorSource(model.getId(), json_xmls.getBytes("utf-8"));
86
+//			}else {
87
+//				String process_id_value = "\":\""+  processIdValue+orgId + "\"";
88
+//				//把值拼接进去
89
+//				String substring2 = string1.substring(indexOf);
90
+//				
91
+//				String json_xmls=string2+=process_id_value+=substring2;
92
+//				repositoryService.addModelEditorSource(model.getId(), json_xmls.getBytes("utf-8"));
93
+//			}
94
+			
95
+			String process_id_value = "\":\""+  processIdValue + "\"";
96
+			//把值拼接进去
97
+			String substring2 = string1.substring(indexOf);
98
+			
99
+			String json_xmls=string2+=process_id_value+=substring2;
100
+			repositoryService.addModelEditorSource(model.getId(), json_xmls.getBytes("utf-8"));
101
+			
102
+
103
+
104
+			InputStream svgStream = new ByteArrayInputStream(svg_xml.getBytes("utf-8"));
105
+			TranscoderInput input = new TranscoderInput(svgStream);
106
+
107
+			PNGTranscoder transcoder = new PNGTranscoder();
108
+			ByteArrayOutputStream outStream = new ByteArrayOutputStream();
109
+			TranscoderOutput output = new TranscoderOutput(outStream);
110
+
111
+			transcoder.transcode(input, output);
112
+			final byte[] result = outStream.toByteArray();
113
+			repositoryService.addModelEditorSourceExtra(model.getId(), result);
114
+			outStream.close();
115
+
116
+		} catch (Exception e) {
117
+			LOGGER.error("Error saving model", e);
118
+
119
+			throw new ActivitiException("Error saving model", e);
120
+		}
121
+	}
122
+}

+ 45 - 0
src/main/java/com/chinaitop/depot/act/rest/servlet/FilterServletOutputStream.java

@@ -0,0 +1,45 @@
1
+package com.chinaitop.depot.act.rest.servlet;
2
+
3
+import java.io.DataOutputStream;
4
+import java.io.IOException;
5
+import java.io.OutputStream;
6
+
7
+import javax.servlet.ServletOutputStream;
8
+import javax.servlet.WriteListener;
9
+/**
10
+ * @author xujh
11
+ * @version 2017-10-17
12
+ */
13
+public class FilterServletOutputStream extends ServletOutputStream {
14
+
15
+	private DataOutputStream stream;
16
+
17
+	public FilterServletOutputStream(OutputStream output) {
18
+		stream = new DataOutputStream(output);
19
+	}
20
+
21
+	public void write(int b) throws IOException {
22
+		stream.write(b);
23
+	}
24
+
25
+	public void write(byte[] b) throws IOException {
26
+		stream.write(b);
27
+	}
28
+
29
+	public void write(byte[] b, int off, int len) throws IOException {
30
+		stream.write(b, off, len);
31
+	}
32
+
33
+	@Override
34
+	public boolean isReady() {
35
+		// TODO Auto-generated method stub
36
+		return false;
37
+	}
38
+
39
+	@Override
40
+	public void setWriteListener(WriteListener listener) {
41
+		// TODO Auto-generated method stub
42
+		
43
+	}
44
+
45
+}

+ 53 - 0
src/main/java/com/chinaitop/depot/act/rest/servlet/GenericResponseWrapper.java

@@ -0,0 +1,53 @@
1
+package com.chinaitop.depot.act.rest.servlet;
2
+
3
+import java.io.ByteArrayOutputStream;
4
+import java.io.PrintWriter;
5
+
6
+import javax.servlet.ServletOutputStream;
7
+import javax.servlet.http.HttpServletResponse;
8
+import javax.servlet.http.HttpServletResponseWrapper;
9
+/**
10
+ * @author xujh
11
+ * @version 2017-10-17
12
+ */
13
+public class GenericResponseWrapper extends HttpServletResponseWrapper {
14
+	
15
+	private ByteArrayOutputStream output;
16
+	private int contentLength;
17
+	private String contentType;
18
+
19
+	public GenericResponseWrapper(HttpServletResponse response) {
20
+		super(response);
21
+		output = new ByteArrayOutputStream();
22
+	}
23
+
24
+	public byte[] getData() {
25
+		return output.toByteArray();
26
+	}
27
+
28
+	public ServletOutputStream getOutputStream() {
29
+		return new FilterServletOutputStream(output);
30
+	}
31
+
32
+	public PrintWriter getWriter() {
33
+		return new PrintWriter(getOutputStream(), true);
34
+	}
35
+
36
+	public void setContentLength(int length) {
37
+		this.contentLength = length;
38
+		super.setContentLength(length);
39
+	}
40
+
41
+	public int getContentLength() {
42
+		return contentLength;
43
+	}
44
+
45
+	public void setContentType(String type) {
46
+		this.contentType = type;
47
+		super.setContentType(type);
48
+	}
49
+
50
+	public String getContentType() {
51
+		return contentType;
52
+	}
53
+}

+ 66 - 0
src/main/java/com/chinaitop/depot/act/rest/servlet/JsonpCallbackFilter.java

@@ -0,0 +1,66 @@
1
+package com.chinaitop.depot.act.rest.servlet;
2
+
3
+import java.io.ByteArrayOutputStream;
4
+import java.io.IOException;
5
+import java.io.OutputStream;
6
+import java.util.Map;
7
+
8
+import javax.servlet.Filter;
9
+import javax.servlet.FilterChain;
10
+import javax.servlet.FilterConfig;
11
+import javax.servlet.ServletException;
12
+import javax.servlet.ServletRequest;
13
+import javax.servlet.ServletResponse;
14
+import javax.servlet.http.HttpServletRequest;
15
+import javax.servlet.http.HttpServletResponse;
16
+
17
+import org.slf4j.Logger;
18
+import org.slf4j.LoggerFactory;
19
+/**
20
+ * 配置过滤器
21
+ * @author xujh
22
+ * @version 2017-10-17
23
+ */
24
+public class JsonpCallbackFilter implements Filter {
25
+
26
+	private static Logger log = LoggerFactory.getLogger(JsonpCallbackFilter.class);
27
+
28
+	public void init(FilterConfig fConfig) throws ServletException {}
29
+
30
+	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
31
+		
32
+		HttpServletRequest httpRequest = (HttpServletRequest) request;
33
+		HttpServletResponse httpResponse = (HttpServletResponse) response;
34
+		Map<String, String[]> parms = httpRequest.getParameterMap();
35
+
36
+		if (parms.containsKey("callback")) {
37
+			if (log.isDebugEnabled())
38
+				log.debug("Wrapping response with JSONP callback '" + parms.get("callback")[0] + "'");
39
+
40
+			OutputStream out = httpResponse.getOutputStream();
41
+
42
+			GenericResponseWrapper wrapper = new GenericResponseWrapper(httpResponse);
43
+
44
+			chain.doFilter(request, wrapper);
45
+
46
+			//handles the content-size truncation
47
+			ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
48
+			outputStream.write(new String(parms.get("callback")[0] + "(").getBytes());
49
+			outputStream.write(wrapper.getData());
50
+			outputStream.write(new String(");").getBytes());
51
+			byte jsonpResponse[] = outputStream.toByteArray();
52
+
53
+			wrapper.setContentType("text/javascript;charset=UTF-8");
54
+			wrapper.setContentLength(jsonpResponse.length);
55
+
56
+			out.write(jsonpResponse);
57
+
58
+			out.close();
59
+
60
+		} else {
61
+			chain.doFilter(request, response);
62
+		}
63
+	}
64
+
65
+	public void destroy() {}
66
+}

+ 19 - 0
src/main/java/com/chinaitop/depot/act/rest/servlet/filterBean.java

@@ -0,0 +1,19 @@
1
+package com.chinaitop.depot.act.rest.servlet;
2
+
3
+import org.springframework.boot.web.servlet.FilterRegistrationBean;
4
+import org.springframework.context.annotation.Bean;
5
+import org.springframework.context.annotation.Configuration;
6
+/**
7
+ * 配置过滤器
8
+ * @author xujh
9
+ * @version 2017-10-17
10
+ */
11
+@Configuration
12
+public class filterBean {
13
+	  @Bean
14
+	  public FilterRegistrationBean indexFilterRegistration() {
15
+	    FilterRegistrationBean registration = new FilterRegistrationBean(new JsonpCallbackFilter());
16
+	    registration.addUrlPatterns("/act/service/*");
17
+	    return registration;
18
+	  }
19
+}

+ 62 - 0
src/main/java/com/chinaitop/depot/act/service/ActDynamicFormService.java

@@ -0,0 +1,62 @@
1
+package com.chinaitop.depot.act.service;
2
+
3
+import java.util.HashMap;
4
+import java.util.List;
5
+import java.util.Map;
6
+import java.util.Map.Entry;
7
+
8
+import org.activiti.engine.FormService;
9
+import org.activiti.engine.RepositoryService;
10
+import org.activiti.engine.form.FormProperty;
11
+import org.activiti.engine.impl.form.StartFormDataImpl;
12
+import org.activiti.engine.repository.ProcessDefinition;
13
+import org.activiti.engine.repository.ProcessDefinitionQuery;
14
+import org.slf4j.Logger;
15
+import org.slf4j.LoggerFactory;
16
+import org.springframework.beans.factory.annotation.Autowired;
17
+import org.springframework.stereotype.Service;
18
+import org.springframework.web.bind.annotation.PathVariable;
19
+/**
20
+ * 流程模型相关Service
21
+ * @author xujh
22
+ * @version 2017-10-11
23
+ */
24
+@Service
25
+public class ActDynamicFormService {
26
+	private Logger logger = LoggerFactory.getLogger(getClass());
27
+	@Autowired
28
+    private RepositoryService repositoryService;
29
+	@Autowired
30
+    private FormService formService;
31
+	public List<ProcessDefinition> getProcess(){
32
+		// 读取所有流程
33
+        ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().active().orderByDeploymentId().desc();
34
+        List<ProcessDefinition> list = query.list();
35
+		return list;
36
+	}
37
+	
38
+	public Map<String, Object> findStartForm(@PathVariable("processDefinitionId") String processDefinitionId) throws Exception {
39
+        Map<String, Object> result = new HashMap<String, Object>();
40
+        StartFormDataImpl startFormData = (StartFormDataImpl) formService.getStartFormData(processDefinitionId);
41
+        startFormData.setProcessDefinition(null);
42
+
43
+    /*
44
+     * 读取enum类型数据,用于下拉框
45
+     */
46
+        List<FormProperty> formProperties = startFormData.getFormProperties();
47
+        for (FormProperty formProperty : formProperties) {
48
+            @SuppressWarnings("unchecked")
49
+			Map<String, String> values = (Map<String, String>) formProperty.getType().getInformation("values");
50
+            if (values != null) {
51
+                for (Entry<String, String> enumEntry : values.entrySet()) {
52
+                    logger.debug("enum, key: {}, value: {}", enumEntry.getKey(), enumEntry.getValue());
53
+                }
54
+                result.put("enum_" + formProperty.getId(), values);
55
+            }
56
+        }
57
+
58
+        result.put("form", startFormData);
59
+
60
+        return result;
61
+    }
62
+}

+ 183 - 0
src/main/java/com/chinaitop/depot/act/service/ActModelService.java

@@ -0,0 +1,183 @@
1
+package com.chinaitop.depot.act.service;
2
+
3
+import java.io.ByteArrayInputStream;
4
+import java.io.IOException;
5
+import java.io.UnsupportedEncodingException;
6
+import java.util.List;
7
+
8
+import javax.servlet.http.HttpServletResponse;
9
+
10
+import org.activiti.bpmn.converter.BpmnXMLConverter;
11
+import org.activiti.bpmn.model.BpmnModel;
12
+import org.activiti.editor.constants.ModelDataJsonConstants;
13
+import org.activiti.editor.language.json.converter.BpmnJsonConverter;
14
+import org.activiti.engine.ActivitiException;
15
+import org.activiti.engine.RepositoryService;
16
+import org.activiti.engine.repository.Deployment;
17
+import org.activiti.engine.repository.Model;
18
+import org.activiti.engine.repository.ModelQuery;
19
+import org.activiti.engine.repository.ProcessDefinition;
20
+import org.apache.commons.io.IOUtils;
21
+import org.apache.commons.lang3.StringUtils;
22
+import org.springframework.beans.factory.annotation.Autowired;
23
+import org.springframework.stereotype.Service;
24
+import org.springframework.transaction.annotation.Transactional;
25
+import com.fasterxml.jackson.core.JsonProcessingException;
26
+import com.fasterxml.jackson.databind.JsonNode;
27
+import com.fasterxml.jackson.databind.ObjectMapper;
28
+import com.fasterxml.jackson.databind.node.ObjectNode;
29
+
30
+/**
31
+ * 流程模型相关Service
32
+ * @author xujh
33
+ * @version 2017-10-11
34
+ */
35
+@Service
36
+@Transactional(readOnly = true)
37
+public class ActModelService{
38
+
39
+	@Autowired
40
+	private RepositoryService repositoryService;
41
+	protected ObjectMapper objectMapper = new ObjectMapper();
42
+
43
+
44
+	/**
45
+	 * 创建模型
46
+	 * @throws UnsupportedEncodingException 
47
+	 */
48
+	@SuppressWarnings("deprecation")
49
+	@Transactional(readOnly = false)
50
+	public Model create(String name, String key, String description, String category) throws UnsupportedEncodingException {
51
+		
52
+		ObjectNode editorNode = objectMapper.createObjectNode();
53
+		editorNode.put("id", "canvas");
54
+		editorNode.put("resourceId", "canvas");
55
+		ObjectNode properties = objectMapper.createObjectNode();
56
+		properties.put("process_author", "xujh");
57
+		editorNode.put("properties", properties);
58
+		ObjectNode stencilset = objectMapper.createObjectNode();
59
+		stencilset.put("namespace", "http://b3mn.org/stencilset/bpmn2.0#");
60
+		editorNode.put("stencilset", stencilset);
61
+		
62
+		Model modelData = repositoryService.newModel();
63
+		description = StringUtils.defaultString(description);
64
+		modelData.setKey(StringUtils.defaultString(key));
65
+		modelData.setName(name);
66
+		modelData.setCategory(category);
67
+		modelData.setVersion(Integer.parseInt(String.valueOf(repositoryService.createModelQuery().modelKey(modelData.getKey()).count()+1)));
68
+
69
+		ObjectNode modelObjectNode = objectMapper.createObjectNode();
70
+		modelObjectNode.put(ModelDataJsonConstants.MODEL_NAME, name);
71
+		modelObjectNode.put(ModelDataJsonConstants.MODEL_REVISION, modelData.getVersion());
72
+		modelObjectNode.put(ModelDataJsonConstants.MODEL_DESCRIPTION, description);
73
+		modelData.setMetaInfo(modelObjectNode.toString());
74
+		
75
+		repositoryService.saveModel(modelData);
76
+		repositoryService.addModelEditorSource(modelData.getId(), editorNode.toString().getBytes("utf-8"));
77
+		
78
+		return modelData;
79
+	}
80
+
81
+	/**
82
+	 * 根据Model部署流程
83
+	 */
84
+	@Transactional(readOnly = false)
85
+	public String deploy(String id) {
86
+		String message = "";
87
+		try {
88
+			org.activiti.engine.repository.Model modelData = repositoryService.getModel(id);
89
+			BpmnJsonConverter jsonConverter = new BpmnJsonConverter();
90
+			JsonNode editorNode = new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelData.getId()));
91
+			BpmnModel bpmnModel = jsonConverter.convertToBpmnModel(editorNode);
92
+			BpmnXMLConverter xmlConverter = new BpmnXMLConverter();
93
+			byte[] bpmnBytes = xmlConverter.convertToXML(bpmnModel);
94
+			
95
+			String processName = modelData.getName();
96
+			if (!StringUtils.endsWith(processName, ".bpmn20.xml")){
97
+				processName += ".bpmn20.xml";
98
+			}
99
+			ByteArrayInputStream in = new ByteArrayInputStream(bpmnBytes);
100
+			Deployment deployment = repositoryService.createDeployment().name(modelData.getName())
101
+					.addInputStream(processName, in).deploy();
102
+			
103
+			// 设置流程分类
104
+			List<ProcessDefinition> list = repositoryService.createProcessDefinitionQuery().deploymentId(deployment.getId()).list();
105
+			for (ProcessDefinition processDefinition : list) {
106
+				repositoryService.setProcessDefinitionCategory(processDefinition.getId(), modelData.getCategory());
107
+				message = "部署成功,流程ID=" + processDefinition.getId();
108
+			}
109
+			if (list.size() == 0){
110
+				message = "部署失败,没有流程。";
111
+			}
112
+		} catch (Exception e) {
113
+			throw new ActivitiException("设计模型图不正确,检查模型正确性,模型ID="+id, e);
114
+		}
115
+		return message;
116
+	}
117
+	
118
+	/**
119
+	 * 导出model的xml文件
120
+	 * @throws IOException 
121
+	 * @throws JsonProcessingException 
122
+	 */
123
+	public void export(String id, HttpServletResponse response) {
124
+		try {
125
+			org.activiti.engine.repository.Model modelData = repositoryService.getModel(id);
126
+			BpmnJsonConverter jsonConverter = new BpmnJsonConverter();
127
+			JsonNode editorNode = new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelData.getId()));
128
+			BpmnModel bpmnModel = jsonConverter.convertToBpmnModel(editorNode);
129
+			BpmnXMLConverter xmlConverter = new BpmnXMLConverter();
130
+			byte[] bpmnBytes = xmlConverter.convertToXML(bpmnModel);
131
+
132
+			ByteArrayInputStream in = new ByteArrayInputStream(bpmnBytes);
133
+			IOUtils.copy(in, response.getOutputStream());
134
+			String filename = bpmnModel.getMainProcess().getId() + ".bpmn20.xml";
135
+			response.setHeader("Content-Disposition", "attachment; filename=" + filename);
136
+			response.flushBuffer();
137
+		} catch (Exception e) {
138
+			throw new ActivitiException("导出model的xml文件失败,模型ID="+id, e);
139
+		}
140
+		
141
+	}
142
+
143
+	/**
144
+	 * 更新Model分类
145
+	 */
146
+	@Transactional(readOnly = false)
147
+	public void updateCategory(String id, String category) {
148
+		org.activiti.engine.repository.Model modelData = repositoryService.getModel(id);
149
+		modelData.setCategory(category);
150
+		repositoryService.saveModel(modelData);
151
+	}
152
+	
153
+	/**
154
+	 * 删除模型
155
+	 * @param id
156
+	 * @return
157
+	 */
158
+	@Transactional(readOnly = false)
159
+	public void delete(String id) {
160
+		repositoryService.deleteModel(id);
161
+	}
162
+
163
+	public List<Model> queryByExample() {
164
+		// TODO Auto-generated method stub
165
+//		List<Model> list = repositoryService.createModelQuery().list();
166
+		List<Model> list = repositoryService.createModelQuery().list();
167
+		return list;
168
+	}
169
+	
170
+	/**
171
+	 * 流程模型列表
172
+	 */
173
+	public List<Model> modelList(String category) {
174
+
175
+		ModelQuery modelQuery = repositoryService.createModelQuery().latestVersion().orderByLastUpdateTime().desc();
176
+		
177
+//		if (StringUtils.isNotEmpty(category)){
178
+//			modelQuery.modelCategory(category);
179
+//		}
180
+		List<Model> list = modelQuery.orderByCreateTime().desc().list();
181
+		return list;
182
+	}
183
+}

+ 276 - 0
src/main/java/com/chinaitop/depot/act/service/ActProcessService.java

@@ -0,0 +1,276 @@
1
+package com.chinaitop.depot.act.service;
2
+
3
+import java.io.File;
4
+import java.io.IOException;
5
+import java.io.InputStream;
6
+import java.io.InputStreamReader;
7
+import java.io.UnsupportedEncodingException;
8
+import java.util.ArrayList;
9
+import java.util.List;
10
+import java.util.zip.ZipInputStream;
11
+
12
+import javax.annotation.Resource;
13
+import javax.servlet.http.HttpServletRequest;
14
+import javax.xml.stream.XMLInputFactory;
15
+import javax.xml.stream.XMLStreamException;
16
+import javax.xml.stream.XMLStreamReader;
17
+
18
+import org.activiti.bpmn.converter.BpmnXMLConverter;
19
+import org.activiti.bpmn.model.BpmnModel;
20
+import org.activiti.editor.constants.ModelDataJsonConstants;
21
+import org.activiti.editor.language.json.converter.BpmnJsonConverter;
22
+import org.activiti.engine.ActivitiException;
23
+import org.activiti.engine.RepositoryService;
24
+import org.activiti.engine.RuntimeService;
25
+import org.activiti.engine.repository.Deployment;
26
+import org.activiti.engine.repository.ProcessDefinition;
27
+import org.activiti.engine.repository.ProcessDefinitionQuery;
28
+import org.activiti.engine.runtime.ProcessInstance;
29
+import org.apache.commons.io.FilenameUtils;
30
+import org.springframework.stereotype.Service;
31
+import org.springframework.transaction.annotation.Transactional;
32
+import org.springframework.web.multipart.MultipartFile;
33
+import com.fasterxml.jackson.databind.ObjectMapper;
34
+import com.fasterxml.jackson.databind.node.ObjectNode;
35
+
36
+
37
+/**
38
+ * 流程定义相关Service
39
+ * @author xujh
40
+ * @version 2017-10-11
41
+ */
42
+@Service
43
+public class ActProcessService {
44
+	@Resource
45
+	private RepositoryService repositoryService;
46
+	@Resource
47
+	private RuntimeService runtimeService;
48
+	
49
+	/**
50
+	 * 流程定义列表
51
+	 */
52
+	public List<ProcessDefinition> processList(HttpServletRequest request) {
53
+		ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery()
54
+	    		.latestVersion().orderByProcessDefinitionKey().asc();
55
+		/*List<ProcessDefinition> list = repositoryService.createProcessDefinitionQuery()//创建流程定义查询
56
+				.orderByProcessDefinitionVersion().asc()//按照版本的升序排列
57
+				//.orderByProcessDefinitionName().desc()//按照流程定义的名称降序排列
58
+				.list();//返回一个集合列表,封装流程定义
59
+		//.singleResult();//返回唯一结果集
60
+		 */
61
+		
62
+		
63
+//		Integer depotId =(Integer) request.getSession().getAttribute("depotId");
64
+//		
65
+//		if (depotId.toString()!=null && "".equals(depotId.toString())){
66
+//	    	processDefinitionQuery.processDefinitionCategory(depotId.toString());
67
+//		}
68
+		
69
+		List<ProcessDefinition> list =processDefinitionQuery.list();
70
+		return list;
71
+	}
72
+
73
+	/**
74
+	 * 部署流程 - 保存
75
+	 * @param file
76
+	 * @return
77
+	 */
78
+	@Transactional(readOnly = false)
79
+	public String deploy(String exportDir, String category, MultipartFile file) {
80
+
81
+		String message = "";
82
+		
83
+		String fileName = file.getOriginalFilename();
84
+		
85
+		try {
86
+			InputStream fileInputStream = file.getInputStream();
87
+			Deployment deployment = null;
88
+			String extension = FilenameUtils.getExtension(fileName);
89
+			if (extension.equals("zip") || extension.equals("bar")) {
90
+				ZipInputStream zip = new ZipInputStream(fileInputStream);
91
+				deployment = repositoryService.createDeployment().addZipInputStream(zip).deploy();
92
+			} else if (extension.equals("png")) {
93
+				deployment = repositoryService.createDeployment().addInputStream(fileName, fileInputStream).deploy();
94
+			} else if (fileName.indexOf("bpmn20.xml") != -1) {
95
+				deployment = repositoryService.createDeployment().addInputStream(fileName, fileInputStream).deploy();
96
+			} else if (extension.equals("bpmn")) { // bpmn扩展名特殊处理,转换为bpmn20.xml
97
+				String baseName = FilenameUtils.getBaseName(fileName); 
98
+				deployment = repositoryService.createDeployment().addInputStream(baseName + ".bpmn20.xml", fileInputStream).deploy();
99
+			} else {
100
+				message = "不支持的文件类型:" + extension;
101
+			}
102
+			
103
+			List<ProcessDefinition> list = repositoryService.createProcessDefinitionQuery().deploymentId(deployment.getId()).list();
104
+
105
+			// 设置流程分类
106
+			for (ProcessDefinition processDefinition : list) {
107
+//					ActUtils.exportDiagramToFile(repositoryService, processDefinition, exportDir);
108
+				repositoryService.setProcessDefinitionCategory(processDefinition.getId(), category);
109
+				message += "部署成功,流程ID=" + processDefinition.getId() + "<br/>";
110
+			}
111
+			
112
+			if (list.size() == 0){
113
+				message = "部署失败,没有流程。";
114
+			}
115
+			
116
+		} catch (Exception e) {
117
+			throw new ActivitiException("部署失败!", e);
118
+		}
119
+		return message;
120
+	}
121
+	
122
+	/**
123
+	 * 设置流程分类
124
+	 */
125
+	@Transactional(readOnly = false)
126
+	public void updateCategory(String procDefId, String category) {
127
+		repositoryService.setProcessDefinitionCategory(procDefId, category);
128
+	}
129
+
130
+	/**
131
+	 * 挂起、激活流程实例
132
+	 */
133
+	@Transactional(readOnly = false)
134
+	public String updateState(String state, String procDefId) {
135
+		if (state.equals("active")) {
136
+			repositoryService.activateProcessDefinitionById(procDefId, true, null);
137
+			return "已激活ID为[" + procDefId + "]的流程定义。";
138
+		} else if (state.equals("suspend")) {
139
+			repositoryService.suspendProcessDefinitionById(procDefId, true, null);
140
+			return "已挂起ID为[" + procDefId + "]的流程定义。";
141
+		}
142
+		return "无操作";
143
+	}
144
+	
145
+	/**
146
+	 * 将部署的流程转换为模型
147
+	 * @param procDefId
148
+	 * @throws UnsupportedEncodingException
149
+	 * @throws XMLStreamException
150
+	 */
151
+	@Transactional(readOnly = false)
152
+	public org.activiti.engine.repository.Model convertToModel(String procDefId) throws UnsupportedEncodingException, XMLStreamException {
153
+		
154
+		ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(procDefId).singleResult();
155
+		InputStream bpmnStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(),
156
+		processDefinition.getResourceName());
157
+		XMLInputFactory xif = XMLInputFactory.newInstance();
158
+		InputStreamReader in = new InputStreamReader(bpmnStream, "UTF-8");
159
+		XMLStreamReader xtr = xif.createXMLStreamReader(in);
160
+		BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr);
161
+	
162
+		BpmnJsonConverter converter = new BpmnJsonConverter();
163
+		ObjectNode modelNode = converter.convertToJson(bpmnModel);
164
+		org.activiti.engine.repository.Model modelData = repositoryService.newModel();
165
+		modelData.setKey(processDefinition.getKey());
166
+		modelData.setName(processDefinition.getResourceName());
167
+		modelData.setCategory(processDefinition.getCategory());//.getDeploymentId());
168
+		modelData.setDeploymentId(processDefinition.getDeploymentId());
169
+		modelData.setVersion(Integer.parseInt(String.valueOf(repositoryService.createModelQuery().modelKey(modelData.getKey()).count()+1)));
170
+	
171
+		ObjectNode modelObjectNode = new ObjectMapper().createObjectNode();
172
+		modelObjectNode.put(ModelDataJsonConstants.MODEL_NAME, processDefinition.getName());
173
+		modelObjectNode.put(ModelDataJsonConstants.MODEL_REVISION, modelData.getVersion());
174
+		modelObjectNode.put(ModelDataJsonConstants.MODEL_DESCRIPTION, processDefinition.getDescription());
175
+		modelData.setMetaInfo(modelObjectNode.toString());
176
+	
177
+		repositoryService.saveModel(modelData);
178
+	
179
+		repositoryService.addModelEditorSource(modelData.getId(), modelNode.toString().getBytes("utf-8"));
180
+	
181
+		return modelData;
182
+	}
183
+	
184
+
185
+
186
+	/**
187
+	 * 删除部署的流程,级联删除流程实例
188
+	 * @param deploymentId 流程部署ID
189
+	 */
190
+//	@Transactional(readOnly = false)
191
+	public void deleteDeployment(String deploymentId) {
192
+		repositoryService.deleteDeployment(deploymentId, true);
193
+	}
194
+	
195
+	/**
196
+	 * 删除部署的流程实例
197
+	 * @param procInsId 流程实例ID
198
+	 * @param deleteReason 删除原因,可为空
199
+	 */
200
+	@Transactional(readOnly = false)
201
+	public void deleteProcIns(String procInsId, String deleteReason) {
202
+		runtimeService.deleteProcessInstance(procInsId, deleteReason);
203
+	}
204
+	
205
+	
206
+	/**
207
+	 * 导出图片文件到硬盘
208
+	 */
209
+	public List<String> exportDiagrams(String exportDir) throws IOException {
210
+		List<String> files = new ArrayList<String>();
211
+		List<ProcessDefinition> list = repositoryService.createProcessDefinitionQuery().list();
212
+		
213
+		for (ProcessDefinition processDefinition : list) {
214
+			String diagramResourceName = processDefinition.getDiagramResourceName();
215
+			String key = processDefinition.getKey();
216
+			int version = processDefinition.getVersion();
217
+			String diagramPath = "";
218
+
219
+			InputStream resourceAsStream = repositoryService.getResourceAsStream(
220
+					processDefinition.getDeploymentId(), diagramResourceName);
221
+			byte[] b = new byte[resourceAsStream.available()];
222
+
223
+			@SuppressWarnings("unused")
224
+			int len = -1;
225
+			resourceAsStream.read(b, 0, b.length);
226
+
227
+			// create file if not exist
228
+			String diagramDir = exportDir + "/" + key + "/" + version;
229
+			File diagramDirFile = new File(diagramDir);
230
+			if (!diagramDirFile.exists()) {
231
+				diagramDirFile.mkdirs();
232
+			}
233
+			diagramPath = diagramDir + "/" + diagramResourceName;
234
+			File file = new File(diagramPath);
235
+
236
+			// 文件存在退出
237
+			if (file.exists()) {
238
+				// 文件大小相同时直接返回否则重新创建文件(可能损坏)
239
+				throw  new  NullPointerException("diagram exist");
240
+			} else {
241
+				file.createNewFile();
242
+				/*logger.debug("export diagram to : {}", diagramPath);*/
243
+				throw  new  NullPointerException("export diagram to");
244
+			}
245
+			
246
+		}
247
+		
248
+		return files;
249
+	}
250
+	
251
+	/**
252
+	 * 读取资源,通过部署ID
253
+	 * @param processDefinitionId  流程定义ID
254
+	 * @param processInstanceId 流程实例ID
255
+	 * @param resourceType 资源类型(xml|image)
256
+	 */
257
+	public InputStream resourceRead(String procDefId, String proInsId, String resType) throws Exception {
258
+		
259
+		if (procDefId!=null){
260
+			ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(proInsId).singleResult();
261
+			procDefId = processInstance.getProcessDefinitionId();
262
+		}
263
+		ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(procDefId).singleResult();
264
+		
265
+		String resourceName = "";
266
+		if (resType.equals("image")) {
267
+			resourceName = processDefinition.getDiagramResourceName();
268
+		} else if (resType.equals("xml")) {
269
+			resourceName = processDefinition.getResourceName();
270
+		}
271
+		
272
+		InputStream resourceAsStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), resourceName);
273
+		return resourceAsStream;
274
+	}
275
+	
276
+}

+ 745 - 0
src/main/java/com/chinaitop/depot/act/service/ActTaskService.java

@@ -0,0 +1,745 @@
1
+package com.chinaitop.depot.act.service;
2
+
3
+import java.util.ArrayList;
4
+import java.util.HashMap;
5
+import java.util.List;
6
+import java.util.Map;
7
+import javax.annotation.Resource;
8
+import org.activiti.engine.FormService;
9
+import org.activiti.engine.HistoryService;
10
+import org.activiti.engine.IdentityService;
11
+import org.activiti.engine.RepositoryService;
12
+import org.activiti.engine.RuntimeService;
13
+import org.activiti.engine.TaskService;
14
+import org.activiti.engine.history.HistoricActivityInstance;
15
+import org.activiti.engine.history.HistoricProcessInstance;
16
+import org.activiti.engine.history.HistoricTaskInstance;
17
+import org.activiti.engine.history.HistoricTaskInstanceQuery;
18
+import org.activiti.engine.impl.RepositoryServiceImpl;
19
+import org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior;
20
+import org.activiti.engine.impl.persistence.entity.ExecutionEntity;
21
+import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity;
22
+import org.activiti.engine.impl.pvm.PvmActivity;
23
+import org.activiti.engine.impl.pvm.PvmTransition;
24
+import org.activiti.engine.impl.pvm.process.ActivityImpl;
25
+import org.activiti.engine.impl.task.TaskDefinition;
26
+import org.activiti.engine.repository.ProcessDefinitionQuery;
27
+import org.activiti.engine.runtime.ProcessInstance;
28
+import org.activiti.engine.task.Comment;
29
+import org.activiti.engine.task.Task;
30
+import org.activiti.engine.task.TaskQuery;
31
+import org.slf4j.Logger;
32
+import org.slf4j.LoggerFactory;
33
+import org.springframework.beans.factory.annotation.Autowired;
34
+import org.springframework.stereotype.Service;
35
+import org.springframework.transaction.annotation.Transactional;
36
+import com.alibaba.fastjson.JSONObject;
37
+import com.chinaitop.depot.act.model.Act;
38
+import com.chinaitop.depot.act.model.DeploymentList;
39
+import com.chinaitop.depot.act.model.HistoryList;
40
+import com.chinaitop.depot.business.model.enums.TaskType;
41
+import com.chinaitop.depot.business.mapper.UserInfoMapper;
42
+import com.chinaitop.depot.business.mapper.UserRoleMapper;
43
+import com.chinaitop.depot.business.model.OrgInfo;
44
+import com.chinaitop.depot.business.model.UserInfo;
45
+import com.chinaitop.depot.business.model.UserInfoExample;
46
+import com.chinaitop.depot.business.model.UserRole;
47
+import com.chinaitop.depot.business.model.UserRoleExample;
48
+import com.chinaitop.depot.business.model.BusinessPlanExample.Criteria;
49
+import com.chinaitop.depot.business.service.OrgInfoService;
50
+import com.chinaitop.depot.business.service.UserInfoService;
51
+import com.chinaitop.depot.utils.activiti.StringUtils;
52
+import com.google.common.collect.Lists;
53
+import com.google.common.collect.Maps;
54
+
55
+/**
56
+ * 流程定义相关Service
57
+ * @author xujh
58
+ * @version 2017-10-11
59
+ */
60
+@Service
61
+public class ActTaskService {
62
+	
63
+	/**
64
+	 * 日志对象
65
+	 */
66
+	protected Logger logger = LoggerFactory.getLogger(getClass());
67
+
68
+	@Autowired
69
+	private RuntimeService runtimeService;
70
+	@Autowired
71
+	private TaskService taskService;
72
+	@Autowired
73
+	private FormService formService;
74
+	@Autowired
75
+	private HistoryService historyService;
76
+	@Autowired
77
+	private RepositoryService repositoryService;
78
+	@Autowired
79
+	private IdentityService identityService;
80
+	@Resource
81
+	private UserRoleMapper userRoleMapper;
82
+	@Resource
83
+	private UserInfoMapper userInfoMapper;
84
+	@Resource
85
+	private UserInfoService userInfoService;
86
+	@Resource
87
+	private OrgInfoService orgInfoService;
88
+	
89
+	/**
90
+	 * 获取待办列表
91
+	 * @param procDefKey 流程定义标识
92
+	 * @return
93
+	 */
94
+	public List<DeploymentList> todoList(String name,TaskType taskType){
95
+		List<Act> result = new ArrayList<Act>();
96
+		
97
+		// =============== 已经签收的任务  ===============
98
+		TaskQuery todoTaskQuery = taskService.createTaskQuery().taskAssignee(name).active()
99
+				.includeProcessVariables().orderByTaskCreateTime().desc();
100
+		
101
+		// 设置查询条件
102
+		if(taskType != null) {
103
+			todoTaskQuery.processDefinitionKey(taskType.getTaskType());
104
+		}
105
+		
106
+		// 查询列表
107
+		List<Task> todoList = todoTaskQuery.list();
108
+		for (Task task : todoList) {
109
+			Act e = new Act();
110
+			e.setTask(task);
111
+			e.setVars(task.getProcessVariables());
112
+			e.setStatus("todo");
113
+			result.add(e);
114
+		}
115
+		
116
+		// =============== 等待签收的任务  ===============
117
+		TaskQuery toClaimQuery = taskService.createTaskQuery().taskCandidateUser(name)
118
+				.includeProcessVariables().active().orderByTaskCreateTime().desc();
119
+		
120
+		// 查询列表
121
+		List<Task> toClaimList = toClaimQuery.list();
122
+		for (Task task : toClaimList) {
123
+			Act e = new Act();
124
+			e.setTask(task);
125
+			e.setVars(task.getProcessVariables());
126
+			e.setStatus("claim");
127
+			result.add(e);
128
+		}
129
+		
130
+		List<DeploymentList> deploymentlist=new ArrayList<DeploymentList>();
131
+		if(result!=null&&result.size()>0){
132
+			for(Act m: result){
133
+				DeploymentList deploymentLists=new DeploymentList();
134
+				//第一个参数
135
+				deploymentLists.setTaskId(m.getTaskId());
136
+				//第二个参数
137
+				deploymentLists.setTaskName(m.getTaskName());
138
+				//第三个参数
139
+				deploymentLists.setTaskDefKey(m.getTaskDefKey());
140
+				//第四个参数
141
+				deploymentLists.setProcInsId(m.getProcInsId());
142
+				//第五个参数
143
+				deploymentLists.setProcDefId(m.getProcDefId());
144
+				//第六个参数
145
+				deploymentLists.setStatus(m.getStatus());
146
+				deploymentLists.setName(m.getProcDefId());
147
+				deploymentLists.setResourceName(m.getAssignee());
148
+				deploymentlist.add(deploymentLists);
149
+			}
150
+			
151
+		}
152
+		
153
+		
154
+		
155
+		return deploymentlist;
156
+	}
157
+
158
+	
159
+	/**
160
+	 * 获取已办任务
161
+	 * @param page
162
+	 * @param procDefKey 流程定义标识
163
+	 * @return
164
+	 */
165
+	public List<DeploymentList> historicList(String name,String taskType){
166
+//		String userId = "";//ObjectUtils.toString(UserUtils.getUser().getId());
167
+
168
+		HistoricTaskInstanceQuery histTaskQuery = historyService.createHistoricTaskInstanceQuery().taskAssignee(name).finished()
169
+				.includeProcessVariables().orderByHistoricTaskInstanceEndTime().desc();
170
+		
171
+		// 设置查询条件
172
+		if (StringUtils.isNotBlank(taskType)){
173
+			histTaskQuery.processDefinitionKey(taskType);
174
+		}
175
+		/*if (act.getBeginDate() != null){
176
+			histTaskQuery.taskCompletedAfter(act.getBeginDate());
177
+		}
178
+		if (act.getEndDate() != null){
179
+			histTaskQuery.taskCompletedBefore(act.getEndDate());
180
+		}*/
181
+		
182
+		// 查询列表
183
+		List<HistoricTaskInstance> list = histTaskQuery.list();
184
+		//处理分页问题
185
+		List<Act> actList=Lists.newArrayList();
186
+		for (HistoricTaskInstance histTask : list) {
187
+			Act e = new Act();
188
+			e.setHistTask(histTask);
189
+			e.setVars(histTask.getProcessVariables());
190
+			e.setStatus("finish");
191
+			actList.add(e);
192
+		}
193
+		
194
+		List<DeploymentList> deploymentlist=new ArrayList<DeploymentList>();
195
+		if(actList!=null&&actList.size()>0){
196
+			for(Act m: actList){
197
+				DeploymentList deploymentLists=new DeploymentList();
198
+				//第一个参数
199
+				deploymentLists.setTaskId(m.getTaskId());
200
+				//第二个参数
201
+				deploymentLists.setTaskName(m.getTaskName());
202
+				//第三个参数
203
+				deploymentLists.setTaskDefKey(m.getTaskDefKey());
204
+				//第四个参数
205
+				deploymentLists.setProcInsId(m.getProcInsId());
206
+				//第五个参数
207
+				deploymentLists.setProcDefId(m.getProcDefId());
208
+				//第六个参数
209
+				deploymentLists.setStatus(m.getStatus());
210
+				deploymentLists.setName(m.getProcDefId());
211
+				deploymentLists.setResourceName(m.getAssignee());
212
+				deploymentlist.add(deploymentLists);
213
+			}
214
+			
215
+		}
216
+		
217
+		return deploymentlist;
218
+	}
219
+	
220
+	/**
221
+	 * 获取流转历史列表
222
+	 * @param procInsId 流程实例
223
+	 * @param startAct 开始活动节点名称
224
+	 * @param endAct 结束活动节点名称
225
+	 */
226
+	@SuppressWarnings("unused")
227
+	public List<HistoryList> histoicFlowList(String procInsId, String startAct, String endAct){
228
+		List<Act> actList = Lists.newArrayList();
229
+		List<HistoricActivityInstance> list = historyService.createHistoricActivityInstanceQuery().processInstanceId(procInsId)
230
+				.orderByHistoricActivityInstanceStartTime().asc().orderByHistoricActivityInstanceEndTime().asc().list();
231
+		
232
+		boolean start = false;
233
+		Map<String, Integer> actMap = Maps.newHashMap();
234
+		
235
+		for (int i=0; i<list.size(); i++){
236
+			
237
+			HistoricActivityInstance histIns = list.get(i);
238
+			
239
+			// 过滤开始节点前的节点
240
+			if (StringUtils.isNotBlank(startAct) && startAct.equals(histIns.getActivityId())){
241
+				start = true;
242
+			}
243
+			if (StringUtils.isNotBlank(startAct) && !start){
244
+				continue;
245
+			}
246
+			
247
+			// 只显示开始节点和结束节点,并且执行人不为空的任务
248
+			if (StringUtils.isNotBlank(histIns.getAssignee())
249
+					 || "startEvent".equals(histIns.getActivityType())
250
+					 || "endEvent".equals(histIns.getActivityType())){
251
+				
252
+				// 给节点增加一个序号
253
+				Integer actNum = actMap.get(histIns.getActivityId());
254
+				if (actNum == null){
255
+					actMap.put(histIns.getActivityId(), actMap.size());
256
+				}
257
+				
258
+				Act e = new Act();
259
+				e.setHistIns(histIns);
260
+				// 获取流程发起人名称
261
+				if ("startEvent".equals(histIns.getActivityType())){
262
+					List<HistoricProcessInstance> il = historyService.createHistoricProcessInstanceQuery().processInstanceId(procInsId).orderByProcessInstanceStartTime().asc().list();
263
+//					List<HistoricIdentityLink> il = historyService.getHistoricIdentityLinksForProcessInstance(procInsId);
264
+					if (il.size() > 0){
265
+						if (StringUtils.isNotBlank(il.get(0).getStartUserId())){
266
+//							User user = UserUtils.getByLoginName(il.get(0).getStartUserId());
267
+							UserInfo user = null;
268
+							if (user != null){
269
+								e.setAssignee(histIns.getAssignee());
270
+								e.setAssigneeName(user.getUsername());
271
+							}
272
+						}
273
+					}
274
+				}
275
+				// 获取任务执行人名称
276
+				if (StringUtils.isNotEmpty(histIns.getAssignee())){
277
+//					User user = UserUtils.getByLoginName(histIns.getAssignee());
278
+					UserInfo user = null;
279
+					if (user != null){
280
+						e.setAssignee(histIns.getAssignee());
281
+						e.setAssigneeName(user.getUsername());
282
+					}
283
+				}
284
+				// 获取意见评论内容
285
+				if (StringUtils.isNotBlank(histIns.getTaskId())){
286
+					List<Comment> commentList = taskService.getTaskComments(histIns.getTaskId());
287
+					if (commentList.size()>0){
288
+						e.setComment(commentList.get(0).getFullMessage());
289
+					}
290
+				}
291
+				actList.add(e);
292
+			}
293
+			
294
+			// 过滤结束节点后的节点
295
+			if (StringUtils.isNotBlank(endAct) && endAct.equals(histIns.getActivityId())){
296
+				boolean bl = false;
297
+				Integer actNum = actMap.get(histIns.getActivityId());
298
+				// 该活动节点,后续节点是否在结束节点之前,在后续节点中是否存在
299
+				for (int j=i+1; j<list.size(); j++){
300
+					HistoricActivityInstance hi = list.get(j);
301
+					Integer actNumA = actMap.get(hi.getActivityId());
302
+					if ((actNumA != null && actNumA < actNum) || StringUtils.equals(hi.getActivityId(), histIns.getActivityId())){
303
+						bl = true;
304
+					}
305
+				}
306
+				if (!bl){
307
+					break;
308
+				}
309
+			}
310
+		}
311
+		
312
+		List<HistoryList> historyList1=new ArrayList<HistoryList>();
313
+		for (int j = 0; j < actList.size(); j++) {
314
+			if(j != 0&&j!=actList.size()-1){
315
+				HistoryList historyList=new HistoryList();
316
+				historyList.setAssigneeName(actList.get(j).getHistIns().getAssignee());//审批人名字
317
+				
318
+				UserInfo userInfo = userInfoService.findById( Integer.valueOf(actList.get(j).getHistIns().getAssignee()));
319
+				Integer orgId = userInfo.getOrgId();
320
+				
321
+				OrgInfo orgInfo=orgInfoService.findById(orgId);
322
+				String departmentName=orgInfo.getOrgName();
323
+				historyList.setDepartment(departmentName);
324
+				
325
+				historyList.setComment(actList.get(j).getComment());//审批意见
326
+				historyList.setStartTime(actList.get(j).getHistIns().getStartTime());//开始时间
327
+				historyList.setEndDate(actList.get(j).getHistIns().getEndTime());//结束时间
328
+				historyList.setActivityName(actList.get(j).getHistIns().getActivityName());//审批人岗位
329
+				historyList1.add(historyList);
330
+			}
331
+		}
332
+		return historyList1;
333
+	}
334
+
335
+	/**
336
+	 * 获取流程列表
337
+	 * @param category 流程分类
338
+	 */
339
+	public Object[] processList(String category) {
340
+		/*
341
+		 * 保存两个对象,一个是ProcessDefinition(流程定义),一个是Deployment(流程部署)
342
+		 */
343
+	    ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery()
344
+	    		.latestVersion().active().orderByProcessDefinitionKey().asc();
345
+	    
346
+	    if (StringUtils.isNotEmpty(category)){
347
+	    	processDefinitionQuery.processDefinitionCategory(category);
348
+		}
349
+	    
350
+		return null;
351
+	}
352
+	
353
+	/**
354
+	 * 获取流程表单(首先获取任务节点表单KEY,如果没有则取流程开始节点表单KEY)
355
+	 * @return
356
+	 */
357
+	public String getFormKey(String procDefId, String taskDefKey){
358
+		String formKey = "";
359
+		if (StringUtils.isNotBlank(procDefId)){
360
+			if (StringUtils.isNotBlank(taskDefKey)){
361
+				try{
362
+					formKey = formService.getTaskFormKey(procDefId, taskDefKey);
363
+				}catch (Exception e) {
364
+					formKey = "";
365
+				}
366
+			}
367
+			if (StringUtils.isBlank(formKey)){
368
+				formKey = formService.getStartFormKey(procDefId);
369
+			}
370
+			if (StringUtils.isBlank(formKey)){
371
+				formKey = "/404";
372
+			}
373
+		}
374
+		logger.debug("getFormKey: {}", formKey);
375
+		return formKey;
376
+	}
377
+	
378
+	/**
379
+	 * 获取流程实例对象
380
+	 * @param procInsId
381
+	 * @return
382
+	 */
383
+	@Transactional(readOnly = false)
384
+	public ProcessInstance getProcIns(String procInsId) {
385
+		return runtimeService.createProcessInstanceQuery().processInstanceId(procInsId).singleResult();
386
+	}
387
+
388
+	
389
+
390
+	/**
391
+	 * 获取任务
392
+	 * @param taskId 任务ID
393
+	 */
394
+	public Task getTask(String taskId){
395
+		return taskService.createTaskQuery().taskId(taskId).singleResult();
396
+	}
397
+	
398
+	/**
399
+	 * 删除任务
400
+	 * @param taskId 任务ID
401
+	 * @param deleteReason 删除原因
402
+	 */
403
+	@Transactional(readOnly = false)
404
+	public void deleteTask(String taskId, String deleteReason){
405
+		taskService.deleteTask(taskId, deleteReason);
406
+	}
407
+	
408
+	
409
+	/**
410
+	 * 提交任务, 并保存意见
411
+	 * @param taskId 任务ID
412
+	 * @param procInsId 流程实例ID,如果为空,则不保存任务提交意见
413
+	 * @param comment 任务提交意见的内容
414
+	 * @param title			流程标题,显示在待办任务标题
415
+	 * @param vars 任务变量
416
+	 */
417
+	@SuppressWarnings("unused")
418
+	@Transactional(readOnly = false)
419
+	public void complete(String taskId, String procInsId, String comment, String title, Map<String, Object> vars){
420
+		String pass = (String) vars.get("pass");
421
+		if(pass.equals("0")&&StringUtils.isNotBlank(procInsId)){
422
+			// 添加意见
423
+			String advice="退回";
424
+			advice+=comment;
425
+		
426
+			taskService.addComment(taskId, procInsId, advice);
427
+			
428
+		}else if (pass.equals("1")&&StringUtils.isNotBlank(procInsId)) {
429
+			// 添加意见
430
+			String advice="同意";
431
+			advice+=comment;
432
+			taskService.addComment(taskId, procInsId, advice);
433
+			
434
+		}else if (pass.equals("2")&&StringUtils.isNotBlank(procInsId)) {
435
+			// 添加意见
436
+			String advice="驳回";
437
+			advice+=comment;
438
+			taskService.addComment(taskId, procInsId, advice);
439
+		}else if (pass.equals("3")&&StringUtils.isNotBlank(procInsId)) {
440
+			// 添加意见
441
+			String advice="拒绝";
442
+			advice+=comment;
443
+			taskService.addComment(taskId, procInsId, advice);
444
+		}
445
+		
446
+		// 设置流程变量
447
+		if (vars == null){
448
+			vars = Maps.newHashMap();
449
+		}
450
+		
451
+		// 设置流程标题
452
+		if (StringUtils.isNotBlank(title)){
453
+			vars.put("title", title);
454
+		}
455
+		
456
+		// 提交任务
457
+		taskService.complete(taskId, vars);
458
+	}
459
+	
460
+	/**
461
+	 * 添加任务意见
462
+	 */
463
+	public void addTaskComment(String taskId, String procInsId, String comment){
464
+		taskService.addComment(taskId, procInsId, comment);
465
+	}
466
+	
467
+	
468
+	/**
469
+	 * 设置当前处理人信息
470
+	 * @param vars
471
+	 * @param currentTask
472
+	 */
473
+	@SuppressWarnings("unused")
474
+	private void setCurrentTaskAssignee(Map<String, Object> vars, Task currentTask) {
475
+		String assignee = currentTask.getAssignee();
476
+		if (assignee != null) {
477
+			org.activiti.engine.identity.User assigneeUser = identityService.createUserQuery().userId(assignee).singleResult();
478
+			String userInfo = assigneeUser.getFirstName() + " " + assigneeUser.getLastName();
479
+			vars.put("当前处理人", userInfo);
480
+		}
481
+	}
482
+	
483
+	/**
484
+	 * 设置当前处理人信息
485
+	 * @param type 启动流程的类型
486
+	 * @param id 业务id
487
+	 * @param name启动人的名字
488
+	 */
489
+	public ProcessInstance startProcess(String type,String id,String name,String userId,String deportId) {
490
+		// 启动流程
491
+        Map<String, Object> variables = new HashMap<String, Object>();
492
+        // TODO 用来设置启动流程的人员ID
493
+        identityService.setAuthenticatedUserId(name);
494
+        String businessKey = id.toString();
495
+        variables.put("type", type);
496
+        variables.put("busId", businessKey);
497
+		variables.put("inputUser", userId);
498
+        //新增拼接businessKey作为业务数据与流程绑定
499
+        String objId =type + ":" + businessKey;
500
+        // 启动流程
501
+        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(type, objId, variables);
502
+        
503
+//        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(type+deportId, objId, variables);
504
+        
505
+		return processInstance;
506
+		
507
+	}
508
+	
509
+	public String startProcessNew(String type,String id,String name,String userId,String deportId){
510
+		ProcessInstance startProcess = this.startProcess(type, id, name, userId, deportId);
511
+		String processInstanceId = startProcess.getProcessInstanceId();
512
+		// 设置流程定义id.
513
+        String processDefinitionId = startProcess.getProcessDefinitionId();
514
+        JSONObject json=new JSONObject();
515
+        json.put("processInstanceId", processInstanceId);
516
+        json.put("processDefinitionId",processDefinitionId);
517
+		return json.toString();
518
+	}
519
+	
520
+	/** 
521
+     * 根据实例编号查找下一个任务节点 
522
+     * @param String procInstId :实例编号 
523
+     * @return 
524
+     */  
525
+    public TaskDefinition nextTaskDefinition(String procInstId){  
526
+        //流程标示  
527
+        String processDefinitionId = historyService.createHistoricProcessInstanceQuery().processInstanceId(procInstId).singleResult().getProcessDefinitionId();  
528
+          
529
+        ProcessDefinitionEntity def = (ProcessDefinitionEntity) ((RepositoryServiceImpl)repositoryService).getDeployedProcessDefinition(processDefinitionId);  
530
+        //执行实例  
531
+        ExecutionEntity execution = (ExecutionEntity) runtimeService.createProcessInstanceQuery().processInstanceId(procInstId).singleResult();  
532
+        //当前实例的执行到哪个节点  
533
+        String activitiId = execution.getActivityId();  
534
+        //获得当前任务的所有节点  
535
+        List<ActivityImpl> activitiList = def.getActivities();  
536
+        String id = null;  
537
+        for(ActivityImpl activityImpl:activitiList){    
538
+            id = activityImpl.getId();   
539
+            if(activitiId.equals(id)){  
540
+                System.out.println("当前任务:"+activityImpl.getProperty("name"));  
541
+                return nextTaskDefinition(activityImpl, activityImpl.getId(),"${pass==1}");  
542
+//              System.out.println(taskDefinition.getCandidateGroupIdExpressions().toArray()[0]);  
543
+//              return taskDefinition;  
544
+            }  
545
+        }  
546
+        return null;  
547
+    }  
548
+      
549
+    /** 
550
+     * 下一个任务节点 
551
+     * @param activityImpl 
552
+     * @param activityId 
553
+     * @param elString 
554
+     * @return 
555
+     */  
556
+    private TaskDefinition nextTaskDefinition(ActivityImpl activityImpl, String activityId, String elString){  
557
+            if("userTask".equals(activityImpl.getProperty("type")) && !activityId.equals(activityImpl.getId())){  
558
+                TaskDefinition taskDefinition = ((UserTaskActivityBehavior)activityImpl.getActivityBehavior()).getTaskDefinition();  
559
+//              taskDefinition.getCandidateGroupIdExpressions().toArray();  
560
+                return taskDefinition;  
561
+            }else{  
562
+                List<PvmTransition> outTransitions = activityImpl.getOutgoingTransitions();  
563
+                List<PvmTransition> outTransitionsTemp = null;  
564
+                for(PvmTransition tr:outTransitions){    
565
+                    PvmActivity ac = tr.getDestination(); //获取线路的终点节点    
566
+                    if("exclusiveGateway".equals(ac.getProperty("type"))){  
567
+                        outTransitionsTemp = ac.getOutgoingTransitions();  
568
+                        if(outTransitionsTemp.size() == 1){  
569
+                            return nextTaskDefinition((ActivityImpl)outTransitionsTemp.get(0).getDestination(), activityId, elString);  
570
+                        }else if(outTransitionsTemp.size() > 1){  
571
+                            for(PvmTransition tr1 : outTransitionsTemp){  
572
+                                Object s = tr1.getProperty("conditionText");  
573
+                                String string = s.toString();
574
+                                if(elString.equals(string)){  
575
+                                    return nextTaskDefinition((ActivityImpl)tr1.getDestination(), activityId, elString);  
576
+                                }  
577
+                            }  
578
+                        }  
579
+                    }else if("userTask".equals(ac.getProperty("type"))){  
580
+                        return ((UserTaskActivityBehavior)((ActivityImpl)ac).getActivityBehavior()).getTaskDefinition();  
581
+                    }else{  
582
+//                        logger.debug(ac.getProperty("type"));  
583
+                    }  
584
+                }   
585
+            return null;  
586
+        }  
587
+    }
588
+    
589
+    public List<UserInfo> getUserByRoleId(Integer roleId) {
590
+    	UserRoleExample userRoleExample = new UserRoleExample();
591
+    	userRoleExample.createCriteria().andRoleIdEqualTo(roleId);
592
+    	List<UserRole> urlist = userRoleMapper.selectByExample(userRoleExample);
593
+    	List<UserInfo> userlist = new ArrayList<UserInfo>();
594
+    	if (urlist.size() > 0) {
595
+        	List<Integer> userIds = new ArrayList<Integer>();
596
+        	for (UserRole userRole : urlist) {
597
+    			userIds.add(userRole.getUserId());
598
+    		}
599
+        	UserInfoExample userExample = new UserInfoExample();
600
+        	userExample.createCriteria().andUserIdIn(userIds);
601
+        	userlist = userInfoMapper.selectByExample(userExample);
602
+    	}
603
+    	return userlist;
604
+    };
605
+    
606
+    
607
+    public List<UserInfo> getUserByRoleId(Integer roleId, Integer orgId) {
608
+    	UserRoleExample userRoleExample = new UserRoleExample();
609
+    	userRoleExample.createCriteria().andRoleIdEqualTo(roleId);
610
+    	List<UserRole> urlist = userRoleMapper.selectByExample(userRoleExample);
611
+    	List<UserInfo> userlist = new ArrayList<UserInfo>();
612
+    	if (urlist.size() > 0) {
613
+    		List<Integer> userIds = new ArrayList<Integer>();
614
+    		for (UserRole userRole : urlist) {
615
+    			userIds.add(userRole.getUserId());
616
+    		}
617
+    		UserInfoExample userExample = new UserInfoExample();
618
+    		UserInfoExample.Criteria criteria = userExample.createCriteria();
619
+    		criteria.andUserIdIn(userIds);
620
+    		criteria.andOrgIdEqualTo(orgId);
621
+    		userlist = userInfoMapper.selectByExample(userExample);
622
+    	}
623
+    	return userlist;
624
+    };
625
+    
626
+    
627
+    //可以分配个人任务从一个人到另一个人(认领任务:)
628
+    //任务ID
629
+    //指定的办理人
630
+	public String setAssigneeTask(String processInstanceId,String userId){
631
+		Task singleResult = selectTask(processInstanceId);
632
+		String taskId = singleResult.getId();
633
+		taskService.setAssignee(taskId, userId);
634
+		String mgs="设置成功";
635
+		return mgs;
636
+	}
637
+	
638
+	//使用流程实例id 查询当前任务信息
639
+	public Task selectTask(String processInstanceId){
640
+		//使用流程实例id 查询当前任务信息
641
+		Task singleResult = taskService.createTaskQuery().processInstanceId(processInstanceId).singleResult();
642
+		return singleResult;
643
+	}
644
+	//使用流程实例id 查询当前任务id
645
+	public String selectTaskId(String processInstanceId){
646
+		Task selectTask = this.selectTask(processInstanceId);
647
+		return selectTask.getId();
648
+	}
649
+	
650
+	/**查询历史任务(获取上一个人的名字)*/
651
+	public String findHistoryTaskName(String processInstanceId){
652
+		String assignee = null;
653
+		@SuppressWarnings("deprecation")
654
+		List<HistoricTaskInstance> list = historyService//与历史数据(历史表)相关的Service
655
+						.createHistoricTaskInstanceQuery()//创建历史任务实例查询
656
+						.processInstanceId(processInstanceId)//
657
+						.orderByHistoricTaskInstanceStartTime().asc()
658
+						.list();
659
+		if(list!=null && list.size()>0){
660
+			int length = list.size()-1;
661
+			for (int i = 0; i < list.size(); i++) {
662
+				if(i==length){
663
+					assignee = list.get(length).getAssignee();
664
+				}
665
+			}
666
+		}
667
+		return assignee;
668
+	}
669
+	/**查询历史任务(获取第一个人的名字)*/
670
+	public String findHistoryFirstTaskName(String processInstanceId){
671
+		String assignee = null;
672
+		@SuppressWarnings("deprecation")
673
+		List<HistoricTaskInstance> list = historyService//与历史数据(历史表)相关的Service
674
+						.createHistoricTaskInstanceQuery()//创建历史任务实例查询
675
+						.processInstanceId(processInstanceId)//
676
+						.orderByHistoricTaskInstanceStartTime().asc()
677
+						.list();
678
+		if(list!=null && list.size()>0){
679
+			assignee=list.get(0).getAssignee();
680
+		}
681
+		return assignee;
682
+	}
683
+	/**查询流程状态(判断流程正在执行,还是结束)*/
684
+	public ProcessInstance isProcessEnd(String processInstanceId){
685
+		ProcessInstance pi = runtimeService//表示正在执行的流程实例和执行对象
686
+						.createProcessInstanceQuery()//创建流程实例查询
687
+						.processInstanceId(processInstanceId)//使用流程实例ID查询
688
+						.singleResult();
689
+		return pi;
690
+	}
691
+	
692
+	/**查询流程状态(判断流程正在执行,还是结束)*/
693
+	public boolean isProcessEndNew(String processInstanceId){
694
+		ProcessInstance processEnd = this.isProcessEnd(processInstanceId);
695
+		if(processEnd!=null){
696
+			
697
+			return false;
698
+		}
699
+		return true;
700
+	}
701
+	
702
+	/**删除正在执行中的任务*/
703
+	public void delRunTask(String processInstanceId,String deleteReason){
704
+		runtimeService.deleteProcessInstance(processInstanceId, deleteReason);
705
+	}
706
+	
707
+	/**统计正在执行中的任务*/
708
+	public Map<String, Object> todoType(String userId){
709
+		//计划总条数
710
+		int countPlan = 0;
711
+		//合同总条数
712
+		int countContract = 0;
713
+		//合同变更总条数
714
+		Map<String, Object> modelMap = new HashMap<String, Object>();
715
+		TaskType taskType = null;
716
+		List<DeploymentList> todoList = todoList(userId, taskType);
717
+		for (DeploymentList deploymentList : todoList) {
718
+			String procDefId = deploymentList.getProcDefId();
719
+			String[] split = procDefId.split(":");
720
+			String string = split[0];
721
+			if(string.equals("plan")){
722
+				countPlan++;
723
+			}else if (string.equals("contract")) {
724
+				countContract++;
725
+			}
726
+		}
727
+		modelMap.put("plan", countPlan);
728
+		modelMap.put("contract", countContract);
729
+		return modelMap;
730
+	}
731
+	
732
+	// 获取到当前进行到的任务节点.
733
+	public String taskNode(String processInstanceId){
734
+        Task singleResult = taskService.createTaskQuery().processInstanceId(processInstanceId).singleResult();
735
+        JSONObject json=new JSONObject();
736
+        
737
+        if(singleResult!=null){
738
+        	String id = singleResult.getId();
739
+        	String name = singleResult.getName();
740
+        	json.put("taskId", id);
741
+        	json.put("taskName",name);
742
+        }
743
+		return json.toString();
744
+	} 
745
+}

+ 123 - 0
src/main/java/com/chinaitop/depot/act/service/ActTemplateService.java

@@ -0,0 +1,123 @@
1
+package com.chinaitop.depot.act.service;
2
+
3
+import java.io.InputStream;
4
+import java.io.InputStreamReader;
5
+import java.io.UnsupportedEncodingException;
6
+import java.util.List;
7
+import java.util.zip.ZipInputStream;
8
+
9
+import javax.servlet.http.HttpServletRequest;
10
+import javax.xml.stream.XMLInputFactory;
11
+import javax.xml.stream.XMLStreamException;
12
+import javax.xml.stream.XMLStreamReader;
13
+
14
+import org.activiti.bpmn.converter.BpmnXMLConverter;
15
+import org.activiti.bpmn.model.BpmnModel;
16
+import org.activiti.editor.constants.ModelDataJsonConstants;
17
+import org.activiti.editor.language.json.converter.BpmnJsonConverter;
18
+import org.activiti.engine.ActivitiException;
19
+import org.activiti.engine.RepositoryService;
20
+import org.activiti.engine.repository.Deployment;
21
+import org.activiti.engine.repository.ProcessDefinition;
22
+import org.apache.commons.io.FilenameUtils;
23
+import org.springframework.beans.factory.annotation.Autowired;
24
+import org.springframework.stereotype.Service;
25
+import org.springframework.transaction.annotation.Transactional;
26
+import org.springframework.web.multipart.MultipartFile;
27
+
28
+import com.chinaitop.depot.business.model.UserInfo;
29
+import com.fasterxml.jackson.databind.ObjectMapper;
30
+import com.fasterxml.jackson.databind.node.ObjectNode;
31
+@Service
32
+public class ActTemplateService {
33
+	@Autowired
34
+	private RepositoryService repositoryService;
35
+	/**
36
+	 * 部署流程 - 保存
37
+	 * @param file
38
+	 * @return
39
+	 */
40
+	@Transactional(readOnly = false)
41
+	public String deploy(MultipartFile file, HttpServletRequest request) {
42
+
43
+		String message = "";
44
+		
45
+		String fileName = file.getOriginalFilename();
46
+		
47
+		try {
48
+			InputStream fileInputStream = file.getInputStream();
49
+			Deployment deployment = null;
50
+			String extension = FilenameUtils.getExtension(fileName);
51
+			if (extension.equals("zip") || extension.equals("bar")) {
52
+				ZipInputStream zip = new ZipInputStream(fileInputStream);
53
+				deployment = repositoryService.createDeployment().addZipInputStream(zip).deploy();
54
+			} else if (extension.equals("png")) {
55
+				deployment = repositoryService.createDeployment().addInputStream(fileName, fileInputStream).deploy();
56
+			} else if (fileName.indexOf("bpmn20.xml") != -1) {
57
+				deployment = repositoryService.createDeployment().addInputStream(fileName, fileInputStream).deploy();
58
+			} else if (extension.equals("bpmn")) { // bpmn扩展名特殊处理,转换为bpmn20.xml
59
+				String baseName = FilenameUtils.getBaseName(fileName); 
60
+				deployment = repositoryService.createDeployment().addInputStream(baseName + ".bpmn20.xml", fileInputStream).deploy();
61
+			} else {
62
+				message = "不支持的文件类型:" + extension;
63
+			}
64
+			
65
+			List<ProcessDefinition> list = repositoryService.createProcessDefinitionQuery().deploymentId(deployment.getId()).list();
66
+			
67
+			Integer depotId =(Integer) request.getSession().getAttribute("depotId");
68
+			
69
+				// 设置流程分类
70
+			for (ProcessDefinition processDefinition : list) {
71
+	//				ActUtils.exportDiagramToFile(repositoryService, processDefinition, exportDir);
72
+				repositoryService.setProcessDefinitionCategory(processDefinition.getId(), depotId.toString());
73
+				message += "部署成功,流程ID=" + processDefinition.getId() + "<br/>";
74
+			}
75
+			if (list.size() == 0){
76
+				message = "部署失败,没有流程。";
77
+			}
78
+			
79
+		} catch (Exception e) {
80
+			throw new ActivitiException("部署失败!", e);
81
+		}
82
+		return message;
83
+	}
84
+	
85
+	/**
86
+	 * 将部署的流程转换为模型
87
+	 * @param procDefId
88
+	 * @throws UnsupportedEncodingException
89
+	 * @throws XMLStreamException
90
+	 */
91
+	@Transactional(readOnly = false)
92
+	public org.activiti.engine.repository.Model convertToModel(String procDefId) throws UnsupportedEncodingException, XMLStreamException {
93
+		
94
+		ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(procDefId).singleResult();
95
+		InputStream bpmnStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(),
96
+		processDefinition.getResourceName());
97
+		XMLInputFactory xif = XMLInputFactory.newInstance();
98
+		InputStreamReader in = new InputStreamReader(bpmnStream, "UTF-8");
99
+		XMLStreamReader xtr = xif.createXMLStreamReader(in);
100
+		BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr);
101
+	
102
+		BpmnJsonConverter converter = new BpmnJsonConverter();
103
+		ObjectNode modelNode = converter.convertToJson(bpmnModel);
104
+		org.activiti.engine.repository.Model modelData = repositoryService.newModel();
105
+		modelData.setKey(processDefinition.getKey());
106
+		modelData.setName(processDefinition.getResourceName());
107
+		modelData.setCategory(processDefinition.getCategory());//.getDeploymentId());
108
+		modelData.setDeploymentId(processDefinition.getDeploymentId());
109
+		modelData.setVersion(Integer.parseInt(String.valueOf(repositoryService.createModelQuery().modelKey(modelData.getKey()).count()+1)));
110
+	
111
+		ObjectNode modelObjectNode = new ObjectMapper().createObjectNode();
112
+		modelObjectNode.put(ModelDataJsonConstants.MODEL_NAME, processDefinition.getName());
113
+		modelObjectNode.put(ModelDataJsonConstants.MODEL_REVISION, modelData.getVersion());
114
+		modelObjectNode.put(ModelDataJsonConstants.MODEL_DESCRIPTION, processDefinition.getDescription());
115
+		modelData.setMetaInfo(modelObjectNode.toString());
116
+	
117
+		repositoryService.saveModel(modelData);
118
+	
119
+		repositoryService.addModelEditorSource(modelData.getId(), modelNode.toString().getBytes("utf-8"));
120
+	
121
+		return modelData;
122
+	}
123
+}

+ 28 - 0
src/main/java/com/chinaitop/depot/act/service/DeleteService.java

@@ -0,0 +1,28 @@
1
+package com.chinaitop.depot.act.service;
2
+
3
+import java.io.InputStream;
4
+
5
+import javax.annotation.Resource;
6
+
7
+import org.activiti.engine.RepositoryService;
8
+import org.springframework.stereotype.Service;
9
+@Service
10
+public class DeleteService {
11
+	@Resource
12
+	private RepositoryService repositoryService;
13
+	/**
14
+	 * 删除部署的流程,级联删除流程实例
15
+	 * @param deploymentId 流程部署ID
16
+	 */
17
+
18
+	public void deleteDeployment(String deploymentId) {
19
+		repositoryService.deleteDeployment(deploymentId, true);
20
+	}
21
+	
22
+	/**使用部署对象ID和资源图片名称,获取图片的输入流*/
23
+	public InputStream findImageInputStream(String deploymentId,
24
+			String imageName) {
25
+		return repositoryService.getResourceAsStream(deploymentId, imageName);
26
+	}
27
+
28
+}

+ 55 - 0
src/main/java/com/chinaitop/depot/act/service/cmd/JumpTaskCmd.java

@@ -0,0 +1,55 @@
1
+package com.chinaitop.depot.act.service.cmd;
2
+
3
+import java.util.Map;
4
+import org.activiti.engine.impl.context.Context;
5
+import org.activiti.engine.impl.interceptor.Command;
6
+import org.activiti.engine.impl.interceptor.CommandContext;
7
+import org.activiti.engine.impl.persistence.entity.ExecutionEntity;
8
+import org.activiti.engine.impl.persistence.entity.TaskEntity;
9
+import org.activiti.engine.impl.pvm.process.ActivityImpl;
10
+import org.activiti.engine.impl.pvm.runtime.AtomicOperation;
11
+
12
+public class JumpTaskCmd implements Command<java.lang.Void> {
13
+	
14
+	private TaskEntity taskEntity;
15
+	private ActivityImpl targetActivity;
16
+	protected Map<String, Object> variables;
17
+
18
+	public JumpTaskCmd(TaskEntity taskEntity, ActivityImpl targetActivity, Map<String, Object> variables) {
19
+		this.taskEntity = taskEntity;
20
+		this.targetActivity = targetActivity;
21
+		this.variables = variables;
22
+	}
23
+
24
+	@Override
25
+	public Void execute(CommandContext commandContext) {
26
+		
27
+		if (taskEntity != null) {
28
+			
29
+			//删除当前的任务,不能删除当前正在执行的任务,所以要先清除掉关联
30
+			if (variables != null) {
31
+				if (taskEntity.getExecutionId() != null) {
32
+					taskEntity.setExecutionVariables(variables);
33
+				} else {
34
+					taskEntity.setVariables(variables);
35
+				}
36
+			}
37
+
38
+//			// 完成活动历史
39
+//			Context.getCommandContext().getHistoryManager()
40
+//				.recordActivityEnd((ExecutionEntity) taskEntity.getExecution());
41
+			
42
+			// 完成待办任务
43
+			Context.getCommandContext().getTaskEntityManager().deleteTask(taskEntity, 
44
+					TaskEntity.DELETE_REASON_COMPLETED, false);	// DELETE_REASON_DELETED  DELETE_REASON_COMPLETED
45
+			
46
+			// 跳转任务
47
+			ExecutionEntity execution = taskEntity.getExecution();
48
+			execution.setActivity(targetActivity);
49
+			execution.performOperation(AtomicOperation.ACTIVITY_START);
50
+			
51
+		}
52
+
53
+		return null;
54
+	}
55
+}

+ 49 - 0
src/main/java/com/chinaitop/depot/act/service/creator/ChainedActivitiesCreator.java

@@ -0,0 +1,49 @@
1
+package com.chinaitop.depot.act.service.creator;
2
+
3
+import java.util.ArrayList;
4
+import java.util.List;
5
+
6
+import org.activiti.engine.ProcessEngine;
7
+import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity;
8
+import org.activiti.engine.impl.pvm.process.ActivityImpl;
9
+import org.springframework.util.CollectionUtils;
10
+
11
+import com.chinaitop.depot.utils.activiti.ProcessDefUtils;
12
+
13
+public class ChainedActivitiesCreator extends RuntimeActivityCreatorSupport implements RuntimeActivityCreator {
14
+	
15
+	@SuppressWarnings("unchecked")
16
+	public ActivityImpl[] createActivities(ProcessEngine processEngine, ProcessDefinitionEntity processDefinition,
17
+			RuntimeActivityDefinitionEntity info) {
18
+		info.setFactoryName(ChainedActivitiesCreator.class.getName());
19
+		RuntimeActivityDefinitionEntityIntepreter radei = new RuntimeActivityDefinitionEntityIntepreter(info);
20
+
21
+		if (radei.getCloneActivityIds() == null) {
22
+			radei.setCloneActivityIds(CollectionUtils.arrayToList(new String[radei.getAssignees().size()]));
23
+		}
24
+
25
+		return createActivities(processEngine, processDefinition, info.getProcessInstanceId(), radei.getPrototypeActivityId(),
26
+				radei.getNextActivityId(), radei.getAssignees(), radei.getCloneActivityIds());
27
+	}
28
+
29
+	private ActivityImpl[] createActivities(ProcessEngine processEngine, ProcessDefinitionEntity processDefinition, String processInstanceId,
30
+			String prototypeActivityId, String nextActivityId, List<String> assignees, List<String> activityIds) {
31
+		ActivityImpl prototypeActivity = ProcessDefUtils.getActivity(processEngine, processDefinition.getId(), prototypeActivityId);
32
+
33
+		List<ActivityImpl> activities = new ArrayList<ActivityImpl>();
34
+		for (int i = 0; i < assignees.size(); i++) {
35
+			if (activityIds.get(i) == null) {
36
+				String activityId = createUniqueActivityId(processInstanceId, prototypeActivityId);
37
+				activityIds.set(i, activityId);
38
+			}
39
+
40
+			ActivityImpl clone = createActivity(processEngine, processDefinition, prototypeActivity, activityIds.get(i), assignees.get(i));
41
+			activities.add(clone);
42
+		}
43
+
44
+		ActivityImpl nextActivity = ProcessDefUtils.getActivity(processEngine, processDefinition.getId(), nextActivityId);
45
+		createActivityChain(activities, nextActivity);
46
+
47
+		return activities.toArray(new ActivityImpl[0]);
48
+	}
49
+}

+ 45 - 0
src/main/java/com/chinaitop/depot/act/service/creator/CreateAndTakeTransitionCmd.java

@@ -0,0 +1,45 @@
1
+package com.chinaitop.depot.act.service.creator;
2
+
3
+import java.util.Map;
4
+
5
+import org.activiti.engine.impl.context.Context;
6
+import org.activiti.engine.impl.interceptor.Command;
7
+import org.activiti.engine.impl.interceptor.CommandContext;
8
+import org.activiti.engine.impl.persistence.entity.ExecutionEntity;
9
+import org.activiti.engine.impl.persistence.entity.TaskEntity;
10
+import org.activiti.engine.impl.pvm.process.ActivityImpl;
11
+import org.activiti.engine.impl.pvm.runtime.AtomicOperation;
12
+
13
+public class CreateAndTakeTransitionCmd implements Command<java.lang.Void> {
14
+	
15
+	private TaskEntity currentTaskEntity;
16
+	private ActivityImpl activity;
17
+	protected Map<String, Object> variables;
18
+
19
+	public CreateAndTakeTransitionCmd(TaskEntity currentTaskEntity, ActivityImpl activity, Map<String, Object> variables) {
20
+		this.currentTaskEntity = currentTaskEntity;
21
+		this.activity = activity;
22
+		this.variables = variables;
23
+	}
24
+
25
+	@Override
26
+	public Void execute(CommandContext commandContext) {
27
+		if (currentTaskEntity != null) {
28
+
29
+			ExecutionEntity execution = commandContext.getExecutionEntityManager().findExecutionById(currentTaskEntity.getExecutionId());
30
+			execution.setActivity(activity);
31
+			execution.performOperation(AtomicOperation.TRANSITION_CREATE_SCOPE);
32
+
33
+			if (variables != null) {
34
+				if (currentTaskEntity.getExecutionId() != null) {
35
+					currentTaskEntity.setExecutionVariables(variables);
36
+				} else {
37
+					currentTaskEntity.setVariables(variables);
38
+				}
39
+			}
40
+			//删除当前的任务,不能删除当前正在执行的任务,所以要先清除掉关联
41
+			Context.getCommandContext().getTaskEntityManager().deleteTask(currentTaskEntity, TaskEntity.DELETE_REASON_DELETED, false);
42
+		}
43
+		return null;
44
+	}
45
+}

+ 58 - 0
src/main/java/com/chinaitop/depot/act/service/creator/MultiInstanceActivityCreator.java

@@ -0,0 +1,58 @@
1
+package com.chinaitop.depot.act.service.creator;
2
+
3
+import java.util.List;
4
+
5
+import org.activiti.engine.ProcessEngine;
6
+import org.activiti.engine.impl.bpmn.behavior.MultiInstanceActivityBehavior;
7
+import org.activiti.engine.impl.bpmn.behavior.ParallelMultiInstanceBehavior;
8
+import org.activiti.engine.impl.bpmn.behavior.SequentialMultiInstanceBehavior;
9
+import org.activiti.engine.impl.bpmn.behavior.TaskActivityBehavior;
10
+import org.activiti.engine.impl.el.FixedValue;
11
+import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity;
12
+import org.activiti.engine.impl.pvm.PvmTransition;
13
+import org.activiti.engine.impl.pvm.process.ActivityImpl;
14
+
15
+import com.chinaitop.depot.utils.activiti.ProcessDefUtils;
16
+
17
+public class MultiInstanceActivityCreator extends RuntimeActivityCreatorSupport implements RuntimeActivityCreator {
18
+	
19
+	public ActivityImpl[] createActivities(ProcessEngine processEngine, ProcessDefinitionEntity processDefinition,
20
+			RuntimeActivityDefinitionEntity info) {
21
+		info.setFactoryName(MultiInstanceActivityCreator.class.getName());
22
+		RuntimeActivityDefinitionEntityIntepreter radei = new RuntimeActivityDefinitionEntityIntepreter(info);
23
+
24
+		if (radei.getCloneActivityId() == null) {
25
+			String cloneActivityId = createUniqueActivityId(info.getProcessInstanceId(), radei.getPrototypeActivityId());
26
+			radei.setCloneActivityId(cloneActivityId);
27
+		}
28
+
29
+		return new ActivityImpl[] { createMultiInstanceActivity(processEngine, processDefinition, info.getProcessInstanceId(),
30
+				radei.getPrototypeActivityId(), radei.getCloneActivityId(), radei.getSequential(), radei.getAssignees()) };
31
+	}
32
+
33
+	private ActivityImpl createMultiInstanceActivity(ProcessEngine processEngine, ProcessDefinitionEntity processDefinition,
34
+			String processInstanceId, String prototypeActivityId, String cloneActivityId, boolean isSequential, List<String> assignees) {
35
+		ActivityImpl prototypeActivity = ProcessDefUtils.getActivity(processEngine, processDefinition.getId(), prototypeActivityId);
36
+
37
+		//拷贝listener,executionListeners会激活历史记录的保存
38
+		ActivityImpl clone = cloneActivity(processDefinition, prototypeActivity, cloneActivityId, "executionListeners", "properties");
39
+		//拷贝所有后向链接
40
+		for (PvmTransition trans : prototypeActivity.getOutgoingTransitions()) {
41
+			clone.createOutgoingTransition(trans.getId()).setDestination((ActivityImpl) trans.getDestination());
42
+		}
43
+
44
+		MultiInstanceActivityBehavior multiInstanceBehavior = isSequential ? new SequentialMultiInstanceBehavior(clone,
45
+				(TaskActivityBehavior) prototypeActivity.getActivityBehavior()) : new ParallelMultiInstanceBehavior(clone,
46
+				(TaskActivityBehavior) prototypeActivity.getActivityBehavior());
47
+
48
+		clone.setActivityBehavior(multiInstanceBehavior);
49
+
50
+		clone.setScope(true);
51
+		clone.setProperty("multiInstance", isSequential ? "sequential" : "parallel");
52
+
53
+		//设置多实例节点属性
54
+		multiInstanceBehavior.setLoopCardinalityExpression(new FixedValue(assignees.size()));
55
+		multiInstanceBehavior.setCollectionExpression(new FixedValue(assignees));
56
+		return clone;
57
+	}
58
+}

+ 11 - 0
src/main/java/com/chinaitop/depot/act/service/creator/RuntimeActivityCreator.java

@@ -0,0 +1,11 @@
1
+package com.chinaitop.depot.act.service.creator;
2
+
3
+import org.activiti.engine.ProcessEngine;
4
+import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity;
5
+import org.activiti.engine.impl.pvm.process.ActivityImpl;
6
+
7
+public interface RuntimeActivityCreator
8
+{
9
+	public ActivityImpl[] createActivities(ProcessEngine processEngine, ProcessDefinitionEntity processDefinition,
10
+			RuntimeActivityDefinitionEntity info);
11
+}

+ 90 - 0
src/main/java/com/chinaitop/depot/act/service/creator/RuntimeActivityCreatorSupport.java

@@ -0,0 +1,90 @@
1
+package com.chinaitop.depot.act.service.creator;
2
+
3
+import java.lang.reflect.Field;
4
+import java.util.List;
5
+
6
+import org.activiti.engine.ProcessEngine;
7
+import org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior;
8
+import org.activiti.engine.impl.el.FixedValue;
9
+import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity;
10
+import org.activiti.engine.impl.pvm.process.ActivityImpl;
11
+import org.activiti.engine.impl.task.TaskDefinition;
12
+import org.apache.commons.lang3.reflect.FieldUtils;
13
+//import org.junit.Assert;
14
+import org.springframework.beans.BeanUtils;
15
+
16
+import com.chinaitop.depot.utils.activiti.ProcessDefUtils;
17
+
18
+
19
+public abstract class RuntimeActivityCreatorSupport {
20
+	private static int SEQUNCE_NUMBER = 0;
21
+
22
+	protected ActivityImpl cloneActivity(ProcessDefinitionEntity processDefinition, ActivityImpl prototypeActivity, String newActivityId,
23
+			String... fieldNames) {
24
+		ActivityImpl clone = processDefinition.createActivity(newActivityId);
25
+		copyFields(prototypeActivity, clone, fieldNames);
26
+
27
+		return clone;
28
+	}
29
+
30
+	protected TaskDefinition cloneTaskDefinition(TaskDefinition taskDefinition) {
31
+		TaskDefinition newTaskDefinition = new TaskDefinition(taskDefinition.getTaskFormHandler());
32
+		BeanUtils.copyProperties(taskDefinition, newTaskDefinition);
33
+		return newTaskDefinition;
34
+	}
35
+
36
+	protected ActivityImpl createActivity(ProcessEngine processEngine, ProcessDefinitionEntity processDefinition, ActivityImpl prototypeActivity,
37
+			String cloneActivityId, String assignee) {
38
+		ActivityImpl clone = cloneActivity(processDefinition, prototypeActivity, cloneActivityId, "executionListeners", "properties");
39
+
40
+		//设置assignee
41
+		UserTaskActivityBehavior activityBehavior = (UserTaskActivityBehavior) (prototypeActivity.getActivityBehavior());
42
+
43
+		TaskDefinition taskDefinition = cloneTaskDefinition(activityBehavior.getTaskDefinition());
44
+		taskDefinition.setKey(cloneActivityId);
45
+		if (assignee != null) {
46
+			taskDefinition.setAssigneeExpression(new FixedValue(assignee));
47
+		}
48
+
49
+		UserTaskActivityBehavior cloneActivityBehavior = new UserTaskActivityBehavior(null, taskDefinition);
50
+		clone.setActivityBehavior(cloneActivityBehavior);
51
+
52
+		return clone;
53
+	}
54
+
55
+	protected ActivityImpl createActivity(ProcessEngine processEngine, ProcessDefinitionEntity processDefinition, String prototypeActivityId,
56
+			String cloneActivityId, String assignee) {
57
+		ActivityImpl prototypeActivity = ProcessDefUtils.getActivity(processEngine, processDefinition.getId(), prototypeActivityId);
58
+
59
+		return createActivity(processEngine, processDefinition, prototypeActivity, cloneActivityId, assignee);
60
+	}
61
+
62
+	protected void createActivityChain(List<ActivityImpl> activities, ActivityImpl nextActivity) {
63
+		for (int i = 0; i < activities.size(); i++) {
64
+			//设置各活动的下线
65
+			activities.get(i).getOutgoingTransitions().clear();
66
+			activities.get(i).createOutgoingTransition("flow" + (i + 1))
67
+					.setDestination(i == activities.size() - 1 ? nextActivity : activities.get(i + 1));
68
+		}
69
+	}
70
+
71
+	protected String createUniqueActivityId(String processInstanceId, String prototypeActivityId) {
72
+		return processInstanceId + ":" + prototypeActivityId + ":" + System.currentTimeMillis() + "-" + (SEQUNCE_NUMBER++);
73
+	}
74
+
75
+	private static void copyFields(Object source, Object target, String... fieldNames) {
76
+//		Assert.assertNotNull(source);
77
+//		Assert.assertNotNull(target);
78
+//		Assert.assertSame(source.getClass(), target.getClass());
79
+
80
+		for (String fieldName : fieldNames) {
81
+			try {
82
+				Field field = FieldUtils.getField(source.getClass(), fieldName, true);
83
+				field.setAccessible(true);
84
+				field.set(target, field.get(source));
85
+			} catch (Exception e) {
86
+				e.printStackTrace();
87
+			}
88
+		}
89
+	}
90
+}

+ 65 - 0
src/main/java/com/chinaitop/depot/act/service/creator/RuntimeActivityDefinitionEntity.java

@@ -0,0 +1,65 @@
1
+package com.chinaitop.depot.act.service.creator;
2
+
3
+import java.io.IOException;
4
+
5
+import com.fasterxml.jackson.core.JsonProcessingException;
6
+
7
+public interface RuntimeActivityDefinitionEntity
8
+{
9
+	/**
10
+	 * 反序列化PropertiesText到Map
11
+	 */
12
+	void deserializeProperties() throws IOException;
13
+
14
+	/**
15
+	 * 获取工厂名
16
+	 */
17
+	String getFactoryName();
18
+
19
+	/**
20
+	 * 获取流程定义的ID
21
+	 */
22
+	String getProcessDefinitionId();
23
+
24
+	/**
25
+	 * 获取流程实例的ID
26
+	 */
27
+	String getProcessInstanceId();
28
+
29
+	/**
30
+	 * 获取PropertiesText,它是一个JSON字符串
31
+	 */
32
+	String getPropertiesText();
33
+
34
+	/**
35
+	 * 获取指定的属性值
36
+	 */
37
+	<T> T getProperty(String name);
38
+
39
+	/**
40
+	 * 序列化Map至PropertiesText
41
+	 */
42
+	void serializeProperties() throws JsonProcessingException;
43
+
44
+	/**
45
+	 * 设置工厂名
46
+	 */
47
+	void setFactoryName(String factoryName);
48
+
49
+	/**
50
+	 * 设置流程定义ID
51
+	 */
52
+	void setProcessDefinitionId(String processDefinitionId);
53
+
54
+	/**
55
+	 * 设置流程实例ID
56
+	 */
57
+	void setProcessInstanceId(String processInstanceId);
58
+
59
+	/**
60
+	 * 设置PropertiesText
61
+	 */
62
+	void setPropertiesText(String propertiesText);
63
+
64
+	<T> void setProperty(String name, T value);
65
+}

+ 81 - 0
src/main/java/com/chinaitop/depot/act/service/creator/RuntimeActivityDefinitionEntityIntepreter.java

@@ -0,0 +1,81 @@
1
+package com.chinaitop.depot.act.service.creator;
2
+
3
+import java.util.List;
4
+
5
+/**
6
+ * RuntimeActivityDefinitionEntity的解释类(代理类)
7
+ * 主要用以解释properties字段的值,如为get("name")提供getName()方法
8
+ * 
9
+ * @author xujh
10
+ * 
11
+ */
12
+public class RuntimeActivityDefinitionEntityIntepreter
13
+{
14
+	RuntimeActivityDefinitionEntity _entity;
15
+
16
+	public RuntimeActivityDefinitionEntityIntepreter(RuntimeActivityDefinitionEntity entity)
17
+	{
18
+		super();
19
+		_entity = entity;
20
+	}
21
+
22
+	public List<String> getAssignees()
23
+	{
24
+		return _entity.getProperty("assignees");
25
+	}
26
+
27
+	public String getCloneActivityId()
28
+	{
29
+		return _entity.getProperty("cloneActivityId");
30
+	}
31
+
32
+	public List<String> getCloneActivityIds()
33
+	{
34
+		return _entity.getProperty("cloneActivityIds");
35
+	}
36
+
37
+	public String getNextActivityId()
38
+	{
39
+		return _entity.getProperty("nextActivityId");
40
+	}
41
+
42
+	public String getPrototypeActivityId()
43
+	{
44
+		return _entity.getProperty("prototypeActivityId");
45
+	}
46
+
47
+	public boolean getSequential()
48
+	{
49
+		return (Boolean) _entity.getProperty("sequential");
50
+	}
51
+
52
+	public void setAssignees(List<String> assignees)
53
+	{
54
+		_entity.setProperty("assignees", assignees);
55
+	}
56
+
57
+	public void setCloneActivityId(String cloneActivityId)
58
+	{
59
+		_entity.setProperty("cloneActivityId", cloneActivityId);
60
+	}
61
+
62
+	public void setCloneActivityIds(List<String> cloneActivityIds)
63
+	{
64
+		_entity.setProperty("cloneActivityIds", cloneActivityIds);
65
+	}
66
+
67
+	public void setNextActivityId(String nextActivityId)
68
+	{
69
+		_entity.setProperty("nextActivityId", nextActivityId);
70
+	}
71
+
72
+	public void setPrototypeActivityId(String prototypeActivityId)
73
+	{
74
+		_entity.setProperty("prototypeActivityId", prototypeActivityId);
75
+	}
76
+
77
+	public void setSequential(boolean sequential)
78
+	{
79
+		_entity.setProperty("sequential", sequential);
80
+	}
81
+}

+ 88 - 0
src/main/java/com/chinaitop/depot/act/service/creator/SimpleRuntimeActivityDefinitionEntity.java

@@ -0,0 +1,88 @@
1
+package com.chinaitop.depot.act.service.creator;
2
+
3
+import java.io.IOException;
4
+import java.util.HashMap;
5
+import java.util.Map;
6
+
7
+import com.fasterxml.jackson.core.JsonProcessingException;
8
+import com.fasterxml.jackson.databind.ObjectMapper;
9
+
10
+public class SimpleRuntimeActivityDefinitionEntity implements RuntimeActivityDefinitionEntity {
11
+	String _factoryName;
12
+
13
+	String _processDefinitionId;
14
+
15
+	public Map<String, Object> getProperties() {
16
+		return _properties;
17
+	}
18
+
19
+	public void setProperties(Map<String, Object> properties) {
20
+		_properties = properties;
21
+	}
22
+
23
+	public void setFactoryName(String factoryName) {
24
+		_factoryName = factoryName;
25
+	}
26
+
27
+	public void setProcessDefinitionId(String processDefinitionId) {
28
+		_processDefinitionId = processDefinitionId;
29
+	}
30
+
31
+	public void setProcessInstanceId(String processInstanceId) {
32
+		_processInstanceId = processInstanceId;
33
+	}
34
+
35
+	public void setPropertiesText(String propertiesText) {
36
+		_propertiesText = propertiesText;
37
+	}
38
+
39
+	String _processInstanceId;
40
+
41
+	Map<String, Object> _properties = new HashMap<String, Object>();
42
+
43
+	String _propertiesText;
44
+
45
+	@SuppressWarnings("unchecked")
46
+	@Override
47
+	public void deserializeProperties() throws IOException {
48
+		ObjectMapper objectMapper = new ObjectMapper();
49
+		_properties = objectMapper.readValue(_propertiesText, Map.class);
50
+	}
51
+
52
+	@Override
53
+	public String getFactoryName() {
54
+		return _factoryName;
55
+	}
56
+
57
+	@Override
58
+	public String getProcessDefinitionId() {
59
+		return _processDefinitionId;
60
+	}
61
+
62
+	@Override
63
+	public String getProcessInstanceId() {
64
+		return _processInstanceId;
65
+	}
66
+
67
+	@Override
68
+	public String getPropertiesText() {
69
+		return _propertiesText;
70
+	}
71
+
72
+	@SuppressWarnings("unchecked")
73
+	@Override
74
+	public <T> T getProperty(String name) {
75
+		return (T) _properties.get(name);
76
+	}
77
+
78
+	@Override
79
+	public void serializeProperties() throws JsonProcessingException {
80
+		ObjectMapper objectMapper = new ObjectMapper();
81
+		_propertiesText = objectMapper.writeValueAsString(_properties);
82
+	}
83
+
84
+	@Override
85
+	public <T> void setProperty(String name, T value) {
86
+		_properties.put(name, value);
87
+	}
88
+}

+ 64 - 0
src/main/java/com/chinaitop/depot/agile/mapper/BusinessSceduleMapper.java

@@ -0,0 +1,64 @@
1
+package com.chinaitop.depot.agile.mapper;
2
+
3
+import java.util.List;
4
+import java.util.Map;
5
+
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+import com.chinaitop.depot.agile.model.BusinessScedule;
9
+
10
+
11
+
12
+/**
13
+ * 粮库业务管理与出入库系统关联mapper.
14
+* <p>Title: BusinessSceduleMapper</p>
15
+* <p>Description: </p>
16
+* @author yaoyabin
17
+* @date 2017年11月20日 上午10:58:55
18
+ */
19
+public interface BusinessSceduleMapper {
20
+
21
+    /**
22
+     * 通过多个计划id,获取这多个计划的出入库类型,出库总数量,入库总数量.
23
+     * @param planIds
24
+     * @return
25
+     */
26
+    List<BusinessScedule> getPlanSceduleInPlanId(@Param("planIds")String planIds);
27
+    
28
+    /**
29
+     * 通过多个合同id,获取这多个合同的出入库类型,出库总数量,入库总数量.
30
+     * @param planIds
31
+     * @return
32
+     */
33
+    List<BusinessScedule> getContractSceduleInContractId(@Param("contractIds")String contractIds);
34
+    
35
+    /**
36
+     * 通过多个通知单id,获取这多个通知单的出入库类型,出库总数量,入库总数量.
37
+     * @param planIds
38
+     * @return
39
+     */
40
+    List<BusinessScedule> getNoticeSceduleInNoticeId(@Param("noticeIds")String noticeIds);
41
+
42
+    /**
43
+     * 根据粮库业务管理中出入库通知单id,修改出入库系统中,通知单状态. 
44
+     * 修改出入库表  data_crkyw_tzdxx_default中tzdh等于 这边的 通知单id获取到DataID 
45
+     * 通过DataID 链接 fl_bill_relation 修改字段FLOWSTATUS
46
+     * @param paramMap 通知单id. 通知单状态.
47
+     */
48
+    void updateNoticeStatus(Map<String, Object> paramMap);
49
+
50
+    /**
51
+     * 通过多个到站中转合同id,获取这多个合同的出入库类型,出库总数量,
52
+     * @param noticeIds
53
+     * @return
54
+     */
55
+	List<BusinessScedule> getDzContractSceduleInContractId(@Param("contractIds")String contractIds);
56
+
57
+	/**
58
+     * 通过多个发运中转合同id,获取这多个合同的出入库类型,出库总数量,
59
+     * @param noticeIds
60
+     * @return
61
+     */
62
+	List<BusinessScedule> getFyContractSceduleInContractId(@Param("contractIds")String contractIds);
63
+    
64
+}

+ 81 - 0
src/main/java/com/chinaitop/depot/agile/mapper/BusinessSceduleMapper.xml

@@ -0,0 +1,81 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.chinaitop.depot.agile.mapper.BusinessSceduleMapper" >
4
+  <select id="getPlanSceduleInPlanId" parameterType="java.lang.String" resultType="com.chinaitop.depot.agile.model.BusinessScedule">
5
+	SELECT
6
+		a.jhdID jhId, x.cazylx crkLx, sum(f.srsl) sumRksl, sum(f.zcsl) sumCksl
7
+	FROM
8
+		lsreport_ts.data_kcgl_xckc_default x,
9
+        lsreport_ts.data_crkyw_tzdxx_default a,
10
+		lsreport_ts.data_kcgl_fcbgz_default f
11
+	WHERE
12
+		x.DataID = f.stockdataid  
13
+		and x.tzdh = a.tzdbh  
14
+		and a.jhdID IN ${planIds} GROUP BY a.jhdID, x.cazylx;
15
+  </select>
16
+  
17
+  <select id="getContractSceduleInContractId" parameterType="java.lang.String" resultType="com.chinaitop.depot.agile.model.BusinessScedule">
18
+  	SELECT
19
+		b.htID htId, x.cazylx crkLx, sum(f.srsl) sumRksl, sum(f.zcsl) sumCksl
20
+	FROM
21
+		lsreport_ts.data_kcgl_xckc_default x,
22
+        lsreport_ts.data_crkyw_tzdxx_default b,
23
+		lsreport_ts.data_kcgl_fcbgz_default f
24
+	WHERE
25
+		x.DataID = f.stockdataid
26
+        and x.tzdh = b.tzdbh
27
+		and b.htID IN ${contractIds} GROUP BY b.htID, x.cazylx;
28
+  </select>
29
+  
30
+  <select id="getNoticeSceduleInNoticeId" parameterType="java.lang.String" resultType="com.chinaitop.depot.agile.model.BusinessScedule">
31
+  	SELECT
32
+		b.tzdID tzdId, x.cazylx crkLx, sum(f.srsl) sumRksl, sum(f.zcsl) sumCksl
33
+	FROM
34
+		lsreport_ts.data_kcgl_xckc_default x,
35
+        lsreport_ts.data_crkyw_tzdxx_default b,
36
+		lsreport_ts.data_kcgl_fcbgz_default f
37
+	WHERE
38
+		x.DataID = f.stockdataid
39
+		and x.tzdh = b.tzdbh
40
+		and b.tzdID IN ${noticeIds} GROUP BY b.tzdID, x.cazylx;
41
+  </select>
42
+  
43
+  <update id="updateNoticeStatus" parameterType="java.util.Map">
44
+  	UPDATE 
45
+  		lsreport_ts.fl_bill_relation 
46
+  	SET 
47
+  		FLOWSTATUS = ${FLOWSTATUS}
48
+	WHERE 
49
+		DATAID IN (SELECT DataID FROM lsreport_ts.data_crkyw_tzdxx_default WHERE tzdID = ${tzdh})
50
+		<!-- 不能修改已经执行完毕的通知单的状态  -->
51
+		and FLOWSTATUS != 2
52
+  </update>
53
+  
54
+  <select id="getDzContractSceduleInContractId" parameterType="java.lang.String" resultType="com.chinaitop.depot.agile.model.BusinessScedule">
55
+  	SELECT
56
+	     SUM(b.klhjz) sumCksl,d.htbh,bc.id htId
57
+    FROM
58
+	     lsreport_ts.data_crkyw_ckrmdj_default a
59
+		inner JOIN lsreport_ts.data_crkyw_ckcmz_default b ON a.BizNo = b.BizNo
60
+		inner JOIN lsreport_ts.data_crkyw_dzzzthd_default c ON a.thdh = c.thdh
61
+		left JOIN lsreport_ts.data_crkyw_hcrzdj_default d ON c.rzdh = d.rzdh
62
+		left join depot.business_contract bc on d.htbh = bc.contract_number
63
+	WHERE
64
+	    a.thdh IS NOT NULL 
65
+	    and bc.id in ${contractIds} GROUP BY d.htbh
66
+	
67
+  </select>
68
+  
69
+  <select id="getFyContractSceduleInContractId" parameterType="java.lang.String" resultType="com.chinaitop.depot.agile.model.BusinessScedule">
70
+  	SELECT
71
+	    SUM(b.xzklhjz) sumCksl,d.htID htId
72
+    FROM
73
+	      lsreport_ts.DATA_CRKYW_FYZZQCDZRMDJ_DEFAULT a
74
+		LEFT JOIN lsreport_ts.DATA_CRKYW_CPZ_DEFAULT b ON a.BizNo = b.BizNo
75
+		LEFT JOIN lsreport_ts.data_crkyw_tzdxx_default d ON a.tzdbh = d.tzdbh
76
+		LEFT JOIN lsreport_ts.data_crkyw_hcckrzdj_default c ON d.htbh = c.htbh
77
+    WHERE
78
+	c.cczyfl = '4028818465320af10165322e04ec0c51'
79
+    AND d.htID IN ${contractIds} GROUP BY c.htbh
80
+  </select>
81
+</mapper>

+ 102 - 0
src/main/java/com/chinaitop/depot/agile/model/BusinessScedule.java

@@ -0,0 +1,102 @@
1
+/**
2
+ * 
3
+ */
4
+package com.chinaitop.depot.agile.model;
5
+
6
+/**
7
+ * 粮食业务管理,进度查询.
8
+ * <p>Title: BusinessScedule</p>
9
+ * <p>Description: </p>
10
+ * @author yaoyabin
11
+ * @date 2017年11月1日 下午8:04:31
12
+ */
13
+
14
+public class BusinessScedule {
15
+    // 可研报告号 对应 粮食业务管理中的计划id
16
+    private String jhId;
17
+    // 合同编号 对应 粮食业务管理中的合同id.
18
+    private String htId;
19
+    // 通知单号 对应 粮食业务管理中的通知单id.
20
+    private String tzdId;
21
+    // 仓廒作业类型   1:入库 3:出库
22
+    private String crkLx;
23
+    
24
+    // 入库数量.
25
+    private String sumRksl;
26
+    // 出库数量.
27
+    private String sumCksl;
28
+    /**
29
+     * @return the jhId
30
+     */
31
+    public String getJhId() {
32
+        return jhId;
33
+    }
34
+    /**
35
+     * @param jhId the jhId to set
36
+     */
37
+    public void setJhId(String jhId) {
38
+        this.jhId = jhId;
39
+    }
40
+    /**
41
+     * @return the htId
42
+     */
43
+    public String getHtId() {
44
+        return htId;
45
+    }
46
+    /**
47
+     * @param htId the htId to set
48
+     */
49
+    public void setHtId(String htId) {
50
+        this.htId = htId;
51
+    }
52
+    /**
53
+     * @return the tzdId
54
+     */
55
+    public String getTzdId() {
56
+        return tzdId;
57
+    }
58
+    /**
59
+     * @param tzdId the tzdId to set
60
+     */
61
+    public void setTzdId(String tzdId) {
62
+        this.tzdId = tzdId;
63
+    }
64
+    /**
65
+     * @return the sumRksl
66
+     */
67
+    public String getSumRksl() {
68
+        return sumRksl;
69
+    }
70
+    /**
71
+     * @param sumRksl the sumRksl to set
72
+     */
73
+    public void setSumRksl(String sumRksl) {
74
+        this.sumRksl = sumRksl;
75
+    }
76
+    /**
77
+     * @return the sumCksl
78
+     */
79
+    public String getSumCksl() {
80
+        return sumCksl;
81
+    }
82
+    /**
83
+     * @param sumCksl the sumCksl to set
84
+     */
85
+    public void setSumCksl(String sumCksl) {
86
+        this.sumCksl = sumCksl;
87
+    }
88
+    /**
89
+     * @return the crkLx
90
+     */
91
+    public String getCrkLx() {
92
+        return crkLx;
93
+    }
94
+    /**
95
+     * @param crkLx the crkLx to set
96
+     */
97
+    public void setCrkLx(String crkLx) {
98
+        this.crkLx = crkLx;
99
+    }
100
+    
101
+    
102
+}

+ 54 - 0
src/main/java/com/chinaitop/depot/agile/service/BusinessSceduleService.java

@@ -0,0 +1,54 @@
1
+package com.chinaitop.depot.agile.service;
2
+
3
+import java.util.List;
4
+import java.util.Map;
5
+
6
+import com.chinaitop.depot.agile.model.BusinessScedule;
7
+
8
+
9
+public interface BusinessSceduleService {
10
+
11
+    /**
12
+     * 通过多个计划id,获取这多个计划的出入库类型,出库总数量,入库总数量.
13
+     * @param planIds
14
+     * @return
15
+     */
16
+    List<BusinessScedule> getPlanSceduleInPlanId(String planIds);
17
+    
18
+    /**
19
+     * 通过多个合同id,获取这多个合同的出入库类型,出库总数量,入库总数量.
20
+     * @param planIds
21
+     * @return
22
+     */
23
+    List<BusinessScedule> getContractSceduleInContractId(String contractIds);
24
+    
25
+    /**
26
+     * 通过多个通知单id,获取这多个通知单的出入库类型,出库总数量,入库总数量.
27
+     * @param planIds
28
+     * @return
29
+     */
30
+    List<BusinessScedule> getNoticeSceduleInNoticeId(String noticeIds);
31
+
32
+    /**
33
+     * 根据粮库业务管理中出入库通知单id,修改出入库系统中,通知单状态. 
34
+     * 修改出入库表  data_crkyw_tzdxx_default中tzdh等于 这边的 通知单id获取到DataID 
35
+     * 通过DataID 链接 fl_bill_relation 修改字段FLOWSTATUS
36
+     * @param paramMap 通知单id. 通知单状态.
37
+     */
38
+    void updateNoticeStatus(Map<String, Object> paramMap);
39
+    
40
+    /**
41
+     * 通过多个到站中转合同id,获取这多个合同的出入库类型,出库总数量,
42
+     * @param noticeIds
43
+     * @return
44
+     */
45
+	List<BusinessScedule> getDzContractSceduleInContractId(String contractIds);
46
+
47
+	/**
48
+     * 通过多个发运中转合同id,获取这多个合同的出入库类型,出库总数量,
49
+     * @param noticeIds
50
+     * @return
51
+     */
52
+	List<BusinessScedule> getFyContractSceduleInContractId(String contractIds);
53
+
54
+}

+ 62 - 0
src/main/java/com/chinaitop/depot/agile/service/impl/BusinessSceduleServiceImpl.java

@@ -0,0 +1,62 @@
1
+/**
2
+ * 
3
+ */
4
+package com.chinaitop.depot.agile.service.impl;
5
+
6
+import java.util.List;
7
+import java.util.Map;
8
+
9
+import org.springframework.beans.factory.annotation.Autowired;
10
+import org.springframework.stereotype.Service;
11
+
12
+import com.chinaitop.depot.agile.mapper.BusinessSceduleMapper;
13
+import com.chinaitop.depot.agile.model.BusinessScedule;
14
+import com.chinaitop.depot.agile.service.BusinessSceduleService;
15
+
16
+
17
+/**
18
+ * <p>Title: BusinessSceduleServiceImpl</p>
19
+ * <p>Description: </p>
20
+ * @author yaoyabin
21
+ * @date 2018年3月1日 下午4:52:53
22
+ */
23
+@Service
24
+public class BusinessSceduleServiceImpl implements BusinessSceduleService{
25
+
26
+    @Autowired
27
+    private BusinessSceduleMapper businessSceduleMapper;
28
+    
29
+    @Override
30
+    public List<BusinessScedule> getPlanSceduleInPlanId(String planIds) {
31
+        return businessSceduleMapper.getPlanSceduleInPlanId(planIds);
32
+    }
33
+
34
+    @Override
35
+    public List<BusinessScedule> getContractSceduleInContractId(
36
+            String contractIds) {
37
+        return businessSceduleMapper.getContractSceduleInContractId(contractIds);
38
+    }
39
+
40
+    @Override
41
+    public List<BusinessScedule> getNoticeSceduleInNoticeId(String noticeIds) {
42
+        return businessSceduleMapper.getNoticeSceduleInNoticeId(noticeIds);
43
+    }
44
+
45
+    @Override
46
+    public void updateNoticeStatus(Map<String, Object> paramMap) {
47
+        businessSceduleMapper.updateNoticeStatus(paramMap);
48
+    }
49
+
50
+	@Override
51
+	public List<BusinessScedule> getDzContractSceduleInContractId(String contractIds) {
52
+		// TODO Auto-generated method stub
53
+		return businessSceduleMapper.getDzContractSceduleInContractId(contractIds);
54
+	}
55
+
56
+	@Override
57
+	public List<BusinessScedule> getFyContractSceduleInContractId(String contractIds) {
58
+		// TODO Auto-generated method stub
59
+		return businessSceduleMapper.getFyContractSceduleInContractId(contractIds);
60
+	}
61
+
62
+}

+ 183 - 0
src/main/java/com/chinaitop/depot/business/controller/ApprovalController.java

@@ -0,0 +1,183 @@
1
+package com.chinaitop.depot.business.controller;
2
+
3
+import com.chinaitop.depot.business.model.BusinessApproval;
4
+import com.chinaitop.depot.business.model.BusinessApprovalExample;
5
+import com.chinaitop.depot.business.model.BusinessApprovalExample.Criteria;
6
+import com.chinaitop.depot.business.service.BusinessApprovalService;
7
+import com.fasterxml.jackson.databind.ObjectMapper;
8
+import com.github.pagehelper.PageHelper;
9
+import com.github.pagehelper.PageInfo;
10
+import io.swagger.annotations.Api;
11
+import io.swagger.annotations.ApiImplicitParam;
12
+import io.swagger.annotations.ApiImplicitParams;
13
+import io.swagger.annotations.ApiOperation;
14
+import org.springframework.http.MediaType;
15
+import org.springframework.web.bind.annotation.RequestMapping;
16
+import org.springframework.web.bind.annotation.RequestMethod;
17
+import org.springframework.web.bind.annotation.RestController;
18
+
19
+import javax.annotation.Resource;
20
+import javax.servlet.http.HttpServletRequest;
21
+import java.io.IOException;
22
+import java.util.HashMap;
23
+import java.util.List;
24
+import java.util.Map;
25
+
26
+@RestController
27
+@RequestMapping(value="/depot/business/select")
28
+@Api(value= "ApprovalController", description = "审批管理")
29
+
30
+public class ApprovalController {
31
+	@Resource
32
+	private BusinessApprovalService businessApprovalService;
33
+
34
+	@RequestMapping(value="/getList",produces = MediaType.APPLICATION_JSON_VALUE,  method=RequestMethod.GET)
35
+	@ApiOperation(value="获取审批列表", notes = "查询数据列表,支持分页")
36
+	@ApiImplicitParams({
37
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
38
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
39
+		@ApiImplicitParam(name = "userId", value = "当前登录人id", paramType = "query"),
40
+		@ApiImplicitParam(name = "projectId", value = "业务单据id", paramType = "query"),
41
+		@ApiImplicitParam(name = "orderByClause", value = "排序方式", paramType = "query")
42
+	})
43
+    public PageInfo<BusinessApproval> getList(Integer pageNum,Integer pageSize,String type, BusinessApproval businessApproval,Integer userId ,Integer projectId, String taskType, String orderByClause) {
44
+		Map<String, Object> map = new HashMap<String, Object>();
45
+    	map.put("type", type);
46
+    	map.put("userId", userId);
47
+    	if (null != taskType && !"".equals(taskType)) {
48
+    		map.put("taskType", taskType);
49
+    	}
50
+    	if (businessApproval.getProjectName()!=null && !"".equals(businessApproval.getProjectName())) {
51
+    		map.put("projectName", businessApproval.getProjectName());
52
+    	}
53
+    	if (businessApproval.getApplyName()!=null && !"".equals(businessApproval.getApplyName())){
54
+    		map.put("applyName", businessApproval.getApplyName());
55
+    	}
56
+    	if(businessApproval.getTaskId()!=null && !"".equals(businessApproval.getTaskId())){
57
+    		map.put("taskId", businessApproval.getTaskId());
58
+    	}
59
+    	if (projectId != null){
60
+    		map.put("projectId", projectId);
61
+    	}
62
+    	
63
+    	if (null != pageNum && null != pageSize) {
64
+    		PageHelper.startPage(pageNum, pageSize);
65
+    	}
66
+    	 List<BusinessApproval> queryByExample = businessApprovalService.queryByMap(map);
67
+        PageInfo<BusinessApproval> pageInfo = new PageInfo<BusinessApproval>(queryByExample);
68
+        return pageInfo;
69
+    }
70
+
71
+	@RequestMapping(value="/getListSize", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
72
+	@ApiOperation(value="获取审批列表总数,为首页提供", notes = "获取审批列表总数")
73
+	@ApiImplicitParams({
74
+		@ApiImplicitParam(name = "userId", value = "当前登录人id", paramType = "query")
75
+	})
76
+    public int getListSize(String type, BusinessApproval businessApproval,Integer userId ,HttpServletRequest request) {
77
+		Map<String, Object> map = new HashMap<String, Object>();
78
+    	map.put("userId", userId);
79
+    	map.put("type", "todo"); //待办
80
+    	List<BusinessApproval> queryByExample = businessApprovalService.queryByMap(map);
81
+        //待办理共有多少条数据
82
+        int size = queryByExample.size();
83
+        return size;
84
+
85
+    }
86
+
87
+	@RequestMapping(value="/update", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
88
+    @ApiOperation(value="更新流程轨迹表数据", notes = "更新流程轨迹表数据")
89
+	@ApiImplicitParams({
90
+		@ApiImplicitParam(name = "businessApproval", value = "数据字符串", paramType = "form"),
91
+		@ApiImplicitParam(name = "approvalStatus", value = "审批状态", paramType = "form")
92
+	})
93
+    public Map<String, Object> update(String businessApproval, Integer approvalStatus) {
94
+    	Map<String, Object> map = new HashMap<String, Object>();
95
+
96
+    	ObjectMapper mapper = new ObjectMapper();
97
+    	BusinessApproval Approval = null;
98
+    	try {
99
+			Approval = mapper.readValue(businessApproval, BusinessApproval.class);
100
+
101
+			//先将前面的审批数据的result刷成已审批
102
+    		BusinessApprovalExample businessApprovalExample=new BusinessApprovalExample();
103
+        	Criteria criteria = businessApprovalExample.createCriteria();
104
+        	
105
+        	if(Approval.getProjectId()!=null){
106
+        		criteria.andProjectIdEqualTo(Approval.getProjectId());
107
+        	}
108
+        	if(Approval.getTaskType()!=null){
109
+        		criteria.andTaskTypeEqualTo(Approval.getTaskType());
110
+        	}
111
+        	if(Approval.getTaskId()!=null){
112
+        		criteria.andTaskIdEqualTo(Approval.getTaskId());
113
+        	}
114
+        	if(Approval.getTaskType()!=null){
115
+        		criteria.andTaskTypeEqualTo(Approval.getTaskType());
116
+        	}
117
+        	businessApprovalExample.setOrderByClause(" id  asc ");
118
+
119
+        	List<BusinessApproval> list = businessApprovalService.queryByExample(businessApprovalExample);
120
+        	if (null != list && list.size() > 0) {
121
+        		for (BusinessApproval obj_list : list) {
122
+        			BusinessApproval approval_obj = obj_list;
123
+        			approval_obj.setResult("已审批");
124
+            		businessApprovalService.updateByPrimaryKeySelective(approval_obj);
125
+        		}
126
+        	}
127
+
128
+        	/* 把新的轨迹数据插入 */
129
+			businessApprovalService.add(Approval);
130
+
131
+			if (4 == approvalStatus || approvalStatus == 0 || approvalStatus == 6) {
132
+				//将当前单号的所有轨迹数据刷为审批结束
133
+				list = businessApprovalService.queryByExample(businessApprovalExample);
134
+				if (null != list && list.size() > 0) {
135
+	        		for (BusinessApproval obj_list : list) {
136
+	        			BusinessApproval approval_obj = obj_list;
137
+	        			if (4 == approvalStatus || approvalStatus == 6) {
138
+	        				approval_obj.setResult("审批结束");
139
+	        			} else if (approvalStatus == 0) {
140
+	        				approval_obj.setResult("已审批");
141
+	        			}
142
+	            		businessApprovalService.updateByPrimaryKeySelective(approval_obj);
143
+	        		}
144
+	        	}
145
+			}
146
+	    	map.put("status", "success");
147
+		} catch (IOException e) {
148
+			System.err.println("》》》提交流程异常》》》提交流程异常》》》》提交流程异常》》》提交流程异常》》》》》提交流程异常》》》》》提交流程异常》》》》提交流程异常》》》》提交流程异常");
149
+			e.printStackTrace();
150
+		}
151
+
152
+        return map;
153
+    }
154
+
155
+	@RequestMapping(value="/removeList", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
156
+    @ApiOperation(value="删除流程轨迹表数据", notes = "更新流程轨迹表数据")
157
+	@ApiImplicitParams({
158
+		@ApiImplicitParam(name = "projectId", value = "业务数据ID", paramType = "form"),
159
+		@ApiImplicitParam(name = "taskType", value = "任务类型", paramType = "form")
160
+	})
161
+    public Map<String, Object> removeList(Integer projectId, String taskType) {
162
+    	Map<String, Object> map = new HashMap<String, Object>();
163
+
164
+    	try {
165
+    		BusinessApprovalExample businessApprovalExample=new BusinessApprovalExample();
166
+        	Criteria criteria = businessApprovalExample.createCriteria();
167
+        	criteria.andProjectIdEqualTo(projectId);
168
+        	if ("1".equals(taskType)) {
169
+        		criteria.andTaskTypeEqualTo("fumigationProgram");
170
+        	} else if ("2".equals(taskType)) {
171
+        		criteria.andTaskTypeEqualTo("storageAeration");
172
+        	}
173
+
174
+        	businessApprovalService.removeList(businessApprovalExample);
175
+	    	map.put("status", "success");
176
+		} catch (Exception e) {
177
+			e.printStackTrace();
178
+		}
179
+
180
+        return map;
181
+    }
182
+
183
+}

+ 850 - 0
src/main/java/com/chinaitop/depot/business/controller/BusinessContractController.java

@@ -0,0 +1,850 @@
1
+package com.chinaitop.depot.business.controller;
2
+
3
+
4
+import java.io.IOException;
5
+import java.text.SimpleDateFormat;
6
+import java.util.HashMap;
7
+import java.util.List;
8
+import java.util.Map;
9
+
10
+import javax.annotation.Resource;
11
+import javax.servlet.http.HttpServletRequest;
12
+
13
+import org.apache.commons.lang.ObjectUtils;
14
+import org.apache.commons.lang3.StringUtils;
15
+import org.springframework.beans.factory.annotation.Autowired;
16
+import org.springframework.http.MediaType;
17
+import org.springframework.web.bind.annotation.RequestMapping;
18
+import org.springframework.web.bind.annotation.RequestMethod;
19
+import org.springframework.web.bind.annotation.RestController;
20
+
21
+import com.chinaitop.depot.act.service.ActTaskService;
22
+import com.chinaitop.depot.business.model.BusinessContract;
23
+import com.chinaitop.depot.business.model.BusinessContractExample;
24
+import com.chinaitop.depot.business.model.BusinessContractExample.Criteria;
25
+import com.chinaitop.depot.business.model.BusinessFile;
26
+import com.chinaitop.depot.business.model.BusinessStoreWareDetail;
27
+import com.chinaitop.depot.business.model.enums.AuditType;
28
+import com.chinaitop.depot.business.model.enums.StoreWareType;
29
+import com.chinaitop.depot.business.model.vo.BusinessContractAuditVO;
30
+import com.chinaitop.depot.business.service.BusinessContractService;
31
+import com.chinaitop.depot.business.service.BusinessDeliveryStorageNoticeService;
32
+import com.chinaitop.depot.business.service.BusinessFileService;
33
+import com.chinaitop.depot.business.service.BusinessStoreWareDetailService;
34
+import com.fasterxml.jackson.core.JsonParseException;
35
+import com.fasterxml.jackson.core.type.TypeReference;
36
+import com.fasterxml.jackson.databind.JsonMappingException;
37
+import com.fasterxml.jackson.databind.ObjectMapper;
38
+import com.github.pagehelper.PageHelper;
39
+import com.github.pagehelper.PageInfo;
40
+
41
+import io.swagger.annotations.Api;
42
+import io.swagger.annotations.ApiImplicitParam;
43
+import io.swagger.annotations.ApiImplicitParams;
44
+import io.swagger.annotations.ApiOperation;
45
+
46
+/**
47
+ * 粮库业务管理-合同管理
48
+* <p>Title: BusinessContractController</p>
49
+* <p>Description: </p>
50
+* @author yaoyabin
51
+* @date 2017年10月25日 下午5:28:02
52
+ */
53
+@RestController
54
+@RequestMapping(value="/depot/business/contract")
55
+@Api(value= "BusinessContractController", description = "合同管理")
56
+
57
+public class BusinessContractController {
58
+    
59
+    @Resource
60
+    private BusinessContractService contractService;
61
+    @Resource
62
+    private BusinessStoreWareDetailService businessStoreWareDetailService;
63
+    @Resource
64
+    private ActTaskService actTaskService;
65
+    @Autowired
66
+    private BusinessFileService businessFileService;
67
+    @Autowired
68
+    private BusinessDeliveryStorageNoticeService businessNoticeService;
69
+    
70
+    /**
71
+     * 合同申请列表.
72
+     * @param pageNum 页码
73
+     * @param pageSize 每页显示条数
74
+     * @return
75
+     * @throws Exception 
76
+     */
77
+    @RequestMapping(value="/getList",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
78
+	@ApiOperation(value="合同申请列表", notes = "查询数据列表,支持分页")
79
+	@ApiImplicitParams({
80
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
81
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
82
+		@ApiImplicitParam(name = "userId", value = "当前登录人id", paramType = "query")
83
+	})
84
+    public PageInfo<BusinessContract> getList(Integer pageNum, Integer pageSize,HttpServletRequest request, BusinessContract contract ,Integer userId) throws Exception {
85
+    	/*UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
86
+		if (userInfo==null) {
87
+			throw new Exception("请您先登录"); 
88
+		}
89
+		Integer userId = userInfo.getUserId();*/
90
+       
91
+        List<BusinessContract> list = contractService.queryByExample(pageNum, pageSize, userId, contract, "FIELD(audit_state,0,3,1,2,4 ), id desc", "");
92
+        PageInfo<BusinessContract> pageInfo = new PageInfo<BusinessContract>(list);
93
+        return pageInfo;
94
+    }
95
+
96
+    /**
97
+     * 审批通过列表.
98
+     * @param pageNum 页码
99
+     * @param pageSize 每页显示条数
100
+     * @param contract 合同体
101
+     * @param request
102
+     * @return
103
+     */
104
+    @RequestMapping(value="/getAuditPassList",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
105
+	@ApiOperation(value="合同审批通过列表", notes = "查询数据列表,支持分页")
106
+	@ApiImplicitParams({
107
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
108
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query")
109
+	})
110
+    public PageInfo<BusinessContract> getAuditPassList(Integer pageNum, Integer pageSize, BusinessContract contract,
111
+            Integer billType, HttpServletRequest request) {
112
+        List<BusinessContract> list = contractService.getAuditPassList(pageNum, pageSize, contract, billType);
113
+        PageInfo<BusinessContract> pageInfo = new PageInfo<BusinessContract>(list);
114
+        return pageInfo;
115
+    }
116
+    
117
+    /**
118
+     * 获取可以合同变更的申请列表.
119
+     * @param pageNum 页码
120
+     * @param pageSize 每页显示条数
121
+     * @return
122
+     */
123
+    @RequestMapping(value="/getCanChangeList",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
124
+	@ApiOperation(value="获取合同可以变更的申请列表", notes = "查询数据列表,支持分页")
125
+	@ApiImplicitParams({
126
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
127
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
128
+		@ApiImplicitParam(name = "userId", value = "当前登录人id", paramType = "query")
129
+	})
130
+    public PageInfo<BusinessContract> getCanChangeList(Integer pageNum, Integer pageSize,Integer userId,HttpServletRequest request) {
131
+
132
+    	List<BusinessContract> new_list = contractService.queryContractChangeList(userId, pageNum, pageSize);
133
+
134
+        PageInfo<BusinessContract> pageInfo = new PageInfo<BusinessContract>(new_list);
135
+
136
+        return pageInfo;
137
+    }
138
+    
139
+    //中转
140
+    /**
141
+     * 获取可以合同变更的申请列表.
142
+     * @param pageNum 页码
143
+     * @param pageSize 每页显示条数
144
+     * @return
145
+     */
146
+    @RequestMapping(value="/getCanChangeListTransfer", produces = MediaType.APPLICATION_JSON_VALUE,method=RequestMethod.GET)
147
+	@ApiOperation(value="获取中转合同变更的申请列表", notes = "查询数据列表,支持分页")
148
+	@ApiImplicitParams({
149
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
150
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
151
+		@ApiImplicitParam(name = "userId", value = "当前登录人id", paramType = "query")
152
+	})
153
+    public PageInfo<BusinessContract> getCanChangeListTransfer(Integer pageNum, Integer pageSize,Integer userId,HttpServletRequest request) {
154
+    	/*UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
155
+    	Integer userId = userInfo.getUserId();*/
156
+    	BusinessContractExample example = new BusinessContractExample();
157
+    	Criteria createCriteria = example.createCriteria();
158
+    	// 审批通过的.
159
+    	createCriteria.andAuditStateEqualTo(AuditType.AGREE.getAuditCode());
160
+    	// 变更状态为没有被变更.
161
+    	createCriteria.andChangingEqualTo("0");
162
+    	// 只能变更自己申请的合同.
163
+    	createCriteria.andCreaterIdEqualTo(userId);
164
+    	// 倒序.
165
+    	example.setOrderByClause(" id desc");
166
+    	//中转合同
167
+    	createCriteria.andContractTypeEqualTo(6913);
168
+    	PageHelper.startPage(pageNum, pageSize);
169
+    	List<BusinessContract> list = contractService.queryByExample(example);  
170
+    	PageInfo<BusinessContract> pageInfo = new PageInfo<BusinessContract>(list);
171
+    	return pageInfo;
172
+    }
173
+    
174
+    /**
175
+     * 合同变更列表.
176
+     * 注:如果一条合同变更多次,只会显示最新一次的变更.
177
+     * @param pageNum 页码
178
+     * @param pageSize 每页显示条数
179
+     * @return
180
+     */
181
+    @RequestMapping(value="/getChangeList", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
182
+	@ApiOperation(value="合同变更列表", notes = "查询数据列表,支持分页")
183
+	@ApiImplicitParams({
184
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
185
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
186
+		@ApiImplicitParam(name = "userId", value = "当前登录人id", paramType = "query")
187
+	})
188
+    public PageInfo<BusinessContract> getChangeList(Integer pageNum, Integer pageSize,
189
+            BusinessContract contract, Integer userId,HttpServletRequest request) {
190
+        // 登录人信息.
191
+    	/*UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
192
+    	Integer userId = userInfo.getUserId();*/
193
+    	
194
+        List<BusinessContract> list = contractService.queryByExample(pageNum, pageSize, userId, contract, "FIELD(audit_state,0,3,1,2,4 ), id desc", "change");
195
+        PageInfo<BusinessContract> pageInfo = new PageInfo<BusinessContract>(list);
196
+        return pageInfo;
197
+    }
198
+    
199
+    //中转
200
+    /**
201
+     * 中转合同变更列表.
202
+     * 注:如果一条合同变更多次,只会显示最新一次的变更.
203
+     * @param pageNum 页码
204
+     * @param pageSize 每页显示条数
205
+     * @return
206
+     */
207
+    @RequestMapping(value="/getChangeListTransfer", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
208
+	@ApiOperation(value="中转合同变更列表", notes = "查询数据列表,支持分页")
209
+	@ApiImplicitParams({
210
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
211
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
212
+		@ApiImplicitParam(name = "userId", value = "当前登录人id", paramType = "query")
213
+	})
214
+    public PageInfo<BusinessContract> getChangeListTransfer(Integer pageNum, Integer pageSize,
215
+    		BusinessContract contract, Integer userId,HttpServletRequest request) {
216
+    	// 登录人信息.
217
+    	/*UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
218
+    	Integer userId = userInfo.getUserId();*/
219
+    	
220
+    	List<BusinessContract> list = contractService.queryByExampleTransfer(pageNum, pageSize, userId, contract, "FIELD(audit_state,0,3,1,2,4 ), id desc", "change");
221
+    	PageInfo<BusinessContract> pageInfo = new PageInfo<BusinessContract>(list);
222
+    	return pageInfo;
223
+    }
224
+    
225
+    /**
226
+     * 获取合同进度列表.
227
+     * @param pageNum
228
+     * @param pageSize
229
+     * @return
230
+     */
231
+    @RequestMapping(value="/getScheduleList", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
232
+	@ApiOperation(value="获取合同进度列表", notes = "查询数据列表,支持分页")
233
+	@ApiImplicitParams({
234
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
235
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query")
236
+	})
237
+    public PageInfo<BusinessContractAuditVO> getScheduleList(Integer pageNum, Integer pageSize, BusinessContract contract) {
238
+        PageInfo<BusinessContractAuditVO> pageInfo = contractService.getScheduleList(pageNum, pageSize, contract);
239
+        return pageInfo;
240
+    }
241
+    
242
+    /**
243
+     * 根据id查询合同.
244
+     * @param id 主键
245
+     * @return
246
+     */
247
+    @RequestMapping(value="/edit", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
248
+	@ApiOperation(value="根据id查找详情", notes = "根据id查找")
249
+	@ApiImplicitParams({
250
+		@ApiImplicitParam(name = "id", value = "合同id", paramType = "query")
251
+	})
252
+    public Map<String, Object> edit(Integer id) {
253
+        Map<String, Object> modelMap = new HashMap<String, Object>();
254
+        if (id != null) {
255
+            BusinessContract contract = contractService.findById(id);
256
+            modelMap.put("contract", contract);
257
+            List<BusinessFile> fileList= businessFileService.getByBid(id, "contract", null, null);
258
+            modelMap.put("fileList", fileList);
259
+        }
260
+        return modelMap;
261
+    }
262
+    
263
+    /**
264
+     * 根据id查询变更的合同.
265
+     * @param id 主键
266
+     * @return
267
+     */
268
+    @RequestMapping(value="/editForChange",produces = MediaType.APPLICATION_JSON_VALUE,  method=RequestMethod.GET)
269
+	@ApiOperation(value="根据id查找变更的合同", notes = "根据id查找")
270
+	@ApiImplicitParams({
271
+		@ApiImplicitParam(name = "id", value = "id", paramType = "query")
272
+	})
273
+    public Map<String, Object> editForChange(Integer id) {
274
+        Map<String, Object> modelMap = new HashMap<String, Object>();
275
+        if (id != null) {
276
+        	// 获取当前合同主表数据
277
+            BusinessContract contract = contractService.findById(id);
278
+            modelMap.put("contract", contract);
279
+            
280
+            //附件
281
+            List<BusinessFile> fileList= businessFileService.getByBid(id, "contract", null, null);
282
+            modelMap.put("fileList", fileList);
283
+            
284
+            // 获取当前合同的历次修改原因,内容,时间.
285
+            List<BusinessContract> changeDetailList = contractService.getChangeDetailList(id, "edit");
286
+            modelMap.put("changeDetailList", changeDetailList);
287
+            
288
+            // 仓号货位号数量质量标准.
289
+            List<BusinessStoreWareDetail> storeWareDetailList= businessStoreWareDetailService.getByZidAndType(id, StoreWareType.contract.getValue());
290
+            if(contract.getPlanBid()!=null){
291
+            	List<BusinessStoreWareDetail> planList= businessStoreWareDetailService.getByZidAndType(contract.getPlanBid(), StoreWareType.plan.getValue());
292
+
293
+            	/* 根据引用内容获取被引用合同明细的剩余数量 */
294
+            	Map<String, Object> param_map = new HashMap<String, Object>();
295
+            	param_map.put("plan_id", contract.getPlanBid());
296
+                List<Map<String, Object>> map = businessStoreWareDetailService.selectPlanUseCount(param_map);
297
+                BusinessStoreWareDetail obj = null;
298
+                double sysl = 0d;
299
+                double sum_use_num = 0d; //已使用总量
300
+                double plan_sum_num = 0d; //原计划数量
301
+                for (int i = 0; i < planList.size(); i++) {
302
+                	obj = planList.get(i);
303
+                	for (Map<String, Object> m : map) {
304
+                		if (m.get("house_id").equals(obj.getHouseId()) && m.get("warehouse_id").equals(obj.getWarehouseId())) {
305
+                			if (!"".equals(m.get("in_count")) && null != m.get("in_count")) {
306
+                				plan_sum_num = Double.parseDouble(obj.getInCount());
307
+                				sum_use_num = Double.parseDouble(m.get("in_count")+"");
308
+                				if (sum_use_num <= plan_sum_num) {
309
+                					sysl = plan_sum_num - sum_use_num;
310
+                					obj.setRemainingNumber(sysl+""); //页面上明细列表的数量
311
+                					if (sysl == 0) {
312
+                						obj.setRemainingNumber("0");
313
+                					}
314
+                				} else if (sum_use_num > plan_sum_num){
315
+                					sysl = sum_use_num - plan_sum_num;
316
+                					obj.setRemainingNumber("超出:" + sysl);
317
+                				}
318
+                			}
319
+                			if (!"".equals(m.get("out_count")) && null != m.get("out_count")) {
320
+                				plan_sum_num = Double.parseDouble(obj.getOutCount());
321
+                				sum_use_num = Double.parseDouble(m.get("out_count")+"");
322
+                				if (sum_use_num <= plan_sum_num) {
323
+                					sysl = plan_sum_num - sum_use_num;
324
+                					obj.setOutRemainingNumber(""+sysl);
325
+                				} else if (sum_use_num > plan_sum_num){
326
+                					sysl = sum_use_num - plan_sum_num;
327
+                					obj.setOutRemainingNumber("超出:" + sysl);
328
+                				}
329
+                			}
330
+                		}
331
+                	}
332
+                }
333
+
334
+                for (BusinessStoreWareDetail contractDetail : storeWareDetailList) {
335
+    				for (BusinessStoreWareDetail planDetail : planList) {
336
+    					if(contractDetail.getHouseId().equals(planDetail.getHouseId())  && 
337
+            					contractDetail.getWarehouseId().equals(planDetail.getWarehouseId())){
338
+   
339
+            				contractDetail.setRemainingNumber(planDetail.getRemainingNumber());
340
+            				contractDetail.setOutRemainingNumber(planDetail.getOutRemainingNumber());
341
+            			}
342
+    				}
343
+    			}
344
+			}
345
+            modelMap.put("storeWareDetailList", storeWareDetailList);
346
+        }
347
+        return modelMap;
348
+    }
349
+    
350
+    /**
351
+     * 根据id查询.
352
+     * @param id 主键
353
+     * @return
354
+     */
355
+    @RequestMapping(value="/addForChange",produces = MediaType.APPLICATION_JSON_VALUE,  method=RequestMethod.GET)
356
+   	@ApiOperation(value="根据id查找,获取历次变更详情(新增时,不显示当前id对应的历史记录)", notes = "根据id查找")
357
+   	@ApiImplicitParams({
358
+   		@ApiImplicitParam(name = "id", value = "id", paramType = "query")
359
+   	})
360
+    public Map<String, Object> addForChange(Integer id) {
361
+        Map<String, Object> modelMap = new HashMap<String, Object>();
362
+        if (id != null) {
363
+        	// 获取当前合同主数据
364
+            BusinessContract contract = contractService.findById(id);
365
+            // 获取当前合同的历次修改原因,内容,时间.
366
+            List<BusinessContract> changeDetailList = contractService.getChangeDetailList(id, "add");
367
+            // 获取当前合同明细数据
368
+            List<BusinessStoreWareDetail> storeWareDetailList= businessStoreWareDetailService.getByZidAndType(id, StoreWareType.contract.getValue());
369
+            if(contract.getPlanBid()!=null){
370
+            	// 查询当前合同所在的计划的明细信息
371
+            	List<BusinessStoreWareDetail> planList= businessStoreWareDetailService.getByZidAndType(contract.getPlanBid(), StoreWareType.plan.getValue());
372
+
373
+            	/* 根据引用内容获取被引用合同明细的剩余数量 */
374
+            	Map<String, Object> param_map = new HashMap<String, Object>();
375
+            	param_map.put("plan_id", contract.getPlanBid());
376
+                List<Map<String, Object>> map = businessStoreWareDetailService.selectPlanUseCount(param_map);
377
+                BusinessStoreWareDetail obj = null;
378
+                double sysl = 0d;
379
+                double sum_use_num = 0d; //已使用总量
380
+                double plan_sum_num = 0d; //原计划数量
381
+                for (int i = 0; i < planList.size(); i++) {
382
+                	obj = planList.get(i);
383
+                	for (Map<String, Object> m : map) {
384
+                		if (m.get("house_id").equals(obj.getHouseId()) && m.get("warehouse_id").equals(obj.getWarehouseId())) {
385
+                			if (!"".equals(m.get("in_count")) && null != m.get("in_count")) {
386
+                				plan_sum_num = Double.parseDouble(obj.getInCount());
387
+                				sum_use_num = Double.parseDouble(m.get("in_count")+"");
388
+                				if (sum_use_num <= plan_sum_num) {
389
+                					sysl = plan_sum_num - sum_use_num;
390
+                					obj.setRemainingNumber(sysl+""); //页面上明细列表的数量
391
+                					if (sysl == 0) {
392
+                						obj.setRemainingNumber("0");
393
+                					}
394
+                				} else if (sum_use_num > plan_sum_num){
395
+                					sysl = sum_use_num - plan_sum_num;
396
+                					obj.setRemainingNumber("超出:" + sysl);
397
+                				}
398
+                			}
399
+                			if (!"".equals(m.get("out_count")) && null != m.get("out_count")) {
400
+                				plan_sum_num = Double.parseDouble(obj.getOutCount());
401
+                				sum_use_num = Double.parseDouble(m.get("out_count")+"");
402
+                				if (sum_use_num <= plan_sum_num) {
403
+                					sysl = plan_sum_num - sum_use_num;
404
+                					obj.setOutRemainingNumber(""+sysl);
405
+                				} else if (sum_use_num > plan_sum_num){
406
+                					sysl = sum_use_num - plan_sum_num;
407
+                					obj.setOutRemainingNumber("超出:" + sysl);
408
+                				}
409
+                			}
410
+                		}
411
+                	}
412
+                }
413
+            	
414
+                for (BusinessStoreWareDetail contractDetail : storeWareDetailList) {
415
+    				for (BusinessStoreWareDetail planDetail : planList) {
416
+    					if(contractDetail.getHouseId().equals(planDetail.getHouseId())  && 
417
+            					contractDetail.getWarehouseId().equals(planDetail.getWarehouseId())){
418
+   
419
+            				contractDetail.setRemainingNumber(planDetail.getRemainingNumber());
420
+            				contractDetail.setOutRemainingNumber(planDetail.getOutRemainingNumber());
421
+            			}
422
+    				}
423
+    			}
424
+    		}
425
+            List<BusinessFile> fileList= businessFileService.getByBid(id, "contract", null, null);
426
+            modelMap.put("fileList", fileList);
427
+            
428
+            modelMap.put("contract", contract);
429
+            modelMap.put("changeDetailList", changeDetailList);
430
+            modelMap.put("storeWareDetailList", storeWareDetailList);
431
+        }
432
+        return modelMap;
433
+    }
434
+
435
+    /**
436
+     * 保存
437
+     * @param contractJson 合同数据json
438
+     * @return
439
+     * @throws JsonParseException
440
+     * @throws JsonMappingException
441
+     * @throws IOException
442
+     */
443
+    @RequestMapping(value="/save", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
444
+	@ApiOperation(value="保存数据", notes = "保存")
445
+    @SuppressWarnings("unchecked")
446
+    @ApiImplicitParams({
447
+    	@ApiImplicitParam(name="contractJson", value="主表数据", paramType="form"),
448
+    	@ApiImplicitParam(name="businessStoreWareDetailJson", value="子表数据", paramType="form"),
449
+    	@ApiImplicitParam(name="userId", value="当前登录人的id", paramType="form"),
450
+    	@ApiImplicitParam(name="realName", value="当前登录人的name", paramType="form"),
451
+    	@ApiImplicitParam(name="depotInfoOrgId", value="当前登录人的组织id", paramType="form")
452
+    })
453
+    public Map<String, Object> save(String contractJson, String businessStoreWareDetailJson,
454
+            HttpServletRequest request,Integer userId,String realName,Integer depotInfoOrgId,String fileIds, String deleteFileIds) 
455
+            throws JsonParseException, JsonMappingException, IOException {
456
+        Map<String, Object> modelMap = new HashMap<String, Object>();
457
+    	/*UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
458
+    	if (userInfo == null) {
459
+    	    modelMap.put("status", "error");
460
+            modelMap.put("msg", "请重新登录!");
461
+            return modelMap;
462
+    	}
463
+    	OrgInfo depotInfo = (OrgInfo)request.getSession().getAttribute("depotInfo");*/
464
+        try {
465
+            // JSON字符串转对象
466
+            ObjectMapper mapper = new ObjectMapper();
467
+            BusinessContract contract = (BusinessContract)mapper.readValue(contractJson, BusinessContract.class);
468
+            
469
+            // 明细.
470
+            List<BusinessStoreWareDetail> storeWareDetailList = null;
471
+            if (businessStoreWareDetailJson != null) {
472
+                storeWareDetailList = (List<BusinessStoreWareDetail>)mapper.readValue(businessStoreWareDetailJson, new TypeReference<List<BusinessStoreWareDetail>>(){});
473
+            }
474
+            if (contract.getId() == null) {
475
+                Map<String, Object> returnMap = contractService.add(contract, storeWareDetailList,  userId, realName, depotInfoOrgId,fileIds);
476
+                if (returnMap != null && returnMap.get("error") != null) {
477
+                    modelMap.put("status", "error");
478
+                    modelMap.put("msg", returnMap.get("error"));
479
+                    return modelMap;
480
+                }
481
+                modelMap.put("id", returnMap.get("id"));
482
+            } else {
483
+                contractService.update(contract, storeWareDetailList,fileIds,deleteFileIds);
484
+            }
485
+            modelMap.put("status", "success");
486
+        } catch (Exception e) {
487
+            e.printStackTrace();
488
+            modelMap.put("status", "error");
489
+            modelMap.put("msg", "保存失败!");
490
+            return modelMap;
491
+        }
492
+        return modelMap;
493
+    }
494
+
495
+    /**
496
+     * 删除
497
+     * @param id 主键
498
+     * @param processInstanceId 流程实例id
499
+     * @param deleteReason 删除原因
500
+     * @return
501
+     * @throws JsonParseException
502
+     * @throws JsonMappingException
503
+     * @throws IOException
504
+     */
505
+    @RequestMapping(value="/remove",produces = MediaType.APPLICATION_JSON_VALUE,  method=RequestMethod.POST)
506
+    @ApiOperation(value="删除合同", notes = "根据id删除")
507
+    @ApiImplicitParams({
508
+            @ApiImplicitParam(name = "id", value = "合同id", paramType = "query"),
509
+            @ApiImplicitParam(name = "processInstanceId", value = "流程实例id", paramType = "query"),
510
+            @ApiImplicitParam(name = "deleteReason", value = "删除原因", paramType = "query"),
511
+            @ApiImplicitParam(name = "planBid", value = "计划id", paramType = "query")
512
+    })
513
+    public Map<String, Object> remove(Integer id, String processInstanceId, String deleteReason,Integer planBid)
514
+            throws JsonParseException, JsonMappingException, IOException {
515
+        Map<String, Object> modelMap = new HashMap<String, Object>();
516
+        if (id != null) {
517
+            contractService.remove(id, processInstanceId, deleteReason,planBid);
518
+        }
519
+        modelMap.put("status", "success");
520
+        return modelMap;
521
+    }
522
+
523
+    /**
524
+     * 保存合同变更
525
+     * @param contractJson 合同数据json
526
+     * @return
527
+     * @throws JsonParseException
528
+     * @throws JsonMappingException
529
+     * @throws IOException
530
+     */
531
+    @RequestMapping(value="/saveChange", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
532
+	@ApiOperation(value="保存合同变更", notes = "保存")
533
+    @SuppressWarnings("unchecked")
534
+    @ApiImplicitParams({
535
+    	@ApiImplicitParam(name="contractJson", value="主表数据", paramType="form"),
536
+    	@ApiImplicitParam(name="businessStoreWareDetailJson", value="子表数据", paramType="form"),
537
+    	@ApiImplicitParam(name="userId", value="当前登录人的id", paramType="form"),
538
+    	@ApiImplicitParam(name="userName", value="当前登录人的name", paramType="form"),
539
+    	@ApiImplicitParam(name="depotInfoOrgId", value="当前登录人的组织id", paramType="form"),
540
+            @ApiImplicitParam(name="id", value="原id", paramType="form")
541
+    })
542
+    public Map<String, Object> saveChange(String contractJson, String businessStoreWareDetailJson,
543
+    		Integer userId,String userName, String realName,Integer depotInfoOrgId,Integer id,String fileIds, String deleteFileIds) throws JsonParseException, JsonMappingException, IOException {
544
+        Map<String, Object> modelMap = new HashMap<String, Object>();
545
+
546
+        try {
547
+            // JSON字符串转对象
548
+            ObjectMapper mapper = new ObjectMapper();
549
+            BusinessContract contract = (BusinessContract)mapper.readValue(contractJson, BusinessContract.class);
550
+
551
+            // 明细.
552
+            List<BusinessStoreWareDetail> storeWareDetailList = null;
553
+            if (businessStoreWareDetailJson != null) {
554
+                storeWareDetailList = (List<BusinessStoreWareDetail>)mapper.readValue(businessStoreWareDetailJson, new TypeReference<List<BusinessStoreWareDetail>>(){});
555
+            }
556
+
557
+            if (id == null) {
558
+                throw new RuntimeException("原合同id为空,保存失败!");
559
+            } else {
560
+                Map<String, Object> returnMap =  contractService.saveChange(contract, storeWareDetailList,  userId, userName,  realName, depotInfoOrgId,id,fileIds);
561
+                modelMap.put("id",returnMap.get("id"));
562
+            }
563
+            modelMap.put("status", "success");
564
+        } catch (Exception e) {
565
+            e.printStackTrace();
566
+            modelMap.put("status", "error");
567
+            modelMap.put("msg", "保存失败!");
568
+        }
569
+        return modelMap;
570
+    }
571
+
572
+    /**
573
+     * 修改合同变更.
574
+     * @param contractJson 合同数据json
575
+     * @return
576
+     * @throws JsonParseException
577
+     * @throws JsonMappingException
578
+     * @throws IOException
579
+     */
580
+    @RequestMapping(value="/updateChange", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
581
+	@ApiOperation(value="修改合同变更", notes = "保存")
582
+    @SuppressWarnings("unchecked")
583
+    @ApiImplicitParams({
584
+    	@ApiImplicitParam(name="contractJson", value="主表数据", paramType="form"),
585
+    	@ApiImplicitParam(name="businessStoreWareDetailJson", value="子表数据", paramType="form")
586
+    })
587
+    public Map<String, Object> updateChange(String contractJson, String businessStoreWareDetailJson,String fileIds, String deleteFileIds)
588
+            throws JsonParseException, JsonMappingException, IOException {
589
+        Map<String, Object> modelMap = new HashMap<String, Object>();
590
+        try {
591
+            // JSON字符串转对象
592
+            ObjectMapper mapper = new ObjectMapper();
593
+            BusinessContract contract = (BusinessContract)mapper.readValue(contractJson, BusinessContract.class);
594
+
595
+            // 明细.
596
+            List<BusinessStoreWareDetail> storeWareDetailList = null;
597
+            if (businessStoreWareDetailJson != null) {
598
+                storeWareDetailList = (List<BusinessStoreWareDetail>)mapper.readValue(businessStoreWareDetailJson, new TypeReference<List<BusinessStoreWareDetail>>(){});
599
+            }
600
+
601
+            if (contract.getId() == null) {
602
+                throw new RuntimeException("合同id为空,保存失败!");
603
+            } else {
604
+                contractService.update(contract, storeWareDetailList,fileIds,deleteFileIds);
605
+            }
606
+            modelMap.put("status", "success");
607
+        } catch (Exception e) {
608
+            e.printStackTrace();
609
+            modelMap.put("status", "error");
610
+            modelMap.put("msg", "保存失败!");
611
+        }
612
+        return modelMap;
613
+    }
614
+
615
+    /**
616
+     * 删除合同变更.
617
+     * @param id 主键
618
+     * @param originalContractBid 原合同id
619
+     * @param processInstanceId 流程实例id
620
+     * @param deleteReason 删除原因
621
+     * @return
622
+     * @throws JsonParseException
623
+     * @throws JsonMappingException
624
+     * @throws IOException
625
+     */
626
+    @RequestMapping(value="/changeContractRemove",produces = MediaType.APPLICATION_JSON_VALUE,  method=RequestMethod.POST)
627
+	@ApiOperation(value="删除合同变更", notes = "根据id删除")
628
+	@ApiImplicitParams({
629
+		@ApiImplicitParam(name = "id", value = "合同id", paramType = "query"),
630
+		@ApiImplicitParam(name = "originalContractBid", value = "原合同id", paramType = "query"),
631
+		@ApiImplicitParam(name = "processInstanceId", value = "流程实例id", paramType = "query"),
632
+		@ApiImplicitParam(name = "deleteReason", value = "删除原因", paramType = "query"),
633
+	})
634
+    public Map<String, Object> changeContractRemove(Integer id, Integer originalContractBid,
635
+    		String processInstanceId, String deleteReason,Integer planBid)
636
+    		throws JsonParseException, JsonMappingException, IOException {
637
+        Map<String, Object> modelMap = new HashMap<String, Object>();
638
+        if (id != null) {
639
+            modelMap = contractService.changeContractRemove(id, originalContractBid, processInstanceId, deleteReason,planBid);
640
+            if ("success".equals(modelMap.get("status"))) {
641
+                try {
642
+                    if (deleteReason!=null) {
643
+                        actTaskService.delRunTask(processInstanceId, deleteReason);
644
+                    } else {
645
+                        deleteReason="删除原因无";
646
+                        actTaskService.delRunTask(processInstanceId, deleteReason);
647
+                    }
648
+                } catch (Exception e) {
649
+                    e.printStackTrace();
650
+                }
651
+            }
652
+        } else {
653
+            modelMap.put("status", "error");
654
+            modelMap.put("msg", "id为空,删除失败!");
655
+        }
656
+        return modelMap;
657
+    }
658
+    
659
+    /**
660
+     * 提交
661
+     * @param contract 合同
662
+     * @param assignee 下一个审批人
663
+     * @return
664
+     */
665
+    @RequestMapping(value="/submit", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
666
+	@ApiOperation(value="提交", notes = "提交")
667
+    @ApiImplicitParams({
668
+		@ApiImplicitParam(name = "contract", value = "合同", paramType = "query"),
669
+		@ApiImplicitParam(name = "assignee", value = "下一个审批人", paramType = "query"),
670
+		@ApiImplicitParam(name = "userId", value = "当前登录人id", paramType = "query"),
671
+		@ApiImplicitParam(name = "realName", value = "当前登录人name", paramType = "query")
672
+	})
673
+    public Map<String, Object> submit(BusinessContract contract,String assignee,Integer userId,String realName,HttpServletRequest request) {
674
+    	//UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
675
+        Map<String, Object> returnMap = contractService.submit(contract, assignee, userId, realName);
676
+        return returnMap;
677
+    }
678
+    
679
+    /**
680
+     * 启用
681
+     * @param id 主键.
682
+     * @return
683
+     */
684
+    @RequestMapping(value="/application", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
685
+	@ApiOperation(value="合同启用", notes = "合同启用")
686
+    @ApiImplicitParams({
687
+		@ApiImplicitParam(name = "id", value = "合同id", paramType = "query")
688
+	})
689
+    public Map<String, Object> application(Integer id) {
690
+        Map<String, Object> modelMap = new HashMap<String, Object>();
691
+        Map<String, String> returnMap = contractService.application(id);
692
+        if (StringUtils.isNoneBlank(returnMap.get("error"))) {
693
+            modelMap.put("status", "error");
694
+            modelMap.put("msg", returnMap.get("error"));
695
+        } else {
696
+            modelMap.put("status", "success");
697
+        }
698
+        return modelMap;
699
+    }
700
+    
701
+    /**
702
+     * 暂停
703
+     * @param id 主键.
704
+     * @return
705
+     */
706
+    @RequestMapping(value="/discontinue", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
707
+	@ApiOperation(value="合同暂停", notes = "合同暂停")
708
+    @ApiImplicitParams({
709
+		@ApiImplicitParam(name = "id", value = "合同id", paramType = "query")
710
+	})
711
+    public Map<String, Object> discontinue(Integer id,String refuseReason) {
712
+        Map<String, Object> modelMap = new HashMap<String, Object>();
713
+        contractService.discontinue(id,refuseReason);
714
+        modelMap.put("status", "success");
715
+        return modelMap;
716
+    }
717
+    
718
+    /**
719
+     * 终止
720
+     * @param id 主键.
721
+     * @return
722
+     */
723
+    @RequestMapping(value="/finish", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
724
+   	@ApiOperation(value="合同终止", notes = "合同终止")
725
+   	@ApiImplicitParams({
726
+   		@ApiImplicitParam(name = "id", value = "合同id", paramType = "query")
727
+   	})
728
+    public Map<String, Object> finish(Integer id,String refuseReason) {
729
+        Map<String, Object> modelMap = new HashMap<String, Object>();
730
+        contractService.finish(id,refuseReason);
731
+        modelMap.put("status", "success");
732
+        return modelMap;
733
+    }
734
+    
735
+    /**
736
+     * 校验合同编号,是否可用.
737
+     * @param id 主键.
738
+     * @param contractNumber 合同编号.
739
+     * @return true 为可用,false为不可用.
740
+     */
741
+    @RequestMapping(value="/validContractNumber", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
742
+	@ApiOperation(value="校验合同编号,是否可用", notes = "校验合同编号,是否可用")
743
+	@ApiImplicitParams({
744
+		@ApiImplicitParam(name = "id", value = "合同id", paramType = "query"),
745
+		@ApiImplicitParam(name = "contractNumber", value = "合同编号", paramType = "query")
746
+	})
747
+    public Boolean validContractNumber(Integer id, String contractNumber) {
748
+        return contractService.validContractNumber(id, contractNumber);
749
+    }
750
+    
751
+    
752
+    //中转------------------------------------------------------------------
753
+    /**
754
+     * 中转合同申请列表.
755
+     * @param pageNum 页码
756
+     * @param pageSize 每页显示条数
757
+     * @return
758
+     * @throws Exception 
759
+     */
760
+    @RequestMapping(value="/getTransferList", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
761
+	@ApiOperation(value="中转合同申请列表", notes = "查询数据列表,支持分页")
762
+	@ApiImplicitParams({
763
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
764
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
765
+		@ApiImplicitParam(name = "userId", value = "当前登录人的id", paramType = "query")
766
+	})
767
+    public PageInfo<BusinessContract> getTransferList(Integer pageNum, Integer pageSize,HttpServletRequest request, BusinessContract contract,Integer userId) throws Exception {
768
+    	/*UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
769
+		if (userInfo==null) {
770
+			throw new Exception("请您先登录"); 
771
+		}
772
+		Integer userId = userInfo.getUserId();*/
773
+        List<BusinessContract> list = contractService.queryByExampleTransfer(pageNum, pageSize, userId, contract, "FIELD(audit_state,0,3,1,2,4 ), id desc", "");
774
+        PageInfo<BusinessContract> pageInfo = new PageInfo<BusinessContract>(list);
775
+        return pageInfo;
776
+    }
777
+    
778
+    /**
779
+     * 审批通过列表.
780
+     * @param pageNum 页码
781
+     * @param pageSize 每页显示条数
782
+     * @param contract 合同体
783
+     * @param request
784
+     * @return
785
+     */
786
+    @RequestMapping(value="/getAuditPassListTransfer", produces = MediaType.APPLICATION_JSON_VALUE,method=RequestMethod.GET)
787
+	@ApiOperation(value="审批通过列表", notes = "查询数据列表,支持分页")
788
+	@ApiImplicitParams({
789
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
790
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
791
+		@ApiImplicitParam(name = "billType", value = "合同类型(收购/销售)", paramType = "query")
792
+	})
793
+    public PageInfo<BusinessContract> getAuditPassListTransfer(Integer pageNum, Integer pageSize, BusinessContract contract,
794
+            Integer billType, HttpServletRequest request) {
795
+        List<BusinessContract> list = contractService.getAuditPassListTransfer(pageNum, pageSize, contract, billType);
796
+        PageInfo<BusinessContract> pageInfo = new PageInfo<BusinessContract>(list);
797
+        return pageInfo;
798
+    }
799
+    
800
+    
801
+    /**
802
+     * 审批通过列表(所有类型的合同,用于移动端).
803
+     * @param pageNum 页码
804
+     * @param pageSize 每页显示条数
805
+     * @param contract 合同体
806
+     * @param request
807
+     * @return
808
+     */
809
+    @RequestMapping(value="/getAuditPassListApp",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
810
+	@ApiOperation(value="合同审批通过列表", notes = "查询数据列表,支持分页")
811
+	@ApiImplicitParams({
812
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
813
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
814
+		@ApiImplicitParam(name = "billType", value = "合同类型(收购/销售)", paramType = "query")
815
+	})
816
+    public PageInfo<BusinessContract> getAuditPassListApp(Integer pageNum, Integer pageSize, BusinessContract contract,
817
+            Integer billType, HttpServletRequest request) {
818
+        List<BusinessContract> list = contractService.getAuditPassListApp(pageNum, pageSize, contract, billType);
819
+        PageInfo<BusinessContract> pageInfo = new PageInfo<BusinessContract>(list);
820
+        return pageInfo;
821
+    }
822
+    
823
+    
824
+    
825
+   /* //合同信息同步
826
+  	@RequestMapping("/contractInfoSynchronization")
827
+  	public void contractInfoSynchronization() {
828
+  		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
829
+  		List list = DataSynchronization.queryContractInfo();
830
+  		List<BusinessContract> contractList = contractService.getAllContractInfo();
831
+  		for(BusinessContract contractInfo:contractList) {
832
+  			int num = 0;
833
+  			for(int i=0;i<list.size();i++) {
834
+  				Map<String,Object> map = (Map<String,Object>)list.get(i);
835
+  				String kdbm = ObjectUtils.toString(map.get("kdbm"),"");//库点编码
836
+  				String refreshTime = ObjectUtils.toString(map.get("refreshTime"),"");
837
+  				if(kdbm.equals(ObjectUtils.toString(orgInfo.getOrgId(),""))) {
838
+  					if(!refreshTime.equals(format.format(orgInfo.getUpdateTime()))) {
839
+  						DataSynchronization.orgInfoSynchronizationUpdate(map, orgInfo);
840
+  					}
841
+  					break;
842
+  				}else if(num == (list.size()-1)){
843
+  					DataSynchronization.orgInfoSynchronizationInsert(orgInfo);
844
+  				}else {
845
+  					num = num+1;
846
+  				}
847
+  			}
848
+  		}
849
+  	}*/
850
+}

+ 101 - 0
src/main/java/com/chinaitop/depot/business/controller/BusinessContractPayController.java

@@ -0,0 +1,101 @@
1
+package com.chinaitop.depot.business.controller;
2
+
3
+
4
+import java.io.IOException;
5
+import java.util.HashMap;
6
+import java.util.List;
7
+import java.util.Map;
8
+
9
+import javax.annotation.Resource;
10
+import javax.servlet.http.HttpServletRequest;
11
+
12
+import org.springframework.http.MediaType;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RequestMethod;
15
+import org.springframework.web.bind.annotation.RestController;
16
+
17
+import com.chinaitop.depot.business.model.BusinessContractPayRecevice;
18
+import com.chinaitop.depot.business.service.BusinessContractPayService;
19
+import com.fasterxml.jackson.core.JsonParseException;
20
+import com.fasterxml.jackson.databind.JsonMappingException;
21
+import com.fasterxml.jackson.databind.ObjectMapper;
22
+import com.github.pagehelper.PageHelper;
23
+import com.github.pagehelper.PageInfo;
24
+
25
+import io.swagger.annotations.ApiImplicitParam;
26
+import io.swagger.annotations.ApiImplicitParams;
27
+import io.swagger.annotations.ApiOperation;
28
+
29
+/**
30
+ * 粮库业务管理-合同收付款管理
31
+* 
32
+* <p>Description: </p>
33
+* @author yaoyabin
34
+* @date 2017年10月25日 下午5:33:42
35
+ */
36
+@RestController
37
+@RequestMapping(value="/depot/business/contractPay")
38
+public class BusinessContractPayController {
39
+	
40
+	@Resource
41
+	private BusinessContractPayService contractPayService;
42
+   
43
+	
44
+	/**
45
+	 * 列表
46
+	 * @param pageNum
47
+	 * @param pageSize
48
+	 * @param customerBadrecord
49
+	 * @return
50
+	 */
51
+	@RequestMapping(value="/getList",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
52
+   	@ApiOperation(value="合同收付款列表", notes = "查询数据列表,支持分页")
53
+   	@ApiImplicitParams({
54
+   		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
55
+   		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query")
56
+   	})
57
+	public PageInfo<BusinessContractPayRecevice> getList(Integer pageNum, Integer pageSize,BusinessContractPayRecevice contractPayRecevice) {
58
+		List<BusinessContractPayRecevice> list = contractPayService.queryByExample(pageNum,pageSize,contractPayRecevice);	
59
+		PageInfo<BusinessContractPayRecevice> pageInfo = new PageInfo<BusinessContractPayRecevice>(list);
60
+		return pageInfo;
61
+	}
62
+
63
+	
64
+
65
+	/**
66
+	 * 保存
67
+	 * @param customerJson 业务数据json
68
+	 * @return
69
+	 * @throws JsonParseException
70
+	 * @throws JsonMappingException
71
+	 * @throws IOException
72
+	 */
73
+	@RequestMapping(value="/contractPaySave", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
74
+	@ApiOperation(value="保存数据", notes = "保存")
75
+    @SuppressWarnings("unchecked")
76
+    @ApiImplicitParams({
77
+    	@ApiImplicitParam(name="contractJson", value="增加数据", paramType="form")
78
+    })
79
+	public Map<String, Object> save(HttpServletRequest request, String contractJson) throws JsonParseException, JsonMappingException, IOException {
80
+		
81
+        Map<String, Object> modelMap = new HashMap<String, Object>();
82
+		try {
83
+            // JSON字符串转对象
84
+            ObjectMapper mapper = new ObjectMapper();
85
+            BusinessContractPayRecevice contract = (BusinessContractPayRecevice)mapper.readValue(contractJson, BusinessContractPayRecevice.class);
86
+            if (contract.getId() == null) {
87
+            	contractPayService.add(contract);
88
+            } else {
89
+            	
90
+            }
91
+            modelMap.put("status", "success");
92
+        } catch (Exception e) {
93
+            e.printStackTrace();
94
+            modelMap.put("status", "error");
95
+            modelMap.put("msg", "保存失败!");
96
+        }
97
+		return modelMap;
98
+	}
99
+	
100
+	
101
+}

+ 472 - 0
src/main/java/com/chinaitop/depot/business/controller/BusinessDeliveryStorageNoticeController.java

@@ -0,0 +1,472 @@
1
+package com.chinaitop.depot.business.controller;
2
+
3
+
4
+import com.chinaitop.depot.business.model.BusinessDeliveryStorageNotice;
5
+import com.chinaitop.depot.business.model.BusinessStoreWareDetail;
6
+import com.chinaitop.depot.business.model.enums.AuditType;
7
+import com.chinaitop.depot.business.model.enums.StoreWareType;
8
+import com.chinaitop.depot.business.model.vo.BusinessDeliveryStorageNoticeAuditVO;
9
+import com.chinaitop.depot.business.service.BusinessDeliveryStorageNoticeService;
10
+import com.chinaitop.depot.business.service.BusinessStoreWareDetailService;
11
+import com.fasterxml.jackson.core.JsonParseException;
12
+import com.fasterxml.jackson.core.type.TypeReference;
13
+import com.fasterxml.jackson.databind.JsonMappingException;
14
+import com.fasterxml.jackson.databind.ObjectMapper;
15
+import com.github.pagehelper.PageInfo;
16
+import io.swagger.annotations.Api;
17
+import io.swagger.annotations.ApiImplicitParam;
18
+import io.swagger.annotations.ApiImplicitParams;
19
+import io.swagger.annotations.ApiOperation;
20
+import org.apache.commons.lang3.StringUtils;
21
+import org.springframework.http.MediaType;
22
+import org.springframework.web.bind.annotation.RequestMapping;
23
+import org.springframework.web.bind.annotation.RequestMethod;
24
+import org.springframework.web.bind.annotation.RestController;
25
+
26
+import javax.annotation.Resource;
27
+import javax.servlet.http.HttpServletRequest;
28
+import java.io.IOException;
29
+import java.util.ArrayList;
30
+import java.util.HashMap;
31
+import java.util.List;
32
+import java.util.Map;
33
+
34
+/**
35
+ * 粮库业务管理-出入库通知单管理
36
+* <p>Title: BusinessDeliveryStorageNoticeController</p>
37
+* <p>Description: </p>
38
+* @author yaoyabin
39
+* @date 2017年10月25日 下午5:36:15
40
+ */
41
+@RestController
42
+@RequestMapping(value="/depot/business/deliveryStorageNotice")
43
+@Api(value= "BusinessDeliveryStorageNoticeController", description = "出入库通知单管理")
44
+
45
+public class BusinessDeliveryStorageNoticeController {
46
+    
47
+    @Resource
48
+    private BusinessDeliveryStorageNoticeService deliveryStorageNoticeService;
49
+    @Resource
50
+    private BusinessStoreWareDetailService businessStoreWareDetailService;
51
+   /* @Resource
52
+    private BasicCodeRuleService basicCodeRuleService;*/
53
+    
54
+    /**
55
+     * 申请列表.
56
+     * @param pageNum 页码
57
+     * @param pageSize 每页显示条数
58
+     * @return
59
+     */
60
+    @RequestMapping(value="/getList", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
61
+	@ApiOperation(value="申请列表", notes = "查询数据列表,支持分页")
62
+	@ApiImplicitParams({
63
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
64
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
65
+		@ApiImplicitParam(name = "userId", value = "当前登录人id", paramType = "query")
66
+	})
67
+    public PageInfo<BusinessDeliveryStorageNotice> getList(Integer pageNum, Integer pageSize,
68
+            HttpServletRequest request, BusinessDeliveryStorageNotice notice,Integer userId) {
69
+        /*UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
70
+        Integer userId = userInfo.getUserId();*/
71
+        List<BusinessDeliveryStorageNotice> list = deliveryStorageNoticeService.queryByExample(pageNum, pageSize, userId, notice, "FIELD(audit_state,0,3,1,2,4 ), id desc");  
72
+        PageInfo<BusinessDeliveryStorageNotice> pageInfo = new PageInfo<BusinessDeliveryStorageNotice>(list);
73
+        return pageInfo;
74
+    }
75
+    
76
+    //中转
77
+    /**
78
+     * 申请列表.
79
+     * @param pageNum 页码
80
+     * @param pageSize 每页显示条数
81
+     * @return
82
+     */
83
+    @RequestMapping(value="/getListTransfer", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
84
+	@ApiOperation(value="申请列表(中转)", notes = "查询数据列表,支持分页")
85
+	@ApiImplicitParams({
86
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
87
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
88
+		@ApiImplicitParam(name = "userId", value = "当前登录人id", paramType = "query")
89
+	})
90
+    public PageInfo<BusinessDeliveryStorageNotice> getListTransfer(Integer pageNum, Integer pageSize,
91
+    		HttpServletRequest request, BusinessDeliveryStorageNotice notice,Integer userId) {
92
+    	/*UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
93
+    	Integer userId = userInfo.getUserId();*/
94
+    	List<BusinessDeliveryStorageNotice> list = deliveryStorageNoticeService.queryByExampleTransfer(pageNum, pageSize, userId, notice, "FIELD(audit_state,0,3,1,2,4 ), id desc");  
95
+    	PageInfo<BusinessDeliveryStorageNotice> pageInfo = new PageInfo<BusinessDeliveryStorageNotice>(list);
96
+    	return pageInfo;
97
+    }
98
+
99
+    /**
100
+     * 审批通过列表.
101
+     * @param pageNum 页码
102
+     * @param pageSize 每页显示条数
103
+     * @return
104
+     */
105
+    @RequestMapping(value="/getAuditPassList", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
106
+	@ApiOperation(value="通知单审批通过列表", notes = "查询数据列表,支持分页")
107
+	@ApiImplicitParams({
108
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
109
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query")
110
+	})
111
+    public PageInfo<BusinessDeliveryStorageNotice> getAuditPassList(Integer pageNum, Integer pageSize, BusinessDeliveryStorageNotice notice) {
112
+        notice.setAuditState(AuditType.AGREE.getAuditCode());
113
+        List<BusinessDeliveryStorageNotice> list = deliveryStorageNoticeService.queryByExample(pageNum, pageSize, null, notice, "agree_time desc");  
114
+        PageInfo<BusinessDeliveryStorageNotice> pageInfo = new PageInfo<BusinessDeliveryStorageNotice>(list);
115
+        return pageInfo;
116
+    }
117
+   
118
+    /**
119
+     * 获取进度列表.
120
+     * @param pageNum
121
+     * @param pageSize
122
+     * @param deliveryStorageNotice
123
+     * @return
124
+     */
125
+    @RequestMapping(value="/getScheduleList",produces = MediaType.APPLICATION_JSON_VALUE,  method=RequestMethod.GET)
126
+	@ApiOperation(value="获取通知单进度列表", notes = "查询数据列表,支持分页")
127
+	@ApiImplicitParams({
128
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
129
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query")
130
+	})
131
+    public PageInfo<BusinessDeliveryStorageNoticeAuditVO> getScheduleList(Integer pageNum, Integer pageSize, BusinessDeliveryStorageNotice deliveryStorageNotice) {
132
+        PageInfo<BusinessDeliveryStorageNoticeAuditVO> pageInfo = deliveryStorageNoticeService.getScheduleList(pageNum, pageSize, deliveryStorageNotice);
133
+        return pageInfo;
134
+    }
135
+    /**
136
+     * 根据id查询.
137
+     * @param id 主键
138
+     * @return
139
+     */
140
+    @RequestMapping(value="/edit", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
141
+	@ApiOperation(value="根据id查找", notes = "根据id查找")
142
+	@ApiImplicitParams({
143
+		@ApiImplicitParam(name = "id", value = "通知单id", paramType = "query")
144
+	})
145
+    public Map<String, Object> edit(Integer id) {
146
+        Map<String, Object> modelMap = new HashMap<String, Object>();
147
+        if (id != null) {
148
+            BusinessDeliveryStorageNotice deliveryStorageNotice = deliveryStorageNoticeService.findById(id);
149
+            modelMap.put("deliveryStorageNotice", deliveryStorageNotice);
150
+            
151
+            List<BusinessStoreWareDetail> list = new ArrayList<BusinessStoreWareDetail>();
152
+            Integer plan_id = deliveryStorageNotice.getPlanBid(); //计划ID
153
+            Integer contract_id = deliveryStorageNotice.getContractBid(); //合同ID
154
+            Map<String, Object> param_map = new HashMap<String, Object>();
155
+            List<Map<String, Object>> map = null;
156
+            if (null != contract_id) {
157
+            	list = businessStoreWareDetailService.getByZidAndType(contract_id, "contract");
158
+            	param_map.put("contract_id", contract_id);
159
+            	map = businessStoreWareDetailService.selectContractUseCount(param_map);
160
+            } else if (null != plan_id) {
161
+            	list = businessStoreWareDetailService.getByZidAndType(plan_id, "plan");
162
+            	param_map.put("plan_id", plan_id);
163
+            	map = businessStoreWareDetailService.selectPlanUseCount(param_map);
164
+            }
165
+            
166
+            BusinessStoreWareDetail obj = null;
167
+            double sysl = 0d;
168
+            double sum_use_num = 0d; //已使用总量
169
+            double plan_sum_num = 0d; //原计划数量
170
+            for (int i = 0; i < list.size(); i++) {
171
+            	obj = list.get(i);
172
+            	for (Map<String, Object> m : map) {
173
+            		if (obj.getHouseId().equals(m.get("house_id")) && obj.getWarehouseId().equals(m.get("warehouse_id"))) {
174
+            			if ("1".equals(deliveryStorageNotice.getBillType())) {
175
+            				plan_sum_num = Double.parseDouble(obj.getInCount());
176
+            				sum_use_num = Double.parseDouble(m.get("in_count")+"");
177
+            				if (sum_use_num <= plan_sum_num) {
178
+        						sysl = plan_sum_num - sum_use_num;
179
+        						obj.setRemainingNumber(sysl+""); //页面上明细列表的剩余数量
180
+        					} else if (sum_use_num > plan_sum_num){
181
+        						sysl = sum_use_num - plan_sum_num;
182
+        						obj.setRemainingNumber("超出:"+sysl);
183
+        					}
184
+            			}
185
+            			if ("3".equals(deliveryStorageNotice.getBillType())) {
186
+            				plan_sum_num = Double.parseDouble(obj.getOutCount());
187
+            				sum_use_num = Double.parseDouble(m.get("out_count")+"");
188
+            				if (sum_use_num <= plan_sum_num) {
189
+        						sysl = plan_sum_num - sum_use_num;
190
+        						obj.setOutRemainingNumber(sysl+""); //页面上明细列表的剩余数量
191
+        					} else if (sum_use_num > plan_sum_num){
192
+        						sysl = sum_use_num - plan_sum_num;
193
+        						obj.setOutRemainingNumber("超出:"+sysl);
194
+        					}
195
+            			}
196
+            		}
197
+            	}
198
+            }
199
+            
200
+            //明细
201
+            List<BusinessStoreWareDetail> transferNoticeList= businessStoreWareDetailService.getByZidAndType(id, StoreWareType.transferNotice.getValue());
202
+            /*for (int i = 0; i < list.size(); i++) {
203
+            	obj = list.get(i);
204
+            	for (BusinessStoreWareDetail m : transferNoticeList) {
205
+            		if (obj.getHouseId().equals(m.getHouseId()) && obj.getWarehouseId().equals(m.getWarehouseId())) {
206
+            			if ("1".equals(deliveryStorageNotice.getBillType())) {
207
+            				m.setRemainingNumber(obj.getRemainingNumber());
208
+            			}
209
+            			if ("3".equals(deliveryStorageNotice.getBillType())) {
210
+            				m.setOutRemainingNumber(obj.getOutRemainingNumber());
211
+            			}
212
+            		}
213
+            	}
214
+            }*/
215
+            List<BusinessStoreWareDetail> noticelList= businessStoreWareDetailService.getByZidAndType(id, StoreWareType.notice.getValue());
216
+
217
+            for (int i = 0; i < list.size(); i++) {
218
+            	obj = list.get(i);
219
+            	for (BusinessStoreWareDetail m : noticelList) {
220
+            		if (obj.getHouseId().equals(m.getHouseId()) && obj.getWarehouseId().equals(m.getWarehouseId())) {
221
+            			if ("1".equals(deliveryStorageNotice.getBillType())) {
222
+            				m.setRemainingNumber(obj.getRemainingNumber());
223
+            			}
224
+            			if ("3".equals(deliveryStorageNotice.getBillType())) {
225
+            				m.setOutRemainingNumber(obj.getOutRemainingNumber());
226
+            			}
227
+            		}
228
+            	}
229
+            }
230
+            if(transferNoticeList.size()>0 && transferNoticeList!=null){
231
+            	modelMap.put("storeWareDetailList", transferNoticeList);
232
+            }
233
+            if(noticelList.size()>0 && noticelList!=null){
234
+            	modelMap.put("storeWareDetailList", noticelList);
235
+            }
236
+            
237
+        }
238
+        return modelMap;
239
+    }
240
+
241
+    /**
242
+     * 保存
243
+     * @param deliveryStorageNoticeJson 主表信息
244
+     * @param businessStoreWareDetailJson 明细
245
+     * @return
246
+     * @throws JsonParseException
247
+     * @throws JsonMappingException
248
+     * @throws IOException
249
+     */
250
+    @RequestMapping(value="/save", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
251
+	@ApiOperation(value="保存数据", notes = "保存")
252
+    @SuppressWarnings("unchecked")
253
+    @ApiImplicitParams({
254
+		@ApiImplicitParam(name = "deliveryStorageNoticeJson", value = "主表数据", paramType = "query"),
255
+		@ApiImplicitParam(name = "businessStoreWareDetailJson", value = "子表数据", paramType = "query"),
256
+		@ApiImplicitParam(name = "userId", value = "当前登录人id", paramType = "query"),
257
+		@ApiImplicitParam(name = "name", value = "当前登录人name", paramType = "query"),
258
+		@ApiImplicitParam(name = "orgId", value = "当前登录人所在组织", paramType = "query"),
259
+		@ApiImplicitParam(name = "depotInfoOrgId", value = "当前登录人所在组织id", paramType = "query")
260
+	})
261
+    public Map<String, Object> save(String deliveryStorageNoticeJson, String businessStoreWareDetailJson, 
262
+    		Integer userId, String name ,Integer orgId,Integer depotInfoOrgId,HttpServletRequest request) 
263
+            throws JsonParseException, JsonMappingException, IOException {
264
+        Map<String, Object> modelMap = new HashMap<String, Object>();
265
+        /*UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
266
+        OrgInfo depotInfo = (OrgInfo)request.getSession().getAttribute("depotInfo");*/
267
+        try {
268
+            // JSON字符串转对象
269
+            ObjectMapper mapper = new ObjectMapper();
270
+            BusinessDeliveryStorageNotice businessDeliveryStorageNotice = (BusinessDeliveryStorageNotice)mapper.readValue(deliveryStorageNoticeJson, BusinessDeliveryStorageNotice.class);
271
+            
272
+            List<BusinessStoreWareDetail> storeWareDetailList = null;
273
+            if (businessStoreWareDetailJson != null) {
274
+                storeWareDetailList = (List<BusinessStoreWareDetail>)mapper.readValue(businessStoreWareDetailJson, new TypeReference<List<BusinessStoreWareDetail>>(){});
275
+                
276
+                 //通知单的明细 库点名称都是一样的,所以取第一个
277
+					if(storeWareDetailList.get(0).getState() != storeWareDetailList.get(0).getOrgId()){ //代储库的
278
+						businessDeliveryStorageNotice.setHouseId(storeWareDetailList.get(0).getState());
279
+					}else{
280
+						businessDeliveryStorageNotice.setHouseId(storeWareDetailList.get(0).getOrgId());
281
+					}
282
+            
283
+            }
284
+            
285
+            if (businessDeliveryStorageNotice.getId() == null) {
286
+                Map<String, Object> returnMap = deliveryStorageNoticeService.add(businessDeliveryStorageNotice, storeWareDetailList,  userId,  name , orgId, depotInfoOrgId);
287
+                if (returnMap != null && returnMap.get("error") != null) {
288
+                    modelMap.put("status", "error");
289
+                    modelMap.put("msg", returnMap.get("error"));
290
+                    return modelMap;
291
+                }
292
+                modelMap.put("id", returnMap.get("id"));
293
+            } else {
294
+                deliveryStorageNoticeService.update(businessDeliveryStorageNotice, storeWareDetailList);
295
+            }
296
+            modelMap.put("status", "success");
297
+        } catch (Exception e) {
298
+            e.printStackTrace();
299
+            modelMap.put("status", "error");
300
+            modelMap.put("msg", "保存失败!");
301
+            return modelMap;
302
+        }
303
+        return modelMap;
304
+    }
305
+    
306
+    /**
307
+     * 删除(同时删除流程)
308
+     * @param id 主键
309
+     * @param processInstanceId 流程实例id
310
+     * @param deleteReason 删除原因
311
+     * @return
312
+     * @throws JsonParseException
313
+     * @throws JsonMappingException
314
+     * @throws IOException
315
+     */
316
+    @RequestMapping(value="/remove", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
317
+    @ApiOperation(value="通知单删除(同时删除流程)", notes = "删除.")
318
+	@ApiImplicitParams({
319
+		@ApiImplicitParam(name = "id", value = "主键id", paramType = "query"),
320
+		@ApiImplicitParam(name = "processInstanceId", value = "流程实例id", paramType = "query"),
321
+		@ApiImplicitParam(name = "deleteReason", value = "删除原因", paramType = "query"),
322
+        @ApiImplicitParam(name = "planBid", value = "计划id", paramType = "query"),
323
+        @ApiImplicitParam(name = "contractBid", value = "合同id", paramType = "query")
324
+	})
325
+    public Map<String, Object> remove(Integer id, String processInstanceId, String deleteReason,Integer planBid,Integer contractBid) 
326
+            throws JsonParseException, JsonMappingException, IOException {
327
+        Map<String, Object> modelMap = new HashMap<String, Object>();
328
+        if (id != null) {
329
+            deliveryStorageNoticeService.remove(id, processInstanceId, deleteReason,planBid,contractBid);
330
+        }
331
+        modelMap.put("status", "success");
332
+        return modelMap;
333
+    }
334
+    
335
+    /**
336
+     * 提交
337
+     * @param businessDeliveryStorageNotice 业务主体
338
+     * @param assignee 下一个审批人
339
+     * @return
340
+     */
341
+    @RequestMapping(value="/submit", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
342
+	@ApiOperation(value="提交", notes = "提交")
343
+    @ApiImplicitParams({
344
+		@ApiImplicitParam(name = "businessDeliveryStorageNotice", value = "业务主体", paramType = "query"),
345
+		@ApiImplicitParam(name = "assignee", value = "下一个审批人", paramType = "query"),
346
+		@ApiImplicitParam(name = "userId", value = "当前登录人id", paramType = "query"),
347
+		@ApiImplicitParam(name = "realName", value = "当前登录人name", paramType = "query")
348
+	})
349
+    public Map<String, Object> startProcess(BusinessDeliveryStorageNotice businessDeliveryStorageNotice, String assignee,Integer userId,String realName,HttpServletRequest request) {
350
+        //UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
351
+        Map<String, Object> returnMap = deliveryStorageNoticeService.submit(businessDeliveryStorageNotice, assignee, userId, realName);
352
+        return returnMap;
353
+    }
354
+    
355
+    /**
356
+     * 启用
357
+     * @param id 主键.
358
+     * @return
359
+     */
360
+    @RequestMapping(value="/application", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
361
+    @ApiOperation(value="通知单启用", notes = "启用.")
362
+	@ApiImplicitParams({
363
+		@ApiImplicitParam(name = "id", value = "主键id", paramType = "query")
364
+	})
365
+    public Map<String, Object> application(Integer id) {
366
+        Map<String, Object> modelMap = new HashMap<String, Object>();
367
+        Map<String, String> returnMap = deliveryStorageNoticeService.application(id);
368
+        if (StringUtils.isNoneBlank(returnMap.get("error"))) {
369
+            modelMap.put("status", "error");
370
+            modelMap.put("msg", returnMap.get("error"));
371
+        } else {
372
+            modelMap.put("status", "success");
373
+        }
374
+        return modelMap;
375
+    }
376
+    
377
+    /**
378
+     * 暂停
379
+     * @param id 主键.
380
+     * @return
381
+     */
382
+    @RequestMapping(value="/discontinue",produces = MediaType.APPLICATION_JSON_VALUE,  method=RequestMethod.POST)
383
+    @ApiOperation(value="通知单暂停", notes = "暂停.")
384
+	@ApiImplicitParams({
385
+		@ApiImplicitParam(name = "id", value = "主键id", paramType = "query")
386
+	})
387
+    public Map<String, Object> discontinue(Integer id ,String refuseReason) {
388
+        Map<String, Object> modelMap = new HashMap<String, Object>();
389
+        deliveryStorageNoticeService.discontinue(id,refuseReason);
390
+        modelMap.put("status", "success");
391
+        return modelMap;
392
+    }
393
+    
394
+    /**
395
+     * 终止.
396
+     * @param id 主键.
397
+     * @return
398
+     */
399
+    @RequestMapping(value="/finish",produces = MediaType.APPLICATION_JSON_VALUE,  method=RequestMethod.POST)
400
+    @ApiOperation(value="通知单终止", notes = "终止.")
401
+	@ApiImplicitParams({
402
+		@ApiImplicitParam(name = "id", value = "主键id", paramType = "query")
403
+	})
404
+    public Map<String, Object> finish(Integer id,String refuseReason) {
405
+        Map<String, Object> modelMap = new HashMap<String, Object>();
406
+        deliveryStorageNoticeService.finish(id,refuseReason);
407
+        modelMap.put("status", "success");
408
+        return modelMap;
409
+    }
410
+    
411
+    
412
+    /**
413
+     * 中转保存
414
+     * @param deliveryStorageNoticeJson 主表信息
415
+     * @param businessStoreWareDetailJson 明细
416
+     * @return
417
+     * @throws JsonParseException
418
+     * @throws JsonMappingException
419
+     * @throws IOException
420
+     */
421
+    @RequestMapping(value="/addTransfer",produces = MediaType.APPLICATION_JSON_VALUE,  method=RequestMethod.POST)
422
+	@ApiOperation(value="中转保存", notes = "保存")
423
+    @SuppressWarnings("unchecked")
424
+    @ApiImplicitParams({
425
+		@ApiImplicitParam(name = "deliveryStorageNoticeJson", value = "主表数据", paramType = "query"),
426
+		@ApiImplicitParam(name = "businessStoreWareDetailJson", value = "子表数据", paramType = "query"),
427
+		@ApiImplicitParam(name = "userId", value = "当前登录人id", paramType = "query"),
428
+		@ApiImplicitParam(name = "name", value = "当前登录人name", paramType = "query"),
429
+		@ApiImplicitParam(name = "orgId", value = "当前登录人所在组织", paramType = "query")
430
+		
431
+	})
432
+    public Map<String, Object> addTransfer(String deliveryStorageNoticeJson, String businessStoreWareDetailJson, Integer userId, String name ,Integer orgId,HttpServletRequest request) 
433
+            throws JsonParseException, JsonMappingException, IOException {
434
+        Map<String, Object> modelMap = new HashMap<String, Object>();
435
+       /* UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
436
+        OrgInfo depotInfo = (OrgInfo)request.getSession().getAttribute("depotInfo");*/
437
+        try {
438
+            // JSON字符串转对象
439
+            ObjectMapper mapper = new ObjectMapper();
440
+            BusinessDeliveryStorageNotice businessDeliveryStorageNotice = (BusinessDeliveryStorageNotice)mapper.readValue(deliveryStorageNoticeJson, BusinessDeliveryStorageNotice.class);
441
+            businessDeliveryStorageNotice.setHouseId(orgId);
442
+            //List<BusinessStoreWareDetail> storeWareDetailList = null;
443
+            /*if (businessStoreWareDetailJson != null) {
444
+                storeWareDetailList = (List<BusinessStoreWareDetail>)mapper.readValue(businessStoreWareDetailJson, new TypeReference<List<BusinessStoreWareDetail>>(){});
445
+            }*/
446
+            List<BusinessStoreWareDetail> storeWareDetailList = null;
447
+            if (businessStoreWareDetailJson != null) {
448
+                storeWareDetailList = (List<BusinessStoreWareDetail>)mapper.readValue(businessStoreWareDetailJson, new TypeReference<List<BusinessStoreWareDetail>>(){});
449
+                
450
+            }
451
+            
452
+            if (businessDeliveryStorageNotice.getId() == null) {
453
+                Map<String, Object> returnMap = deliveryStorageNoticeService.addTransfer(businessDeliveryStorageNotice, storeWareDetailList,  userId,  name , orgId);
454
+                if (returnMap != null && returnMap.get("error") != null) {
455
+                    modelMap.put("status", "error");
456
+                    modelMap.put("msg", returnMap.get("error"));
457
+                    return modelMap;
458
+                }
459
+            } else {
460
+                //deliveryStorageNoticeService.update(businessDeliveryStorageNotice, storeWareDetailList);
461
+            }
462
+            modelMap.put("status", "success");
463
+        } catch (Exception e) {
464
+            e.printStackTrace();
465
+            modelMap.put("status", "error");
466
+            modelMap.put("msg", "保存失败!");
467
+            return modelMap;
468
+        }
469
+        return modelMap;
470
+    }
471
+    
472
+}

+ 99 - 0
src/main/java/com/chinaitop/depot/business/controller/BusinessFileController.java

@@ -0,0 +1,99 @@
1
+package com.chinaitop.depot.business.controller;
2
+
3
+
4
+import java.io.IOException;
5
+import java.util.HashMap;
6
+import java.util.List;
7
+import java.util.Map;
8
+
9
+import javax.servlet.http.HttpServletRequest;
10
+
11
+import org.springframework.beans.factory.annotation.Autowired;
12
+import org.springframework.http.MediaType;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RequestMethod;
15
+import org.springframework.web.bind.annotation.RestController;
16
+import org.springframework.web.multipart.MultipartFile;
17
+
18
+import com.chinaitop.depot.business.model.BusinessFile;
19
+import com.chinaitop.depot.business.service.BusinessFileService;
20
+import com.fasterxml.jackson.core.JsonParseException;
21
+import com.fasterxml.jackson.databind.JsonMappingException;
22
+
23
+import io.swagger.annotations.Api;
24
+import io.swagger.annotations.ApiImplicitParam;
25
+import io.swagger.annotations.ApiImplicitParams;
26
+import io.swagger.annotations.ApiOperation;
27
+
28
+/**
29
+ * 粮库业务管理-文件
30
+* <p>Title: BusinessPlanController</p>
31
+* <p>Description: </p>
32
+* @author yaoyabin
33
+* @date 2017年12月8日 下午5:43:19
34
+ */
35
+@RestController
36
+@RequestMapping(value="/depot/business/file")
37
+@Api(value= "BusinessFileController", description = "文件")
38
+
39
+public class BusinessFileController {
40
+    @Autowired
41
+    private BusinessFileService businessFileService;
42
+    
43
+    /**
44
+     * 删除.
45
+     * @param id
46
+     * @return
47
+     * @throws JsonParseException
48
+     * @throws JsonMappingException
49
+     * @throws IOException
50
+     */
51
+    @RequestMapping(value="/remove", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
52
+	@ApiOperation(value="删除", notes = "根据id删除")
53
+	@ApiImplicitParams({
54
+		@ApiImplicitParam(name = "id", value = "id", paramType = "form")
55
+	})
56
+    public Map<String, Object> remove(Integer id, HttpServletRequest request) throws JsonParseException, JsonMappingException, IOException {
57
+        Map<String, Object> modelMap = new HashMap<String, Object>();
58
+        // 服务器路径
59
+        String rootPath = request.getSession().getServletContext().getRealPath("");
60
+        if (id != null) {
61
+            businessFileService.remove(id, rootPath);
62
+        }
63
+        modelMap.put("status", "success");
64
+        return modelMap;
65
+    }
66
+    
67
+    
68
+    @RequestMapping(value="/uploadFile")
69
+    public BusinessFile uploadFile(MultipartFile file, String type, Integer bid, Integer userId,Integer orgId,HttpServletRequest request) throws IllegalStateException, IOException {
70
+        BusinessFile businessFile = businessFileService.uploadFile(file,type,bid, userId, orgId);
71
+        return businessFile;
72
+    }
73
+
74
+    @RequestMapping(value="/updateFile", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
75
+    @ApiOperation(value="修改数据", notes = "修改数据保存的文件数据")
76
+    @ApiImplicitParams({
77
+            @ApiImplicitParam(name = "fileIds", value = "文件ID集合", paramType = "form"),
78
+            @ApiImplicitParam(name = "bid", value = "主键id", paramType = "form")
79
+    })
80
+    public void updateFile(String fileIds, Integer bid, String fileType){
81
+        businessFileService.updateFileByFileIdsAndBid(fileIds,bid,fileType);
82
+    }
83
+
84
+    @RequestMapping(value="/getList", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
85
+    @ApiOperation(value="按条件查询附件数据", notes = "按条件查询附件数据")
86
+    @ApiImplicitParams({
87
+    	@ApiImplicitParam(name = "bid", value = "主表id", paramType = "query"),
88
+        @ApiImplicitParam(name = "fileType", value = "文件类型", paramType = "query"),
89
+        @ApiImplicitParam(name = "order", value = "排序方式", paramType = "query"),
90
+        @ApiImplicitParam(name = "orgId", value = "单位id", paramType = "query")
91
+    })
92
+    public List<BusinessFile> getList(Integer bid, String fileType, String order, Integer orgId){
93
+    	List<BusinessFile> list = null;
94
+  
95
+    	list = businessFileService.getByBid(bid, fileType, orgId, order);
96
+
97
+        return list;
98
+    }
99
+}

+ 129 - 0
src/main/java/com/chinaitop/depot/business/controller/BusinessLadingController.java

@@ -0,0 +1,129 @@
1
+package com.chinaitop.depot.business.controller;
2
+
3
+import java.io.IOException;
4
+import java.util.HashMap;
5
+import java.util.List;
6
+import java.util.Map;
7
+
8
+import javax.annotation.Resource;
9
+import javax.servlet.http.HttpServletRequest;
10
+
11
+import org.springframework.http.MediaType;
12
+import org.springframework.web.bind.annotation.RequestMapping;
13
+import org.springframework.web.bind.annotation.RequestMethod;
14
+import org.springframework.web.bind.annotation.RestController;
15
+
16
+import com.chinaitop.depot.business.model.BusinessLading;
17
+import com.chinaitop.depot.business.model.BusinessLadingExample;
18
+import com.chinaitop.depot.business.service.BusinessLadingService;
19
+import com.fasterxml.jackson.core.JsonParseException;
20
+import com.fasterxml.jackson.databind.JsonMappingException;
21
+import com.fasterxml.jackson.databind.ObjectMapper;
22
+import com.github.pagehelper.PageHelper;
23
+import com.github.pagehelper.PageInfo;
24
+
25
+import io.swagger.annotations.Api;
26
+import io.swagger.annotations.ApiImplicitParam;
27
+import io.swagger.annotations.ApiImplicitParams;
28
+import io.swagger.annotations.ApiOperation;
29
+
30
+@RestController
31
+@RequestMapping(value="/depot/business/lading")
32
+@Api(value= "BusinessLadingController", description = "提货单")
33
+
34
+public class BusinessLadingController {
35
+
36
+	@Resource
37
+    private BusinessLadingService ladingService;
38
+	
39
+	/**
40
+     * 列表.
41
+     * @param pageNum 页码
42
+     * @param pageSize 每页显示条数
43
+     * @return
44
+     */
45
+	@RequestMapping(value="/getList", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
46
+	@ApiOperation(value="获取提货单列表信息", notes = "查询数据列表,支持分页")
47
+	@ApiImplicitParams({
48
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
49
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query")
50
+	})
51
+    public PageInfo<BusinessLading> getList(Integer pageNum, Integer pageSize) {
52
+    	BusinessLadingExample example = new BusinessLadingExample();
53
+        example.setOrderByClause("id desc");
54
+        if (pageNum != null && pageSize != null) {
55
+            PageHelper.startPage(pageNum, pageSize);
56
+        }
57
+        List<BusinessLading> list = ladingService.queryByExample(example);    
58
+        PageInfo<BusinessLading> pageInfo = new PageInfo<BusinessLading>(list);
59
+        return pageInfo;
60
+    }
61
+    
62
+    
63
+	/**
64
+	 * 保存
65
+	 * @param ladingJson
66
+	 * @param request
67
+	 * @return
68
+	 * @throws JsonParseException
69
+	 * @throws JsonMappingException
70
+	 * @throws IOException
71
+	 */
72
+	@RequestMapping(value="/save", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
73
+	@ApiOperation(value="保存数据", notes = "保存")
74
+	@ApiImplicitParams({
75
+		@ApiImplicitParam(name = "ladingJson", value = "新增数据", paramType = "query")
76
+	})
77
+    public Map<String, Object> save(String ladingJson, HttpServletRequest request)
78
+            throws JsonParseException, JsonMappingException, IOException {
79
+        Map<String, Object> modelMap = new HashMap<String, Object>();
80
+        try {
81
+           /* // 用户信息.
82
+            UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
83
+            Integer userId = userInfo.getUserId();
84
+            // 组织机构信息.
85
+            OrgInfo depotInfo = (OrgInfo)request.getSession().getAttribute("depotInfo");*/
86
+            
87
+            // JSON字符串转对象
88
+            ObjectMapper mapper = new ObjectMapper();
89
+            BusinessLading lading = (BusinessLading)mapper.readValue(ladingJson, BusinessLading.class);
90
+            if (lading.getId() == null) {
91
+                Map<String, Object> returnMap = ladingService.add(lading);
92
+                if (returnMap != null && returnMap.get("error") != null) {
93
+                    modelMap.put("status", "error");
94
+                    modelMap.put("msg", returnMap.get("error"));
95
+                    return modelMap;
96
+                }
97
+            } else {
98
+                modelMap = ladingService.update(lading);
99
+            }
100
+            modelMap.put("status", "success");
101
+        } catch (Exception e) {
102
+            e.printStackTrace();
103
+            modelMap.put("status", "error");
104
+            modelMap.put("msg", "保存失败!");
105
+        }
106
+        return modelMap;
107
+    }
108
+    
109
+	/**
110
+     * 根据id查询.
111
+     * @param id 主键
112
+     * @return
113
+     */
114
+	@RequestMapping(value="/edit", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
115
+	@ApiOperation(value="根据id查找", notes = "根据id查找")
116
+	@ApiImplicitParams({
117
+		@ApiImplicitParam(name = "id", value = "主键id", paramType = "query")
118
+	})
119
+    public BusinessLading edit(Integer id) {
120
+    	BusinessLading lading = new BusinessLading();
121
+        if (id != null) {
122
+        	lading = ladingService.findById(id);
123
+        }
124
+        return lading;
125
+    }
126
+
127
+	
128
+	
129
+}

+ 648 - 0
src/main/java/com/chinaitop/depot/business/controller/BusinessPlanController.java

@@ -0,0 +1,648 @@
1
+package com.chinaitop.depot.business.controller;
2
+
3
+
4
+import com.chinaitop.depot.business.model.BusinessFile;
5
+import com.chinaitop.depot.business.model.BusinessPlan;
6
+import com.chinaitop.depot.business.model.BusinessStoreWareDetail;
7
+import com.chinaitop.depot.business.model.enums.AuditType;
8
+import com.chinaitop.depot.business.model.enums.StoreWareType;
9
+import com.chinaitop.depot.business.model.vo.BusinessPlanAuditVO;
10
+import com.chinaitop.depot.business.service.BusinessFileService;
11
+import com.chinaitop.depot.business.service.BusinessPlanService;
12
+import com.chinaitop.depot.business.service.BusinessStoreWareDetailService;
13
+import com.chinaitop.depot.utils.HTTPUtils;
14
+import com.fasterxml.jackson.core.JsonParseException;
15
+import com.fasterxml.jackson.core.type.TypeReference;
16
+import com.fasterxml.jackson.databind.JsonMappingException;
17
+import com.fasterxml.jackson.databind.ObjectMapper;
18
+import com.github.pagehelper.PageHelper;
19
+import com.github.pagehelper.PageInfo;
20
+import io.swagger.annotations.Api;
21
+import io.swagger.annotations.ApiImplicitParam;
22
+import io.swagger.annotations.ApiImplicitParams;
23
+import io.swagger.annotations.ApiOperation;
24
+import org.springframework.beans.factory.annotation.Autowired;
25
+import org.springframework.beans.factory.annotation.Value;
26
+import org.springframework.http.MediaType;
27
+import org.springframework.web.bind.annotation.RequestMapping;
28
+import org.springframework.web.bind.annotation.RequestMethod;
29
+import org.springframework.web.bind.annotation.RestController;
30
+
31
+import javax.annotation.Resource;
32
+import javax.servlet.http.HttpServletRequest;
33
+import java.io.IOException;
34
+import java.net.URLEncoder;
35
+import java.util.ArrayList;
36
+import java.util.Date;
37
+import java.util.HashMap;
38
+import java.util.List;
39
+import java.util.Map;
40
+
41
+/**
42
+ * 粮库业务管理-计划管理
43
+ * <p>Title: BusinessPlanController</p>
44
+ * <p>Description: </p>
45
+ * @author yaoyabin
46
+ * @date 2017年10月25日 下午5:43:19
47
+ */
48
+@RestController
49
+@RequestMapping(value="/depot/business/plan")
50
+@Api(value= "BusinessPlanController", description = "计划管理")
51
+
52
+public class BusinessPlanController {
53
+
54
+    @Resource
55
+    private BusinessPlanService businessPlanService;
56
+    @Autowired
57
+    private BusinessFileService businessFileService;
58
+    @Resource
59
+    private BusinessStoreWareDetailService businessStoreWareDetailService;
60
+
61
+    // 获取ip地址
62
+    @Value("${reportUrl}")
63
+    private String reportPath;
64
+
65
+    /**
66
+     * 查找申请列表
67
+     * @param pageNum  页码
68
+     * @param pageSize 每页显示条数
69
+     * @return
70
+     * @throws Exception
71
+     */
72
+    @RequestMapping(value="/getList",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
73
+    @ApiOperation(value="计划申请列表", notes = "查询数据列表,支持分页")
74
+    @ApiImplicitParams({
75
+            @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
76
+            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
77
+            @ApiImplicitParam(name = "userId", value = "当前登录的用户编号", paramType = "query")
78
+    })
79
+    public PageInfo<BusinessPlan> getList(Integer pageNum, Integer pageSize, Integer userId ,HttpServletRequest request, BusinessPlan businessPlan) throws Exception {
80
+
81
+        // Integer userId = userInfo.getUserId();
82
+        List<BusinessPlan> list = businessPlanService.queryByExample(pageNum, pageSize, userId, businessPlan, "FIELD(audit_state,0,3,1,2,4 ), id desc", null);
83
+        PageInfo<BusinessPlan> pageInfo = new PageInfo<BusinessPlan>(list);
84
+        return pageInfo;
85
+    }
86
+
87
+    /**
88
+     * 审批通过列表
89
+     * @param pageNum 页码
90
+     * @param pageSize 每页显示条数
91
+     * @return
92
+     */
93
+    @RequestMapping(value="/getAuditPassList",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
94
+    @ApiOperation(value="计划审批通过列表", notes = "查询数据列表,支持分页")
95
+    @ApiImplicitParams({
96
+            @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
97
+            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query")
98
+    })
99
+    public PageInfo<BusinessPlan> getAuditPassList(Integer pageNum, Integer pageSize, BusinessPlan businessPlan, Integer billType) {
100
+        // 可以查询所有人通过的计划,必须是应用的.
101
+        businessPlan.setAuditState(AuditType.AGREE.getAuditCode());
102
+        List<BusinessPlan> list = businessPlanService.queryByExample(pageNum, pageSize, null, businessPlan, " agree_time desc", billType);
103
+        PageInfo<BusinessPlan> pageInfo = new PageInfo<BusinessPlan>(list);
104
+        return pageInfo;
105
+    }
106
+
107
+    /**
108
+     * 获取进度列表.
109
+     * @param pageNum
110
+     * @param pageSize
111
+     * @param businessPlan
112
+     * @return
113
+     */
114
+    @RequestMapping(value="/getScheduleList",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
115
+    @ApiOperation(value="获取计划进度列表", notes = "查询数据列表,支持分页")
116
+    @ApiImplicitParams({
117
+            @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
118
+            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query")
119
+    })
120
+    public PageInfo<BusinessPlanAuditVO> getScheduleList(Integer pageNum, Integer pageSize, BusinessPlan businessPlan) {
121
+        PageInfo<BusinessPlanAuditVO> pageInfo = businessPlanService.getScheduleList(pageNum, pageSize, businessPlan);
122
+        return pageInfo;
123
+    }
124
+
125
+    /**
126
+     * 根据id查询
127
+     * @param id 主键
128
+     * @return
129
+     */
130
+    @RequestMapping(value="/edit", produces = MediaType.APPLICATION_JSON_VALUE,method=RequestMethod.GET)
131
+    @ApiOperation(value="根据计划id查找信息", notes = "根据id查找")
132
+    @ApiImplicitParams({
133
+            @ApiImplicitParam(name = "id", value = "计划id", paramType = "query")
134
+    })
135
+    public Map<String, Object> edit(Integer id) {
136
+        Map<String, Object> modelMap = new HashMap<String, Object>();
137
+        BusinessPlan businessPlan = new BusinessPlan();
138
+        if (id != null) {
139
+            businessPlan = businessPlanService.findById(id);
140
+            // 获取对应的文件.
141
+            List<BusinessFile> fileList= businessFileService.getByBid(id, "plan", null, null);
142
+            modelMap.put("fileList", fileList);
143
+        }else{
144
+            businessPlan=new BusinessPlan();
145
+        }
146
+        modelMap.put("plan", businessPlan);
147
+
148
+        return modelMap;
149
+    }
150
+
151
+    /**
152
+     * 保存
153
+     * @param businessPlanJson 计划json
154
+     * @return
155
+     * @throws JsonParseException
156
+     * @throws JsonMappingException
157
+     * @throws IOException
158
+     */
159
+    @RequestMapping(value="/save",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
160
+    @ApiOperation(value="保存数据", notes = "保存")
161
+    @SuppressWarnings("unchecked")
162
+    @ApiImplicitParams({
163
+            @ApiImplicitParam(name="businessPlanJson", value="主表数据", paramType="form"),
164
+            @ApiImplicitParam(name="businessStoreWareDetailJson", value="子表数据", paramType="form"),
165
+            @ApiImplicitParam(name="fileIds", value="文件数据", paramType="form"),
166
+            @ApiImplicitParam(name="userId", value="当前登录人的id", paramType="form"),
167
+            @ApiImplicitParam(name="orgId", value="当前登录人的组织id", paramType="form"),
168
+            @ApiImplicitParam(name="name", value="当前登录人的name", paramType="form"),
169
+            @ApiImplicitParam(name="depotInfoOrgId", value="当前登录人的组织id", paramType="form")
170
+    })
171
+    public Map<String, Object> save(String businessPlanJson, String businessStoreWareDetailJson,
172
+                                    String fileIds, String deleteFileIds, Integer userId , Integer orgId ,String name ,Integer depotInfoOrgId,
173
+                                    HttpServletRequest request) throws JsonParseException, JsonMappingException, IOException {
174
+        Map<String, Object> modelMap = new HashMap<String, Object>();
175
+       /* UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
176
+        OrgInfo depotInfo = (OrgInfo)request.getSession().getAttribute("depotInfo");*/
177
+        try {
178
+            // JSON字符串转对象
179
+            ObjectMapper mapper = new ObjectMapper();
180
+            BusinessPlan businessPlan = (BusinessPlan)mapper.readValue(businessPlanJson, BusinessPlan.class);
181
+
182
+            List<BusinessStoreWareDetail> storeWareDetailList = null;
183
+            if (businessStoreWareDetailJson != null) {
184
+                storeWareDetailList = (List<BusinessStoreWareDetail>)mapper.readValue(businessStoreWareDetailJson, new TypeReference<List<BusinessStoreWareDetail>>(){});
185
+            }
186
+
187
+            if (businessPlan.getId() == null) {
188
+                Map<String, Object> returnMap = businessPlanService.add(businessPlan, storeWareDetailList, fileIds , userId ,  orgId , name , depotInfoOrgId);
189
+                if (returnMap.get("error") != null) {
190
+                    modelMap.put("status", "error");
191
+                    modelMap.put("msg", returnMap.get("error"));
192
+                    return modelMap;
193
+                }
194
+                modelMap.put("id", returnMap.get("id"));
195
+            } else {
196
+                businessPlanService.update(businessPlan, storeWareDetailList, fileIds, deleteFileIds);
197
+            }
198
+            modelMap.put("status", "success");
199
+        } catch (Exception e) {
200
+            e.printStackTrace();
201
+            modelMap.put("status", "error");
202
+            modelMap.put("msg", "保存失败!");
203
+            return modelMap;
204
+        }
205
+        return modelMap;
206
+    }
207
+
208
+    /**
209
+     * 删除(同时删除流程)
210
+     * @param id 主键
211
+     * @param processInstanceId 流程实例id
212
+     * @param deleteReason 删除原因
213
+     * @return
214
+     * @throws JsonParseException
215
+     * @throws JsonMappingException
216
+     * @throws IOException
217
+     */
218
+    @RequestMapping(value="/remove", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
219
+    @ApiOperation(value="删除(同时删除流程)", notes = "根据id删除")
220
+    @ApiImplicitParams({
221
+            @ApiImplicitParam(name = "id", value = "计划id", paramType = "query"),
222
+            @ApiImplicitParam(name = "processInstanceId", value = "流程实例id", paramType = "query")
223
+    })
224
+    public Map<String, Object> remove(Integer id, String processInstanceId, String deleteReason, HttpServletRequest request)
225
+            throws JsonParseException, JsonMappingException, IOException {
226
+        Map<String, Object> modelMap = new HashMap<String, Object>();
227
+        // 服务器路径
228
+        String rootPath = request.getSession().getServletContext().getRealPath("");
229
+        if (id != null) {
230
+            businessPlanService.remove(id, processInstanceId, deleteReason, rootPath);
231
+        }
232
+        modelMap.put("status", "success");
233
+        return modelMap;
234
+    }
235
+
236
+    /**
237
+     * 提交
238
+     * @param businessDeliveryStorageNotice 业务主体
239
+     * @param assignee 下一个审批人
240
+     * @return
241
+     */
242
+    @RequestMapping(value="/submit",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
243
+    @ApiOperation(value="计划提交", notes = "计划提交")
244
+    @ApiImplicitParams({
245
+            @ApiImplicitParam(name = "id", value = "计划id", paramType = "query"),
246
+            @ApiImplicitParam(name = "assignee", value = "下一个审批人", paramType = "query"),
247
+            @ApiImplicitParam(name = "userId", value = "当前登录人的id", paramType = "query"),
248
+            @ApiImplicitParam(name = "realName", value = "当前登录人姓名", paramType = "query")
249
+    })
250
+    public Map<String, Object> submit(Integer id, String assignee,Integer userId , String realName ,HttpServletRequest request) {
251
+        // UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
252
+        Map<String, Object> returnMap = businessPlanService.submit(id, assignee,userId ,realName);
253
+        return returnMap;
254
+    }
255
+
256
+    /**
257
+     * 启用
258
+     * @param id 主键.
259
+     * @return
260
+     */
261
+    @RequestMapping(value="/application", produces = MediaType.APPLICATION_JSON_VALUE,method=RequestMethod.POST)
262
+    @ApiOperation(value="计划启用", notes = "计划启用")
263
+    @ApiImplicitParams({
264
+            @ApiImplicitParam(name = "id", value = "计划id", paramType = "query")
265
+    })
266
+    public Map<String, Object> application(Integer id) {
267
+        Map<String, Object> modelMap = new HashMap<String, Object>();
268
+        businessPlanService.application(id);
269
+        modelMap.put("status", "success");
270
+        return modelMap;
271
+    }
272
+
273
+    /**
274
+     * 暂停
275
+     * @param id 主键.
276
+     * @return
277
+     */
278
+    @RequestMapping(value="/discontinue", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
279
+    @ApiOperation(value="计划暂停", notes = "计划暂停")
280
+    @ApiImplicitParams({
281
+            @ApiImplicitParam(name = "id", value = "计划id", paramType = "query")
282
+    })
283
+    public Map<String, Object> discontinue(Integer id,String refuseReason) {
284
+        Map<String, Object> modelMap = new HashMap<String, Object>();
285
+        businessPlanService.discontinue(id,refuseReason);
286
+        modelMap.put("status", "success");
287
+        return modelMap;
288
+    }
289
+
290
+    /**
291
+     * 终止
292
+     * @param id 主键.
293
+     * @return
294
+     */
295
+    @RequestMapping(value="/finish", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
296
+    @ApiOperation(value="计划终止", notes = "计划终止")
297
+    @ApiImplicitParams({
298
+            @ApiImplicitParam(name = "id", value = "计划id", paramType = "query")
299
+    })
300
+    public Map<String, Object> finish(Integer id,String refuseReason) {
301
+        Map<String, Object> modelMap = new HashMap<String, Object>();
302
+        businessPlanService.finish(id,refuseReason);
303
+        modelMap.put("status", "success");
304
+        return modelMap;
305
+    }
306
+
307
+    /**
308
+     * 校验计划编号,是否可用.
309
+     * @param id 主键.
310
+     * @param planNumber 计划编号.
311
+     * @return
312
+     */
313
+    @RequestMapping(value="/validPlanNumber", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
314
+    @ApiOperation(value="校验计划编号,是否可用", notes = "校验计划编号,是否可用")
315
+    @ApiImplicitParams({
316
+            @ApiImplicitParam(name = "id", value = "计划id", paramType = "query"),
317
+            @ApiImplicitParam(name = "planNumber", value = "计划编号", paramType = "query")
318
+    })
319
+    public Boolean validPlanNumber(Integer id, String planNumber) {
320
+        return businessPlanService.validPlanNumber(id, planNumber);
321
+    }
322
+
323
+
324
+    /**
325
+     * 根据id查询追溯数据.
326
+     * @param id 主键
327
+     * @return
328
+     */
329
+    @RequestMapping(value="/getSynthInfo", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
330
+    @ApiOperation(value="根据id查询计划追溯数据", notes = "根据id查找")
331
+    @ApiImplicitParams({
332
+            @ApiImplicitParam(name = "id", value = "计划id", paramType = "query")
333
+    })
334
+    public Map<String, Object> getSynthInfo(Integer id) {
335
+        Map<String, Object> modelMap = new HashMap<String, Object>();
336
+        if (id != null) {
337
+            modelMap = businessPlanService.getSynthInfo(id);
338
+        }
339
+        return modelMap;
340
+    }
341
+
342
+    /**
343
+     * 计划已上报的列表展示(省)
344
+     * @param pageNum
345
+     * @param pageSize
346
+     * @param userId
347
+     * @param request
348
+     * @param businessPlan
349
+     * @return
350
+     * @throws Exception
351
+     */
352
+    @RequestMapping(value="/getReportList", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
353
+    @ApiOperation(value="计划已上报列表", notes = "查询数据列表,支持分页")
354
+    @ApiImplicitParams({
355
+            @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
356
+            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
357
+            @ApiImplicitParam(name = "userId", value = "当前登录人的id", paramType = "query")
358
+    })
359
+    public PageInfo<BusinessPlan> getReportList(Integer pageNum, Integer pageSize, Integer userId ,HttpServletRequest request, BusinessPlan businessPlan) throws Exception {
360
+
361
+        // 可以查询所有人通过的计划,必须是应用的.
362
+        businessPlan.setAuditState(AuditType.AGREE.getAuditCode());
363
+        List<BusinessPlan> list = businessPlanService.queryReportByExample(pageNum, pageSize, userId, businessPlan);
364
+        for (BusinessPlan plan : list) {
365
+            int id=plan.getId();
366
+            List<BusinessStoreWareDetail> storeWareDetailList= businessStoreWareDetailService.getByZidAndType(id, StoreWareType.plan.getValue());
367
+            int grainAttribute = storeWareDetailList.get(0).getGrainAttribute();
368
+            plan.setGrainAttributeByfirst(String.valueOf(grainAttribute));
369
+        }
370
+        PageInfo<BusinessPlan> pageInfo = new PageInfo<BusinessPlan>(list);
371
+        return pageInfo;
372
+    }
373
+
374
+
375
+    /**
376
+     * 计划已上报的列表的查看(省)
377
+     * @param pageNum
378
+     * @param pageSize
379
+     * @param userId
380
+     * @param request
381
+     * @param businessPlan
382
+     * @return
383
+     * @throws Exception
384
+     */
385
+    @RequestMapping(value="/getReportEduit", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
386
+    @ApiOperation(value="计划已上报列表查看", notes = "计划已上报列表查看")
387
+    @ApiImplicitParams({
388
+            @ApiImplicitParam(name = "id", value = "计划id", paramType = "query"),
389
+            @ApiImplicitParam(name = "userName", value = "当前登录人的姓名", paramType = "query")
390
+    })
391
+    public Map<String, Object> getReportEduit(Integer id,String userName) throws Exception {
392
+
393
+        Map<String, Object> modelMap = new HashMap<String, Object>();
394
+        // 详情.
395
+        BusinessPlan plan = businessPlanService.findById(id);
396
+        modelMap.put("plan", plan);
397
+
398
+        // 获取对应的文件.
399
+        List<BusinessFile> fileList= businessFileService.getByBid(id, "plan", null, null);
400
+
401
+        modelMap.put("fileList", fileList);
402
+
403
+        // 仓号货位号数量质量标准.
404
+        List<BusinessStoreWareDetail> storeWareDetailList= businessStoreWareDetailService.getByZidAndType(id, StoreWareType.plan.getValue());
405
+        modelMap.put("storeWareDetailList", storeWareDetailList);
406
+        return modelMap;
407
+    }
408
+
409
+
410
+    /**
411
+     * 上报 修改状态
412
+     * @param id
413
+     * @param request
414
+     * @return
415
+     */
416
+    @RequestMapping(value="/updatePlanStatus", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
417
+    @ApiOperation(value="修改计划上报状态", notes = "修改计划上报状态")
418
+    @ApiImplicitParams({
419
+            @ApiImplicitParam(name = "id", value = "计划id", paramType = "query"),
420
+            @ApiImplicitParam(name = "status", value = "计划状态", paramType = "query")
421
+    })
422
+    public Map<String, Object> updatePlanStatus(Integer id,Integer status,String totalQuantity,String enterpriseRemark,String provinceRemark) {
423
+        Map<String, Object> modelMap = new HashMap<String, Object>();
424
+        BusinessPlan plan = new BusinessPlan();
425
+        try {
426
+            if(id!=null && status!=null){
427
+            	Date date = new Date();
428
+                plan.setId(id);
429
+                if(status==10){ //上报的状态
430
+                    plan.setReportDate(date);
431
+                }
432
+                if(status==40){ //下发的状态
433
+                    plan.setSendDate(date);
434
+                }
435
+                plan.setCustomerPlanState(String.valueOf(status));
436
+                if(totalQuantity!=null){
437
+                	plan.setTotalQuantity(totalQuantity);
438
+                }
439
+                if(enterpriseRemark!=null){
440
+                	plan.setEnterpriseRemark(enterpriseRemark);
441
+                }
442
+                if(provinceRemark!=null){
443
+                	plan.setProvinceRemark(provinceRemark);
444
+                }
445
+                businessPlanService.updatePlanStatus(plan);
446
+                modelMap.put("plan", plan);
447
+                modelMap.put("status", "success");
448
+            }else{
449
+                throw new RuntimeException("id或status无值");
450
+            }
451
+        } catch (Exception e) {
452
+            // TODO Auto-generated catch block
453
+            e.printStackTrace();
454
+            modelMap.put("status", "error");
455
+            modelMap.put("msg", "保存失败!");
456
+        }
457
+
458
+        return modelMap;
459
+
460
+    }
461
+
462
+
463
+    /**
464
+     *
465
+     * 验收申请
466
+     * @return
467
+     * @throws Exception
468
+     */
469
+    @RequestMapping(value="/acceptanceSave",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
470
+    @ApiOperation(value="计划申请列表", notes = "查询数据列表,支持分页")
471
+    @ApiImplicitParams({
472
+            @ApiImplicitParam(name = "planJson", value = "计划", paramType = "query"),
473
+            @ApiImplicitParam(name = "houseJson", value = "明细信息", paramType = "query"),
474
+            @ApiImplicitParam(name = "fileJson", value = "文件", paramType = "query")
475
+    })
476
+    public Map<String, Object> acceptanceSave(String planJson, String houseJson, String fileJson) throws Exception {
477
+        // Integer userId = userInfo.getUserId();
478
+        Map<String, Object> modelMap = new HashMap<String, Object>();
479
+        StringBuffer req = new StringBuffer();
480
+        try {
481
+            String plan = URLEncoder.encode(planJson, "UTF-8");
482
+            String house = URLEncoder.encode(houseJson, "UTF-8");
483
+            String file = URLEncoder.encode(fileJson, "UTF-8");
484
+
485
+
486
+            String url = reportPath+"/business-management/businessPlan/houseSave";
487
+
488
+            String count= HTTPUtils.doGet(url+"?planJson="+plan+"&houseJson="+house+"&fileJson="+file);
489
+            System.out.println(count+"********验收***"+reportPath+"地址");
490
+            if(count.contains("Success") || count.contains("200")){
491
+                modelMap.put("status", "success");
492
+                modelMap.put("msg", "成功!");
493
+            }
494
+
495
+        } catch (Exception e){
496
+            // req.append("?data=");
497
+            e.printStackTrace();
498
+            modelMap.put("status", "error");
499
+            modelMap.put("msg", "保存失败!");
500
+        }
501
+
502
+        return modelMap;
503
+    }
504
+
505
+
506
+    /**
507
+     *
508
+     * 上报申请
509
+     * @return
510
+     * @throws Exception
511
+     */
512
+    @RequestMapping(value="/reportSave",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
513
+    @ApiOperation(value="计划申请列表", notes = "查询数据列表,支持分页")
514
+    @ApiImplicitParams({
515
+            @ApiImplicitParam(name = "businessPlan", value = "计划", paramType = "query")
516
+
517
+    })
518
+    public Map<String, Object> reportSave(String businessPlan) throws Exception {
519
+        // Integer userId = userInfo.getUserId();
520
+        Map<String, Object> modelMap = new HashMap<String, Object>();
521
+        StringBuffer req = new StringBuffer();
522
+        try {
523
+            String plan = URLEncoder.encode(businessPlan, "UTF-8");
524
+
525
+            String url = reportPath+"/business-management/businessPlan/save";
526
+
527
+            String count= HTTPUtils.doGet(url+"?businessPlan="+plan);
528
+            System.out.println(count+"********上报*****"+reportPath+"地址");
529
+            if(count.contains("Success") || count.contains("200")){
530
+                modelMap.put("status", "success");
531
+                modelMap.put("msg", "成功!");
532
+            }
533
+        } catch (Exception e){
534
+            // req.append("?data=");
535
+            e.printStackTrace();
536
+            modelMap.put("status", "error");
537
+            modelMap.put("msg", "保存失败!");
538
+        }
539
+
540
+        return modelMap;
541
+    }
542
+
543
+    /**
544
+     * 验收列表
545
+     * @param pageNum 页码
546
+     * @param pageSize 每页显示条数
547
+     * @return
548
+     */
549
+    @RequestMapping(value="/getAcceptanceList",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
550
+    @ApiOperation(value="计划审批通过列表", notes = "查询数据列表,支持分页")
551
+    @ApiImplicitParams({
552
+            @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
553
+            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query")
554
+    })
555
+    public PageInfo<Map<String, Object>> getAcceptanceList(Integer pageNum, Integer pageSize, BusinessPlan businessPlan,Integer userId,Integer orgId) {
556
+       
557
+    	Map<String, Object> map = new HashMap<String, Object>();
558
+    	map.put("orgId", orgId);
559
+    	map.put("userId", userId);
560
+    	if(null != businessPlan.getPlanNumber()){
561
+    		map.put("planNumber", businessPlan.getPlanNumber());
562
+    	}
563
+    	if(null != businessPlan.getPlanTitle()){
564
+    		map.put("planTitle", businessPlan.getPlanTitle());
565
+    	}
566
+    	if(null != businessPlan.getCustomerPlanState()){
567
+    		map.put("customerPlanState", businessPlan.getCustomerPlanState());
568
+    	}
569
+    	if(null != pageNum && null != pageSize){
570
+			PageHelper.startPage(pageNum, pageSize);
571
+		}
572
+    	
573
+        List<Map<String, Object>> list = businessPlanService.queryAcceptanceList(map);
574
+        
575
+        PageInfo<Map<String, Object>> pageInfo = new PageInfo<Map<String, Object>>(list);
576
+        return pageInfo;
577
+    }
578
+    
579
+    /**
580
+     * 架空期查询数据
581
+     * @param pageNum 页码
582
+     * @param pageSize 每页显示条数
583
+     * @return
584
+     */
585
+    @RequestMapping(value="/getJkqPlanNumberList",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
586
+    @ApiOperation(value="架空期数据查询", notes = "架空期数据查询")
587
+    @ApiImplicitParams({
588
+            @ApiImplicitParam(name = "executeType", value = "轮换计划", paramType = "query")
589
+    })
590
+    public PageInfo<Map<String, Object>> getJkqPlanNumberList(HttpServletRequest request, Integer pageNum, Integer pageSize,
591
+    		String applyTimeA, String applyTimeB, String lhEndA, String lhEndB) {
592
+       
593
+    	Integer orgId = (Integer) request.getSession().getAttribute("orgId");
594
+    	List<Map<String, Object>> countList = new ArrayList<Map<String, Object>>();
595
+    	List<Map<String, Object>> lastList = new ArrayList<Map<String, Object>>();
596
+    	Map<String, Object> map = new HashMap<String, Object>();
597
+    	map.put("orgId", orgId);
598
+    	map.put("executeType", 3156);
599
+    	map.put("cjsjA", applyTimeA);
600
+    	map.put("cjsjB", applyTimeB);
601
+    	map.put("rqA", lhEndA);
602
+    	map.put("rqB", lhEndB);
603
+        List<Map<String, Object>> list = businessPlanService.getjkqPlanList(map);
604
+        for (Map<String, Object> countMap : list) {
605
+        	countMap.put("orgId", orgId);
606
+        	countMap.put("executeType", 3156);
607
+        	countMap.put("cjsjA", applyTimeA);
608
+        	countMap.put("cjsjB", applyTimeB);
609
+        	countMap.put("rqA", lhEndA);
610
+        	countMap.put("rqB", lhEndB);
611
+			countList = businessPlanService.getjkqPlanDayList(countMap);
612
+			for (Map<String, Object> lastMap : countList) {
613
+				if(lastMap != null && !lastMap.isEmpty() && lastMap.get("jkqEnd") !=null) {
614
+				lastList.add(lastMap);
615
+				}
616
+        	}
617
+		}
618
+        PageInfo<Map<String, Object>> pageInfo = new PageInfo<Map<String, Object>>(lastList);
619
+        return pageInfo;
620
+    }
621
+    
622
+    /**
623
+     * 架空期查询轮入数据
624
+     * @return
625
+     */
626
+    @RequestMapping(value="/getJkqPlanDayList",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
627
+    @ApiOperation(value="架空期查询轮入数据", notes = "架空期查询轮入数据")
628
+    @ApiImplicitParams({
629
+            @ApiImplicitParam(name = "executeType", value = "轮换计划", paramType = "query")
630
+    })
631
+    public PageInfo<Map<String, Object>> getJkqPlanDayList(HttpServletRequest request, Integer pageNum, Integer pageSize, Integer houseId, Integer warHouseId) {
632
+       
633
+    	Integer orgId = (Integer) request.getSession().getAttribute("orgId");
634
+    	Map<String, Object> map = new HashMap<String, Object>();
635
+    	map.put("orgId", orgId);
636
+    	map.put("executeType", 3156);
637
+    	map.put("billType", 3);
638
+    	map.put("ch", houseId);
639
+    	map.put("hwh", warHouseId);
640
+    	if(null != pageNum && null != pageSize){
641
+			PageHelper.startPage(pageNum, pageSize);
642
+		}
643
+        List<Map<String, Object>> list = businessPlanService.getjkqPlanDayList(map);
644
+        PageInfo<Map<String, Object>> pageInfo = new PageInfo<Map<String, Object>>(list);
645
+        return pageInfo;
646
+    }
647
+    
648
+}

+ 222 - 0
src/main/java/com/chinaitop/depot/business/controller/BusinessStoreWareDetailController.java

@@ -0,0 +1,222 @@
1
+package com.chinaitop.depot.business.controller;
2
+
3
+
4
+import java.io.IOException;
5
+import java.util.ArrayList;
6
+import java.util.HashMap;
7
+import java.util.List;
8
+import java.util.Map;
9
+
10
+import javax.annotation.Resource;
11
+
12
+import org.apache.commons.lang3.StringUtils;
13
+import org.springframework.http.MediaType;
14
+import org.springframework.web.bind.annotation.RequestMapping;
15
+import org.springframework.web.bind.annotation.RequestMethod;
16
+import org.springframework.web.bind.annotation.RestController;
17
+
18
+import com.chinaitop.depot.business.model.BusinessStoreWareDetail;
19
+import com.chinaitop.depot.business.service.BusinessContractService;
20
+import com.chinaitop.depot.business.service.BusinessStoreWareDetailService;
21
+import com.fasterxml.jackson.core.JsonParseException;
22
+import com.fasterxml.jackson.databind.JsonMappingException;
23
+
24
+import io.swagger.annotations.Api;
25
+import io.swagger.annotations.ApiImplicitParam;
26
+import io.swagger.annotations.ApiImplicitParams;
27
+import io.swagger.annotations.ApiOperation;
28
+
29
+/**
30
+ * 粮库业务管理-计划合同通知单-子表
31
+* <p>Title: BusinessStoreWareDetailController</p>
32
+* <p>Description: </p>
33
+* @author yaoyabin
34
+* @date 2017年12月20日 下午7:42:10
35
+ */
36
+@RestController
37
+@RequestMapping(value="/depot/business/storeWareDetail")
38
+@Api(value= "BusinessStoreWareDetailController", description = "计划合同通知单-子表")
39
+
40
+public class BusinessStoreWareDetailController {
41
+    
42
+    @Resource
43
+    private BusinessStoreWareDetailService detailService;
44
+    
45
+    @Resource
46
+    private BusinessContractService contractService;
47
+    
48
+    
49
+    /**
50
+     * 删除
51
+     * @param id 主键
52
+     * @return
53
+     * @throws JsonParseException
54
+     * @throws JsonMappingException
55
+     * @throws IOException
56
+     */
57
+    @RequestMapping(value="/remove",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
58
+	@ApiOperation(value="删除", notes = "根据id删除")
59
+	@ApiImplicitParams({
60
+		@ApiImplicitParam(name = "id", value = "计划合同通知单子表id", paramType = "query")
61
+	})
62
+    public Map<String, Object> remove(Integer id) throws JsonParseException, JsonMappingException, IOException {
63
+        Map<String, Object> modelMap = new HashMap<String, Object>();
64
+        if (id != null) {
65
+        	detailService.remove(id);
66
+        }
67
+        modelMap.put("status", "success");
68
+        return modelMap;
69
+    }
70
+    
71
+    
72
+    @RequestMapping(value="/getByZidAndType", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
73
+	@ApiOperation(value="根据条件查找", notes = "根据条件查找")
74
+	@ApiImplicitParams({
75
+		@ApiImplicitParam(name = "zid", value = "关联的主表id", paramType = "query"),
76
+		@ApiImplicitParam(name = "type", value = "类型", paramType = "query")
77
+	})
78
+    public Map<String, Object> getByZidAndType(Integer zid, String type) throws JsonParseException, JsonMappingException, IOException {
79
+        Map<String, Object> modelMap = new HashMap<String, Object>();
80
+        try {
81
+            if (zid != null && StringUtils.isNotBlank(type)) {
82
+                List<BusinessStoreWareDetail> list = new ArrayList<BusinessStoreWareDetail>();
83
+                Map<String, Object> param_map = new HashMap<String, Object>();
84
+                List<Map<String, Object>> map = null;
85
+                if (!"plan".equals(type)) {
86
+                	list = detailService.getByZidAndType(zid, "contract");
87
+        			param_map.put("contract_id", zid);
88
+        			map = detailService.selectContractUseCount(param_map);
89
+                } else {
90
+                	list = detailService.getByZidAndType(zid, "plan");
91
+                	param_map.put("plan_id", zid);
92
+                	map = detailService.selectPlanUseCount(param_map);
93
+                }
94
+                BusinessStoreWareDetail obj = null;
95
+                double sysl = 0d;
96
+                double sum_use_num = 0d; //已使用总量
97
+                double plan_sum_num = 0d; //原计划数量
98
+                for (int i = 0; i < list.size(); i++) {
99
+                	obj = list.get(i);
100
+                	if (map.size() > 0) {
101
+                		for (Map<String, Object> m : map) {
102
+                			if (m.get("house_id").equals(obj.getHouseId()) && m.get("warehouse_id").equals(obj.getWarehouseId())) {
103
+                				if (!"".equals(m.get("in_count")) && null != m.get("in_count")) {
104
+                					if (!"".equals(obj.getInCount()) && null != obj.getInCount()) {
105
+                						plan_sum_num = Double.parseDouble(obj.getInCount());
106
+                    					sum_use_num = Double.parseDouble(m.get("in_count")+"");
107
+                    					if (sum_use_num <= plan_sum_num) {
108
+                    						sysl = plan_sum_num - sum_use_num;
109
+                    						obj.setRemainingNumber("0"); //页面上明细列表的剩余数量
110
+                    						obj.setInCount(sysl+"");
111
+                    					} else if (sum_use_num > plan_sum_num){
112
+                    						sysl = sum_use_num - plan_sum_num;
113
+                    						obj.setRemainingNumber("超出:"+sysl);
114
+                    					}
115
+                					}
116
+                					//轮换计划的引用了入的,出的为空  "".equals(m.get("out_count")) && null == m.get("out_count")
117
+                					if(!m.containsKey("out_count")){
118
+                						if(!"".equals(obj.getOutCount()) && null != obj.getOutCount()){
119
+                							plan_sum_num = Double.parseDouble(obj.getOutCount());
120
+                    						sum_use_num = 0d;
121
+                    						if (sum_use_num <= plan_sum_num) {
122
+                    							sysl = plan_sum_num - sum_use_num;
123
+                    							obj.setOutRemainingNumber("0");
124
+                    							obj.setOutCount(sysl+"");
125
+                    						} 
126
+                						}
127
+                					}
128
+                				}
129
+                				if (!"".equals(m.get("out_count")) && null != m.get("out_count")) {
130
+                					if (!"".equals(obj.getOutCount()) && null != obj.getOutCount()) {
131
+                						plan_sum_num = Double.parseDouble(obj.getOutCount());
132
+                						sum_use_num = Double.parseDouble(m.get("out_count")+"");
133
+                						if (sum_use_num <= plan_sum_num) {
134
+                							sysl = plan_sum_num - sum_use_num;
135
+                							obj.setOutRemainingNumber("0");
136
+                							obj.setOutCount(sysl+"");
137
+                						} else if (sum_use_num > plan_sum_num){
138
+                							sysl = sum_use_num - plan_sum_num;
139
+                							obj.setOutRemainingNumber("超出:"+sysl);
140
+                						}
141
+                					}
142
+                					
143
+                					//轮换计划的引用了出的,入的为空  "".equals(m.get("in_count")) && null == m.get("in_count")
144
+                					if (!m.containsKey("in_count")) {
145
+                    					if (!"".equals(obj.getInCount()) && null != obj.getInCount()) {
146
+                    						plan_sum_num = Double.parseDouble(obj.getInCount());
147
+                        					sum_use_num = 0d;
148
+                        					if (sum_use_num <= plan_sum_num) {
149
+                        						sysl = plan_sum_num - sum_use_num;
150
+                        						obj.setRemainingNumber("0"); //页面上明细列表的剩余数量
151
+                        						obj.setInCount(sysl+"");
152
+                        					} 
153
+                    					}
154
+                					}
155
+                					
156
+                				}
157
+                			}
158
+                		}
159
+                	} else {
160
+                		/* 如果没有查询到数据,则表示还没有被任何通知单和合同引用过 */
161
+                		obj.setRemainingNumber("0");
162
+                		obj.setOutRemainingNumber("0");
163
+                	}
164
+                }
165
+                modelMap.put("status", "success");
166
+                modelMap.put("list", list);
167
+            } else {
168
+                throw new RuntimeException("zid或者type为空!");
169
+            }
170
+        } catch (Exception e) {
171
+            e.printStackTrace();
172
+            modelMap.put("status", "error");
173
+            modelMap.put("msg", "查询失败!");
174
+        }
175
+        return modelMap;
176
+    }
177
+    
178
+    
179
+    /**
180
+     * 根据id 修改数据
181
+     * @param id 主键
182
+     * @return
183
+     * @throws JsonParseException
184
+     * @throws JsonMappingException
185
+     * @throws IOException
186
+     */
187
+    @RequestMapping(value="/updateById",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
188
+	@ApiOperation(value="修改", notes = "根据id修改")
189
+	@ApiImplicitParams({
190
+		@ApiImplicitParam(name = "BusinessStoreWareDetail", value = "子表数据", paramType = "query")
191
+	})
192
+    public int updateById(BusinessStoreWareDetail detail) {
193
+        
194
+        	int i= detailService.updateById(detail);
195
+        
196
+        return i;
197
+    }
198
+    
199
+    
200
+    /**
201
+     * 根据id 查询数据
202
+     * @param id 主键
203
+     * @return
204
+     * @throws JsonParseException
205
+     * @throws JsonMappingException
206
+     * @throws IOException
207
+     */
208
+    @RequestMapping(value="/queryStoreWareDetailInfo",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
209
+    @ApiOperation(value="修改", notes = "根据id修改")
210
+    @ApiImplicitParams({
211
+    	@ApiImplicitParam(name = "BusinessStoreWareDetail", value = "子表数据", paramType = "query")
212
+    })
213
+    public BusinessStoreWareDetail queryStoreWareDetailInfo(String id) {
214
+    	BusinessStoreWareDetail businessStoreWareDetail = null;
215
+    	if(id!=null && !"".equals(id)){
216
+    		 businessStoreWareDetail= detailService.queryInfo(id);
217
+    	}
218
+    	
219
+    	return businessStoreWareDetail;
220
+    }
221
+    
222
+}

+ 72 - 0
src/main/java/com/chinaitop/depot/business/controller/OrgInfoController.java

@@ -0,0 +1,72 @@
1
+package com.chinaitop.depot.business.controller;
2
+import com.chinaitop.depot.business.model.OrgInfo;
3
+import com.chinaitop.depot.business.model.OrgInfoExample;
4
+import com.chinaitop.depot.business.model.UserInfo;
5
+import com.chinaitop.depot.business.model.UserInfoExample;
6
+import com.chinaitop.depot.business.service.OrgInfoService;
7
+import com.fasterxml.jackson.core.JsonParseException;
8
+import com.fasterxml.jackson.databind.JsonMappingException;
9
+import com.fasterxml.jackson.databind.ObjectMapper;
10
+import com.github.pagehelper.PageHelper;
11
+import com.github.pagehelper.PageInfo;
12
+
13
+import io.swagger.annotations.Api;
14
+import io.swagger.annotations.ApiImplicitParam;
15
+import io.swagger.annotations.ApiImplicitParams;
16
+import io.swagger.annotations.ApiOperation;
17
+
18
+import org.apache.commons.lang.ObjectUtils;
19
+import org.apache.commons.lang3.StringUtils;
20
+import org.springframework.web.bind.annotation.RequestMapping;
21
+import org.springframework.web.bind.annotation.RequestMethod;
22
+import org.springframework.web.bind.annotation.RestController;
23
+
24
+import javax.annotation.Resource;
25
+import javax.servlet.http.HttpServletRequest;
26
+import java.io.IOException;
27
+import java.util.ArrayList;
28
+import java.util.HashMap;
29
+import java.util.List;
30
+import java.util.Map;
31
+
32
+/**
33
+ * 组织信息控制类
34
+ * @author xueenxi
35
+ *
36
+ */
37
+@RestController
38
+@RequestMapping(value="/orgInfo")
39
+@Api(description = "组织机构信息控制类")
40
+public class OrgInfoController {
41
+	
42
+	@Resource
43
+	private OrgInfoService orgInfoService;
44
+	
45
+	
46
+	/**
47
+     * 查询所有的用户枚举,返回id与用户姓名的map.
48
+     * @param request
49
+     * @return
50
+     */
51
+    @RequestMapping(value="/findAllOrgMap", method = RequestMethod.GET)
52
+    public Map<Integer, Object> findAllUserMapByOrgId(HttpServletRequest request) {
53
+        Map<Integer, Object> map = new HashMap<>();
54
+		
55
+           OrgInfoExample orgExample = new OrgInfoExample();
56
+			//Criteria criteria = keeperExample.createCriteria();
57
+			List<OrgInfo> list = null;
58
+			try {
59
+				list = orgInfoService.queryByExample(orgExample);
60
+				for (OrgInfo orgInfo : list) {
61
+					map.put(orgInfo.getOrgId(), orgInfo.getOrgName());
62
+				}
63
+			} catch (Exception e) {
64
+				e.printStackTrace();
65
+			}
66
+        
67
+        return map;
68
+    }
69
+	
70
+
71
+	
72
+}

+ 482 - 0
src/main/java/com/chinaitop/depot/business/controller/UserInfoController.java

@@ -0,0 +1,482 @@
1
+package com.chinaitop.depot.business.controller;
2
+
3
+import java.awt.image.BufferedImage;
4
+import java.io.ByteArrayOutputStream;
5
+import java.io.IOException;
6
+import java.util.HashMap;
7
+import java.util.List;
8
+import java.util.Map;
9
+
10
+import javax.annotation.Resource;
11
+import javax.imageio.ImageIO;
12
+import javax.servlet.http.HttpServletRequest;
13
+
14
+import org.apache.commons.codec.binary.Base64;
15
+import org.apache.commons.lang.ObjectUtils;
16
+import org.apache.commons.lang3.StringUtils;
17
+import org.springframework.beans.factory.annotation.Value;
18
+import org.springframework.http.MediaType;
19
+import org.springframework.web.bind.annotation.RequestMapping;
20
+import org.springframework.web.bind.annotation.RequestMethod;
21
+import org.springframework.web.bind.annotation.RestController;
22
+
23
+import com.chinaitop.depot.business.model.OrgInfo;
24
+import com.chinaitop.depot.business.model.UserInfo;
25
+import com.chinaitop.depot.business.model.UserInfoExample;
26
+import com.chinaitop.depot.business.model.UserInfoExample.Criteria;
27
+import com.chinaitop.depot.business.model.UserRole;
28
+import com.chinaitop.depot.business.service.OrgInfoService;
29
+import com.chinaitop.depot.business.service.RoleInfoService;
30
+import com.chinaitop.depot.business.service.UserInfoService;
31
+import com.chinaitop.depot.business.service.UserRoleService;
32
+import com.chinaitop.depot.utils.SecurityCode;
33
+import com.chinaitop.depot.utils.SecurityCode.SecurityCodeLevel;
34
+import com.chinaitop.depot.utils.SecurityImage;
35
+import com.fasterxml.jackson.core.JsonParseException;
36
+import com.fasterxml.jackson.core.JsonProcessingException;
37
+import com.fasterxml.jackson.databind.JsonMappingException;
38
+import com.fasterxml.jackson.databind.ObjectMapper;
39
+import com.github.pagehelper.PageHelper;
40
+import com.github.pagehelper.PageInfo;
41
+
42
+import io.swagger.annotations.Api;
43
+import io.swagger.annotations.ApiImplicitParam;
44
+import io.swagger.annotations.ApiImplicitParams;
45
+import io.swagger.annotations.ApiOperation;
46
+
47
+/**
48
+ * 用户信息控制类
49
+ * @author xueenxi
50
+ *
51
+ */
52
+@RestController
53
+@RequestMapping(value="/userInfo")
54
+@Api(description = "用户信息控制类")
55
+public class UserInfoController {
56
+	
57
+	@Resource
58
+	private UserInfoService userInfoService;
59
+
60
+	@Resource
61
+	private OrgInfoService orgInfoService;
62
+
63
+	@Resource
64
+	private UserRoleService userRoleService;
65
+
66
+	@Resource
67
+	private RoleInfoService roleInfoService;
68
+
69
+	@Value("${web.upload-path}")
70
+	private String uploadPath;
71
+
72
+	/**
73
+	 * 查找用户信息
74
+	 * @param pageNum	页码
75
+	 * @param pageSize	每页条数
76
+	 * @return
77
+	 */
78
+	@RequestMapping(value="/getUser", method = RequestMethod.GET)
79
+	@ApiOperation(value="查询用户信息", notes = "查询用户信息列表,支持分页")
80
+	@ApiImplicitParams({
81
+			@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
82
+			@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
83
+			@ApiImplicitParam(name = "username", value = "用户名", paramType = "query"),
84
+			@ApiImplicitParam(name = "realName", value = "用户真实姓名", paramType = "query")
85
+	})
86
+	public PageInfo<UserInfo> getUserInfo(HttpServletRequest request, Integer pageNum, Integer pageSize,
87
+                                          String username, String realName, Integer roleId, String orgIds) {
88
+		
89
+		if (pageNum!=null && pageSize!=null) {
90
+			PageHelper.startPage(pageNum, pageSize);
91
+		}
92
+		
93
+		HashMap<Object, Object> map = new HashMap<Object, Object>();
94
+		map.put("username", username);
95
+		map.put("realName", realName);
96
+		map.put("roleId", roleId);
97
+		List<UserInfo> listAll=userInfoService.queryAll(map);
98
+		PageInfo<UserInfo> pageInfo = new PageInfo<UserInfo>(listAll);
99
+		return pageInfo;
100
+	}
101
+
102
+	/**
103
+	 * 用户登录
104
+	 * @param request
105
+	 * @param username	用户名
106
+	 * @param password	密码
107
+	 * @return
108
+	 */
109
+	@RequestMapping(value="/login", method = RequestMethod.POST)
110
+	@ApiOperation(value="用户登录", notes = "用户登录")
111
+	@ApiImplicitParams({
112
+			@ApiImplicitParam(name = "username", value = "用户名", paramType = "form"),
113
+			@ApiImplicitParam(name = "password", value = "密码", paramType = "form"),
114
+			@ApiImplicitParam(name = "yzm", value = "验证码", paramType = "form"),
115
+			@ApiImplicitParam(name = "from", value = "来源,app代表来自于移动端", paramType = "form")
116
+	})
117
+	public Map<String, Object> Login(HttpServletRequest request, String username, String password, String yzm, String from) {
118
+		Map<String, Object> map = new HashMap<String, Object>();
119
+		if (StringUtils.isBlank(from) || from.compareTo("app")!=0) {
120
+			String yzm_code = (String) request.getSession().getAttribute("Service_Code");
121
+			if (!yzm_code.equals(yzm)) {
122
+				map.put("status", false);
123
+				map.put("success", "验证码输入错误!");
124
+				return map;
125
+			}
126
+		}
127
+		UserInfo userInfo = userInfoService.valid(username, password);
128
+		if (userInfo != null) {
129
+			//把对象转变成一个json
130
+			ObjectMapper mapper = new ObjectMapper();
131
+			try {
132
+				String userInfoObject = mapper.writeValueAsString(userInfo);
133
+				// 当前登录用户
134
+				request.getSession().setAttribute("userInfo", userInfoObject);
135
+				// 当前登录用户id
136
+				request.getSession().setAttribute("userId", userInfo.getUserId());
137
+				// 当前组织信息
138
+				OrgInfo orgInfo = orgInfoService.findById(userInfo.getOrgId());
139
+				String orgInfoObject = mapper.writeValueAsString(orgInfo);
140
+				request.getSession().setAttribute("orgInfo", orgInfoObject);
141
+				// 当前用户所属的库信息及库编号
142
+				OrgInfo depotInfo = orgInfoService.getDepotInfo(orgInfo);
143
+				if(depotInfo!=null){
144
+					String depotInfoObject = mapper.writeValueAsString(depotInfo);
145
+					request.getSession().setAttribute("depotInfo", depotInfoObject);
146
+					request.getSession().setAttribute("depotId", depotInfo.getOrgId());
147
+				}
148
+			} catch (JsonProcessingException e) {
149
+				e.printStackTrace();
150
+			}
151
+			map.put("status", true);
152
+			map.put("userInfo", userInfo);
153
+		} else {
154
+			map.put("status", false);
155
+			map.put("success", "用户名或密码错误,登录失败!");
156
+		}
157
+		return map;
158
+	}
159
+
160
+	/**
161
+	 * 获取用户登录信息,包括当前用户、当前组织、当前库、当前库编号
162
+	 * @param request
163
+	 * @return
164
+	 */
165
+	@RequestMapping(value="/getLoginInfo", method = RequestMethod.GET)
166
+	@ApiOperation(value="获取用户登录信息", notes = "获取用户登录信息")
167
+	public Map<String, Object> getLoginInfo(HttpServletRequest request) {
168
+		Map<String, Object> modelMap = new HashMap<>();
169
+		try {
170
+			// JSON字符串转对象
171
+			ObjectMapper mapper = new ObjectMapper();
172
+			String userInfoObject = ObjectUtils.toString(request.getSession().getAttribute("userInfo"),"");
173
+			if(!userInfoObject.isEmpty()) {
174
+				UserInfo userInfo = mapper.readValue(userInfoObject, UserInfo.class);
175
+				//UserInfo userInfo = (UserInfo)request.getSession().getAttribute("userInfo");
176
+				modelMap.put("userInfo", userInfo);
177
+			}
178
+			String orgInfoObject = ObjectUtils.toString(request.getSession().getAttribute("orgInfo"),"");
179
+			if(!orgInfoObject.isEmpty()) {
180
+				OrgInfo orgInfo = mapper.readValue(orgInfoObject, OrgInfo.class);
181
+				//OrgInfo orgInfo = (OrgInfo)request.getSession().getAttribute("orgInfo");
182
+				modelMap.put("orgInfo", orgInfo);
183
+			}
184
+			String depotInfoObject = ObjectUtils.toString(request.getSession().getAttribute("depotInfo"),"");
185
+			if(!depotInfoObject.isEmpty()) {
186
+				OrgInfo depotInfo = mapper.readValue(depotInfoObject, OrgInfo.class);
187
+				//OrgInfo depotInfo = (OrgInfo)request.getSession().getAttribute("depotInfo");
188
+				modelMap.put("depotInfo", depotInfo);
189
+			}
190
+			Integer depotId = (Integer)request.getSession().getAttribute("depotId");
191
+			modelMap.put("depotId", depotId);
192
+		} catch (IOException e) {
193
+			e.printStackTrace();
194
+		}
195
+		
196
+		return modelMap;
197
+	}
198
+	
199
+	/**
200
+	 * 退出登录
201
+	 * @param request
202
+	 * @return
203
+	 */
204
+	@RequestMapping(value="/exitLogin", method = RequestMethod.GET)
205
+	@ApiOperation(value="退出登录", notes = "退出登录,删除session")
206
+	public Map<String, Object> exitLogin(HttpServletRequest request) {
207
+		Map<String, Object> modelMap = new HashMap<>();
208
+		request.getSession().removeAttribute("userInfo");
209
+		modelMap.put("status", "success");
210
+		return modelMap;
211
+	}
212
+
213
+	/**
214
+	 * 验证用户名是否可用
215
+	 * @param userId	用户编号
216
+	 * @param username	用户名
217
+	 * @return
218
+	 */
219
+	@RequestMapping(value="/validUsername", method = RequestMethod.GET)
220
+	@ApiOperation(value="验证用户名", notes = "验证用户名是否可用")
221
+	@ApiImplicitParams({
222
+			@ApiImplicitParam(name = "userId", value = "用户编号", paramType = "query"),
223
+			@ApiImplicitParam(name = "username", value = "用户名", paramType = "query")
224
+	})
225
+	public Boolean validUsername(Integer userId, String username) {
226
+		return userInfoService.validUsername(userId, username);
227
+	}
228
+	
229
+	/**
230
+	 * 验证用户输入的原密码是否正确
231
+	 * @param oldPassword	用户输入的原密码
232
+	 * @return
233
+	 */
234
+	@RequestMapping(value="/validPassword", method = RequestMethod.GET)
235
+	@ApiOperation(value="验证用户输入的原密码是否正确", notes = "验证用户输入的原密码是否正确")
236
+	@ApiImplicitParams({
237
+			@ApiImplicitParam(name = "oldPassword", value = "用户密码", paramType = "query")
238
+	})
239
+	public boolean validPassword(HttpServletRequest request, String oldPassword) throws Exception{
240
+		ObjectMapper mapper = new ObjectMapper();
241
+		String userInfoObject = ObjectUtils.toString(request.getSession().getAttribute("userInfo"),"");
242
+		UserInfo userInfo = mapper.readValue(userInfoObject, UserInfo.class);
243
+		String resPassword = userInfo.getPassword();
244
+		return userInfoService.validPassword(resPassword, oldPassword);
245
+	}
246
+
247
+	/**
248
+	 * 重置密码
249
+	 * @param userId
250
+	 * @return
251
+	 */
252
+	@RequestMapping(value="/resetPassword", method = RequestMethod.POST)
253
+	@ApiOperation(value="重置密码", notes = "重置密码")
254
+	@ApiImplicitParams({
255
+			@ApiImplicitParam(name = "userId", value = "用户编号", paramType = "form")
256
+	})
257
+	public void resetPassword(Integer userId) {
258
+		userInfoService.resetPassword(userId);
259
+	}
260
+	
261
+	/**
262
+	 * 根据编号查找用户信息
263
+	 * @param userId 用户编号
264
+	 * @return	UserInfo	用户信息
265
+	 */
266
+	@RequestMapping(value="/edit", method = RequestMethod.GET)
267
+	@ApiOperation(value="编辑用户信息", notes = "编辑用户信息,用于新增或者修改")
268
+	@ApiImplicitParams({
269
+			@ApiImplicitParam(name = "userId", value = "用户编号", paramType = "query")
270
+	})
271
+	public UserInfo edit(Integer userId) {
272
+		UserInfo userInfo = new UserInfo();
273
+		if (userId != null) {
274
+			userInfo = userInfoService.findById(userId);
275
+		}
276
+		return userInfo;
277
+	}
278
+
279
+	/**
280
+	 * 保存用户信息
281
+	 * @param userInfoJson	用户信息json字符串
282
+	 * @return
283
+	 * @throws JsonParseException
284
+	 * @throws JsonMappingException
285
+	 * @throws IOException
286
+	 */
287
+	@RequestMapping(value="/save", method = RequestMethod.POST)
288
+	@ApiOperation(value="保存用户", notes = "保存用户信息,新增或者修改")
289
+	@ApiImplicitParams({
290
+			@ApiImplicitParam(name = "userInfoJson", value = "用户信息JSON串", paramType = "form"),
291
+			@ApiImplicitParam(name = "userRoleIds", value = "用户角色编号,多个之间用逗号隔开", paramType = "form")
292
+	})
293
+	public Map<String, Object> save(String userInfoJson , String userRoleIds) throws JsonParseException, JsonMappingException, IOException {
294
+		Map<String, Object> modelMap = new HashMap<>();
295
+		// JSON字符串转对象
296
+		ObjectMapper mapper = new ObjectMapper();
297
+		UserInfo userInfo = (UserInfo)mapper.readValue(userInfoJson, UserInfo.class);
298
+		UserRole userRole = new UserRole();
299
+		 if (StringUtils.isNotBlank(userRoleIds) && !"[]".equals(userRoleIds)) {
300
+			 userRoleIds = userRoleIds.substring(1, userRoleIds.length());
301
+			 userRoleIds = userRoleIds.substring(0, userRoleIds.length() - 1);
302
+	            String[] idArray = userRoleIds.split(",");
303
+	           if(userInfo.getUserId() == null){
304
+	        	   userInfoService.add(userInfo);
305
+	        	  /* userRole.setUserId(userInfo.getUserId());
306
+	        	   for (String id : idArray) {
307
+		            	userRole.setRoleId(Integer.parseInt(id));
308
+			            userRoleService.add(userRole);
309
+		            }*/
310
+	           }else{
311
+	        	   userInfoService.update(userInfo);
312
+	        	   userRoleService.deleteById(userInfo.getUserId());
313
+	           }
314
+	           userRole.setUserId(userInfo.getUserId());
315
+	           for (String id : idArray) {
316
+	        	   userRole.setRoleId(Integer.parseInt(id));
317
+	        	   userRoleService.add(userRole);
318
+	           }
319
+	           
320
+	          
321
+		 }
322
+		
323
+		/*String[] split1 = userRoleIds.split("[");
324
+		String[] split2 = split1[0].split("]");
325
+		String[] userRoleids = split2[0].split(",");*/
326
+		
327
+		//int userRoleids = Integer.parseInt(userRoleIds);
328
+		/*UserRole userRole = new UserRole();
329
+		for (int i = 0; i < userRoleids.length; i++) {
330
+			userRole.setRoleId(Integer.parseInt(userRoleids[i]));
331
+		}*/
332
+		modelMap.put("status", "success");
333
+		return modelMap;
334
+	}
335
+	
336
+	/**
337
+	 * 根据编号删除用户编纂 
338
+	 * @param userId	用户编号
339
+	 * @return
340
+	 */
341
+	@RequestMapping(value="/remove", method = RequestMethod.POST)
342
+	@ApiOperation(value="删除用户", notes = "按用户编号删除用户")
343
+	@ApiImplicitParams({
344
+			@ApiImplicitParam(name = "userId", value = "用户名", paramType = "form")
345
+	})
346
+	public Map<String, Object> remove(Integer userId) {
347
+		Map<String, Object> modelMap = new HashMap<>();
348
+		if (userId != null) {
349
+			userInfoService.remove(userId);
350
+			userRoleService.deleteById(userId);//删除用户角色信息
351
+		}
352
+		modelMap.put("status", "success");
353
+		return modelMap;
354
+	}
355
+	
356
+	/**
357
+	 * 修改密码
358
+	 * @param request
359
+	 * @param oldPassword	原密码
360
+	 * @param newPassword	新密码
361
+	 * @return
362
+	 */
363
+	@RequestMapping(value="/modifyPwd", method = RequestMethod.POST)
364
+	@ApiOperation(value="修改密码", notes = "修改用户登录密码")
365
+	@ApiImplicitParams({
366
+			@ApiImplicitParam(name = "oldPassword", value = "源密码", paramType = "form"),
367
+			@ApiImplicitParam(name = "newPassword", value = "新密码", paramType = "form")
368
+	})
369
+	public UserInfo modifyPwd(HttpServletRequest request, String oldPassword, String newPassword) {
370
+		try {
371
+			ObjectMapper mapper = new ObjectMapper();
372
+			String userInfoObject = ObjectUtils.toString(request.getSession().getAttribute("userInfo"),"");
373
+			UserInfo userInfo = mapper.readValue(userInfoObject, UserInfo.class);
374
+			if (userInfo.getPassword().equals(userInfoService.getMD5(oldPassword))) {
375
+				userInfo.setPassword(userInfoService.getMD5(newPassword));
376
+				userInfoService.update(userInfo);
377
+				
378
+				String userInfoObjectNew = mapper.writeValueAsString(userInfo);
379
+				request.getSession().setAttribute("userInfo", userInfoObjectNew);
380
+				return userInfo;
381
+			}
382
+		} catch (IOException e) {
383
+			e.printStackTrace();
384
+		}
385
+		return null;
386
+	}
387
+
388
+	/**
389
+	 * 查询当前库下所有的用户
390
+	 * @param request
391
+	 * @return
392
+	 */
393
+	@RequestMapping(value="/findAllUserByOrgId", method = RequestMethod.GET)
394
+	@ApiOperation(value="查询当前库下所有的用户", notes = "查询当前库下所有的用户")
395
+	@ApiImplicitParams({
396
+			@ApiImplicitParam(name = "orgId", value = "单位ID", paramType = "form")
397
+	})
398
+	public List<UserInfo> findAllUserByOrgId(Integer orgId){
399
+		UserInfoExample example = new UserInfoExample();
400
+		Criteria criteria = example.createCriteria();
401
+		List<UserInfo> list = null;
402
+		try {
403
+			// 拼接查询条件单位
404
+			if (null != orgId && !"".equals(orgId)) {
405
+				criteria.andOrgIdEqualTo(orgId);
406
+			}
407
+			//criteria.andDelFlagEqualTo(1); // 查询正常数据(暂时不做限制)
408
+			list = userInfoService.queryByExample(example);
409
+		} catch (Exception e) {
410
+			e.printStackTrace();
411
+		}
412
+		return list;
413
+	}
414
+	
415
+	/**
416
+     * 查询所有的用户枚举,返回id与用户姓名的map.
417
+     * @param request
418
+     * @return
419
+     */
420
+    @RequestMapping(value="/findAllUserMapByOrgId", method = RequestMethod.GET)
421
+    public Map<Integer, Object> findAllUserMapByOrgId(HttpServletRequest request) {
422
+        Map<Integer, Object> map = new HashMap<>();
423
+		
424
+			//ObjectMapper mapper = new ObjectMapper();
425
+			/*String depotInfoObject = ObjectUtils.toString(request.getSession().getAttribute("depotInfo"),"");
426
+			OrgInfo orgInfo = mapper.readValue(depotInfoObject, OrgInfo.class);*/
427
+			
428
+			UserInfoExample keeperExample = new UserInfoExample();
429
+			//Criteria criteria = keeperExample.createCriteria();
430
+			List<UserInfo> list = null;
431
+			try {
432
+				//Integer orgId = null;
433
+				/*if (orgInfo != null) {
434
+					orgId=orgInfo.getOrgId();//所属库id
435
+				}
436
+				// 拼接查询条件单位
437
+				if (null != orgId && !"".equals(orgId)) {
438
+					criteria.andOrgIdEqualTo(orgId);
439
+				}*/
440
+				list = userInfoService.queryByExample(keeperExample);
441
+				for (UserInfo userInfo : list) {
442
+					map.put(userInfo.getUserId(), userInfo.getRealName());
443
+				}
444
+			} catch (Exception e) {
445
+				e.printStackTrace();
446
+			}
447
+        
448
+        return map;
449
+    }
450
+
451
+    /**
452
+	 * 生成验证码图片, 并将验证码图片上传到服务器,然后将生成的验证码串值保存到session 中
453
+	 * 
454
+	 * @param request
455
+	 **/
456
+	@RequestMapping(value="/getCode", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
457
+	@ApiOperation(value="生成验证码图片", notes = "生成验证码图片")
458
+	public Map<String, Object> getCode(HttpServletRequest request, Integer fontSize, Integer width, Integer heigth) {
459
+
460
+		// 图片流
461
+		BufferedImage image;
462
+
463
+		// 获取验证码数字字符串
464
+		String yzm_code = SecurityCode.getSecurityCode(4, SecurityCodeLevel.Hard, false).toLowerCase();
465
+		request.getSession().setAttribute("Service_Code", yzm_code);
466
+		// 生成验证码图片
467
+		image = SecurityImage.createImage(yzm_code, fontSize, width, heigth);
468
+
469
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
470
+        try {
471
+			ImageIO.write(image, "jpg", baos);
472
+		} catch (IOException e1) {
473
+			e1.printStackTrace();
474
+		}
475
+
476
+        //将图片转换为base64位二进制编码返回
477
+        String imgBase64 = new Base64().encodeToString(baos.toByteArray());
478
+  		Map<String, Object> map = new HashMap<String, Object>();
479
+  		map.put("file", imgBase64);
480
+  		return map;
481
+	}
482
+}

+ 480 - 0
src/main/java/com/chinaitop/depot/business/controller/audit/BusinessContractAuditController.java

@@ -0,0 +1,480 @@
1
+package com.chinaitop.depot.business.controller.audit;
2
+
3
+
4
+import java.util.HashMap;
5
+import java.util.List;
6
+import java.util.Map;
7
+
8
+import javax.annotation.Resource;
9
+import javax.servlet.http.HttpServletRequest;
10
+
11
+import org.springframework.beans.factory.annotation.Autowired;
12
+import org.springframework.http.MediaType;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RequestMethod;
15
+import org.springframework.web.bind.annotation.RestController;
16
+
17
+import com.chinaitop.depot.act.model.HistoryList;
18
+import com.chinaitop.depot.act.service.ActTaskService;
19
+import com.chinaitop.depot.business.model.BusinessApproval;
20
+import com.chinaitop.depot.business.model.BusinessContract;
21
+import com.chinaitop.depot.business.model.BusinessFile;
22
+import com.chinaitop.depot.business.model.BusinessStoreWareDetail;
23
+import com.chinaitop.depot.business.model.enums.StoreWareType;
24
+import com.chinaitop.depot.business.model.vo.BusinessContractAuditVO;
25
+import com.chinaitop.depot.business.service.BusinessApprovalService;
26
+import com.chinaitop.depot.business.service.BusinessContractService;
27
+import com.chinaitop.depot.business.service.BusinessFileService;
28
+import com.chinaitop.depot.business.service.BusinessStoreWareDetailService;
29
+import com.chinaitop.depot.utils.activiti.StringUtils;
30
+import com.github.pagehelper.PageHelper;
31
+import com.github.pagehelper.PageInfo;
32
+
33
+import io.swagger.annotations.Api;
34
+import io.swagger.annotations.ApiImplicitParam;
35
+import io.swagger.annotations.ApiImplicitParams;
36
+import io.swagger.annotations.ApiOperation;
37
+
38
+/**
39
+ * 粮库业务管理-合同审批管理
40
+* <p>Title: BusinessContractAuditController</p>
41
+* <p>Description: </p>
42
+* @author yaoyabin
43
+* @date 2017年10月25日 下午5:45:39
44
+ */
45
+@RestController
46
+@RequestMapping(value="/depot/business/contract/audit")
47
+@Api(value= "BusinessContractAuditController", description = "合同审批管理")
48
+public class BusinessContractAuditController {
49
+    
50
+    @Resource
51
+    private BusinessContractService businessContractService;
52
+    @Resource
53
+    private BusinessStoreWareDetailService businessStoreWareDetailService;
54
+    @Resource
55
+    private BusinessApprovalService businessApprovalService;
56
+    @Resource
57
+    private ActTaskService actTaskService;
58
+    @Autowired
59
+    private BusinessFileService businessFileService;
60
+    
61
+    /**
62
+     * 获取审批列表.
63
+     * @param pageNum  页码
64
+     * @param pageSize  每页显示条数
65
+     * @return
66
+     */
67
+	 @RequestMapping(value="/getList", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
68
+	@ApiOperation(value="获取合同审批列表", notes = "查询数据列表,支持分页")
69
+	@ApiImplicitParams({
70
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
71
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
72
+		@ApiImplicitParam(name = "userId", value = "当前登录人id", paramType = "query")
73
+	})
74
+ 
75
+    public PageInfo<BusinessContractAuditVO> getList(Integer pageNum, Integer pageSize, 
76
+            HttpServletRequest request, BusinessContractAuditVO businessContractAuditVO,Integer userId) {
77
+    	/*UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
78
+    	Integer userId = userInfo.getUserId();*/
79
+        PageHelper.startPage(pageNum, pageSize);
80
+        Map<String,Object> paramMap = new HashMap<String, Object>();
81
+        paramMap.put("operator", userId);
82
+        paramMap.put("changeRecordFlag", "0");
83
+        
84
+        if(StringUtils.isNotBlank(businessContractAuditVO.getContractNumber())) {
85
+            paramMap.put("contractNumber", businessContractAuditVO.getContractNumber());
86
+        }
87
+        
88
+        if(StringUtils.isNotBlank(businessContractAuditVO.getAuditState())) {
89
+            paramMap.put("result", businessContractAuditVO.getAuditState());
90
+        }
91
+        paramMap.put("ctype", 6913);
92
+        List<BusinessContractAuditVO> list = businessContractService.getApprovalList(paramMap);
93
+        PageInfo<BusinessContractAuditVO> pageInfo = new PageInfo<BusinessContractAuditVO>(list);
94
+        return pageInfo;
95
+    }
96
+    
97
+    //中转
98
+    /**
99
+     * 获取审批列表.
100
+     * @param pageNum 页码
101
+     * @param pageSize 每页显示条数
102
+     * @return
103
+     */
104
+    @RequestMapping(value="/getListTransfer",produces = MediaType.APPLICATION_JSON_VALUE,  method=RequestMethod.GET)
105
+	@ApiOperation(value="获取中转合同审批列表", notes = "查询数据列表,支持分页")
106
+	@ApiImplicitParams({
107
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
108
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
109
+		@ApiImplicitParam(name = "userId", value = "当前登录人id", paramType = "query")
110
+	})
111
+    public PageInfo<BusinessContractAuditVO> getListTransfer(Integer pageNum, Integer pageSize, 
112
+    		HttpServletRequest request, BusinessContractAuditVO businessContractAuditVO,Integer userId) {
113
+    	/*UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
114
+    	Integer userId = userInfo.getUserId();*/
115
+    	PageHelper.startPage(pageNum, pageSize);
116
+    	Map<String,Object> paramMap = new HashMap<String, Object>();
117
+    	paramMap.put("operator", userId);
118
+    	paramMap.put("changeRecordFlag", "0");
119
+    	
120
+    	if(StringUtils.isNotBlank(businessContractAuditVO.getContractNumber())) {
121
+    		paramMap.put("contractNumber", businessContractAuditVO.getContractNumber());
122
+    	}
123
+    	
124
+    	if(StringUtils.isNotBlank(businessContractAuditVO.getAuditState())) {
125
+    		paramMap.put("result", businessContractAuditVO.getAuditState());
126
+    	}
127
+        paramMap.put("contract_type", 6913);
128
+    	List<BusinessContractAuditVO> list = businessContractService.getApprovalList(paramMap);
129
+    	PageInfo<BusinessContractAuditVO> pageInfo = new PageInfo<BusinessContractAuditVO>(list);
130
+    	return pageInfo;
131
+    }
132
+    
133
+    /**
134
+     * 获取审批页面详情.
135
+     * @param id 业务主键
136
+     * @param processInstanceId 流程实例id
137
+     * @return   
138
+     */
139
+    @RequestMapping(value="/getAudit", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
140
+	@ApiOperation(value="获取合同审批页面详情", notes = "获取审批页面详情")
141
+	@ApiImplicitParams({
142
+		@ApiImplicitParam(name = "id", value = "合同id", paramType = "query"),
143
+		@ApiImplicitParam(name = "processInstanceId", value = "流程实例id", paramType = "query"),
144
+		@ApiImplicitParam(name = "userName", value = "当前登录人name", paramType = "query")
145
+	})
146
+    public Map<String, Object> getAudit(Integer id, String processInstanceId,String userName) {
147
+        Map<String, Object> modelMap = new HashMap<String, Object>();
148
+        BusinessContract contract = businessContractService.findById(id);
149
+        modelMap.put("contract", contract);
150
+       // 获取对应的文件.
151
+        List<BusinessFile> fileList= businessFileService.getByBid(id,"contract", null, null);
152
+        
153
+        modelMap.put("fileList", fileList);
154
+        // 审批历史.
155
+        if(processInstanceId!=null){
156
+        	HistoryList historyList= null;
157
+        	List<HistoryList> auditList = actTaskService.histoicFlowList(processInstanceId, null, null);
158
+        	if(auditList.size()>0 && auditList!=null){
159
+        		for(int i = auditList.size() - 1; i >= 0; i--) { 
160
+        			if(auditList.get(i).getComment().contains("驳回")) {
161
+        				if(i<auditList.size()) {
162
+        					if(auditList.get(i).getActivityName().contains("库领导审批")){
163
+        						historyList = auditList.get(i-1);
164
+        					}else{
165
+        						historyList = auditList.get(i);
166
+        					}
167
+        					if(historyList!=null){
168
+        						break;
169
+        					}
170
+        				} else {
171
+        					historyList = null;
172
+        				}
173
+        			}
174
+        		}
175
+        	}
176
+			modelMap.put("subAudit", historyList);
177
+        	modelMap.put("auditList", auditList);
178
+        }
179
+        
180
+        if(contract.getPlanBid()!=null){
181
+        	// 查询该条合同引的计划的剩余数量
182
+        	List<BusinessStoreWareDetail> storeWareDetailListPlan= businessStoreWareDetailService.getByZidAndType(contract.getPlanBid(), StoreWareType.plan.getValue());
183
+        	//计算每条明细所对应的计划的剩余数量
184
+        	Map<String, Object> param_map = new HashMap<String, Object>();
185
+        	param_map.put("plan_id", contract.getPlanBid());
186
+            List<Map<String, Object>> map = businessStoreWareDetailService.selectPlanUseCount(param_map);
187
+            BusinessStoreWareDetail obj = null;
188
+            double sysl = 0d;
189
+            double sum_use_num = 0d; //已使用总量
190
+            double plan_sum_num = 0d; //原计划数量
191
+            for (int i = 0; i < storeWareDetailListPlan.size(); i++) {
192
+            	obj = storeWareDetailListPlan.get(i);
193
+            	for (Map<String, Object> m : map) {
194
+            		if (m.get("house_id").equals(obj.getHouseId()) && m.get("warehouse_id").equals(obj.getWarehouseId())) {
195
+            			if (!"".equals(m.get("in_count")) && null != m.get("in_count") && !"".equals(obj.getInCount()) && null != obj.getInCount()) {
196
+            				plan_sum_num = Double.parseDouble(obj.getInCount());
197
+            				sum_use_num = Double.parseDouble(m.get("in_count")+"");
198
+            				if (sum_use_num <= plan_sum_num) {
199
+            					sysl = plan_sum_num - sum_use_num;
200
+            					obj.setRemainingNumber(sysl+""); //页面上明细列表的数量
201
+            					if (sysl == 0) {
202
+            						obj.setRemainingNumber("0");
203
+            					}
204
+            				} else if (sum_use_num > plan_sum_num){
205
+            					sysl = sum_use_num - plan_sum_num;
206
+            					obj.setRemainingNumber("超出:" + sysl);
207
+            				}
208
+            			}
209
+            			if (!"".equals(m.get("out_count")) && null != m.get("out_count") && !"".equals(obj.getOutCount()) && null != obj.getOutCount()) {
210
+            				plan_sum_num = Double.parseDouble(obj.getOutCount());
211
+            				sum_use_num = Double.parseDouble(m.get("out_count")+"");
212
+            				if (sum_use_num <= plan_sum_num) {
213
+            					sysl = plan_sum_num - sum_use_num;
214
+            					obj.setOutRemainingNumber(""+sysl);
215
+            				} else if (sum_use_num > plan_sum_num){
216
+            					sysl = sum_use_num - plan_sum_num;
217
+            					obj.setOutRemainingNumber("超出:" + sysl);
218
+            				}
219
+            			}
220
+            		}
221
+            	}
222
+            }
223
+
224
+        	// 该条合同下的明细
225
+	        List<BusinessStoreWareDetail> storeWareDetailList= businessStoreWareDetailService.getByZidAndType(id, StoreWareType.contract.getValue());
226
+	        for (BusinessStoreWareDetail businessPlanDetail : storeWareDetailListPlan) {
227
+	        	 for (BusinessStoreWareDetail businessStoreWareDetail : storeWareDetailList) {
228
+					if(businessPlanDetail.getHouseId().equals(businessStoreWareDetail.getHouseId()) &&
229
+					   businessPlanDetail.getWarehouseId().equals(businessStoreWareDetail.getWarehouseId())){
230
+					    
231
+						if(businessPlanDetail.getRemainingNumber()!=null){
232
+							businessStoreWareDetail.setRemainingNumber(businessPlanDetail.getRemainingNumber());
233
+						}
234
+						if(businessPlanDetail.getOutRemainingNumber()!=null){
235
+							businessStoreWareDetail.setOutRemainingNumber(businessPlanDetail.getOutRemainingNumber());
236
+						}
237
+						
238
+					}
239
+				}
240
+			}
241
+	        modelMap.put("storeWareDetailList", storeWareDetailList);
242
+        }else{
243
+	        List<BusinessStoreWareDetail> storeWareDetailList= businessStoreWareDetailService.getByZidAndType(id, StoreWareType.contract.getValue());
244
+	        modelMap.put("storeWareDetailList", storeWareDetailList);
245
+        }
246
+        return modelMap;
247
+    }
248
+    
249
+    /**
250
+     * 获取审批页面详情.
251
+     * @param id 业务主键
252
+     * @param processInstanceId 流程实例id
253
+     * @return
254
+     */
255
+    @RequestMapping(value="/getAuditForChange",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
256
+   	@ApiOperation(value="获取合同变更审批页面详情", notes = "查询数据列表,支持分页")
257
+   	@ApiImplicitParams({
258
+   		@ApiImplicitParam(name = "id", value = "合同id", paramType = "query"),
259
+   		@ApiImplicitParam(name = "processInstanceId", value = "流程实例id", paramType = "query"),
260
+   		@ApiImplicitParam(name = "userName", value = "当前登录人name", paramType = "query")
261
+   	})
262
+    public Map<String, Object> getAduitForChange(Integer id, String processInstanceId, String userName) {
263
+        Map<String, Object> modelMap = new HashMap<String, Object>();
264
+        // 主体.
265
+        BusinessContract contract = businessContractService.findById(id);
266
+        modelMap.put("contract", contract);
267
+        // 获取对应的文件.
268
+        List<BusinessFile> fileList= businessFileService.getByBid(id,"contract", null, null);
269
+        
270
+        modelMap.put("fileList", fileList);
271
+        /*// 审批历史.
272
+        List<HistoryList> auditList = actTaskService.histoicFlowList(processInstanceId, null, null);
273
+        modelMap.put("auditList", auditList);*/
274
+        
275
+       // 审批历史.
276
+        if(processInstanceId!=null){
277
+        	HistoryList historyList= null;
278
+        	List<HistoryList> auditList = actTaskService.histoicFlowList(processInstanceId, null, null);
279
+        	if(auditList.size()>0 && auditList!=null){
280
+        		for(int i = auditList.size() - 1; i >= 0; i--) { 
281
+        			if(auditList.get(i).getComment().contains("驳回")) {
282
+        				if(i<auditList.size()) {
283
+        					historyList = auditList.get(i-1);
284
+        					if(historyList!=null){
285
+        						break;
286
+        					}
287
+        				} else {
288
+        					historyList = null;
289
+        				}
290
+        			}
291
+        		}
292
+        	}
293
+			modelMap.put("subAudit", historyList);
294
+        	modelMap.put("auditList", auditList);
295
+        }
296
+        
297
+        
298
+        // 获取历史变更详情
299
+        List<BusinessContract> changeDetailList = businessContractService.getChangeDetailList(id,"");
300
+        modelMap.put("changeDetailList", changeDetailList);
301
+        
302
+        // 仓号货位号数量质量标准.
303
+        List<BusinessStoreWareDetail> storeWareDetailList= businessStoreWareDetailService.getByZidAndType(id, StoreWareType.contract.getValue());
304
+        if(contract.getPlanBid()!=null){
305
+        	List<BusinessStoreWareDetail> planList= businessStoreWareDetailService.getByZidAndType(contract.getPlanBid(), StoreWareType.plan.getValue());
306
+        	
307
+        	/* 根据引用内容获取被引用合同明细的剩余数量 */
308
+        	Map<String, Object> param_map = new HashMap<String, Object>();
309
+        	param_map.put("plan_id", contract.getPlanBid());
310
+            List<Map<String, Object>> map = businessStoreWareDetailService.selectPlanUseCount(param_map);
311
+            BusinessStoreWareDetail obj = null;
312
+            double sysl = 0d;
313
+            double sum_use_num = 0d; //已使用总量
314
+            double plan_sum_num = 0d; //原计划数量
315
+            for (int i = 0; i < planList.size(); i++) {
316
+            	obj = planList.get(i);
317
+            	for (Map<String, Object> m : map) {
318
+            		if (m.get("house_id").equals(obj.getHouseId()) && m.get("warehouse_id").equals(obj.getWarehouseId())) {
319
+            			if (!"".equals(m.get("in_count")) && null != m.get("in_count")) {
320
+            				plan_sum_num = Double.parseDouble(obj.getInCount());
321
+            				sum_use_num = Double.parseDouble(m.get("in_count")+"");
322
+            				if (sum_use_num <= plan_sum_num) {
323
+            					sysl = plan_sum_num - sum_use_num;
324
+            					obj.setRemainingNumber(sysl+""); //页面上明细列表的数量
325
+            					if (sysl == 0) {
326
+            						obj.setRemainingNumber("0");
327
+            					}
328
+            				} else if (sum_use_num > plan_sum_num){
329
+            					sysl = sum_use_num - plan_sum_num;
330
+            					obj.setRemainingNumber("超出:" + sysl);
331
+            				}
332
+            			}
333
+            			if (!"".equals(m.get("out_count")) && null != m.get("out_count")) {
334
+            				plan_sum_num = Double.parseDouble(obj.getOutCount());
335
+            				sum_use_num = Double.parseDouble(m.get("out_count")+"");
336
+            				if (sum_use_num <= plan_sum_num) {
337
+            					sysl = plan_sum_num - sum_use_num;
338
+            					obj.setOutRemainingNumber(""+sysl);
339
+            				} else if (sum_use_num > plan_sum_num){
340
+            					sysl = sum_use_num - plan_sum_num;
341
+            					obj.setOutRemainingNumber("超出:" + sysl);
342
+            				}
343
+            			}
344
+            		}
345
+            	}
346
+            }
347
+        	
348
+        	/* 把获取的剩余数量给予当前的合同的明细剩余数量 */
349
+        	for (BusinessStoreWareDetail contractDetail : storeWareDetailList) {
350
+				for (BusinessStoreWareDetail planDetail : planList) {
351
+					if(contractDetail.getHouseId().equals(planDetail.getHouseId())  && 
352
+        					contractDetail.getWarehouseId().equals(planDetail.getWarehouseId())){
353
+        				
354
+//        				if(contractDetail.getInCount()!=null){
355
+//        					contractDetail.setPlanRemainingNumber(planDetail.getRemainingNumber());
356
+//        				}
357
+//        				if(contractDetail.getOutCount()!=null){
358
+//        					contractDetail.setPlanOutRemainingNumber(planDetail.getOutRemainingNumber());
359
+//        				}
360
+        				contractDetail.setRemainingNumber(planDetail.getRemainingNumber());
361
+        				contractDetail.setOutRemainingNumber(planDetail.getOutRemainingNumber());
362
+        			}
363
+				}
364
+				}
365
+			}
366
+        modelMap.put("storeWareDetailList", storeWareDetailList);
367
+        return modelMap;
368
+    }
369
+
370
+    /**
371
+     * 审批.
372
+     * @param contractId 业务主键
373
+     * @param businessApproval 中间表主体
374
+     * @param assignee 下一个审批人
375
+     * @param result 当前环节审批结果
376
+     * @return
377
+     */
378
+	 @RequestMapping(value="/audit", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
379
+	 @ApiOperation(value="合同审批", notes = "合同审批")
380
+	 @ApiImplicitParams({
381
+	   		@ApiImplicitParam(name = "contractId", value = "业务主键", paramType = "query"),
382
+	   		@ApiImplicitParam(name = "businessApproval", value = "中间表主体", paramType = "query"),
383
+	   		@ApiImplicitParam(name = "assignee", value = "下一个审批人", paramType = "query"),
384
+	   		@ApiImplicitParam(name = "result", value = "当前环节审批结果", paramType = "query"),
385
+	   		@ApiImplicitParam(name = "userId", value = "当前登录人id", paramType = "query"),
386
+	   		@ApiImplicitParam(name = "userName", value = "当前登录人name", paramType = "query")
387
+	   	})
388
+    public Map<String, Object> audit(Integer contractId, BusinessApproval businessApproval,String assignee,String result,Integer userId ,String realName,HttpServletRequest request) {
389
+    	//UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
390
+        Map<String, Object> modelMap = new HashMap<String, Object>();
391
+        businessContractService.audit(contractId, businessApproval,assignee, result, userId , realName);
392
+        modelMap.put("status", "success");
393
+        return modelMap;
394
+    }
395
+    
396
+    /**
397
+     * 获取合同变更审批列表.
398
+     * @param pageNum 页码
399
+     * @param pageSize 每页显示条数
400
+     * @return
401
+     */
402
+	@RequestMapping(value="/getContractChangeList",produces = MediaType.APPLICATION_JSON_VALUE,  method=RequestMethod.GET)
403
+    @ApiOperation(value="获取合同变更审批列表", notes = "获取合同变更审批列表,支持分页")
404
+	@ApiImplicitParams({
405
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
406
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
407
+		@ApiImplicitParam(name = "userId", value = "当前登录人id", paramType = "query")
408
+	})
409
+   
410
+    public PageInfo<BusinessContractAuditVO> getContractChangeList(Integer pageNum, Integer pageSize,
411
+            HttpServletRequest request, BusinessContractAuditVO businessContractAuditVO,Integer userId) {
412
+    	/*UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
413
+    	Integer userId = userInfo.getUserId();*/
414
+        PageHelper.startPage(pageNum, pageSize);
415
+        Map<String,Object> paramMap = new HashMap<String, Object>();
416
+        // TODO 获取当前登录人
417
+        paramMap.put("operator", userId);
418
+        paramMap.put("changeRecordFlag", "1");
419
+        
420
+        if(StringUtils.isNotBlank(businessContractAuditVO.getContractNumber())) {
421
+            paramMap.put("contractNumber", businessContractAuditVO.getContractNumber());
422
+        }
423
+        
424
+       /* if(businessContractAuditVO.getGrainKind() != null) {
425
+            paramMap.put("grainKind", businessContractAuditVO.getGrainKind());
426
+        }*/
427
+        
428
+        if(StringUtils.isNotBlank(businessContractAuditVO.getAuditState())) {
429
+            paramMap.put("result", businessContractAuditVO.getAuditState());
430
+        }
431
+        paramMap.put("ctype", 6913);
432
+        List<BusinessContractAuditVO> list = businessContractService.getApprovalList(paramMap);
433
+        PageInfo<BusinessContractAuditVO> pageInfo = new PageInfo<BusinessContractAuditVO>(list);
434
+        return pageInfo;
435
+    }
436
+    
437
+    //中转
438
+    /**
439
+     * 获取合同变更审批列表.
440
+     * @param pageNum 页码
441
+     * @param pageSize 每页显示条数
442
+     * @return
443
+     */
444
+	@RequestMapping(value="/getContractChangeListTransfer", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
445
+    @ApiOperation(value="获取中转合同变更审批列表", notes = "获取合同变更审批列表,支持分页")
446
+	@ApiImplicitParams({
447
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
448
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
449
+		@ApiImplicitParam(name = "userId", value = "当前登录人id", paramType = "query")
450
+	})
451
+   
452
+    public PageInfo<BusinessContractAuditVO> getContractChangeListTransfer(Integer pageNum, Integer pageSize,
453
+    		HttpServletRequest request, BusinessContractAuditVO businessContractAuditVO,Integer userId) {
454
+    	/*UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
455
+    	Integer userId = userInfo.getUserId();*/
456
+    	PageHelper.startPage(pageNum, pageSize);
457
+    	Map<String,Object> paramMap = new HashMap<String, Object>();
458
+    	// TODO 获取当前登录人
459
+    	paramMap.put("operator", userId);
460
+    	paramMap.put("changeRecordFlag", "1");
461
+    	
462
+    	if(StringUtils.isNotBlank(businessContractAuditVO.getContractNumber())) {
463
+    		paramMap.put("contractNumber", businessContractAuditVO.getContractNumber());
464
+    	}
465
+    	
466
+    	/* if(businessContractAuditVO.getGrainKind() != null) {
467
+            paramMap.put("grainKind", businessContractAuditVO.getGrainKind());
468
+        }*/
469
+    	
470
+    	if(StringUtils.isNotBlank(businessContractAuditVO.getAuditState())) {
471
+    		paramMap.put("result", businessContractAuditVO.getAuditState());
472
+    	}
473
+    	paramMap.put("contract_type", 6913);
474
+    	List<BusinessContractAuditVO> list = businessContractService.getApprovalList(paramMap);
475
+    	PageInfo<BusinessContractAuditVO> pageInfo = new PageInfo<BusinessContractAuditVO>(list);
476
+    	return pageInfo;
477
+    }
478
+    
479
+    
480
+}

+ 168 - 0
src/main/java/com/chinaitop/depot/business/controller/audit/BusinessDeliveryStorageNoticeAuditController.java

@@ -0,0 +1,168 @@
1
+package com.chinaitop.depot.business.controller.audit;
2
+
3
+
4
+import java.util.HashMap;
5
+import java.util.List;
6
+import java.util.Map;
7
+
8
+import javax.annotation.Resource;
9
+import javax.servlet.http.HttpServletRequest;
10
+
11
+import org.springframework.http.MediaType;
12
+import org.springframework.web.bind.annotation.RequestMapping;
13
+import org.springframework.web.bind.annotation.RequestMethod;
14
+import org.springframework.web.bind.annotation.RestController;
15
+
16
+import com.chinaitop.depot.act.model.HistoryList;
17
+import com.chinaitop.depot.act.service.ActTaskService;
18
+import com.chinaitop.depot.business.model.BusinessApproval;
19
+import com.chinaitop.depot.business.model.BusinessDeliveryStorageNotice;
20
+import com.chinaitop.depot.business.model.BusinessStoreWareDetail;
21
+import com.chinaitop.depot.business.model.enums.StoreWareType;
22
+import com.chinaitop.depot.business.model.vo.BusinessDeliveryStorageNoticeAuditVO;
23
+import com.chinaitop.depot.business.service.BusinessApprovalService;
24
+import com.chinaitop.depot.business.service.BusinessDeliveryStorageNoticeService;
25
+import com.chinaitop.depot.business.service.BusinessStoreWareDetailService;
26
+import com.chinaitop.depot.utils.activiti.StringUtils;
27
+import com.github.pagehelper.PageHelper;
28
+import com.github.pagehelper.PageInfo;
29
+
30
+import io.swagger.annotations.Api;
31
+import io.swagger.annotations.ApiImplicitParam;
32
+import io.swagger.annotations.ApiImplicitParams;
33
+import io.swagger.annotations.ApiOperation;
34
+
35
+/**
36
+ * 粮库业务管理-出入库通知单审批
37
+* <p>Title: BusinessDeliveryStorageNoticeAuditController</p>
38
+* <p>Description: </p>
39
+* @author yaoyabin
40
+* @date 2017年10月25日 下午5:48:06  
41
+ */
42
+@RestController
43
+@RequestMapping(value="/depot/business/deliveryStorageNotice/audit")
44
+@Api(value= "BusinessDeliveryStorageNoticeAuditController", description = "出入库通知单审批")
45
+public class BusinessDeliveryStorageNoticeAuditController {
46
+    
47
+    @Resource
48
+    private BusinessDeliveryStorageNoticeService businessDeliveryStorageNoticeService;
49
+    @Resource
50
+    private BusinessStoreWareDetailService businessStoreWareDetailService;
51
+    @Resource
52
+    private BusinessApprovalService businessApprovalService;
53
+    @Resource
54
+    private ActTaskService actTaskService;
55
+    
56
+    /**
57
+     * 获取审批列表.
58
+     * @param pageNum 页码
59
+     * @param pageSize 每页显示条数
60
+     * @return
61
+     */
62
+    @RequestMapping(value="/getList",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
63
+	@ApiOperation(value="获取审批列表", notes = "查询数据列表,支持分页")
64
+	@ApiImplicitParams({
65
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
66
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
67
+		@ApiImplicitParam(name = "userId", value = "当前登录人id", paramType = "query")
68
+	})
69
+    public PageInfo<BusinessDeliveryStorageNoticeAuditVO> getList(Integer pageNum, Integer pageSize, 
70
+            BusinessDeliveryStorageNotice notice, HttpServletRequest request,Integer userId) {
71
+    	/*UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
72
+    	Integer userId = userInfo.getUserId();*/
73
+        PageHelper.startPage(pageNum, pageSize);
74
+        Map<String,Object> paramMap = new HashMap<String, Object>();
75
+        paramMap.put("operator", userId);
76
+        if (StringUtils.isNotEmpty(notice.getBillType())) {
77
+            paramMap.put("billType", notice.getBillType());
78
+        }
79
+        if (StringUtils.isNotBlank(notice.getAuditState())) {
80
+            paramMap.put("result", notice.getAuditState());
81
+        }
82
+        List<BusinessDeliveryStorageNoticeAuditVO> list = businessDeliveryStorageNoticeService.getApprovalList(paramMap);
83
+        PageInfo<BusinessDeliveryStorageNoticeAuditVO> pageInfo = new PageInfo<BusinessDeliveryStorageNoticeAuditVO>(list);
84
+        return pageInfo;
85
+    }
86
+    
87
+    /**
88
+     * 获取审批页面详情.
89
+     * @param id 业务主键
90
+     * @param processInstanceId 流程实例id
91
+     * @return
92
+     */
93
+    @RequestMapping(value="/getAudit", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
94
+   	@ApiOperation(value="获取审批页面详情", notes = "获取审批页面详情")
95
+   	@ApiImplicitParams({
96
+   		@ApiImplicitParam(name = "id", value = "通知单id", paramType = "query"),
97
+   		@ApiImplicitParam(name = "processInstanceId", value = "流程实例id", paramType = "query"),
98
+   		@ApiImplicitParam(name = "userName", value = "当前登录人name", paramType = "query")
99
+   	})
100
+    public Map<String, Object> getAduit(Integer id, String processInstanceId,String userName) {
101
+        Map<String, Object> modelMap = new HashMap<String, Object>();
102
+        // 详情.
103
+        BusinessDeliveryStorageNotice deliveryStorageNotice = businessDeliveryStorageNoticeService.findById(id);
104
+        modelMap.put("deliveryStorageNotice", deliveryStorageNotice);
105
+        
106
+        // 审批列表.
107
+        //List<HistoryList> auditList = actTaskService.histoicFlowList(processInstanceId, null, null);
108
+        //modelMap.put("auditList", auditList);
109
+        
110
+        // 审批列表.
111
+        if(processInstanceId!=null){
112
+        	HistoryList historyList= null;
113
+        	List<HistoryList> auditList = actTaskService.histoicFlowList(processInstanceId, null, null);
114
+        	if(auditList.size()>0 && auditList!=null){
115
+        		for(int i = auditList.size() - 1; i >= 0; i--) { 
116
+        			if(auditList.get(i).getComment().contains("驳回")) {
117
+        				if(i<auditList.size()) {
118
+        					/*if(auditList.get(i).getActivityName().contains("库领导审批")){
119
+        						historyList = auditList.get(i-1);
120
+        					}else{
121
+        						historyList = auditList.get(i);
122
+        					}*/
123
+        					historyList = auditList.get(1);
124
+        					if(historyList!=null){
125
+        						break;
126
+        					}
127
+        				} else {
128
+        					historyList = null;
129
+        				}
130
+        			}
131
+        		}
132
+        	}
133
+			modelMap.put("subAudit", historyList);
134
+        	modelMap.put("auditList", auditList);
135
+        }
136
+        // 仓号货位号数量质量标准.
137
+        List<BusinessStoreWareDetail> storeWareDetailList= businessStoreWareDetailService.getByZidAndType(id, StoreWareType.notice.getValue());
138
+        modelMap.put("storeWareDetailList", storeWareDetailList);
139
+        return modelMap;
140
+    }
141
+
142
+    /**
143
+     * 审批.
144
+     * @param deliveryStorageNoticeId 业务主键
145
+     * @param businessApproval 中间表
146
+     * @param assignee 下一个环节审批人
147
+     * @param result 当前环节审批结果
148
+     * @return
149
+     */
150
+    @RequestMapping(value="/audit", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
151
+   	@ApiOperation(value="通知单审批", notes = "审批")
152
+    @ApiImplicitParams({
153
+   		@ApiImplicitParam(name = "deliveryStorageNoticeId", value = "业务主键", paramType = "query"),
154
+   		@ApiImplicitParam(name = "businessApproval", value = "中间表", paramType = "query"),
155
+   		@ApiImplicitParam(name = "assignee", value = "下一个环节审批人", paramType = "query"),
156
+   		@ApiImplicitParam(name = "result", value = "当前环节审批结果", paramType = "query"),
157
+   		@ApiImplicitParam(name = "name", value = "当前登录人name", paramType = "query")
158
+   	})
159
+    public Map<String, Object> audit(Integer deliveryStorageNoticeId, BusinessApproval businessApproval,String assignee,String result,String name ,HttpServletRequest request) {
160
+    	//UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
161
+        Map<String, Object> modelMap = new HashMap<String, Object>();
162
+        businessDeliveryStorageNoticeService.audit(deliveryStorageNoticeId, businessApproval,assignee,result, name);
163
+        modelMap.put("status", "success");
164
+        return modelMap;
165
+    }
166
+    
167
+    
168
+}

+ 279 - 0
src/main/java/com/chinaitop/depot/business/controller/audit/BusinessPlanAuditController.java

@@ -0,0 +1,279 @@
1
+package com.chinaitop.depot.business.controller.audit;
2
+
3
+
4
+import com.chinaitop.depot.act.model.HistoryList;
5
+import com.chinaitop.depot.act.service.ActTaskService;
6
+import com.chinaitop.depot.business.model.BusinessApproval;
7
+import com.chinaitop.depot.business.model.BusinessFile;
8
+import com.chinaitop.depot.business.model.BusinessPlan;
9
+import com.chinaitop.depot.business.model.BusinessStoreWareDetail;
10
+import com.chinaitop.depot.business.model.enums.StoreWareType;
11
+import com.chinaitop.depot.business.model.vo.BusinessPlanAuditVO;
12
+import com.chinaitop.depot.business.service.BusinessApprovalService;
13
+import com.chinaitop.depot.business.service.BusinessFileService;
14
+import com.chinaitop.depot.business.service.BusinessPlanService;
15
+import com.chinaitop.depot.business.service.BusinessStoreWareDetailService;
16
+import com.chinaitop.depot.utils.activiti.StringUtils;
17
+import com.fasterxml.jackson.core.JsonParseException;
18
+import com.fasterxml.jackson.databind.JsonMappingException;
19
+import com.github.pagehelper.PageHelper;
20
+import com.github.pagehelper.PageInfo;
21
+import io.swagger.annotations.Api;
22
+import io.swagger.annotations.ApiImplicitParam;
23
+import io.swagger.annotations.ApiImplicitParams;
24
+import io.swagger.annotations.ApiOperation;
25
+import org.springframework.beans.factory.annotation.Autowired;
26
+import org.springframework.http.MediaType;
27
+import org.springframework.web.bind.annotation.RequestMapping;
28
+import org.springframework.web.bind.annotation.RequestMethod;
29
+import org.springframework.web.bind.annotation.RestController;
30
+
31
+import javax.annotation.Resource;
32
+import javax.servlet.http.HttpServletRequest;
33
+import java.io.IOException;
34
+import java.text.SimpleDateFormat;
35
+import java.util.Date;
36
+import java.util.HashMap;
37
+import java.util.List;
38
+import java.util.Map;
39
+
40
+/**
41
+ * 粮库业务管理-计划审批管理
42
+* <p>Title: BusinessPlanAuditController</p>
43
+* <p>Description: </p>
44
+* @author yaoyabin
45
+* @date 2017年10月25日 下午5:50:37
46
+ */
47
+@RestController
48
+@RequestMapping(value="/depot/business/plan/audit")
49
+@Api(value= "BusinessPlanAuditController", description = "计划审批管理")
50
+public class BusinessPlanAuditController {
51
+    
52
+    @Resource
53
+    private BusinessPlanService businessPlanService;
54
+    @Resource
55
+    private BusinessStoreWareDetailService businessStoreWareDetailService;
56
+    @Resource
57
+    private BusinessApprovalService businessApprovalService;
58
+    @Autowired
59
+    private BusinessFileService businessFileService;
60
+    @Resource
61
+    private ActTaskService actTaskService;
62
+    
63
+    /**
64
+     * 获取审批列表.
65
+     * @param pageNum 页码
66
+     * @param pageSize 每页显示条数
67
+     * @return
68
+     */
69
+    @RequestMapping(value="/getList",  method=RequestMethod.GET)
70
+	@ApiOperation(value="获取计划审批列表", notes = "查询数据列表,支持分页")
71
+	@ApiImplicitParams({
72
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
73
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
74
+		@ApiImplicitParam(name = "userId", value = "当前登录人的id", paramType = "query")
75
+	})
76
+    public PageInfo<BusinessPlanAuditVO> getList(Integer pageNum, Integer pageSize,HttpServletRequest request,BusinessPlanAuditVO businessPlanAuditVO,Integer userId) {
77
+    	/*UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
78
+    	Integer userId = userInfo.getUserId();*/
79
+    	
80
+        PageHelper.startPage(pageNum, pageSize);
81
+        
82
+        
83
+        Map<String,Object> paramMap = new HashMap<String, Object>();
84
+        paramMap.put("operator", userId);
85
+        if(StringUtils.isNotEmpty(businessPlanAuditVO.getPlanNumber())&&businessPlanAuditVO.getPlanNumber()!=null){
86
+        	String planNumber = businessPlanAuditVO.getPlanNumber();
87
+        	paramMap.put("planNumber", planNumber);
88
+		}
89
+		if(StringUtils.isNotEmpty(businessPlanAuditVO.getAuditState())&&businessPlanAuditVO.getAuditState()!=null){
90
+			String result = businessPlanAuditVO.getAuditState();
91
+			paramMap.put("result", result);
92
+		}
93
+		//储备粮计划
94
+		if(null!=businessPlanAuditVO.getAttributeType()){
95
+			Integer attributeType = businessPlanAuditVO.getAttributeType();
96
+			paramMap.put("attributeType", attributeType);
97
+		}
98
+        List<BusinessPlanAuditVO> list = businessPlanService.getApprovalList(paramMap);
99
+        PageInfo<BusinessPlanAuditVO> pageInfo = new PageInfo<BusinessPlanAuditVO>(list);
100
+        return pageInfo;
101
+    }
102
+    
103
+    /**
104
+     * 获取审批页面详情.
105
+     * @param id  业务主键
106
+     * @param processInstanceId 流程实例id
107
+     * @return
108
+     */
109
+    @RequestMapping(value="/getAudit", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
110
+	@ApiOperation(value="获取计划审批页面详情", notes = "获取计划审批页面详情")
111
+	@ApiImplicitParams({
112
+		@ApiImplicitParam(name = "id", value = "计划id", paramType = "query"),
113
+		@ApiImplicitParam(name = "processInstanceId", value = "流程实例id", paramType = "query")
114
+	})
115
+    public Map<String, Object> getAduit(Integer id, String processInstanceId,String userName,Integer userId) {
116
+        Map<String, Object> modelMap = new HashMap<String, Object>();
117
+        // 详情.
118
+        BusinessPlan plan = businessPlanService.findById(id);
119
+        modelMap.put("plan", plan);
120
+        
121
+        // 审批列表.
122
+        if(processInstanceId!=null){
123
+        	HistoryList historyList= null;
124
+        	List<HistoryList> auditList = actTaskService.histoicFlowList(processInstanceId, null, null);
125
+        	if(auditList.size()>0 && auditList!=null){
126
+        		for(int i = auditList.size() - 1; i >= 0; i--) { 
127
+        			if(auditList.get(i).getComment().contains("驳回")) {
128
+        				if(i<auditList.size()) {
129
+        					if(auditList.get(i).getActivityName().contains("库领导审批")){
130
+        						historyList = auditList.get(i-1);
131
+        					}else{
132
+        						historyList = auditList.get(i);
133
+        					}
134
+        					if(historyList!=null){
135
+        						break;
136
+        					}
137
+        				} else {
138
+        					historyList = null;
139
+        				}
140
+        			}
141
+        		}
142
+        	}
143
+			modelMap.put("subAudit", historyList);
144
+        	modelMap.put("auditList", auditList);
145
+        }
146
+        
147
+        // 获取对应的文件.
148
+        List<BusinessFile> fileList= businessFileService.getByBid(id,"plan", null, null);
149
+        
150
+        modelMap.put("fileList", fileList);
151
+        
152
+        // 仓号货位号数量质量标准.
153
+        List<BusinessStoreWareDetail> storeWareDetailList= businessStoreWareDetailService.getByZidAndType(id, StoreWareType.plan.getValue());
154
+        modelMap.put("storeWareDetailList", storeWareDetailList);
155
+        return modelMap;
156
+    }
157
+
158
+    /**
159
+     * 审批.
160
+     * @param planId 业务主键
161
+     * @param businessApproval 中间表
162
+     * @param assignee 下一个环节审批人
163
+     * @param result 当前环节审批结果
164
+     * @return
165
+     */
166
+    @RequestMapping(value="/audit", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
167
+	@ApiOperation(value="计划审批", notes = "计划审批")
168
+    @ApiImplicitParams({
169
+    	@ApiImplicitParam(name="planId", value="计划id", paramType="form"),
170
+    	@ApiImplicitParam(name="businessApproval", value="中间表数据", paramType="form"),
171
+    	@ApiImplicitParam(name="assignee", value="下一个环节审批人", paramType="form"),
172
+    	@ApiImplicitParam(name="result", value="当前环节审批结果", paramType="form"),
173
+    	@ApiImplicitParam(name="userId", value="当前登录人id", paramType="form"),
174
+    	@ApiImplicitParam(name="realName", value="前登录人姓名", paramType="form")
175
+    })
176
+    public Map<String, Object> audit(HttpServletRequest request, Integer planId,
177
+            BusinessApproval businessApproval, String assignee, String result,Integer userId, String realName) {
178
+        //UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
179
+        Map<String, Object> modelMap = new HashMap<String, Object>();
180
+        businessPlanService.audit(planId, businessApproval,assignee,result,  userId,  realName);
181
+        modelMap.put("status", "success");
182
+        return modelMap;
183
+    }
184
+
185
+    /**
186
+     * 获取计划验收列表.
187
+     * @param pageNum 页码
188
+     * @param pageSize 每页显示条数
189
+     * @return
190
+     */
191
+    @RequestMapping(value="/getAcceptanceList", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
192
+    @ApiOperation(value="计划验收", notes = "获取计划验收列表")
193
+    @ApiImplicitParams({
194
+            @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
195
+            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
196
+            @ApiImplicitParam(name = "userId", value = "当前登录人的id", paramType = "query"),
197
+            @ApiImplicitParam(name = "businessPlanAuditVO", value = "查询条件", paramType = "query")
198
+    })
199
+    public PageInfo<BusinessPlanAuditVO> getAcceptanceList(Integer pageNum, Integer pageSize,String userId,BusinessPlanAuditVO businessPlanAuditVO) {
200
+        PageHelper.startPage(pageNum, pageSize);
201
+        String planNumber = businessPlanAuditVO.getPlanNumber();
202
+        String planTitle = businessPlanAuditVO.getPlanTitle();
203
+        Map<String,Object> paramMap = new HashMap<String, Object>();
204
+        paramMap.put("operator", userId);
205
+        if(StringUtils.isNotEmpty(businessPlanAuditVO.getPlanNumber())&&businessPlanAuditVO.getPlanNumber()!=null){
206
+            paramMap.put("planNumber", planNumber);
207
+        }
208
+        if(StringUtils.isNotEmpty(businessPlanAuditVO.getPlanTitle())&&businessPlanAuditVO.getPlanTitle()!=null){
209
+            paramMap.put("planTitle", planTitle);
210
+        }
211
+        List<BusinessPlanAuditVO> list = businessPlanService.getAcceptanceList(paramMap);
212
+        PageInfo<BusinessPlanAuditVO> pageInfo = new PageInfo<BusinessPlanAuditVO>(list);
213
+        return pageInfo;
214
+    }
215
+
216
+    /**
217
+     * 保存
218
+     * @param businessPlanId 计划json
219
+     * @return
220
+     * @throws JsonParseException
221
+     * @throws JsonMappingException
222
+     * @throws IOException
223
+     */
224
+    @RequestMapping(value="/save", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
225
+    @ApiOperation(value="保存计划验收", notes = "保存计划验收详细信息")
226
+    @ApiImplicitParams({
227
+            @ApiImplicitParam(name = "businessPlanId", value = "计划id", paramType = "query"),
228
+            @ApiImplicitParam(name = "businessPlancreateTime", value = "计划验收时间", paramType = "query"),
229
+            @ApiImplicitParam(name = "businessStoreWareDetailJson", value = "验收详细信息", paramType = "query"),
230
+            @ApiImplicitParam(name = "fileIds", value = "附件id", paramType = "query"),
231
+            @ApiImplicitParam(name = "acceptanceNumber", value = "申请验收编号", paramType = "query"),
232
+    })
233
+    public Map<String, Object> save(String businessPlanId,String acceptanceNumber,String businessPlancreateTime, String qualityIds, String fileIds) throws JsonParseException, JsonMappingException, IOException {
234
+        Map<String, Object> modelMap = new HashMap<String, Object>();
235
+        BusinessPlan plan = new BusinessPlan();
236
+        try {
237
+        	Date date = new Date();
238
+        	plan.setAcceptTanceDate(date);
239
+        	plan.setCustomerPlanState("60");
240
+        	plan.setId(Integer.valueOf(businessPlanId));
241
+        	businessPlanService.updatePlanStatus(plan);
242
+            // JSON字符串转对象
243
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
244
+            Map<String, Object> returnMap = businessPlanService.addAcceptance(businessPlanId,acceptanceNumber, sdf.format(date), qualityIds, fileIds);
245
+            if (returnMap.get("error") != null) {
246
+                modelMap.put("status", "error");
247
+                modelMap.put("msg", returnMap.get("error"));
248
+                return modelMap;
249
+            }
250
+            modelMap.put("id", returnMap.get("id"));
251
+
252
+            modelMap.put("status", "success");
253
+        } catch (Exception e) {
254
+            e.printStackTrace();
255
+            modelMap.put("status", "error");
256
+            modelMap.put("msg", "保存失败!");
257
+            return modelMap;
258
+        }
259
+        return modelMap;
260
+    }
261
+
262
+    /**
263
+     * 获取计划验收列表.
264
+     * @param bid 验收id
265
+     * @return
266
+     */
267
+    @RequestMapping(value="/getDataByZJId", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
268
+    @ApiOperation(value="计划验收详情", notes = "查看验收计划详情。")
269
+    @ApiImplicitParams({
270
+            @ApiImplicitParam(name = "bid", value = "主表id", paramType = "query"),
271
+            @ApiImplicitParam(name = "fileType", value = "文件类型", paramType = "query")
272
+    })
273
+    public Map<String,Object> getDataByZJId(Integer bid,String fileType) {
274
+        Map<String,Object> map = new HashMap<String, Object>();
275
+        List<BusinessFile> fileList= businessFileService.getByBid(bid, fileType, null, null);
276
+        map.put("fileList", fileList);
277
+        return map;
278
+    }
279
+}

+ 34 - 0
src/main/java/com/chinaitop/depot/business/mapper/BusinessApprovalMapper.java

@@ -0,0 +1,34 @@
1
+package com.chinaitop.depot.business.mapper;
2
+
3
+import com.chinaitop.depot.business.model.BusinessApproval;
4
+import com.chinaitop.depot.business.model.BusinessApprovalExample;
5
+import org.apache.ibatis.annotations.Param;
6
+
7
+import java.util.List;
8
+import java.util.Map;
9
+
10
+public interface BusinessApprovalMapper {
11
+    int countByExample(BusinessApprovalExample example);
12
+
13
+    int deleteByExample(BusinessApprovalExample example);
14
+
15
+    int deleteByPrimaryKey(Integer id);
16
+
17
+    int insert(BusinessApproval record);
18
+
19
+    int insertSelective(BusinessApproval record);
20
+
21
+    List<BusinessApproval> selectByExample(BusinessApprovalExample example);
22
+
23
+    BusinessApproval selectByPrimaryKey(Integer id);
24
+
25
+    int updateByExampleSelective(@Param("record") BusinessApproval record, @Param("example") BusinessApprovalExample example);
26
+
27
+    int updateByExample(@Param("record") BusinessApproval record, @Param("example") BusinessApprovalExample example);
28
+
29
+    int updateByPrimaryKeySelective(BusinessApproval record);
30
+
31
+    int updateByPrimaryKey(BusinessApproval record);
32
+
33
+	List<BusinessApproval> queryByMap(Map<String, Object> map);
34
+}

+ 744 - 0
src/main/java/com/chinaitop/depot/business/mapper/BusinessApprovalMapper.xml

@@ -0,0 +1,744 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.chinaitop.depot.business.mapper.BusinessApprovalMapper" >
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.business.model.BusinessApproval" >
5
+    <!--
6
+      WARNING - @mbggenerated
7
+      This element is automatically generated by MyBatis Generator, do not modify.
8
+      This element was generated on Thu Oct 26 14:47:31 CST 2017.
9
+    -->
10
+    <id column="id" property="id" jdbcType="INTEGER" />
11
+    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
12
+    <result column="is_deleted" property="isDeleted" jdbcType="INTEGER" />
13
+    <result column="remark" property="remark" jdbcType="VARCHAR" />
14
+    <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
15
+    <result column="content" property="content" jdbcType="VARCHAR" />
16
+    <result column="from_department" property="fromDepartment" jdbcType="VARCHAR" />
17
+    <result column="from_people" property="fromPeople" jdbcType="VARCHAR" />
18
+    <result column="from_user_name" property="fromUserName" jdbcType="VARCHAR" />
19
+    <result column="last_people" property="lastPeople" jdbcType="VARCHAR" />
20
+    <result column="operate_time" property="operateTime" jdbcType="VARCHAR" />
21
+    <result column="operator" property="operator" jdbcType="VARCHAR" />
22
+    <result column="operator_name" property="operatorName" jdbcType="VARCHAR" />
23
+    <result column="process_instance_id" property="processInstanceId" jdbcType="VARCHAR" />
24
+    <result column="project_id" property="projectId" jdbcType="INTEGER" />
25
+    <result column="project_name" property="projectName" jdbcType="VARCHAR" />
26
+    <result column="result" property="result" jdbcType="VARCHAR" />
27
+    <result column="task_id" property="taskId" jdbcType="VARCHAR" />
28
+    <result column="task_info" property="taskInfo" jdbcType="VARCHAR" />
29
+    <result column="task_name" property="taskName" jdbcType="VARCHAR" />
30
+    <result column="task_type" property="taskType" jdbcType="VARCHAR" />
31
+    <result column="title" property="title" jdbcType="VARCHAR" />
32
+    <result column="version" property="version" jdbcType="INTEGER" />
33
+    <result column="task_type_name" property="taskTypeName" jdbcType="VARCHAR" />
34
+    <result column="is_hide" property="isHide" jdbcType="INTEGER" />
35
+    <result column="is_countersign" property="isCountersign" jdbcType="INTEGER" />
36
+    <result column="apply_name" property="applyName" jdbcType="VARCHAR" />
37
+    <result column="apply_name_id" property="applyNameId" jdbcType="VARCHAR" />
38
+    <result column="apply_time" property="applyTime" jdbcType="TIMESTAMP" />
39
+  </resultMap>
40
+  <sql id="Example_Where_Clause" >
41
+    <!--
42
+      WARNING - @mbggenerated
43
+      This element is automatically generated by MyBatis Generator, do not modify.
44
+      This element was generated on Thu Oct 26 14:47:31 CST 2017.
45
+    -->
46
+    <where >
47
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
48
+        <if test="criteria.valid" >
49
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
50
+            <foreach collection="criteria.criteria" item="criterion" >
51
+              <choose >
52
+                <when test="criterion.noValue" >
53
+                  and ${criterion.condition}
54
+                </when>
55
+                <when test="criterion.singleValue" >
56
+                  and ${criterion.condition} #{criterion.value}
57
+                </when>
58
+                <when test="criterion.betweenValue" >
59
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
60
+                </when>
61
+                <when test="criterion.listValue" >
62
+                  and ${criterion.condition}
63
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
64
+                    #{listItem}
65
+                  </foreach>
66
+                </when>
67
+              </choose>
68
+            </foreach>
69
+          </trim>
70
+        </if>
71
+      </foreach>
72
+    </where>
73
+  </sql>
74
+  <sql id="Update_By_Example_Where_Clause" >
75
+    <!--
76
+      WARNING - @mbggenerated
77
+      This element is automatically generated by MyBatis Generator, do not modify.
78
+      This element was generated on Thu Oct 26 14:47:31 CST 2017.
79
+    -->
80
+    <where >
81
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
82
+        <if test="criteria.valid" >
83
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
84
+            <foreach collection="criteria.criteria" item="criterion" >
85
+              <choose >
86
+                <when test="criterion.noValue" >
87
+                  and ${criterion.condition}
88
+                </when>
89
+                <when test="criterion.singleValue" >
90
+                  and ${criterion.condition} #{criterion.value}
91
+                </when>
92
+                <when test="criterion.betweenValue" >
93
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
94
+                </when>
95
+                <when test="criterion.listValue" >
96
+                  and ${criterion.condition}
97
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
98
+                    #{listItem}
99
+                  </foreach>
100
+                </when>
101
+              </choose>
102
+            </foreach>
103
+          </trim>
104
+        </if>
105
+      </foreach>
106
+    </where>
107
+  </sql>
108
+  <sql id="Base_Column_List" >
109
+    <!--
110
+      WARNING - @mbggenerated
111
+      This element is automatically generated by MyBatis Generator, do not modify.
112
+      This element was generated on Thu Oct 26 14:47:31 CST 2017.
113
+    -->
114
+    id, create_time, is_deleted, remark, update_time, content, from_department, from_people, 
115
+    from_user_name, last_people, operate_time, operator, operator_name, process_instance_id, 
116
+    project_id, project_name, result, task_id, task_info, task_name, task_type, title, 
117
+    version, task_type_name, is_hide, is_countersign, apply_name, apply_name_id, apply_time
118
+  </sql>
119
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.business.model.BusinessApprovalExample" >
120
+    <!--
121
+      WARNING - @mbggenerated
122
+      This element is automatically generated by MyBatis Generator, do not modify.
123
+      This element was generated on Thu Oct 26 14:47:31 CST 2017.
124
+    -->
125
+    select
126
+    <if test="distinct" >
127
+      distinct
128
+    </if>
129
+    <include refid="Base_Column_List" />
130
+    from business_approval
131
+    <if test="_parameter != null" >
132
+      <include refid="Example_Where_Clause" />
133
+    </if>
134
+    <if test="orderByClause != null" >
135
+      order by ${orderByClause}
136
+    </if>
137
+  </select>
138
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
139
+    <!--
140
+      WARNING - @mbggenerated
141
+      This element is automatically generated by MyBatis Generator, do not modify.
142
+      This element was generated on Thu Oct 26 14:47:31 CST 2017.
143
+    -->
144
+    select 
145
+    <include refid="Base_Column_List" />
146
+    from business_approval
147
+    where id = #{id,jdbcType=INTEGER}
148
+  </select>
149
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
150
+    <!--
151
+      WARNING - @mbggenerated
152
+      This element is automatically generated by MyBatis Generator, do not modify.
153
+      This element was generated on Thu Oct 26 14:47:31 CST 2017.
154
+    -->
155
+    delete from business_approval
156
+    where id = #{id,jdbcType=INTEGER}
157
+  </delete>
158
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.business.model.BusinessApprovalExample" >
159
+    <!--
160
+      WARNING - @mbggenerated
161
+      This element is automatically generated by MyBatis Generator, do not modify.
162
+      This element was generated on Thu Oct 26 14:47:31 CST 2017.
163
+    -->
164
+    delete from business_approval
165
+    <if test="_parameter != null" >
166
+      <include refid="Example_Where_Clause" />
167
+    </if>
168
+  </delete>
169
+  <insert id="insert" parameterType="com.chinaitop.depot.business.model.BusinessApproval" >
170
+    <!--
171
+      WARNING - @mbggenerated
172
+      This element is automatically generated by MyBatis Generator, do not modify.
173
+      This element was generated on Thu Oct 26 14:47:31 CST 2017.
174
+    -->
175
+    insert into business_approval (id, create_time, is_deleted, 
176
+      remark, update_time, content, 
177
+      from_department, from_people, from_user_name, 
178
+      last_people, operate_time, operator, 
179
+      operator_name, process_instance_id, project_id, 
180
+      project_name, result, task_id, 
181
+      task_info, task_name, task_type, 
182
+      title, version, task_type_name, 
183
+      is_hide, is_countersign, apply_name, 
184
+      apply_name_id, apply_time)
185
+    values (#{id,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=INTEGER}, 
186
+      #{remark,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{content,jdbcType=VARCHAR}, 
187
+      #{fromDepartment,jdbcType=VARCHAR}, #{fromPeople,jdbcType=VARCHAR}, #{fromUserName,jdbcType=VARCHAR}, 
188
+      #{lastPeople,jdbcType=VARCHAR}, #{operateTime,jdbcType=VARCHAR}, #{operator,jdbcType=VARCHAR}, 
189
+      #{operatorName,jdbcType=VARCHAR}, #{processInstanceId,jdbcType=VARCHAR}, #{projectId,jdbcType=INTEGER}, 
190
+      #{projectName,jdbcType=VARCHAR}, #{result,jdbcType=VARCHAR}, #{taskId,jdbcType=VARCHAR}, 
191
+      #{taskInfo,jdbcType=VARCHAR}, #{taskName,jdbcType=VARCHAR}, #{taskType,jdbcType=VARCHAR}, 
192
+      #{title,jdbcType=VARCHAR}, #{version,jdbcType=INTEGER}, #{taskTypeName,jdbcType=VARCHAR}, 
193
+      #{isHide,jdbcType=INTEGER}, #{isCountersign,jdbcType=INTEGER}, #{applyName,jdbcType=VARCHAR}, 
194
+      #{applyNameId,jdbcType=VARCHAR}, #{applyTime,jdbcType=TIMESTAMP})
195
+  </insert>
196
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.business.model.BusinessApproval" >
197
+    <!--
198
+      WARNING - @mbggenerated
199
+      This element is automatically generated by MyBatis Generator, do not modify.
200
+      This element was generated on Thu Oct 26 14:47:31 CST 2017.
201
+    -->
202
+    insert into business_approval
203
+    <trim prefix="(" suffix=")" suffixOverrides="," >
204
+      <if test="id != null" >
205
+        id,
206
+      </if>
207
+      <if test="createTime != null" >
208
+        create_time,
209
+      </if>
210
+      <if test="isDeleted != null" >
211
+        is_deleted,
212
+      </if>
213
+      <if test="remark != null" >
214
+        remark,
215
+      </if>
216
+      <if test="updateTime != null" >
217
+        update_time,
218
+      </if>
219
+      <if test="content != null" >
220
+        content,
221
+      </if>
222
+      <if test="fromDepartment != null" >
223
+        from_department,
224
+      </if>
225
+      <if test="fromPeople != null" >
226
+        from_people,
227
+      </if>
228
+      <if test="fromUserName != null" >
229
+        from_user_name,
230
+      </if>
231
+      <if test="lastPeople != null" >
232
+        last_people,
233
+      </if>
234
+      <if test="operateTime != null" >
235
+        operate_time,
236
+      </if>
237
+      <if test="operator != null" >
238
+        operator,
239
+      </if>
240
+      <if test="operatorName != null" >
241
+        operator_name,
242
+      </if>
243
+      <if test="processInstanceId != null" >
244
+        process_instance_id,
245
+      </if>
246
+      <if test="projectId != null" >
247
+        project_id,
248
+      </if>
249
+      <if test="projectName != null" >
250
+        project_name,
251
+      </if>
252
+      <if test="result != null" >
253
+        result,
254
+      </if>
255
+      <if test="taskId != null" >
256
+        task_id,
257
+      </if>
258
+      <if test="taskInfo != null" >
259
+        task_info,
260
+      </if>
261
+      <if test="taskName != null" >
262
+        task_name,
263
+      </if>
264
+      <if test="taskType != null" >
265
+        task_type,
266
+      </if>
267
+      <if test="title != null" >
268
+        title,
269
+      </if>
270
+      <if test="version != null" >
271
+        version,
272
+      </if>
273
+      <if test="taskTypeName != null" >
274
+        task_type_name,
275
+      </if>
276
+      <if test="isHide != null" >
277
+        is_hide,
278
+      </if>
279
+      <if test="isCountersign != null" >
280
+        is_countersign,
281
+      </if>
282
+      <if test="applyName != null" >
283
+        apply_name,
284
+      </if>
285
+      <if test="applyNameId != null" >
286
+        apply_name_id,
287
+      </if>
288
+      <if test="applyTime != null" >
289
+        apply_time,
290
+      </if>
291
+    </trim>
292
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
293
+      <if test="id != null" >
294
+        #{id,jdbcType=INTEGER},
295
+      </if>
296
+      <if test="createTime != null" >
297
+        #{createTime,jdbcType=TIMESTAMP},
298
+      </if>
299
+      <if test="isDeleted != null" >
300
+        #{isDeleted,jdbcType=INTEGER},
301
+      </if>
302
+      <if test="remark != null" >
303
+        #{remark,jdbcType=VARCHAR},
304
+      </if>
305
+      <if test="updateTime != null" >
306
+        #{updateTime,jdbcType=TIMESTAMP},
307
+      </if>
308
+      <if test="content != null" >
309
+        #{content,jdbcType=VARCHAR},
310
+      </if>
311
+      <if test="fromDepartment != null" >
312
+        #{fromDepartment,jdbcType=VARCHAR},
313
+      </if>
314
+      <if test="fromPeople != null" >
315
+        #{fromPeople,jdbcType=VARCHAR},
316
+      </if>
317
+      <if test="fromUserName != null" >
318
+        #{fromUserName,jdbcType=VARCHAR},
319
+      </if>
320
+      <if test="lastPeople != null" >
321
+        #{lastPeople,jdbcType=VARCHAR},
322
+      </if>
323
+      <if test="operateTime != null" >
324
+        #{operateTime,jdbcType=VARCHAR},
325
+      </if>
326
+      <if test="operator != null" >
327
+        #{operator,jdbcType=VARCHAR},
328
+      </if>
329
+      <if test="operatorName != null" >
330
+        #{operatorName,jdbcType=VARCHAR},
331
+      </if>
332
+      <if test="processInstanceId != null" >
333
+        #{processInstanceId,jdbcType=VARCHAR},
334
+      </if>
335
+      <if test="projectId != null" >
336
+        #{projectId,jdbcType=INTEGER},
337
+      </if>
338
+      <if test="projectName != null" >
339
+        #{projectName,jdbcType=VARCHAR},
340
+      </if>
341
+      <if test="result != null" >
342
+        #{result,jdbcType=VARCHAR},
343
+      </if>
344
+      <if test="taskId != null" >
345
+        #{taskId,jdbcType=VARCHAR},
346
+      </if>
347
+      <if test="taskInfo != null" >
348
+        #{taskInfo,jdbcType=VARCHAR},
349
+      </if>
350
+      <if test="taskName != null" >
351
+        #{taskName,jdbcType=VARCHAR},
352
+      </if>
353
+      <if test="taskType != null" >
354
+        #{taskType,jdbcType=VARCHAR},
355
+      </if>
356
+      <if test="title != null" >
357
+        #{title,jdbcType=VARCHAR},
358
+      </if>
359
+      <if test="version != null" >
360
+        #{version,jdbcType=INTEGER},
361
+      </if>
362
+      <if test="taskTypeName != null" >
363
+        #{taskTypeName,jdbcType=VARCHAR},
364
+      </if>
365
+      <if test="isHide != null" >
366
+        #{isHide,jdbcType=INTEGER},
367
+      </if>
368
+      <if test="isCountersign != null" >
369
+        #{isCountersign,jdbcType=INTEGER},
370
+      </if>
371
+      <if test="applyName != null" >
372
+        #{applyName,jdbcType=VARCHAR},
373
+      </if>
374
+      <if test="applyNameId != null" >
375
+        #{applyNameId,jdbcType=VARCHAR},
376
+      </if>
377
+      <if test="applyTime != null" >
378
+        #{applyTime,jdbcType=TIMESTAMP},
379
+      </if>
380
+    </trim>
381
+  </insert>
382
+  <select id="countByExample" parameterType="com.chinaitop.depot.business.model.BusinessApprovalExample" resultType="java.lang.Integer" >
383
+    <!--
384
+      WARNING - @mbggenerated
385
+      This element is automatically generated by MyBatis Generator, do not modify.
386
+      This element was generated on Thu Oct 26 14:47:31 CST 2017.
387
+    -->
388
+    select count(*) from business_approval
389
+    <if test="_parameter != null" >
390
+      <include refid="Example_Where_Clause" />
391
+    </if>
392
+  </select>
393
+  <update id="updateByExampleSelective" parameterType="map" >
394
+    <!--
395
+      WARNING - @mbggenerated
396
+      This element is automatically generated by MyBatis Generator, do not modify.
397
+      This element was generated on Thu Oct 26 14:47:31 CST 2017.
398
+    -->
399
+    update business_approval
400
+    <set >
401
+      <if test="record.id != null" >
402
+        id = #{record.id,jdbcType=INTEGER},
403
+      </if>
404
+      <if test="record.createTime != null" >
405
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
406
+      </if>
407
+      <if test="record.isDeleted != null" >
408
+        is_deleted = #{record.isDeleted,jdbcType=INTEGER},
409
+      </if>
410
+      <if test="record.remark != null" >
411
+        remark = #{record.remark,jdbcType=VARCHAR},
412
+      </if>
413
+      <if test="record.updateTime != null" >
414
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
415
+      </if>
416
+      <if test="record.content != null" >
417
+        content = #{record.content,jdbcType=VARCHAR},
418
+      </if>
419
+      <if test="record.fromDepartment != null" >
420
+        from_department = #{record.fromDepartment,jdbcType=VARCHAR},
421
+      </if>
422
+      <if test="record.fromPeople != null" >
423
+        from_people = #{record.fromPeople,jdbcType=VARCHAR},
424
+      </if>
425
+      <if test="record.fromUserName != null" >
426
+        from_user_name = #{record.fromUserName,jdbcType=VARCHAR},
427
+      </if>
428
+      <if test="record.lastPeople != null" >
429
+        last_people = #{record.lastPeople,jdbcType=VARCHAR},
430
+      </if>
431
+      <if test="record.operateTime != null" >
432
+        operate_time = #{record.operateTime,jdbcType=VARCHAR},
433
+      </if>
434
+      <if test="record.operator != null" >
435
+        operator = #{record.operator,jdbcType=VARCHAR},
436
+      </if>
437
+      <if test="record.operatorName != null" >
438
+        operator_name = #{record.operatorName,jdbcType=VARCHAR},
439
+      </if>
440
+      <if test="record.processInstanceId != null" >
441
+        process_instance_id = #{record.processInstanceId,jdbcType=VARCHAR},
442
+      </if>
443
+      <if test="record.projectId != null" >
444
+        project_id = #{record.projectId,jdbcType=INTEGER},
445
+      </if>
446
+      <if test="record.projectName != null" >
447
+        project_name = #{record.projectName,jdbcType=VARCHAR},
448
+      </if>
449
+      <if test="record.result != null" >
450
+        result = #{record.result,jdbcType=VARCHAR},
451
+      </if>
452
+      <if test="record.taskId != null" >
453
+        task_id = #{record.taskId,jdbcType=VARCHAR},
454
+      </if>
455
+      <if test="record.taskInfo != null" >
456
+        task_info = #{record.taskInfo,jdbcType=VARCHAR},
457
+      </if>
458
+      <if test="record.taskName != null" >
459
+        task_name = #{record.taskName,jdbcType=VARCHAR},
460
+      </if>
461
+      <if test="record.taskType != null" >
462
+        task_type = #{record.taskType,jdbcType=VARCHAR},
463
+      </if>
464
+      <if test="record.title != null" >
465
+        title = #{record.title,jdbcType=VARCHAR},
466
+      </if>
467
+      <if test="record.version != null" >
468
+        version = #{record.version,jdbcType=INTEGER},
469
+      </if>
470
+      <if test="record.taskTypeName != null" >
471
+        task_type_name = #{record.taskTypeName,jdbcType=VARCHAR},
472
+      </if>
473
+      <if test="record.isHide != null" >
474
+        is_hide = #{record.isHide,jdbcType=INTEGER},
475
+      </if>
476
+      <if test="record.isCountersign != null" >
477
+        is_countersign = #{record.isCountersign,jdbcType=INTEGER},
478
+      </if>
479
+      <if test="record.applyName != null" >
480
+        apply_name = #{record.applyName,jdbcType=VARCHAR},
481
+      </if>
482
+      <if test="record.applyNameId != null" >
483
+        apply_name_id = #{record.applyNameId,jdbcType=VARCHAR},
484
+      </if>
485
+      <if test="record.applyTime != null" >
486
+        apply_time = #{record.applyTime,jdbcType=TIMESTAMP},
487
+      </if>
488
+    </set>
489
+    <if test="_parameter != null" >
490
+      <include refid="Update_By_Example_Where_Clause" />
491
+    </if>
492
+  </update>
493
+  <update id="updateByExample" parameterType="map" >
494
+    <!--
495
+      WARNING - @mbggenerated
496
+      This element is automatically generated by MyBatis Generator, do not modify.
497
+      This element was generated on Thu Oct 26 14:47:31 CST 2017.
498
+    -->
499
+    update business_approval
500
+    set id = #{record.id,jdbcType=INTEGER},
501
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
502
+      is_deleted = #{record.isDeleted,jdbcType=INTEGER},
503
+      remark = #{record.remark,jdbcType=VARCHAR},
504
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
505
+      content = #{record.content,jdbcType=VARCHAR},
506
+      from_department = #{record.fromDepartment,jdbcType=VARCHAR},
507
+      from_people = #{record.fromPeople,jdbcType=VARCHAR},
508
+      from_user_name = #{record.fromUserName,jdbcType=VARCHAR},
509
+      last_people = #{record.lastPeople,jdbcType=VARCHAR},
510
+      operate_time = #{record.operateTime,jdbcType=VARCHAR},
511
+      operator = #{record.operator,jdbcType=VARCHAR},
512
+      operator_name = #{record.operatorName,jdbcType=VARCHAR},
513
+      process_instance_id = #{record.processInstanceId,jdbcType=VARCHAR},
514
+      project_id = #{record.projectId,jdbcType=INTEGER},
515
+      project_name = #{record.projectName,jdbcType=VARCHAR},
516
+      result = #{record.result,jdbcType=VARCHAR},
517
+      task_id = #{record.taskId,jdbcType=VARCHAR},
518
+      task_info = #{record.taskInfo,jdbcType=VARCHAR},
519
+      task_name = #{record.taskName,jdbcType=VARCHAR},
520
+      task_type = #{record.taskType,jdbcType=VARCHAR},
521
+      title = #{record.title,jdbcType=VARCHAR},
522
+      version = #{record.version,jdbcType=INTEGER},
523
+      task_type_name = #{record.taskTypeName,jdbcType=VARCHAR},
524
+      is_hide = #{record.isHide,jdbcType=INTEGER},
525
+      is_countersign = #{record.isCountersign,jdbcType=INTEGER},
526
+      apply_name = #{record.applyName,jdbcType=VARCHAR},
527
+      apply_name_id = #{record.applyNameId,jdbcType=VARCHAR},
528
+      apply_time = #{record.applyTime,jdbcType=TIMESTAMP}
529
+    <if test="_parameter != null" >
530
+      <include refid="Update_By_Example_Where_Clause" />
531
+    </if>
532
+  </update>
533
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.business.model.BusinessApproval" >
534
+    <!--
535
+      WARNING - @mbggenerated
536
+      This element is automatically generated by MyBatis Generator, do not modify.
537
+      This element was generated on Thu Oct 26 14:47:31 CST 2017.
538
+    -->
539
+    update business_approval
540
+    <set >
541
+      <if test="createTime != null" >
542
+        create_time = #{createTime,jdbcType=TIMESTAMP},
543
+      </if>
544
+      <if test="isDeleted != null" >
545
+        is_deleted = #{isDeleted,jdbcType=INTEGER},
546
+      </if>
547
+      <if test="remark != null" >
548
+        remark = #{remark,jdbcType=VARCHAR},
549
+      </if>
550
+      <if test="updateTime != null" >
551
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
552
+      </if>
553
+      <if test="content != null" >
554
+        content = #{content,jdbcType=VARCHAR},
555
+      </if>
556
+      <if test="fromDepartment != null" >
557
+        from_department = #{fromDepartment,jdbcType=VARCHAR},
558
+      </if>
559
+      <if test="fromPeople != null" >
560
+        from_people = #{fromPeople,jdbcType=VARCHAR},
561
+      </if>
562
+      <if test="fromUserName != null" >
563
+        from_user_name = #{fromUserName,jdbcType=VARCHAR},
564
+      </if>
565
+      <if test="lastPeople != null" >
566
+        last_people = #{lastPeople,jdbcType=VARCHAR},
567
+      </if>
568
+      <if test="operateTime != null" >
569
+        operate_time = #{operateTime,jdbcType=VARCHAR},
570
+      </if>
571
+      <if test="operator != null" >
572
+        operator = #{operator,jdbcType=VARCHAR},
573
+      </if>
574
+      <if test="operatorName != null" >
575
+        operator_name = #{operatorName,jdbcType=VARCHAR},
576
+      </if>
577
+      <if test="processInstanceId != null" >
578
+        process_instance_id = #{processInstanceId,jdbcType=VARCHAR},
579
+      </if>
580
+      <if test="projectId != null" >
581
+        project_id = #{projectId,jdbcType=INTEGER},
582
+      </if>
583
+      <if test="projectName != null" >
584
+        project_name = #{projectName,jdbcType=VARCHAR},
585
+      </if>
586
+      <if test="result != null" >
587
+        result = #{result,jdbcType=VARCHAR},
588
+      </if>
589
+      <if test="taskId != null" >
590
+        task_id = #{taskId,jdbcType=VARCHAR},
591
+      </if>
592
+      <if test="taskInfo != null" >
593
+        task_info = #{taskInfo,jdbcType=VARCHAR},
594
+      </if>
595
+      <if test="taskName != null" >
596
+        task_name = #{taskName,jdbcType=VARCHAR},
597
+      </if>
598
+      <if test="taskType != null" >
599
+        task_type = #{taskType,jdbcType=VARCHAR},
600
+      </if>
601
+      <if test="title != null" >
602
+        title = #{title,jdbcType=VARCHAR},
603
+      </if>
604
+      <if test="version != null" >
605
+        version = #{version,jdbcType=INTEGER},
606
+      </if>
607
+      <if test="taskTypeName != null" >
608
+        task_type_name = #{taskTypeName,jdbcType=VARCHAR},
609
+      </if>
610
+      <if test="isHide != null" >
611
+        is_hide = #{isHide,jdbcType=INTEGER},
612
+      </if>
613
+      <if test="isCountersign != null" >
614
+        is_countersign = #{isCountersign,jdbcType=INTEGER},
615
+      </if>
616
+      <if test="applyName != null" >
617
+        apply_name = #{applyName,jdbcType=VARCHAR},
618
+      </if>
619
+      <if test="applyNameId != null" >
620
+        apply_name_id = #{applyNameId,jdbcType=VARCHAR},
621
+      </if>
622
+      <if test="applyTime != null" >
623
+        apply_time = #{applyTime,jdbcType=TIMESTAMP},
624
+      </if>
625
+    </set>
626
+    where id = #{id,jdbcType=INTEGER}
627
+  </update>
628
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.business.model.BusinessApproval" >
629
+    <!--
630
+      WARNING - @mbggenerated
631
+      This element is automatically generated by MyBatis Generator, do not modify.
632
+      This element was generated on Thu Oct 26 14:47:31 CST 2017.
633
+    -->
634
+    update business_approval
635
+    set create_time = #{createTime,jdbcType=TIMESTAMP},
636
+      is_deleted = #{isDeleted,jdbcType=INTEGER},
637
+      remark = #{remark,jdbcType=VARCHAR},
638
+      update_time = #{updateTime,jdbcType=TIMESTAMP},
639
+      content = #{content,jdbcType=VARCHAR},
640
+      from_department = #{fromDepartment,jdbcType=VARCHAR},
641
+      from_people = #{fromPeople,jdbcType=VARCHAR},
642
+      from_user_name = #{fromUserName,jdbcType=VARCHAR},
643
+      last_people = #{lastPeople,jdbcType=VARCHAR},
644
+      operate_time = #{operateTime,jdbcType=VARCHAR},
645
+      operator = #{operator,jdbcType=VARCHAR},
646
+      operator_name = #{operatorName,jdbcType=VARCHAR},
647
+      process_instance_id = #{processInstanceId,jdbcType=VARCHAR},
648
+      project_id = #{projectId,jdbcType=INTEGER},
649
+      project_name = #{projectName,jdbcType=VARCHAR},
650
+      result = #{result,jdbcType=VARCHAR},
651
+      task_id = #{taskId,jdbcType=VARCHAR},
652
+      task_info = #{taskInfo,jdbcType=VARCHAR},
653
+      task_name = #{taskName,jdbcType=VARCHAR},
654
+      task_type = #{taskType,jdbcType=VARCHAR},
655
+      title = #{title,jdbcType=VARCHAR},
656
+      version = #{version,jdbcType=INTEGER},
657
+      task_type_name = #{taskTypeName,jdbcType=VARCHAR},
658
+      is_hide = #{isHide,jdbcType=INTEGER},
659
+      is_countersign = #{isCountersign,jdbcType=INTEGER},
660
+      apply_name = #{applyName,jdbcType=VARCHAR},
661
+      apply_name_id = #{applyNameId,jdbcType=VARCHAR},
662
+      apply_time = #{applyTime,jdbcType=TIMESTAMP}
663
+    where id = #{id,jdbcType=INTEGER}
664
+  </update>
665
+
666
+   <select id="queryByMap" parameterType="java.util.Map" resultMap="BaseResultMap">
667
+	select 
668
+		MAX(ba.create_time),
669
+	    ba.*,
670
+        dp.id dpId,
671
+        dp.audit_state auditState,
672
+        du.id duId,
673
+        du.state state
674
+     from business_approval ba
675
+      LEFT JOIN business_plan p on ba.project_id = p.id
676
+      LEFT JOIN business_contract c on ba.project_id = c.id
677
+      LEFT JOIN business_delivery_storage_notice n on ba.project_id = n.id
678
+      LEFT JOIN business_drug_purchase dp ON ba.task_type_name = dp.apply_number
679
+      LEFT JOIN business_drug_useapply du ON ba.task_type_name = du.apply_number
680
+      
681
+     <where>
682
+     (ba.task_type='plan' 
683
+     or ba.task_type='contract'
684
+      or ba.task_type='storageNotice'
685
+        or ba.task_type='deliveryNotice'
686
+         or ba.task_type='contractChange'
687
+         or ba.task_type='drugUseApply'
688
+         or ba.task_type='drugPurchase')
689
+     and 1=1
690
+     	 <if test="taskType!= null" >
691
+      		AND ba.task_type = #{taskType}
692
+         </if>
693
+     	 <if test="projectName!= null" >
694
+      		AND ba.project_name like CONCAT('%',#{projectName,jdbcType=VARCHAR},'%')
695
+         </if>
696
+     	 <if test="applyName!= null" >
697
+      		AND ba.apply_name like CONCAT('%',#{applyName,jdbcType=VARCHAR},'%')
698
+         </if>
699
+     	 <if test="taskId!= null" >
700
+      		AND ba.task_id = #{taskId}
701
+         </if>
702
+     	 <if test="projectId!= null" >
703
+      		AND ba.project_id = #{projectId}
704
+         </if>
705
+         <if test="'todo'==type"> <!-- 待办 -->
706
+	         <if test="userId!= null" >
707
+	           AND (
708
+	           		  (result = '待审批' and operator = #{userId} and 
709
+		              ((c.audit_state=0 or c.audit_state=3 or c.audit_state=1)
710
+	                  or (p.audit_state=0 or p.audit_state=3 or p.audit_state=1)
711
+	                  or (n.audit_state=0 or n.audit_state=3 or n.audit_state=1)
712
+	                  OR (dp.audit_state = 0 OR dp.audit_state = 3 )
713
+					  OR (du.state = 0 OR du.state = 3 ))) <!-- 待审批 是审批人是当前登录人 -->
714
+					  
715
+	           Or  (result = '驳回' and apply_name_id = #{userId} and 
716
+	           		((c.audit_state=0 or c.audit_state=3)
717
+                  or (p.audit_state=0 or p.audit_state=3)
718
+                  or (n.audit_state=0 or n.audit_state=3)
719
+                  OR (dp.audit_state = 0 OR dp.audit_state = 3 )
720
+				  OR (du.state = 0 OR du.state = 3 )))) <!-- 驳回 是申请人是当前登录人 -->
721
+			   GROUP BY ba.task_type_name
722
+	         </if>
723
+         </if>
724
+         <if test="'complete'==type"> <!-- 已办 -->
725
+          <if test="userId!= null" >
726
+          	AND ((result = '同意' and operator =#{userId}) 
727
+          	or (result = '拒绝' and operator =#{userId}) 
728
+          	or (result = '已审批' and operator =#{userId}) 
729
+          	or (result = '审批结束' and operator =#{userId}) 
730
+          	or (result = '驳回' and operator =#{userId})) 
731
+          	 <!-- 1、当前登录人是创建者的时候,驳回时申请人是当前登录人2、当前 审批人驳回时,已办是审批人是当前登录人-->
732
+          	and ((c.audit_state=2 or c.audit_state=4 or c.audit_state=3 or c.audit_state=1)
733
+                  or (p.audit_state=2 or p.audit_state=4 or p.audit_state=3 or p.audit_state=1)
734
+                  or (n.audit_state=2 or n.audit_state=4 or n.audit_state=3 or n.audit_state=1)
735
+                  OR (dp.audit_state = 2 OR dp.audit_state = 4 OR dp.audit_state = 3 OR dp.audit_state = 1)
736
+				  OR (du.state = 2 OR du.state = 4 OR du.state = 3 OR du.state = 1))
737
+			GROUP BY ba.task_type_name
738
+          </if>
739
+         </if>
740
+     </where>
741
+     ORDER BY apply_time desc		
742
+
743
+	</select>
744
+</mapper>

+ 60 - 0
src/main/java/com/chinaitop/depot/business/mapper/BusinessContractMapper.java

@@ -0,0 +1,60 @@
1
+package com.chinaitop.depot.business.mapper;
2
+
3
+import com.chinaitop.depot.business.model.BusinessContract;
4
+import com.chinaitop.depot.business.model.BusinessContractExample;
5
+import com.chinaitop.depot.business.model.vo.BusinessContractAuditVO;
6
+
7
+import java.util.List;
8
+import java.util.Map;
9
+
10
+import org.apache.ibatis.annotations.Param;
11
+
12
+public interface BusinessContractMapper {
13
+    int countByExample(BusinessContractExample example);
14
+
15
+    int deleteByExample(BusinessContractExample example);
16
+
17
+    int deleteByPrimaryKey(Integer id);
18
+
19
+    int insert(BusinessContract record);
20
+
21
+    int insertSelective(BusinessContract record);
22
+
23
+    List<BusinessContract> selectByExample(BusinessContractExample example);
24
+
25
+    BusinessContract selectByPrimaryKey(Integer id);
26
+
27
+    int updateByExampleSelective(@Param("record") BusinessContract record, @Param("example") BusinessContractExample example);
28
+
29
+    int updateByExample(@Param("record") BusinessContract record, @Param("example") BusinessContractExample example);
30
+
31
+    int updateByPrimaryKeySelective(BusinessContract record);
32
+
33
+    int updateByPrimaryKey(BusinessContract record);
34
+    
35
+    
36
+    /**
37
+     * @param paramMap
38
+     * @return
39
+     */
40
+    List<BusinessContractAuditVO> getApprovalList(Map<String, Object> paramMap);
41
+
42
+    /**
43
+     * @param paramMap
44
+     */
45
+    void updateApplicationByPlanBid(Map<String, Object> paramMap);
46
+
47
+    /**
48
+     * @param example
49
+     * @return
50
+     */
51
+    List<BusinessContractAuditVO> selectByExampleToVO(
52
+            BusinessContractExample example);
53
+
54
+    List<Map<String,Object>> selectBusinessByOrgId(String orgId);
55
+
56
+    //根据通知单状态查询合同数据
57
+    List<Map<String,Object>> contractData(Map<String,Object> map);
58
+
59
+	/*List<BusinessContract> getAllContractInfo();*/
60
+}

File diff suppressed because it is too large
+ 1098 - 0
src/main/java/com/chinaitop/depot/business/mapper/BusinessContractMapper.xml


+ 30 - 0
src/main/java/com/chinaitop/depot/business/mapper/BusinessContractPayReceviceMapper.java

@@ -0,0 +1,30 @@
1
+package com.chinaitop.depot.business.mapper;
2
+
3
+import com.chinaitop.depot.business.model.BusinessContractPayRecevice;
4
+import com.chinaitop.depot.business.model.BusinessContractPayReceviceExample;
5
+import java.util.List;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+public interface BusinessContractPayReceviceMapper {
9
+    int countByExample(BusinessContractPayReceviceExample example);
10
+
11
+    int deleteByExample(BusinessContractPayReceviceExample example);
12
+
13
+    int deleteByPrimaryKey(Integer id);
14
+
15
+    int insert(BusinessContractPayRecevice record);
16
+
17
+    int insertSelective(BusinessContractPayRecevice record);
18
+
19
+    List<BusinessContractPayRecevice> selectByExample(BusinessContractPayReceviceExample example);
20
+
21
+    BusinessContractPayRecevice selectByPrimaryKey(Integer id);
22
+
23
+    int updateByExampleSelective(@Param("record") BusinessContractPayRecevice record, @Param("example") BusinessContractPayReceviceExample example);
24
+
25
+    int updateByExample(@Param("record") BusinessContractPayRecevice record, @Param("example") BusinessContractPayReceviceExample example);
26
+
27
+    int updateByPrimaryKeySelective(BusinessContractPayRecevice record);
28
+
29
+    int updateByPrimaryKey(BusinessContractPayRecevice record);
30
+}

+ 258 - 0
src/main/java/com/chinaitop/depot/business/mapper/BusinessContractPayReceviceMapper.xml

@@ -0,0 +1,258 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.chinaitop.depot.business.mapper.BusinessContractPayReceviceMapper" >
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.business.model.BusinessContractPayRecevice" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="zid" property="zid" jdbcType="INTEGER" />
7
+    <result column="contract_num" property="contractNum" jdbcType="VARCHAR" />
8
+    <result column="contract_title" property="contractTitle" jdbcType="VARCHAR" />
9
+    <result column="contract_type" property="contractType" jdbcType="INTEGER" />
10
+    <result column="pay_status" property="payStatus" jdbcType="INTEGER" />
11
+    <result column="money" property="money" jdbcType="VARCHAR" />
12
+    <result column="time" property="time" jdbcType="TIMESTAMP" />
13
+  </resultMap>
14
+  <sql id="Example_Where_Clause" >
15
+    <where >
16
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
17
+        <if test="criteria.valid" >
18
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
19
+            <foreach collection="criteria.criteria" item="criterion" >
20
+              <choose >
21
+                <when test="criterion.noValue" >
22
+                  and ${criterion.condition}
23
+                </when>
24
+                <when test="criterion.singleValue" >
25
+                  and ${criterion.condition} #{criterion.value}
26
+                </when>
27
+                <when test="criterion.betweenValue" >
28
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
29
+                </when>
30
+                <when test="criterion.listValue" >
31
+                  and ${criterion.condition}
32
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
33
+                    #{listItem}
34
+                  </foreach>
35
+                </when>
36
+              </choose>
37
+            </foreach>
38
+          </trim>
39
+        </if>
40
+      </foreach>
41
+    </where>
42
+  </sql>
43
+  <sql id="Update_By_Example_Where_Clause" >
44
+    <where >
45
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
46
+        <if test="criteria.valid" >
47
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
48
+            <foreach collection="criteria.criteria" item="criterion" >
49
+              <choose >
50
+                <when test="criterion.noValue" >
51
+                  and ${criterion.condition}
52
+                </when>
53
+                <when test="criterion.singleValue" >
54
+                  and ${criterion.condition} #{criterion.value}
55
+                </when>
56
+                <when test="criterion.betweenValue" >
57
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
58
+                </when>
59
+                <when test="criterion.listValue" >
60
+                  and ${criterion.condition}
61
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
62
+                    #{listItem}
63
+                  </foreach>
64
+                </when>
65
+              </choose>
66
+            </foreach>
67
+          </trim>
68
+        </if>
69
+      </foreach>
70
+    </where>
71
+  </sql>
72
+  <sql id="Base_Column_List" >
73
+    id, zid, contract_num, contract_title, contract_type, pay_status, money, time
74
+  </sql>
75
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.business.model.BusinessContractPayReceviceExample" >
76
+    select
77
+    <if test="distinct" >
78
+      distinct
79
+    </if>
80
+    <include refid="Base_Column_List" />
81
+    from business_contract_pay_recevice
82
+    <if test="_parameter != null" >
83
+      <include refid="Example_Where_Clause" />
84
+    </if>
85
+    <if test="orderByClause != null" >
86
+      order by ${orderByClause}
87
+    </if>
88
+  </select>
89
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
90
+    select 
91
+    <include refid="Base_Column_List" />
92
+    from business_contract_pay_recevice
93
+    where id = #{id,jdbcType=INTEGER}
94
+  </select>
95
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
96
+    delete from business_contract_pay_recevice
97
+    where id = #{id,jdbcType=INTEGER}
98
+  </delete>
99
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.business.model.BusinessContractPayReceviceExample" >
100
+    delete from business_contract_pay_recevice
101
+    <if test="_parameter != null" >
102
+      <include refid="Example_Where_Clause" />
103
+    </if>
104
+  </delete>
105
+  <insert id="insert" parameterType="com.chinaitop.depot.business.model.BusinessContractPayRecevice" >
106
+    insert into business_contract_pay_recevice (id, zid, contract_num, 
107
+      contract_title, contract_type, pay_status, 
108
+      money, time)
109
+    values (#{id,jdbcType=INTEGER}, #{zid,jdbcType=INTEGER}, #{contractNum,jdbcType=VARCHAR}, 
110
+      #{contractTitle,jdbcType=VARCHAR}, #{contractType,jdbcType=INTEGER}, #{payStatus,jdbcType=INTEGER}, 
111
+      #{money,jdbcType=VARCHAR}, #{time,jdbcType=TIMESTAMP})
112
+  </insert>
113
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.business.model.BusinessContractPayRecevice" >
114
+    insert into business_contract_pay_recevice
115
+    <trim prefix="(" suffix=")" suffixOverrides="," >
116
+      <if test="id != null" >
117
+        id,
118
+      </if>
119
+      <if test="zid != null" >
120
+        zid,
121
+      </if>
122
+      <if test="contractNum != null" >
123
+        contract_num,
124
+      </if>
125
+      <if test="contractTitle != null" >
126
+        contract_title,
127
+      </if>
128
+      <if test="contractType != null" >
129
+        contract_type,
130
+      </if>
131
+      <if test="payStatus != null" >
132
+        pay_status,
133
+      </if>
134
+      <if test="money != null" >
135
+        money,
136
+      </if>
137
+      <if test="time != null" >
138
+        time,
139
+      </if>
140
+    </trim>
141
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
142
+      <if test="id != null" >
143
+        #{id,jdbcType=INTEGER},
144
+      </if>
145
+      <if test="zid != null" >
146
+        #{zid,jdbcType=INTEGER},
147
+      </if>
148
+      <if test="contractNum != null" >
149
+        #{contractNum,jdbcType=VARCHAR},
150
+      </if>
151
+      <if test="contractTitle != null" >
152
+        #{contractTitle,jdbcType=VARCHAR},
153
+      </if>
154
+      <if test="contractType != null" >
155
+        #{contractType,jdbcType=INTEGER},
156
+      </if>
157
+      <if test="payStatus != null" >
158
+        #{payStatus,jdbcType=INTEGER},
159
+      </if>
160
+      <if test="money != null" >
161
+        #{money,jdbcType=VARCHAR},
162
+      </if>
163
+      <if test="time != null" >
164
+        #{time,jdbcType=TIMESTAMP},
165
+      </if>
166
+    </trim>
167
+  </insert>
168
+  <select id="countByExample" parameterType="com.chinaitop.depot.business.model.BusinessContractPayReceviceExample" resultType="java.lang.Integer" >
169
+    select count(*) from business_contract_pay_recevice
170
+    <if test="_parameter != null" >
171
+      <include refid="Example_Where_Clause" />
172
+    </if>
173
+  </select>
174
+  <update id="updateByExampleSelective" parameterType="map" >
175
+    update business_contract_pay_recevice
176
+    <set >
177
+      <if test="record.id != null" >
178
+        id = #{record.id,jdbcType=INTEGER},
179
+      </if>
180
+      <if test="record.zid != null" >
181
+        zid = #{record.zid,jdbcType=INTEGER},
182
+      </if>
183
+      <if test="record.contractNum != null" >
184
+        contract_num = #{record.contractNum,jdbcType=VARCHAR},
185
+      </if>
186
+      <if test="record.contractTitle != null" >
187
+        contract_title = #{record.contractTitle,jdbcType=VARCHAR},
188
+      </if>
189
+      <if test="record.contractType != null" >
190
+        contract_type = #{record.contractType,jdbcType=INTEGER},
191
+      </if>
192
+      <if test="record.payStatus != null" >
193
+        pay_status = #{record.payStatus,jdbcType=INTEGER},
194
+      </if>
195
+      <if test="record.money != null" >
196
+        money = #{record.money,jdbcType=VARCHAR},
197
+      </if>
198
+      <if test="record.time != null" >
199
+        time = #{record.time,jdbcType=TIMESTAMP},
200
+      </if>
201
+    </set>
202
+    <if test="_parameter != null" >
203
+      <include refid="Update_By_Example_Where_Clause" />
204
+    </if>
205
+  </update>
206
+  <update id="updateByExample" parameterType="map" >
207
+    update business_contract_pay_recevice
208
+    set id = #{record.id,jdbcType=INTEGER},
209
+      zid = #{record.zid,jdbcType=INTEGER},
210
+      contract_num = #{record.contractNum,jdbcType=VARCHAR},
211
+      contract_title = #{record.contractTitle,jdbcType=VARCHAR},
212
+      contract_type = #{record.contractType,jdbcType=INTEGER},
213
+      pay_status = #{record.payStatus,jdbcType=INTEGER},
214
+      money = #{record.money,jdbcType=VARCHAR},
215
+      time = #{record.time,jdbcType=TIMESTAMP}
216
+    <if test="_parameter != null" >
217
+      <include refid="Update_By_Example_Where_Clause" />
218
+    </if>
219
+  </update>
220
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.business.model.BusinessContractPayRecevice" >
221
+    update business_contract_pay_recevice
222
+    <set >
223
+      <if test="zid != null" >
224
+        zid = #{zid,jdbcType=INTEGER},
225
+      </if>
226
+      <if test="contractNum != null" >
227
+        contract_num = #{contractNum,jdbcType=VARCHAR},
228
+      </if>
229
+      <if test="contractTitle != null" >
230
+        contract_title = #{contractTitle,jdbcType=VARCHAR},
231
+      </if>
232
+      <if test="contractType != null" >
233
+        contract_type = #{contractType,jdbcType=INTEGER},
234
+      </if>
235
+      <if test="payStatus != null" >
236
+        pay_status = #{payStatus,jdbcType=INTEGER},
237
+      </if>
238
+      <if test="money != null" >
239
+        money = #{money,jdbcType=VARCHAR},
240
+      </if>
241
+      <if test="time != null" >
242
+        time = #{time,jdbcType=TIMESTAMP},
243
+      </if>
244
+    </set>
245
+    where id = #{id,jdbcType=INTEGER}
246
+  </update>
247
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.business.model.BusinessContractPayRecevice" >
248
+    update business_contract_pay_recevice
249
+    set zid = #{zid,jdbcType=INTEGER},
250
+      contract_num = #{contractNum,jdbcType=VARCHAR},
251
+      contract_title = #{contractTitle,jdbcType=VARCHAR},
252
+      contract_type = #{contractType,jdbcType=INTEGER},
253
+      pay_status = #{payStatus,jdbcType=INTEGER},
254
+      money = #{money,jdbcType=VARCHAR},
255
+      time = #{time,jdbcType=TIMESTAMP}
256
+    where id = #{id,jdbcType=INTEGER}
257
+  </update>
258
+</mapper>

+ 58 - 0
src/main/java/com/chinaitop/depot/business/mapper/BusinessDeliveryStorageNoticeMapper.java

@@ -0,0 +1,58 @@
1
+package com.chinaitop.depot.business.mapper;
2
+
3
+import com.chinaitop.depot.business.model.BusinessDeliveryStorageNotice;
4
+import com.chinaitop.depot.business.model.BusinessDeliveryStorageNoticeExample;
5
+import com.chinaitop.depot.business.model.vo.BusinessDeliveryStorageNoticeAuditVO;
6
+
7
+import java.util.List;
8
+import java.util.Map;
9
+
10
+import org.apache.ibatis.annotations.Param;
11
+
12
+public interface BusinessDeliveryStorageNoticeMapper {
13
+    int countByExample(BusinessDeliveryStorageNoticeExample example);
14
+
15
+    int deleteByExample(BusinessDeliveryStorageNoticeExample example);
16
+
17
+    int deleteByPrimaryKey(Integer id);
18
+
19
+    int insert(BusinessDeliveryStorageNotice record);
20
+
21
+    int insertSelective(BusinessDeliveryStorageNotice record);
22
+
23
+    List<BusinessDeliveryStorageNotice> selectByExample(BusinessDeliveryStorageNoticeExample example);
24
+
25
+    BusinessDeliveryStorageNotice selectByPrimaryKey(Integer id);
26
+
27
+    int updateByExampleSelective(@Param("record") BusinessDeliveryStorageNotice record, @Param("example") BusinessDeliveryStorageNoticeExample example);
28
+
29
+    int updateByExample(@Param("record") BusinessDeliveryStorageNotice record, @Param("example") BusinessDeliveryStorageNoticeExample example);
30
+
31
+    int updateByPrimaryKeySelective(BusinessDeliveryStorageNotice record);
32
+
33
+    int updateByPrimaryKey(BusinessDeliveryStorageNotice record);
34
+
35
+    /**
36
+     * @param paramMap
37
+     * @return
38
+     */
39
+    List<BusinessDeliveryStorageNoticeAuditVO> getApprovalList(Map<String, Object> paramMap);
40
+
41
+    /**
42
+     * @param paramMap
43
+     */
44
+    void updateApplication(Map<String, Object> paramMap);
45
+
46
+    /**
47
+     * @param example
48
+     * @return
49
+     */
50
+    List<BusinessDeliveryStorageNoticeAuditVO> selectByExampleToVO(
51
+            BusinessDeliveryStorageNoticeExample example);
52
+
53
+    //统计出入库数据
54
+	List<BusinessDeliveryStorageNotice> countTj();
55
+
56
+	//根据通知单状态查询数据--主表
57
+    List<Map<String,Object>> uploadNoticeData(Map<String,Object> map);
58
+}

+ 947 - 0
src/main/java/com/chinaitop/depot/business/mapper/BusinessDeliveryStorageNoticeMapper.xml

@@ -0,0 +1,947 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.chinaitop.depot.business.mapper.BusinessDeliveryStorageNoticeMapper" >
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.business.model.BusinessDeliveryStorageNotice" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="bill_type" property="billType" jdbcType="VARCHAR" />
7
+    <result column="bill_type_id" property="billTypeId" jdbcType="INTEGER" />
8
+    <result column="bill_number" property="billNumber" jdbcType="VARCHAR" />
9
+    <result column="shiping_count" property="shipingCount" jdbcType="VARCHAR" />
10
+    <result column="finished_count" property="finishedCount" jdbcType="VARCHAR" />
11
+    <result column="received_money" property="receivedMoney" jdbcType="VARCHAR" />
12
+    <result column="customer_bid" property="customerBid" jdbcType="INTEGER" />
13
+    <result column="customer_number" property="customerNumber" jdbcType="VARCHAR" />
14
+    <result column="mobile" property="mobile" jdbcType="VARCHAR" />
15
+    <result column="delivery_customer" property="deliveryCustomer" jdbcType="VARCHAR" />
16
+    <result column="contract" property="contract" jdbcType="VARCHAR" />
17
+    <result column="contract_bid" property="contractBid" jdbcType="INTEGER" />
18
+    <result column="plan_number" property="planNumber" jdbcType="VARCHAR" />
19
+    <result column="plan_bid" property="planBid" jdbcType="INTEGER" />
20
+    <result column="bill_memo" property="billMemo" jdbcType="VARCHAR" />
21
+    <result column="grain_price" property="grainPrice" jdbcType="VARCHAR" />
22
+    <result column="money_quantity" property="moneyQuantity" jdbcType="VARCHAR" />
23
+    <result column="grain_annual" property="grainAnnual" jdbcType="INTEGER" />
24
+    <result column="warehouse" property="warehouse" jdbcType="INTEGER" />
25
+    <result column="goods_location" property="goodsLocation" jdbcType="INTEGER" />
26
+    <result column="audit_state" property="auditState" jdbcType="VARCHAR" />
27
+    <result column="storage_time" property="storageTime" jdbcType="TIMESTAMP" />
28
+    <result column="process_instance_id" property="processInstanceId" jdbcType="VARCHAR" />
29
+    <result column="process_definition_id" property="processDefinitionId" jdbcType="VARCHAR" />
30
+    <result column="quality_standard" property="qualityStandard" jdbcType="VARCHAR" />
31
+    <result column="agree_time" property="agreeTime" jdbcType="TIMESTAMP" />
32
+    <result column="bill_man" property="billMan" jdbcType="VARCHAR" />
33
+    <result column="bill_date" property="billDate" jdbcType="TIMESTAMP" />
34
+    <result column="bill_unit" property="billUnit" jdbcType="VARCHAR" />
35
+    <result column="house_id" property="houseId" jdbcType="INTEGER" />
36
+    <result column="house_name" property="houseName" jdbcType="VARCHAR" />
37
+    <result column="warehouse_id" property="warehouseId" jdbcType="INTEGER" />
38
+    <result column="warehouse_name" property="warehouseName" jdbcType="VARCHAR" />
39
+    <result column="creater" property="creater" jdbcType="VARCHAR" />
40
+    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
41
+    <result column="create_unit" property="createUnit" jdbcType="VARCHAR" />
42
+    <result column="create_depot" property="createDepot" jdbcType="VARCHAR" />
43
+    <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
44
+    <result column="org_id" property="orgId" jdbcType="INTEGER" />
45
+    <result column="in_application" property="inApplication" jdbcType="INTEGER" />
46
+    <result column="creater_id" property="createrId" jdbcType="INTEGER" />
47
+    <result column="root_contract_bid" property="rootContractBid" jdbcType="INTEGER" />
48
+    <result column="identification" property="identification" jdbcType="VARCHAR" />
49
+    <result column="carNumber" property="carnumber" jdbcType="VARCHAR" />
50
+  </resultMap>
51
+  <sql id="Example_Where_Clause" >
52
+    <where >
53
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
54
+        <if test="criteria.valid" >
55
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
56
+            <foreach collection="criteria.criteria" item="criterion" >
57
+              <choose >
58
+                <when test="criterion.noValue" >
59
+                  and ${criterion.condition}
60
+                </when>
61
+                <when test="criterion.singleValue" >
62
+                  and ${criterion.condition} #{criterion.value}
63
+                </when>
64
+                <when test="criterion.betweenValue" >
65
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
66
+                </when>
67
+                <when test="criterion.listValue" >
68
+                  and ${criterion.condition}
69
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
70
+                    #{listItem}
71
+                  </foreach>
72
+                </when>
73
+              </choose>
74
+            </foreach>
75
+          </trim>
76
+        </if>
77
+      </foreach>
78
+    </where>
79
+  </sql>
80
+  <sql id="Update_By_Example_Where_Clause" >
81
+    <where >
82
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
83
+        <if test="criteria.valid" >
84
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
85
+            <foreach collection="criteria.criteria" item="criterion" >
86
+              <choose >
87
+                <when test="criterion.noValue" >
88
+                  and ${criterion.condition}
89
+                </when>
90
+                <when test="criterion.singleValue" >
91
+                  and ${criterion.condition} #{criterion.value}
92
+                </when>
93
+                <when test="criterion.betweenValue" >
94
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
95
+                </when>
96
+                <when test="criterion.listValue" >
97
+                  and ${criterion.condition}
98
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
99
+                    #{listItem}
100
+                  </foreach>
101
+                </when>
102
+              </choose>
103
+            </foreach>
104
+          </trim>
105
+        </if>
106
+      </foreach>
107
+    </where>
108
+  </sql>
109
+  <sql id="Base_Column_List" >
110
+    id, bill_type, bill_type_id, bill_number, shiping_count, finished_count, received_money, 
111
+    customer_bid, customer_number, mobile, delivery_customer, contract, contract_bid, 
112
+    plan_number, plan_bid, bill_memo, grain_price, money_quantity, grain_annual, warehouse, 
113
+    goods_location, audit_state, storage_time, process_instance_id, process_definition_id, 
114
+    quality_standard, agree_time, bill_man, bill_date, bill_unit, house_id, house_name, 
115
+    warehouse_id, warehouse_name, creater, create_time, create_unit, create_depot, update_time, 
116
+    org_id, in_application, creater_id, root_contract_bid, identification, carNumber
117
+  </sql>
118
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.business.model.BusinessDeliveryStorageNoticeExample" >
119
+    select
120
+    <if test="distinct" >
121
+      distinct
122
+    </if>
123
+    <include refid="Base_Column_List" />
124
+    from business_delivery_storage_notice
125
+    <if test="_parameter != null" >
126
+      <include refid="Example_Where_Clause" />
127
+    </if>
128
+    <if test="orderByClause != null" >
129
+      order by ${orderByClause}
130
+    </if>
131
+  </select>
132
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
133
+    select 
134
+    <include refid="Base_Column_List" />
135
+    from business_delivery_storage_notice
136
+    where id = #{id,jdbcType=INTEGER}
137
+  </select>
138
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
139
+    delete from business_delivery_storage_notice
140
+    where id = #{id,jdbcType=INTEGER}
141
+  </delete>
142
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.business.model.BusinessDeliveryStorageNoticeExample" >
143
+    delete from business_delivery_storage_notice
144
+    <if test="_parameter != null" >
145
+      <include refid="Example_Where_Clause" />
146
+    </if>
147
+  </delete>
148
+  <insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.chinaitop.depot.business.model.BusinessDeliveryStorageNotice" >
149
+   <!--<selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
150
+      SELECT LAST_INSERT_ID()
151
+    </selectKey>-->
152
+    insert into business_delivery_storage_notice (id, bill_type, bill_type_id, 
153
+      bill_number, shiping_count, finished_count, 
154
+      received_money, customer_bid, customer_number, 
155
+      mobile, delivery_customer, contract, 
156
+      contract_bid, plan_number, plan_bid, 
157
+      bill_memo, grain_price, money_quantity, 
158
+      grain_annual, warehouse, goods_location, 
159
+      audit_state, storage_time, process_instance_id, 
160
+      process_definition_id, quality_standard, agree_time, 
161
+      bill_man, bill_date, bill_unit, 
162
+      house_id, house_name, warehouse_id, 
163
+      warehouse_name, creater, create_time, 
164
+      create_unit, create_depot, update_time, 
165
+      org_id, in_application, creater_id, 
166
+      root_contract_bid, identification, carNumber
167
+      )
168
+    values (#{id,jdbcType=INTEGER}, #{billType,jdbcType=VARCHAR}, #{billTypeId,jdbcType=INTEGER}, 
169
+      #{billNumber,jdbcType=VARCHAR}, #{shipingCount,jdbcType=VARCHAR}, #{finishedCount,jdbcType=VARCHAR}, 
170
+      #{receivedMoney,jdbcType=VARCHAR}, #{customerBid,jdbcType=INTEGER}, #{customerNumber,jdbcType=VARCHAR}, 
171
+      #{mobile,jdbcType=VARCHAR}, #{deliveryCustomer,jdbcType=VARCHAR}, #{contract,jdbcType=VARCHAR}, 
172
+      #{contractBid,jdbcType=INTEGER}, #{planNumber,jdbcType=VARCHAR}, #{planBid,jdbcType=INTEGER}, 
173
+      #{billMemo,jdbcType=VARCHAR}, #{grainPrice,jdbcType=VARCHAR}, #{moneyQuantity,jdbcType=VARCHAR}, 
174
+      #{grainAnnual,jdbcType=INTEGER}, #{warehouse,jdbcType=INTEGER}, #{goodsLocation,jdbcType=INTEGER}, 
175
+      #{auditState,jdbcType=VARCHAR}, #{storageTime,jdbcType=TIMESTAMP}, #{processInstanceId,jdbcType=VARCHAR}, 
176
+      #{processDefinitionId,jdbcType=VARCHAR}, #{qualityStandard,jdbcType=VARCHAR}, #{agreeTime,jdbcType=TIMESTAMP}, 
177
+      #{billMan,jdbcType=VARCHAR}, #{billDate,jdbcType=TIMESTAMP}, #{billUnit,jdbcType=VARCHAR}, 
178
+      #{houseId,jdbcType=INTEGER}, #{houseName,jdbcType=VARCHAR}, #{warehouseId,jdbcType=INTEGER}, 
179
+      #{warehouseName,jdbcType=VARCHAR}, #{creater,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
180
+      #{createUnit,jdbcType=VARCHAR}, #{createDepot,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, 
181
+      #{orgId,jdbcType=INTEGER}, #{inApplication,jdbcType=INTEGER}, #{createrId,jdbcType=INTEGER}, 
182
+      #{rootContractBid,jdbcType=INTEGER}, #{identification,jdbcType=VARCHAR}, #{carnumber,jdbcType=VARCHAR}
183
+      )
184
+  </insert>
185
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.business.model.BusinessDeliveryStorageNotice" >
186
+    insert into business_delivery_storage_notice
187
+    <trim prefix="(" suffix=")" suffixOverrides="," >
188
+      <if test="id != null" >
189
+        id,
190
+      </if>
191
+      <if test="billType != null" >
192
+        bill_type,
193
+      </if>
194
+      <if test="billTypeId != null" >
195
+        bill_type_id,
196
+      </if>
197
+      <if test="billNumber != null" >
198
+        bill_number,
199
+      </if>
200
+      <if test="shipingCount != null" >
201
+        shiping_count,
202
+      </if>
203
+      <if test="finishedCount != null" >
204
+        finished_count,
205
+      </if>
206
+      <if test="receivedMoney != null" >
207
+        received_money,
208
+      </if>
209
+      <if test="customerBid != null" >
210
+        customer_bid,
211
+      </if>
212
+      <if test="customerNumber != null" >
213
+        customer_number,
214
+      </if>
215
+      <if test="mobile != null" >
216
+        mobile,
217
+      </if>
218
+      <if test="deliveryCustomer != null" >
219
+        delivery_customer,
220
+      </if>
221
+      <if test="contract != null" >
222
+        contract,
223
+      </if>
224
+      <if test="contractBid != null" >
225
+        contract_bid,
226
+      </if>
227
+      <if test="planNumber != null" >
228
+        plan_number,
229
+      </if>
230
+      <if test="planBid != null" >
231
+        plan_bid,
232
+      </if>
233
+      <if test="billMemo != null" >
234
+        bill_memo,
235
+      </if>
236
+      <if test="grainPrice != null" >
237
+        grain_price,
238
+      </if>
239
+      <if test="moneyQuantity != null" >
240
+        money_quantity,
241
+      </if>
242
+      <if test="grainAnnual != null" >
243
+        grain_annual,
244
+      </if>
245
+      <if test="warehouse != null" >
246
+        warehouse,
247
+      </if>
248
+      <if test="goodsLocation != null" >
249
+        goods_location,
250
+      </if>
251
+      <if test="auditState != null" >
252
+        audit_state,
253
+      </if>
254
+      <if test="storageTime != null" >
255
+        storage_time,
256
+      </if>
257
+      <if test="processInstanceId != null" >
258
+        process_instance_id,
259
+      </if>
260
+      <if test="processDefinitionId != null" >
261
+        process_definition_id,
262
+      </if>
263
+      <if test="qualityStandard != null" >
264
+        quality_standard,
265
+      </if>
266
+      <if test="agreeTime != null" >
267
+        agree_time,
268
+      </if>
269
+      <if test="billMan != null" >
270
+        bill_man,
271
+      </if>
272
+      <if test="billDate != null" >
273
+        bill_date,
274
+      </if>
275
+      <if test="billUnit != null" >
276
+        bill_unit,
277
+      </if>
278
+      <if test="houseId != null" >
279
+        house_id,
280
+      </if>
281
+      <if test="houseName != null" >
282
+        house_name,
283
+      </if>
284
+      <if test="warehouseId != null" >
285
+        warehouse_id,
286
+      </if>
287
+      <if test="warehouseName != null" >
288
+        warehouse_name,
289
+      </if>
290
+      <if test="creater != null" >
291
+        creater,
292
+      </if>
293
+      <if test="createTime != null" >
294
+        create_time,
295
+      </if>
296
+      <if test="createUnit != null" >
297
+        create_unit,
298
+      </if>
299
+      <if test="createDepot != null" >
300
+        create_depot,
301
+      </if>
302
+      <if test="updateTime != null" >
303
+        update_time,
304
+      </if>
305
+      <if test="orgId != null" >
306
+        org_id,
307
+      </if>
308
+      <if test="inApplication != null" >
309
+        in_application,
310
+      </if>
311
+      <if test="createrId != null" >
312
+        creater_id,
313
+      </if>
314
+      <if test="rootContractBid != null" >
315
+        root_contract_bid,
316
+      </if>
317
+      <if test="identification != null" >
318
+        identification,
319
+      </if>
320
+      <if test="carnumber != null" >
321
+        carNumber,
322
+      </if>
323
+    </trim>
324
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
325
+      <if test="id != null" >
326
+        #{id,jdbcType=INTEGER},
327
+      </if>
328
+      <if test="billType != null" >
329
+        #{billType,jdbcType=VARCHAR},
330
+      </if>
331
+      <if test="billTypeId != null" >
332
+        #{billTypeId,jdbcType=INTEGER},
333
+      </if>
334
+      <if test="billNumber != null" >
335
+        #{billNumber,jdbcType=VARCHAR},
336
+      </if>
337
+      <if test="shipingCount != null" >
338
+        #{shipingCount,jdbcType=VARCHAR},
339
+      </if>
340
+      <if test="finishedCount != null" >
341
+        #{finishedCount,jdbcType=VARCHAR},
342
+      </if>
343
+      <if test="receivedMoney != null" >
344
+        #{receivedMoney,jdbcType=VARCHAR},
345
+      </if>
346
+      <if test="customerBid != null" >
347
+        #{customerBid,jdbcType=INTEGER},
348
+      </if>
349
+      <if test="customerNumber != null" >
350
+        #{customerNumber,jdbcType=VARCHAR},
351
+      </if>
352
+      <if test="mobile != null" >
353
+        #{mobile,jdbcType=VARCHAR},
354
+      </if>
355
+      <if test="deliveryCustomer != null" >
356
+        #{deliveryCustomer,jdbcType=VARCHAR},
357
+      </if>
358
+      <if test="contract != null" >
359
+        #{contract,jdbcType=VARCHAR},
360
+      </if>
361
+      <if test="contractBid != null" >
362
+        #{contractBid,jdbcType=INTEGER},
363
+      </if>
364
+      <if test="planNumber != null" >
365
+        #{planNumber,jdbcType=VARCHAR},
366
+      </if>
367
+      <if test="planBid != null" >
368
+        #{planBid,jdbcType=INTEGER},
369
+      </if>
370
+      <if test="billMemo != null" >
371
+        #{billMemo,jdbcType=VARCHAR},
372
+      </if>
373
+      <if test="grainPrice != null" >
374
+        #{grainPrice,jdbcType=VARCHAR},
375
+      </if>
376
+      <if test="moneyQuantity != null" >
377
+        #{moneyQuantity,jdbcType=VARCHAR},
378
+      </if>
379
+      <if test="grainAnnual != null" >
380
+        #{grainAnnual,jdbcType=INTEGER},
381
+      </if>
382
+      <if test="warehouse != null" >
383
+        #{warehouse,jdbcType=INTEGER},
384
+      </if>
385
+      <if test="goodsLocation != null" >
386
+        #{goodsLocation,jdbcType=INTEGER},
387
+      </if>
388
+      <if test="auditState != null" >
389
+        #{auditState,jdbcType=VARCHAR},
390
+      </if>
391
+      <if test="storageTime != null" >
392
+        #{storageTime,jdbcType=TIMESTAMP},
393
+      </if>
394
+      <if test="processInstanceId != null" >
395
+        #{processInstanceId,jdbcType=VARCHAR},
396
+      </if>
397
+      <if test="processDefinitionId != null" >
398
+        #{processDefinitionId,jdbcType=VARCHAR},
399
+      </if>
400
+      <if test="qualityStandard != null" >
401
+        #{qualityStandard,jdbcType=VARCHAR},
402
+      </if>
403
+      <if test="agreeTime != null" >
404
+        #{agreeTime,jdbcType=TIMESTAMP},
405
+      </if>
406
+      <if test="billMan != null" >
407
+        #{billMan,jdbcType=VARCHAR},
408
+      </if>
409
+      <if test="billDate != null" >
410
+        #{billDate,jdbcType=TIMESTAMP},
411
+      </if>
412
+      <if test="billUnit != null" >
413
+        #{billUnit,jdbcType=VARCHAR},
414
+      </if>
415
+      <if test="houseId != null" >
416
+        #{houseId,jdbcType=INTEGER},
417
+      </if>
418
+      <if test="houseName != null" >
419
+        #{houseName,jdbcType=VARCHAR},
420
+      </if>
421
+      <if test="warehouseId != null" >
422
+        #{warehouseId,jdbcType=INTEGER},
423
+      </if>
424
+      <if test="warehouseName != null" >
425
+        #{warehouseName,jdbcType=VARCHAR},
426
+      </if>
427
+      <if test="creater != null" >
428
+        #{creater,jdbcType=VARCHAR},
429
+      </if>
430
+      <if test="createTime != null" >
431
+        #{createTime,jdbcType=TIMESTAMP},
432
+      </if>
433
+      <if test="createUnit != null" >
434
+        #{createUnit,jdbcType=VARCHAR},
435
+      </if>
436
+      <if test="createDepot != null" >
437
+        #{createDepot,jdbcType=VARCHAR},
438
+      </if>
439
+      <if test="updateTime != null" >
440
+        #{updateTime,jdbcType=TIMESTAMP},
441
+      </if>
442
+      <if test="orgId != null" >
443
+        #{orgId,jdbcType=INTEGER},
444
+      </if>
445
+      <if test="inApplication != null" >
446
+        #{inApplication,jdbcType=INTEGER},
447
+      </if>
448
+      <if test="createrId != null" >
449
+        #{createrId,jdbcType=INTEGER},
450
+      </if>
451
+      <if test="rootContractBid != null" >
452
+        #{rootContractBid,jdbcType=INTEGER},
453
+      </if>
454
+      <if test="identification != null" >
455
+        #{identification,jdbcType=VARCHAR},
456
+      </if>
457
+      <if test="carnumber != null" >
458
+        #{carnumber,jdbcType=VARCHAR},
459
+      </if>
460
+    </trim>
461
+  </insert>
462
+  <select id="countByExample" parameterType="com.chinaitop.depot.business.model.BusinessDeliveryStorageNoticeExample" resultType="java.lang.Integer" >
463
+    select count(*) from business_delivery_storage_notice
464
+    <if test="_parameter != null" >
465
+      <include refid="Example_Where_Clause" />
466
+    </if>
467
+  </select>
468
+  <update id="updateByExampleSelective" parameterType="map" >
469
+    update business_delivery_storage_notice
470
+    <set >
471
+      <if test="record.id != null" >
472
+        id = #{record.id,jdbcType=INTEGER},
473
+      </if>
474
+      <if test="record.billType != null" >
475
+        bill_type = #{record.billType,jdbcType=VARCHAR},
476
+      </if>
477
+      <if test="record.billTypeId != null" >
478
+        bill_type_id = #{record.billTypeId,jdbcType=INTEGER},
479
+      </if>
480
+      <if test="record.billNumber != null" >
481
+        bill_number = #{record.billNumber,jdbcType=VARCHAR},
482
+      </if>
483
+      <if test="record.shipingCount != null" >
484
+        shiping_count = #{record.shipingCount,jdbcType=VARCHAR},
485
+      </if>
486
+      <if test="record.finishedCount != null" >
487
+        finished_count = #{record.finishedCount,jdbcType=VARCHAR},
488
+      </if>
489
+      <if test="record.receivedMoney != null" >
490
+        received_money = #{record.receivedMoney,jdbcType=VARCHAR},
491
+      </if>
492
+      <if test="record.customerBid != null" >
493
+        customer_bid = #{record.customerBid,jdbcType=INTEGER},
494
+      </if>
495
+      <if test="record.customerNumber != null" >
496
+        customer_number = #{record.customerNumber,jdbcType=VARCHAR},
497
+      </if>
498
+      <if test="record.mobile != null" >
499
+        mobile = #{record.mobile,jdbcType=VARCHAR},
500
+      </if>
501
+      <if test="record.deliveryCustomer != null" >
502
+        delivery_customer = #{record.deliveryCustomer,jdbcType=VARCHAR},
503
+      </if>
504
+      <if test="record.contract != null" >
505
+        contract = #{record.contract,jdbcType=VARCHAR},
506
+      </if>
507
+      <if test="record.contractBid != null" >
508
+        contract_bid = #{record.contractBid,jdbcType=INTEGER},
509
+      </if>
510
+      <if test="record.planNumber != null" >
511
+        plan_number = #{record.planNumber,jdbcType=VARCHAR},
512
+      </if>
513
+      <if test="record.planBid != null" >
514
+        plan_bid = #{record.planBid,jdbcType=INTEGER},
515
+      </if>
516
+      <if test="record.billMemo != null" >
517
+        bill_memo = #{record.billMemo,jdbcType=VARCHAR},
518
+      </if>
519
+      <if test="record.grainPrice != null" >
520
+        grain_price = #{record.grainPrice,jdbcType=VARCHAR},
521
+      </if>
522
+      <if test="record.moneyQuantity != null" >
523
+        money_quantity = #{record.moneyQuantity,jdbcType=VARCHAR},
524
+      </if>
525
+      <if test="record.grainAnnual != null" >
526
+        grain_annual = #{record.grainAnnual,jdbcType=INTEGER},
527
+      </if>
528
+      <if test="record.warehouse != null" >
529
+        warehouse = #{record.warehouse,jdbcType=INTEGER},
530
+      </if>
531
+      <if test="record.goodsLocation != null" >
532
+        goods_location = #{record.goodsLocation,jdbcType=INTEGER},
533
+      </if>
534
+      <if test="record.auditState != null" >
535
+        audit_state = #{record.auditState,jdbcType=VARCHAR},
536
+      </if>
537
+      <if test="record.storageTime != null" >
538
+        storage_time = #{record.storageTime,jdbcType=TIMESTAMP},
539
+      </if>
540
+      <if test="record.processInstanceId != null" >
541
+        process_instance_id = #{record.processInstanceId,jdbcType=VARCHAR},
542
+      </if>
543
+      <if test="record.processDefinitionId != null" >
544
+        process_definition_id = #{record.processDefinitionId,jdbcType=VARCHAR},
545
+      </if>
546
+      <if test="record.qualityStandard != null" >
547
+        quality_standard = #{record.qualityStandard,jdbcType=VARCHAR},
548
+      </if>
549
+      <if test="record.agreeTime != null" >
550
+        agree_time = #{record.agreeTime,jdbcType=TIMESTAMP},
551
+      </if>
552
+      <if test="record.billMan != null" >
553
+        bill_man = #{record.billMan,jdbcType=VARCHAR},
554
+      </if>
555
+      <if test="record.billDate != null" >
556
+        bill_date = #{record.billDate,jdbcType=TIMESTAMP},
557
+      </if>
558
+      <if test="record.billUnit != null" >
559
+        bill_unit = #{record.billUnit,jdbcType=VARCHAR},
560
+      </if>
561
+      <if test="record.houseId != null" >
562
+        house_id = #{record.houseId,jdbcType=INTEGER},
563
+      </if>
564
+      <if test="record.houseName != null" >
565
+        house_name = #{record.houseName,jdbcType=VARCHAR},
566
+      </if>
567
+      <if test="record.warehouseId != null" >
568
+        warehouse_id = #{record.warehouseId,jdbcType=INTEGER},
569
+      </if>
570
+      <if test="record.warehouseName != null" >
571
+        warehouse_name = #{record.warehouseName,jdbcType=VARCHAR},
572
+      </if>
573
+      <if test="record.creater != null" >
574
+        creater = #{record.creater,jdbcType=VARCHAR},
575
+      </if>
576
+      <if test="record.createTime != null" >
577
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
578
+      </if>
579
+      <if test="record.createUnit != null" >
580
+        create_unit = #{record.createUnit,jdbcType=VARCHAR},
581
+      </if>
582
+      <if test="record.createDepot != null" >
583
+        create_depot = #{record.createDepot,jdbcType=VARCHAR},
584
+      </if>
585
+      <if test="record.updateTime != null" >
586
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
587
+      </if>
588
+      <if test="record.orgId != null" >
589
+        org_id = #{record.orgId,jdbcType=INTEGER},
590
+      </if>
591
+      <if test="record.inApplication != null" >
592
+        in_application = #{record.inApplication,jdbcType=INTEGER},
593
+      </if>
594
+      <if test="record.createrId != null" >
595
+        creater_id = #{record.createrId,jdbcType=INTEGER},
596
+      </if>
597
+      <if test="record.rootContractBid != null" >
598
+        root_contract_bid = #{record.rootContractBid,jdbcType=INTEGER},
599
+      </if>
600
+      <if test="record.identification != null" >
601
+        identification = #{record.identification,jdbcType=VARCHAR},
602
+      </if>
603
+      <if test="record.carnumber != null" >
604
+        carNumber = #{record.carnumber,jdbcType=VARCHAR},
605
+      </if>
606
+    </set>
607
+    <if test="_parameter != null" >
608
+      <include refid="Update_By_Example_Where_Clause" />
609
+    </if>
610
+  </update>
611
+  <update id="updateByExample" parameterType="map" >
612
+    update business_delivery_storage_notice
613
+    set id = #{record.id,jdbcType=INTEGER},
614
+      bill_type = #{record.billType,jdbcType=VARCHAR},
615
+      bill_type_id = #{record.billTypeId,jdbcType=INTEGER},
616
+      bill_number = #{record.billNumber,jdbcType=VARCHAR},
617
+      shiping_count = #{record.shipingCount,jdbcType=VARCHAR},
618
+      finished_count = #{record.finishedCount,jdbcType=VARCHAR},
619
+      received_money = #{record.receivedMoney,jdbcType=VARCHAR},
620
+      customer_bid = #{record.customerBid,jdbcType=INTEGER},
621
+      customer_number = #{record.customerNumber,jdbcType=VARCHAR},
622
+      mobile = #{record.mobile,jdbcType=VARCHAR},
623
+      delivery_customer = #{record.deliveryCustomer,jdbcType=VARCHAR},
624
+      contract = #{record.contract,jdbcType=VARCHAR},
625
+      contract_bid = #{record.contractBid,jdbcType=INTEGER},
626
+      plan_number = #{record.planNumber,jdbcType=VARCHAR},
627
+      plan_bid = #{record.planBid,jdbcType=INTEGER},
628
+      bill_memo = #{record.billMemo,jdbcType=VARCHAR},
629
+      grain_price = #{record.grainPrice,jdbcType=VARCHAR},
630
+      money_quantity = #{record.moneyQuantity,jdbcType=VARCHAR},
631
+      grain_annual = #{record.grainAnnual,jdbcType=INTEGER},
632
+      warehouse = #{record.warehouse,jdbcType=INTEGER},
633
+      goods_location = #{record.goodsLocation,jdbcType=INTEGER},
634
+      audit_state = #{record.auditState,jdbcType=VARCHAR},
635
+      storage_time = #{record.storageTime,jdbcType=TIMESTAMP},
636
+      process_instance_id = #{record.processInstanceId,jdbcType=VARCHAR},
637
+      process_definition_id = #{record.processDefinitionId,jdbcType=VARCHAR},
638
+      quality_standard = #{record.qualityStandard,jdbcType=VARCHAR},
639
+      agree_time = #{record.agreeTime,jdbcType=TIMESTAMP},
640
+      bill_man = #{record.billMan,jdbcType=VARCHAR},
641
+      bill_date = #{record.billDate,jdbcType=TIMESTAMP},
642
+      bill_unit = #{record.billUnit,jdbcType=VARCHAR},
643
+      house_id = #{record.houseId,jdbcType=INTEGER},
644
+      house_name = #{record.houseName,jdbcType=VARCHAR},
645
+      warehouse_id = #{record.warehouseId,jdbcType=INTEGER},
646
+      warehouse_name = #{record.warehouseName,jdbcType=VARCHAR},
647
+      creater = #{record.creater,jdbcType=VARCHAR},
648
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
649
+      create_unit = #{record.createUnit,jdbcType=VARCHAR},
650
+      create_depot = #{record.createDepot,jdbcType=VARCHAR},
651
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
652
+      org_id = #{record.orgId,jdbcType=INTEGER},
653
+      in_application = #{record.inApplication,jdbcType=INTEGER},
654
+      creater_id = #{record.createrId,jdbcType=INTEGER},
655
+      root_contract_bid = #{record.rootContractBid,jdbcType=INTEGER},
656
+      identification = #{record.identification,jdbcType=VARCHAR},
657
+      carNumber = #{record.carnumber,jdbcType=VARCHAR}
658
+    <if test="_parameter != null" >
659
+      <include refid="Update_By_Example_Where_Clause" />
660
+    </if>
661
+  </update>
662
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.business.model.BusinessDeliveryStorageNotice" >
663
+    update business_delivery_storage_notice
664
+    <set >
665
+      <if test="billType != null" >
666
+        bill_type = #{billType,jdbcType=VARCHAR},
667
+      </if>
668
+      <if test="billTypeId != null" >
669
+        bill_type_id = #{billTypeId,jdbcType=INTEGER},
670
+      </if>
671
+      <if test="billNumber != null" >
672
+        bill_number = #{billNumber,jdbcType=VARCHAR},
673
+      </if>
674
+      <if test="shipingCount != null" >
675
+        shiping_count = #{shipingCount,jdbcType=VARCHAR},
676
+      </if>
677
+      <if test="finishedCount != null" >
678
+        finished_count = #{finishedCount,jdbcType=VARCHAR},
679
+      </if>
680
+      <if test="receivedMoney != null" >
681
+        received_money = #{receivedMoney,jdbcType=VARCHAR},
682
+      </if>
683
+      <if test="customerBid != null" >
684
+        customer_bid = #{customerBid,jdbcType=INTEGER},
685
+      </if>
686
+      <if test="customerNumber != null" >
687
+        customer_number = #{customerNumber,jdbcType=VARCHAR},
688
+      </if>
689
+      <if test="mobile != null" >
690
+        mobile = #{mobile,jdbcType=VARCHAR},
691
+      </if>
692
+      <if test="deliveryCustomer != null" >
693
+        delivery_customer = #{deliveryCustomer,jdbcType=VARCHAR},
694
+      </if>
695
+      <if test="contract != null" >
696
+        contract = #{contract,jdbcType=VARCHAR},
697
+      </if>
698
+      <if test="contractBid != null" >
699
+        contract_bid = #{contractBid,jdbcType=INTEGER},
700
+      </if>
701
+      <if test="planNumber != null" >
702
+        plan_number = #{planNumber,jdbcType=VARCHAR},
703
+      </if>
704
+      <if test="planBid != null" >
705
+        plan_bid = #{planBid,jdbcType=INTEGER},
706
+      </if>
707
+      <if test="billMemo != null" >
708
+        bill_memo = #{billMemo,jdbcType=VARCHAR},
709
+      </if>
710
+      <if test="grainPrice != null" >
711
+        grain_price = #{grainPrice,jdbcType=VARCHAR},
712
+      </if>
713
+      <if test="moneyQuantity != null" >
714
+        money_quantity = #{moneyQuantity,jdbcType=VARCHAR},
715
+      </if>
716
+      <if test="grainAnnual != null" >
717
+        grain_annual = #{grainAnnual,jdbcType=INTEGER},
718
+      </if>
719
+      <if test="warehouse != null" >
720
+        warehouse = #{warehouse,jdbcType=INTEGER},
721
+      </if>
722
+      <if test="goodsLocation != null" >
723
+        goods_location = #{goodsLocation,jdbcType=INTEGER},
724
+      </if>
725
+      <if test="auditState != null" >
726
+        audit_state = #{auditState,jdbcType=VARCHAR},
727
+      </if>
728
+      <if test="storageTime != null" >
729
+        storage_time = #{storageTime,jdbcType=TIMESTAMP},
730
+      </if>
731
+      <if test="processInstanceId != null" >
732
+        process_instance_id = #{processInstanceId,jdbcType=VARCHAR},
733
+      </if>
734
+      <if test="processDefinitionId != null" >
735
+        process_definition_id = #{processDefinitionId,jdbcType=VARCHAR},
736
+      </if>
737
+      <if test="qualityStandard != null" >
738
+        quality_standard = #{qualityStandard,jdbcType=VARCHAR},
739
+      </if>
740
+      <if test="agreeTime != null" >
741
+        agree_time = #{agreeTime,jdbcType=TIMESTAMP},
742
+      </if>
743
+      <if test="billMan != null" >
744
+        bill_man = #{billMan,jdbcType=VARCHAR},
745
+      </if>
746
+      <if test="billDate != null" >
747
+        bill_date = #{billDate,jdbcType=TIMESTAMP},
748
+      </if>
749
+      <if test="billUnit != null" >
750
+        bill_unit = #{billUnit,jdbcType=VARCHAR},
751
+      </if>
752
+      <if test="houseId != null" >
753
+        house_id = #{houseId,jdbcType=INTEGER},
754
+      </if>
755
+      <if test="houseName != null" >
756
+        house_name = #{houseName,jdbcType=VARCHAR},
757
+      </if>
758
+      <if test="warehouseId != null" >
759
+        warehouse_id = #{warehouseId,jdbcType=INTEGER},
760
+      </if>
761
+      <if test="warehouseName != null" >
762
+        warehouse_name = #{warehouseName,jdbcType=VARCHAR},
763
+      </if>
764
+      <if test="creater != null" >
765
+        creater = #{creater,jdbcType=VARCHAR},
766
+      </if>
767
+      <if test="createTime != null" >
768
+        create_time = #{createTime,jdbcType=TIMESTAMP},
769
+      </if>
770
+      <if test="createUnit != null" >
771
+        create_unit = #{createUnit,jdbcType=VARCHAR},
772
+      </if>
773
+      <if test="createDepot != null" >
774
+        create_depot = #{createDepot,jdbcType=VARCHAR},
775
+      </if>
776
+      <if test="updateTime != null" >
777
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
778
+      </if>
779
+      <if test="orgId != null" >
780
+        org_id = #{orgId,jdbcType=INTEGER},
781
+      </if>
782
+      <if test="inApplication != null" >
783
+        in_application = #{inApplication,jdbcType=INTEGER},
784
+      </if>
785
+      <if test="createrId != null" >
786
+        creater_id = #{createrId,jdbcType=INTEGER},
787
+      </if>
788
+      <if test="rootContractBid != null" >
789
+        root_contract_bid = #{rootContractBid,jdbcType=INTEGER},
790
+      </if>
791
+      <if test="identification != null" >
792
+        identification = #{identification,jdbcType=VARCHAR},
793
+      </if>
794
+      <if test="carnumber != null" >
795
+        carNumber = #{carnumber,jdbcType=VARCHAR},
796
+      </if>
797
+    </set>
798
+    where id = #{id,jdbcType=INTEGER}
799
+  </update>
800
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.business.model.BusinessDeliveryStorageNotice" >
801
+    update business_delivery_storage_notice
802
+    set bill_type = #{billType,jdbcType=VARCHAR},
803
+      bill_type_id = #{billTypeId,jdbcType=INTEGER},
804
+      bill_number = #{billNumber,jdbcType=VARCHAR},
805
+      shiping_count = #{shipingCount,jdbcType=VARCHAR},
806
+      finished_count = #{finishedCount,jdbcType=VARCHAR},
807
+      received_money = #{receivedMoney,jdbcType=VARCHAR},
808
+      customer_bid = #{customerBid,jdbcType=INTEGER},
809
+      customer_number = #{customerNumber,jdbcType=VARCHAR},
810
+      mobile = #{mobile,jdbcType=VARCHAR},
811
+      delivery_customer = #{deliveryCustomer,jdbcType=VARCHAR},
812
+      contract = #{contract,jdbcType=VARCHAR},
813
+      contract_bid = #{contractBid,jdbcType=INTEGER},
814
+      plan_number = #{planNumber,jdbcType=VARCHAR},
815
+      plan_bid = #{planBid,jdbcType=INTEGER},
816
+      bill_memo = #{billMemo,jdbcType=VARCHAR},
817
+      grain_price = #{grainPrice,jdbcType=VARCHAR},
818
+      money_quantity = #{moneyQuantity,jdbcType=VARCHAR},
819
+      grain_annual = #{grainAnnual,jdbcType=INTEGER},
820
+      warehouse = #{warehouse,jdbcType=INTEGER},
821
+      goods_location = #{goodsLocation,jdbcType=INTEGER},
822
+      audit_state = #{auditState,jdbcType=VARCHAR},
823
+      storage_time = #{storageTime,jdbcType=TIMESTAMP},
824
+      process_instance_id = #{processInstanceId,jdbcType=VARCHAR},
825
+      process_definition_id = #{processDefinitionId,jdbcType=VARCHAR},
826
+      quality_standard = #{qualityStandard,jdbcType=VARCHAR},
827
+      agree_time = #{agreeTime,jdbcType=TIMESTAMP},
828
+      bill_man = #{billMan,jdbcType=VARCHAR},
829
+      bill_date = #{billDate,jdbcType=TIMESTAMP},
830
+      bill_unit = #{billUnit,jdbcType=VARCHAR},
831
+      house_id = #{houseId,jdbcType=INTEGER},
832
+      house_name = #{houseName,jdbcType=VARCHAR},
833
+      warehouse_id = #{warehouseId,jdbcType=INTEGER},
834
+      warehouse_name = #{warehouseName,jdbcType=VARCHAR},
835
+      creater = #{creater,jdbcType=VARCHAR},
836
+      create_time = #{createTime,jdbcType=TIMESTAMP},
837
+      create_unit = #{createUnit,jdbcType=VARCHAR},
838
+      create_depot = #{createDepot,jdbcType=VARCHAR},
839
+      update_time = #{updateTime,jdbcType=TIMESTAMP},
840
+      org_id = #{orgId,jdbcType=INTEGER},
841
+      in_application = #{inApplication,jdbcType=INTEGER},
842
+      creater_id = #{createrId,jdbcType=INTEGER},
843
+      root_contract_bid = #{rootContractBid,jdbcType=INTEGER},
844
+      identification = #{identification,jdbcType=VARCHAR},
845
+      carNumber = #{carnumber,jdbcType=VARCHAR}
846
+    where id = #{id,jdbcType=INTEGER}
847
+  </update>
848
+  
849
+   <resultMap id="approvalResultMap" type="com.chinaitop.depot.business.model.vo.BusinessDeliveryStorageNoticeAuditVO" extends="BaseResultMap">
850
+    <result column="task_id" property="taskId" jdbcType="VARCHAR" />
851
+    <result column="task_name" property="taskName" jdbcType="VARCHAR" />
852
+    <result column="result" property="result" jdbcType="VARCHAR" />
853
+    <result column="auditId" property="auditId" jdbcType="INTEGER" />
854
+  </resultMap>
855
+ 
856
+ 
857
+  <select id="getApprovalList" resultMap="approvalResultMap" parameterType="java.util.Map" >
858
+    select
859
+        a.id id, a.bill_type bill_type, a.bill_number bill_number,
860
+        a.contract contract,
861
+        a.plan_number plan_number,
862
+        a.delivery_customer delivery_customer,
863
+        a.money_quantity money_quantity,
864
+        a.bill_date bill_date,
865
+        a.process_instance_id process_instance_id,
866
+        a.process_definition_id process_definition_id,
867
+        b.id auditId,
868
+        b.result result,
869
+        b.task_id task_id,
870
+        b.task_name task_name
871
+    from business_delivery_storage_notice a, business_approval b
872
+    <where>
873
+        a.process_instance_id = b.process_instance_id
874
+        and
875
+        a.audit_state != 0
876
+        <if test="operator != null">
877
+            and b.operator = #{operator}
878
+        </if>
879
+        <if test="billType != null">
880
+            and a.bill_type = #{billType}
881
+        </if>
882
+        <if test="result != null">
883
+            and b.result = #{result}
884
+        </if>
885
+        order by FIELD(b.result, '待审批', '同意', '驳回', '拒绝'), b.create_time desc
886
+    </where>
887
+  </select>
888
+ 
889
+  <update id="updateApplication" parameterType="java.util.Map">
890
+     update business_delivery_storage_notice
891
+     set in_application = #{inApplication}
892
+     where
893
+     1=1
894
+     <!-- 不能修改已经执行完毕的启动状态  -->
895
+     and in_application != 2
896
+     <if test="planBid != null" >
897
+        and plan_bid =  #{planBid}
898
+    </if>
899
+    <if test="contractBid != null" >
900
+        and contract_bid = #{contractBid}
901
+    </if>
902
+    <if test="rootContractBid != null" >
903
+        and root_contract_bid = #{rootContractBid}
904
+    </if>
905
+  </update>
906
+ 
907
+  <select id="selectByExampleToVO" resultMap="approvalResultMap" parameterType="com.chinaitop.depot.business.model.BusinessDeliveryStorageNoticeExample" >
908
+    select
909
+    <if test="distinct" >
910
+      distinct
911
+    </if>
912
+    <include refid="Base_Column_List" />
913
+    from business_delivery_storage_notice
914
+    <if test="_parameter != null" >
915
+      <include refid="Example_Where_Clause" />
916
+    </if>
917
+    <if test="orderByClause != null" >
918
+      order by ${orderByClause}
919
+    </if>
920
+  </select>
921
+
922
+  <select id="uploadNoticeData" parameterType="java.util.Map" resultType="java.util.HashMap">
923
+    SELECT
924
+        notice.*,
925
+        customer.address, <!-- 地址 -->
926
+        customer.identification,<!-- 身份证号 -->
927
+        customer.mobile,<!-- 手机号 -->
928
+        customer.social_credit_code identification,<!-- 社会信用代码 -->
929
+        customer.enterprise_phone mobile<!-- 企业电话 -->
930
+    FROM
931
+        business_delivery_storage_notice notice
932
+    left join business_customer customer on customer.id=notice.customer_bid
933
+    WHERE ((notice.audit_state=2) or (notice.bill_type=2)) and 1 = 1 <!-- 审批通过的,中转通知单没有审批 -->
934
+    <if test="orgId != null" ><!--用house_id 区分是哪个库的 house_id是代储库 orgId 是主库 -->
935
+      AND notice.house_id = #{orgId,jdbcType=INTEGER}
936
+    </if>
937
+    <if test="inApplication != null" >
938
+      AND notice.in_Application = #{inApplication,jdbcType=INTEGER}
939
+    </if>
940
+    <if test="ids != null" >
941
+      AND notice.id not in
942
+      <foreach collection="ids" item="listItem" open="(" close=")" separator="," >
943
+        #{listItem}
944
+      </foreach>
945
+    </if>
946
+  </select>
947
+</mapper>

+ 32 - 0
src/main/java/com/chinaitop/depot/business/mapper/BusinessFileMapper.java

@@ -0,0 +1,32 @@
1
+package com.chinaitop.depot.business.mapper;
2
+
3
+import com.chinaitop.depot.business.model.BusinessFile;
4
+import com.chinaitop.depot.business.model.BusinessFileExample;
5
+import java.util.List;
6
+import org.apache.ibatis.annotations.Param;
7
+import org.springframework.stereotype.Repository;
8
+
9
+@Repository
10
+public interface BusinessFileMapper {
11
+    int countByExample(BusinessFileExample example);
12
+
13
+    int deleteByExample(BusinessFileExample example);
14
+
15
+    int deleteByPrimaryKey(Integer id);
16
+
17
+    int insert(BusinessFile record);
18
+
19
+    int insertSelective(BusinessFile record);
20
+
21
+    List<BusinessFile> selectByExample(BusinessFileExample example);
22
+
23
+    BusinessFile selectByPrimaryKey(Integer id);
24
+
25
+    int updateByExampleSelective(@Param("record") BusinessFile record, @Param("example") BusinessFileExample example);
26
+
27
+    int updateByExample(@Param("record") BusinessFile record, @Param("example") BusinessFileExample example);
28
+
29
+    int updateByPrimaryKeySelective(BusinessFile record);
30
+
31
+    int updateByPrimaryKey(BusinessFile record);
32
+}

+ 338 - 0
src/main/java/com/chinaitop/depot/business/mapper/BusinessFileMapper.xml

@@ -0,0 +1,338 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.chinaitop.depot.business.mapper.BusinessFileMapper" >
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.business.model.BusinessFile" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="bid" property="bid" jdbcType="INTEGER" />
7
+    <result column="type" property="type" jdbcType="VARCHAR" />
8
+    <result column="file_name" property="fileName" jdbcType="VARCHAR" />
9
+    <result column="original_file_name" property="originalFileName" jdbcType="VARCHAR" />
10
+    <result column="file_type" property="fileType" jdbcType="VARCHAR" />
11
+    <result column="source" property="source" jdbcType="VARCHAR" />
12
+    <result column="remarks" property="remarks" jdbcType="VARCHAR" />
13
+    <result column="file_path" property="filePath" jdbcType="VARCHAR" />
14
+    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
15
+    <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
16
+    <result column="creater" property="creater" jdbcType="INTEGER" />
17
+    <result column="org_id" property="orgId" jdbcType="INTEGER" />
18
+  </resultMap>
19
+  <sql id="Example_Where_Clause" >
20
+    <where >
21
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
22
+        <if test="criteria.valid" >
23
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
24
+            <foreach collection="criteria.criteria" item="criterion" >
25
+              <choose >
26
+                <when test="criterion.noValue" >
27
+                  and ${criterion.condition}
28
+                </when>
29
+                <when test="criterion.singleValue" >
30
+                  and ${criterion.condition} #{criterion.value}
31
+                </when>
32
+                <when test="criterion.betweenValue" >
33
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
34
+                </when>
35
+                <when test="criterion.listValue" >
36
+                  and ${criterion.condition}
37
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
38
+                    #{listItem}
39
+                  </foreach>
40
+                </when>
41
+              </choose>
42
+            </foreach>
43
+          </trim>
44
+        </if>
45
+      </foreach>
46
+    </where>
47
+  </sql>
48
+  <sql id="Update_By_Example_Where_Clause" >
49
+    <where >
50
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
51
+        <if test="criteria.valid" >
52
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
53
+            <foreach collection="criteria.criteria" item="criterion" >
54
+              <choose >
55
+                <when test="criterion.noValue" >
56
+                  and ${criterion.condition}
57
+                </when>
58
+                <when test="criterion.singleValue" >
59
+                  and ${criterion.condition} #{criterion.value}
60
+                </when>
61
+                <when test="criterion.betweenValue" >
62
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
63
+                </when>
64
+                <when test="criterion.listValue" >
65
+                  and ${criterion.condition}
66
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
67
+                    #{listItem}
68
+                  </foreach>
69
+                </when>
70
+              </choose>
71
+            </foreach>
72
+          </trim>
73
+        </if>
74
+      </foreach>
75
+    </where>
76
+  </sql>
77
+  <sql id="Base_Column_List" >
78
+    id, bid, type, file_name, original_file_name, file_type, source, remarks, file_path, 
79
+    create_time, update_time, creater, org_id
80
+  </sql>
81
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.business.model.BusinessFileExample" >
82
+    select
83
+    <if test="distinct" >
84
+      distinct
85
+    </if>
86
+    <include refid="Base_Column_List" />
87
+    from business_file
88
+    <if test="_parameter != null" >
89
+      <include refid="Example_Where_Clause" />
90
+    </if>
91
+    <if test="orderByClause != null" >
92
+      order by ${orderByClause}
93
+    </if>
94
+  </select>
95
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
96
+    select 
97
+    <include refid="Base_Column_List" />
98
+    from business_file
99
+    where id = #{id,jdbcType=INTEGER}
100
+  </select>
101
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
102
+    delete from business_file
103
+    where id = #{id,jdbcType=INTEGER}
104
+  </delete>
105
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.business.model.BusinessFileExample" >
106
+    delete from business_file
107
+    <if test="_parameter != null" >
108
+      <include refid="Example_Where_Clause" />
109
+    </if>
110
+  </delete>
111
+  <insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.chinaitop.depot.business.model.BusinessFile" >
112
+    insert into business_file (id, bid, type, 
113
+      file_name, original_file_name, file_type, 
114
+      source, remarks, file_path, 
115
+      create_time, update_time, creater, 
116
+      org_id)
117
+    values (#{id,jdbcType=INTEGER}, #{bid,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR}, 
118
+      #{fileName,jdbcType=VARCHAR}, #{originalFileName,jdbcType=VARCHAR}, #{fileType,jdbcType=VARCHAR}, 
119
+      #{source,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, #{filePath,jdbcType=VARCHAR}, 
120
+      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{creater,jdbcType=INTEGER}, 
121
+      #{orgId,jdbcType=INTEGER})
122
+  </insert>
123
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.business.model.BusinessFile" >
124
+    insert into business_file
125
+    <trim prefix="(" suffix=")" suffixOverrides="," >
126
+      <if test="id != null" >
127
+        id,
128
+      </if>
129
+      <if test="bid != null" >
130
+        bid,
131
+      </if>
132
+      <if test="type != null" >
133
+        type,
134
+      </if>
135
+      <if test="fileName != null" >
136
+        file_name,
137
+      </if>
138
+      <if test="originalFileName != null" >
139
+        original_file_name,
140
+      </if>
141
+      <if test="fileType != null" >
142
+        file_type,
143
+      </if>
144
+      <if test="source != null" >
145
+        source,
146
+      </if>
147
+      <if test="remarks != null" >
148
+        remarks,
149
+      </if>
150
+      <if test="filePath != null" >
151
+        file_path,
152
+      </if>
153
+      <if test="createTime != null" >
154
+        create_time,
155
+      </if>
156
+      <if test="updateTime != null" >
157
+        update_time,
158
+      </if>
159
+      <if test="creater != null" >
160
+        creater,
161
+      </if>
162
+      <if test="orgId != null" >
163
+        org_id,
164
+      </if>
165
+    </trim>
166
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
167
+      <if test="id != null" >
168
+        #{id,jdbcType=INTEGER},
169
+      </if>
170
+      <if test="bid != null" >
171
+        #{bid,jdbcType=INTEGER},
172
+      </if>
173
+      <if test="type != null" >
174
+        #{type,jdbcType=VARCHAR},
175
+      </if>
176
+      <if test="fileName != null" >
177
+        #{fileName,jdbcType=VARCHAR},
178
+      </if>
179
+      <if test="originalFileName != null" >
180
+        #{originalFileName,jdbcType=VARCHAR},
181
+      </if>
182
+      <if test="fileType != null" >
183
+        #{fileType,jdbcType=VARCHAR},
184
+      </if>
185
+      <if test="source != null" >
186
+        #{source,jdbcType=VARCHAR},
187
+      </if>
188
+      <if test="remarks != null" >
189
+        #{remarks,jdbcType=VARCHAR},
190
+      </if>
191
+      <if test="filePath != null" >
192
+        #{filePath,jdbcType=VARCHAR},
193
+      </if>
194
+      <if test="createTime != null" >
195
+        #{createTime,jdbcType=TIMESTAMP},
196
+      </if>
197
+      <if test="updateTime != null" >
198
+        #{updateTime,jdbcType=TIMESTAMP},
199
+      </if>
200
+      <if test="creater != null" >
201
+        #{creater,jdbcType=INTEGER},
202
+      </if>
203
+      <if test="orgId != null" >
204
+        #{orgId,jdbcType=INTEGER},
205
+      </if>
206
+    </trim>
207
+  </insert>
208
+  <select id="countByExample" parameterType="com.chinaitop.depot.business.model.BusinessFileExample" resultType="java.lang.Integer" >
209
+    select count(*) from business_file
210
+    <if test="_parameter != null" >
211
+      <include refid="Example_Where_Clause" />
212
+    </if>
213
+  </select>
214
+  <update id="updateByExampleSelective" parameterType="map" >
215
+    update business_file
216
+    <set >
217
+      <if test="record.id != null" >
218
+        id = #{record.id,jdbcType=INTEGER},
219
+      </if>
220
+      <if test="record.bid != null" >
221
+        bid = #{record.bid,jdbcType=INTEGER},
222
+      </if>
223
+      <if test="record.type != null" >
224
+        type = #{record.type,jdbcType=VARCHAR},
225
+      </if>
226
+      <if test="record.fileName != null" >
227
+        file_name = #{record.fileName,jdbcType=VARCHAR},
228
+      </if>
229
+      <if test="record.originalFileName != null" >
230
+        original_file_name = #{record.originalFileName,jdbcType=VARCHAR},
231
+      </if>
232
+      <if test="record.fileType != null" >
233
+        file_type = #{record.fileType,jdbcType=VARCHAR},
234
+      </if>
235
+      <if test="record.source != null" >
236
+        source = #{record.source,jdbcType=VARCHAR},
237
+      </if>
238
+      <if test="record.remarks != null" >
239
+        remarks = #{record.remarks,jdbcType=VARCHAR},
240
+      </if>
241
+      <if test="record.filePath != null" >
242
+        file_path = #{record.filePath,jdbcType=VARCHAR},
243
+      </if>
244
+      <if test="record.createTime != null" >
245
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
246
+      </if>
247
+      <if test="record.updateTime != null" >
248
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
249
+      </if>
250
+      <if test="record.creater != null" >
251
+        creater = #{record.creater,jdbcType=INTEGER},
252
+      </if>
253
+      <if test="record.orgId != null" >
254
+        org_id = #{record.orgId,jdbcType=INTEGER},
255
+      </if>
256
+    </set>
257
+    <if test="_parameter != null" >
258
+      <include refid="Update_By_Example_Where_Clause" />
259
+    </if>
260
+  </update>
261
+  <update id="updateByExample" parameterType="map" >
262
+    update business_file
263
+    set id = #{record.id,jdbcType=INTEGER},
264
+      bid = #{record.bid,jdbcType=INTEGER},
265
+      type = #{record.type,jdbcType=VARCHAR},
266
+      file_name = #{record.fileName,jdbcType=VARCHAR},
267
+      original_file_name = #{record.originalFileName,jdbcType=VARCHAR},
268
+      file_type = #{record.fileType,jdbcType=VARCHAR},
269
+      source = #{record.source,jdbcType=VARCHAR},
270
+      remarks = #{record.remarks,jdbcType=VARCHAR},
271
+      file_path = #{record.filePath,jdbcType=VARCHAR},
272
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
273
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
274
+      creater = #{record.creater,jdbcType=INTEGER},
275
+      org_id = #{record.orgId,jdbcType=INTEGER}
276
+    <if test="_parameter != null" >
277
+      <include refid="Update_By_Example_Where_Clause" />
278
+    </if>
279
+  </update>
280
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.business.model.BusinessFile" >
281
+    update business_file
282
+    <set >
283
+      <if test="bid != null" >
284
+        bid = #{bid,jdbcType=INTEGER},
285
+      </if>
286
+      <if test="type != null" >
287
+        type = #{type,jdbcType=VARCHAR},
288
+      </if>
289
+      <if test="fileName != null" >
290
+        file_name = #{fileName,jdbcType=VARCHAR},
291
+      </if>
292
+      <if test="originalFileName != null" >
293
+        original_file_name = #{originalFileName,jdbcType=VARCHAR},
294
+      </if>
295
+      <if test="fileType != null" >
296
+        file_type = #{fileType,jdbcType=VARCHAR},
297
+      </if>
298
+      <if test="source != null" >
299
+        source = #{source,jdbcType=VARCHAR},
300
+      </if>
301
+      <if test="remarks != null" >
302
+        remarks = #{remarks,jdbcType=VARCHAR},
303
+      </if>
304
+      <if test="filePath != null" >
305
+        file_path = #{filePath,jdbcType=VARCHAR},
306
+      </if>
307
+      <if test="createTime != null" >
308
+        create_time = #{createTime,jdbcType=TIMESTAMP},
309
+      </if>
310
+      <if test="updateTime != null" >
311
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
312
+      </if>
313
+      <if test="creater != null" >
314
+        creater = #{creater,jdbcType=INTEGER},
315
+      </if>
316
+      <if test="orgId != null" >
317
+        org_id = #{orgId,jdbcType=INTEGER},
318
+      </if>
319
+    </set>
320
+    where id = #{id,jdbcType=INTEGER}
321
+  </update>
322
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.business.model.BusinessFile" >
323
+    update business_file
324
+    set bid = #{bid,jdbcType=INTEGER},
325
+      type = #{type,jdbcType=VARCHAR},
326
+      file_name = #{fileName,jdbcType=VARCHAR},
327
+      original_file_name = #{originalFileName,jdbcType=VARCHAR},
328
+      file_type = #{fileType,jdbcType=VARCHAR},
329
+      source = #{source,jdbcType=VARCHAR},
330
+      remarks = #{remarks,jdbcType=VARCHAR},
331
+      file_path = #{filePath,jdbcType=VARCHAR},
332
+      create_time = #{createTime,jdbcType=TIMESTAMP},
333
+      update_time = #{updateTime,jdbcType=TIMESTAMP},
334
+      creater = #{creater,jdbcType=INTEGER},
335
+      org_id = #{orgId,jdbcType=INTEGER}
336
+    where id = #{id,jdbcType=INTEGER}
337
+  </update>
338
+</mapper>

+ 34 - 0
src/main/java/com/chinaitop/depot/business/mapper/BusinessLadingMapper.java

@@ -0,0 +1,34 @@
1
+package com.chinaitop.depot.business.mapper;
2
+
3
+import com.chinaitop.depot.business.model.BusinessLading;
4
+import com.chinaitop.depot.business.model.BusinessLadingExample;
5
+import java.util.List;
6
+import java.util.Map;
7
+
8
+import org.apache.ibatis.annotations.Param;
9
+
10
+public interface BusinessLadingMapper {
11
+    int countByExample(BusinessLadingExample example);
12
+
13
+    int deleteByExample(BusinessLadingExample example);
14
+
15
+    int deleteByPrimaryKey(Integer id);
16
+
17
+    int insert(BusinessLading record);
18
+
19
+    int insertSelective(BusinessLading record);
20
+
21
+    List<BusinessLading> selectByExample(BusinessLadingExample example);
22
+
23
+    BusinessLading selectByPrimaryKey(Integer id);
24
+
25
+    int updateByExampleSelective(@Param("record") BusinessLading record, @Param("example") BusinessLadingExample example);
26
+
27
+    int updateByExample(@Param("record") BusinessLading record, @Param("example") BusinessLadingExample example);
28
+
29
+    int updateByPrimaryKeySelective(BusinessLading record);
30
+
31
+    int updateByPrimaryKey(BusinessLading record);
32
+
33
+	List<Map<String, Object>> getLadingDatas(Map<String, Object> mapCondition);
34
+}

+ 519 - 0
src/main/java/com/chinaitop/depot/business/mapper/BusinessLadingMapper.xml

@@ -0,0 +1,519 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.chinaitop.depot.business.mapper.BusinessLadingMapper" >
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.business.model.BusinessLading" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="lading_number" property="ladingNumber" jdbcType="VARCHAR" />
7
+    <result column="inbound_number" property="inboundNumber" jdbcType="VARCHAR" />
8
+    <result column="customer_name" property="customerName" jdbcType="VARCHAR" />
9
+    <result column="train_number" property="trainNumber" jdbcType="VARCHAR" />
10
+    <result column="grain_kind" property="grainKind" jdbcType="INTEGER" />
11
+    <result column="model" property="model" jdbcType="VARCHAR" />
12
+    <result column="unload_number" property="unloadNumber" jdbcType="DOUBLE" />
13
+    <result column="platform" property="platform" jdbcType="VARCHAR" />
14
+    <result column="warehouse_name" property="warehouseName" jdbcType="VARCHAR" />
15
+    <result column="goods_number" property="goodsNumber" jdbcType="DOUBLE" />
16
+    <result column="measurement_method" property="measurementMethod" jdbcType="INTEGER" />
17
+    <result column="business_type" property="businessType" jdbcType="VARCHAR" />
18
+    <result column="sales_type" property="salesType" jdbcType="VARCHAR" />
19
+    <result column="sales_department" property="salesDepartment" jdbcType="VARCHAR" />
20
+    <result column="transport_station" property="transportStation" jdbcType="VARCHAR" />
21
+    <result column="delivery_date" property="deliveryDate" jdbcType="TIMESTAMP" />
22
+    <result column="creater" property="creater" jdbcType="VARCHAR" />
23
+    <result column="bill_date" property="billDate" jdbcType="TIMESTAMP" />
24
+    <result column="carNumber" property="carnumber" jdbcType="VARCHAR" />
25
+    <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
26
+    <result column="org_id" property="orgId" jdbcType="INTEGER" />
27
+  </resultMap>
28
+  <sql id="Example_Where_Clause" >
29
+    <where >
30
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
31
+        <if test="criteria.valid" >
32
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
33
+            <foreach collection="criteria.criteria" item="criterion" >
34
+              <choose >
35
+                <when test="criterion.noValue" >
36
+                  and ${criterion.condition}
37
+                </when>
38
+                <when test="criterion.singleValue" >
39
+                  and ${criterion.condition} #{criterion.value}
40
+                </when>
41
+                <when test="criterion.betweenValue" >
42
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
43
+                </when>
44
+                <when test="criterion.listValue" >
45
+                  and ${criterion.condition}
46
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
47
+                    #{listItem}
48
+                  </foreach>
49
+                </when>
50
+              </choose>
51
+            </foreach>
52
+          </trim>
53
+        </if>
54
+      </foreach>
55
+    </where>
56
+  </sql>
57
+  <sql id="Update_By_Example_Where_Clause" >
58
+    <where >
59
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
60
+        <if test="criteria.valid" >
61
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
62
+            <foreach collection="criteria.criteria" item="criterion" >
63
+              <choose >
64
+                <when test="criterion.noValue" >
65
+                  and ${criterion.condition}
66
+                </when>
67
+                <when test="criterion.singleValue" >
68
+                  and ${criterion.condition} #{criterion.value}
69
+                </when>
70
+                <when test="criterion.betweenValue" >
71
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
72
+                </when>
73
+                <when test="criterion.listValue" >
74
+                  and ${criterion.condition}
75
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
76
+                    #{listItem}
77
+                  </foreach>
78
+                </when>
79
+              </choose>
80
+            </foreach>
81
+          </trim>
82
+        </if>
83
+      </foreach>
84
+    </where>
85
+  </sql>
86
+  <sql id="Base_Column_List" >
87
+    id, lading_number, inbound_number, customer_name, train_number, grain_kind, model, 
88
+    unload_number, platform, warehouse_name, goods_number, measurement_method, business_type, 
89
+    sales_type, sales_department, transport_station, delivery_date, creater, bill_date, 
90
+    carNumber, updatetime, org_id
91
+  </sql>
92
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.business.model.BusinessLadingExample" >
93
+    select
94
+    <if test="distinct" >
95
+      distinct
96
+    </if>
97
+    <include refid="Base_Column_List" />
98
+    from business_lading
99
+    <if test="_parameter != null" >
100
+      <include refid="Example_Where_Clause" />
101
+    </if>
102
+    <if test="orderByClause != null" >
103
+      order by ${orderByClause}
104
+    </if>
105
+  </select>
106
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
107
+    select 
108
+    <include refid="Base_Column_List" />
109
+    from business_lading
110
+    where id = #{id,jdbcType=INTEGER}
111
+  </select>
112
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
113
+    delete from business_lading
114
+    where id = #{id,jdbcType=INTEGER}
115
+  </delete>
116
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.business.model.BusinessLadingExample" >
117
+    delete from business_lading
118
+    <if test="_parameter != null" >
119
+      <include refid="Example_Where_Clause" />
120
+    </if>
121
+  </delete>
122
+  <insert id="insert" parameterType="com.chinaitop.depot.business.model.BusinessLading" >
123
+    insert into business_lading (id, lading_number, inbound_number, 
124
+      customer_name, train_number, grain_kind, 
125
+      model, unload_number, platform, 
126
+      warehouse_name, goods_number, measurement_method, 
127
+      business_type, sales_type, sales_department, 
128
+      transport_station, delivery_date, creater, 
129
+      bill_date, carNumber, updatetime, 
130
+      org_id)
131
+    values (#{id,jdbcType=INTEGER}, #{ladingNumber,jdbcType=VARCHAR}, #{inboundNumber,jdbcType=VARCHAR}, 
132
+      #{customerName,jdbcType=VARCHAR}, #{trainNumber,jdbcType=VARCHAR}, #{grainKind,jdbcType=INTEGER}, 
133
+      #{model,jdbcType=VARCHAR}, #{unloadNumber,jdbcType=DOUBLE}, #{platform,jdbcType=VARCHAR}, 
134
+      #{warehouseName,jdbcType=VARCHAR}, #{goodsNumber,jdbcType=DOUBLE}, #{measurementMethod,jdbcType=INTEGER}, 
135
+      #{businessType,jdbcType=VARCHAR}, #{salesType,jdbcType=VARCHAR}, #{salesDepartment,jdbcType=VARCHAR}, 
136
+      #{transportStation,jdbcType=VARCHAR}, #{deliveryDate,jdbcType=TIMESTAMP}, #{creater,jdbcType=VARCHAR}, 
137
+      #{billDate,jdbcType=TIMESTAMP}, #{carnumber,jdbcType=VARCHAR}, #{updatetime,jdbcType=TIMESTAMP}, 
138
+      #{orgId,jdbcType=INTEGER})
139
+  </insert>
140
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.business.model.BusinessLading" >
141
+    insert into business_lading
142
+    <trim prefix="(" suffix=")" suffixOverrides="," >
143
+      <if test="id != null" >
144
+        id,
145
+      </if>
146
+      <if test="ladingNumber != null" >
147
+        lading_number,
148
+      </if>
149
+      <if test="inboundNumber != null" >
150
+        inbound_number,
151
+      </if>
152
+      <if test="customerName != null" >
153
+        customer_name,
154
+      </if>
155
+      <if test="trainNumber != null" >
156
+        train_number,
157
+      </if>
158
+      <if test="grainKind != null" >
159
+        grain_kind,
160
+      </if>
161
+      <if test="model != null" >
162
+        model,
163
+      </if>
164
+      <if test="unloadNumber != null" >
165
+        unload_number,
166
+      </if>
167
+      <if test="platform != null" >
168
+        platform,
169
+      </if>
170
+      <if test="warehouseName != null" >
171
+        warehouse_name,
172
+      </if>
173
+      <if test="goodsNumber != null" >
174
+        goods_number,
175
+      </if>
176
+      <if test="measurementMethod != null" >
177
+        measurement_method,
178
+      </if>
179
+      <if test="businessType != null" >
180
+        business_type,
181
+      </if>
182
+      <if test="salesType != null" >
183
+        sales_type,
184
+      </if>
185
+      <if test="salesDepartment != null" >
186
+        sales_department,
187
+      </if>
188
+      <if test="transportStation != null" >
189
+        transport_station,
190
+      </if>
191
+      <if test="deliveryDate != null" >
192
+        delivery_date,
193
+      </if>
194
+      <if test="creater != null" >
195
+        creater,
196
+      </if>
197
+      <if test="billDate != null" >
198
+        bill_date,
199
+      </if>
200
+      <if test="carnumber != null" >
201
+        carNumber,
202
+      </if>
203
+      <if test="updatetime != null" >
204
+        updatetime,
205
+      </if>
206
+      <if test="orgId != null" >
207
+        org_id,
208
+      </if>
209
+    </trim>
210
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
211
+      <if test="id != null" >
212
+        #{id,jdbcType=INTEGER},
213
+      </if>
214
+      <if test="ladingNumber != null" >
215
+        #{ladingNumber,jdbcType=VARCHAR},
216
+      </if>
217
+      <if test="inboundNumber != null" >
218
+        #{inboundNumber,jdbcType=VARCHAR},
219
+      </if>
220
+      <if test="customerName != null" >
221
+        #{customerName,jdbcType=VARCHAR},
222
+      </if>
223
+      <if test="trainNumber != null" >
224
+        #{trainNumber,jdbcType=VARCHAR},
225
+      </if>
226
+      <if test="grainKind != null" >
227
+        #{grainKind,jdbcType=INTEGER},
228
+      </if>
229
+      <if test="model != null" >
230
+        #{model,jdbcType=VARCHAR},
231
+      </if>
232
+      <if test="unloadNumber != null" >
233
+        #{unloadNumber,jdbcType=DOUBLE},
234
+      </if>
235
+      <if test="platform != null" >
236
+        #{platform,jdbcType=VARCHAR},
237
+      </if>
238
+      <if test="warehouseName != null" >
239
+        #{warehouseName,jdbcType=VARCHAR},
240
+      </if>
241
+      <if test="goodsNumber != null" >
242
+        #{goodsNumber,jdbcType=DOUBLE},
243
+      </if>
244
+      <if test="measurementMethod != null" >
245
+        #{measurementMethod,jdbcType=INTEGER},
246
+      </if>
247
+      <if test="businessType != null" >
248
+        #{businessType,jdbcType=VARCHAR},
249
+      </if>
250
+      <if test="salesType != null" >
251
+        #{salesType,jdbcType=VARCHAR},
252
+      </if>
253
+      <if test="salesDepartment != null" >
254
+        #{salesDepartment,jdbcType=VARCHAR},
255
+      </if>
256
+      <if test="transportStation != null" >
257
+        #{transportStation,jdbcType=VARCHAR},
258
+      </if>
259
+      <if test="deliveryDate != null" >
260
+        #{deliveryDate,jdbcType=TIMESTAMP},
261
+      </if>
262
+      <if test="creater != null" >
263
+        #{creater,jdbcType=VARCHAR},
264
+      </if>
265
+      <if test="billDate != null" >
266
+        #{billDate,jdbcType=TIMESTAMP},
267
+      </if>
268
+      <if test="carnumber != null" >
269
+        #{carnumber,jdbcType=VARCHAR},
270
+      </if>
271
+      <if test="updatetime != null" >
272
+        #{updatetime,jdbcType=TIMESTAMP},
273
+      </if>
274
+      <if test="orgId != null" >
275
+        #{orgId,jdbcType=INTEGER},
276
+      </if>
277
+    </trim>
278
+  </insert>
279
+  <select id="countByExample" parameterType="com.chinaitop.depot.business.model.BusinessLadingExample" resultType="java.lang.Integer" >
280
+    select count(*) from business_lading
281
+    <if test="_parameter != null" >
282
+      <include refid="Example_Where_Clause" />
283
+    </if>
284
+  </select>
285
+  <update id="updateByExampleSelective" parameterType="map" >
286
+    update business_lading
287
+    <set >
288
+      <if test="record.id != null" >
289
+        id = #{record.id,jdbcType=INTEGER},
290
+      </if>
291
+      <if test="record.ladingNumber != null" >
292
+        lading_number = #{record.ladingNumber,jdbcType=VARCHAR},
293
+      </if>
294
+      <if test="record.inboundNumber != null" >
295
+        inbound_number = #{record.inboundNumber,jdbcType=VARCHAR},
296
+      </if>
297
+      <if test="record.customerName != null" >
298
+        customer_name = #{record.customerName,jdbcType=VARCHAR},
299
+      </if>
300
+      <if test="record.trainNumber != null" >
301
+        train_number = #{record.trainNumber,jdbcType=VARCHAR},
302
+      </if>
303
+      <if test="record.grainKind != null" >
304
+        grain_kind = #{record.grainKind,jdbcType=INTEGER},
305
+      </if>
306
+      <if test="record.model != null" >
307
+        model = #{record.model,jdbcType=VARCHAR},
308
+      </if>
309
+      <if test="record.unloadNumber != null" >
310
+        unload_number = #{record.unloadNumber,jdbcType=DOUBLE},
311
+      </if>
312
+      <if test="record.platform != null" >
313
+        platform = #{record.platform,jdbcType=VARCHAR},
314
+      </if>
315
+      <if test="record.warehouseName != null" >
316
+        warehouse_name = #{record.warehouseName,jdbcType=VARCHAR},
317
+      </if>
318
+      <if test="record.goodsNumber != null" >
319
+        goods_number = #{record.goodsNumber,jdbcType=DOUBLE},
320
+      </if>
321
+      <if test="record.measurementMethod != null" >
322
+        measurement_method = #{record.measurementMethod,jdbcType=INTEGER},
323
+      </if>
324
+      <if test="record.businessType != null" >
325
+        business_type = #{record.businessType,jdbcType=VARCHAR},
326
+      </if>
327
+      <if test="record.salesType != null" >
328
+        sales_type = #{record.salesType,jdbcType=VARCHAR},
329
+      </if>
330
+      <if test="record.salesDepartment != null" >
331
+        sales_department = #{record.salesDepartment,jdbcType=VARCHAR},
332
+      </if>
333
+      <if test="record.transportStation != null" >
334
+        transport_station = #{record.transportStation,jdbcType=VARCHAR},
335
+      </if>
336
+      <if test="record.deliveryDate != null" >
337
+        delivery_date = #{record.deliveryDate,jdbcType=TIMESTAMP},
338
+      </if>
339
+      <if test="record.creater != null" >
340
+        creater = #{record.creater,jdbcType=VARCHAR},
341
+      </if>
342
+      <if test="record.billDate != null" >
343
+        bill_date = #{record.billDate,jdbcType=TIMESTAMP},
344
+      </if>
345
+      <if test="record.carnumber != null" >
346
+        carNumber = #{record.carnumber,jdbcType=VARCHAR},
347
+      </if>
348
+      <if test="record.updatetime != null" >
349
+        updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
350
+      </if>
351
+      <if test="record.orgId != null" >
352
+        org_id = #{record.orgId,jdbcType=INTEGER},
353
+      </if>
354
+    </set>
355
+    <if test="_parameter != null" >
356
+      <include refid="Update_By_Example_Where_Clause" />
357
+    </if>
358
+  </update>
359
+  <update id="updateByExample" parameterType="map" >
360
+    update business_lading
361
+    set id = #{record.id,jdbcType=INTEGER},
362
+      lading_number = #{record.ladingNumber,jdbcType=VARCHAR},
363
+      inbound_number = #{record.inboundNumber,jdbcType=VARCHAR},
364
+      customer_name = #{record.customerName,jdbcType=VARCHAR},
365
+      train_number = #{record.trainNumber,jdbcType=VARCHAR},
366
+      grain_kind = #{record.grainKind,jdbcType=INTEGER},
367
+      model = #{record.model,jdbcType=VARCHAR},
368
+      unload_number = #{record.unloadNumber,jdbcType=DOUBLE},
369
+      platform = #{record.platform,jdbcType=VARCHAR},
370
+      warehouse_name = #{record.warehouseName,jdbcType=VARCHAR},
371
+      goods_number = #{record.goodsNumber,jdbcType=DOUBLE},
372
+      measurement_method = #{record.measurementMethod,jdbcType=INTEGER},
373
+      business_type = #{record.businessType,jdbcType=VARCHAR},
374
+      sales_type = #{record.salesType,jdbcType=VARCHAR},
375
+      sales_department = #{record.salesDepartment,jdbcType=VARCHAR},
376
+      transport_station = #{record.transportStation,jdbcType=VARCHAR},
377
+      delivery_date = #{record.deliveryDate,jdbcType=TIMESTAMP},
378
+      creater = #{record.creater,jdbcType=VARCHAR},
379
+      bill_date = #{record.billDate,jdbcType=TIMESTAMP},
380
+      carNumber = #{record.carnumber,jdbcType=VARCHAR},
381
+      updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
382
+      org_id = #{record.orgId,jdbcType=INTEGER}
383
+    <if test="_parameter != null" >
384
+      <include refid="Update_By_Example_Where_Clause" />
385
+    </if>
386
+  </update>
387
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.business.model.BusinessLading" >
388
+    update business_lading
389
+    <set >
390
+      <if test="ladingNumber != null" >
391
+        lading_number = #{ladingNumber,jdbcType=VARCHAR},
392
+      </if>
393
+      <if test="inboundNumber != null" >
394
+        inbound_number = #{inboundNumber,jdbcType=VARCHAR},
395
+      </if>
396
+      <if test="customerName != null" >
397
+        customer_name = #{customerName,jdbcType=VARCHAR},
398
+      </if>
399
+      <if test="trainNumber != null" >
400
+        train_number = #{trainNumber,jdbcType=VARCHAR},
401
+      </if>
402
+      <if test="grainKind != null" >
403
+        grain_kind = #{grainKind,jdbcType=INTEGER},
404
+      </if>
405
+      <if test="model != null" >
406
+        model = #{model,jdbcType=VARCHAR},
407
+      </if>
408
+      <if test="unloadNumber != null" >
409
+        unload_number = #{unloadNumber,jdbcType=DOUBLE},
410
+      </if>
411
+      <if test="platform != null" >
412
+        platform = #{platform,jdbcType=VARCHAR},
413
+      </if>
414
+      <if test="warehouseName != null" >
415
+        warehouse_name = #{warehouseName,jdbcType=VARCHAR},
416
+      </if>
417
+      <if test="goodsNumber != null" >
418
+        goods_number = #{goodsNumber,jdbcType=DOUBLE},
419
+      </if>
420
+      <if test="measurementMethod != null" >
421
+        measurement_method = #{measurementMethod,jdbcType=INTEGER},
422
+      </if>
423
+      <if test="businessType != null" >
424
+        business_type = #{businessType,jdbcType=VARCHAR},
425
+      </if>
426
+      <if test="salesType != null" >
427
+        sales_type = #{salesType,jdbcType=VARCHAR},
428
+      </if>
429
+      <if test="salesDepartment != null" >
430
+        sales_department = #{salesDepartment,jdbcType=VARCHAR},
431
+      </if>
432
+      <if test="transportStation != null" >
433
+        transport_station = #{transportStation,jdbcType=VARCHAR},
434
+      </if>
435
+      <if test="deliveryDate != null" >
436
+        delivery_date = #{deliveryDate,jdbcType=TIMESTAMP},
437
+      </if>
438
+      <if test="creater != null" >
439
+        creater = #{creater,jdbcType=VARCHAR},
440
+      </if>
441
+      <if test="billDate != null" >
442
+        bill_date = #{billDate,jdbcType=TIMESTAMP},
443
+      </if>
444
+      <if test="carnumber != null" >
445
+        carNumber = #{carnumber,jdbcType=VARCHAR},
446
+      </if>
447
+      <if test="updatetime != null" >
448
+        updatetime = #{updatetime,jdbcType=TIMESTAMP},
449
+      </if>
450
+      <if test="orgId != null" >
451
+        org_id = #{orgId,jdbcType=INTEGER},
452
+      </if>
453
+    </set>
454
+    where id = #{id,jdbcType=INTEGER}
455
+  </update>
456
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.business.model.BusinessLading" >
457
+    update business_lading
458
+    set lading_number = #{ladingNumber,jdbcType=VARCHAR},
459
+      inbound_number = #{inboundNumber,jdbcType=VARCHAR},
460
+      customer_name = #{customerName,jdbcType=VARCHAR},
461
+      train_number = #{trainNumber,jdbcType=VARCHAR},
462
+      grain_kind = #{grainKind,jdbcType=INTEGER},
463
+      model = #{model,jdbcType=VARCHAR},
464
+      unload_number = #{unloadNumber,jdbcType=DOUBLE},
465
+      platform = #{platform,jdbcType=VARCHAR},
466
+      warehouse_name = #{warehouseName,jdbcType=VARCHAR},
467
+      goods_number = #{goodsNumber,jdbcType=DOUBLE},
468
+      measurement_method = #{measurementMethod,jdbcType=INTEGER},
469
+      business_type = #{businessType,jdbcType=VARCHAR},
470
+      sales_type = #{salesType,jdbcType=VARCHAR},
471
+      sales_department = #{salesDepartment,jdbcType=VARCHAR},
472
+      transport_station = #{transportStation,jdbcType=VARCHAR},
473
+      delivery_date = #{deliveryDate,jdbcType=TIMESTAMP},
474
+      creater = #{creater,jdbcType=VARCHAR},
475
+      bill_date = #{billDate,jdbcType=TIMESTAMP},
476
+      carNumber = #{carnumber,jdbcType=VARCHAR},
477
+      updatetime = #{updatetime,jdbcType=TIMESTAMP},
478
+      org_id = #{orgId,jdbcType=INTEGER}
479
+    where id = #{id,jdbcType=INTEGER}
480
+  </update>
481
+  
482
+  <select id="getLadingDatas" parameterType="java.util.Map" resultType="java.util.HashMap">
483
+    SELECT
484
+		id,
485
+		org_id,
486
+		lading_number thdh,
487
+		carNumber qcph,
488
+		customer_name khmc,
489
+		train_number glhcph,
490
+		model ggxh,
491
+		unload_number js,
492
+		warehouse_name hw,
493
+		goods_number thjs,
494
+		transport_station fyz,
495
+		DATE_FORMAT(
496
+			delivery_date,
497
+			'%Y-%m-%d %T'
498
+		) fhrq,
499
+		DATE_FORMAT(bill_date, '%Y-%m-%d %T') zdrq,
500
+		inbound_number rzdh,
501
+		grain_kind lypz,
502
+		platform zt,
503
+		measurement_method jlfs,
504
+		creater zdr,
505
+		sales_department djzl
506
+   FROM
507
+	   business_lading
508
+    WHERE 1 = 1
509
+    <if test="orgId != null" >
510
+      AND org_id = #{orgId,jdbcType=INTEGER}
511
+    </if>
512
+    <if test="thdhs != null" >
513
+      AND lading_number not in
514
+      <foreach collection="thdhs" item="listItem" open="(" close=")" separator="," >
515
+        #{listItem}
516
+      </foreach>
517
+    </if>
518
+  </select>
519
+</mapper>

+ 50 - 0
src/main/java/com/chinaitop/depot/business/mapper/BusinessPlanMapper.java

@@ -0,0 +1,50 @@
1
+package com.chinaitop.depot.business.mapper;
2
+
3
+import com.chinaitop.depot.business.model.BusinessPlan;
4
+import com.chinaitop.depot.business.model.BusinessPlanExample;
5
+import com.chinaitop.depot.business.model.vo.BusinessPlanAuditVO;
6
+
7
+import java.util.List;
8
+import java.util.Map;
9
+
10
+import org.apache.ibatis.annotations.Param;
11
+
12
+public interface BusinessPlanMapper {
13
+    int countByExample(BusinessPlanExample example);
14
+
15
+    int deleteByExample(BusinessPlanExample example);
16
+
17
+    int deleteByPrimaryKey(Integer id);
18
+
19
+    int insert(BusinessPlan record);
20
+
21
+    int insertSelective(BusinessPlan record);
22
+
23
+    List<BusinessPlan> selectByExample(BusinessPlanExample example);
24
+
25
+    BusinessPlan selectByPrimaryKey(Integer id);
26
+
27
+    int updateByExampleSelective(@Param("record") BusinessPlan record, @Param("example") BusinessPlanExample example);
28
+
29
+    int updateByExample(@Param("record") BusinessPlan record, @Param("example") BusinessPlanExample example);
30
+
31
+    int updateByPrimaryKeySelective(BusinessPlan record);
32
+
33
+    int updateByPrimaryKey(BusinessPlan record);
34
+    
35
+    //自增
36
+    List<BusinessPlanAuditVO> getApprovalList(Map<String, Object> paramMap);
37
+    List<BusinessPlanAuditVO> selectByExampleToVO(BusinessPlanExample example);
38
+
39
+    List<BusinessPlanAuditVO> getAcceptanceList(Map<String, Object> paramMap);
40
+    int addAcceptance(Map<String, String> paramMap);
41
+    int addAcceptanceDetail(Map<String, String> paramMap);
42
+
43
+	void updateByStatus(Integer id);
44
+
45
+	List<Map<String, Object>> queryAcceptanceList(Map<String, Object> map);
46
+	//架空期带出数据
47
+	List<Map<String, Object>> getjkqPlanList(Map<String, Object> map);
48
+
49
+	List<Map<String, Object>> getjkqDayList(Map<String, Object> map);
50
+}

+ 837 - 0
src/main/java/com/chinaitop/depot/business/mapper/BusinessPlanMapper.xml

@@ -0,0 +1,837 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.chinaitop.depot.business.mapper.BusinessPlanMapper" >
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.business.model.BusinessPlan" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="plan_number" property="planNumber" jdbcType="VARCHAR" />
7
+    <result column="plan_title" property="planTitle" jdbcType="VARCHAR" />
8
+    <result column="reference_number" property="referenceNumber" jdbcType="VARCHAR" />
9
+    <result column="plan_desc" property="planDesc" jdbcType="VARCHAR" />
10
+    <result column="execute_type" property="executeType" jdbcType="INTEGER" />
11
+    <result column="out_amount" property="outAmount" jdbcType="VARCHAR" />
12
+    <result column="in_amount" property="inAmount" jdbcType="VARCHAR" />
13
+    <result column="out_total_price" property="outTotalPrice" jdbcType="VARCHAR" />
14
+    <result column="in_total_price" property="inTotalPrice" jdbcType="VARCHAR" />
15
+    <result column="customer_plan_state" property="customerPlanState" jdbcType="VARCHAR" />
16
+    <result column="plan_customer" property="planCustomer" jdbcType="VARCHAR" />
17
+    <result column="audit_state" property="auditState" jdbcType="VARCHAR" />
18
+    <result column="process_instance_id" property="processInstanceId" jdbcType="VARCHAR" />
19
+    <result column="process_definition_id" property="processDefinitionId" jdbcType="VARCHAR" />
20
+    <result column="current_approve_path" property="currentApprovePath" jdbcType="VARCHAR" />
21
+    <result column="agree_time" property="agreeTime" jdbcType="TIMESTAMP" />
22
+    <result column="creater_id" property="createrId" jdbcType="INTEGER" />
23
+    <result column="creater" property="creater" jdbcType="VARCHAR" />
24
+    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
25
+    <result column="create_unit" property="createUnit" jdbcType="VARCHAR" />
26
+    <result column="org_id" property="orgId" jdbcType="INTEGER" />
27
+    <result column="in_application" property="inApplication" jdbcType="INTEGER" />
28
+    <result column="total_quantity" property="totalQuantity" jdbcType="VARCHAR" />
29
+    <result column="report_date" property="reportDate" jdbcType="TIMESTAMP" />
30
+    <result column="send_date" property="sendDate" jdbcType="TIMESTAMP" />
31
+    <result column="province_remark" property="provinceRemark" jdbcType="VARCHAR" />
32
+    <result column="enterprise_remark" property="enterpriseRemark" jdbcType="VARCHAR" />
33
+    <result column="attribute_type" property="attributeType" jdbcType="INTEGER" />
34
+    <result column="refuse_reason" property="refuseReason" jdbcType="VARCHAR" />
35
+  </resultMap>
36
+  
37
+  <resultMap id="approvalResultMap" type="com.chinaitop.depot.business.model.vo.BusinessPlanAuditVO" extends="BaseResultMap">
38
+
39
+    <result column="process_instance_id" property="processInstanceId" jdbcType="VARCHAR" />
40
+
41
+    <result column="task_id" property="taskId" jdbcType="VARCHAR" />
42
+
43
+    <result column="result" property="result" jdbcType="VARCHAR" />
44
+
45
+    <result column="task_name" property="taskName" jdbcType="VARCHAR" />
46
+
47
+    <result column="auditId" property="auditId" jdbcType="INTEGER" />
48
+
49
+    <result column="applicationDate" property="applicationDate" jdbcType="VARCHAR" />
50
+
51
+    <result column="acceptanceType" property="acceptanceType" jdbcType="VARCHAR" />
52
+
53
+    <result column="house_id" property="houseId" jdbcType="INTEGER" />
54
+
55
+    <result column="warehouse_id" property="warehouseId" jdbcType="INTEGER" />
56
+
57
+  </resultMap>
58
+  
59
+  <sql id="Example_Where_Clause" >
60
+    <where >
61
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
62
+        <if test="criteria.valid" >
63
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
64
+            <foreach collection="criteria.criteria" item="criterion" >
65
+              <choose >
66
+                <when test="criterion.noValue" >
67
+                  and ${criterion.condition}
68
+                </when>
69
+                <when test="criterion.singleValue" >
70
+                  and ${criterion.condition} #{criterion.value}
71
+                </when>
72
+                <when test="criterion.betweenValue" >
73
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
74
+                </when>
75
+                <when test="criterion.listValue" >
76
+                  and ${criterion.condition}
77
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
78
+                    #{listItem}
79
+                  </foreach>
80
+                </when>
81
+              </choose>
82
+            </foreach>
83
+          </trim>
84
+        </if>
85
+      </foreach>
86
+    </where>
87
+  </sql>
88
+  <sql id="Update_By_Example_Where_Clause" >
89
+    <where >
90
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
91
+        <if test="criteria.valid" >
92
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
93
+            <foreach collection="criteria.criteria" item="criterion" >
94
+              <choose >
95
+                <when test="criterion.noValue" >
96
+                  and ${criterion.condition}
97
+                </when>
98
+                <when test="criterion.singleValue" >
99
+                  and ${criterion.condition} #{criterion.value}
100
+                </when>
101
+                <when test="criterion.betweenValue" >
102
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
103
+                </when>
104
+                <when test="criterion.listValue" >
105
+                  and ${criterion.condition}
106
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
107
+                    #{listItem}
108
+                  </foreach>
109
+                </when>
110
+              </choose>
111
+            </foreach>
112
+          </trim>
113
+        </if>
114
+      </foreach>
115
+    </where>
116
+  </sql>
117
+  <sql id="Base_Column_List" >
118
+    id, plan_number, plan_title, reference_number, plan_desc, execute_type, out_amount, 
119
+    in_amount, out_total_price, in_total_price, customer_plan_state, plan_customer, audit_state, 
120
+    process_instance_id, process_definition_id, current_approve_path, agree_time, creater_id, 
121
+    creater, create_time, create_unit, org_id, in_application, total_quantity, report_date, 
122
+    send_date, province_remark, enterprise_remark, attribute_type, refuse_reason
123
+  </sql>
124
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.business.model.BusinessPlanExample" >
125
+    select
126
+    <if test="distinct" >
127
+      distinct
128
+    </if>
129
+    <include refid="Base_Column_List" />
130
+    from business_plan
131
+    <!-- a.id, a.plan_number, a.plan_title, a.reference_number, a.plan_desc, a.execute_type, a.out_amount,
132
+    a.in_amount, a.out_total_price, a.in_total_price, a.customer_plan_state,a.plan_customer, a.audit_state,
133
+    a.process_instance_id, a.process_definition_id, a.current_approve_path, a.agree_time, a.creater_id,
134
+    a.creater, a.create_time, a.create_unit, org_id, a.in_application, a.total_quantity, a.report_date,
135
+    a.send_date, a.province_remark, a.enterprise_remark, a.attribute_type, a.refuse_reason,
136
+    acceptance.acceptance_number acceptanceNumber
137
+    from business_plan a
138
+    LEFT JOIN business_plan_acceptance acceptance ON acceptance.plan_id = a.id -->
139
+    <if test="_parameter != null" >
140
+      <include refid="Example_Where_Clause" />
141
+    </if>
142
+    <if test="orderByClause != null" >
143
+      order by ${orderByClause}
144
+    </if>
145
+  </select>
146
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
147
+    select 
148
+    <include refid="Base_Column_List" />
149
+    from business_plan
150
+    where id = #{id,jdbcType=INTEGER}
151
+  </select>
152
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
153
+    delete from business_plan
154
+    where id = #{id,jdbcType=INTEGER}
155
+  </delete>
156
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.business.model.BusinessPlanExample" >
157
+    delete from business_plan
158
+    <if test="_parameter != null" >
159
+      <include refid="Example_Where_Clause" />
160
+    </if>
161
+  </delete>
162
+  <insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.chinaitop.depot.business.model.BusinessPlan" >
163
+    insert into business_plan (id, plan_number, plan_title, 
164
+      reference_number, plan_desc, execute_type, 
165
+      out_amount, in_amount, out_total_price, 
166
+      in_total_price, customer_plan_state, plan_customer, 
167
+      audit_state, process_instance_id, process_definition_id, 
168
+      current_approve_path, agree_time, creater_id, 
169
+      creater, create_time, create_unit, 
170
+      org_id, in_application, total_quantity, 
171
+      report_date, send_date, province_remark, 
172
+      enterprise_remark, attribute_type, refuse_reason
173
+      )
174
+    values (#{id,jdbcType=INTEGER}, #{planNumber,jdbcType=VARCHAR}, #{planTitle,jdbcType=VARCHAR}, 
175
+      #{referenceNumber,jdbcType=VARCHAR}, #{planDesc,jdbcType=VARCHAR}, #{executeType,jdbcType=INTEGER}, 
176
+      #{outAmount,jdbcType=VARCHAR}, #{inAmount,jdbcType=VARCHAR}, #{outTotalPrice,jdbcType=VARCHAR}, 
177
+      #{inTotalPrice,jdbcType=VARCHAR}, #{customerPlanState,jdbcType=VARCHAR}, #{planCustomer,jdbcType=VARCHAR}, 
178
+      #{auditState,jdbcType=VARCHAR}, #{processInstanceId,jdbcType=VARCHAR}, #{processDefinitionId,jdbcType=VARCHAR}, 
179
+      #{currentApprovePath,jdbcType=VARCHAR}, #{agreeTime,jdbcType=TIMESTAMP}, #{createrId,jdbcType=INTEGER}, 
180
+      #{creater,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{createUnit,jdbcType=VARCHAR}, 
181
+      #{orgId,jdbcType=INTEGER}, #{inApplication,jdbcType=INTEGER}, #{totalQuantity,jdbcType=VARCHAR}, 
182
+      #{reportDate,jdbcType=TIMESTAMP}, #{sendDate,jdbcType=TIMESTAMP}, #{provinceRemark,jdbcType=VARCHAR}, 
183
+      #{enterpriseRemark,jdbcType=VARCHAR}, #{attributeType,jdbcType=INTEGER}, #{refuseReason,jdbcType=VARCHAR}
184
+      )
185
+  </insert>
186
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.business.model.BusinessPlan" >
187
+    insert into business_plan
188
+    <trim prefix="(" suffix=")" suffixOverrides="," >
189
+      <if test="id != null" >
190
+        id,
191
+      </if>
192
+      <if test="planNumber != null" >
193
+        plan_number,
194
+      </if>
195
+      <if test="planTitle != null" >
196
+        plan_title,
197
+      </if>
198
+      <if test="referenceNumber != null" >
199
+        reference_number,
200
+      </if>
201
+      <if test="planDesc != null" >
202
+        plan_desc,
203
+      </if>
204
+      <if test="executeType != null" >
205
+        execute_type,
206
+      </if>
207
+      <if test="outAmount != null" >
208
+        out_amount,
209
+      </if>
210
+      <if test="inAmount != null" >
211
+        in_amount,
212
+      </if>
213
+      <if test="outTotalPrice != null" >
214
+        out_total_price,
215
+      </if>
216
+      <if test="inTotalPrice != null" >
217
+        in_total_price,
218
+      </if>
219
+      <if test="customerPlanState != null" >
220
+        customer_plan_state,
221
+      </if>
222
+      <if test="planCustomer != null" >
223
+        plan_customer,
224
+      </if>
225
+      <if test="auditState != null" >
226
+        audit_state,
227
+      </if>
228
+      <if test="processInstanceId != null" >
229
+        process_instance_id,
230
+      </if>
231
+      <if test="processDefinitionId != null" >
232
+        process_definition_id,
233
+      </if>
234
+      <if test="currentApprovePath != null" >
235
+        current_approve_path,
236
+      </if>
237
+      <if test="agreeTime != null" >
238
+        agree_time,
239
+      </if>
240
+      <if test="createrId != null" >
241
+        creater_id,
242
+      </if>
243
+      <if test="creater != null" >
244
+        creater,
245
+      </if>
246
+      <if test="createTime != null" >
247
+        create_time,
248
+      </if>
249
+      <if test="createUnit != null" >
250
+        create_unit,
251
+      </if>
252
+      <if test="orgId != null" >
253
+        org_id,
254
+      </if>
255
+      <if test="inApplication != null" >
256
+        in_application,
257
+      </if>
258
+      <if test="totalQuantity != null" >
259
+        total_quantity,
260
+      </if>
261
+      <if test="reportDate != null" >
262
+        report_date,
263
+      </if>
264
+      <if test="sendDate != null" >
265
+        send_date,
266
+      </if>
267
+      <if test="provinceRemark != null" >
268
+        province_remark,
269
+      </if>
270
+      <if test="enterpriseRemark != null" >
271
+        enterprise_remark,
272
+      </if>
273
+      <if test="attributeType != null" >
274
+        attribute_type,
275
+      </if>
276
+      <if test="refuseReason != null" >
277
+        refuse_reason,
278
+      </if>
279
+    </trim>
280
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
281
+      <if test="id != null" >
282
+        #{id,jdbcType=INTEGER},
283
+      </if>
284
+      <if test="planNumber != null" >
285
+        #{planNumber,jdbcType=VARCHAR},
286
+      </if>
287
+      <if test="planTitle != null" >
288
+        #{planTitle,jdbcType=VARCHAR},
289
+      </if>
290
+      <if test="referenceNumber != null" >
291
+        #{referenceNumber,jdbcType=VARCHAR},
292
+      </if>
293
+      <if test="planDesc != null" >
294
+        #{planDesc,jdbcType=VARCHAR},
295
+      </if>
296
+      <if test="executeType != null" >
297
+        #{executeType,jdbcType=INTEGER},
298
+      </if>
299
+      <if test="outAmount != null" >
300
+        #{outAmount,jdbcType=VARCHAR},
301
+      </if>
302
+      <if test="inAmount != null" >
303
+        #{inAmount,jdbcType=VARCHAR},
304
+      </if>
305
+      <if test="outTotalPrice != null" >
306
+        #{outTotalPrice,jdbcType=VARCHAR},
307
+      </if>
308
+      <if test="inTotalPrice != null" >
309
+        #{inTotalPrice,jdbcType=VARCHAR},
310
+      </if>
311
+      <if test="customerPlanState != null" >
312
+        #{customerPlanState,jdbcType=VARCHAR},
313
+      </if>
314
+      <if test="planCustomer != null" >
315
+        #{planCustomer,jdbcType=VARCHAR},
316
+      </if>
317
+      <if test="auditState != null" >
318
+        #{auditState,jdbcType=VARCHAR},
319
+      </if>
320
+      <if test="processInstanceId != null" >
321
+        #{processInstanceId,jdbcType=VARCHAR},
322
+      </if>
323
+      <if test="processDefinitionId != null" >
324
+        #{processDefinitionId,jdbcType=VARCHAR},
325
+      </if>
326
+      <if test="currentApprovePath != null" >
327
+        #{currentApprovePath,jdbcType=VARCHAR},
328
+      </if>
329
+      <if test="agreeTime != null" >
330
+        #{agreeTime,jdbcType=TIMESTAMP},
331
+      </if>
332
+      <if test="createrId != null" >
333
+        #{createrId,jdbcType=INTEGER},
334
+      </if>
335
+      <if test="creater != null" >
336
+        #{creater,jdbcType=VARCHAR},
337
+      </if>
338
+      <if test="createTime != null" >
339
+        #{createTime,jdbcType=TIMESTAMP},
340
+      </if>
341
+      <if test="createUnit != null" >
342
+        #{createUnit,jdbcType=VARCHAR},
343
+      </if>
344
+      <if test="orgId != null" >
345
+        #{orgId,jdbcType=INTEGER},
346
+      </if>
347
+      <if test="inApplication != null" >
348
+        #{inApplication,jdbcType=INTEGER},
349
+      </if>
350
+      <if test="totalQuantity != null" >
351
+        #{totalQuantity,jdbcType=VARCHAR},
352
+      </if>
353
+      <if test="reportDate != null" >
354
+        #{reportDate,jdbcType=TIMESTAMP},
355
+      </if>
356
+      <if test="sendDate != null" >
357
+        #{sendDate,jdbcType=TIMESTAMP},
358
+      </if>
359
+      <if test="provinceRemark != null" >
360
+        #{provinceRemark,jdbcType=VARCHAR},
361
+      </if>
362
+      <if test="enterpriseRemark != null" >
363
+        #{enterpriseRemark,jdbcType=VARCHAR},
364
+      </if>
365
+      <if test="attributeType != null" >
366
+        #{attributeType,jdbcType=INTEGER},
367
+      </if>
368
+      <if test="refuseReason != null" >
369
+        #{refuseReason,jdbcType=VARCHAR},
370
+      </if>
371
+    </trim>
372
+  </insert>
373
+  <select id="countByExample" parameterType="com.chinaitop.depot.business.model.BusinessPlanExample" resultType="java.lang.Integer" >
374
+    select count(*) from business_plan
375
+    <if test="_parameter != null" >
376
+      <include refid="Example_Where_Clause" />
377
+    </if>
378
+  </select>
379
+  <update id="updateByExampleSelective" parameterType="map" >
380
+    update business_plan
381
+    <set >
382
+      <if test="record.id != null" >
383
+        id = #{record.id,jdbcType=INTEGER},
384
+      </if>
385
+      <if test="record.planNumber != null" >
386
+        plan_number = #{record.planNumber,jdbcType=VARCHAR},
387
+      </if>
388
+      <if test="record.planTitle != null" >
389
+        plan_title = #{record.planTitle,jdbcType=VARCHAR},
390
+      </if>
391
+      <if test="record.referenceNumber != null" >
392
+        reference_number = #{record.referenceNumber,jdbcType=VARCHAR},
393
+      </if>
394
+      <if test="record.planDesc != null" >
395
+        plan_desc = #{record.planDesc,jdbcType=VARCHAR},
396
+      </if>
397
+      <if test="record.executeType != null" >
398
+        execute_type = #{record.executeType,jdbcType=INTEGER},
399
+      </if>
400
+      <if test="record.outAmount != null" >
401
+        out_amount = #{record.outAmount,jdbcType=VARCHAR},
402
+      </if>
403
+      <if test="record.inAmount != null" >
404
+        in_amount = #{record.inAmount,jdbcType=VARCHAR},
405
+      </if>
406
+      <if test="record.outTotalPrice != null" >
407
+        out_total_price = #{record.outTotalPrice,jdbcType=VARCHAR},
408
+      </if>
409
+      <if test="record.inTotalPrice != null" >
410
+        in_total_price = #{record.inTotalPrice,jdbcType=VARCHAR},
411
+      </if>
412
+      <if test="record.customerPlanState != null" >
413
+        customer_plan_state = #{record.customerPlanState,jdbcType=VARCHAR},
414
+      </if>
415
+      <if test="record.planCustomer != null" >
416
+        plan_customer = #{record.planCustomer,jdbcType=VARCHAR},
417
+      </if>
418
+      <if test="record.auditState != null" >
419
+        audit_state = #{record.auditState,jdbcType=VARCHAR},
420
+      </if>
421
+      <if test="record.processInstanceId != null" >
422
+        process_instance_id = #{record.processInstanceId,jdbcType=VARCHAR},
423
+      </if>
424
+      <if test="record.processDefinitionId != null" >
425
+        process_definition_id = #{record.processDefinitionId,jdbcType=VARCHAR},
426
+      </if>
427
+      <if test="record.currentApprovePath != null" >
428
+        current_approve_path = #{record.currentApprovePath,jdbcType=VARCHAR},
429
+      </if>
430
+      <if test="record.agreeTime != null" >
431
+        agree_time = #{record.agreeTime,jdbcType=TIMESTAMP},
432
+      </if>
433
+      <if test="record.createrId != null" >
434
+        creater_id = #{record.createrId,jdbcType=INTEGER},
435
+      </if>
436
+      <if test="record.creater != null" >
437
+        creater = #{record.creater,jdbcType=VARCHAR},
438
+      </if>
439
+      <if test="record.createTime != null" >
440
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
441
+      </if>
442
+      <if test="record.createUnit != null" >
443
+        create_unit = #{record.createUnit,jdbcType=VARCHAR},
444
+      </if>
445
+      <if test="record.orgId != null" >
446
+        org_id = #{record.orgId,jdbcType=INTEGER},
447
+      </if>
448
+      <if test="record.inApplication != null" >
449
+        in_application = #{record.inApplication,jdbcType=INTEGER},
450
+      </if>
451
+      <if test="record.totalQuantity != null" >
452
+        total_quantity = #{record.totalQuantity,jdbcType=VARCHAR},
453
+      </if>
454
+      <if test="record.reportDate != null" >
455
+        report_date = #{record.reportDate,jdbcType=TIMESTAMP},
456
+      </if>
457
+      <if test="record.sendDate != null" >
458
+        send_date = #{record.sendDate,jdbcType=TIMESTAMP},
459
+      </if>
460
+      <if test="record.provinceRemark != null" >
461
+        province_remark = #{record.provinceRemark,jdbcType=VARCHAR},
462
+      </if>
463
+      <if test="record.enterpriseRemark != null" >
464
+        enterprise_remark = #{record.enterpriseRemark,jdbcType=VARCHAR},
465
+      </if>
466
+      <if test="record.attributeType != null" >
467
+        attribute_type = #{record.attributeType,jdbcType=INTEGER},
468
+      </if>
469
+      <if test="record.refuseReason != null" >
470
+        refuse_reason = #{record.refuseReason,jdbcType=VARCHAR},
471
+      </if>
472
+    </set>
473
+    <if test="_parameter != null" >
474
+      <include refid="Update_By_Example_Where_Clause" />
475
+    </if>
476
+  </update>
477
+  <update id="updateByExample" parameterType="map" >
478
+    update business_plan
479
+    set id = #{record.id,jdbcType=INTEGER},
480
+      plan_number = #{record.planNumber,jdbcType=VARCHAR},
481
+      plan_title = #{record.planTitle,jdbcType=VARCHAR},
482
+      reference_number = #{record.referenceNumber,jdbcType=VARCHAR},
483
+      plan_desc = #{record.planDesc,jdbcType=VARCHAR},
484
+      execute_type = #{record.executeType,jdbcType=INTEGER},
485
+      out_amount = #{record.outAmount,jdbcType=VARCHAR},
486
+      in_amount = #{record.inAmount,jdbcType=VARCHAR},
487
+      out_total_price = #{record.outTotalPrice,jdbcType=VARCHAR},
488
+      in_total_price = #{record.inTotalPrice,jdbcType=VARCHAR},
489
+      customer_plan_state = #{record.customerPlanState,jdbcType=VARCHAR},
490
+      plan_customer = #{record.planCustomer,jdbcType=VARCHAR},
491
+      audit_state = #{record.auditState,jdbcType=VARCHAR},
492
+      process_instance_id = #{record.processInstanceId,jdbcType=VARCHAR},
493
+      process_definition_id = #{record.processDefinitionId,jdbcType=VARCHAR},
494
+      current_approve_path = #{record.currentApprovePath,jdbcType=VARCHAR},
495
+      agree_time = #{record.agreeTime,jdbcType=TIMESTAMP},
496
+      creater_id = #{record.createrId,jdbcType=INTEGER},
497
+      creater = #{record.creater,jdbcType=VARCHAR},
498
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
499
+      create_unit = #{record.createUnit,jdbcType=VARCHAR},
500
+      org_id = #{record.orgId,jdbcType=INTEGER},
501
+      in_application = #{record.inApplication,jdbcType=INTEGER},
502
+      total_quantity = #{record.totalQuantity,jdbcType=VARCHAR},
503
+      report_date = #{record.reportDate,jdbcType=TIMESTAMP},
504
+      send_date = #{record.sendDate,jdbcType=TIMESTAMP},
505
+      province_remark = #{record.provinceRemark,jdbcType=VARCHAR},
506
+      enterprise_remark = #{record.enterpriseRemark,jdbcType=VARCHAR},
507
+      attribute_type = #{record.attributeType,jdbcType=INTEGER},
508
+      refuse_reason = #{record.refuseReason,jdbcType=VARCHAR}
509
+    <if test="_parameter != null" >
510
+      <include refid="Update_By_Example_Where_Clause" />
511
+    </if>
512
+  </update>
513
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.business.model.BusinessPlan" >
514
+    update business_plan
515
+    <set >
516
+      <if test="planNumber != null" >
517
+        plan_number = #{planNumber,jdbcType=VARCHAR},
518
+      </if>
519
+      <if test="planTitle != null" >
520
+        plan_title = #{planTitle,jdbcType=VARCHAR},
521
+      </if>
522
+      <if test="referenceNumber != null" >
523
+        reference_number = #{referenceNumber,jdbcType=VARCHAR},
524
+      </if>
525
+      <if test="planDesc != null" >
526
+        plan_desc = #{planDesc,jdbcType=VARCHAR},
527
+      </if>
528
+      <if test="executeType != null" >
529
+        execute_type = #{executeType,jdbcType=INTEGER},
530
+      </if>
531
+      <if test="outAmount != null" >
532
+        out_amount = #{outAmount,jdbcType=VARCHAR},
533
+      </if>
534
+      <if test="inAmount != null" >
535
+        in_amount = #{inAmount,jdbcType=VARCHAR},
536
+      </if>
537
+      <if test="outTotalPrice != null" >
538
+        out_total_price = #{outTotalPrice,jdbcType=VARCHAR},
539
+      </if>
540
+      <if test="inTotalPrice != null" >
541
+        in_total_price = #{inTotalPrice,jdbcType=VARCHAR},
542
+      </if>
543
+      <if test="customerPlanState != null" >
544
+        customer_plan_state = #{customerPlanState,jdbcType=VARCHAR},
545
+      </if>
546
+      <if test="planCustomer != null" >
547
+        plan_customer = #{planCustomer,jdbcType=VARCHAR},
548
+      </if>
549
+      <if test="auditState != null" >
550
+        audit_state = #{auditState,jdbcType=VARCHAR},
551
+      </if>
552
+      <if test="processInstanceId != null" >
553
+        process_instance_id = #{processInstanceId,jdbcType=VARCHAR},
554
+      </if>
555
+      <if test="processDefinitionId != null" >
556
+        process_definition_id = #{processDefinitionId,jdbcType=VARCHAR},
557
+      </if>
558
+      <if test="currentApprovePath != null" >
559
+        current_approve_path = #{currentApprovePath,jdbcType=VARCHAR},
560
+      </if>
561
+      <if test="agreeTime != null" >
562
+        agree_time = #{agreeTime,jdbcType=TIMESTAMP},
563
+      </if>
564
+      <if test="createrId != null" >
565
+        creater_id = #{createrId,jdbcType=INTEGER},
566
+      </if>
567
+      <if test="creater != null" >
568
+        creater = #{creater,jdbcType=VARCHAR},
569
+      </if>
570
+      <if test="createTime != null" >
571
+        create_time = #{createTime,jdbcType=TIMESTAMP},
572
+      </if>
573
+      <if test="createUnit != null" >
574
+        create_unit = #{createUnit,jdbcType=VARCHAR},
575
+      </if>
576
+      <if test="orgId != null" >
577
+        org_id = #{orgId,jdbcType=INTEGER},
578
+      </if>
579
+      <if test="inApplication != null" >
580
+        in_application = #{inApplication,jdbcType=INTEGER},
581
+      </if>
582
+      <if test="totalQuantity != null" >
583
+        total_quantity = #{totalQuantity,jdbcType=VARCHAR},
584
+      </if>
585
+      <if test="reportDate != null" >
586
+        report_date = #{reportDate,jdbcType=TIMESTAMP},
587
+      </if>
588
+      <if test="sendDate != null" >
589
+        send_date = #{sendDate,jdbcType=TIMESTAMP},
590
+      </if>
591
+      <if test="provinceRemark != null" >
592
+        province_remark = #{provinceRemark,jdbcType=VARCHAR},
593
+      </if>
594
+      <if test="enterpriseRemark != null" >
595
+        enterprise_remark = #{enterpriseRemark,jdbcType=VARCHAR},
596
+      </if>
597
+      <if test="attributeType != null" >
598
+        attribute_type = #{attributeType,jdbcType=INTEGER},
599
+      </if>
600
+      <if test="refuseReason != null" >
601
+        refuse_reason = #{refuseReason,jdbcType=VARCHAR},
602
+      </if>
603
+    </set>
604
+    where id = #{id,jdbcType=INTEGER}
605
+  </update>
606
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.business.model.BusinessPlan" >
607
+    update business_plan
608
+    set plan_number = #{planNumber,jdbcType=VARCHAR},
609
+      plan_title = #{planTitle,jdbcType=VARCHAR},
610
+      reference_number = #{referenceNumber,jdbcType=VARCHAR},
611
+      plan_desc = #{planDesc,jdbcType=VARCHAR},
612
+      execute_type = #{executeType,jdbcType=INTEGER},
613
+      out_amount = #{outAmount,jdbcType=VARCHAR},
614
+      in_amount = #{inAmount,jdbcType=VARCHAR},
615
+      out_total_price = #{outTotalPrice,jdbcType=VARCHAR},
616
+      in_total_price = #{inTotalPrice,jdbcType=VARCHAR},
617
+      customer_plan_state = #{customerPlanState,jdbcType=VARCHAR},
618
+      plan_customer = #{planCustomer,jdbcType=VARCHAR},
619
+      audit_state = #{auditState,jdbcType=VARCHAR},
620
+      process_instance_id = #{processInstanceId,jdbcType=VARCHAR},
621
+      process_definition_id = #{processDefinitionId,jdbcType=VARCHAR},
622
+      current_approve_path = #{currentApprovePath,jdbcType=VARCHAR},
623
+      agree_time = #{agreeTime,jdbcType=TIMESTAMP},
624
+      creater_id = #{createrId,jdbcType=INTEGER},
625
+      creater = #{creater,jdbcType=VARCHAR},
626
+      create_time = #{createTime,jdbcType=TIMESTAMP},
627
+      create_unit = #{createUnit,jdbcType=VARCHAR},
628
+      org_id = #{orgId,jdbcType=INTEGER},
629
+      in_application = #{inApplication,jdbcType=INTEGER},
630
+      total_quantity = #{totalQuantity,jdbcType=VARCHAR},
631
+      report_date = #{reportDate,jdbcType=TIMESTAMP},
632
+      send_date = #{sendDate,jdbcType=TIMESTAMP},
633
+      province_remark = #{provinceRemark,jdbcType=VARCHAR},
634
+      enterprise_remark = #{enterpriseRemark,jdbcType=VARCHAR},
635
+      attribute_type = #{attributeType,jdbcType=INTEGER},
636
+      refuse_reason = #{refuseReason,jdbcType=VARCHAR}
637
+    where id = #{id,jdbcType=INTEGER}
638
+  </update>
639
+  
640
+  
641
+  <select id="getApprovalList" resultMap="approvalResultMap" parameterType="java.util.Map" >
642
+    select
643
+        a.id id, a.plan_number plan_number, a.reference_number reference_number, a.execute_type execute_type,
644
+        a.in_amount in_amount,a.out_amount out_amount, a.create_time create_time,
645
+        a.process_instance_id process_instance_id,
646
+        a.process_definition_id process_definition_id,
647
+        b.id auditId,
648
+        b.result result, b.task_id task_id,b.task_name task_name
649
+    from business_plan a, business_approval b
650
+    <where>
651
+        a.process_instance_id = b.process_instance_id
652
+        and
653
+        a.audit_state != 0
654
+        <if test="operator != null">
655
+           and b.operator = #{operator}
656
+        </if>
657
+        <if test="result != null">
658
+           and b.result = #{result}
659
+        </if>
660
+        <if test="planNumber != null">
661
+           and a.plan_number LIKE CONCAT(CONCAT('%', #{planNumber}), '%')
662
+        </if>
663
+        <if test="attributeType != null">
664
+           and a.attribute_type = #{attributeType}
665
+        </if>
666
+        order by FIELD(b.result, '待审批', '同意', '驳回', '拒绝'), b.create_time desc
667
+    </where>
668
+  </select>
669
+
670
+  <select id="selectByExampleToVO" resultMap="approvalResultMap" parameterType="com.chinaitop.depot.business.model.BusinessPlanExample" >select
671
+    <if test="distinct" >
672
+      distinct
673
+    </if>
674
+    <include refid="Base_Column_List" />
675
+    from business_plan
676
+    <if test="_parameter != null" >
677
+      <include refid="Example_Where_Clause" />
678
+    </if>
679
+    <if test="orderByClause != null" >
680
+      order by ${orderByClause}
681
+    </if>
682
+  </select>
683
+
684
+  <update id="updateByStatus" parameterType="java.lang.Integer">
685
+  	update business_plan set customer_plan_state=1 where id=#{id};
686
+  </update>
687
+
688
+ <!-- 审批结束的(audit_state = 2),终止(in_application = 3),已上报的(customer_plan_state=50)的轮换计划(execute_type=3156)-->
689
+  <select id="getAcceptanceList" resultMap="approvalResultMap" parameterType="java.util.Map" >
690
+    SELECT
691
+      a.id id,a.plan_number plan_number,a.reference_number reference_number,
692
+      a.execute_type execute_type,
693
+      a.customer_plan_state customer_plan_state,
694
+      a.in_application in_application,
695
+      detail.grain_kind grain_kind,
696
+      detail.grain_attribute grain_attribute,
697
+      detail.grain_annual grain_annual,
698
+      detail.house_id house_id,
699
+      detail.warehouse_id warehouse_id,
700
+      a.create_time create_time,
701
+      a.process_instance_id process_instance_id,
702
+      a.process_definition_id process_definition_id,
703
+      a.plan_title plan_title,
704
+      acceptance.application_date applicationDate,
705
+      acceptance.acceptance_type acceptanceType
706
+    FROM
707
+      business_plan a
708
+    LEFT JOIN business_plan_acceptance acceptance ON acceptance.plan_id = a.id
709
+    LEFT JOIN business_store_ware_detail detail ON detail.zid = a.id
710
+    <where>
711
+      a.audit_state = 2 AND a.in_application = 3 AND a.execute_type=3156 AND customer_plan_state=50
712
+      <if test="planTitle != null">
713
+        and a.plan_title LIKE CONCAT(CONCAT('%', #{planTitle}), '%')
714
+      </if>
715
+      <if test="planNumber != null">
716
+        and a.plan_number LIKE CONCAT(CONCAT('%', #{planNumber}), '%')
717
+      </if>
718
+      order by a.create_time desc
719
+    </where>
720
+  </select>
721
+
722
+  <insert id="addAcceptance" useGeneratedKeys="true" keyProperty="id"  parameterType="java.util.Map">
723
+      INSERT INTO business_plan_acceptance (plan_id, application_date, acceptance_number,acceptance_type) VALUES
724
+      ${sql}
725
+  </insert>
726
+
727
+  <insert id="addAcceptanceDetail" parameterType="java.util.Map">
728
+      INSERT INTO business_plan_acceptance_detail (acceptance_id, qualitycheck_id) VALUES
729
+      ${sqlDetail}
730
+  </insert>
731
+
732
+  <select id="getDataByZJId" resultMap="BaseResultMap" parameterType="java.util.Map" >
733
+    SELECT
734
+        quality.*,house.storehouse_name storehouseName,warehouse.warehouse_name wareHouseName, acceptance.id acceptanceId
735
+    FROM
736
+        business_plan_acceptance acceptance
737
+    INNER JOIN business_plan_acceptance_detail detail ON detail.acceptance_id = acceptance.id
738
+    INNER JOIN storage_qualitycheck quality ON quality.id = detail.qualitycheck_id
739
+    INNER JOIN basic_storehouse house ON house.storehouse_id = quality.house_id
740
+    INNER JOIN basic_warehouse warehouse ON warehouse.warehouse_id = quality.warehouse_id
741
+     where acceptance.plan_id = #{id,jdbcType=VARCHAR}
742
+  </select>
743
+  
744
+  
745
+  <select id="queryAcceptanceList" parameterType="java.util.Map" resultType="java.util.HashMap" >
746
+    select * from business_plan_acceptance a left join business_plan p on a.plan_id=p.id 
747
+    <!-- left join business_plan_acceptance_detail pa on pa.acceptance_id = a.id -->
748
+    <where>
749
+     p.creater_id = #{userId} and p.org_id = #{orgId}
750
+    	<if test="planTitle != null">
751
+          and p.plan_title LIKE CONCAT('%',#{planTitle,jdbcType=VARCHAR},'%')
752
+         </if>
753
+        <if test="planNumber != null">
754
+        and p.plan_number LIKE CONCAT('%',#{planNumber,jdbcType=VARCHAR},'%')
755
+        </if>     		       
756
+        <if test="customerPlanState != null">
757
+        and p.customer_plan_state = #{customerPlanState}
758
+        </if>
759
+        order by p.create_time desc
760
+    </where>
761
+  </select>
762
+  
763
+  <!-- 架空期查询 -->
764
+   <select id="getjkqPlanList" parameterType="java.util.Map" resultType="java.util.HashMap" >
765
+	SELECT
766
+	a.ch,
767
+	a.hwh,
768
+	a.wjh
769
+	FROM
770
+		lsreport_ts.data_kcgl_fcbgz_default a
771
+	LEFT JOIN lsreport_ts.data_kcgl_xckc_default b ON a.DataID = b.DataID
772
+	LEFT JOIN depot.business_delivery_storage_notice c ON b.tzdh = c.bill_number
773
+	LEFT JOIN depot.business_plan d ON  c.plan_number = d.plan_number
774
+	<where>
775
+	<if test="orgId != null">
776
+	AND d.org_id = #{orgId}
777
+	</if>
778
+	<if test="executeType != null">
779
+	AND d.execute_type = #{executeType}
780
+	</if>
781
+	<if test="cjsjA != null and cjsjB != null and cjsjA != '' and cjsjB != ''" >
782
+	AND a.cjsj between #{cjsjA} and #{cjsjB}
783
+	</if>
784
+	<if test="rqA != null and rqB != null and rqA != '' and rqB != ''" >
785
+	AND a.rq between #{rqA} and #{rqB}
786
+	</if>
787
+	</where>
788
+  </select>
789
+  <!-- 查询轮换日期 -->
790
+  <select id="getjkqDayList" parameterType="java.util.Map" resultType="java.util.HashMap" >
791
+	SELECT
792
+	distinct
793
+	a.cjsj AS modifydate,
794
+	a.ch,
795
+	a.hwh,
796
+	a.mxpz,
797
+	a.hwxz,
798
+	a.zcsl,
799
+	SUM(a.srsl) AS srsl,
800
+	c.bill_number,
801
+	c.plan_number AS jhbh,
802
+	(IFNULL(d.customer_plan_state,7))  AS planSp,
803
+	DATE_FORMAT(DATE_ADD(a.cjsj,INTERVAL 1 DAY),'%Y-%m-%d') AS jkqStart,
804
+	DATE_FORMAT(DATE_ADD(a.cjsj,INTERVAL 1 DAY),'%Y-%m-%d') AS jkqEnd,
805
+	a.rq
806
+	FROM
807
+		lsreport_ts.data_kcgl_fcbgz_default a
808
+	LEFT JOIN lsreport_ts.data_kcgl_xckc_default b ON a.DataID = b.DataID
809
+	LEFT JOIN depot.business_delivery_storage_notice c ON b.tzdh = c.bill_number
810
+	LEFT JOIN depot.business_plan d ON c.plan_number = d.plan_number
811
+	<where>
812
+	<if test="orgId != null">
813
+	AND d.org_id = #{orgId}
814
+	</if>
815
+	<if test="ch != null">
816
+	AND a.ch = #{ch}
817
+	</if>
818
+	<if test="hwh != null">
819
+	AND a.hwh = #{hwh}
820
+	</if>
821
+	<if test="wjh != null">
822
+	AND c.plan_number = #{wjh}
823
+	</if>
824
+	<if test="executeType != null">
825
+	AND d.execute_type = #{executeType}
826
+	</if>
827
+	<if test="cjsjA != null and cjsjB != null and cjsjA != '' and cjsjB != ''" >
828
+	AND a.cjsj between #{cjsjA} and #{cjsjB}
829
+	</if>
830
+	<if test="rqA != null and rqB != null and rqA != '' and rqB != ''" >
831
+	AND a.rq between #{rqA} and #{rqB}
832
+	</if>
833
+	</where>
834
+	ORDER BY
835
+	a.rq DESC
836
+  </select>
837
+</mapper>

+ 49 - 0
src/main/java/com/chinaitop/depot/business/mapper/BusinessSceduleMapper.java

@@ -0,0 +1,49 @@
1
+/*package com.chinaitop.depot.business.mapper;
2
+
3
+import java.util.List;
4
+import java.util.Map;
5
+
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+import com.chinaitop.depot.business.model.BusinessScedule;
9
+
10
+
11
+*//**
12
+ * 粮库业务管理与出入库系统关联mapper.
13
+* <p>Title: BusinessSceduleMapper</p>
14
+* <p>Description: </p>
15
+* @author yaoyabin
16
+* @date 2017年11月20日 上午10:58:55
17
+ *//*
18
+public interface BusinessSceduleMapper {
19
+
20
+    *//**
21
+     * 通过多个计划id,获取这多个计划的出入库类型,出库总数量,入库总数量.
22
+     * @param planIds
23
+     * @return
24
+     *//*
25
+    List<BusinessScedule> getPlanSceduleInPlanId(@Param("planIds")String planIds);
26
+    
27
+    *//**
28
+     * 通过多个合同id,获取这多个合同的出入库类型,出库总数量,入库总数量.
29
+     * @param planIds
30
+     * @return
31
+     *//*
32
+    List<BusinessScedule> getContractSceduleInContractId(@Param("contractIds")String contractIds);
33
+    
34
+    *//**
35
+     * 通过多个通知单id,获取这多个通知单的出入库类型,出库总数量,入库总数量.
36
+     * @param planIds
37
+     * @return
38
+     *//*
39
+    List<BusinessScedule> getNoticeSceduleInNoticeId(@Param("noticeIds")String noticeIds);
40
+
41
+    *//**
42
+     * 根据粮库业务管理中出入库通知单id,修改出入库系统中,通知单状态. 
43
+     * 修改出入库表  data_crkyw_tzdxx_default中tzdh等于 这边的 通知单id获取到DataID 
44
+     * 通过DataID 链接 fl_bill_relation 修改字段FLOWSTATUS
45
+     * @param paramMap 通知单id. 通知单状态.
46
+     *//*
47
+    void updateNoticeStatus(Map<String, Object> paramMap);
48
+    
49
+}*/

+ 47 - 0
src/main/java/com/chinaitop/depot/business/mapper/BusinessSceduleMapper.xml

@@ -0,0 +1,47 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.chinaitop.depot.business.mapper.BusinessSceduleMapper" >
4
+  <select id="getPlanSceduleInPlanId" parameterType="java.lang.String" resultType="com.chinaitop.depot.business.model.BusinessScedule">
5
+  	SELECT
6
+		x.kybgh jhId, x.cazylx crkLx, sum(f.srsl) sumRksl, sum(f.zcsl) sumCksl
7
+	FROM
8
+		data_kcgl_xckc_default x,
9
+		data_kcgl_fcbgz_default f
10
+	WHERE
11
+		x.DataID = f.stockdataid
12
+		and x.kybgh IN ${planIds} GROUP BY x.kybgh, x.cazylx;
13
+  </select>
14
+  
15
+  <select id="getContractSceduleInContractId" parameterType="java.lang.String" resultType="com.chinaitop.depot.business.model.BusinessScedule">
16
+  	SELECT
17
+		x.htbh htId, x.cazylx crkLx, sum(f.srsl) sumRksl, sum(f.zcsl) sumCksl
18
+	FROM
19
+		data_kcgl_xckc_default x,
20
+		data_kcgl_fcbgz_default f
21
+	WHERE
22
+		x.DataID = f.stockdataid
23
+		and x.htbh IN ${contractIds} GROUP BY x.htbh, x.cazylx;
24
+  </select>
25
+  
26
+  <select id="getNoticeSceduleInNoticeId" parameterType="java.lang.String" resultType="com.chinaitop.depot.business.model.BusinessScedule">
27
+  	SELECT
28
+		x.tzdh tzdId, x.cazylx crkLx, sum(f.srsl) sumRksl, sum(f.zcsl) sumCksl
29
+	FROM
30
+		data_kcgl_xckc_default x,
31
+		data_kcgl_fcbgz_default f
32
+	WHERE
33
+		x.DataID = f.stockdataid
34
+		and x.tzdh IN ${noticeIds} GROUP BY x.tzdh, x.cazylx;
35
+  </select>
36
+  
37
+  <update id="updateNoticeStatus" parameterType="java.util.Map">
38
+  	UPDATE 
39
+  		fl_bill_relation 
40
+  	SET 
41
+  		FLOWSTATUS = ${FLOWSTATUS}
42
+	WHERE 
43
+		DATAID IN (SELECT DataID FROM data_crkyw_tzdxx_default WHERE tzdh = ${tzdh})
44
+		<!-- 不能修改已经执行完毕的通知单的状态  -->
45
+		and FLOWSTATUS != 2
46
+  </update>
47
+</mapper>

+ 69 - 0
src/main/java/com/chinaitop/depot/business/mapper/BusinessStoreWareDetailMapper.java

@@ -0,0 +1,69 @@
1
+package com.chinaitop.depot.business.mapper;
2
+
3
+import com.chinaitop.depot.business.model.BusinessDeliveryStorageNoticeExample;
4
+import com.chinaitop.depot.business.model.BusinessStoreWareDetail;
5
+import com.chinaitop.depot.business.model.BusinessStoreWareDetailExample;
6
+import com.chinaitop.depot.business.model.vo.BusinessDeliveryStorageNoticeAuditVO;
7
+
8
+import java.util.List;
9
+import java.util.Map;
10
+
11
+import org.apache.ibatis.annotations.Param;
12
+
13
+public interface BusinessStoreWareDetailMapper {
14
+    int countByExample(BusinessStoreWareDetailExample example);
15
+
16
+    int deleteByExample(BusinessStoreWareDetailExample example);
17
+
18
+    int deleteByPrimaryKey(Integer id);
19
+
20
+    int insert(BusinessStoreWareDetail record);
21
+
22
+    int insertSelective(BusinessStoreWareDetail record);
23
+
24
+    List<BusinessStoreWareDetail> selectByExample(BusinessStoreWareDetailExample example);
25
+
26
+    BusinessStoreWareDetail selectByPrimaryKey(Integer id);
27
+
28
+    int updateByExampleSelective(@Param("record") BusinessStoreWareDetail record, @Param("example") BusinessStoreWareDetailExample example);
29
+
30
+    int updateByExample(@Param("record") BusinessStoreWareDetail record, @Param("example") BusinessStoreWareDetailExample example);
31
+
32
+    int updateByPrimaryKeySelective(BusinessStoreWareDetail record);
33
+
34
+    int updateByPrimaryKey(BusinessStoreWareDetail record);
35
+    
36
+    /**
37
+     * @param paramMap
38
+     * @return
39
+     */
40
+    List<BusinessDeliveryStorageNoticeAuditVO> getApprovalList(Map<String, Object> paramMap);
41
+
42
+    /**
43
+     * @param paramMap
44
+     */
45
+    void updateApplication(Map<String, Object> paramMap);
46
+
47
+    /**
48
+     * @param example
49
+     * @return
50
+     */
51
+    List<BusinessDeliveryStorageNoticeAuditVO> selectByExampleToVO(
52
+            BusinessDeliveryStorageNoticeExample example);
53
+
54
+    /**
55
+     * 根据计划ID查询数据计划子表数据中计划的使用数量
56
+     * 
57
+     * @param map 参数集合
58
+     * @return
59
+     */
60
+    List<Map<String, Object>> selectPlanUseCount(Map<String, Object> map);
61
+
62
+    /**
63
+     * 根据合同ID查询数据计划子表数据中计划的使用数量
64
+     * 
65
+     * @param map 参数集合
66
+     * @return
67
+     */
68
+    List<Map<String, Object>> selectContractUseCount(Map<String, Object> map);
69
+}

+ 575 - 0
src/main/java/com/chinaitop/depot/business/mapper/BusinessStoreWareDetailMapper.xml

@@ -0,0 +1,575 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.chinaitop.depot.business.mapper.BusinessStoreWareDetailMapper" >
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.business.model.BusinessStoreWareDetail" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="zid" property="zid" jdbcType="INTEGER" />
7
+    <result column="type" property="type" jdbcType="VARCHAR" />
8
+    <result column="house_id" property="houseId" jdbcType="INTEGER" />
9
+    <result column="house_name" property="houseName" jdbcType="VARCHAR" />
10
+    <result column="warehouse_id" property="warehouseId" jdbcType="INTEGER" />
11
+    <result column="warehouse_name" property="warehouseName" jdbcType="VARCHAR" />
12
+    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
13
+    <result column="org_id" property="orgId" jdbcType="INTEGER" />
14
+    <result column="grain_kind" property="grainKind" jdbcType="INTEGER" />
15
+    <result column="grain_detail_kind" property="grainDetailKind" jdbcType="INTEGER" />
16
+    <result column="grain_grade" property="grainGrade" jdbcType="INTEGER" />
17
+    <result column="grain_attribute" property="grainAttribute" jdbcType="INTEGER" />
18
+    <result column="grain_annual" property="grainAnnual" jdbcType="INTEGER" />
19
+    <result column="grain_producing_area" property="grainProducingArea" jdbcType="INTEGER" />
20
+    <result column="in_price" property="inPrice" jdbcType="VARCHAR" />
21
+    <result column="in_count" property="inCount" jdbcType="VARCHAR" />
22
+    <result column="in_detail_total_price" property="inDetailTotalPrice" jdbcType="VARCHAR" />
23
+    <result column="input_time" property="inputTime" jdbcType="TIMESTAMP" />
24
+    <result column="state" property="state" jdbcType="INTEGER" />
25
+    <result column="productive_year" property="productiveYear" jdbcType="INTEGER" />
26
+    <result column="remaining_number" property="remainingNumber" jdbcType="VARCHAR" />
27
+    <result column="out_price" property="outPrice" jdbcType="VARCHAR" />
28
+    <result column="out_count" property="outCount" jdbcType="VARCHAR" />
29
+    <result column="out_detail_total_price" property="outDetailTotalPrice" jdbcType="VARCHAR" />
30
+    <result column="out_remaining_number" property="outRemainingNumber" jdbcType="VARCHAR" />
31
+  </resultMap>
32
+  <sql id="Example_Where_Clause" >
33
+    <where >
34
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
35
+        <if test="criteria.valid" >
36
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
37
+            <foreach collection="criteria.criteria" item="criterion" >
38
+              <choose >
39
+                <when test="criterion.noValue" >
40
+                  and ${criterion.condition}
41
+                </when>
42
+                <when test="criterion.singleValue" >
43
+                  and ${criterion.condition} #{criterion.value}
44
+                </when>
45
+                <when test="criterion.betweenValue" >
46
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
47
+                </when>
48
+                <when test="criterion.listValue" >
49
+                  and ${criterion.condition}
50
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
51
+                    #{listItem}
52
+                  </foreach>
53
+                </when>
54
+              </choose>
55
+            </foreach>
56
+          </trim>
57
+        </if>
58
+      </foreach>
59
+    </where>
60
+  </sql>
61
+  <sql id="Update_By_Example_Where_Clause" >
62
+    <where >
63
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
64
+        <if test="criteria.valid" >
65
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
66
+            <foreach collection="criteria.criteria" item="criterion" >
67
+              <choose >
68
+                <when test="criterion.noValue" >
69
+                  and ${criterion.condition}
70
+                </when>
71
+                <when test="criterion.singleValue" >
72
+                  and ${criterion.condition} #{criterion.value}
73
+                </when>
74
+                <when test="criterion.betweenValue" >
75
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
76
+                </when>
77
+                <when test="criterion.listValue" >
78
+                  and ${criterion.condition}
79
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
80
+                    #{listItem}
81
+                  </foreach>
82
+                </when>
83
+              </choose>
84
+            </foreach>
85
+          </trim>
86
+        </if>
87
+      </foreach>
88
+    </where>
89
+  </sql>
90
+  <sql id="Base_Column_List" >
91
+    id, zid, type, house_id, house_name, warehouse_id, warehouse_name, create_time, org_id, 
92
+    grain_kind, grain_detail_kind, grain_grade, grain_attribute, grain_annual, grain_producing_area, 
93
+    in_price, in_count, in_detail_total_price, input_time, state, productive_year, remaining_number, 
94
+    out_price, out_count, out_detail_total_price, out_remaining_number
95
+  </sql>
96
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.business.model.BusinessStoreWareDetailExample" >
97
+    select
98
+    <if test="distinct" >
99
+      distinct
100
+    </if>
101
+    <include refid="Base_Column_List" />
102
+    from business_store_ware_detail
103
+    <if test="_parameter != null" >
104
+      <include refid="Example_Where_Clause" />
105
+    </if>
106
+    <if test="orderByClause != null" >
107
+      order by ${orderByClause}
108
+    </if>
109
+  </select>
110
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
111
+    select 
112
+    <include refid="Base_Column_List" />
113
+    from business_store_ware_detail
114
+    where id = #{id,jdbcType=INTEGER}
115
+  </select>
116
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
117
+    delete from business_store_ware_detail
118
+    where id = #{id,jdbcType=INTEGER}
119
+  </delete>
120
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.business.model.BusinessStoreWareDetailExample" >
121
+    delete from business_store_ware_detail
122
+    <if test="_parameter != null" >
123
+      <include refid="Example_Where_Clause" />
124
+    </if>
125
+  </delete>
126
+  <insert id="insert" parameterType="com.chinaitop.depot.business.model.BusinessStoreWareDetail" >
127
+    insert into business_store_ware_detail (id, zid, type, 
128
+      house_id, house_name, warehouse_id, 
129
+      warehouse_name, create_time, org_id, 
130
+      grain_kind, grain_detail_kind, grain_grade, 
131
+      grain_attribute, grain_annual, grain_producing_area, 
132
+      in_price, in_count, in_detail_total_price, 
133
+      input_time, state, productive_year, 
134
+      remaining_number, out_price, out_count, 
135
+      out_detail_total_price, out_remaining_number
136
+      )
137
+    values (#{id,jdbcType=INTEGER}, #{zid,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR}, 
138
+      #{houseId,jdbcType=INTEGER}, #{houseName,jdbcType=VARCHAR}, #{warehouseId,jdbcType=INTEGER}, 
139
+      #{warehouseName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{orgId,jdbcType=INTEGER}, 
140
+      #{grainKind,jdbcType=INTEGER}, #{grainDetailKind,jdbcType=INTEGER}, #{grainGrade,jdbcType=INTEGER}, 
141
+      #{grainAttribute,jdbcType=INTEGER}, #{grainAnnual,jdbcType=INTEGER}, #{grainProducingArea,jdbcType=INTEGER}, 
142
+      #{inPrice,jdbcType=VARCHAR}, #{inCount,jdbcType=VARCHAR}, #{inDetailTotalPrice,jdbcType=VARCHAR}, 
143
+      #{inputTime,jdbcType=TIMESTAMP}, #{state,jdbcType=INTEGER}, #{productiveYear,jdbcType=INTEGER}, 
144
+      #{remainingNumber,jdbcType=VARCHAR}, #{outPrice,jdbcType=VARCHAR}, #{outCount,jdbcType=VARCHAR}, 
145
+      #{outDetailTotalPrice,jdbcType=VARCHAR}, #{outRemainingNumber,jdbcType=VARCHAR}
146
+      )
147
+  </insert>
148
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.business.model.BusinessStoreWareDetail" >
149
+    insert into business_store_ware_detail
150
+    <trim prefix="(" suffix=")" suffixOverrides="," >
151
+      <if test="id != null" >
152
+        id,
153
+      </if>
154
+      <if test="zid != null" >
155
+        zid,
156
+      </if>
157
+      <if test="type != null" >
158
+        type,
159
+      </if>
160
+      <if test="houseId != null" >
161
+        house_id,
162
+      </if>
163
+      <if test="houseName != null" >
164
+        house_name,
165
+      </if>
166
+      <if test="warehouseId != null" >
167
+        warehouse_id,
168
+      </if>
169
+      <if test="warehouseName != null" >
170
+        warehouse_name,
171
+      </if>
172
+      <if test="createTime != null" >
173
+        create_time,
174
+      </if>
175
+      <if test="orgId != null" >
176
+        org_id,
177
+      </if>
178
+      <if test="grainKind != null" >
179
+        grain_kind,
180
+      </if>
181
+      <if test="grainDetailKind != null" >
182
+        grain_detail_kind,
183
+      </if>
184
+      <if test="grainGrade != null" >
185
+        grain_grade,
186
+      </if>
187
+      <if test="grainAttribute != null" >
188
+        grain_attribute,
189
+      </if>
190
+      <if test="grainAnnual != null" >
191
+        grain_annual,
192
+      </if>
193
+      <if test="grainProducingArea != null" >
194
+        grain_producing_area,
195
+      </if>
196
+      <if test="inPrice != null" >
197
+        in_price,
198
+      </if>
199
+      <if test="inCount != null" >
200
+        in_count,
201
+      </if>
202
+      <if test="inDetailTotalPrice != null" >
203
+        in_detail_total_price,
204
+      </if>
205
+      <if test="inputTime != null" >
206
+        input_time,
207
+      </if>
208
+      <if test="state != null" >
209
+        state,
210
+      </if>
211
+      <if test="productiveYear != null" >
212
+        productive_year,
213
+      </if>
214
+      <if test="remainingNumber != null" >
215
+        remaining_number,
216
+      </if>
217
+      <if test="outPrice != null" >
218
+        out_price,
219
+      </if>
220
+      <if test="outCount != null" >
221
+        out_count,
222
+      </if>
223
+      <if test="outDetailTotalPrice != null" >
224
+        out_detail_total_price,
225
+      </if>
226
+      <if test="outRemainingNumber != null" >
227
+        out_remaining_number,
228
+      </if>
229
+    </trim>
230
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
231
+      <if test="id != null" >
232
+        #{id,jdbcType=INTEGER},
233
+      </if>
234
+      <if test="zid != null" >
235
+        #{zid,jdbcType=INTEGER},
236
+      </if>
237
+      <if test="type != null" >
238
+        #{type,jdbcType=VARCHAR},
239
+      </if>
240
+      <if test="houseId != null" >
241
+        #{houseId,jdbcType=INTEGER},
242
+      </if>
243
+      <if test="houseName != null" >
244
+        #{houseName,jdbcType=VARCHAR},
245
+      </if>
246
+      <if test="warehouseId != null" >
247
+        #{warehouseId,jdbcType=INTEGER},
248
+      </if>
249
+      <if test="warehouseName != null" >
250
+        #{warehouseName,jdbcType=VARCHAR},
251
+      </if>
252
+      <if test="createTime != null" >
253
+        #{createTime,jdbcType=TIMESTAMP},
254
+      </if>
255
+      <if test="orgId != null" >
256
+        #{orgId,jdbcType=INTEGER},
257
+      </if>
258
+      <if test="grainKind != null" >
259
+        #{grainKind,jdbcType=INTEGER},
260
+      </if>
261
+      <if test="grainDetailKind != null" >
262
+        #{grainDetailKind,jdbcType=INTEGER},
263
+      </if>
264
+      <if test="grainGrade != null" >
265
+        #{grainGrade,jdbcType=INTEGER},
266
+      </if>
267
+      <if test="grainAttribute != null" >
268
+        #{grainAttribute,jdbcType=INTEGER},
269
+      </if>
270
+      <if test="grainAnnual != null" >
271
+        #{grainAnnual,jdbcType=INTEGER},
272
+      </if>
273
+      <if test="grainProducingArea != null" >
274
+        #{grainProducingArea,jdbcType=INTEGER},
275
+      </if>
276
+      <if test="inPrice != null" >
277
+        #{inPrice,jdbcType=VARCHAR},
278
+      </if>
279
+      <if test="inCount != null" >
280
+        #{inCount,jdbcType=VARCHAR},
281
+      </if>
282
+      <if test="inDetailTotalPrice != null" >
283
+        #{inDetailTotalPrice,jdbcType=VARCHAR},
284
+      </if>
285
+      <if test="inputTime != null" >
286
+        #{inputTime,jdbcType=TIMESTAMP},
287
+      </if>
288
+      <if test="state != null" >
289
+        #{state,jdbcType=INTEGER},
290
+      </if>
291
+      <if test="productiveYear != null" >
292
+        #{productiveYear,jdbcType=INTEGER},
293
+      </if>
294
+      <if test="remainingNumber != null" >
295
+        #{remainingNumber,jdbcType=VARCHAR},
296
+      </if>
297
+      <if test="outPrice != null" >
298
+        #{outPrice,jdbcType=VARCHAR},
299
+      </if>
300
+      <if test="outCount != null" >
301
+        #{outCount,jdbcType=VARCHAR},
302
+      </if>
303
+      <if test="outDetailTotalPrice != null" >
304
+        #{outDetailTotalPrice,jdbcType=VARCHAR},
305
+      </if>
306
+      <if test="outRemainingNumber != null" >
307
+        #{outRemainingNumber,jdbcType=VARCHAR},
308
+      </if>
309
+    </trim>
310
+  </insert>
311
+  <select id="countByExample" parameterType="com.chinaitop.depot.business.model.BusinessStoreWareDetailExample" resultType="java.lang.Integer" >
312
+    select count(*) from business_store_ware_detail
313
+    <if test="_parameter != null" >
314
+      <include refid="Example_Where_Clause" />
315
+    </if>
316
+  </select>
317
+  <update id="updateByExampleSelective" parameterType="map" >
318
+    update business_store_ware_detail
319
+    <set >
320
+      <if test="record.id != null" >
321
+        id = #{record.id,jdbcType=INTEGER},
322
+      </if>
323
+      <if test="record.zid != null" >
324
+        zid = #{record.zid,jdbcType=INTEGER},
325
+      </if>
326
+      <if test="record.type != null" >
327
+        type = #{record.type,jdbcType=VARCHAR},
328
+      </if>
329
+      <if test="record.houseId != null" >
330
+        house_id = #{record.houseId,jdbcType=INTEGER},
331
+      </if>
332
+      <if test="record.houseName != null" >
333
+        house_name = #{record.houseName,jdbcType=VARCHAR},
334
+      </if>
335
+      <if test="record.warehouseId != null" >
336
+        warehouse_id = #{record.warehouseId,jdbcType=INTEGER},
337
+      </if>
338
+      <if test="record.warehouseName != null" >
339
+        warehouse_name = #{record.warehouseName,jdbcType=VARCHAR},
340
+      </if>
341
+      <if test="record.createTime != null" >
342
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
343
+      </if>
344
+      <if test="record.orgId != null" >
345
+        org_id = #{record.orgId,jdbcType=INTEGER},
346
+      </if>
347
+      <if test="record.grainKind != null" >
348
+        grain_kind = #{record.grainKind,jdbcType=INTEGER},
349
+      </if>
350
+      <if test="record.grainDetailKind != null" >
351
+        grain_detail_kind = #{record.grainDetailKind,jdbcType=INTEGER},
352
+      </if>
353
+      <if test="record.grainGrade != null" >
354
+        grain_grade = #{record.grainGrade,jdbcType=INTEGER},
355
+      </if>
356
+      <if test="record.grainAttribute != null" >
357
+        grain_attribute = #{record.grainAttribute,jdbcType=INTEGER},
358
+      </if>
359
+      <if test="record.grainAnnual != null" >
360
+        grain_annual = #{record.grainAnnual,jdbcType=INTEGER},
361
+      </if>
362
+      <if test="record.grainProducingArea != null" >
363
+        grain_producing_area = #{record.grainProducingArea,jdbcType=INTEGER},
364
+      </if>
365
+      <if test="record.inPrice != null" >
366
+        in_price = #{record.inPrice,jdbcType=VARCHAR},
367
+      </if>
368
+      <if test="record.inCount != null" >
369
+        in_count = #{record.inCount,jdbcType=VARCHAR},
370
+      </if>
371
+      <if test="record.inDetailTotalPrice != null" >
372
+        in_detail_total_price = #{record.inDetailTotalPrice,jdbcType=VARCHAR},
373
+      </if>
374
+      <if test="record.inputTime != null" >
375
+        input_time = #{record.inputTime,jdbcType=TIMESTAMP},
376
+      </if>
377
+      <if test="record.state != null" >
378
+        state = #{record.state,jdbcType=INTEGER},
379
+      </if>
380
+      <if test="record.productiveYear != null" >
381
+        productive_year = #{record.productiveYear,jdbcType=INTEGER},
382
+      </if>
383
+      <if test="record.remainingNumber != null" >
384
+        remaining_number = #{record.remainingNumber,jdbcType=VARCHAR},
385
+      </if>
386
+      <if test="record.outPrice != null" >
387
+        out_price = #{record.outPrice,jdbcType=VARCHAR},
388
+      </if>
389
+      <if test="record.outCount != null" >
390
+        out_count = #{record.outCount,jdbcType=VARCHAR},
391
+      </if>
392
+      <if test="record.outDetailTotalPrice != null" >
393
+        out_detail_total_price = #{record.outDetailTotalPrice,jdbcType=VARCHAR},
394
+      </if>
395
+      <if test="record.outRemainingNumber != null" >
396
+        out_remaining_number = #{record.outRemainingNumber,jdbcType=VARCHAR},
397
+      </if>
398
+    </set>
399
+    <if test="_parameter != null" >
400
+      <include refid="Update_By_Example_Where_Clause" />
401
+    </if>
402
+  </update>
403
+  <update id="updateByExample" parameterType="map" >
404
+    update business_store_ware_detail
405
+    set id = #{record.id,jdbcType=INTEGER},
406
+      zid = #{record.zid,jdbcType=INTEGER},
407
+      type = #{record.type,jdbcType=VARCHAR},
408
+      house_id = #{record.houseId,jdbcType=INTEGER},
409
+      house_name = #{record.houseName,jdbcType=VARCHAR},
410
+      warehouse_id = #{record.warehouseId,jdbcType=INTEGER},
411
+      warehouse_name = #{record.warehouseName,jdbcType=VARCHAR},
412
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
413
+      org_id = #{record.orgId,jdbcType=INTEGER},
414
+      grain_kind = #{record.grainKind,jdbcType=INTEGER},
415
+      grain_detail_kind = #{record.grainDetailKind,jdbcType=INTEGER},
416
+      grain_grade = #{record.grainGrade,jdbcType=INTEGER},
417
+      grain_attribute = #{record.grainAttribute,jdbcType=INTEGER},
418
+      grain_annual = #{record.grainAnnual,jdbcType=INTEGER},
419
+      grain_producing_area = #{record.grainProducingArea,jdbcType=INTEGER},
420
+      in_price = #{record.inPrice,jdbcType=VARCHAR},
421
+      in_count = #{record.inCount,jdbcType=VARCHAR},
422
+      in_detail_total_price = #{record.inDetailTotalPrice,jdbcType=VARCHAR},
423
+      input_time = #{record.inputTime,jdbcType=TIMESTAMP},
424
+      state = #{record.state,jdbcType=INTEGER},
425
+      productive_year = #{record.productiveYear,jdbcType=INTEGER},
426
+      remaining_number = #{record.remainingNumber,jdbcType=VARCHAR},
427
+      out_price = #{record.outPrice,jdbcType=VARCHAR},
428
+      out_count = #{record.outCount,jdbcType=VARCHAR},
429
+      out_detail_total_price = #{record.outDetailTotalPrice,jdbcType=VARCHAR},
430
+      out_remaining_number = #{record.outRemainingNumber,jdbcType=VARCHAR}
431
+    <if test="_parameter != null" >
432
+      <include refid="Update_By_Example_Where_Clause" />
433
+    </if>
434
+  </update>
435
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.business.model.BusinessStoreWareDetail" >
436
+    update business_store_ware_detail
437
+    <set >
438
+      <if test="zid != null" >
439
+        zid = #{zid,jdbcType=INTEGER},
440
+      </if>
441
+      <if test="type != null" >
442
+        type = #{type,jdbcType=VARCHAR},
443
+      </if>
444
+      <if test="houseId != null" >
445
+        house_id = #{houseId,jdbcType=INTEGER},
446
+      </if>
447
+      <if test="houseName != null" >
448
+        house_name = #{houseName,jdbcType=VARCHAR},
449
+      </if>
450
+      <if test="warehouseId != null" >
451
+        warehouse_id = #{warehouseId,jdbcType=INTEGER},
452
+      </if>
453
+      <if test="warehouseName != null" >
454
+        warehouse_name = #{warehouseName,jdbcType=VARCHAR},
455
+      </if>
456
+      <if test="createTime != null" >
457
+        create_time = #{createTime,jdbcType=TIMESTAMP},
458
+      </if>
459
+      <if test="orgId != null" >
460
+        org_id = #{orgId,jdbcType=INTEGER},
461
+      </if>
462
+      <if test="grainKind != null" >
463
+        grain_kind = #{grainKind,jdbcType=INTEGER},
464
+      </if>
465
+      <if test="grainDetailKind != null" >
466
+        grain_detail_kind = #{grainDetailKind,jdbcType=INTEGER},
467
+      </if>
468
+      <if test="grainGrade != null" >
469
+        grain_grade = #{grainGrade,jdbcType=INTEGER},
470
+      </if>
471
+      <if test="grainAttribute != null" >
472
+        grain_attribute = #{grainAttribute,jdbcType=INTEGER},
473
+      </if>
474
+      <if test="grainAnnual != null" >
475
+        grain_annual = #{grainAnnual,jdbcType=INTEGER},
476
+      </if>
477
+      <if test="grainProducingArea != null" >
478
+        grain_producing_area = #{grainProducingArea,jdbcType=INTEGER},
479
+      </if>
480
+      <if test="inPrice != null" >
481
+        in_price = #{inPrice,jdbcType=VARCHAR},
482
+      </if>
483
+      <if test="inCount != null" >
484
+        in_count = #{inCount,jdbcType=VARCHAR},
485
+      </if>
486
+      <if test="inDetailTotalPrice != null" >
487
+        in_detail_total_price = #{inDetailTotalPrice,jdbcType=VARCHAR},
488
+      </if>
489
+      <if test="inputTime != null" >
490
+        input_time = #{inputTime,jdbcType=TIMESTAMP},
491
+      </if>
492
+      <if test="state != null" >
493
+        state = #{state,jdbcType=INTEGER},
494
+      </if>
495
+      <if test="productiveYear != null" >
496
+        productive_year = #{productiveYear,jdbcType=INTEGER},
497
+      </if>
498
+      <if test="remainingNumber != null" >
499
+        remaining_number = #{remainingNumber,jdbcType=VARCHAR},
500
+      </if>
501
+      <if test="outPrice != null" >
502
+        out_price = #{outPrice,jdbcType=VARCHAR},
503
+      </if>
504
+      <if test="outCount != null" >
505
+        out_count = #{outCount,jdbcType=VARCHAR},
506
+      </if>
507
+      <if test="outDetailTotalPrice != null" >
508
+        out_detail_total_price = #{outDetailTotalPrice,jdbcType=VARCHAR},
509
+      </if>
510
+      <if test="outRemainingNumber != null" >
511
+        out_remaining_number = #{outRemainingNumber,jdbcType=VARCHAR},
512
+      </if>
513
+    </set>
514
+    where id = #{id,jdbcType=INTEGER}
515
+  </update>
516
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.business.model.BusinessStoreWareDetail" >
517
+    update business_store_ware_detail
518
+    set zid = #{zid,jdbcType=INTEGER},
519
+      type = #{type,jdbcType=VARCHAR},
520
+      house_id = #{houseId,jdbcType=INTEGER},
521
+      house_name = #{houseName,jdbcType=VARCHAR},
522
+      warehouse_id = #{warehouseId,jdbcType=INTEGER},
523
+      warehouse_name = #{warehouseName,jdbcType=VARCHAR},
524
+      create_time = #{createTime,jdbcType=TIMESTAMP},
525
+      org_id = #{orgId,jdbcType=INTEGER},
526
+      grain_kind = #{grainKind,jdbcType=INTEGER},
527
+      grain_detail_kind = #{grainDetailKind,jdbcType=INTEGER},
528
+      grain_grade = #{grainGrade,jdbcType=INTEGER},
529
+      grain_attribute = #{grainAttribute,jdbcType=INTEGER},
530
+      grain_annual = #{grainAnnual,jdbcType=INTEGER},
531
+      grain_producing_area = #{grainProducingArea,jdbcType=INTEGER},
532
+      in_price = #{inPrice,jdbcType=VARCHAR},
533
+      in_count = #{inCount,jdbcType=VARCHAR},
534
+      in_detail_total_price = #{inDetailTotalPrice,jdbcType=VARCHAR},
535
+      input_time = #{inputTime,jdbcType=TIMESTAMP},
536
+      state = #{state,jdbcType=INTEGER},
537
+      productive_year = #{productiveYear,jdbcType=INTEGER},
538
+      remaining_number = #{remainingNumber,jdbcType=VARCHAR},
539
+      out_price = #{outPrice,jdbcType=VARCHAR},
540
+      out_count = #{outCount,jdbcType=VARCHAR},
541
+      out_detail_total_price = #{outDetailTotalPrice,jdbcType=VARCHAR},
542
+      out_remaining_number = #{outRemainingNumber,jdbcType=VARCHAR}
543
+    where id = #{id,jdbcType=INTEGER}
544
+  </update>
545
+  <!-- 通过计划ID获取计划子表数据的已使用数量 -->
546
+  <select id="selectPlanUseCount" parameterType="java.util.Map" resultType="java.util.Map">
547
+    SELECT detail.plan_id, detail.id, detail.house_id,detail.warehouse_id, SUM(detail.in_count) in_count, SUM(detail.out_count) out_count FROM (
548
+	SELECT c.id plan_id, a.id, a.house_id,a.warehouse_id,a.in_count,a.out_count FROM business_store_ware_detail a
549
+	LEFT JOIN business_contract b on b.id=a.zid
550
+	LEFT JOIN business_plan c on c.id=b.plan_bid
551
+	WHERE 1=1 AND a.type='contract' AND b.audit_state!=4 AND b.changing=0
552
+	UNION
553
+	SELECT c.id plan_id, a.id, a.house_id,a.warehouse_id,a.in_count,a.out_count FROM business_store_ware_detail a
554
+	LEFT JOIN business_delivery_storage_notice b on b.id=a.zid
555
+	LEFT JOIN business_plan c on c.id=b.plan_bid
556
+	WHERE 1=1 AND a.type='notice' AND b.audit_state!=4 AND IFNULL(b.contract_bid, 0)=0 
557
+	) detail
558
+	WHERE detail.plan_id=#{plan_id}
559
+	GROUP BY detail.plan_id,detail.house_id,detail.warehouse_id
560
+	ORDER BY detail.id;
561
+  </select>
562
+  <!-- 通过合同ID获取合同子表数据的已使用数量 -->
563
+  <select id="selectContractUseCount" parameterType="java.util.Map" resultType="java.util.Map">
564
+    SELECT detail.contract_id, detail.id, detail.house_id,detail.warehouse_id, SUM(detail.in_count) in_count, SUM(detail.out_count) out_count FROM 
565
+	(
566
+	SELECT c.id contract_id,a.id, a.house_id,a.warehouse_id,a.in_count,a.out_count FROM business_store_ware_detail a
567
+	LEFT JOIN business_delivery_storage_notice b on b.id=a.zid
568
+	LEFT JOIN business_contract c ON c.id=b.contract_bid
569
+	WHERE 1=1 AND a.type='notice' AND b.audit_state!=4
570
+	) detail
571
+	WHERE detail.contract_id=#{contract_id} 
572
+	GROUP BY detail.contract_id,detail.house_id,detail.warehouse_id
573
+	ORDER BY detail.id
574
+  </select>
575
+</mapper>

+ 30 - 0
src/main/java/com/chinaitop/depot/business/mapper/OrgInfoMapper.java

@@ -0,0 +1,30 @@
1
+package com.chinaitop.depot.business.mapper;
2
+
3
+import com.chinaitop.depot.business.model.OrgInfo;
4
+import com.chinaitop.depot.business.model.OrgInfoExample;
5
+import java.util.List;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+public interface OrgInfoMapper {
9
+    int countByExample(OrgInfoExample example);
10
+
11
+    int deleteByExample(OrgInfoExample example);
12
+
13
+    int deleteByPrimaryKey(Integer orgId);
14
+
15
+    int insert(OrgInfo record);
16
+
17
+    int insertSelective(OrgInfo record);
18
+
19
+    List<OrgInfo> selectByExample(OrgInfoExample example);
20
+
21
+    OrgInfo selectByPrimaryKey(Integer orgId);
22
+
23
+    int updateByExampleSelective(@Param("record") OrgInfo record, @Param("example") OrgInfoExample example);
24
+
25
+    int updateByExample(@Param("record") OrgInfo record, @Param("example") OrgInfoExample example);
26
+
27
+    int updateByPrimaryKeySelective(OrgInfo record);
28
+
29
+    int updateByPrimaryKey(OrgInfo record);
30
+}

+ 845 - 0
src/main/java/com/chinaitop/depot/business/mapper/OrgInfoMapper.xml

@@ -0,0 +1,845 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.chinaitop.depot.business.mapper.OrgInfoMapper" >
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.business.model.OrgInfo" >
5
+    <id column="org_id" property="orgId" jdbcType="INTEGER" />
6
+    <result column="org_name" property="orgName" jdbcType="VARCHAR" />
7
+    <result column="short_name" property="shortName" jdbcType="VARCHAR" />
8
+    <result column="org_code" property="orgCode" jdbcType="VARCHAR" />
9
+    <result column="org_class_id" property="orgClassId" jdbcType="INTEGER" />
10
+    <result column="company_nature" property="companyNature" jdbcType="INTEGER" />
11
+    <result column="busi_type" property="busiType" jdbcType="INTEGER" />
12
+    <result column="address" property="address" jdbcType="VARCHAR" />
13
+    <result column="contact" property="contact" jdbcType="VARCHAR" />
14
+    <result column="fax" property="fax" jdbcType="VARCHAR" />
15
+    <result column="charge_person" property="chargePerson" jdbcType="VARCHAR" />
16
+    <result column="longitude" property="longitude" jdbcType="VARCHAR" />
17
+    <result column="latitude" property="latitude" jdbcType="VARCHAR" />
18
+    <result column="regist_capital" property="registCapital" jdbcType="INTEGER" />
19
+    <result column="work_number" property="workNumber" jdbcType="INTEGER" />
20
+    <result column="area_code" property="areaCode" jdbcType="INTEGER" />
21
+    <result column="area_name" property="areaName" jdbcType="VARCHAR" />
22
+    <result column="post" property="post" jdbcType="INTEGER" />
23
+    <result column="depot_class" property="depotClass" jdbcType="INTEGER" />
24
+    <result column="design_capacity" property="designCapacity" jdbcType="INTEGER" />
25
+    <result column="effective_capacity" property="effectiveCapacity" jdbcType="INTEGER" />
26
+    <result column="depot_area" property="depotArea" jdbcType="REAL" />
27
+    <result column="complete_date" property="completeDate" jdbcType="TIMESTAMP" />
28
+    <result column="use_date" property="useDate" jdbcType="TIMESTAMP" />
29
+    <result column="company_org_code" property="companyOrgCode" jdbcType="VARCHAR" />
30
+    <result column="credit_code" property="creditCode" jdbcType="VARCHAR" />
31
+    <result column="regist_type" property="registType" jdbcType="INTEGER" />
32
+    <result column="qualification" property="qualification" jdbcType="INTEGER" />
33
+    <result column="independent_corporation" property="independentCorporation" jdbcType="INTEGER" />
34
+    <result column="legal_person" property="legalPerson" jdbcType="VARCHAR" />
35
+    <result column="whether_rent" property="whetherRent" jdbcType="INTEGER" />
36
+    <result column="info_regist" property="infoRegist" jdbcType="VARCHAR" />
37
+    <result column="regist_date" property="registDate" jdbcType="TIMESTAMP" />
38
+    <result column="remark" property="remark" jdbcType="VARCHAR" />
39
+    <result column="parent_id" property="parentId" jdbcType="INTEGER" />
40
+    <result column="status" property="status" jdbcType="INTEGER" />
41
+    <result column="del_flag" property="delFlag" jdbcType="INTEGER" />
42
+    <result column="birds_eye" property="birdsEye" jdbcType="VARCHAR" />
43
+    <result column="birds_Remote" property="birdsRemote" jdbcType="VARCHAR" />
44
+    <result column="brief_introduction" property="briefIntroduction" jdbcType="VARCHAR" />
45
+    <result column="invoice_title" property="invoiceTitle" jdbcType="VARCHAR" />
46
+    <result column="regist_number" property="registNumber" jdbcType="VARCHAR" />
47
+    <result column="bank_name" property="bankName" jdbcType="VARCHAR" />
48
+    <result column="account_name" property="accountName" jdbcType="VARCHAR" />
49
+    <result column="account_number" property="accountNumber" jdbcType="VARCHAR" />
50
+  </resultMap>
51
+  <sql id="Example_Where_Clause" >
52
+    <where >
53
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
54
+        <if test="criteria.valid" >
55
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
56
+            <foreach collection="criteria.criteria" item="criterion" >
57
+              <choose >
58
+                <when test="criterion.noValue" >
59
+                  and ${criterion.condition}
60
+                </when>
61
+                <when test="criterion.singleValue" >
62
+                  and ${criterion.condition} #{criterion.value}
63
+                </when>
64
+                <when test="criterion.betweenValue" >
65
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
66
+                </when>
67
+                <when test="criterion.listValue" >
68
+                  and ${criterion.condition}
69
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
70
+                    #{listItem}
71
+                  </foreach>
72
+                </when>
73
+              </choose>
74
+            </foreach>
75
+          </trim>
76
+        </if>
77
+      </foreach>
78
+    </where>
79
+  </sql>
80
+  <sql id="Update_By_Example_Where_Clause" >
81
+    <where >
82
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
83
+        <if test="criteria.valid" >
84
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
85
+            <foreach collection="criteria.criteria" item="criterion" >
86
+              <choose >
87
+                <when test="criterion.noValue" >
88
+                  and ${criterion.condition}
89
+                </when>
90
+                <when test="criterion.singleValue" >
91
+                  and ${criterion.condition} #{criterion.value}
92
+                </when>
93
+                <when test="criterion.betweenValue" >
94
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
95
+                </when>
96
+                <when test="criterion.listValue" >
97
+                  and ${criterion.condition}
98
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
99
+                    #{listItem}
100
+                  </foreach>
101
+                </when>
102
+              </choose>
103
+            </foreach>
104
+          </trim>
105
+        </if>
106
+      </foreach>
107
+    </where>
108
+  </sql>
109
+  <sql id="Base_Column_List" >
110
+    org_id, org_name, short_name, org_code, org_class_id, company_nature, busi_type, 
111
+    address, contact, fax, charge_person, longitude, latitude, regist_capital, work_number, 
112
+    area_code, area_name, post, depot_class, design_capacity, effective_capacity, depot_area, 
113
+    complete_date, use_date, company_org_code, credit_code, regist_type, qualification, 
114
+    independent_corporation, legal_person, whether_rent, info_regist, regist_date, remark, 
115
+    parent_id, status, del_flag, birds_eye, birds_Remote, brief_introduction, invoice_title, 
116
+    regist_number, bank_name, account_name, account_number
117
+  </sql>
118
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.business.model.OrgInfoExample" >
119
+    select
120
+    <if test="distinct" >
121
+      distinct
122
+    </if>
123
+    <include refid="Base_Column_List" />
124
+    from org_info
125
+    <if test="_parameter != null" >
126
+      <include refid="Example_Where_Clause" />
127
+    </if>
128
+    <if test="orderByClause != null" >
129
+      order by ${orderByClause}
130
+    </if>
131
+  </select>
132
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
133
+    select 
134
+    <include refid="Base_Column_List" />
135
+    from org_info
136
+    where org_id = #{orgId,jdbcType=INTEGER}
137
+  </select>
138
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
139
+    delete from org_info
140
+    where org_id = #{orgId,jdbcType=INTEGER}
141
+  </delete>
142
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.business.model.OrgInfoExample" >
143
+    delete from org_info
144
+    <if test="_parameter != null" >
145
+      <include refid="Example_Where_Clause" />
146
+    </if>
147
+  </delete>
148
+  <insert id="insert" parameterType="com.chinaitop.depot.business.model.OrgInfo" >
149
+    insert into org_info (org_id, org_name, short_name, 
150
+      org_code, org_class_id, company_nature, 
151
+      busi_type, address, contact, 
152
+      fax, charge_person, longitude, 
153
+      latitude, regist_capital, work_number, 
154
+      area_code, area_name, post, 
155
+      depot_class, design_capacity, effective_capacity, 
156
+      depot_area, complete_date, use_date, 
157
+      company_org_code, credit_code, regist_type, 
158
+      qualification, independent_corporation, 
159
+      legal_person, whether_rent, info_regist, 
160
+      regist_date, remark, parent_id, 
161
+      status, del_flag, birds_eye, 
162
+      birds_Remote, brief_introduction, invoice_title, 
163
+      regist_number, bank_name, account_name, 
164
+      account_number)
165
+    values (#{orgId,jdbcType=INTEGER}, #{orgName,jdbcType=VARCHAR}, #{shortName,jdbcType=VARCHAR}, 
166
+      #{orgCode,jdbcType=VARCHAR}, #{orgClassId,jdbcType=INTEGER}, #{companyNature,jdbcType=INTEGER}, 
167
+      #{busiType,jdbcType=INTEGER}, #{address,jdbcType=VARCHAR}, #{contact,jdbcType=VARCHAR}, 
168
+      #{fax,jdbcType=VARCHAR}, #{chargePerson,jdbcType=VARCHAR}, #{longitude,jdbcType=VARCHAR}, 
169
+      #{latitude,jdbcType=VARCHAR}, #{registCapital,jdbcType=INTEGER}, #{workNumber,jdbcType=INTEGER}, 
170
+      #{areaCode,jdbcType=INTEGER}, #{areaName,jdbcType=VARCHAR}, #{post,jdbcType=INTEGER}, 
171
+      #{depotClass,jdbcType=INTEGER}, #{designCapacity,jdbcType=INTEGER}, #{effectiveCapacity,jdbcType=INTEGER}, 
172
+      #{depotArea,jdbcType=REAL}, #{completeDate,jdbcType=TIMESTAMP}, #{useDate,jdbcType=TIMESTAMP}, 
173
+      #{companyOrgCode,jdbcType=VARCHAR}, #{creditCode,jdbcType=VARCHAR}, #{registType,jdbcType=INTEGER}, 
174
+      #{qualification,jdbcType=INTEGER}, #{independentCorporation,jdbcType=INTEGER}, 
175
+      #{legalPerson,jdbcType=VARCHAR}, #{whetherRent,jdbcType=INTEGER}, #{infoRegist,jdbcType=VARCHAR}, 
176
+      #{registDate,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER}, 
177
+      #{status,jdbcType=INTEGER}, #{delFlag,jdbcType=INTEGER}, #{birdsEye,jdbcType=VARCHAR}, 
178
+      #{birdsRemote,jdbcType=VARCHAR}, #{briefIntroduction,jdbcType=VARCHAR}, #{invoiceTitle,jdbcType=VARCHAR}, 
179
+      #{registNumber,jdbcType=VARCHAR}, #{bankName,jdbcType=VARCHAR}, #{accountName,jdbcType=VARCHAR}, 
180
+      #{accountNumber,jdbcType=VARCHAR})
181
+  </insert>
182
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.business.model.OrgInfo" >
183
+    insert into org_info
184
+    <trim prefix="(" suffix=")" suffixOverrides="," >
185
+      <if test="orgId != null" >
186
+        org_id,
187
+      </if>
188
+      <if test="orgName != null" >
189
+        org_name,
190
+      </if>
191
+      <if test="shortName != null" >
192
+        short_name,
193
+      </if>
194
+      <if test="orgCode != null" >
195
+        org_code,
196
+      </if>
197
+      <if test="orgClassId != null" >
198
+        org_class_id,
199
+      </if>
200
+      <if test="companyNature != null" >
201
+        company_nature,
202
+      </if>
203
+      <if test="busiType != null" >
204
+        busi_type,
205
+      </if>
206
+      <if test="address != null" >
207
+        address,
208
+      </if>
209
+      <if test="contact != null" >
210
+        contact,
211
+      </if>
212
+      <if test="fax != null" >
213
+        fax,
214
+      </if>
215
+      <if test="chargePerson != null" >
216
+        charge_person,
217
+      </if>
218
+      <if test="longitude != null" >
219
+        longitude,
220
+      </if>
221
+      <if test="latitude != null" >
222
+        latitude,
223
+      </if>
224
+      <if test="registCapital != null" >
225
+        regist_capital,
226
+      </if>
227
+      <if test="workNumber != null" >
228
+        work_number,
229
+      </if>
230
+      <if test="areaCode != null" >
231
+        area_code,
232
+      </if>
233
+      <if test="areaName != null" >
234
+        area_name,
235
+      </if>
236
+      <if test="post != null" >
237
+        post,
238
+      </if>
239
+      <if test="depotClass != null" >
240
+        depot_class,
241
+      </if>
242
+      <if test="designCapacity != null" >
243
+        design_capacity,
244
+      </if>
245
+      <if test="effectiveCapacity != null" >
246
+        effective_capacity,
247
+      </if>
248
+      <if test="depotArea != null" >
249
+        depot_area,
250
+      </if>
251
+      <if test="completeDate != null" >
252
+        complete_date,
253
+      </if>
254
+      <if test="useDate != null" >
255
+        use_date,
256
+      </if>
257
+      <if test="companyOrgCode != null" >
258
+        company_org_code,
259
+      </if>
260
+      <if test="creditCode != null" >
261
+        credit_code,
262
+      </if>
263
+      <if test="registType != null" >
264
+        regist_type,
265
+      </if>
266
+      <if test="qualification != null" >
267
+        qualification,
268
+      </if>
269
+      <if test="independentCorporation != null" >
270
+        independent_corporation,
271
+      </if>
272
+      <if test="legalPerson != null" >
273
+        legal_person,
274
+      </if>
275
+      <if test="whetherRent != null" >
276
+        whether_rent,
277
+      </if>
278
+      <if test="infoRegist != null" >
279
+        info_regist,
280
+      </if>
281
+      <if test="registDate != null" >
282
+        regist_date,
283
+      </if>
284
+      <if test="remark != null" >
285
+        remark,
286
+      </if>
287
+      <if test="parentId != null" >
288
+        parent_id,
289
+      </if>
290
+      <if test="status != null" >
291
+        status,
292
+      </if>
293
+      <if test="delFlag != null" >
294
+        del_flag,
295
+      </if>
296
+      <if test="birdsEye != null" >
297
+        birds_eye,
298
+      </if>
299
+      <if test="birdsRemote != null" >
300
+        birds_Remote,
301
+      </if>
302
+      <if test="briefIntroduction != null" >
303
+        brief_introduction,
304
+      </if>
305
+      <if test="invoiceTitle != null" >
306
+        invoice_title,
307
+      </if>
308
+      <if test="registNumber != null" >
309
+        regist_number,
310
+      </if>
311
+      <if test="bankName != null" >
312
+        bank_name,
313
+      </if>
314
+      <if test="accountName != null" >
315
+        account_name,
316
+      </if>
317
+      <if test="accountNumber != null" >
318
+        account_number,
319
+      </if>
320
+    </trim>
321
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
322
+      <if test="orgId != null" >
323
+        #{orgId,jdbcType=INTEGER},
324
+      </if>
325
+      <if test="orgName != null" >
326
+        #{orgName,jdbcType=VARCHAR},
327
+      </if>
328
+      <if test="shortName != null" >
329
+        #{shortName,jdbcType=VARCHAR},
330
+      </if>
331
+      <if test="orgCode != null" >
332
+        #{orgCode,jdbcType=VARCHAR},
333
+      </if>
334
+      <if test="orgClassId != null" >
335
+        #{orgClassId,jdbcType=INTEGER},
336
+      </if>
337
+      <if test="companyNature != null" >
338
+        #{companyNature,jdbcType=INTEGER},
339
+      </if>
340
+      <if test="busiType != null" >
341
+        #{busiType,jdbcType=INTEGER},
342
+      </if>
343
+      <if test="address != null" >
344
+        #{address,jdbcType=VARCHAR},
345
+      </if>
346
+      <if test="contact != null" >
347
+        #{contact,jdbcType=VARCHAR},
348
+      </if>
349
+      <if test="fax != null" >
350
+        #{fax,jdbcType=VARCHAR},
351
+      </if>
352
+      <if test="chargePerson != null" >
353
+        #{chargePerson,jdbcType=VARCHAR},
354
+      </if>
355
+      <if test="longitude != null" >
356
+        #{longitude,jdbcType=VARCHAR},
357
+      </if>
358
+      <if test="latitude != null" >
359
+        #{latitude,jdbcType=VARCHAR},
360
+      </if>
361
+      <if test="registCapital != null" >
362
+        #{registCapital,jdbcType=INTEGER},
363
+      </if>
364
+      <if test="workNumber != null" >
365
+        #{workNumber,jdbcType=INTEGER},
366
+      </if>
367
+      <if test="areaCode != null" >
368
+        #{areaCode,jdbcType=INTEGER},
369
+      </if>
370
+      <if test="areaName != null" >
371
+        #{areaName,jdbcType=VARCHAR},
372
+      </if>
373
+      <if test="post != null" >
374
+        #{post,jdbcType=INTEGER},
375
+      </if>
376
+      <if test="depotClass != null" >
377
+        #{depotClass,jdbcType=INTEGER},
378
+      </if>
379
+      <if test="designCapacity != null" >
380
+        #{designCapacity,jdbcType=INTEGER},
381
+      </if>
382
+      <if test="effectiveCapacity != null" >
383
+        #{effectiveCapacity,jdbcType=INTEGER},
384
+      </if>
385
+      <if test="depotArea != null" >
386
+        #{depotArea,jdbcType=REAL},
387
+      </if>
388
+      <if test="completeDate != null" >
389
+        #{completeDate,jdbcType=TIMESTAMP},
390
+      </if>
391
+      <if test="useDate != null" >
392
+        #{useDate,jdbcType=TIMESTAMP},
393
+      </if>
394
+      <if test="companyOrgCode != null" >
395
+        #{companyOrgCode,jdbcType=VARCHAR},
396
+      </if>
397
+      <if test="creditCode != null" >
398
+        #{creditCode,jdbcType=VARCHAR},
399
+      </if>
400
+      <if test="registType != null" >
401
+        #{registType,jdbcType=INTEGER},
402
+      </if>
403
+      <if test="qualification != null" >
404
+        #{qualification,jdbcType=INTEGER},
405
+      </if>
406
+      <if test="independentCorporation != null" >
407
+        #{independentCorporation,jdbcType=INTEGER},
408
+      </if>
409
+      <if test="legalPerson != null" >
410
+        #{legalPerson,jdbcType=VARCHAR},
411
+      </if>
412
+      <if test="whetherRent != null" >
413
+        #{whetherRent,jdbcType=INTEGER},
414
+      </if>
415
+      <if test="infoRegist != null" >
416
+        #{infoRegist,jdbcType=VARCHAR},
417
+      </if>
418
+      <if test="registDate != null" >
419
+        #{registDate,jdbcType=TIMESTAMP},
420
+      </if>
421
+      <if test="remark != null" >
422
+        #{remark,jdbcType=VARCHAR},
423
+      </if>
424
+      <if test="parentId != null" >
425
+        #{parentId,jdbcType=INTEGER},
426
+      </if>
427
+      <if test="status != null" >
428
+        #{status,jdbcType=INTEGER},
429
+      </if>
430
+      <if test="delFlag != null" >
431
+        #{delFlag,jdbcType=INTEGER},
432
+      </if>
433
+      <if test="birdsEye != null" >
434
+        #{birdsEye,jdbcType=VARCHAR},
435
+      </if>
436
+      <if test="birdsRemote != null" >
437
+        #{birdsRemote,jdbcType=VARCHAR},
438
+      </if>
439
+      <if test="briefIntroduction != null" >
440
+        #{briefIntroduction,jdbcType=VARCHAR},
441
+      </if>
442
+      <if test="invoiceTitle != null" >
443
+        #{invoiceTitle,jdbcType=VARCHAR},
444
+      </if>
445
+      <if test="registNumber != null" >
446
+        #{registNumber,jdbcType=VARCHAR},
447
+      </if>
448
+      <if test="bankName != null" >
449
+        #{bankName,jdbcType=VARCHAR},
450
+      </if>
451
+      <if test="accountName != null" >
452
+        #{accountName,jdbcType=VARCHAR},
453
+      </if>
454
+      <if test="accountNumber != null" >
455
+        #{accountNumber,jdbcType=VARCHAR},
456
+      </if>
457
+    </trim>
458
+  </insert>
459
+  <select id="countByExample" parameterType="com.chinaitop.depot.business.model.OrgInfoExample" resultType="java.lang.Integer" >
460
+    select count(*) from org_info
461
+    <if test="_parameter != null" >
462
+      <include refid="Example_Where_Clause" />
463
+    </if>
464
+  </select>
465
+  <update id="updateByExampleSelective" parameterType="map" >
466
+    update org_info
467
+    <set >
468
+      <if test="record.orgId != null" >
469
+        org_id = #{record.orgId,jdbcType=INTEGER},
470
+      </if>
471
+      <if test="record.orgName != null" >
472
+        org_name = #{record.orgName,jdbcType=VARCHAR},
473
+      </if>
474
+      <if test="record.shortName != null" >
475
+        short_name = #{record.shortName,jdbcType=VARCHAR},
476
+      </if>
477
+      <if test="record.orgCode != null" >
478
+        org_code = #{record.orgCode,jdbcType=VARCHAR},
479
+      </if>
480
+      <if test="record.orgClassId != null" >
481
+        org_class_id = #{record.orgClassId,jdbcType=INTEGER},
482
+      </if>
483
+      <if test="record.companyNature != null" >
484
+        company_nature = #{record.companyNature,jdbcType=INTEGER},
485
+      </if>
486
+      <if test="record.busiType != null" >
487
+        busi_type = #{record.busiType,jdbcType=INTEGER},
488
+      </if>
489
+      <if test="record.address != null" >
490
+        address = #{record.address,jdbcType=VARCHAR},
491
+      </if>
492
+      <if test="record.contact != null" >
493
+        contact = #{record.contact,jdbcType=VARCHAR},
494
+      </if>
495
+      <if test="record.fax != null" >
496
+        fax = #{record.fax,jdbcType=VARCHAR},
497
+      </if>
498
+      <if test="record.chargePerson != null" >
499
+        charge_person = #{record.chargePerson,jdbcType=VARCHAR},
500
+      </if>
501
+      <if test="record.longitude != null" >
502
+        longitude = #{record.longitude,jdbcType=VARCHAR},
503
+      </if>
504
+      <if test="record.latitude != null" >
505
+        latitude = #{record.latitude,jdbcType=VARCHAR},
506
+      </if>
507
+      <if test="record.registCapital != null" >
508
+        regist_capital = #{record.registCapital,jdbcType=INTEGER},
509
+      </if>
510
+      <if test="record.workNumber != null" >
511
+        work_number = #{record.workNumber,jdbcType=INTEGER},
512
+      </if>
513
+      <if test="record.areaCode != null" >
514
+        area_code = #{record.areaCode,jdbcType=INTEGER},
515
+      </if>
516
+      <if test="record.areaName != null" >
517
+        area_name = #{record.areaName,jdbcType=VARCHAR},
518
+      </if>
519
+      <if test="record.post != null" >
520
+        post = #{record.post,jdbcType=INTEGER},
521
+      </if>
522
+      <if test="record.depotClass != null" >
523
+        depot_class = #{record.depotClass,jdbcType=INTEGER},
524
+      </if>
525
+      <if test="record.designCapacity != null" >
526
+        design_capacity = #{record.designCapacity,jdbcType=INTEGER},
527
+      </if>
528
+      <if test="record.effectiveCapacity != null" >
529
+        effective_capacity = #{record.effectiveCapacity,jdbcType=INTEGER},
530
+      </if>
531
+      <if test="record.depotArea != null" >
532
+        depot_area = #{record.depotArea,jdbcType=REAL},
533
+      </if>
534
+      <if test="record.completeDate != null" >
535
+        complete_date = #{record.completeDate,jdbcType=TIMESTAMP},
536
+      </if>
537
+      <if test="record.useDate != null" >
538
+        use_date = #{record.useDate,jdbcType=TIMESTAMP},
539
+      </if>
540
+      <if test="record.companyOrgCode != null" >
541
+        company_org_code = #{record.companyOrgCode,jdbcType=VARCHAR},
542
+      </if>
543
+      <if test="record.creditCode != null" >
544
+        credit_code = #{record.creditCode,jdbcType=VARCHAR},
545
+      </if>
546
+      <if test="record.registType != null" >
547
+        regist_type = #{record.registType,jdbcType=INTEGER},
548
+      </if>
549
+      <if test="record.qualification != null" >
550
+        qualification = #{record.qualification,jdbcType=INTEGER},
551
+      </if>
552
+      <if test="record.independentCorporation != null" >
553
+        independent_corporation = #{record.independentCorporation,jdbcType=INTEGER},
554
+      </if>
555
+      <if test="record.legalPerson != null" >
556
+        legal_person = #{record.legalPerson,jdbcType=VARCHAR},
557
+      </if>
558
+      <if test="record.whetherRent != null" >
559
+        whether_rent = #{record.whetherRent,jdbcType=INTEGER},
560
+      </if>
561
+      <if test="record.infoRegist != null" >
562
+        info_regist = #{record.infoRegist,jdbcType=VARCHAR},
563
+      </if>
564
+      <if test="record.registDate != null" >
565
+        regist_date = #{record.registDate,jdbcType=TIMESTAMP},
566
+      </if>
567
+      <if test="record.remark != null" >
568
+        remark = #{record.remark,jdbcType=VARCHAR},
569
+      </if>
570
+      <if test="record.parentId != null" >
571
+        parent_id = #{record.parentId,jdbcType=INTEGER},
572
+      </if>
573
+      <if test="record.status != null" >
574
+        status = #{record.status,jdbcType=INTEGER},
575
+      </if>
576
+      <if test="record.delFlag != null" >
577
+        del_flag = #{record.delFlag,jdbcType=INTEGER},
578
+      </if>
579
+      <if test="record.birdsEye != null" >
580
+        birds_eye = #{record.birdsEye,jdbcType=VARCHAR},
581
+      </if>
582
+      <if test="record.birdsRemote != null" >
583
+        birds_Remote = #{record.birdsRemote,jdbcType=VARCHAR},
584
+      </if>
585
+      <if test="record.briefIntroduction != null" >
586
+        brief_introduction = #{record.briefIntroduction,jdbcType=VARCHAR},
587
+      </if>
588
+      <if test="record.invoiceTitle != null" >
589
+        invoice_title = #{record.invoiceTitle,jdbcType=VARCHAR},
590
+      </if>
591
+      <if test="record.registNumber != null" >
592
+        regist_number = #{record.registNumber,jdbcType=VARCHAR},
593
+      </if>
594
+      <if test="record.bankName != null" >
595
+        bank_name = #{record.bankName,jdbcType=VARCHAR},
596
+      </if>
597
+      <if test="record.accountName != null" >
598
+        account_name = #{record.accountName,jdbcType=VARCHAR},
599
+      </if>
600
+      <if test="record.accountNumber != null" >
601
+        account_number = #{record.accountNumber,jdbcType=VARCHAR},
602
+      </if>
603
+    </set>
604
+    <if test="_parameter != null" >
605
+      <include refid="Update_By_Example_Where_Clause" />
606
+    </if>
607
+  </update>
608
+  <update id="updateByExample" parameterType="map" >
609
+    update org_info
610
+    set org_id = #{record.orgId,jdbcType=INTEGER},
611
+      org_name = #{record.orgName,jdbcType=VARCHAR},
612
+      short_name = #{record.shortName,jdbcType=VARCHAR},
613
+      org_code = #{record.orgCode,jdbcType=VARCHAR},
614
+      org_class_id = #{record.orgClassId,jdbcType=INTEGER},
615
+      company_nature = #{record.companyNature,jdbcType=INTEGER},
616
+      busi_type = #{record.busiType,jdbcType=INTEGER},
617
+      address = #{record.address,jdbcType=VARCHAR},
618
+      contact = #{record.contact,jdbcType=VARCHAR},
619
+      fax = #{record.fax,jdbcType=VARCHAR},
620
+      charge_person = #{record.chargePerson,jdbcType=VARCHAR},
621
+      longitude = #{record.longitude,jdbcType=VARCHAR},
622
+      latitude = #{record.latitude,jdbcType=VARCHAR},
623
+      regist_capital = #{record.registCapital,jdbcType=INTEGER},
624
+      work_number = #{record.workNumber,jdbcType=INTEGER},
625
+      area_code = #{record.areaCode,jdbcType=INTEGER},
626
+      area_name = #{record.areaName,jdbcType=VARCHAR},
627
+      post = #{record.post,jdbcType=INTEGER},
628
+      depot_class = #{record.depotClass,jdbcType=INTEGER},
629
+      design_capacity = #{record.designCapacity,jdbcType=INTEGER},
630
+      effective_capacity = #{record.effectiveCapacity,jdbcType=INTEGER},
631
+      depot_area = #{record.depotArea,jdbcType=REAL},
632
+      complete_date = #{record.completeDate,jdbcType=TIMESTAMP},
633
+      use_date = #{record.useDate,jdbcType=TIMESTAMP},
634
+      company_org_code = #{record.companyOrgCode,jdbcType=VARCHAR},
635
+      credit_code = #{record.creditCode,jdbcType=VARCHAR},
636
+      regist_type = #{record.registType,jdbcType=INTEGER},
637
+      qualification = #{record.qualification,jdbcType=INTEGER},
638
+      independent_corporation = #{record.independentCorporation,jdbcType=INTEGER},
639
+      legal_person = #{record.legalPerson,jdbcType=VARCHAR},
640
+      whether_rent = #{record.whetherRent,jdbcType=INTEGER},
641
+      info_regist = #{record.infoRegist,jdbcType=VARCHAR},
642
+      regist_date = #{record.registDate,jdbcType=TIMESTAMP},
643
+      remark = #{record.remark,jdbcType=VARCHAR},
644
+      parent_id = #{record.parentId,jdbcType=INTEGER},
645
+      status = #{record.status,jdbcType=INTEGER},
646
+      del_flag = #{record.delFlag,jdbcType=INTEGER},
647
+      birds_eye = #{record.birdsEye,jdbcType=VARCHAR},
648
+      birds_Remote = #{record.birdsRemote,jdbcType=VARCHAR},
649
+      brief_introduction = #{record.briefIntroduction,jdbcType=VARCHAR},
650
+      invoice_title = #{record.invoiceTitle,jdbcType=VARCHAR},
651
+      regist_number = #{record.registNumber,jdbcType=VARCHAR},
652
+      bank_name = #{record.bankName,jdbcType=VARCHAR},
653
+      account_name = #{record.accountName,jdbcType=VARCHAR},
654
+      account_number = #{record.accountNumber,jdbcType=VARCHAR}
655
+    <if test="_parameter != null" >
656
+      <include refid="Update_By_Example_Where_Clause" />
657
+    </if>
658
+  </update>
659
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.business.model.OrgInfo" >
660
+    update org_info
661
+    <set >
662
+      <if test="orgName != null" >
663
+        org_name = #{orgName,jdbcType=VARCHAR},
664
+      </if>
665
+      <if test="shortName != null" >
666
+        short_name = #{shortName,jdbcType=VARCHAR},
667
+      </if>
668
+      <if test="orgCode != null" >
669
+        org_code = #{orgCode,jdbcType=VARCHAR},
670
+      </if>
671
+      <if test="orgClassId != null" >
672
+        org_class_id = #{orgClassId,jdbcType=INTEGER},
673
+      </if>
674
+      <if test="companyNature != null" >
675
+        company_nature = #{companyNature,jdbcType=INTEGER},
676
+      </if>
677
+      <if test="busiType != null" >
678
+        busi_type = #{busiType,jdbcType=INTEGER},
679
+      </if>
680
+      <if test="address != null" >
681
+        address = #{address,jdbcType=VARCHAR},
682
+      </if>
683
+      <if test="contact != null" >
684
+        contact = #{contact,jdbcType=VARCHAR},
685
+      </if>
686
+      <if test="fax != null" >
687
+        fax = #{fax,jdbcType=VARCHAR},
688
+      </if>
689
+      <if test="chargePerson != null" >
690
+        charge_person = #{chargePerson,jdbcType=VARCHAR},
691
+      </if>
692
+      <if test="longitude != null" >
693
+        longitude = #{longitude,jdbcType=VARCHAR},
694
+      </if>
695
+      <if test="latitude != null" >
696
+        latitude = #{latitude,jdbcType=VARCHAR},
697
+      </if>
698
+      <if test="registCapital != null" >
699
+        regist_capital = #{registCapital,jdbcType=INTEGER},
700
+      </if>
701
+      <if test="workNumber != null" >
702
+        work_number = #{workNumber,jdbcType=INTEGER},
703
+      </if>
704
+      <if test="areaCode != null" >
705
+        area_code = #{areaCode,jdbcType=INTEGER},
706
+      </if>
707
+      <if test="areaName != null" >
708
+        area_name = #{areaName,jdbcType=VARCHAR},
709
+      </if>
710
+      <if test="post != null" >
711
+        post = #{post,jdbcType=INTEGER},
712
+      </if>
713
+      <if test="depotClass != null" >
714
+        depot_class = #{depotClass,jdbcType=INTEGER},
715
+      </if>
716
+      <if test="designCapacity != null" >
717
+        design_capacity = #{designCapacity,jdbcType=INTEGER},
718
+      </if>
719
+      <if test="effectiveCapacity != null" >
720
+        effective_capacity = #{effectiveCapacity,jdbcType=INTEGER},
721
+      </if>
722
+      <if test="depotArea != null" >
723
+        depot_area = #{depotArea,jdbcType=REAL},
724
+      </if>
725
+      <if test="completeDate != null" >
726
+        complete_date = #{completeDate,jdbcType=TIMESTAMP},
727
+      </if>
728
+      <if test="useDate != null" >
729
+        use_date = #{useDate,jdbcType=TIMESTAMP},
730
+      </if>
731
+      <if test="companyOrgCode != null" >
732
+        company_org_code = #{companyOrgCode,jdbcType=VARCHAR},
733
+      </if>
734
+      <if test="creditCode != null" >
735
+        credit_code = #{creditCode,jdbcType=VARCHAR},
736
+      </if>
737
+      <if test="registType != null" >
738
+        regist_type = #{registType,jdbcType=INTEGER},
739
+      </if>
740
+      <if test="qualification != null" >
741
+        qualification = #{qualification,jdbcType=INTEGER},
742
+      </if>
743
+      <if test="independentCorporation != null" >
744
+        independent_corporation = #{independentCorporation,jdbcType=INTEGER},
745
+      </if>
746
+      <if test="legalPerson != null" >
747
+        legal_person = #{legalPerson,jdbcType=VARCHAR},
748
+      </if>
749
+      <if test="whetherRent != null" >
750
+        whether_rent = #{whetherRent,jdbcType=INTEGER},
751
+      </if>
752
+      <if test="infoRegist != null" >
753
+        info_regist = #{infoRegist,jdbcType=VARCHAR},
754
+      </if>
755
+      <if test="registDate != null" >
756
+        regist_date = #{registDate,jdbcType=TIMESTAMP},
757
+      </if>
758
+      <if test="remark != null" >
759
+        remark = #{remark,jdbcType=VARCHAR},
760
+      </if>
761
+      <if test="parentId != null" >
762
+        parent_id = #{parentId,jdbcType=INTEGER},
763
+      </if>
764
+      <if test="status != null" >
765
+        status = #{status,jdbcType=INTEGER},
766
+      </if>
767
+      <if test="delFlag != null" >
768
+        del_flag = #{delFlag,jdbcType=INTEGER},
769
+      </if>
770
+      <if test="birdsEye != null" >
771
+        birds_eye = #{birdsEye,jdbcType=VARCHAR},
772
+      </if>
773
+      <if test="birdsRemote != null" >
774
+        birds_Remote = #{birdsRemote,jdbcType=VARCHAR},
775
+      </if>
776
+      <if test="briefIntroduction != null" >
777
+        brief_introduction = #{briefIntroduction,jdbcType=VARCHAR},
778
+      </if>
779
+      <if test="invoiceTitle != null" >
780
+        invoice_title = #{invoiceTitle,jdbcType=VARCHAR},
781
+      </if>
782
+      <if test="registNumber != null" >
783
+        regist_number = #{registNumber,jdbcType=VARCHAR},
784
+      </if>
785
+      <if test="bankName != null" >
786
+        bank_name = #{bankName,jdbcType=VARCHAR},
787
+      </if>
788
+      <if test="accountName != null" >
789
+        account_name = #{accountName,jdbcType=VARCHAR},
790
+      </if>
791
+      <if test="accountNumber != null" >
792
+        account_number = #{accountNumber,jdbcType=VARCHAR},
793
+      </if>
794
+    </set>
795
+    where org_id = #{orgId,jdbcType=INTEGER}
796
+  </update>
797
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.business.model.OrgInfo" >
798
+    update org_info
799
+    set org_name = #{orgName,jdbcType=VARCHAR},
800
+      short_name = #{shortName,jdbcType=VARCHAR},
801
+      org_code = #{orgCode,jdbcType=VARCHAR},
802
+      org_class_id = #{orgClassId,jdbcType=INTEGER},
803
+      company_nature = #{companyNature,jdbcType=INTEGER},
804
+      busi_type = #{busiType,jdbcType=INTEGER},
805
+      address = #{address,jdbcType=VARCHAR},
806
+      contact = #{contact,jdbcType=VARCHAR},
807
+      fax = #{fax,jdbcType=VARCHAR},
808
+      charge_person = #{chargePerson,jdbcType=VARCHAR},
809
+      longitude = #{longitude,jdbcType=VARCHAR},
810
+      latitude = #{latitude,jdbcType=VARCHAR},
811
+      regist_capital = #{registCapital,jdbcType=INTEGER},
812
+      work_number = #{workNumber,jdbcType=INTEGER},
813
+      area_code = #{areaCode,jdbcType=INTEGER},
814
+      area_name = #{areaName,jdbcType=VARCHAR},
815
+      post = #{post,jdbcType=INTEGER},
816
+      depot_class = #{depotClass,jdbcType=INTEGER},
817
+      design_capacity = #{designCapacity,jdbcType=INTEGER},
818
+      effective_capacity = #{effectiveCapacity,jdbcType=INTEGER},
819
+      depot_area = #{depotArea,jdbcType=REAL},
820
+      complete_date = #{completeDate,jdbcType=TIMESTAMP},
821
+      use_date = #{useDate,jdbcType=TIMESTAMP},
822
+      company_org_code = #{companyOrgCode,jdbcType=VARCHAR},
823
+      credit_code = #{creditCode,jdbcType=VARCHAR},
824
+      regist_type = #{registType,jdbcType=INTEGER},
825
+      qualification = #{qualification,jdbcType=INTEGER},
826
+      independent_corporation = #{independentCorporation,jdbcType=INTEGER},
827
+      legal_person = #{legalPerson,jdbcType=VARCHAR},
828
+      whether_rent = #{whetherRent,jdbcType=INTEGER},
829
+      info_regist = #{infoRegist,jdbcType=VARCHAR},
830
+      regist_date = #{registDate,jdbcType=TIMESTAMP},
831
+      remark = #{remark,jdbcType=VARCHAR},
832
+      parent_id = #{parentId,jdbcType=INTEGER},
833
+      status = #{status,jdbcType=INTEGER},
834
+      del_flag = #{delFlag,jdbcType=INTEGER},
835
+      birds_eye = #{birdsEye,jdbcType=VARCHAR},
836
+      birds_Remote = #{birdsRemote,jdbcType=VARCHAR},
837
+      brief_introduction = #{briefIntroduction,jdbcType=VARCHAR},
838
+      invoice_title = #{invoiceTitle,jdbcType=VARCHAR},
839
+      regist_number = #{registNumber,jdbcType=VARCHAR},
840
+      bank_name = #{bankName,jdbcType=VARCHAR},
841
+      account_name = #{accountName,jdbcType=VARCHAR},
842
+      account_number = #{accountNumber,jdbcType=VARCHAR}
843
+    where org_id = #{orgId,jdbcType=INTEGER}
844
+  </update>
845
+</mapper>

+ 31 - 0
src/main/java/com/chinaitop/depot/business/mapper/RoleInfoMapper.java

@@ -0,0 +1,31 @@
1
+package com.chinaitop.depot.business.mapper;
2
+
3
+import com.chinaitop.depot.business.model.RoleInfo;
4
+import com.chinaitop.depot.business.model.RoleInfoExample;
5
+import org.apache.ibatis.annotations.Param;
6
+
7
+import java.util.List;
8
+
9
+public interface RoleInfoMapper {
10
+    int countByExample(RoleInfoExample example);
11
+
12
+    int deleteByExample(RoleInfoExample example);
13
+
14
+    int deleteByPrimaryKey(Integer roleId);
15
+
16
+    int insert(RoleInfo record);
17
+
18
+    int insertSelective(RoleInfo record);
19
+
20
+    List<RoleInfo> selectByExample(RoleInfoExample example);
21
+
22
+    RoleInfo selectByPrimaryKey(Integer roleId);
23
+
24
+    int updateByExampleSelective(@Param("record") RoleInfo record, @Param("example") RoleInfoExample example);
25
+
26
+    int updateByExample(@Param("record") RoleInfo record, @Param("example") RoleInfoExample example);
27
+
28
+    int updateByPrimaryKeySelective(RoleInfo record);
29
+
30
+    int updateByPrimaryKey(RoleInfo record);
31
+}

+ 228 - 0
src/main/java/com/chinaitop/depot/business/mapper/RoleInfoMapper.xml

@@ -0,0 +1,228 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.chinaitop.depot.business.mapper.RoleInfoMapper" >
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.business.model.RoleInfo" >
5
+    <id column="role_id" property="roleId" jdbcType="INTEGER" />
6
+    <result column="role_name" property="roleName" jdbcType="VARCHAR" />
7
+    <result column="parent_id" property="parentId" jdbcType="INTEGER" />
8
+    <result column="remark" property="remark" jdbcType="VARCHAR" />
9
+    <result column="del_flag" property="delFlag" jdbcType="INTEGER" />
10
+    <result column="org_id" property="orgId" jdbcType="INTEGER" />
11
+  </resultMap>
12
+  <sql id="Example_Where_Clause" >
13
+    <where >
14
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
15
+        <if test="criteria.valid" >
16
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
17
+            <foreach collection="criteria.criteria" item="criterion" >
18
+              <choose >
19
+                <when test="criterion.noValue" >
20
+                  and ${criterion.condition}
21
+                </when>
22
+                <when test="criterion.singleValue" >
23
+                  and ${criterion.condition} #{criterion.value}
24
+                </when>
25
+                <when test="criterion.betweenValue" >
26
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
27
+                </when>
28
+                <when test="criterion.listValue" >
29
+                  and ${criterion.condition}
30
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
31
+                    #{listItem}
32
+                  </foreach>
33
+                </when>
34
+              </choose>
35
+            </foreach>
36
+          </trim>
37
+        </if>
38
+      </foreach>
39
+    </where>
40
+  </sql>
41
+  <sql id="Update_By_Example_Where_Clause" >
42
+    <where >
43
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
44
+        <if test="criteria.valid" >
45
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
46
+            <foreach collection="criteria.criteria" item="criterion" >
47
+              <choose >
48
+                <when test="criterion.noValue" >
49
+                  and ${criterion.condition}
50
+                </when>
51
+                <when test="criterion.singleValue" >
52
+                  and ${criterion.condition} #{criterion.value}
53
+                </when>
54
+                <when test="criterion.betweenValue" >
55
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
56
+                </when>
57
+                <when test="criterion.listValue" >
58
+                  and ${criterion.condition}
59
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
60
+                    #{listItem}
61
+                  </foreach>
62
+                </when>
63
+              </choose>
64
+            </foreach>
65
+          </trim>
66
+        </if>
67
+      </foreach>
68
+    </where>
69
+  </sql>
70
+  <sql id="Base_Column_List" >
71
+    role_id, role_name, parent_id, remark, del_flag, org_id
72
+  </sql>
73
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.business.model.RoleInfoExample" >
74
+    select
75
+    <if test="distinct" >
76
+      distinct
77
+    </if>
78
+    <include refid="Base_Column_List" />
79
+    from role_info
80
+    <if test="_parameter != null" >
81
+      <include refid="Example_Where_Clause" />
82
+    </if>
83
+    <if test="orderByClause != null" >
84
+      order by ${orderByClause}
85
+    </if>
86
+  </select>
87
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
88
+    select 
89
+    <include refid="Base_Column_List" />
90
+    from role_info
91
+    where role_id = #{roleId,jdbcType=INTEGER}
92
+  </select>
93
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
94
+    delete from role_info
95
+    where role_id = #{roleId,jdbcType=INTEGER}
96
+  </delete>
97
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.business.model.RoleInfoExample" >
98
+    delete from role_info
99
+    <if test="_parameter != null" >
100
+      <include refid="Example_Where_Clause" />
101
+    </if>
102
+  </delete>
103
+  <insert id="insert" parameterType="com.chinaitop.depot.business.model.RoleInfo" >
104
+    insert into role_info (role_id, role_name, parent_id, 
105
+      remark, del_flag, org_id
106
+      )
107
+    values (#{roleId,jdbcType=INTEGER}, #{roleName,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER}, 
108
+      #{remark,jdbcType=VARCHAR}, #{delFlag,jdbcType=INTEGER}, #{orgId,jdbcType=INTEGER}
109
+      )
110
+  </insert>
111
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.business.model.RoleInfo" >
112
+    insert into role_info
113
+    <trim prefix="(" suffix=")" suffixOverrides="," >
114
+      <if test="roleId != null" >
115
+        role_id,
116
+      </if>
117
+      <if test="roleName != null" >
118
+        role_name,
119
+      </if>
120
+      <if test="parentId != null" >
121
+        parent_id,
122
+      </if>
123
+      <if test="remark != null" >
124
+        remark,
125
+      </if>
126
+      <if test="delFlag != null" >
127
+        del_flag,
128
+      </if>
129
+      <if test="orgId != null" >
130
+        org_id,
131
+      </if>
132
+    </trim>
133
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
134
+      <if test="roleId != null" >
135
+        #{roleId,jdbcType=INTEGER},
136
+      </if>
137
+      <if test="roleName != null" >
138
+        #{roleName,jdbcType=VARCHAR},
139
+      </if>
140
+      <if test="parentId != null" >
141
+        #{parentId,jdbcType=INTEGER},
142
+      </if>
143
+      <if test="remark != null" >
144
+        #{remark,jdbcType=VARCHAR},
145
+      </if>
146
+      <if test="delFlag != null" >
147
+        #{delFlag,jdbcType=INTEGER},
148
+      </if>
149
+      <if test="orgId != null" >
150
+        #{orgId,jdbcType=INTEGER},
151
+      </if>
152
+    </trim>
153
+  </insert>
154
+  <select id="countByExample" parameterType="com.chinaitop.depot.business.model.RoleInfoExample" resultType="java.lang.Integer" >
155
+    select count(*) from role_info
156
+    <if test="_parameter != null" >
157
+      <include refid="Example_Where_Clause" />
158
+    </if>
159
+  </select>
160
+  <update id="updateByExampleSelective" parameterType="map" >
161
+    update role_info
162
+    <set >
163
+      <if test="record.roleId != null" >
164
+        role_id = #{record.roleId,jdbcType=INTEGER},
165
+      </if>
166
+      <if test="record.roleName != null" >
167
+        role_name = #{record.roleName,jdbcType=VARCHAR},
168
+      </if>
169
+      <if test="record.parentId != null" >
170
+        parent_id = #{record.parentId,jdbcType=INTEGER},
171
+      </if>
172
+      <if test="record.remark != null" >
173
+        remark = #{record.remark,jdbcType=VARCHAR},
174
+      </if>
175
+      <if test="record.delFlag != null" >
176
+        del_flag = #{record.delFlag,jdbcType=INTEGER},
177
+      </if>
178
+      <if test="record.orgId != null" >
179
+        org_id = #{record.orgId,jdbcType=INTEGER},
180
+      </if>
181
+    </set>
182
+    <if test="_parameter != null" >
183
+      <include refid="Update_By_Example_Where_Clause" />
184
+    </if>
185
+  </update>
186
+  <update id="updateByExample" parameterType="map" >
187
+    update role_info
188
+    set role_id = #{record.roleId,jdbcType=INTEGER},
189
+      role_name = #{record.roleName,jdbcType=VARCHAR},
190
+      parent_id = #{record.parentId,jdbcType=INTEGER},
191
+      remark = #{record.remark,jdbcType=VARCHAR},
192
+      del_flag = #{record.delFlag,jdbcType=INTEGER},
193
+      org_id = #{record.orgId,jdbcType=INTEGER}
194
+    <if test="_parameter != null" >
195
+      <include refid="Update_By_Example_Where_Clause" />
196
+    </if>
197
+  </update>
198
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.business.model.RoleInfo" >
199
+    update role_info
200
+    <set >
201
+      <if test="roleName != null" >
202
+        role_name = #{roleName,jdbcType=VARCHAR},
203
+      </if>
204
+      <if test="parentId != null" >
205
+        parent_id = #{parentId,jdbcType=INTEGER},
206
+      </if>
207
+      <if test="remark != null" >
208
+        remark = #{remark,jdbcType=VARCHAR},
209
+      </if>
210
+      <if test="delFlag != null" >
211
+        del_flag = #{delFlag,jdbcType=INTEGER},
212
+      </if>
213
+      <if test="orgId != null" >
214
+        org_id = #{orgId,jdbcType=INTEGER},
215
+      </if>
216
+    </set>
217
+    where role_id = #{roleId,jdbcType=INTEGER}
218
+  </update>
219
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.business.model.RoleInfo" >
220
+    update role_info
221
+    set role_name = #{roleName,jdbcType=VARCHAR},
222
+      parent_id = #{parentId,jdbcType=INTEGER},
223
+      remark = #{remark,jdbcType=VARCHAR},
224
+      del_flag = #{delFlag,jdbcType=INTEGER},
225
+      org_id = #{orgId,jdbcType=INTEGER}
226
+    where role_id = #{roleId,jdbcType=INTEGER}
227
+  </update>
228
+</mapper>

+ 34 - 0
src/main/java/com/chinaitop/depot/business/mapper/UserInfoMapper.java

@@ -0,0 +1,34 @@
1
+package com.chinaitop.depot.business.mapper;
2
+
3
+import com.chinaitop.depot.business.model.UserInfo;
4
+import com.chinaitop.depot.business.model.UserInfoExample;
5
+import org.apache.ibatis.annotations.Param;
6
+
7
+import java.util.HashMap;
8
+import java.util.List;
9
+
10
+public interface UserInfoMapper {
11
+    int countByExample(UserInfoExample example);
12
+
13
+    int deleteByExample(UserInfoExample example);
14
+
15
+    int deleteByPrimaryKey(Integer userId);
16
+
17
+    int insert(UserInfo record);
18
+
19
+    int insertSelective(UserInfo record);
20
+
21
+    List<UserInfo> selectByExample(UserInfoExample example);
22
+
23
+    UserInfo selectByPrimaryKey(Integer userId);
24
+
25
+    int updateByExampleSelective(@Param("record") UserInfo record, @Param("example") UserInfoExample example);
26
+
27
+    int updateByExample(@Param("record") UserInfo record, @Param("example") UserInfoExample example);
28
+
29
+    int updateByPrimaryKeySelective(UserInfo record);
30
+
31
+    int updateByPrimaryKey(UserInfo record);
32
+
33
+	List<UserInfo> queryAll(HashMap<Object, Object> map);
34
+}

+ 485 - 0
src/main/java/com/chinaitop/depot/business/mapper/UserInfoMapper.xml

@@ -0,0 +1,485 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.chinaitop.depot.business.mapper.UserInfoMapper">
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.business.model.UserInfo">
5
+    <id column="user_id" jdbcType="INTEGER" property="userId" />
6
+    <result column="username" jdbcType="VARCHAR" property="username" />
7
+    <result column="password" jdbcType="VARCHAR" property="password" />
8
+    <result column="org_id" jdbcType="INTEGER" property="orgId" />
9
+    <result column="real_name" jdbcType="VARCHAR" property="realName" />
10
+    <result column="user_alias" jdbcType="VARCHAR" property="userAlias" />
11
+    <result column="sex" jdbcType="INTEGER" property="sex" />
12
+    <result column="telphone" jdbcType="VARCHAR" property="telphone" />
13
+    <result column="mobile" jdbcType="VARCHAR" property="mobile" />
14
+    <result column="address" jdbcType="VARCHAR" property="address" />
15
+    <result column="email" jdbcType="VARCHAR" property="email" />
16
+    <result column="qq_number" jdbcType="VARCHAR" property="qqNumber" />
17
+    <result column="img_url" jdbcType="VARCHAR" property="imgUrl" />
18
+    <result column="signature" jdbcType="VARCHAR" property="signature" />
19
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
20
+    <result column="create_user_id" jdbcType="INTEGER" property="createUserId" />
21
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
22
+    <result column="update_user_id" jdbcType="INTEGER" property="updateUserId" />
23
+    <result column="status" jdbcType="INTEGER" property="status" />
24
+    <result column="del_flag" jdbcType="INTEGER" property="delFlag" />
25
+  </resultMap>
26
+  <sql id="Example_Where_Clause">
27
+    <where>
28
+      <foreach collection="oredCriteria" item="criteria" separator="or">
29
+        <if test="criteria.valid">
30
+          <trim prefix="(" prefixOverrides="and" suffix=")">
31
+            <foreach collection="criteria.criteria" item="criterion">
32
+              <choose>
33
+                <when test="criterion.noValue">
34
+                  and ${criterion.condition}
35
+                </when>
36
+                <when test="criterion.singleValue">
37
+                  and ${criterion.condition} #{criterion.value}
38
+                </when>
39
+                <when test="criterion.betweenValue">
40
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
41
+                </when>
42
+                <when test="criterion.listValue">
43
+                  and ${criterion.condition}
44
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
45
+                    #{listItem}
46
+                  </foreach>
47
+                </when>
48
+              </choose>
49
+            </foreach>
50
+          </trim>
51
+        </if>
52
+      </foreach>
53
+    </where>
54
+  </sql>
55
+  <sql id="Update_By_Example_Where_Clause">
56
+    <where>
57
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
58
+        <if test="criteria.valid">
59
+          <trim prefix="(" prefixOverrides="and" suffix=")">
60
+            <foreach collection="criteria.criteria" item="criterion">
61
+              <choose>
62
+                <when test="criterion.noValue">
63
+                  and ${criterion.condition}
64
+                </when>
65
+                <when test="criterion.singleValue">
66
+                  and ${criterion.condition} #{criterion.value}
67
+                </when>
68
+                <when test="criterion.betweenValue">
69
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
70
+                </when>
71
+                <when test="criterion.listValue">
72
+                  and ${criterion.condition}
73
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
74
+                    #{listItem}
75
+                  </foreach>
76
+                </when>
77
+              </choose>
78
+            </foreach>
79
+          </trim>
80
+        </if>
81
+      </foreach>
82
+    </where>
83
+  </sql>
84
+  <sql id="Base_Column_List">
85
+    user_id, username, password, org_id, real_name, user_alias, sex, telphone, mobile, address, email, 
86
+    qq_number, img_url, signature, create_time, create_user_id, update_time, update_user_id, 
87
+    status, del_flag
88
+  </sql>
89
+  <select id="selectByExample" parameterType="com.chinaitop.depot.business.model.UserInfoExample" resultMap="BaseResultMap">
90
+    select
91
+    <if test="distinct">
92
+      distinct
93
+    </if>
94
+    <include refid="Base_Column_List" />
95
+    from user_info
96
+    <if test="_parameter != null">
97
+      <include refid="Example_Where_Clause" />
98
+    </if>
99
+    <if test="orderByClause != null">
100
+      order by ${orderByClause}
101
+    </if>
102
+  </select>
103
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
104
+    select 
105
+    <include refid="Base_Column_List" />
106
+    from user_info
107
+    where user_id = #{userId,jdbcType=INTEGER}
108
+  </select>
109
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
110
+    delete from user_info
111
+    where user_id = #{userId,jdbcType=INTEGER}
112
+  </delete>
113
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.business.model.UserInfoExample">
114
+    delete from user_info
115
+    <if test="_parameter != null">
116
+      <include refid="Example_Where_Clause" />
117
+    </if>
118
+  </delete>
119
+  <insert id="insert" useGeneratedKeys="true" keyProperty="userId" parameterType="com.chinaitop.depot.business.model.UserInfo">
120
+    insert into user_info (user_id, username, password, 
121
+      org_id, real_name, user_alias, sex, 
122
+      telphone, mobile, address, 
123
+      email, qq_number, img_url, 
124
+      signature, create_time, create_user_id, 
125
+      update_time, update_user_id, status, 
126
+      del_flag)
127
+    values (#{userId,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, 
128
+      #{orgId,jdbcType=INTEGER}, #{realName,jdbcType=VARCHAR}, #{userAlias,jdbcType=VARCHAR}, #{sex,jdbcType=INTEGER}, 
129
+      #{telphone,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, 
130
+      #{email,jdbcType=VARCHAR}, #{qqNumber,jdbcType=VARCHAR}, #{imgUrl,jdbcType=VARCHAR}, 
131
+      #{signature,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=INTEGER}, 
132
+      #{updateTime,jdbcType=TIMESTAMP}, #{updateUserId,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, 
133
+      #{delFlag,jdbcType=INTEGER})
134
+  </insert>
135
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.business.model.UserInfo" useGeneratedKeys="true" keyProperty="userId">
136
+    insert into user_info
137
+    <trim prefix="(" suffix=")" suffixOverrides=",">
138
+      <if test="userId != null">
139
+        user_id,
140
+      </if>
141
+      <if test="username != null">
142
+        username,
143
+      </if>
144
+      <if test="password != null">
145
+        password,
146
+      </if>
147
+      <if test="orgId != null">
148
+        org_id,
149
+      </if>
150
+      <if test="realName != null">
151
+        real_name,
152
+      </if>
153
+      <if test="userAlias != null" >
154
+        user_alias,
155
+      </if>
156
+      <if test="sex != null">
157
+        sex,
158
+      </if>
159
+      <if test="telphone != null">
160
+        telphone,
161
+      </if>
162
+      <if test="mobile != null">
163
+        mobile,
164
+      </if>
165
+      <if test="address != null">
166
+        address,
167
+      </if>
168
+      <if test="email != null">
169
+        email,
170
+      </if>
171
+      <if test="qqNumber != null">
172
+        qq_number,
173
+      </if>
174
+      <if test="imgUrl != null">
175
+        img_url,
176
+      </if>
177
+      <if test="signature != null">
178
+        signature,
179
+      </if>
180
+      <if test="createTime != null">
181
+        create_time,
182
+      </if>
183
+      <if test="createUserId != null">
184
+        create_user_id,
185
+      </if>
186
+      <if test="updateTime != null">
187
+        update_time,
188
+      </if>
189
+      <if test="updateUserId != null">
190
+        update_user_id,
191
+      </if>
192
+      <if test="status != null">
193
+        status,
194
+      </if>
195
+      <if test="delFlag != null">
196
+        del_flag,
197
+      </if>
198
+    </trim>
199
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
200
+      <if test="userId != null">
201
+        #{userId,jdbcType=INTEGER},
202
+      </if>
203
+      <if test="username != null">
204
+        #{username,jdbcType=VARCHAR},
205
+      </if>
206
+      <if test="password != null">
207
+        #{password,jdbcType=VARCHAR},
208
+      </if>
209
+      <if test="orgId != null">
210
+        #{orgId,jdbcType=INTEGER},
211
+      </if>
212
+      <if test="realName != null">
213
+        #{realName,jdbcType=VARCHAR},
214
+      </if>
215
+      <if test="userAlias != null" >
216
+        #{userAlias,jdbcType=VARCHAR},
217
+      </if>
218
+      <if test="sex != null">
219
+        #{sex,jdbcType=INTEGER},
220
+      </if>
221
+      <if test="telphone != null">
222
+        #{telphone,jdbcType=VARCHAR},
223
+      </if>
224
+      <if test="mobile != null">
225
+        #{mobile,jdbcType=VARCHAR},
226
+      </if>
227
+      <if test="address != null">
228
+        #{address,jdbcType=VARCHAR},
229
+      </if>
230
+      <if test="email != null">
231
+        #{email,jdbcType=VARCHAR},
232
+      </if>
233
+      <if test="qqNumber != null">
234
+        #{qqNumber,jdbcType=VARCHAR},
235
+      </if>
236
+      <if test="imgUrl != null">
237
+        #{imgUrl,jdbcType=VARCHAR},
238
+      </if>
239
+      <if test="signature != null">
240
+        #{signature,jdbcType=VARCHAR},
241
+      </if>
242
+      <if test="createTime != null">
243
+        #{createTime,jdbcType=TIMESTAMP},
244
+      </if>
245
+      <if test="createUserId != null">
246
+        #{createUserId,jdbcType=INTEGER},
247
+      </if>
248
+      <if test="updateTime != null">
249
+        #{updateTime,jdbcType=TIMESTAMP},
250
+      </if>
251
+      <if test="updateUserId != null">
252
+        #{updateUserId,jdbcType=INTEGER},
253
+      </if>
254
+      <if test="status != null">
255
+        #{status,jdbcType=INTEGER},
256
+      </if>
257
+      <if test="delFlag != null">
258
+        #{delFlag,jdbcType=INTEGER},
259
+      </if>
260
+    </trim>
261
+  </insert>
262
+  <select id="countByExample" parameterType="com.chinaitop.depot.business.model.UserInfoExample" resultType="java.lang.Integer">
263
+    select count(*) from user_info
264
+    <if test="_parameter != null">
265
+      <include refid="Example_Where_Clause" />
266
+    </if>
267
+  </select>
268
+  <update id="updateByExampleSelective" parameterType="map">
269
+    update user_info
270
+    <set>
271
+      <if test="record.userId != null">
272
+        user_id = #{record.userId,jdbcType=INTEGER},
273
+      </if>
274
+      <if test="record.username != null">
275
+        username = #{record.username,jdbcType=VARCHAR},
276
+      </if>
277
+      <if test="record.password != null">
278
+        password = #{record.password,jdbcType=VARCHAR},
279
+      </if>
280
+      <if test="record.orgId != null">
281
+        org_id = #{record.orgId,jdbcType=INTEGER},
282
+      </if>
283
+      <if test="record.realName != null">
284
+        real_name = #{record.realName,jdbcType=VARCHAR},
285
+      </if>
286
+      <if test="record.userAlias != null" >
287
+        user_alias = #{record.userAlias,jdbcType=VARCHAR},
288
+      </if>
289
+      <if test="record.sex != null">
290
+        sex = #{record.sex,jdbcType=INTEGER},
291
+      </if>
292
+      <if test="record.telphone != null">
293
+        telphone = #{record.telphone,jdbcType=VARCHAR},
294
+      </if>
295
+      <if test="record.mobile != null">
296
+        mobile = #{record.mobile,jdbcType=VARCHAR},
297
+      </if>
298
+      <if test="record.address != null">
299
+        address = #{record.address,jdbcType=VARCHAR},
300
+      </if>
301
+      <if test="record.email != null">
302
+        email = #{record.email,jdbcType=VARCHAR},
303
+      </if>
304
+      <if test="record.qqNumber != null">
305
+        qq_number = #{record.qqNumber,jdbcType=VARCHAR},
306
+      </if>
307
+      <if test="record.imgUrl != null">
308
+        img_url = #{record.imgUrl,jdbcType=VARCHAR},
309
+      </if>
310
+      <if test="record.signature != null">
311
+        signature = #{record.signature,jdbcType=VARCHAR},
312
+      </if>
313
+      <if test="record.createTime != null">
314
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
315
+      </if>
316
+      <if test="record.createUserId != null">
317
+        create_user_id = #{record.createUserId,jdbcType=INTEGER},
318
+      </if>
319
+      <if test="record.updateTime != null">
320
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
321
+      </if>
322
+      <if test="record.updateUserId != null">
323
+        update_user_id = #{record.updateUserId,jdbcType=INTEGER},
324
+      </if>
325
+      <if test="record.status != null">
326
+        status = #{record.status,jdbcType=INTEGER},
327
+      </if>
328
+      <if test="record.delFlag != null">
329
+        del_flag = #{record.delFlag,jdbcType=INTEGER},
330
+      </if>
331
+    </set>
332
+    <if test="_parameter != null">
333
+      <include refid="Update_By_Example_Where_Clause" />
334
+    </if>
335
+  </update>
336
+  <update id="updateByExample" parameterType="map">
337
+    update user_info
338
+    set user_id = #{record.userId,jdbcType=INTEGER},
339
+      username = #{record.username,jdbcType=VARCHAR},
340
+      password = #{record.password,jdbcType=VARCHAR},
341
+      org_id = #{record.orgId,jdbcType=INTEGER},
342
+      real_name = #{record.realName,jdbcType=VARCHAR},
343
+      user_alias = #{record.userAlias,jdbcType=VARCHAR},
344
+      sex = #{record.sex,jdbcType=INTEGER},
345
+      telphone = #{record.telphone,jdbcType=VARCHAR},
346
+      mobile = #{record.mobile,jdbcType=VARCHAR},
347
+      address = #{record.address,jdbcType=VARCHAR},
348
+      email = #{record.email,jdbcType=VARCHAR},
349
+      qq_number = #{record.qqNumber,jdbcType=VARCHAR},
350
+      img_url = #{record.imgUrl,jdbcType=VARCHAR},
351
+      signature = #{record.signature,jdbcType=VARCHAR},
352
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
353
+      create_user_id = #{record.createUserId,jdbcType=INTEGER},
354
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
355
+      update_user_id = #{record.updateUserId,jdbcType=INTEGER},
356
+      status = #{record.status,jdbcType=INTEGER},
357
+      del_flag = #{record.delFlag,jdbcType=INTEGER}
358
+    <if test="_parameter != null">
359
+      <include refid="Update_By_Example_Where_Clause" />
360
+    </if>
361
+  </update>
362
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.business.model.UserInfo">
363
+    update user_info
364
+    <set>
365
+      <if test="username != null">
366
+        username = #{username,jdbcType=VARCHAR},
367
+      </if>
368
+      <if test="password != null">
369
+        password = #{password,jdbcType=VARCHAR},
370
+      </if>
371
+      <if test="orgId != null">
372
+        org_id = #{orgId,jdbcType=INTEGER},
373
+      </if>
374
+      <if test="realName != null">
375
+        real_name = #{realName,jdbcType=VARCHAR},
376
+      </if>
377
+      <if test="userAlias != null" >
378
+        user_alias = #{userAlias,jdbcType=VARCHAR},
379
+      </if>
380
+      <if test="sex != null">
381
+        sex = #{sex,jdbcType=INTEGER},
382
+      </if>
383
+      <if test="telphone != null">
384
+        telphone = #{telphone,jdbcType=VARCHAR},
385
+      </if>
386
+      <if test="mobile != null">
387
+        mobile = #{mobile,jdbcType=VARCHAR},
388
+      </if>
389
+      <if test="address != null">
390
+        address = #{address,jdbcType=VARCHAR},
391
+      </if>
392
+      <if test="email != null">
393
+        email = #{email,jdbcType=VARCHAR},
394
+      </if>
395
+      <if test="qqNumber != null">
396
+        qq_number = #{qqNumber,jdbcType=VARCHAR},
397
+      </if>
398
+      <if test="imgUrl != null">
399
+        img_url = #{imgUrl,jdbcType=VARCHAR},
400
+      </if>
401
+      <if test="signature != null">
402
+        signature = #{signature,jdbcType=VARCHAR},
403
+      </if>
404
+      <if test="createTime != null">
405
+        create_time = #{createTime,jdbcType=TIMESTAMP},
406
+      </if>
407
+      <if test="createUserId != null">
408
+        create_user_id = #{createUserId,jdbcType=INTEGER},
409
+      </if>
410
+      <if test="updateTime != null">
411
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
412
+      </if>
413
+      <if test="updateUserId != null">
414
+        update_user_id = #{updateUserId,jdbcType=INTEGER},
415
+      </if>
416
+      <if test="status != null">
417
+        status = #{status,jdbcType=INTEGER},
418
+      </if>
419
+      <if test="delFlag != null">
420
+        del_flag = #{delFlag,jdbcType=INTEGER},
421
+      </if>
422
+    </set>
423
+    where user_id = #{userId,jdbcType=INTEGER}
424
+  </update>
425
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.business.model.UserInfo">
426
+    update user_info
427
+    set username = #{username,jdbcType=VARCHAR},
428
+      password = #{password,jdbcType=VARCHAR},
429
+      org_id = #{orgId,jdbcType=INTEGER},
430
+      real_name = #{realName,jdbcType=VARCHAR},
431
+      user_alias = #{userAlias,jdbcType=VARCHAR},
432
+      sex = #{sex,jdbcType=INTEGER},
433
+      telphone = #{telphone,jdbcType=VARCHAR},
434
+      mobile = #{mobile,jdbcType=VARCHAR},
435
+      address = #{address,jdbcType=VARCHAR},
436
+      email = #{email,jdbcType=VARCHAR},
437
+      qq_number = #{qqNumber,jdbcType=VARCHAR},
438
+      img_url = #{imgUrl,jdbcType=VARCHAR},
439
+      signature = #{signature,jdbcType=VARCHAR},
440
+      create_time = #{createTime,jdbcType=TIMESTAMP},
441
+      create_user_id = #{createUserId,jdbcType=INTEGER},
442
+      update_time = #{updateTime,jdbcType=TIMESTAMP},
443
+      update_user_id = #{updateUserId,jdbcType=INTEGER},
444
+      status = #{status,jdbcType=INTEGER},
445
+      del_flag = #{delFlag,jdbcType=INTEGER}
446
+    where user_id = #{userId,jdbcType=INTEGER}
447
+  </update>
448
+   <resultMap id="UserRoleOrgMap" type="com.chinaitop.depot.business.model.UserInfo">
449
+    <id column="user_id" jdbcType="INTEGER" property="userId" />
450
+    <result column="username" jdbcType="VARCHAR" property="username" />
451
+    <result column="org_name" jdbcType="VARCHAR" property="orgName" />
452
+    <result column="real_name" jdbcType="VARCHAR" property="realName" />
453
+    <result column="telphone" jdbcType="VARCHAR" property="telphone" />
454
+  </resultMap>
455
+  <select id="queryAll" resultMap="UserRoleOrgMap" parameterType="map">
456
+		 SELECT
457
+			ui.user_id,
458
+			ui.real_name,
459
+			ui.username,
460
+			ui.telphone,
461
+			oi.org_name,
462
+			GROUP_CONCAT(ri.role_name)roleNames
463
+		FROM
464
+			user_info ui
465
+		LEFT JOIN user_role ur ON ui.user_id = ur.user_id
466
+		LEFT JOIN role_info ri ON ur.role_id = ri.role_id
467
+		LEFT JOIN org_info oi ON oi.org_id = ui.org_id
468
+		 <where>
469
+				<if test="username!=null">
470
+					and username like '%${username}%'
471
+				</if>
472
+				<if test="realName!=null">
473
+					and real_name like '%${realName}%'
474
+				</if>
475
+				<if test="orgIds!=null">
476
+                 and ui.org_id in
477
+                 <foreach collection="orgIds" index="index" item="item" open="(" separator="," close=")">
478
+                    #{item}
479
+                 </foreach>
480
+               </if>
481
+		</where>
482
+		GROUP BY
483
+			ui.user_id 
484
+  </select>
485
+</mapper>

+ 33 - 0
src/main/java/com/chinaitop/depot/business/mapper/UserRoleMapper.java

@@ -0,0 +1,33 @@
1
+package com.chinaitop.depot.business.mapper;
2
+
3
+import com.chinaitop.depot.business.model.UserRole;
4
+import com.chinaitop.depot.business.model.UserRoleExample;
5
+import org.apache.ibatis.annotations.Param;
6
+
7
+import java.util.List;
8
+
9
+public interface UserRoleMapper {
10
+    int countByExample(UserRoleExample example);
11
+
12
+    int deleteByExample(UserRoleExample example);
13
+
14
+    int deleteByPrimaryKey(Integer urId);
15
+
16
+    int insert(UserRole record);
17
+
18
+    int insertSelective(UserRole record);
19
+
20
+    List<UserRole> selectByExample(UserRoleExample example);
21
+
22
+    UserRole selectByPrimaryKey(Integer urId);
23
+
24
+    int updateByExampleSelective(@Param("record") UserRole record, @Param("example") UserRoleExample example);
25
+
26
+    int updateByExample(@Param("record") UserRole record, @Param("example") UserRoleExample example);
27
+
28
+    int updateByPrimaryKeySelective(UserRole record);
29
+
30
+    int updateByPrimaryKey(UserRole record);
31
+
32
+	void deleteById(Integer userId);
33
+}

+ 184 - 0
src/main/java/com/chinaitop/depot/business/mapper/UserRoleMapper.xml

@@ -0,0 +1,184 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.chinaitop.depot.business.mapper.UserRoleMapper" >
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.business.model.UserRole" >
5
+    <id column="ur_id" property="urId" jdbcType="INTEGER" />
6
+    <result column="user_id" property="userId" jdbcType="INTEGER" />
7
+    <result column="role_id" property="roleId" jdbcType="INTEGER" />
8
+  </resultMap>
9
+  <sql id="Example_Where_Clause" >
10
+    <where >
11
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
12
+        <if test="criteria.valid" >
13
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
14
+            <foreach collection="criteria.criteria" item="criterion" >
15
+              <choose >
16
+                <when test="criterion.noValue" >
17
+                  and ${criterion.condition}
18
+                </when>
19
+                <when test="criterion.singleValue" >
20
+                  and ${criterion.condition} #{criterion.value}
21
+                </when>
22
+                <when test="criterion.betweenValue" >
23
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
24
+                </when>
25
+                <when test="criterion.listValue" >
26
+                  and ${criterion.condition}
27
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
28
+                    #{listItem}
29
+                  </foreach>
30
+                </when>
31
+              </choose>
32
+            </foreach>
33
+          </trim>
34
+        </if>
35
+      </foreach>
36
+    </where>
37
+  </sql>
38
+  <sql id="Update_By_Example_Where_Clause" >
39
+    <where >
40
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
41
+        <if test="criteria.valid" >
42
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
43
+            <foreach collection="criteria.criteria" item="criterion" >
44
+              <choose >
45
+                <when test="criterion.noValue" >
46
+                  and ${criterion.condition}
47
+                </when>
48
+                <when test="criterion.singleValue" >
49
+                  and ${criterion.condition} #{criterion.value}
50
+                </when>
51
+                <when test="criterion.betweenValue" >
52
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
53
+                </when>
54
+                <when test="criterion.listValue" >
55
+                  and ${criterion.condition}
56
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
57
+                    #{listItem}
58
+                  </foreach>
59
+                </when>
60
+              </choose>
61
+            </foreach>
62
+          </trim>
63
+        </if>
64
+      </foreach>
65
+    </where>
66
+  </sql>
67
+  <sql id="Base_Column_List" >
68
+    ur_id, user_id, role_id
69
+  </sql>
70
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.business.model.UserRoleExample" >
71
+    select
72
+    <if test="distinct" >
73
+      distinct
74
+    </if>
75
+    <include refid="Base_Column_List" />
76
+    from user_role
77
+    <if test="_parameter != null" >
78
+      <include refid="Example_Where_Clause" />
79
+    </if>
80
+    <if test="orderByClause != null" >
81
+      order by ${orderByClause}
82
+    </if>
83
+  </select>
84
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
85
+    select 
86
+    <include refid="Base_Column_List" />
87
+    from user_role
88
+    where ur_id = #{urId,jdbcType=INTEGER}
89
+  </select>
90
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
91
+    delete from user_role
92
+    where ur_id = #{urId,jdbcType=INTEGER}
93
+  </delete>
94
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.business.model.UserRoleExample" >
95
+    delete from user_role
96
+    <if test="_parameter != null" >
97
+      <include refid="Example_Where_Clause" />
98
+    </if>
99
+  </delete>
100
+  <insert id="insert" parameterType="com.chinaitop.depot.business.model.UserRole">
101
+    insert into user_role (ur_id, user_id, role_id
102
+      )
103
+    values (#{urId,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{roleId,jdbcType=INTEGER}
104
+      )
105
+  </insert>
106
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.business.model.UserRole" >
107
+    insert into user_role
108
+    <trim prefix="(" suffix=")" suffixOverrides="," >
109
+      <if test="urId != null" >
110
+        ur_id,
111
+      </if>
112
+      <if test="userId != null" >
113
+        user_id,
114
+      </if>
115
+      <if test="roleId != null" >
116
+        role_id,
117
+      </if>
118
+    </trim>
119
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
120
+      <if test="urId != null" >
121
+        #{urId,jdbcType=INTEGER},
122
+      </if>
123
+      <if test="userId != null" >
124
+        #{userId,jdbcType=INTEGER},
125
+      </if>
126
+      <if test="roleId != null" >
127
+        #{roleId,jdbcType=INTEGER},
128
+      </if>
129
+    </trim>
130
+  </insert>
131
+  <select id="countByExample" parameterType="com.chinaitop.depot.business.model.UserRoleExample" resultType="java.lang.Integer" >
132
+    select count(*) from user_role
133
+    <if test="_parameter != null" >
134
+      <include refid="Example_Where_Clause" />
135
+    </if>
136
+  </select>
137
+  <update id="updateByExampleSelective" parameterType="map" >
138
+    update user_role
139
+    <set >
140
+      <if test="record.urId != null" >
141
+        ur_id = #{record.urId,jdbcType=INTEGER},
142
+      </if>
143
+      <if test="record.userId != null" >
144
+        user_id = #{record.userId,jdbcType=INTEGER},
145
+      </if>
146
+      <if test="record.roleId != null" >
147
+        role_id = #{record.roleId,jdbcType=INTEGER},
148
+      </if>
149
+    </set>
150
+    <if test="_parameter != null" >
151
+      <include refid="Update_By_Example_Where_Clause" />
152
+    </if>
153
+  </update>
154
+  <update id="updateByExample" parameterType="map" >
155
+    update user_role
156
+    set ur_id = #{record.urId,jdbcType=INTEGER},
157
+      user_id = #{record.userId,jdbcType=INTEGER},
158
+      role_id = #{record.roleId,jdbcType=INTEGER}
159
+    <if test="_parameter != null" >
160
+      <include refid="Update_By_Example_Where_Clause" />
161
+    </if>
162
+  </update>
163
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.business.model.UserRole" >
164
+    update user_role
165
+    <set >
166
+      <if test="userId != null" >
167
+        user_id = #{userId,jdbcType=INTEGER},
168
+      </if>
169
+      <if test="roleId != null" >
170
+        role_id = #{roleId,jdbcType=INTEGER},
171
+      </if>
172
+    </set>
173
+    where ur_id = #{urId,jdbcType=INTEGER}
174
+  </update>
175
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.business.model.UserRole" >
176
+    update user_role
177
+    set user_id = #{userId,jdbcType=INTEGER},
178
+      role_id = #{roleId,jdbcType=INTEGER}
179
+    where ur_id = #{urId,jdbcType=INTEGER}
180
+  </update>
181
+  <delete id="deleteById" parameterType="java.lang.Integer">
182
+  	delete from user_role where user_id=#{userId};
183
+  </delete>
184
+</mapper>

+ 559 - 0
src/main/java/com/chinaitop/depot/business/model/BusinessApproval.java

@@ -0,0 +1,559 @@
1
+package com.chinaitop.depot.business.model;
2
+
3
+import java.util.Date;
4
+
5
+public class BusinessApproval {
6
+    private Integer id;
7
+
8
+    private Date createTime;
9
+
10
+    private Integer isDeleted;
11
+
12
+    private String remark;
13
+
14
+    private Date updateTime;
15
+
16
+    private String content;
17
+
18
+    private String fromDepartment;
19
+
20
+    private String fromPeople;
21
+
22
+    private String fromUserName;
23
+
24
+    private String lastPeople;
25
+
26
+    private String operateTime;
27
+
28
+    private String operator;
29
+
30
+    private String operatorName;
31
+
32
+    private String processInstanceId;
33
+
34
+    private Integer projectId;
35
+
36
+    private String projectName;
37
+
38
+    private String result;
39
+
40
+    private String taskId;
41
+
42
+    private String taskInfo;
43
+
44
+    private String taskName;
45
+
46
+    private String taskType;
47
+
48
+    private String title;
49
+
50
+    private Integer version;
51
+
52
+    private String taskTypeName;
53
+
54
+    private Integer isHide;
55
+
56
+    private Integer isCountersign;
57
+
58
+    private String applyName;
59
+
60
+    private String applyNameId;
61
+
62
+    private Date applyTime;
63
+
64
+    // 药剂采购主键id
65
+    private Integer dpId;
66
+    private Integer auditState;
67
+    // 药剂申请主键id
68
+    private Integer duId;
69
+    private String state;
70
+
71
+    public Integer getDpId() {
72
+        return dpId;
73
+    }
74
+    public void setDpId(Integer dpId) {
75
+        this.dpId = dpId;
76
+    }
77
+    public Integer getDuId() {
78
+        return duId;
79
+    }
80
+    public void setDuId(Integer duId) {
81
+        this.duId = duId;
82
+    }
83
+    public Integer getAuditState() {
84
+        return auditState;
85
+    }
86
+    public void setAuditState(Integer auditState) {
87
+        this.auditState = auditState;
88
+    }
89
+    public String getState() {
90
+        return state;
91
+    }
92
+    public void setState(String state) {
93
+        this.state = state;
94
+    }
95
+
96
+    /**
97
+     * 
98
+     * @return id 
99
+     */
100
+    public Integer getId() {
101
+        return id;
102
+    }
103
+
104
+    /**
105
+     * 
106
+     * @param id 
107
+     */
108
+    public void setId(Integer id) {
109
+        this.id = id;
110
+    }
111
+
112
+    /**
113
+     * 中间表创建时间
114
+     * @return create_time 中间表创建时间
115
+     */
116
+    public Date getCreateTime() {
117
+        return createTime;
118
+    }
119
+
120
+    /**
121
+     * 中间表创建时间
122
+     * @param createTime 中间表创建时间
123
+     */
124
+    public void setCreateTime(Date createTime) {
125
+        this.createTime = createTime;
126
+    }
127
+
128
+    /**
129
+     * 
130
+     * @return is_deleted 
131
+     */
132
+    public Integer getIsDeleted() {
133
+        return isDeleted;
134
+    }
135
+
136
+    /**
137
+     * 
138
+     * @param isDeleted 
139
+     */
140
+    public void setIsDeleted(Integer isDeleted) {
141
+        this.isDeleted = isDeleted;
142
+    }
143
+
144
+    /**
145
+     * 
146
+     * @return remark 
147
+     */
148
+    public String getRemark() {
149
+        return remark;
150
+    }
151
+
152
+    /**
153
+     * 
154
+     * @param remark 
155
+     */
156
+    public void setRemark(String remark) {
157
+        this.remark = remark == null ? null : remark.trim();
158
+    }
159
+
160
+    /**
161
+     * 
162
+     * @return update_time 
163
+     */
164
+    public Date getUpdateTime() {
165
+        return updateTime;
166
+    }
167
+
168
+    /**
169
+     * 
170
+     * @param updateTime 
171
+     */
172
+    public void setUpdateTime(Date updateTime) {
173
+        this.updateTime = updateTime;
174
+    }
175
+
176
+    /**
177
+     * 
178
+     * @return content 
179
+     */
180
+    public String getContent() {
181
+        return content;
182
+    }
183
+
184
+    /**
185
+     * 
186
+     * @param content 
187
+     */
188
+    public void setContent(String content) {
189
+        this.content = content == null ? null : content.trim();
190
+    }
191
+
192
+    /**
193
+     * 
194
+     * @return from_department 
195
+     */
196
+    public String getFromDepartment() {
197
+        return fromDepartment;
198
+    }
199
+
200
+    /**
201
+     * 
202
+     * @param fromDepartment 
203
+     */
204
+    public void setFromDepartment(String fromDepartment) {
205
+        this.fromDepartment = fromDepartment == null ? null : fromDepartment.trim();
206
+    }
207
+
208
+    /**
209
+     * 
210
+     * @return from_people 
211
+     */
212
+    public String getFromPeople() {
213
+        return fromPeople;
214
+    }
215
+
216
+    /**
217
+     * 
218
+     * @param fromPeople 
219
+     */
220
+    public void setFromPeople(String fromPeople) {
221
+        this.fromPeople = fromPeople == null ? null : fromPeople.trim();
222
+    }
223
+
224
+    /**
225
+     * 
226
+     * @return from_user_name 
227
+     */
228
+    public String getFromUserName() {
229
+        return fromUserName;
230
+    }
231
+
232
+    /**
233
+     * 
234
+     * @param fromUserName 
235
+     */
236
+    public void setFromUserName(String fromUserName) {
237
+        this.fromUserName = fromUserName == null ? null : fromUserName.trim();
238
+    }
239
+
240
+    /**
241
+     * 
242
+     * @return last_people 
243
+     */
244
+    public String getLastPeople() {
245
+        return lastPeople;
246
+    }
247
+
248
+    /**
249
+     * 
250
+     * @param lastPeople 
251
+     */
252
+    public void setLastPeople(String lastPeople) {
253
+        this.lastPeople = lastPeople == null ? null : lastPeople.trim();
254
+    }
255
+
256
+    /**
257
+     * 
258
+     * @return operate_time 
259
+     */
260
+    public String getOperateTime() {
261
+        return operateTime;
262
+    }
263
+
264
+    /**
265
+     * 
266
+     * @param operateTime 
267
+     */
268
+    public void setOperateTime(String operateTime) {
269
+        this.operateTime = operateTime == null ? null : operateTime.trim();
270
+    }
271
+
272
+    /**
273
+     * 
274
+     * @return operator 
275
+     */
276
+    public String getOperator() {
277
+        return operator;
278
+    }
279
+
280
+    /**
281
+     * 
282
+     * @param operator 
283
+     */
284
+    public void setOperator(String operator) {
285
+        this.operator = operator == null ? null : operator.trim();
286
+    }
287
+
288
+    /**
289
+     * 
290
+     * @return operator_name 
291
+     */
292
+    public String getOperatorName() {
293
+        return operatorName;
294
+    }
295
+
296
+    /**
297
+     * 
298
+     * @param operatorName 
299
+     */
300
+    public void setOperatorName(String operatorName) {
301
+        this.operatorName = operatorName == null ? null : operatorName.trim();
302
+    }
303
+
304
+    /**
305
+     * 
306
+     * @return process_instance_id 
307
+     */
308
+    public String getProcessInstanceId() {
309
+        return processInstanceId;
310
+    }
311
+
312
+    /**
313
+     * 
314
+     * @param processInstanceId 
315
+     */
316
+    public void setProcessInstanceId(String processInstanceId) {
317
+        this.processInstanceId = processInstanceId == null ? null : processInstanceId.trim();
318
+    }
319
+
320
+    /**
321
+     * 
322
+     * @return project_id 
323
+     */
324
+    public Integer getProjectId() {
325
+        return projectId;
326
+    }
327
+
328
+    /**
329
+     * 
330
+     * @param projectId 
331
+     */
332
+    public void setProjectId(Integer projectId) {
333
+        this.projectId = projectId;
334
+    }
335
+
336
+    /**
337
+     * 
338
+     * @return project_name 
339
+     */
340
+    public String getProjectName() {
341
+        return projectName;
342
+    }
343
+
344
+    /**
345
+     * 
346
+     * @param projectName 
347
+     */
348
+    public void setProjectName(String projectName) {
349
+        this.projectName = projectName == null ? null : projectName.trim();
350
+    }
351
+
352
+    /**
353
+     * 
354
+     * @return result 
355
+     */
356
+    public String getResult() {
357
+        return result;
358
+    }
359
+
360
+    /**
361
+     * 
362
+     * @param result 
363
+     */
364
+    public void setResult(String result) {
365
+        this.result = result == null ? null : result.trim();
366
+    }
367
+
368
+    /**
369
+     * 
370
+     * @return task_id 
371
+     */
372
+    public String getTaskId() {
373
+        return taskId;
374
+    }
375
+
376
+    /**
377
+     * 
378
+     * @param taskId 
379
+     */
380
+    public void setTaskId(String taskId) {
381
+        this.taskId = taskId == null ? null : taskId.trim();
382
+    }
383
+
384
+    /**
385
+     * 
386
+     * @return task_info 
387
+     */
388
+    public String getTaskInfo() {
389
+        return taskInfo;
390
+    }
391
+
392
+    /**
393
+     * 
394
+     * @param taskInfo 
395
+     */
396
+    public void setTaskInfo(String taskInfo) {
397
+        this.taskInfo = taskInfo == null ? null : taskInfo.trim();
398
+    }
399
+
400
+    /**
401
+     * 
402
+     * @return task_name 
403
+     */
404
+    public String getTaskName() {
405
+        return taskName;
406
+    }
407
+
408
+    /**
409
+     * 
410
+     * @param taskName 
411
+     */
412
+    public void setTaskName(String taskName) {
413
+        this.taskName = taskName == null ? null : taskName.trim();
414
+    }
415
+
416
+    /**
417
+     * 
418
+     * @return task_type 
419
+     */
420
+    public String getTaskType() {
421
+        return taskType;
422
+    }
423
+
424
+    /**
425
+     * 
426
+     * @param taskType 
427
+     */
428
+    public void setTaskType(String taskType) {
429
+        this.taskType = taskType == null ? null : taskType.trim();
430
+    }
431
+
432
+    /**
433
+     * 
434
+     * @return title 
435
+     */
436
+    public String getTitle() {
437
+        return title;
438
+    }
439
+
440
+    /**
441
+     * 
442
+     * @param title 
443
+     */
444
+    public void setTitle(String title) {
445
+        this.title = title == null ? null : title.trim();
446
+    }
447
+
448
+    /**
449
+     * 
450
+     * @return version 
451
+     */
452
+    public Integer getVersion() {
453
+        return version;
454
+    }
455
+
456
+    /**
457
+     * 
458
+     * @param version 
459
+     */
460
+    public void setVersion(Integer version) {
461
+        this.version = version;
462
+    }
463
+
464
+    /**
465
+     * 
466
+     * @return task_type_name 
467
+     */
468
+    public String getTaskTypeName() {
469
+        return taskTypeName;
470
+    }
471
+
472
+    /**
473
+     * 
474
+     * @param taskTypeName 
475
+     */
476
+    public void setTaskTypeName(String taskTypeName) {
477
+        this.taskTypeName = taskTypeName == null ? null : taskTypeName.trim();
478
+    }
479
+
480
+    /**
481
+     * 是否隐藏
482
+     * @return is_hide 是否隐藏
483
+     */
484
+    public Integer getIsHide() {
485
+        return isHide;
486
+    }
487
+
488
+    /**
489
+     * 是否隐藏
490
+     * @param isHide 是否隐藏
491
+     */
492
+    public void setIsHide(Integer isHide) {
493
+        this.isHide = isHide;
494
+    }
495
+
496
+    /**
497
+     * 
498
+     * @return is_countersign 
499
+     */
500
+    public Integer getIsCountersign() {
501
+        return isCountersign;
502
+    }
503
+
504
+    /**
505
+     * 
506
+     * @param isCountersign 
507
+     */
508
+    public void setIsCountersign(Integer isCountersign) {
509
+        this.isCountersign = isCountersign;
510
+    }
511
+
512
+    /**
513
+     * 申请人
514
+     * @return apply_name 申请人
515
+     */
516
+    public String getApplyName() {
517
+        return applyName;
518
+    }
519
+
520
+    /**
521
+     * 申请人
522
+     * @param applyName 申请人
523
+     */
524
+    public void setApplyName(String applyName) {
525
+        this.applyName = applyName == null ? null : applyName.trim();
526
+    }
527
+
528
+    /**
529
+     * 申请人id
530
+     * @return apply_name_id 申请人id
531
+     */
532
+    public String getApplyNameId() {
533
+        return applyNameId;
534
+    }
535
+
536
+    /**
537
+     * 申请人id
538
+     * @param applyNameId 申请人id
539
+     */
540
+    public void setApplyNameId(String applyNameId) {
541
+        this.applyNameId = applyNameId == null ? null : applyNameId.trim();
542
+    }
543
+
544
+    /**
545
+     * 申请时间
546
+     * @return apply_time 申请时间
547
+     */
548
+    public Date getApplyTime() {
549
+        return applyTime;
550
+    }
551
+
552
+    /**
553
+     * 申请时间
554
+     * @param applyTime 申请时间
555
+     */
556
+    public void setApplyTime(Date applyTime) {
557
+        this.applyTime = applyTime;
558
+    }
559
+}

File diff suppressed because it is too large
+ 2159 - 0
src/main/java/com/chinaitop/depot/business/model/BusinessApprovalExample.java


+ 923 - 0
src/main/java/com/chinaitop/depot/business/model/BusinessContract.java

@@ -0,0 +1,923 @@
1
+package com.chinaitop.depot.business.model;
2
+
3
+import java.util.Date;
4
+
5
+public class BusinessContract {
6
+    private Integer id;
7
+
8
+    private String contractNumber;
9
+
10
+    private String contractTitle;
11
+
12
+    private String customerId;
13
+
14
+    private Integer customerBid;
15
+
16
+    private String customerNumber;
17
+
18
+    private String customerName;
19
+
20
+    private String grainQuantity;
21
+
22
+    private String moneyQuantity;
23
+
24
+    private String signingMan;
25
+
26
+    private Date signingTime;
27
+
28
+    private Date enableDate;
29
+
30
+    private Date disableDate;
31
+
32
+    private Integer contractType;
33
+
34
+    private String originalContract;
35
+
36
+    private Integer originalContractBid;
37
+
38
+    private Integer rootContractBid;
39
+
40
+    private Integer shippingType;
41
+
42
+    private Integer contractPayType;
43
+
44
+    private String finishedQuantity;
45
+
46
+    private String moneyOfFinishedQuantity;
47
+
48
+    private String remark;
49
+
50
+    private String plantAcreage;
51
+
52
+    private String planNumber;
53
+
54
+    private String mobile;
55
+
56
+    private String bankName;
57
+
58
+    private String accountName;
59
+
60
+    private String accountNumber;
61
+
62
+    private String breachLiability;
63
+
64
+    private String dissolutionConditions;
65
+
66
+    private String disputeSettlementMethod;
67
+
68
+    private String changeRecordFlag;
69
+
70
+    private String changeReason;
71
+
72
+    private Date changeTime;
73
+
74
+    private String changeContent;
75
+
76
+    private String changing;
77
+
78
+    private Integer planBid;
79
+
80
+    private String auditState;
81
+
82
+    private String processInstanceId;
83
+
84
+    private String processDefinitionId;
85
+
86
+    private Date agreeTime;
87
+
88
+    private String createMan;
89
+
90
+    private String creater;
91
+
92
+    private Date createTime;
93
+
94
+    private String createUnit;
95
+
96
+    private String createDepot;
97
+
98
+    private Date updateTime;
99
+
100
+    private Integer orgId;
101
+
102
+    private Integer inApplication;
103
+
104
+    private Integer createrId;
105
+
106
+    private String identification;
107
+
108
+    /**
109
+     * 
110
+     * @return id 
111
+     */
112
+    public Integer getId() {
113
+        return id;
114
+    }
115
+
116
+    /**
117
+     * 
118
+     * @param id 
119
+     */
120
+    public void setId(Integer id) {
121
+        this.id = id;
122
+    }
123
+
124
+    /**
125
+     * 合同编号
126
+     * @return contract_number 合同编号
127
+     */
128
+    public String getContractNumber() {
129
+        return contractNumber;
130
+    }
131
+
132
+    /**
133
+     * 合同编号
134
+     * @param contractNumber 合同编号
135
+     */
136
+    public void setContractNumber(String contractNumber) {
137
+        this.contractNumber = contractNumber == null ? null : contractNumber.trim();
138
+    }
139
+
140
+    /**
141
+     * 合同名称
142
+     * @return contract_title 合同名称
143
+     */
144
+    public String getContractTitle() {
145
+        return contractTitle;
146
+    }
147
+
148
+    /**
149
+     * 合同名称
150
+     * @param contractTitle 合同名称
151
+     */
152
+    public void setContractTitle(String contractTitle) {
153
+        this.contractTitle = contractTitle == null ? null : contractTitle.trim();
154
+    }
155
+
156
+    /**
157
+     * 合同客户编号
158
+     * @return customer_id 合同客户编号
159
+     */
160
+    public String getCustomerId() {
161
+        return customerId;
162
+    }
163
+
164
+    /**
165
+     * 合同客户编号
166
+     * @param customerId 合同客户编号
167
+     */
168
+    public void setCustomerId(String customerId) {
169
+        this.customerId = customerId == null ? null : customerId.trim();
170
+    }
171
+
172
+    /**
173
+     * 客户id
174
+     * @return customer_bid 客户id
175
+     */
176
+    public Integer getCustomerBid() {
177
+        return customerBid;
178
+    }
179
+
180
+    /**
181
+     * 客户id
182
+     * @param customerBid 客户id
183
+     */
184
+    public void setCustomerBid(Integer customerBid) {
185
+        this.customerBid = customerBid;
186
+    }
187
+
188
+    /**
189
+     * 客户编号
190
+     * @return customer_number 客户编号
191
+     */
192
+    public String getCustomerNumber() {
193
+        return customerNumber;
194
+    }
195
+
196
+    /**
197
+     * 客户编号
198
+     * @param customerNumber 客户编号
199
+     */
200
+    public void setCustomerNumber(String customerNumber) {
201
+        this.customerNumber = customerNumber == null ? null : customerNumber.trim();
202
+    }
203
+
204
+    /**
205
+     * 合同客户名称
206
+     * @return customer_name 合同客户名称
207
+     */
208
+    public String getCustomerName() {
209
+        return customerName;
210
+    }
211
+
212
+    /**
213
+     * 合同客户名称
214
+     * @param customerName 合同客户名称
215
+     */
216
+    public void setCustomerName(String customerName) {
217
+        this.customerName = customerName == null ? null : customerName.trim();
218
+    }
219
+
220
+    /**
221
+     * 合同粮食数量(吨)
222
+     * @return grain_quantity 合同粮食数量(吨)
223
+     */
224
+    public String getGrainQuantity() {
225
+        return grainQuantity;
226
+    }
227
+
228
+    /**
229
+     * 合同粮食数量(吨)
230
+     * @param grainQuantity 合同粮食数量(吨)
231
+     */
232
+    public void setGrainQuantity(String grainQuantity) {
233
+        this.grainQuantity = grainQuantity == null ? null : grainQuantity.trim();
234
+    }
235
+
236
+    /**
237
+     * 总金额(元)
238
+     * @return money_quantity 总金额(元)
239
+     */
240
+    public String getMoneyQuantity() {
241
+        return moneyQuantity;
242
+    }
243
+
244
+    /**
245
+     * 总金额(元)
246
+     * @param moneyQuantity 总金额(元)
247
+     */
248
+    public void setMoneyQuantity(String moneyQuantity) {
249
+        this.moneyQuantity = moneyQuantity == null ? null : moneyQuantity.trim();
250
+    }
251
+
252
+    /**
253
+     * 合同签订人
254
+     * @return signing_man 合同签订人
255
+     */
256
+    public String getSigningMan() {
257
+        return signingMan;
258
+    }
259
+
260
+    /**
261
+     * 合同签订人
262
+     * @param signingMan 合同签订人
263
+     */
264
+    public void setSigningMan(String signingMan) {
265
+        this.signingMan = signingMan == null ? null : signingMan.trim();
266
+    }
267
+
268
+    /**
269
+     * 合同签订时间
270
+     * @return signing_time 合同签订时间
271
+     */
272
+    public Date getSigningTime() {
273
+        return signingTime;
274
+    }
275
+
276
+    /**
277
+     * 合同签订时间
278
+     * @param signingTime 合同签订时间
279
+     */
280
+    public void setSigningTime(Date signingTime) {
281
+        this.signingTime = signingTime;
282
+    }
283
+
284
+    /**
285
+     * 合同生效日期
286
+     * @return enable_date 合同生效日期
287
+     */
288
+    public Date getEnableDate() {
289
+        return enableDate;
290
+    }
291
+
292
+    /**
293
+     * 合同生效日期
294
+     * @param enableDate 合同生效日期
295
+     */
296
+    public void setEnableDate(Date enableDate) {
297
+        this.enableDate = enableDate;
298
+    }
299
+
300
+    /**
301
+     * 合同截止日期
302
+     * @return disable_date 合同截止日期
303
+     */
304
+    public Date getDisableDate() {
305
+        return disableDate;
306
+    }
307
+
308
+    /**
309
+     * 合同截止日期
310
+     * @param disableDate 合同截止日期
311
+     */
312
+    public void setDisableDate(Date disableDate) {
313
+        this.disableDate = disableDate;
314
+    }
315
+
316
+    /**
317
+     * 合同类型
318
+     * @return contract_type 合同类型
319
+     */
320
+    public Integer getContractType() {
321
+        return contractType;
322
+    }
323
+
324
+    /**
325
+     * 合同类型
326
+     * @param contractType 合同类型
327
+     */
328
+    public void setContractType(Integer contractType) {
329
+        this.contractType = contractType;
330
+    }
331
+
332
+    /**
333
+     * 原合同编号
334
+     * @return original_contract 原合同编号
335
+     */
336
+    public String getOriginalContract() {
337
+        return originalContract;
338
+    }
339
+
340
+    /**
341
+     * 原合同编号
342
+     * @param originalContract 原合同编号
343
+     */
344
+    public void setOriginalContract(String originalContract) {
345
+        this.originalContract = originalContract == null ? null : originalContract.trim();
346
+    }
347
+
348
+    /**
349
+     * 原合同id
350
+     * @return original_contract_bid 原合同id
351
+     */
352
+    public Integer getOriginalContractBid() {
353
+        return originalContractBid;
354
+    }
355
+
356
+    /**
357
+     * 原合同id
358
+     * @param originalContractBid 原合同id
359
+     */
360
+    public void setOriginalContractBid(Integer originalContractBid) {
361
+        this.originalContractBid = originalContractBid;
362
+    }
363
+
364
+    /**
365
+     * 起始合同id
366
+     * @return root_contract_bid 起始合同id
367
+     */
368
+    public Integer getRootContractBid() {
369
+        return rootContractBid;
370
+    }
371
+
372
+    /**
373
+     * 起始合同id
374
+     * @param rootContractBid 起始合同id
375
+     */
376
+    public void setRootContractBid(Integer rootContractBid) {
377
+        this.rootContractBid = rootContractBid;
378
+    }
379
+
380
+    /**
381
+     * 运输方式
382
+     * @return shipping_type 运输方式
383
+     */
384
+    public Integer getShippingType() {
385
+        return shippingType;
386
+    }
387
+
388
+    /**
389
+     * 运输方式
390
+     * @param shippingType 运输方式
391
+     */
392
+    public void setShippingType(Integer shippingType) {
393
+        this.shippingType = shippingType;
394
+    }
395
+
396
+    /**
397
+     * 支付方式
398
+     * @return contract_pay_type 支付方式
399
+     */
400
+    public Integer getContractPayType() {
401
+        return contractPayType;
402
+    }
403
+
404
+    /**
405
+     * 支付方式
406
+     * @param contractPayType 支付方式
407
+     */
408
+    public void setContractPayType(Integer contractPayType) {
409
+        this.contractPayType = contractPayType;
410
+    }
411
+
412
+    /**
413
+     * 已完成数量
414
+     * @return finished_quantity 已完成数量
415
+     */
416
+    public String getFinishedQuantity() {
417
+        return finishedQuantity;
418
+    }
419
+
420
+    /**
421
+     * 已完成数量
422
+     * @param finishedQuantity 已完成数量
423
+     */
424
+    public void setFinishedQuantity(String finishedQuantity) {
425
+        this.finishedQuantity = finishedQuantity == null ? null : finishedQuantity.trim();
426
+    }
427
+
428
+    /**
429
+     * 已完成数量金额
430
+     * @return money_of_finished_quantity 已完成数量金额
431
+     */
432
+    public String getMoneyOfFinishedQuantity() {
433
+        return moneyOfFinishedQuantity;
434
+    }
435
+
436
+    /**
437
+     * 已完成数量金额
438
+     * @param moneyOfFinishedQuantity 已完成数量金额
439
+     */
440
+    public void setMoneyOfFinishedQuantity(String moneyOfFinishedQuantity) {
441
+        this.moneyOfFinishedQuantity = moneyOfFinishedQuantity == null ? null : moneyOfFinishedQuantity.trim();
442
+    }
443
+
444
+    /**
445
+     * 合同备注
446
+     * @return remark 合同备注
447
+     */
448
+    public String getRemark() {
449
+        return remark;
450
+    }
451
+
452
+    /**
453
+     * 合同备注
454
+     * @param remark 合同备注
455
+     */
456
+    public void setRemark(String remark) {
457
+        this.remark = remark == null ? null : remark.trim();
458
+    }
459
+
460
+    /**
461
+     * 客户种粮面积(亩)
462
+     * @return plant_acreage 客户种粮面积(亩)
463
+     */
464
+    public String getPlantAcreage() {
465
+        return plantAcreage;
466
+    }
467
+
468
+    /**
469
+     * 客户种粮面积(亩)
470
+     * @param plantAcreage 客户种粮面积(亩)
471
+     */
472
+    public void setPlantAcreage(String plantAcreage) {
473
+        this.plantAcreage = plantAcreage == null ? null : plantAcreage.trim();
474
+    }
475
+
476
+    /**
477
+     * 计划编号
478
+     * @return plan_number 计划编号
479
+     */
480
+    public String getPlanNumber() {
481
+        return planNumber;
482
+    }
483
+
484
+    /**
485
+     * 计划编号
486
+     * @param planNumber 计划编号
487
+     */
488
+    public void setPlanNumber(String planNumber) {
489
+        this.planNumber = planNumber == null ? null : planNumber.trim();
490
+    }
491
+
492
+    /**
493
+     * 客户联系方式
494
+     * @return mobile 客户联系方式
495
+     */
496
+    public String getMobile() {
497
+        return mobile;
498
+    }
499
+
500
+    /**
501
+     * 客户联系方式
502
+     * @param mobile 客户联系方式
503
+     */
504
+    public void setMobile(String mobile) {
505
+        this.mobile = mobile == null ? null : mobile.trim();
506
+    }
507
+
508
+    /**
509
+     * 开户行名称
510
+     * @return bank_name 开户行名称
511
+     */
512
+    public String getBankName() {
513
+        return bankName;
514
+    }
515
+
516
+    /**
517
+     * 开户行名称
518
+     * @param bankName 开户行名称
519
+     */
520
+    public void setBankName(String bankName) {
521
+        this.bankName = bankName == null ? null : bankName.trim();
522
+    }
523
+
524
+    /**
525
+     * 银行账户名称
526
+     * @return account_name 银行账户名称
527
+     */
528
+    public String getAccountName() {
529
+        return accountName;
530
+    }
531
+
532
+    /**
533
+     * 银行账户名称
534
+     * @param accountName 银行账户名称
535
+     */
536
+    public void setAccountName(String accountName) {
537
+        this.accountName = accountName == null ? null : accountName.trim();
538
+    }
539
+
540
+    /**
541
+     * 开户账号
542
+     * @return account_number 开户账号
543
+     */
544
+    public String getAccountNumber() {
545
+        return accountNumber;
546
+    }
547
+
548
+    /**
549
+     * 开户账号
550
+     * @param accountNumber 开户账号
551
+     */
552
+    public void setAccountNumber(String accountNumber) {
553
+        this.accountNumber = accountNumber == null ? null : accountNumber.trim();
554
+    }
555
+
556
+    /**
557
+     * 违约责任
558
+     * @return breach_liability 违约责任
559
+     */
560
+    public String getBreachLiability() {
561
+        return breachLiability;
562
+    }
563
+
564
+    /**
565
+     * 违约责任
566
+     * @param breachLiability 违约责任
567
+     */
568
+    public void setBreachLiability(String breachLiability) {
569
+        this.breachLiability = breachLiability == null ? null : breachLiability.trim();
570
+    }
571
+
572
+    /**
573
+     * 解除条件
574
+     * @return dissolution_conditions 解除条件
575
+     */
576
+    public String getDissolutionConditions() {
577
+        return dissolutionConditions;
578
+    }
579
+
580
+    /**
581
+     * 解除条件
582
+     * @param dissolutionConditions 解除条件
583
+     */
584
+    public void setDissolutionConditions(String dissolutionConditions) {
585
+        this.dissolutionConditions = dissolutionConditions == null ? null : dissolutionConditions.trim();
586
+    }
587
+
588
+    /**
589
+     * 争议解决方式
590
+     * @return dispute_settlement_method 争议解决方式
591
+     */
592
+    public String getDisputeSettlementMethod() {
593
+        return disputeSettlementMethod;
594
+    }
595
+
596
+    /**
597
+     * 争议解决方式
598
+     * @param disputeSettlementMethod 争议解决方式
599
+     */
600
+    public void setDisputeSettlementMethod(String disputeSettlementMethod) {
601
+        this.disputeSettlementMethod = disputeSettlementMethod == null ? null : disputeSettlementMethod.trim();
602
+    }
603
+
604
+    /**
605
+     * 合同的变更记录标志
606
+     * @return change_record_flag 合同的变更记录标志
607
+     */
608
+    public String getChangeRecordFlag() {
609
+        return changeRecordFlag;
610
+    }
611
+
612
+    /**
613
+     * 合同的变更记录标志
614
+     * @param changeRecordFlag 合同的变更记录标志
615
+     */
616
+    public void setChangeRecordFlag(String changeRecordFlag) {
617
+        this.changeRecordFlag = changeRecordFlag == null ? null : changeRecordFlag.trim();
618
+    }
619
+
620
+    /**
621
+     * 合同变更原因
622
+     * @return change_reason 合同变更原因
623
+     */
624
+    public String getChangeReason() {
625
+        return changeReason;
626
+    }
627
+
628
+    /**
629
+     * 合同变更原因
630
+     * @param changeReason 合同变更原因
631
+     */
632
+    public void setChangeReason(String changeReason) {
633
+        this.changeReason = changeReason == null ? null : changeReason.trim();
634
+    }
635
+
636
+    /**
637
+     * 变更时间
638
+     * @return change_time 变更时间
639
+     */
640
+    public Date getChangeTime() {
641
+        return changeTime;
642
+    }
643
+
644
+    /**
645
+     * 变更时间
646
+     * @param changeTime 变更时间
647
+     */
648
+    public void setChangeTime(Date changeTime) {
649
+        this.changeTime = changeTime;
650
+    }
651
+
652
+    /**
653
+     * 变更内容
654
+     * @return change_content 变更内容
655
+     */
656
+    public String getChangeContent() {
657
+        return changeContent;
658
+    }
659
+
660
+    /**
661
+     * 变更内容
662
+     * @param changeContent 变更内容
663
+     */
664
+    public void setChangeContent(String changeContent) {
665
+        this.changeContent = changeContent == null ? null : changeContent.trim();
666
+    }
667
+
668
+    /**
669
+     * 是否在被变更中(0否;1是;2变更成功)
670
+     * @return changing 是否在被变更中(0否;1是;2变更成功)
671
+     */
672
+    public String getChanging() {
673
+        return changing;
674
+    }
675
+
676
+    /**
677
+     * 是否在被变更中(0否;1是;2变更成功)
678
+     * @param changing 是否在被变更中(0否;1是;2变更成功)
679
+     */
680
+    public void setChanging(String changing) {
681
+        this.changing = changing == null ? null : changing.trim();
682
+    }
683
+
684
+    /**
685
+     * 计划id
686
+     * @return plan_bid 计划id
687
+     */
688
+    public Integer getPlanBid() {
689
+        return planBid;
690
+    }
691
+
692
+    /**
693
+     * 计划id
694
+     * @param planBid 计划id
695
+     */
696
+    public void setPlanBid(Integer planBid) {
697
+        this.planBid = planBid;
698
+    }
699
+
700
+    /**
701
+     * 审批状态(0待提交,1审批中,2同意,3驳回,4拒绝)
702
+     * @return audit_state 审批状态(0待提交,1审批中,2同意,3驳回,4拒绝)
703
+     */
704
+    public String getAuditState() {
705
+        return auditState;
706
+    }
707
+
708
+    /**
709
+     * 审批状态(0待提交,1审批中,2同意,3驳回,4拒绝)
710
+     * @param auditState 审批状态(0待提交,1审批中,2同意,3驳回,4拒绝)
711
+     */
712
+    public void setAuditState(String auditState) {
713
+        this.auditState = auditState == null ? null : auditState.trim();
714
+    }
715
+
716
+    /**
717
+     * 流程实例id
718
+     * @return process_instance_id 流程实例id
719
+     */
720
+    public String getProcessInstanceId() {
721
+        return processInstanceId;
722
+    }
723
+
724
+    /**
725
+     * 流程实例id
726
+     * @param processInstanceId 流程实例id
727
+     */
728
+    public void setProcessInstanceId(String processInstanceId) {
729
+        this.processInstanceId = processInstanceId == null ? null : processInstanceId.trim();
730
+    }
731
+
732
+    /**
733
+     * 流程定义id
734
+     * @return process_definition_id 流程定义id
735
+     */
736
+    public String getProcessDefinitionId() {
737
+        return processDefinitionId;
738
+    }
739
+
740
+    /**
741
+     * 流程定义id
742
+     * @param processDefinitionId 流程定义id
743
+     */
744
+    public void setProcessDefinitionId(String processDefinitionId) {
745
+        this.processDefinitionId = processDefinitionId == null ? null : processDefinitionId.trim();
746
+    }
747
+
748
+    /**
749
+     * 审批完成时间
750
+     * @return agree_time 审批完成时间
751
+     */
752
+    public Date getAgreeTime() {
753
+        return agreeTime;
754
+    }
755
+
756
+    /**
757
+     * 审批完成时间
758
+     * @param agreeTime 审批完成时间
759
+     */
760
+    public void setAgreeTime(Date agreeTime) {
761
+        this.agreeTime = agreeTime;
762
+    }
763
+
764
+    /**
765
+     * 合同创建人(数据传输使用)
766
+     * @return create_man 合同创建人(数据传输使用)
767
+     */
768
+    public String getCreateMan() {
769
+        return createMan;
770
+    }
771
+
772
+    /**
773
+     * 合同创建人(数据传输使用)
774
+     * @param createMan 合同创建人(数据传输使用)
775
+     */
776
+    public void setCreateMan(String createMan) {
777
+        this.createMan = createMan == null ? null : createMan.trim();
778
+    }
779
+
780
+    /**
781
+     * 创建人
782
+     * @return creater 创建人
783
+     */
784
+    public String getCreater() {
785
+        return creater;
786
+    }
787
+
788
+    /**
789
+     * 创建人
790
+     * @param creater 创建人
791
+     */
792
+    public void setCreater(String creater) {
793
+        this.creater = creater == null ? null : creater.trim();
794
+    }
795
+
796
+    /**
797
+     * 合同创建时间
798
+     * @return create_time 合同创建时间
799
+     */
800
+    public Date getCreateTime() {
801
+        return createTime;
802
+    }
803
+
804
+    /**
805
+     * 合同创建时间
806
+     * @param createTime 合同创建时间
807
+     */
808
+    public void setCreateTime(Date createTime) {
809
+        this.createTime = createTime;
810
+    }
811
+
812
+    /**
813
+     * 创建部门
814
+     * @return create_unit 创建部门
815
+     */
816
+    public String getCreateUnit() {
817
+        return createUnit;
818
+    }
819
+
820
+    /**
821
+     * 创建部门
822
+     * @param createUnit 创建部门
823
+     */
824
+    public void setCreateUnit(String createUnit) {
825
+        this.createUnit = createUnit == null ? null : createUnit.trim();
826
+    }
827
+
828
+    /**
829
+     * 
830
+     * @return create_depot 
831
+     */
832
+    public String getCreateDepot() {
833
+        return createDepot;
834
+    }
835
+
836
+    /**
837
+     * 
838
+     * @param createDepot 
839
+     */
840
+    public void setCreateDepot(String createDepot) {
841
+        this.createDepot = createDepot == null ? null : createDepot.trim();
842
+    }
843
+
844
+    /**
845
+     * 修改时间
846
+     * @return update_time 修改时间
847
+     */
848
+    public Date getUpdateTime() {
849
+        return updateTime;
850
+    }
851
+
852
+    /**
853
+     * 修改时间
854
+     * @param updateTime 修改时间
855
+     */
856
+    public void setUpdateTime(Date updateTime) {
857
+        this.updateTime = updateTime;
858
+    }
859
+
860
+    /**
861
+     * 
862
+     * @return org_id 
863
+     */
864
+    public Integer getOrgId() {
865
+        return orgId;
866
+    }
867
+
868
+    /**
869
+     * 
870
+     * @param orgId 
871
+     */
872
+    public void setOrgId(Integer orgId) {
873
+        this.orgId = orgId;
874
+    }
875
+
876
+    /**
877
+     * 启用状态 0 : 未执行,1 : 执行中,2 : 执行完毕,3 : 终止,4 : 暂停
878
+     * @return in_application 启用状态 0 : 未执行,1 : 执行中,2 : 执行完毕,3 : 终止,4 : 暂停
879
+     */
880
+    public Integer getInApplication() {
881
+        return inApplication;
882
+    }
883
+
884
+    /**
885
+     * 启用状态 0 : 未执行,1 : 执行中,2 : 执行完毕,3 : 终止,4 : 暂停
886
+     * @param inApplication 启用状态 0 : 未执行,1 : 执行中,2 : 执行完毕,3 : 终止,4 : 暂停
887
+     */
888
+    public void setInApplication(Integer inApplication) {
889
+        this.inApplication = inApplication;
890
+    }
891
+
892
+    /**
893
+     * 
894
+     * @return creater_id 
895
+     */
896
+    public Integer getCreaterId() {
897
+        return createrId;
898
+    }
899
+
900
+    /**
901
+     * 
902
+     * @param createrId 
903
+     */
904
+    public void setCreaterId(Integer createrId) {
905
+        this.createrId = createrId;
906
+    }
907
+
908
+    /**
909
+     * 证件号
910
+     * @return identification 证件号
911
+     */
912
+    public String getIdentification() {
913
+        return identification;
914
+    }
915
+
916
+    /**
917
+     * 证件号
918
+     * @param identification 证件号
919
+     */
920
+    public void setIdentification(String identification) {
921
+        this.identification = identification == null ? null : identification.trim();
922
+    }
923
+}

File diff suppressed because it is too large
+ 3609 - 0
src/main/java/com/chinaitop/depot/business/model/BusinessContractExample.java


+ 149 - 0
src/main/java/com/chinaitop/depot/business/model/BusinessContractPayRecevice.java

@@ -0,0 +1,149 @@
1
+package com.chinaitop.depot.business.model;
2
+
3
+import java.util.Date;
4
+
5
+public class BusinessContractPayRecevice {
6
+    private Integer id;
7
+
8
+    private Integer zid;
9
+
10
+    private String contractNum;
11
+
12
+    private String contractTitle;
13
+
14
+    private Integer contractType;
15
+
16
+    private Integer payStatus;
17
+
18
+    private String money;
19
+
20
+    private Date time;
21
+
22
+    /**
23
+     * 合同收付款表
24
+     * @return id 合同收付款表
25
+     */
26
+    public Integer getId() {
27
+        return id;
28
+    }
29
+
30
+    /**
31
+     * 合同收付款表
32
+     * @param id 合同收付款表
33
+     */
34
+    public void setId(Integer id) {
35
+        this.id = id;
36
+    }
37
+
38
+    /**
39
+     * 合同id
40
+     * @return zid 合同id
41
+     */
42
+    public Integer getZid() {
43
+        return zid;
44
+    }
45
+
46
+    /**
47
+     * 合同id
48
+     * @param zid 合同id
49
+     */
50
+    public void setZid(Integer zid) {
51
+        this.zid = zid;
52
+    }
53
+
54
+    /**
55
+     * 合同编号
56
+     * @return contract_num 合同编号
57
+     */
58
+    public String getContractNum() {
59
+        return contractNum;
60
+    }
61
+
62
+    /**
63
+     * 合同编号
64
+     * @param contractNum 合同编号
65
+     */
66
+    public void setContractNum(String contractNum) {
67
+        this.contractNum = contractNum == null ? null : contractNum.trim();
68
+    }
69
+
70
+    /**
71
+     * 合同名称
72
+     * @return contract_title 合同名称
73
+     */
74
+    public String getContractTitle() {
75
+        return contractTitle;
76
+    }
77
+
78
+    /**
79
+     * 合同名称
80
+     * @param contractTitle 合同名称
81
+     */
82
+    public void setContractTitle(String contractTitle) {
83
+        this.contractTitle = contractTitle == null ? null : contractTitle.trim();
84
+    }
85
+
86
+    /**
87
+     * 合同类型
88
+     * @return contract_type 合同类型
89
+     */
90
+    public Integer getContractType() {
91
+        return contractType;
92
+    }
93
+
94
+    /**
95
+     * 合同类型
96
+     * @param contractType 合同类型
97
+     */
98
+    public void setContractType(Integer contractType) {
99
+        this.contractType = contractType;
100
+    }
101
+
102
+    /**
103
+     * 收付款状态(0:收;1:付)
104
+     * @return pay_status 收付款状态(0:收;1:付)
105
+     */
106
+    public Integer getPayStatus() {
107
+        return payStatus;
108
+    }
109
+
110
+    /**
111
+     * 收付款状态(0:收;1:付)
112
+     * @param payStatus 收付款状态(0:收;1:付)
113
+     */
114
+    public void setPayStatus(Integer payStatus) {
115
+        this.payStatus = payStatus;
116
+    }
117
+
118
+    /**
119
+     * 收付款的数目
120
+     * @return money 收付款的数目
121
+     */
122
+    public String getMoney() {
123
+        return money;
124
+    }
125
+
126
+    /**
127
+     * 收付款的数目
128
+     * @param money 收付款的数目
129
+     */
130
+    public void setMoney(String money) {
131
+        this.money = money == null ? null : money.trim();
132
+    }
133
+
134
+    /**
135
+     * 时间
136
+     * @return time 时间
137
+     */
138
+    public Date getTime() {
139
+        return time;
140
+    }
141
+
142
+    /**
143
+     * 时间
144
+     * @param time 时间
145
+     */
146
+    public void setTime(Date time) {
147
+        this.time = time;
148
+    }
149
+}

+ 729 - 0
src/main/java/com/chinaitop/depot/business/model/BusinessContractPayReceviceExample.java

@@ -0,0 +1,729 @@
1
+package com.chinaitop.depot.business.model;
2
+
3
+import java.util.ArrayList;
4
+import java.util.Date;
5
+import java.util.List;
6
+
7
+public class BusinessContractPayReceviceExample {
8
+    /**
9
+     * business_contract_pay_recevice
10
+     */
11
+    protected String orderByClause;
12
+
13
+    /**
14
+     * business_contract_pay_recevice
15
+     */
16
+    protected boolean distinct;
17
+
18
+    /**
19
+     * business_contract_pay_recevice
20
+     */
21
+    protected List<Criteria> oredCriteria;
22
+
23
+    public BusinessContractPayReceviceExample() {
24
+        oredCriteria = new ArrayList<Criteria>();
25
+    }
26
+
27
+    public void setOrderByClause(String orderByClause) {
28
+        this.orderByClause = orderByClause;
29
+    }
30
+
31
+    public String getOrderByClause() {
32
+        return orderByClause;
33
+    }
34
+
35
+    public void setDistinct(boolean distinct) {
36
+        this.distinct = distinct;
37
+    }
38
+
39
+    public boolean isDistinct() {
40
+        return distinct;
41
+    }
42
+
43
+    public List<Criteria> getOredCriteria() {
44
+        return oredCriteria;
45
+    }
46
+
47
+    public void or(Criteria criteria) {
48
+        oredCriteria.add(criteria);
49
+    }
50
+
51
+    public Criteria or() {
52
+        Criteria criteria = createCriteriaInternal();
53
+        oredCriteria.add(criteria);
54
+        return criteria;
55
+    }
56
+
57
+    public Criteria createCriteria() {
58
+        Criteria criteria = createCriteriaInternal();
59
+        if (oredCriteria.size() == 0) {
60
+            oredCriteria.add(criteria);
61
+        }
62
+        return criteria;
63
+    }
64
+
65
+    protected Criteria createCriteriaInternal() {
66
+        Criteria criteria = new Criteria();
67
+        return criteria;
68
+    }
69
+
70
+    public void clear() {
71
+        oredCriteria.clear();
72
+        orderByClause = null;
73
+        distinct = false;
74
+    }
75
+
76
+    /**
77
+     * business_contract_pay_recevice 2018-10-17
78
+     */
79
+    protected abstract static class GeneratedCriteria {
80
+        protected List<Criterion> criteria;
81
+
82
+        protected GeneratedCriteria() {
83
+            super();
84
+            criteria = new ArrayList<Criterion>();
85
+        }
86
+
87
+        public boolean isValid() {
88
+            return criteria.size() > 0;
89
+        }
90
+
91
+        public List<Criterion> getAllCriteria() {
92
+            return criteria;
93
+        }
94
+
95
+        public List<Criterion> getCriteria() {
96
+            return criteria;
97
+        }
98
+
99
+        protected void addCriterion(String condition) {
100
+            if (condition == null) {
101
+                throw new RuntimeException("Value for condition cannot be null");
102
+            }
103
+            criteria.add(new Criterion(condition));
104
+        }
105
+
106
+        protected void addCriterion(String condition, Object value, String property) {
107
+            if (value == null) {
108
+                throw new RuntimeException("Value for " + property + " cannot be null");
109
+            }
110
+            criteria.add(new Criterion(condition, value));
111
+        }
112
+
113
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
114
+            if (value1 == null || value2 == null) {
115
+                throw new RuntimeException("Between values for " + property + " cannot be null");
116
+            }
117
+            criteria.add(new Criterion(condition, value1, value2));
118
+        }
119
+
120
+        public Criteria andIdIsNull() {
121
+            addCriterion("id is null");
122
+            return (Criteria) this;
123
+        }
124
+
125
+        public Criteria andIdIsNotNull() {
126
+            addCriterion("id is not null");
127
+            return (Criteria) this;
128
+        }
129
+
130
+        public Criteria andIdEqualTo(Integer value) {
131
+            addCriterion("id =", value, "id");
132
+            return (Criteria) this;
133
+        }
134
+
135
+        public Criteria andIdNotEqualTo(Integer value) {
136
+            addCriterion("id <>", value, "id");
137
+            return (Criteria) this;
138
+        }
139
+
140
+        public Criteria andIdGreaterThan(Integer value) {
141
+            addCriterion("id >", value, "id");
142
+            return (Criteria) this;
143
+        }
144
+
145
+        public Criteria andIdGreaterThanOrEqualTo(Integer value) {
146
+            addCriterion("id >=", value, "id");
147
+            return (Criteria) this;
148
+        }
149
+
150
+        public Criteria andIdLessThan(Integer value) {
151
+            addCriterion("id <", value, "id");
152
+            return (Criteria) this;
153
+        }
154
+
155
+        public Criteria andIdLessThanOrEqualTo(Integer value) {
156
+            addCriterion("id <=", value, "id");
157
+            return (Criteria) this;
158
+        }
159
+
160
+        public Criteria andIdIn(List<Integer> values) {
161
+            addCriterion("id in", values, "id");
162
+            return (Criteria) this;
163
+        }
164
+
165
+        public Criteria andIdNotIn(List<Integer> values) {
166
+            addCriterion("id not in", values, "id");
167
+            return (Criteria) this;
168
+        }
169
+
170
+        public Criteria andIdBetween(Integer value1, Integer value2) {
171
+            addCriterion("id between", value1, value2, "id");
172
+            return (Criteria) this;
173
+        }
174
+
175
+        public Criteria andIdNotBetween(Integer value1, Integer value2) {
176
+            addCriterion("id not between", value1, value2, "id");
177
+            return (Criteria) this;
178
+        }
179
+
180
+        public Criteria andZidIsNull() {
181
+            addCriterion("zid is null");
182
+            return (Criteria) this;
183
+        }
184
+
185
+        public Criteria andZidIsNotNull() {
186
+            addCriterion("zid is not null");
187
+            return (Criteria) this;
188
+        }
189
+
190
+        public Criteria andZidEqualTo(Integer value) {
191
+            addCriterion("zid =", value, "zid");
192
+            return (Criteria) this;
193
+        }
194
+
195
+        public Criteria andZidNotEqualTo(Integer value) {
196
+            addCriterion("zid <>", value, "zid");
197
+            return (Criteria) this;
198
+        }
199
+
200
+        public Criteria andZidGreaterThan(Integer value) {
201
+            addCriterion("zid >", value, "zid");
202
+            return (Criteria) this;
203
+        }
204
+
205
+        public Criteria andZidGreaterThanOrEqualTo(Integer value) {
206
+            addCriterion("zid >=", value, "zid");
207
+            return (Criteria) this;
208
+        }
209
+
210
+        public Criteria andZidLessThan(Integer value) {
211
+            addCriterion("zid <", value, "zid");
212
+            return (Criteria) this;
213
+        }
214
+
215
+        public Criteria andZidLessThanOrEqualTo(Integer value) {
216
+            addCriterion("zid <=", value, "zid");
217
+            return (Criteria) this;
218
+        }
219
+
220
+        public Criteria andZidIn(List<Integer> values) {
221
+            addCriterion("zid in", values, "zid");
222
+            return (Criteria) this;
223
+        }
224
+
225
+        public Criteria andZidNotIn(List<Integer> values) {
226
+            addCriterion("zid not in", values, "zid");
227
+            return (Criteria) this;
228
+        }
229
+
230
+        public Criteria andZidBetween(Integer value1, Integer value2) {
231
+            addCriterion("zid between", value1, value2, "zid");
232
+            return (Criteria) this;
233
+        }
234
+
235
+        public Criteria andZidNotBetween(Integer value1, Integer value2) {
236
+            addCriterion("zid not between", value1, value2, "zid");
237
+            return (Criteria) this;
238
+        }
239
+
240
+        public Criteria andContractNumIsNull() {
241
+            addCriterion("contract_num is null");
242
+            return (Criteria) this;
243
+        }
244
+
245
+        public Criteria andContractNumIsNotNull() {
246
+            addCriterion("contract_num is not null");
247
+            return (Criteria) this;
248
+        }
249
+
250
+        public Criteria andContractNumEqualTo(String value) {
251
+            addCriterion("contract_num =", value, "contractNum");
252
+            return (Criteria) this;
253
+        }
254
+
255
+        public Criteria andContractNumNotEqualTo(String value) {
256
+            addCriterion("contract_num <>", value, "contractNum");
257
+            return (Criteria) this;
258
+        }
259
+
260
+        public Criteria andContractNumGreaterThan(String value) {
261
+            addCriterion("contract_num >", value, "contractNum");
262
+            return (Criteria) this;
263
+        }
264
+
265
+        public Criteria andContractNumGreaterThanOrEqualTo(String value) {
266
+            addCriterion("contract_num >=", value, "contractNum");
267
+            return (Criteria) this;
268
+        }
269
+
270
+        public Criteria andContractNumLessThan(String value) {
271
+            addCriterion("contract_num <", value, "contractNum");
272
+            return (Criteria) this;
273
+        }
274
+
275
+        public Criteria andContractNumLessThanOrEqualTo(String value) {
276
+            addCriterion("contract_num <=", value, "contractNum");
277
+            return (Criteria) this;
278
+        }
279
+
280
+        public Criteria andContractNumLike(String value) {
281
+            addCriterion("contract_num like", value, "contractNum");
282
+            return (Criteria) this;
283
+        }
284
+
285
+        public Criteria andContractNumNotLike(String value) {
286
+            addCriterion("contract_num not like", value, "contractNum");
287
+            return (Criteria) this;
288
+        }
289
+
290
+        public Criteria andContractNumIn(List<String> values) {
291
+            addCriterion("contract_num in", values, "contractNum");
292
+            return (Criteria) this;
293
+        }
294
+
295
+        public Criteria andContractNumNotIn(List<String> values) {
296
+            addCriterion("contract_num not in", values, "contractNum");
297
+            return (Criteria) this;
298
+        }
299
+
300
+        public Criteria andContractNumBetween(String value1, String value2) {
301
+            addCriterion("contract_num between", value1, value2, "contractNum");
302
+            return (Criteria) this;
303
+        }
304
+
305
+        public Criteria andContractNumNotBetween(String value1, String value2) {
306
+            addCriterion("contract_num not between", value1, value2, "contractNum");
307
+            return (Criteria) this;
308
+        }
309
+
310
+        public Criteria andContractTitleIsNull() {
311
+            addCriterion("contract_title is null");
312
+            return (Criteria) this;
313
+        }
314
+
315
+        public Criteria andContractTitleIsNotNull() {
316
+            addCriterion("contract_title is not null");
317
+            return (Criteria) this;
318
+        }
319
+
320
+        public Criteria andContractTitleEqualTo(String value) {
321
+            addCriterion("contract_title =", value, "contractTitle");
322
+            return (Criteria) this;
323
+        }
324
+
325
+        public Criteria andContractTitleNotEqualTo(String value) {
326
+            addCriterion("contract_title <>", value, "contractTitle");
327
+            return (Criteria) this;
328
+        }
329
+
330
+        public Criteria andContractTitleGreaterThan(String value) {
331
+            addCriterion("contract_title >", value, "contractTitle");
332
+            return (Criteria) this;
333
+        }
334
+
335
+        public Criteria andContractTitleGreaterThanOrEqualTo(String value) {
336
+            addCriterion("contract_title >=", value, "contractTitle");
337
+            return (Criteria) this;
338
+        }
339
+
340
+        public Criteria andContractTitleLessThan(String value) {
341
+            addCriterion("contract_title <", value, "contractTitle");
342
+            return (Criteria) this;
343
+        }
344
+
345
+        public Criteria andContractTitleLessThanOrEqualTo(String value) {
346
+            addCriterion("contract_title <=", value, "contractTitle");
347
+            return (Criteria) this;
348
+        }
349
+
350
+        public Criteria andContractTitleLike(String value) {
351
+            addCriterion("contract_title like", value, "contractTitle");
352
+            return (Criteria) this;
353
+        }
354
+
355
+        public Criteria andContractTitleNotLike(String value) {
356
+            addCriterion("contract_title not like", value, "contractTitle");
357
+            return (Criteria) this;
358
+        }
359
+
360
+        public Criteria andContractTitleIn(List<String> values) {
361
+            addCriterion("contract_title in", values, "contractTitle");
362
+            return (Criteria) this;
363
+        }
364
+
365
+        public Criteria andContractTitleNotIn(List<String> values) {
366
+            addCriterion("contract_title not in", values, "contractTitle");
367
+            return (Criteria) this;
368
+        }
369
+
370
+        public Criteria andContractTitleBetween(String value1, String value2) {
371
+            addCriterion("contract_title between", value1, value2, "contractTitle");
372
+            return (Criteria) this;
373
+        }
374
+
375
+        public Criteria andContractTitleNotBetween(String value1, String value2) {
376
+            addCriterion("contract_title not between", value1, value2, "contractTitle");
377
+            return (Criteria) this;
378
+        }
379
+
380
+        public Criteria andContractTypeIsNull() {
381
+            addCriterion("contract_type is null");
382
+            return (Criteria) this;
383
+        }
384
+
385
+        public Criteria andContractTypeIsNotNull() {
386
+            addCriterion("contract_type is not null");
387
+            return (Criteria) this;
388
+        }
389
+
390
+        public Criteria andContractTypeEqualTo(Integer value) {
391
+            addCriterion("contract_type =", value, "contractType");
392
+            return (Criteria) this;
393
+        }
394
+
395
+        public Criteria andContractTypeNotEqualTo(Integer value) {
396
+            addCriterion("contract_type <>", value, "contractType");
397
+            return (Criteria) this;
398
+        }
399
+
400
+        public Criteria andContractTypeGreaterThan(Integer value) {
401
+            addCriterion("contract_type >", value, "contractType");
402
+            return (Criteria) this;
403
+        }
404
+
405
+        public Criteria andContractTypeGreaterThanOrEqualTo(Integer value) {
406
+            addCriterion("contract_type >=", value, "contractType");
407
+            return (Criteria) this;
408
+        }
409
+
410
+        public Criteria andContractTypeLessThan(Integer value) {
411
+            addCriterion("contract_type <", value, "contractType");
412
+            return (Criteria) this;
413
+        }
414
+
415
+        public Criteria andContractTypeLessThanOrEqualTo(Integer value) {
416
+            addCriterion("contract_type <=", value, "contractType");
417
+            return (Criteria) this;
418
+        }
419
+
420
+        public Criteria andContractTypeIn(List<Integer> values) {
421
+            addCriterion("contract_type in", values, "contractType");
422
+            return (Criteria) this;
423
+        }
424
+
425
+        public Criteria andContractTypeNotIn(List<Integer> values) {
426
+            addCriterion("contract_type not in", values, "contractType");
427
+            return (Criteria) this;
428
+        }
429
+
430
+        public Criteria andContractTypeBetween(Integer value1, Integer value2) {
431
+            addCriterion("contract_type between", value1, value2, "contractType");
432
+            return (Criteria) this;
433
+        }
434
+
435
+        public Criteria andContractTypeNotBetween(Integer value1, Integer value2) {
436
+            addCriterion("contract_type not between", value1, value2, "contractType");
437
+            return (Criteria) this;
438
+        }
439
+
440
+        public Criteria andPayStatusIsNull() {
441
+            addCriterion("pay_status is null");
442
+            return (Criteria) this;
443
+        }
444
+
445
+        public Criteria andPayStatusIsNotNull() {
446
+            addCriterion("pay_status is not null");
447
+            return (Criteria) this;
448
+        }
449
+
450
+        public Criteria andPayStatusEqualTo(Integer value) {
451
+            addCriterion("pay_status =", value, "payStatus");
452
+            return (Criteria) this;
453
+        }
454
+
455
+        public Criteria andPayStatusNotEqualTo(Integer value) {
456
+            addCriterion("pay_status <>", value, "payStatus");
457
+            return (Criteria) this;
458
+        }
459
+
460
+        public Criteria andPayStatusGreaterThan(Integer value) {
461
+            addCriterion("pay_status >", value, "payStatus");
462
+            return (Criteria) this;
463
+        }
464
+
465
+        public Criteria andPayStatusGreaterThanOrEqualTo(Integer value) {
466
+            addCriterion("pay_status >=", value, "payStatus");
467
+            return (Criteria) this;
468
+        }
469
+
470
+        public Criteria andPayStatusLessThan(Integer value) {
471
+            addCriterion("pay_status <", value, "payStatus");
472
+            return (Criteria) this;
473
+        }
474
+
475
+        public Criteria andPayStatusLessThanOrEqualTo(Integer value) {
476
+            addCriterion("pay_status <=", value, "payStatus");
477
+            return (Criteria) this;
478
+        }
479
+
480
+        public Criteria andPayStatusIn(List<Integer> values) {
481
+            addCriterion("pay_status in", values, "payStatus");
482
+            return (Criteria) this;
483
+        }
484
+
485
+        public Criteria andPayStatusNotIn(List<Integer> values) {
486
+            addCriterion("pay_status not in", values, "payStatus");
487
+            return (Criteria) this;
488
+        }
489
+
490
+        public Criteria andPayStatusBetween(Integer value1, Integer value2) {
491
+            addCriterion("pay_status between", value1, value2, "payStatus");
492
+            return (Criteria) this;
493
+        }
494
+
495
+        public Criteria andPayStatusNotBetween(Integer value1, Integer value2) {
496
+            addCriterion("pay_status not between", value1, value2, "payStatus");
497
+            return (Criteria) this;
498
+        }
499
+
500
+        public Criteria andMoneyIsNull() {
501
+            addCriterion("money is null");
502
+            return (Criteria) this;
503
+        }
504
+
505
+        public Criteria andMoneyIsNotNull() {
506
+            addCriterion("money is not null");
507
+            return (Criteria) this;
508
+        }
509
+
510
+        public Criteria andMoneyEqualTo(String value) {
511
+            addCriterion("money =", value, "money");
512
+            return (Criteria) this;
513
+        }
514
+
515
+        public Criteria andMoneyNotEqualTo(String value) {
516
+            addCriterion("money <>", value, "money");
517
+            return (Criteria) this;
518
+        }
519
+
520
+        public Criteria andMoneyGreaterThan(String value) {
521
+            addCriterion("money >", value, "money");
522
+            return (Criteria) this;
523
+        }
524
+
525
+        public Criteria andMoneyGreaterThanOrEqualTo(String value) {
526
+            addCriterion("money >=", value, "money");
527
+            return (Criteria) this;
528
+        }
529
+
530
+        public Criteria andMoneyLessThan(String value) {
531
+            addCriterion("money <", value, "money");
532
+            return (Criteria) this;
533
+        }
534
+
535
+        public Criteria andMoneyLessThanOrEqualTo(String value) {
536
+            addCriterion("money <=", value, "money");
537
+            return (Criteria) this;
538
+        }
539
+
540
+        public Criteria andMoneyLike(String value) {
541
+            addCriterion("money like", value, "money");
542
+            return (Criteria) this;
543
+        }
544
+
545
+        public Criteria andMoneyNotLike(String value) {
546
+            addCriterion("money not like", value, "money");
547
+            return (Criteria) this;
548
+        }
549
+
550
+        public Criteria andMoneyIn(List<String> values) {
551
+            addCriterion("money in", values, "money");
552
+            return (Criteria) this;
553
+        }
554
+
555
+        public Criteria andMoneyNotIn(List<String> values) {
556
+            addCriterion("money not in", values, "money");
557
+            return (Criteria) this;
558
+        }
559
+
560
+        public Criteria andMoneyBetween(String value1, String value2) {
561
+            addCriterion("money between", value1, value2, "money");
562
+            return (Criteria) this;
563
+        }
564
+
565
+        public Criteria andMoneyNotBetween(String value1, String value2) {
566
+            addCriterion("money not between", value1, value2, "money");
567
+            return (Criteria) this;
568
+        }
569
+
570
+        public Criteria andTimeIsNull() {
571
+            addCriterion("time is null");
572
+            return (Criteria) this;
573
+        }
574
+
575
+        public Criteria andTimeIsNotNull() {
576
+            addCriterion("time is not null");
577
+            return (Criteria) this;
578
+        }
579
+
580
+        public Criteria andTimeEqualTo(Date value) {
581
+            addCriterion("time =", value, "time");
582
+            return (Criteria) this;
583
+        }
584
+
585
+        public Criteria andTimeNotEqualTo(Date value) {
586
+            addCriterion("time <>", value, "time");
587
+            return (Criteria) this;
588
+        }
589
+
590
+        public Criteria andTimeGreaterThan(Date value) {
591
+            addCriterion("time >", value, "time");
592
+            return (Criteria) this;
593
+        }
594
+
595
+        public Criteria andTimeGreaterThanOrEqualTo(Date value) {
596
+            addCriterion("time >=", value, "time");
597
+            return (Criteria) this;
598
+        }
599
+
600
+        public Criteria andTimeLessThan(Date value) {
601
+            addCriterion("time <", value, "time");
602
+            return (Criteria) this;
603
+        }
604
+
605
+        public Criteria andTimeLessThanOrEqualTo(Date value) {
606
+            addCriterion("time <=", value, "time");
607
+            return (Criteria) this;
608
+        }
609
+
610
+        public Criteria andTimeIn(List<Date> values) {
611
+            addCriterion("time in", values, "time");
612
+            return (Criteria) this;
613
+        }
614
+
615
+        public Criteria andTimeNotIn(List<Date> values) {
616
+            addCriterion("time not in", values, "time");
617
+            return (Criteria) this;
618
+        }
619
+
620
+        public Criteria andTimeBetween(Date value1, Date value2) {
621
+            addCriterion("time between", value1, value2, "time");
622
+            return (Criteria) this;
623
+        }
624
+
625
+        public Criteria andTimeNotBetween(Date value1, Date value2) {
626
+            addCriterion("time not between", value1, value2, "time");
627
+            return (Criteria) this;
628
+        }
629
+    }
630
+
631
+    /**
632
+     * business_contract_pay_recevice
633
+     */
634
+    public static class Criteria extends GeneratedCriteria {
635
+
636
+        protected Criteria() {
637
+            super();
638
+        }
639
+    }
640
+
641
+    /**
642
+     * business_contract_pay_recevice 2018-10-17
643
+     */
644
+    public static class Criterion {
645
+        private String condition;
646
+
647
+        private Object value;
648
+
649
+        private Object secondValue;
650
+
651
+        private boolean noValue;
652
+
653
+        private boolean singleValue;
654
+
655
+        private boolean betweenValue;
656
+
657
+        private boolean listValue;
658
+
659
+        private String typeHandler;
660
+
661
+        public String getCondition() {
662
+            return condition;
663
+        }
664
+
665
+        public Object getValue() {
666
+            return value;
667
+        }
668
+
669
+        public Object getSecondValue() {
670
+            return secondValue;
671
+        }
672
+
673
+        public boolean isNoValue() {
674
+            return noValue;
675
+        }
676
+
677
+        public boolean isSingleValue() {
678
+            return singleValue;
679
+        }
680
+
681
+        public boolean isBetweenValue() {
682
+            return betweenValue;
683
+        }
684
+
685
+        public boolean isListValue() {
686
+            return listValue;
687
+        }
688
+
689
+        public String getTypeHandler() {
690
+            return typeHandler;
691
+        }
692
+
693
+        protected Criterion(String condition) {
694
+            super();
695
+            this.condition = condition;
696
+            this.typeHandler = null;
697
+            this.noValue = true;
698
+        }
699
+
700
+        protected Criterion(String condition, Object value, String typeHandler) {
701
+            super();
702
+            this.condition = condition;
703
+            this.value = value;
704
+            this.typeHandler = typeHandler;
705
+            if (value instanceof List<?>) {
706
+                this.listValue = true;
707
+            } else {
708
+                this.singleValue = true;
709
+            }
710
+        }
711
+
712
+        protected Criterion(String condition, Object value) {
713
+            this(condition, value, null);
714
+        }
715
+
716
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
717
+            super();
718
+            this.condition = condition;
719
+            this.value = value;
720
+            this.secondValue = secondValue;
721
+            this.typeHandler = typeHandler;
722
+            this.betweenValue = true;
723
+        }
724
+
725
+        protected Criterion(String condition, Object value, Object secondValue) {
726
+            this(condition, value, secondValue, null);
727
+        }
728
+    }
729
+}

+ 357 - 0
src/main/java/com/chinaitop/depot/business/model/BusinessDeliveryNoticeDetail.java

@@ -0,0 +1,357 @@
1
+package com.chinaitop.depot.business.model;
2
+
3
+import java.util.Date;
4
+
5
+public class BusinessDeliveryNoticeDetail {
6
+    /**
7
+     * This field was generated by MyBatis Generator.
8
+     * This field corresponds to the database column business_delivery_notice_detail.id
9
+     *
10
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
11
+     */
12
+    private Integer id;
13
+
14
+    /**
15
+     * This field was generated by MyBatis Generator.
16
+     * This field corresponds to the database column business_delivery_notice_detail.zid
17
+     *
18
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
19
+     */
20
+    private Integer zid;
21
+
22
+    /**
23
+     * This field was generated by MyBatis Generator.
24
+     * This field corresponds to the database column business_delivery_notice_detail.warehouse
25
+     *
26
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
27
+     */
28
+    private Integer warehouse;
29
+
30
+    /**
31
+     * This field was generated by MyBatis Generator.
32
+     * This field corresponds to the database column business_delivery_notice_detail.goods_location
33
+     *
34
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
35
+     */
36
+    private Integer goodsLocation;
37
+
38
+    /**
39
+     * This field was generated by MyBatis Generator.
40
+     * This field corresponds to the database column business_delivery_notice_detail.shiping_count
41
+     *
42
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
43
+     */
44
+    private String shipingCount;
45
+
46
+    /**
47
+     * This field was generated by MyBatis Generator.
48
+     * This field corresponds to the database column business_delivery_notice_detail.create_time
49
+     *
50
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
51
+     */
52
+    private Date createTime;
53
+
54
+    /**
55
+     * This field was generated by MyBatis Generator.
56
+     * This field corresponds to the database column business_delivery_notice_detail.org_id
57
+     *
58
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
59
+     */
60
+    private Integer orgId;
61
+
62
+    /**
63
+     * This field was generated by MyBatis Generator.
64
+     * This field corresponds to the database column business_delivery_notice_detail.house_id
65
+     *
66
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
67
+     */
68
+    private Integer houseId;
69
+
70
+    /**
71
+     * This field was generated by MyBatis Generator.
72
+     * This field corresponds to the database column business_delivery_notice_detail.house_name
73
+     *
74
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
75
+     */
76
+    private String houseName;
77
+
78
+    /**
79
+     * This field was generated by MyBatis Generator.
80
+     * This field corresponds to the database column business_delivery_notice_detail.warehouse_id
81
+     *
82
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
83
+     */
84
+    private Integer warehouseId;
85
+
86
+    /**
87
+     * This field was generated by MyBatis Generator.
88
+     * This field corresponds to the database column business_delivery_notice_detail.warehouse_name
89
+     *
90
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
91
+     */
92
+    private String warehouseName;
93
+
94
+    /**
95
+     * This method was generated by MyBatis Generator.
96
+     * This method returns the value of the database column business_delivery_notice_detail.id
97
+     *
98
+     * @return the value of business_delivery_notice_detail.id
99
+     *
100
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
101
+     */
102
+    public Integer getId() {
103
+        return id;
104
+    }
105
+
106
+    /**
107
+     * This method was generated by MyBatis Generator.
108
+     * This method sets the value of the database column business_delivery_notice_detail.id
109
+     *
110
+     * @param id the value for business_delivery_notice_detail.id
111
+     *
112
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
113
+     */
114
+    public void setId(Integer id) {
115
+        this.id = id;
116
+    }
117
+
118
+    /**
119
+     * This method was generated by MyBatis Generator.
120
+     * This method returns the value of the database column business_delivery_notice_detail.zid
121
+     *
122
+     * @return the value of business_delivery_notice_detail.zid
123
+     *
124
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
125
+     */
126
+    public Integer getZid() {
127
+        return zid;
128
+    }
129
+
130
+    /**
131
+     * This method was generated by MyBatis Generator.
132
+     * This method sets the value of the database column business_delivery_notice_detail.zid
133
+     *
134
+     * @param zid the value for business_delivery_notice_detail.zid
135
+     *
136
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
137
+     */
138
+    public void setZid(Integer zid) {
139
+        this.zid = zid;
140
+    }
141
+
142
+    /**
143
+     * This method was generated by MyBatis Generator.
144
+     * This method returns the value of the database column business_delivery_notice_detail.warehouse
145
+     *
146
+     * @return the value of business_delivery_notice_detail.warehouse
147
+     *
148
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
149
+     */
150
+    public Integer getWarehouse() {
151
+        return warehouse;
152
+    }
153
+
154
+    /**
155
+     * This method was generated by MyBatis Generator.
156
+     * This method sets the value of the database column business_delivery_notice_detail.warehouse
157
+     *
158
+     * @param warehouse the value for business_delivery_notice_detail.warehouse
159
+     *
160
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
161
+     */
162
+    public void setWarehouse(Integer warehouse) {
163
+        this.warehouse = warehouse;
164
+    }
165
+
166
+    /**
167
+     * This method was generated by MyBatis Generator.
168
+     * This method returns the value of the database column business_delivery_notice_detail.goods_location
169
+     *
170
+     * @return the value of business_delivery_notice_detail.goods_location
171
+     *
172
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
173
+     */
174
+    public Integer getGoodsLocation() {
175
+        return goodsLocation;
176
+    }
177
+
178
+    /**
179
+     * This method was generated by MyBatis Generator.
180
+     * This method sets the value of the database column business_delivery_notice_detail.goods_location
181
+     *
182
+     * @param goodsLocation the value for business_delivery_notice_detail.goods_location
183
+     *
184
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
185
+     */
186
+    public void setGoodsLocation(Integer goodsLocation) {
187
+        this.goodsLocation = goodsLocation;
188
+    }
189
+
190
+    /**
191
+     * This method was generated by MyBatis Generator.
192
+     * This method returns the value of the database column business_delivery_notice_detail.shiping_count
193
+     *
194
+     * @return the value of business_delivery_notice_detail.shiping_count
195
+     *
196
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
197
+     */
198
+    public String getShipingCount() {
199
+        return shipingCount;
200
+    }
201
+
202
+    /**
203
+     * This method was generated by MyBatis Generator.
204
+     * This method sets the value of the database column business_delivery_notice_detail.shiping_count
205
+     *
206
+     * @param shipingCount the value for business_delivery_notice_detail.shiping_count
207
+     *
208
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
209
+     */
210
+    public void setShipingCount(String shipingCount) {
211
+        this.shipingCount = shipingCount == null ? null : shipingCount.trim();
212
+    }
213
+
214
+    /**
215
+     * This method was generated by MyBatis Generator.
216
+     * This method returns the value of the database column business_delivery_notice_detail.create_time
217
+     *
218
+     * @return the value of business_delivery_notice_detail.create_time
219
+     *
220
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
221
+     */
222
+    public Date getCreateTime() {
223
+        return createTime;
224
+    }
225
+
226
+    /**
227
+     * This method was generated by MyBatis Generator.
228
+     * This method sets the value of the database column business_delivery_notice_detail.create_time
229
+     *
230
+     * @param createTime the value for business_delivery_notice_detail.create_time
231
+     *
232
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
233
+     */
234
+    public void setCreateTime(Date createTime) {
235
+        this.createTime = createTime;
236
+    }
237
+
238
+    /**
239
+     * This method was generated by MyBatis Generator.
240
+     * This method returns the value of the database column business_delivery_notice_detail.org_id
241
+     *
242
+     * @return the value of business_delivery_notice_detail.org_id
243
+     *
244
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
245
+     */
246
+    public Integer getOrgId() {
247
+        return orgId;
248
+    }
249
+
250
+    /**
251
+     * This method was generated by MyBatis Generator.
252
+     * This method sets the value of the database column business_delivery_notice_detail.org_id
253
+     *
254
+     * @param orgId the value for business_delivery_notice_detail.org_id
255
+     *
256
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
257
+     */
258
+    public void setOrgId(Integer orgId) {
259
+        this.orgId = orgId;
260
+    }
261
+
262
+    /**
263
+     * This method was generated by MyBatis Generator.
264
+     * This method returns the value of the database column business_delivery_notice_detail.house_id
265
+     *
266
+     * @return the value of business_delivery_notice_detail.house_id
267
+     *
268
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
269
+     */
270
+    public Integer getHouseId() {
271
+        return houseId;
272
+    }
273
+
274
+    /**
275
+     * This method was generated by MyBatis Generator.
276
+     * This method sets the value of the database column business_delivery_notice_detail.house_id
277
+     *
278
+     * @param houseId the value for business_delivery_notice_detail.house_id
279
+     *
280
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
281
+     */
282
+    public void setHouseId(Integer houseId) {
283
+        this.houseId = houseId;
284
+    }
285
+
286
+    /**
287
+     * This method was generated by MyBatis Generator.
288
+     * This method returns the value of the database column business_delivery_notice_detail.house_name
289
+     *
290
+     * @return the value of business_delivery_notice_detail.house_name
291
+     *
292
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
293
+     */
294
+    public String getHouseName() {
295
+        return houseName;
296
+    }
297
+
298
+    /**
299
+     * This method was generated by MyBatis Generator.
300
+     * This method sets the value of the database column business_delivery_notice_detail.house_name
301
+     *
302
+     * @param houseName the value for business_delivery_notice_detail.house_name
303
+     *
304
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
305
+     */
306
+    public void setHouseName(String houseName) {
307
+        this.houseName = houseName == null ? null : houseName.trim();
308
+    }
309
+
310
+    /**
311
+     * This method was generated by MyBatis Generator.
312
+     * This method returns the value of the database column business_delivery_notice_detail.warehouse_id
313
+     *
314
+     * @return the value of business_delivery_notice_detail.warehouse_id
315
+     *
316
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
317
+     */
318
+    public Integer getWarehouseId() {
319
+        return warehouseId;
320
+    }
321
+
322
+    /**
323
+     * This method was generated by MyBatis Generator.
324
+     * This method sets the value of the database column business_delivery_notice_detail.warehouse_id
325
+     *
326
+     * @param warehouseId the value for business_delivery_notice_detail.warehouse_id
327
+     *
328
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
329
+     */
330
+    public void setWarehouseId(Integer warehouseId) {
331
+        this.warehouseId = warehouseId;
332
+    }
333
+
334
+    /**
335
+     * This method was generated by MyBatis Generator.
336
+     * This method returns the value of the database column business_delivery_notice_detail.warehouse_name
337
+     *
338
+     * @return the value of business_delivery_notice_detail.warehouse_name
339
+     *
340
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
341
+     */
342
+    public String getWarehouseName() {
343
+        return warehouseName;
344
+    }
345
+
346
+    /**
347
+     * This method was generated by MyBatis Generator.
348
+     * This method sets the value of the database column business_delivery_notice_detail.warehouse_name
349
+     *
350
+     * @param warehouseName the value for business_delivery_notice_detail.warehouse_name
351
+     *
352
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
353
+     */
354
+    public void setWarehouseName(String warehouseName) {
355
+        this.warehouseName = warehouseName == null ? null : warehouseName.trim();
356
+    }
357
+}

+ 993 - 0
src/main/java/com/chinaitop/depot/business/model/BusinessDeliveryNoticeDetailExample.java

@@ -0,0 +1,993 @@
1
+package com.chinaitop.depot.business.model;
2
+
3
+import java.util.ArrayList;
4
+import java.util.Date;
5
+import java.util.List;
6
+
7
+public class BusinessDeliveryNoticeDetailExample {
8
+    /**
9
+     * This field was generated by MyBatis Generator.
10
+     * This field corresponds to the database table business_delivery_notice_detail
11
+     *
12
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
13
+     */
14
+    protected String orderByClause;
15
+
16
+    /**
17
+     * This field was generated by MyBatis Generator.
18
+     * This field corresponds to the database table business_delivery_notice_detail
19
+     *
20
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
21
+     */
22
+    protected boolean distinct;
23
+
24
+    /**
25
+     * This field was generated by MyBatis Generator.
26
+     * This field corresponds to the database table business_delivery_notice_detail
27
+     *
28
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
29
+     */
30
+    protected List<Criteria> oredCriteria;
31
+
32
+    /**
33
+     * This method was generated by MyBatis Generator.
34
+     * This method corresponds to the database table business_delivery_notice_detail
35
+     *
36
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
37
+     */
38
+    public BusinessDeliveryNoticeDetailExample() {
39
+        oredCriteria = new ArrayList<Criteria>();
40
+    }
41
+
42
+    /**
43
+     * This method was generated by MyBatis Generator.
44
+     * This method corresponds to the database table business_delivery_notice_detail
45
+     *
46
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
47
+     */
48
+    public void setOrderByClause(String orderByClause) {
49
+        this.orderByClause = orderByClause;
50
+    }
51
+
52
+    /**
53
+     * This method was generated by MyBatis Generator.
54
+     * This method corresponds to the database table business_delivery_notice_detail
55
+     *
56
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
57
+     */
58
+    public String getOrderByClause() {
59
+        return orderByClause;
60
+    }
61
+
62
+    /**
63
+     * This method was generated by MyBatis Generator.
64
+     * This method corresponds to the database table business_delivery_notice_detail
65
+     *
66
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
67
+     */
68
+    public void setDistinct(boolean distinct) {
69
+        this.distinct = distinct;
70
+    }
71
+
72
+    /**
73
+     * This method was generated by MyBatis Generator.
74
+     * This method corresponds to the database table business_delivery_notice_detail
75
+     *
76
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
77
+     */
78
+    public boolean isDistinct() {
79
+        return distinct;
80
+    }
81
+
82
+    /**
83
+     * This method was generated by MyBatis Generator.
84
+     * This method corresponds to the database table business_delivery_notice_detail
85
+     *
86
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
87
+     */
88
+    public List<Criteria> getOredCriteria() {
89
+        return oredCriteria;
90
+    }
91
+
92
+    /**
93
+     * This method was generated by MyBatis Generator.
94
+     * This method corresponds to the database table business_delivery_notice_detail
95
+     *
96
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
97
+     */
98
+    public void or(Criteria criteria) {
99
+        oredCriteria.add(criteria);
100
+    }
101
+
102
+    /**
103
+     * This method was generated by MyBatis Generator.
104
+     * This method corresponds to the database table business_delivery_notice_detail
105
+     *
106
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
107
+     */
108
+    public Criteria or() {
109
+        Criteria criteria = createCriteriaInternal();
110
+        oredCriteria.add(criteria);
111
+        return criteria;
112
+    }
113
+
114
+    /**
115
+     * This method was generated by MyBatis Generator.
116
+     * This method corresponds to the database table business_delivery_notice_detail
117
+     *
118
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
119
+     */
120
+    public Criteria createCriteria() {
121
+        Criteria criteria = createCriteriaInternal();
122
+        if (oredCriteria.size() == 0) {
123
+            oredCriteria.add(criteria);
124
+        }
125
+        return criteria;
126
+    }
127
+
128
+    /**
129
+     * This method was generated by MyBatis Generator.
130
+     * This method corresponds to the database table business_delivery_notice_detail
131
+     *
132
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
133
+     */
134
+    protected Criteria createCriteriaInternal() {
135
+        Criteria criteria = new Criteria();
136
+        return criteria;
137
+    }
138
+
139
+    /**
140
+     * This method was generated by MyBatis Generator.
141
+     * This method corresponds to the database table business_delivery_notice_detail
142
+     *
143
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
144
+     */
145
+    public void clear() {
146
+        oredCriteria.clear();
147
+        orderByClause = null;
148
+        distinct = false;
149
+    }
150
+
151
+    /**
152
+     * This class was generated by MyBatis Generator.
153
+     * This class corresponds to the database table business_delivery_notice_detail
154
+     *
155
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
156
+     */
157
+    protected abstract static class GeneratedCriteria {
158
+        protected List<Criterion> criteria;
159
+
160
+        protected GeneratedCriteria() {
161
+            super();
162
+            criteria = new ArrayList<Criterion>();
163
+        }
164
+
165
+        public boolean isValid() {
166
+            return criteria.size() > 0;
167
+        }
168
+
169
+        public List<Criterion> getAllCriteria() {
170
+            return criteria;
171
+        }
172
+
173
+        public List<Criterion> getCriteria() {
174
+            return criteria;
175
+        }
176
+
177
+        protected void addCriterion(String condition) {
178
+            if (condition == null) {
179
+                throw new RuntimeException("Value for condition cannot be null");
180
+            }
181
+            criteria.add(new Criterion(condition));
182
+        }
183
+
184
+        protected void addCriterion(String condition, Object value, String property) {
185
+            if (value == null) {
186
+                throw new RuntimeException("Value for " + property + " cannot be null");
187
+            }
188
+            criteria.add(new Criterion(condition, value));
189
+        }
190
+
191
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
192
+            if (value1 == null || value2 == null) {
193
+                throw new RuntimeException("Between values for " + property + " cannot be null");
194
+            }
195
+            criteria.add(new Criterion(condition, value1, value2));
196
+        }
197
+
198
+        public Criteria andIdIsNull() {
199
+            addCriterion("id is null");
200
+            return (Criteria) this;
201
+        }
202
+
203
+        public Criteria andIdIsNotNull() {
204
+            addCriterion("id is not null");
205
+            return (Criteria) this;
206
+        }
207
+
208
+        public Criteria andIdEqualTo(Integer value) {
209
+            addCriterion("id =", value, "id");
210
+            return (Criteria) this;
211
+        }
212
+
213
+        public Criteria andIdNotEqualTo(Integer value) {
214
+            addCriterion("id <>", value, "id");
215
+            return (Criteria) this;
216
+        }
217
+
218
+        public Criteria andIdGreaterThan(Integer value) {
219
+            addCriterion("id >", value, "id");
220
+            return (Criteria) this;
221
+        }
222
+
223
+        public Criteria andIdGreaterThanOrEqualTo(Integer value) {
224
+            addCriterion("id >=", value, "id");
225
+            return (Criteria) this;
226
+        }
227
+
228
+        public Criteria andIdLessThan(Integer value) {
229
+            addCriterion("id <", value, "id");
230
+            return (Criteria) this;
231
+        }
232
+
233
+        public Criteria andIdLessThanOrEqualTo(Integer value) {
234
+            addCriterion("id <=", value, "id");
235
+            return (Criteria) this;
236
+        }
237
+
238
+        public Criteria andIdIn(List<Integer> values) {
239
+            addCriterion("id in", values, "id");
240
+            return (Criteria) this;
241
+        }
242
+
243
+        public Criteria andIdNotIn(List<Integer> values) {
244
+            addCriterion("id not in", values, "id");
245
+            return (Criteria) this;
246
+        }
247
+
248
+        public Criteria andIdBetween(Integer value1, Integer value2) {
249
+            addCriterion("id between", value1, value2, "id");
250
+            return (Criteria) this;
251
+        }
252
+
253
+        public Criteria andIdNotBetween(Integer value1, Integer value2) {
254
+            addCriterion("id not between", value1, value2, "id");
255
+            return (Criteria) this;
256
+        }
257
+
258
+        public Criteria andZidIsNull() {
259
+            addCriterion("zid is null");
260
+            return (Criteria) this;
261
+        }
262
+
263
+        public Criteria andZidIsNotNull() {
264
+            addCriterion("zid is not null");
265
+            return (Criteria) this;
266
+        }
267
+
268
+        public Criteria andZidEqualTo(Integer value) {
269
+            addCriterion("zid =", value, "zid");
270
+            return (Criteria) this;
271
+        }
272
+
273
+        public Criteria andZidNotEqualTo(Integer value) {
274
+            addCriterion("zid <>", value, "zid");
275
+            return (Criteria) this;
276
+        }
277
+
278
+        public Criteria andZidGreaterThan(Integer value) {
279
+            addCriterion("zid >", value, "zid");
280
+            return (Criteria) this;
281
+        }
282
+
283
+        public Criteria andZidGreaterThanOrEqualTo(Integer value) {
284
+            addCriterion("zid >=", value, "zid");
285
+            return (Criteria) this;
286
+        }
287
+
288
+        public Criteria andZidLessThan(Integer value) {
289
+            addCriterion("zid <", value, "zid");
290
+            return (Criteria) this;
291
+        }
292
+
293
+        public Criteria andZidLessThanOrEqualTo(Integer value) {
294
+            addCriterion("zid <=", value, "zid");
295
+            return (Criteria) this;
296
+        }
297
+
298
+        public Criteria andZidIn(List<Integer> values) {
299
+            addCriterion("zid in", values, "zid");
300
+            return (Criteria) this;
301
+        }
302
+
303
+        public Criteria andZidNotIn(List<Integer> values) {
304
+            addCriterion("zid not in", values, "zid");
305
+            return (Criteria) this;
306
+        }
307
+
308
+        public Criteria andZidBetween(Integer value1, Integer value2) {
309
+            addCriterion("zid between", value1, value2, "zid");
310
+            return (Criteria) this;
311
+        }
312
+
313
+        public Criteria andZidNotBetween(Integer value1, Integer value2) {
314
+            addCriterion("zid not between", value1, value2, "zid");
315
+            return (Criteria) this;
316
+        }
317
+
318
+        public Criteria andWarehouseIsNull() {
319
+            addCriterion("warehouse is null");
320
+            return (Criteria) this;
321
+        }
322
+
323
+        public Criteria andWarehouseIsNotNull() {
324
+            addCriterion("warehouse is not null");
325
+            return (Criteria) this;
326
+        }
327
+
328
+        public Criteria andWarehouseEqualTo(Integer value) {
329
+            addCriterion("warehouse =", value, "warehouse");
330
+            return (Criteria) this;
331
+        }
332
+
333
+        public Criteria andWarehouseNotEqualTo(Integer value) {
334
+            addCriterion("warehouse <>", value, "warehouse");
335
+            return (Criteria) this;
336
+        }
337
+
338
+        public Criteria andWarehouseGreaterThan(Integer value) {
339
+            addCriterion("warehouse >", value, "warehouse");
340
+            return (Criteria) this;
341
+        }
342
+
343
+        public Criteria andWarehouseGreaterThanOrEqualTo(Integer value) {
344
+            addCriterion("warehouse >=", value, "warehouse");
345
+            return (Criteria) this;
346
+        }
347
+
348
+        public Criteria andWarehouseLessThan(Integer value) {
349
+            addCriterion("warehouse <", value, "warehouse");
350
+            return (Criteria) this;
351
+        }
352
+
353
+        public Criteria andWarehouseLessThanOrEqualTo(Integer value) {
354
+            addCriterion("warehouse <=", value, "warehouse");
355
+            return (Criteria) this;
356
+        }
357
+
358
+        public Criteria andWarehouseIn(List<Integer> values) {
359
+            addCriterion("warehouse in", values, "warehouse");
360
+            return (Criteria) this;
361
+        }
362
+
363
+        public Criteria andWarehouseNotIn(List<Integer> values) {
364
+            addCriterion("warehouse not in", values, "warehouse");
365
+            return (Criteria) this;
366
+        }
367
+
368
+        public Criteria andWarehouseBetween(Integer value1, Integer value2) {
369
+            addCriterion("warehouse between", value1, value2, "warehouse");
370
+            return (Criteria) this;
371
+        }
372
+
373
+        public Criteria andWarehouseNotBetween(Integer value1, Integer value2) {
374
+            addCriterion("warehouse not between", value1, value2, "warehouse");
375
+            return (Criteria) this;
376
+        }
377
+
378
+        public Criteria andGoodsLocationIsNull() {
379
+            addCriterion("goods_location is null");
380
+            return (Criteria) this;
381
+        }
382
+
383
+        public Criteria andGoodsLocationIsNotNull() {
384
+            addCriterion("goods_location is not null");
385
+            return (Criteria) this;
386
+        }
387
+
388
+        public Criteria andGoodsLocationEqualTo(Integer value) {
389
+            addCriterion("goods_location =", value, "goodsLocation");
390
+            return (Criteria) this;
391
+        }
392
+
393
+        public Criteria andGoodsLocationNotEqualTo(Integer value) {
394
+            addCriterion("goods_location <>", value, "goodsLocation");
395
+            return (Criteria) this;
396
+        }
397
+
398
+        public Criteria andGoodsLocationGreaterThan(Integer value) {
399
+            addCriterion("goods_location >", value, "goodsLocation");
400
+            return (Criteria) this;
401
+        }
402
+
403
+        public Criteria andGoodsLocationGreaterThanOrEqualTo(Integer value) {
404
+            addCriterion("goods_location >=", value, "goodsLocation");
405
+            return (Criteria) this;
406
+        }
407
+
408
+        public Criteria andGoodsLocationLessThan(Integer value) {
409
+            addCriterion("goods_location <", value, "goodsLocation");
410
+            return (Criteria) this;
411
+        }
412
+
413
+        public Criteria andGoodsLocationLessThanOrEqualTo(Integer value) {
414
+            addCriterion("goods_location <=", value, "goodsLocation");
415
+            return (Criteria) this;
416
+        }
417
+
418
+        public Criteria andGoodsLocationIn(List<Integer> values) {
419
+            addCriterion("goods_location in", values, "goodsLocation");
420
+            return (Criteria) this;
421
+        }
422
+
423
+        public Criteria andGoodsLocationNotIn(List<Integer> values) {
424
+            addCriterion("goods_location not in", values, "goodsLocation");
425
+            return (Criteria) this;
426
+        }
427
+
428
+        public Criteria andGoodsLocationBetween(Integer value1, Integer value2) {
429
+            addCriterion("goods_location between", value1, value2, "goodsLocation");
430
+            return (Criteria) this;
431
+        }
432
+
433
+        public Criteria andGoodsLocationNotBetween(Integer value1, Integer value2) {
434
+            addCriterion("goods_location not between", value1, value2, "goodsLocation");
435
+            return (Criteria) this;
436
+        }
437
+
438
+        public Criteria andShipingCountIsNull() {
439
+            addCriterion("shiping_count is null");
440
+            return (Criteria) this;
441
+        }
442
+
443
+        public Criteria andShipingCountIsNotNull() {
444
+            addCriterion("shiping_count is not null");
445
+            return (Criteria) this;
446
+        }
447
+
448
+        public Criteria andShipingCountEqualTo(String value) {
449
+            addCriterion("shiping_count =", value, "shipingCount");
450
+            return (Criteria) this;
451
+        }
452
+
453
+        public Criteria andShipingCountNotEqualTo(String value) {
454
+            addCriterion("shiping_count <>", value, "shipingCount");
455
+            return (Criteria) this;
456
+        }
457
+
458
+        public Criteria andShipingCountGreaterThan(String value) {
459
+            addCriterion("shiping_count >", value, "shipingCount");
460
+            return (Criteria) this;
461
+        }
462
+
463
+        public Criteria andShipingCountGreaterThanOrEqualTo(String value) {
464
+            addCriterion("shiping_count >=", value, "shipingCount");
465
+            return (Criteria) this;
466
+        }
467
+
468
+        public Criteria andShipingCountLessThan(String value) {
469
+            addCriterion("shiping_count <", value, "shipingCount");
470
+            return (Criteria) this;
471
+        }
472
+
473
+        public Criteria andShipingCountLessThanOrEqualTo(String value) {
474
+            addCriterion("shiping_count <=", value, "shipingCount");
475
+            return (Criteria) this;
476
+        }
477
+
478
+        public Criteria andShipingCountLike(String value) {
479
+            addCriterion("shiping_count like", value, "shipingCount");
480
+            return (Criteria) this;
481
+        }
482
+
483
+        public Criteria andShipingCountNotLike(String value) {
484
+            addCriterion("shiping_count not like", value, "shipingCount");
485
+            return (Criteria) this;
486
+        }
487
+
488
+        public Criteria andShipingCountIn(List<String> values) {
489
+            addCriterion("shiping_count in", values, "shipingCount");
490
+            return (Criteria) this;
491
+        }
492
+
493
+        public Criteria andShipingCountNotIn(List<String> values) {
494
+            addCriterion("shiping_count not in", values, "shipingCount");
495
+            return (Criteria) this;
496
+        }
497
+
498
+        public Criteria andShipingCountBetween(String value1, String value2) {
499
+            addCriterion("shiping_count between", value1, value2, "shipingCount");
500
+            return (Criteria) this;
501
+        }
502
+
503
+        public Criteria andShipingCountNotBetween(String value1, String value2) {
504
+            addCriterion("shiping_count not between", value1, value2, "shipingCount");
505
+            return (Criteria) this;
506
+        }
507
+
508
+        public Criteria andCreateTimeIsNull() {
509
+            addCriterion("create_time is null");
510
+            return (Criteria) this;
511
+        }
512
+
513
+        public Criteria andCreateTimeIsNotNull() {
514
+            addCriterion("create_time is not null");
515
+            return (Criteria) this;
516
+        }
517
+
518
+        public Criteria andCreateTimeEqualTo(Date value) {
519
+            addCriterion("create_time =", value, "createTime");
520
+            return (Criteria) this;
521
+        }
522
+
523
+        public Criteria andCreateTimeNotEqualTo(Date value) {
524
+            addCriterion("create_time <>", value, "createTime");
525
+            return (Criteria) this;
526
+        }
527
+
528
+        public Criteria andCreateTimeGreaterThan(Date value) {
529
+            addCriterion("create_time >", value, "createTime");
530
+            return (Criteria) this;
531
+        }
532
+
533
+        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
534
+            addCriterion("create_time >=", value, "createTime");
535
+            return (Criteria) this;
536
+        }
537
+
538
+        public Criteria andCreateTimeLessThan(Date value) {
539
+            addCriterion("create_time <", value, "createTime");
540
+            return (Criteria) this;
541
+        }
542
+
543
+        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
544
+            addCriterion("create_time <=", value, "createTime");
545
+            return (Criteria) this;
546
+        }
547
+
548
+        public Criteria andCreateTimeIn(List<Date> values) {
549
+            addCriterion("create_time in", values, "createTime");
550
+            return (Criteria) this;
551
+        }
552
+
553
+        public Criteria andCreateTimeNotIn(List<Date> values) {
554
+            addCriterion("create_time not in", values, "createTime");
555
+            return (Criteria) this;
556
+        }
557
+
558
+        public Criteria andCreateTimeBetween(Date value1, Date value2) {
559
+            addCriterion("create_time between", value1, value2, "createTime");
560
+            return (Criteria) this;
561
+        }
562
+
563
+        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
564
+            addCriterion("create_time not between", value1, value2, "createTime");
565
+            return (Criteria) this;
566
+        }
567
+
568
+        public Criteria andOrgIdIsNull() {
569
+            addCriterion("org_id is null");
570
+            return (Criteria) this;
571
+        }
572
+
573
+        public Criteria andOrgIdIsNotNull() {
574
+            addCriterion("org_id is not null");
575
+            return (Criteria) this;
576
+        }
577
+
578
+        public Criteria andOrgIdEqualTo(Integer value) {
579
+            addCriterion("org_id =", value, "orgId");
580
+            return (Criteria) this;
581
+        }
582
+
583
+        public Criteria andOrgIdNotEqualTo(Integer value) {
584
+            addCriterion("org_id <>", value, "orgId");
585
+            return (Criteria) this;
586
+        }
587
+
588
+        public Criteria andOrgIdGreaterThan(Integer value) {
589
+            addCriterion("org_id >", value, "orgId");
590
+            return (Criteria) this;
591
+        }
592
+
593
+        public Criteria andOrgIdGreaterThanOrEqualTo(Integer value) {
594
+            addCriterion("org_id >=", value, "orgId");
595
+            return (Criteria) this;
596
+        }
597
+
598
+        public Criteria andOrgIdLessThan(Integer value) {
599
+            addCriterion("org_id <", value, "orgId");
600
+            return (Criteria) this;
601
+        }
602
+
603
+        public Criteria andOrgIdLessThanOrEqualTo(Integer value) {
604
+            addCriterion("org_id <=", value, "orgId");
605
+            return (Criteria) this;
606
+        }
607
+
608
+        public Criteria andOrgIdIn(List<Integer> values) {
609
+            addCriterion("org_id in", values, "orgId");
610
+            return (Criteria) this;
611
+        }
612
+
613
+        public Criteria andOrgIdNotIn(List<Integer> values) {
614
+            addCriterion("org_id not in", values, "orgId");
615
+            return (Criteria) this;
616
+        }
617
+
618
+        public Criteria andOrgIdBetween(Integer value1, Integer value2) {
619
+            addCriterion("org_id between", value1, value2, "orgId");
620
+            return (Criteria) this;
621
+        }
622
+
623
+        public Criteria andOrgIdNotBetween(Integer value1, Integer value2) {
624
+            addCriterion("org_id not between", value1, value2, "orgId");
625
+            return (Criteria) this;
626
+        }
627
+
628
+        public Criteria andHouseIdIsNull() {
629
+            addCriterion("house_id is null");
630
+            return (Criteria) this;
631
+        }
632
+
633
+        public Criteria andHouseIdIsNotNull() {
634
+            addCriterion("house_id is not null");
635
+            return (Criteria) this;
636
+        }
637
+
638
+        public Criteria andHouseIdEqualTo(Integer value) {
639
+            addCriterion("house_id =", value, "houseId");
640
+            return (Criteria) this;
641
+        }
642
+
643
+        public Criteria andHouseIdNotEqualTo(Integer value) {
644
+            addCriterion("house_id <>", value, "houseId");
645
+            return (Criteria) this;
646
+        }
647
+
648
+        public Criteria andHouseIdGreaterThan(Integer value) {
649
+            addCriterion("house_id >", value, "houseId");
650
+            return (Criteria) this;
651
+        }
652
+
653
+        public Criteria andHouseIdGreaterThanOrEqualTo(Integer value) {
654
+            addCriterion("house_id >=", value, "houseId");
655
+            return (Criteria) this;
656
+        }
657
+
658
+        public Criteria andHouseIdLessThan(Integer value) {
659
+            addCriterion("house_id <", value, "houseId");
660
+            return (Criteria) this;
661
+        }
662
+
663
+        public Criteria andHouseIdLessThanOrEqualTo(Integer value) {
664
+            addCriterion("house_id <=", value, "houseId");
665
+            return (Criteria) this;
666
+        }
667
+
668
+        public Criteria andHouseIdIn(List<Integer> values) {
669
+            addCriterion("house_id in", values, "houseId");
670
+            return (Criteria) this;
671
+        }
672
+
673
+        public Criteria andHouseIdNotIn(List<Integer> values) {
674
+            addCriterion("house_id not in", values, "houseId");
675
+            return (Criteria) this;
676
+        }
677
+
678
+        public Criteria andHouseIdBetween(Integer value1, Integer value2) {
679
+            addCriterion("house_id between", value1, value2, "houseId");
680
+            return (Criteria) this;
681
+        }
682
+
683
+        public Criteria andHouseIdNotBetween(Integer value1, Integer value2) {
684
+            addCriterion("house_id not between", value1, value2, "houseId");
685
+            return (Criteria) this;
686
+        }
687
+
688
+        public Criteria andHouseNameIsNull() {
689
+            addCriterion("house_name is null");
690
+            return (Criteria) this;
691
+        }
692
+
693
+        public Criteria andHouseNameIsNotNull() {
694
+            addCriterion("house_name is not null");
695
+            return (Criteria) this;
696
+        }
697
+
698
+        public Criteria andHouseNameEqualTo(String value) {
699
+            addCriterion("house_name =", value, "houseName");
700
+            return (Criteria) this;
701
+        }
702
+
703
+        public Criteria andHouseNameNotEqualTo(String value) {
704
+            addCriterion("house_name <>", value, "houseName");
705
+            return (Criteria) this;
706
+        }
707
+
708
+        public Criteria andHouseNameGreaterThan(String value) {
709
+            addCriterion("house_name >", value, "houseName");
710
+            return (Criteria) this;
711
+        }
712
+
713
+        public Criteria andHouseNameGreaterThanOrEqualTo(String value) {
714
+            addCriterion("house_name >=", value, "houseName");
715
+            return (Criteria) this;
716
+        }
717
+
718
+        public Criteria andHouseNameLessThan(String value) {
719
+            addCriterion("house_name <", value, "houseName");
720
+            return (Criteria) this;
721
+        }
722
+
723
+        public Criteria andHouseNameLessThanOrEqualTo(String value) {
724
+            addCriterion("house_name <=", value, "houseName");
725
+            return (Criteria) this;
726
+        }
727
+
728
+        public Criteria andHouseNameLike(String value) {
729
+            addCriterion("house_name like", value, "houseName");
730
+            return (Criteria) this;
731
+        }
732
+
733
+        public Criteria andHouseNameNotLike(String value) {
734
+            addCriterion("house_name not like", value, "houseName");
735
+            return (Criteria) this;
736
+        }
737
+
738
+        public Criteria andHouseNameIn(List<String> values) {
739
+            addCriterion("house_name in", values, "houseName");
740
+            return (Criteria) this;
741
+        }
742
+
743
+        public Criteria andHouseNameNotIn(List<String> values) {
744
+            addCriterion("house_name not in", values, "houseName");
745
+            return (Criteria) this;
746
+        }
747
+
748
+        public Criteria andHouseNameBetween(String value1, String value2) {
749
+            addCriterion("house_name between", value1, value2, "houseName");
750
+            return (Criteria) this;
751
+        }
752
+
753
+        public Criteria andHouseNameNotBetween(String value1, String value2) {
754
+            addCriterion("house_name not between", value1, value2, "houseName");
755
+            return (Criteria) this;
756
+        }
757
+
758
+        public Criteria andWarehouseIdIsNull() {
759
+            addCriterion("warehouse_id is null");
760
+            return (Criteria) this;
761
+        }
762
+
763
+        public Criteria andWarehouseIdIsNotNull() {
764
+            addCriterion("warehouse_id is not null");
765
+            return (Criteria) this;
766
+        }
767
+
768
+        public Criteria andWarehouseIdEqualTo(Integer value) {
769
+            addCriterion("warehouse_id =", value, "warehouseId");
770
+            return (Criteria) this;
771
+        }
772
+
773
+        public Criteria andWarehouseIdNotEqualTo(Integer value) {
774
+            addCriterion("warehouse_id <>", value, "warehouseId");
775
+            return (Criteria) this;
776
+        }
777
+
778
+        public Criteria andWarehouseIdGreaterThan(Integer value) {
779
+            addCriterion("warehouse_id >", value, "warehouseId");
780
+            return (Criteria) this;
781
+        }
782
+
783
+        public Criteria andWarehouseIdGreaterThanOrEqualTo(Integer value) {
784
+            addCriterion("warehouse_id >=", value, "warehouseId");
785
+            return (Criteria) this;
786
+        }
787
+
788
+        public Criteria andWarehouseIdLessThan(Integer value) {
789
+            addCriterion("warehouse_id <", value, "warehouseId");
790
+            return (Criteria) this;
791
+        }
792
+
793
+        public Criteria andWarehouseIdLessThanOrEqualTo(Integer value) {
794
+            addCriterion("warehouse_id <=", value, "warehouseId");
795
+            return (Criteria) this;
796
+        }
797
+
798
+        public Criteria andWarehouseIdIn(List<Integer> values) {
799
+            addCriterion("warehouse_id in", values, "warehouseId");
800
+            return (Criteria) this;
801
+        }
802
+
803
+        public Criteria andWarehouseIdNotIn(List<Integer> values) {
804
+            addCriterion("warehouse_id not in", values, "warehouseId");
805
+            return (Criteria) this;
806
+        }
807
+
808
+        public Criteria andWarehouseIdBetween(Integer value1, Integer value2) {
809
+            addCriterion("warehouse_id between", value1, value2, "warehouseId");
810
+            return (Criteria) this;
811
+        }
812
+
813
+        public Criteria andWarehouseIdNotBetween(Integer value1, Integer value2) {
814
+            addCriterion("warehouse_id not between", value1, value2, "warehouseId");
815
+            return (Criteria) this;
816
+        }
817
+
818
+        public Criteria andWarehouseNameIsNull() {
819
+            addCriterion("warehouse_name is null");
820
+            return (Criteria) this;
821
+        }
822
+
823
+        public Criteria andWarehouseNameIsNotNull() {
824
+            addCriterion("warehouse_name is not null");
825
+            return (Criteria) this;
826
+        }
827
+
828
+        public Criteria andWarehouseNameEqualTo(String value) {
829
+            addCriterion("warehouse_name =", value, "warehouseName");
830
+            return (Criteria) this;
831
+        }
832
+
833
+        public Criteria andWarehouseNameNotEqualTo(String value) {
834
+            addCriterion("warehouse_name <>", value, "warehouseName");
835
+            return (Criteria) this;
836
+        }
837
+
838
+        public Criteria andWarehouseNameGreaterThan(String value) {
839
+            addCriterion("warehouse_name >", value, "warehouseName");
840
+            return (Criteria) this;
841
+        }
842
+
843
+        public Criteria andWarehouseNameGreaterThanOrEqualTo(String value) {
844
+            addCriterion("warehouse_name >=", value, "warehouseName");
845
+            return (Criteria) this;
846
+        }
847
+
848
+        public Criteria andWarehouseNameLessThan(String value) {
849
+            addCriterion("warehouse_name <", value, "warehouseName");
850
+            return (Criteria) this;
851
+        }
852
+
853
+        public Criteria andWarehouseNameLessThanOrEqualTo(String value) {
854
+            addCriterion("warehouse_name <=", value, "warehouseName");
855
+            return (Criteria) this;
856
+        }
857
+
858
+        public Criteria andWarehouseNameLike(String value) {
859
+            addCriterion("warehouse_name like", value, "warehouseName");
860
+            return (Criteria) this;
861
+        }
862
+
863
+        public Criteria andWarehouseNameNotLike(String value) {
864
+            addCriterion("warehouse_name not like", value, "warehouseName");
865
+            return (Criteria) this;
866
+        }
867
+
868
+        public Criteria andWarehouseNameIn(List<String> values) {
869
+            addCriterion("warehouse_name in", values, "warehouseName");
870
+            return (Criteria) this;
871
+        }
872
+
873
+        public Criteria andWarehouseNameNotIn(List<String> values) {
874
+            addCriterion("warehouse_name not in", values, "warehouseName");
875
+            return (Criteria) this;
876
+        }
877
+
878
+        public Criteria andWarehouseNameBetween(String value1, String value2) {
879
+            addCriterion("warehouse_name between", value1, value2, "warehouseName");
880
+            return (Criteria) this;
881
+        }
882
+
883
+        public Criteria andWarehouseNameNotBetween(String value1, String value2) {
884
+            addCriterion("warehouse_name not between", value1, value2, "warehouseName");
885
+            return (Criteria) this;
886
+        }
887
+    }
888
+
889
+    /**
890
+     * This class was generated by MyBatis Generator.
891
+     * This class corresponds to the database table business_delivery_notice_detail
892
+     *
893
+     * @mbggenerated do_not_delete_during_merge Tue Oct 31 21:14:31 CST 2017
894
+     */
895
+    public static class Criteria extends GeneratedCriteria {
896
+
897
+        protected Criteria() {
898
+            super();
899
+        }
900
+    }
901
+
902
+    /**
903
+     * This class was generated by MyBatis Generator.
904
+     * This class corresponds to the database table business_delivery_notice_detail
905
+     *
906
+     * @mbggenerated Tue Oct 31 21:14:31 CST 2017
907
+     */
908
+    public static class Criterion {
909
+        private String condition;
910
+
911
+        private Object value;
912
+
913
+        private Object secondValue;
914
+
915
+        private boolean noValue;
916
+
917
+        private boolean singleValue;
918
+
919
+        private boolean betweenValue;
920
+
921
+        private boolean listValue;
922
+
923
+        private String typeHandler;
924
+
925
+        public String getCondition() {
926
+            return condition;
927
+        }
928
+
929
+        public Object getValue() {
930
+            return value;
931
+        }
932
+
933
+        public Object getSecondValue() {
934
+            return secondValue;
935
+        }
936
+
937
+        public boolean isNoValue() {
938
+            return noValue;
939
+        }
940
+
941
+        public boolean isSingleValue() {
942
+            return singleValue;
943
+        }
944
+
945
+        public boolean isBetweenValue() {
946
+            return betweenValue;
947
+        }
948
+
949
+        public boolean isListValue() {
950
+            return listValue;
951
+        }
952
+
953
+        public String getTypeHandler() {
954
+            return typeHandler;
955
+        }
956
+
957
+        protected Criterion(String condition) {
958
+            super();
959
+            this.condition = condition;
960
+            this.typeHandler = null;
961
+            this.noValue = true;
962
+        }
963
+
964
+        protected Criterion(String condition, Object value, String typeHandler) {
965
+            super();
966
+            this.condition = condition;
967
+            this.value = value;
968
+            this.typeHandler = typeHandler;
969
+            if (value instanceof List<?>) {
970
+                this.listValue = true;
971
+            } else {
972
+                this.singleValue = true;
973
+            }
974
+        }
975
+
976
+        protected Criterion(String condition, Object value) {
977
+            this(condition, value, null);
978
+        }
979
+
980
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
981
+            super();
982
+            this.condition = condition;
983
+            this.value = value;
984
+            this.secondValue = secondValue;
985
+            this.typeHandler = typeHandler;
986
+            this.betweenValue = true;
987
+        }
988
+
989
+        protected Criterion(String condition, Object value, Object secondValue) {
990
+            this(condition, value, secondValue, null);
991
+        }
992
+    }
993
+}

+ 828 - 0
src/main/java/com/chinaitop/depot/business/model/BusinessDeliveryStorageNotice.java

@@ -0,0 +1,828 @@
1
+package com.chinaitop.depot.business.model;
2
+
3
+import java.util.Date;
4
+
5
+public class BusinessDeliveryStorageNotice {
6
+    private Integer id;
7
+
8
+    private String billType;
9
+
10
+    private Integer billTypeId;
11
+
12
+    private String billNumber;
13
+
14
+    private String shipingCount;
15
+
16
+    private String finishedCount;
17
+
18
+    private String receivedMoney;
19
+
20
+    private Integer customerBid;
21
+
22
+    private String customerNumber;
23
+
24
+    private String mobile;
25
+
26
+    private String deliveryCustomer;
27
+
28
+    private String contract;
29
+
30
+    private Integer contractBid;
31
+
32
+    private String planNumber;
33
+
34
+    private Integer planBid;
35
+
36
+    private String billMemo;
37
+
38
+    private String grainPrice;
39
+
40
+    private String moneyQuantity;
41
+
42
+    private Integer grainAnnual;
43
+
44
+    private Integer warehouse;
45
+
46
+    private Integer goodsLocation;
47
+
48
+    private String auditState;
49
+
50
+    private Date storageTime;
51
+
52
+    private String processInstanceId;
53
+
54
+    private String processDefinitionId;
55
+
56
+    private String qualityStandard;
57
+
58
+    private Date agreeTime;
59
+
60
+    private String billMan;
61
+
62
+    private Date billDate;
63
+
64
+    private String billUnit;
65
+
66
+    private Integer houseId;
67
+
68
+    private String houseName;
69
+
70
+    private Integer warehouseId;
71
+
72
+    private String warehouseName;
73
+
74
+    private String creater;
75
+
76
+    private Date createTime;
77
+
78
+    private String createUnit;
79
+
80
+    private String createDepot;
81
+
82
+    private Date updateTime;
83
+
84
+    private Integer orgId;
85
+
86
+    private Integer inApplication;
87
+
88
+    private Integer createrId;
89
+
90
+    private Integer rootContractBid;
91
+
92
+    private String identification;
93
+
94
+    private String carnumber;
95
+    
96
+    //业务字段(用于通知单新增)
97
+    private Integer grainProducingArea;
98
+    
99
+    
100
+
101
+    public Integer getGrainProducingArea() {
102
+		return grainProducingArea;
103
+	}
104
+
105
+	public void setGrainProducingArea(Integer grainProducingArea) {
106
+		this.grainProducingArea = grainProducingArea;
107
+	}
108
+
109
+	/**
110
+     * 
111
+     * @return id 
112
+     */
113
+    public Integer getId() {
114
+        return id;
115
+    }
116
+
117
+    /**
118
+     * 
119
+     * @param id 
120
+     */
121
+    public void setId(Integer id) {
122
+        this.id = id;
123
+    }
124
+
125
+    /**
126
+     * 凭证类型(1 入库凭证;3 出库凭证)
127
+     * @return bill_type 凭证类型(1 入库凭证;3 出库凭证)
128
+     */
129
+    public String getBillType() {
130
+        return billType;
131
+    }
132
+
133
+    /**
134
+     * 凭证类型(1 入库凭证;3 出库凭证)
135
+     * @param billType 凭证类型(1 入库凭证;3 出库凭证)
136
+     */
137
+    public void setBillType(String billType) {
138
+        this.billType = billType == null ? null : billType.trim();
139
+    }
140
+
141
+    /**
142
+     * 出入库通知单类型id
143
+     * @return bill_type_id 出入库通知单类型id
144
+     */
145
+    public Integer getBillTypeId() {
146
+        return billTypeId;
147
+    }
148
+
149
+    /**
150
+     * 出入库通知单类型id
151
+     * @param billTypeId 出入库通知单类型id
152
+     */
153
+    public void setBillTypeId(Integer billTypeId) {
154
+        this.billTypeId = billTypeId;
155
+    }
156
+
157
+    /**
158
+     * 通知单编号
159
+     * @return bill_number 通知单编号
160
+     */
161
+    public String getBillNumber() {
162
+        return billNumber;
163
+    }
164
+
165
+    /**
166
+     * 通知单编号
167
+     * @param billNumber 通知单编号
168
+     */
169
+    public void setBillNumber(String billNumber) {
170
+        this.billNumber = billNumber == null ? null : billNumber.trim();
171
+    }
172
+
173
+    /**
174
+     * 数量
175
+     * @return shiping_count 数量
176
+     */
177
+    public String getShipingCount() {
178
+        return shipingCount;
179
+    }
180
+
181
+    /**
182
+     * 数量
183
+     * @param shipingCount 数量
184
+     */
185
+    public void setShipingCount(String shipingCount) {
186
+        this.shipingCount = shipingCount == null ? null : shipingCount.trim();
187
+    }
188
+
189
+    /**
190
+     * 完成数量
191
+     * @return finished_count 完成数量
192
+     */
193
+    public String getFinishedCount() {
194
+        return finishedCount;
195
+    }
196
+
197
+    /**
198
+     * 完成数量
199
+     * @param finishedCount 完成数量
200
+     */
201
+    public void setFinishedCount(String finishedCount) {
202
+        this.finishedCount = finishedCount == null ? null : finishedCount.trim();
203
+    }
204
+
205
+    /**
206
+     * 已收到总金额
207
+     * @return received_money 已收到总金额
208
+     */
209
+    public String getReceivedMoney() {
210
+        return receivedMoney;
211
+    }
212
+
213
+    /**
214
+     * 已收到总金额
215
+     * @param receivedMoney 已收到总金额
216
+     */
217
+    public void setReceivedMoney(String receivedMoney) {
218
+        this.receivedMoney = receivedMoney == null ? null : receivedMoney.trim();
219
+    }
220
+
221
+    /**
222
+     * 客户id
223
+     * @return customer_bid 客户id
224
+     */
225
+    public Integer getCustomerBid() {
226
+        return customerBid;
227
+    }
228
+
229
+    /**
230
+     * 客户id
231
+     * @param customerBid 客户id
232
+     */
233
+    public void setCustomerBid(Integer customerBid) {
234
+        this.customerBid = customerBid;
235
+    }
236
+
237
+    /**
238
+     * 
239
+     * @return customer_number 
240
+     */
241
+    public String getCustomerNumber() {
242
+        return customerNumber;
243
+    }
244
+
245
+    /**
246
+     * 
247
+     * @param customerNumber 
248
+     */
249
+    public void setCustomerNumber(String customerNumber) {
250
+        this.customerNumber = customerNumber == null ? null : customerNumber.trim();
251
+    }
252
+
253
+    /**
254
+     * 联系电话
255
+     * @return mobile 联系电话
256
+     */
257
+    public String getMobile() {
258
+        return mobile;
259
+    }
260
+
261
+    /**
262
+     * 联系电话
263
+     * @param mobile 联系电话
264
+     */
265
+    public void setMobile(String mobile) {
266
+        this.mobile = mobile == null ? null : mobile.trim();
267
+    }
268
+
269
+    /**
270
+     * 单位名称(提货单的提货单位;或者是发货单的发货单位)
271
+     * @return delivery_customer 单位名称(提货单的提货单位;或者是发货单的发货单位)
272
+     */
273
+    public String getDeliveryCustomer() {
274
+        return deliveryCustomer;
275
+    }
276
+
277
+    /**
278
+     * 单位名称(提货单的提货单位;或者是发货单的发货单位)
279
+     * @param deliveryCustomer 单位名称(提货单的提货单位;或者是发货单的发货单位)
280
+     */
281
+    public void setDeliveryCustomer(String deliveryCustomer) {
282
+        this.deliveryCustomer = deliveryCustomer == null ? null : deliveryCustomer.trim();
283
+    }
284
+
285
+    /**
286
+     * 合同编号
287
+     * @return contract 合同编号
288
+     */
289
+    public String getContract() {
290
+        return contract;
291
+    }
292
+
293
+    /**
294
+     * 合同编号
295
+     * @param contract 合同编号
296
+     */
297
+    public void setContract(String contract) {
298
+        this.contract = contract == null ? null : contract.trim();
299
+    }
300
+
301
+    /**
302
+     * 合同id
303
+     * @return contract_bid 合同id
304
+     */
305
+    public Integer getContractBid() {
306
+        return contractBid;
307
+    }
308
+
309
+    /**
310
+     * 合同id
311
+     * @param contractBid 合同id
312
+     */
313
+    public void setContractBid(Integer contractBid) {
314
+        this.contractBid = contractBid;
315
+    }
316
+
317
+    /**
318
+     * 计划编号
319
+     * @return plan_number 计划编号
320
+     */
321
+    public String getPlanNumber() {
322
+        return planNumber;
323
+    }
324
+
325
+    /**
326
+     * 计划编号
327
+     * @param planNumber 计划编号
328
+     */
329
+    public void setPlanNumber(String planNumber) {
330
+        this.planNumber = planNumber == null ? null : planNumber.trim();
331
+    }
332
+
333
+    /**
334
+     * 计划id
335
+     * @return plan_bid 计划id
336
+     */
337
+    public Integer getPlanBid() {
338
+        return planBid;
339
+    }
340
+
341
+    /**
342
+     * 计划id
343
+     * @param planBid 计划id
344
+     */
345
+    public void setPlanBid(Integer planBid) {
346
+        this.planBid = planBid;
347
+    }
348
+
349
+    /**
350
+     * 备注
351
+     * @return bill_memo 备注
352
+     */
353
+    public String getBillMemo() {
354
+        return billMemo;
355
+    }
356
+
357
+    /**
358
+     * 备注
359
+     * @param billMemo 备注
360
+     */
361
+    public void setBillMemo(String billMemo) {
362
+        this.billMemo = billMemo == null ? null : billMemo.trim();
363
+    }
364
+
365
+    /**
366
+     * 
367
+     * @return grain_price 
368
+     */
369
+    public String getGrainPrice() {
370
+        return grainPrice;
371
+    }
372
+
373
+    /**
374
+     * 
375
+     * @param grainPrice 
376
+     */
377
+    public void setGrainPrice(String grainPrice) {
378
+        this.grainPrice = grainPrice == null ? null : grainPrice.trim();
379
+    }
380
+
381
+    /**
382
+     * 金额
383
+     * @return money_quantity 金额
384
+     */
385
+    public String getMoneyQuantity() {
386
+        return moneyQuantity;
387
+    }
388
+
389
+    /**
390
+     * 金额
391
+     * @param moneyQuantity 金额
392
+     */
393
+    public void setMoneyQuantity(String moneyQuantity) {
394
+        this.moneyQuantity = moneyQuantity == null ? null : moneyQuantity.trim();
395
+    }
396
+
397
+    /**
398
+     * 粮食年期
399
+     * @return grain_annual 粮食年期
400
+     */
401
+    public Integer getGrainAnnual() {
402
+        return grainAnnual;
403
+    }
404
+
405
+    /**
406
+     * 粮食年期
407
+     * @param grainAnnual 粮食年期
408
+     */
409
+    public void setGrainAnnual(Integer grainAnnual) {
410
+        this.grainAnnual = grainAnnual;
411
+    }
412
+
413
+    /**
414
+     * 绑定的仓库
415
+     * @return warehouse 绑定的仓库
416
+     */
417
+    public Integer getWarehouse() {
418
+        return warehouse;
419
+    }
420
+
421
+    /**
422
+     * 绑定的仓库
423
+     * @param warehouse 绑定的仓库
424
+     */
425
+    public void setWarehouse(Integer warehouse) {
426
+        this.warehouse = warehouse;
427
+    }
428
+
429
+    /**
430
+     * 绑定的仓房货位
431
+     * @return goods_location 绑定的仓房货位
432
+     */
433
+    public Integer getGoodsLocation() {
434
+        return goodsLocation;
435
+    }
436
+
437
+    /**
438
+     * 绑定的仓房货位
439
+     * @param goodsLocation 绑定的仓房货位
440
+     */
441
+    public void setGoodsLocation(Integer goodsLocation) {
442
+        this.goodsLocation = goodsLocation;
443
+    }
444
+
445
+    /**
446
+     * 审批状态 0待提交,1审批中,2同意,3驳回,4拒绝
447
+     * @return audit_state 审批状态 0待提交,1审批中,2同意,3驳回,4拒绝
448
+     */
449
+    public String getAuditState() {
450
+        return auditState;
451
+    }
452
+
453
+    /**
454
+     * 审批状态 0待提交,1审批中,2同意,3驳回,4拒绝
455
+     * @param auditState 审批状态 0待提交,1审批中,2同意,3驳回,4拒绝
456
+     */
457
+    public void setAuditState(String auditState) {
458
+        this.auditState = auditState == null ? null : auditState.trim();
459
+    }
460
+
461
+    /**
462
+     * 入库时间
463
+     * @return storage_time 入库时间
464
+     */
465
+    public Date getStorageTime() {
466
+        return storageTime;
467
+    }
468
+
469
+    /**
470
+     * 入库时间
471
+     * @param storageTime 入库时间
472
+     */
473
+    public void setStorageTime(Date storageTime) {
474
+        this.storageTime = storageTime;
475
+    }
476
+
477
+    /**
478
+     * 流程实例id
479
+     * @return process_instance_id 流程实例id
480
+     */
481
+    public String getProcessInstanceId() {
482
+        return processInstanceId;
483
+    }
484
+
485
+    /**
486
+     * 流程实例id
487
+     * @param processInstanceId 流程实例id
488
+     */
489
+    public void setProcessInstanceId(String processInstanceId) {
490
+        this.processInstanceId = processInstanceId == null ? null : processInstanceId.trim();
491
+    }
492
+
493
+    /**
494
+     * 流程定义id
495
+     * @return process_definition_id 流程定义id
496
+     */
497
+    public String getProcessDefinitionId() {
498
+        return processDefinitionId;
499
+    }
500
+
501
+    /**
502
+     * 流程定义id
503
+     * @param processDefinitionId 流程定义id
504
+     */
505
+    public void setProcessDefinitionId(String processDefinitionId) {
506
+        this.processDefinitionId = processDefinitionId == null ? null : processDefinitionId.trim();
507
+    }
508
+
509
+    /**
510
+     * 质量标准
511
+     * @return quality_standard 质量标准
512
+     */
513
+    public String getQualityStandard() {
514
+        return qualityStandard;
515
+    }
516
+
517
+    /**
518
+     * 质量标准
519
+     * @param qualityStandard 质量标准
520
+     */
521
+    public void setQualityStandard(String qualityStandard) {
522
+        this.qualityStandard = qualityStandard == null ? null : qualityStandard.trim();
523
+    }
524
+
525
+    /**
526
+     * 审批完成时间
527
+     * @return agree_time 审批完成时间
528
+     */
529
+    public Date getAgreeTime() {
530
+        return agreeTime;
531
+    }
532
+
533
+    /**
534
+     * 审批完成时间
535
+     * @param agreeTime 审批完成时间
536
+     */
537
+    public void setAgreeTime(Date agreeTime) {
538
+        this.agreeTime = agreeTime;
539
+    }
540
+
541
+    /**
542
+     * 开单人名称
543
+     * @return bill_man 开单人名称
544
+     */
545
+    public String getBillMan() {
546
+        return billMan;
547
+    }
548
+
549
+    /**
550
+     * 开单人名称
551
+     * @param billMan 开单人名称
552
+     */
553
+    public void setBillMan(String billMan) {
554
+        this.billMan = billMan == null ? null : billMan.trim();
555
+    }
556
+
557
+    /**
558
+     * 开单日期
559
+     * @return bill_date 开单日期
560
+     */
561
+    public Date getBillDate() {
562
+        return billDate;
563
+    }
564
+
565
+    /**
566
+     * 开单日期
567
+     * @param billDate 开单日期
568
+     */
569
+    public void setBillDate(Date billDate) {
570
+        this.billDate = billDate;
571
+    }
572
+
573
+    /**
574
+     * 开单单位
575
+     * @return bill_unit 开单单位
576
+     */
577
+    public String getBillUnit() {
578
+        return billUnit;
579
+    }
580
+
581
+    /**
582
+     * 开单单位
583
+     * @param billUnit 开单单位
584
+     */
585
+    public void setBillUnit(String billUnit) {
586
+        this.billUnit = billUnit == null ? null : billUnit.trim();
587
+    }
588
+
589
+    /**
590
+     * 仓房编号 仓房id
591
+     * @return house_id 仓房编号 仓房id
592
+     */
593
+    public Integer getHouseId() {
594
+        return houseId;
595
+    }
596
+
597
+    /**
598
+     * 仓房编号 仓房id
599
+     * @param houseId 仓房编号 仓房id
600
+     */
601
+    public void setHouseId(Integer houseId) {
602
+        this.houseId = houseId;
603
+    }
604
+
605
+    /**
606
+     * 仓房名称
607
+     * @return house_name 仓房名称
608
+     */
609
+    public String getHouseName() {
610
+        return houseName;
611
+    }
612
+
613
+    /**
614
+     * 仓房名称
615
+     * @param houseName 仓房名称
616
+     */
617
+    public void setHouseName(String houseName) {
618
+        this.houseName = houseName == null ? null : houseName.trim();
619
+    }
620
+
621
+    /**
622
+     * 货位号  货位id
623
+     * @return warehouse_id 货位号  货位id
624
+     */
625
+    public Integer getWarehouseId() {
626
+        return warehouseId;
627
+    }
628
+
629
+    /**
630
+     * 货位号  货位id
631
+     * @param warehouseId 货位号  货位id
632
+     */
633
+    public void setWarehouseId(Integer warehouseId) {
634
+        this.warehouseId = warehouseId;
635
+    }
636
+
637
+    /**
638
+     * 货位名称
639
+     * @return warehouse_name 货位名称
640
+     */
641
+    public String getWarehouseName() {
642
+        return warehouseName;
643
+    }
644
+
645
+    /**
646
+     * 货位名称
647
+     * @param warehouseName 货位名称
648
+     */
649
+    public void setWarehouseName(String warehouseName) {
650
+        this.warehouseName = warehouseName == null ? null : warehouseName.trim();
651
+    }
652
+
653
+    /**
654
+     * 
655
+     * @return creater 
656
+     */
657
+    public String getCreater() {
658
+        return creater;
659
+    }
660
+
661
+    /**
662
+     * 
663
+     * @param creater 
664
+     */
665
+    public void setCreater(String creater) {
666
+        this.creater = creater == null ? null : creater.trim();
667
+    }
668
+
669
+    /**
670
+     * 
671
+     * @return create_time 
672
+     */
673
+    public Date getCreateTime() {
674
+        return createTime;
675
+    }
676
+
677
+    /**
678
+     * 
679
+     * @param createTime 
680
+     */
681
+    public void setCreateTime(Date createTime) {
682
+        this.createTime = createTime;
683
+    }
684
+
685
+    /**
686
+     * 
687
+     * @return create_unit 
688
+     */
689
+    public String getCreateUnit() {
690
+        return createUnit;
691
+    }
692
+
693
+    /**
694
+     * 
695
+     * @param createUnit 
696
+     */
697
+    public void setCreateUnit(String createUnit) {
698
+        this.createUnit = createUnit == null ? null : createUnit.trim();
699
+    }
700
+
701
+    /**
702
+     * 
703
+     * @return create_depot 
704
+     */
705
+    public String getCreateDepot() {
706
+        return createDepot;
707
+    }
708
+
709
+    /**
710
+     * 
711
+     * @param createDepot 
712
+     */
713
+    public void setCreateDepot(String createDepot) {
714
+        this.createDepot = createDepot == null ? null : createDepot.trim();
715
+    }
716
+
717
+    /**
718
+     * 
719
+     * @return update_time 
720
+     */
721
+    public Date getUpdateTime() {
722
+        return updateTime;
723
+    }
724
+
725
+    /**
726
+     * 
727
+     * @param updateTime 
728
+     */
729
+    public void setUpdateTime(Date updateTime) {
730
+        this.updateTime = updateTime;
731
+    }
732
+
733
+    /**
734
+     * 
735
+     * @return org_id 
736
+     */
737
+    public Integer getOrgId() {
738
+        return orgId;
739
+    }
740
+
741
+    /**
742
+     * 
743
+     * @param orgId 
744
+     */
745
+    public void setOrgId(Integer orgId) {
746
+        this.orgId = orgId;
747
+    }
748
+
749
+    /**
750
+     * 启用状态 0 : 未执行,1 : 执行中,2 : 执行完毕,3 : 终止,4 : 暂停
751
+     * @return in_application 启用状态 0 : 未执行,1 : 执行中,2 : 执行完毕,3 : 终止,4 : 暂停
752
+     */
753
+    public Integer getInApplication() {
754
+        return inApplication;
755
+    }
756
+
757
+    /**
758
+     * 启用状态 0 : 未执行,1 : 执行中,2 : 执行完毕,3 : 终止,4 : 暂停
759
+     * @param inApplication 启用状态 0 : 未执行,1 : 执行中,2 : 执行完毕,3 : 终止,4 : 暂停
760
+     */
761
+    public void setInApplication(Integer inApplication) {
762
+        this.inApplication = inApplication;
763
+    }
764
+
765
+    /**
766
+     * 
767
+     * @return creater_id 
768
+     */
769
+    public Integer getCreaterId() {
770
+        return createrId;
771
+    }
772
+
773
+    /**
774
+     * 
775
+     * @param createrId 
776
+     */
777
+    public void setCreaterId(Integer createrId) {
778
+        this.createrId = createrId;
779
+    }
780
+
781
+    /**
782
+     * 起始合同id
783
+     * @return root_contract_bid 起始合同id
784
+     */
785
+    public Integer getRootContractBid() {
786
+        return rootContractBid;
787
+    }
788
+
789
+    /**
790
+     * 起始合同id
791
+     * @param rootContractBid 起始合同id
792
+     */
793
+    public void setRootContractBid(Integer rootContractBid) {
794
+        this.rootContractBid = rootContractBid;
795
+    }
796
+
797
+    /**
798
+     * 证件号
799
+     * @return identification 证件号
800
+     */
801
+    public String getIdentification() {
802
+        return identification;
803
+    }
804
+
805
+    /**
806
+     * 证件号
807
+     * @param identification 证件号
808
+     */
809
+    public void setIdentification(String identification) {
810
+        this.identification = identification == null ? null : identification.trim();
811
+    }
812
+
813
+    /**
814
+     * 
815
+     * @return carNumber 
816
+     */
817
+    public String getCarnumber() {
818
+        return carnumber;
819
+    }
820
+
821
+    /**
822
+     * 
823
+     * @param carnumber 
824
+     */
825
+    public void setCarnumber(String carnumber) {
826
+        this.carnumber = carnumber == null ? null : carnumber.trim();
827
+    }
828
+}

File diff suppressed because it is too large
+ 3179 - 0
src/main/java/com/chinaitop/depot/business/model/BusinessDeliveryStorageNoticeExample.java


+ 239 - 0
src/main/java/com/chinaitop/depot/business/model/BusinessFile.java

@@ -0,0 +1,239 @@
1
+package com.chinaitop.depot.business.model;
2
+
3
+import java.util.Date;
4
+
5
+public class BusinessFile {
6
+    private Integer id;
7
+
8
+    private Integer bid;
9
+
10
+    private String type;
11
+
12
+    private String fileName;
13
+
14
+    private String originalFileName;
15
+
16
+    private String fileType;
17
+
18
+    private String source;
19
+
20
+    private String remarks;
21
+
22
+    private String filePath;
23
+
24
+    private Date createTime;
25
+
26
+    private Date updateTime;
27
+
28
+    private Integer creater;
29
+
30
+    private Integer orgId;
31
+
32
+    /**
33
+     * 主键id
34
+     * @return id 主键id
35
+     */
36
+    public Integer getId() {
37
+        return id;
38
+    }
39
+
40
+    /**
41
+     * 主键id
42
+     * @param id 主键id
43
+     */
44
+    public void setId(Integer id) {
45
+        this.id = id;
46
+    }
47
+
48
+    /**
49
+     * 数据id
50
+     * @return bid 数据id
51
+     */
52
+    public Integer getBid() {
53
+        return bid;
54
+    }
55
+
56
+    /**
57
+     * 数据id
58
+     * @param bid 数据id
59
+     */
60
+    public void setBid(Integer bid) {
61
+        this.bid = bid;
62
+    }
63
+
64
+    /**
65
+     * 业务类型
66
+     * @return type 业务类型
67
+     */
68
+    public String getType() {
69
+        return type;
70
+    }
71
+
72
+    /**
73
+     * 业务类型
74
+     * @param type 业务类型
75
+     */
76
+    public void setType(String type) {
77
+        this.type = type == null ? null : type.trim();
78
+    }
79
+
80
+    /**
81
+     * 文件名称
82
+     * @return file_name 文件名称
83
+     */
84
+    public String getFileName() {
85
+        return fileName;
86
+    }
87
+
88
+    /**
89
+     * 文件名称
90
+     * @param fileName 文件名称
91
+     */
92
+    public void setFileName(String fileName) {
93
+        this.fileName = fileName == null ? null : fileName.trim();
94
+    }
95
+
96
+    /**
97
+     * 文件原始名称
98
+     * @return original_file_name 文件原始名称
99
+     */
100
+    public String getOriginalFileName() {
101
+        return originalFileName;
102
+    }
103
+
104
+    /**
105
+     * 文件原始名称
106
+     * @param originalFileName 文件原始名称
107
+     */
108
+    public void setOriginalFileName(String originalFileName) {
109
+        this.originalFileName = originalFileName == null ? null : originalFileName.trim();
110
+    }
111
+
112
+    /**
113
+     * 文件类型
114
+     * @return file_type 文件类型
115
+     */
116
+    public String getFileType() {
117
+        return fileType;
118
+    }
119
+
120
+    /**
121
+     * 文件类型
122
+     * @param fileType 文件类型
123
+     */
124
+    public void setFileType(String fileType) {
125
+        this.fileType = fileType == null ? null : fileType.trim();
126
+    }
127
+
128
+    /**
129
+     * 来源
130
+     * @return source 来源
131
+     */
132
+    public String getSource() {
133
+        return source;
134
+    }
135
+
136
+    /**
137
+     * 来源
138
+     * @param source 来源
139
+     */
140
+    public void setSource(String source) {
141
+        this.source = source == null ? null : source.trim();
142
+    }
143
+
144
+    /**
145
+     * 备注
146
+     * @return remarks 备注
147
+     */
148
+    public String getRemarks() {
149
+        return remarks;
150
+    }
151
+
152
+    /**
153
+     * 备注
154
+     * @param remarks 备注
155
+     */
156
+    public void setRemarks(String remarks) {
157
+        this.remarks = remarks == null ? null : remarks.trim();
158
+    }
159
+
160
+    /**
161
+     * 文件上传路径
162
+     * @return file_path 文件上传路径
163
+     */
164
+    public String getFilePath() {
165
+        return filePath;
166
+    }
167
+
168
+    /**
169
+     * 文件上传路径
170
+     * @param filePath 文件上传路径
171
+     */
172
+    public void setFilePath(String filePath) {
173
+        this.filePath = filePath == null ? null : filePath.trim();
174
+    }
175
+
176
+    /**
177
+     * 
178
+     * @return create_time 
179
+     */
180
+    public Date getCreateTime() {
181
+        return createTime;
182
+    }
183
+
184
+    /**
185
+     * 
186
+     * @param createTime 
187
+     */
188
+    public void setCreateTime(Date createTime) {
189
+        this.createTime = createTime;
190
+    }
191
+
192
+    /**
193
+     * 
194
+     * @return update_time 
195
+     */
196
+    public Date getUpdateTime() {
197
+        return updateTime;
198
+    }
199
+
200
+    /**
201
+     * 
202
+     * @param updateTime 
203
+     */
204
+    public void setUpdateTime(Date updateTime) {
205
+        this.updateTime = updateTime;
206
+    }
207
+
208
+    /**
209
+     * 
210
+     * @return creater 
211
+     */
212
+    public Integer getCreater() {
213
+        return creater;
214
+    }
215
+
216
+    /**
217
+     * 
218
+     * @param creater 
219
+     */
220
+    public void setCreater(Integer creater) {
221
+        this.creater = creater;
222
+    }
223
+
224
+    /**
225
+     * 
226
+     * @return org_id 
227
+     */
228
+    public Integer getOrgId() {
229
+        return orgId;
230
+    }
231
+
232
+    /**
233
+     * 
234
+     * @param orgId 
235
+     */
236
+    public void setOrgId(Integer orgId) {
237
+        this.orgId = orgId;
238
+    }
239
+}

+ 0 - 0
src/main/java/com/chinaitop/depot/business/model/BusinessFileExample.java


Some files were not shown because too many files changed in this diff