fanxw 6 år sedan
förälder
incheckning
1dfbce33ca
26 ändrade filer med 7339 tillägg och 0 borttagningar
  1. 6 0
      Dockerfile
  2. 159 0
      pom.xml
  3. 152 0
      src/main/java/com/chinaitop/depot/DatePermissionInterceptor.java
  4. 19 0
      src/main/java/com/chinaitop/depot/DepotGrainAnalysisApplication.java
  5. 12 0
      src/main/java/com/chinaitop/depot/HelloWebXml.java
  6. 35 0
      src/main/java/com/chinaitop/depot/SwaggerGrainAnalysisConfig.java
  7. 254 0
      src/main/java/com/chinaitop/depot/grainAnalysis/controller/MonthStorageGrainAnalysisController.java
  8. 189 0
      src/main/java/com/chinaitop/depot/grainAnalysis/controller/StorageGrainAnalysisController.java
  9. 207 0
      src/main/java/com/chinaitop/depot/grainAnalysis/controller/YearStorageGrainAnalysisController.java
  10. 30 0
      src/main/java/com/chinaitop/depot/grainAnalysis/mapper/StorageExceptionAndOnforeMapper.java
  11. 371 0
      src/main/java/com/chinaitop/depot/grainAnalysis/mapper/StorageExceptionAndOnforeMapper.xml
  12. 40 0
      src/main/java/com/chinaitop/depot/grainAnalysis/mapper/StorageGrainAnalysisMapper.java
  13. 563 0
      src/main/java/com/chinaitop/depot/grainAnalysis/mapper/StorageGrainAnalysisMapper.xml
  14. 276 0
      src/main/java/com/chinaitop/depot/grainAnalysis/model/StorageExceptionAndOnfore.java
  15. 1210 0
      src/main/java/com/chinaitop/depot/grainAnalysis/model/StorageExceptionAndOnforeExample.java
  16. 491 0
      src/main/java/com/chinaitop/depot/grainAnalysis/model/StorageGrainAnalysis.java
  17. 1959 0
      src/main/java/com/chinaitop/depot/grainAnalysis/model/StorageGrainAnalysisExample.java
  18. 94 0
      src/main/java/com/chinaitop/depot/grainAnalysis/service/StorageGrainAnalysisService.java
  19. 266 0
      src/main/java/com/chinaitop/depot/grainAnalysis/service/impl/StorageGrainAnalysisServiceImpl.java
  20. 44 0
      src/main/java/com/chinaitop/depot/utils/CustomFilter.java
  21. 61 0
      src/main/java/com/chinaitop/depot/utils/DataPolicyEngine.java
  22. 66 0
      src/main/java/com/chinaitop/depot/utils/RedisConfig.java
  23. 547 0
      src/main/java/com/chinaitop/depot/utils/RedisUtil.java
  24. 39 0
      src/main/java/com/chinaitop/depot/utils/WebConfig.java
  25. 198 0
      src/main/java/com/chinaitop/utils/ParameterUtil.java
  26. 51 0
      src/main/resources/bootstrap.yml

+ 6 - 0
Dockerfile

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

+ 159 - 0
pom.xml

@@ -0,0 +1,159 @@
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-grain-analysis</artifactId>
8
+	<version>0.0.1-SNAPSHOT</version>
9
+	<packaging>jar</packaging>
10
+
11
+	<name>depot-grainAnalysis</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
+		<dependency>
39
+			<groupId>mysql</groupId>
40
+			<artifactId>mysql-connector-java</artifactId>
41
+		</dependency>
42
+		<!-- 引入spring boot自带的pagehelper插件 -->
43
+		<dependency>
44
+			<groupId>com.github.pagehelper</groupId>
45
+			<artifactId>pagehelper-spring-boot-starter</artifactId>
46
+			<version>1.2.3</version>
47
+		</dependency>
48
+		<dependency>
49
+			<groupId>org.springframework.cloud</groupId>
50
+			<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
51
+		</dependency>
52
+		<dependency>
53
+            <groupId>org.springframework.cloud</groupId>
54
+            <artifactId>spring-cloud-starter-config</artifactId>
55
+        </dependency>
56
+
57
+		<dependency>
58
+			<groupId>org.apache.commons</groupId>
59
+			<artifactId>commons-lang3</artifactId>
60
+		</dependency>
61
+
62
+		<!-- swagger2 -->
63
+		<dependency>
64
+			<groupId>io.springfox</groupId>
65
+			<artifactId>springfox-swagger2</artifactId>
66
+			<version>2.6.1</version>
67
+		</dependency>
68
+		<dependency>
69
+			<groupId>io.springfox</groupId>
70
+			<artifactId>springfox-swagger-ui</artifactId>
71
+			<version>2.6.1</version>
72
+		</dependency>
73
+		<dependency>
74
+			<groupId>org.springframework.boot</groupId>
75
+			<artifactId>spring-boot-starter-test</artifactId>
76
+			<scope>test</scope>
77
+		</dependency>
78
+		<dependency>
79
+			<groupId>org.apache.poi</groupId>
80
+			<artifactId>poi-ooxml</artifactId>
81
+			<version>3.9</version>
82
+		</dependency>
83
+
84
+		<!-- 阿里巴巴json -->
85
+		<dependency>
86
+			<groupId>com.alibaba</groupId>
87
+			<artifactId>fastjson</artifactId>
88
+			<version>1.2.37</version>
89
+		</dependency>
90
+		
91
+		<dependency>
92
+            <groupId>org.springframework.boot</groupId>
93
+            <artifactId>spring-boot-starter-data-redis</artifactId>
94
+        </dependency>
95
+        <dependency>
96
+            <groupId>org.springframework.session</groupId>
97
+            <artifactId>spring-session-data-redis</artifactId>
98
+        </dependency>
99
+	</dependencies>
100
+
101
+	<dependencyManagement>
102
+		<dependencies>
103
+			<dependency>
104
+				<groupId>org.springframework.cloud</groupId>
105
+				<artifactId>spring-cloud-dependencies</artifactId>
106
+				<version>${spring-cloud.version}</version>
107
+				<type>pom</type>
108
+				<scope>import</scope>
109
+			</dependency>
110
+		</dependencies>
111
+	</dependencyManagement>
112
+
113
+	<build>
114
+		<finalName>${project.artifactId}</finalName>
115
+		<plugins>
116
+			<plugin>
117
+				<groupId>org.springframework.boot</groupId>
118
+				<artifactId>spring-boot-maven-plugin</artifactId>
119
+			</plugin>
120
+			<plugin>
121
+            	<groupId>org.apache.maven.plugins</groupId>
122
+            	<artifactId>maven-war-plugin</artifactId>
123
+            	<version>2.6</version>
124
+            	<configuration>
125
+                	<failOnMissingWebXml>false</failOnMissingWebXml>
126
+            	</configuration>
127
+        	</plugin>
128
+		</plugins>
129
+
130
+		<!-- 如果不添加此节点mybatis的mapper.xml文件都会被漏掉。 -->
131
+		<resources>
132
+			<resource>
133
+				<directory>src/main/java</directory>
134
+				<includes>
135
+					<include>**/*.properties</include>
136
+					<include>**/*.xml</include>
137
+					<include>**/*.store</include>
138
+				</includes>
139
+				<filtering>false</filtering>
140
+			</resource>
141
+			<resource>
142
+				<directory>src/main/resources</directory>
143
+			</resource>
144
+		</resources>
145
+	</build>
146
+
147
+	<repositories>
148
+		<repository>
149
+			<id>spring-milestones</id>
150
+			<name>Spring Milestones</name>
151
+			<url>https://repo.spring.io/milestone</url>
152
+			<snapshots>
153
+				<enabled>false</enabled>
154
+			</snapshots>
155
+		</repository>
156
+	</repositories>
157
+
158
+
159
+</project>

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

@@ -0,0 +1,152 @@
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是查询的才进行权限过滤
58
+	    if(mappedStatement.getSqlCommandType().toString().equals("select".toUpperCase())) {
59
+	    
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
+				//解析sql中的表名
68
+				Statement statement = CCJSqlParserUtil.parse(bouString);
69
+			    Select selectStatement = (Select)statement;
70
+			    TablesNamesFinder tablesNamesFinder = new TablesNamesFinder();
71
+			    List<String> result = tablesNamesFinder.getTableList(selectStatement);
72
+				
73
+				Set<String> tableNames = new HashSet<String>();// 定义需要替换的table信息列表
74
+				//获取业务表信息数据
75
+				List<String> tableList = (List<String>)redisUtil.lGetAll("tableList").get(0);
76
+				for(int i=0;i<result.size();i++) {
77
+					for (int j = 0; j < tableList.size(); j++) {// 处理查看sql中是否有业务表
78
+						if (result.get(i).equals(ObjectUtils.toString(tableList.get(j)))) {// 是否存在业务表
79
+							tableNames.add(result.get(i));
80
+						}
81
+					}
82
+				}
83
+				
84
+				if (tableNames != null && tableNames.size() > 0) {// sql中存在业务表进行sql拼接数据重新检索
85
+					if(result.size() >= 2) {//sql中存在2张及以上表
86
+						for (String table : tableNames) {// 进行业务表的数据权限替换
87
+							table += " ";//表名后面加空格,防止两个表名一部分相似,导致替换出错
88
+							bouString = bouString.replaceAll(table, "(SELECT * from " + table
89
+									+ " WHERE org_id = '"+orgId+"') ");
90
+						}
91
+					}else {//sql中是单表
92
+						for (String table : tableNames) {// 进行业务表的数据权限替换
93
+							if(bouString.contains(table+" ")) {//防止是单表查询,表后面没有空格的时候替换不了
94
+								table += " ";//表名后面加空格,防止两个表名一部分相似,导致替换出错
95
+							}
96
+							bouString = bouString.replaceAll(table, "(SELECT * from " + table
97
+									+ " WHERE org_id = '"+orgId+"') "+table+" ");
98
+						}
99
+					}
100
+					
101
+					/*bouString = bouString.replaceAll(table, "(SELECT b.* from " + table
102
+							+ " b,user_business u WHERE b.org_id = u.org_id AND u .user_id ='"+userId+"' AND u.business_type = '"+table+"') ");*/
103
+					
104
+				}
105
+				
106
+				//metaStatementHandler.setValue("delegate.boundSql.sql", bouString);
107
+				
108
+				Field field = getField(boundSql, "sql");
109
+				if (field != null) {
110
+					try {
111
+						field.setAccessible(true);
112
+						field.set(boundSql, bouString);
113
+					} catch (IllegalArgumentException e) {
114
+						// TODO Auto-generated catch block
115
+						e.printStackTrace();
116
+					} catch (IllegalAccessException e) {
117
+						// TODO Auto-generated catch block
118
+						e.printStackTrace();
119
+					}
120
+				}
121
+			}
122
+		
123
+	    }
124
+			
125
+		return invocation.proceed();
126
+		
127
+
128
+	}
129
+
130
+	private static Field getField(Object obj, String fieldName) {
131
+		Field field = null;
132
+		for (Class<?> clazz = obj.getClass(); clazz != Object.class; clazz = clazz.getSuperclass()) {
133
+			try {
134
+				field = clazz.getDeclaredField(fieldName);
135
+				break;
136
+			} catch (NoSuchFieldException e) {
137
+				// 这里不用做处理,子类没有该字段可能对应的父类有,都没有就返回null。
138
+			}
139
+		}
140
+		return field;
141
+	}
142
+
143
+	@Override
144
+	public Object plugin(Object target) {
145
+		return Plugin.wrap(target, this);
146
+	}
147
+
148
+	@Override
149
+	public void setProperties(Properties properties) {
150
+	}
151
+
152
+}

+ 19 - 0
src/main/java/com/chinaitop/depot/DepotGrainAnalysisApplication.java

@@ -0,0 +1,19 @@
1
+package com.chinaitop.depot;
2
+
3
+import org.mybatis.spring.annotation.MapperScan;
4
+import org.springframework.boot.SpringApplication;
5
+import org.springframework.boot.autoconfigure.SpringBootApplication;
6
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
7
+import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
8
+
9
+
10
+@EnableEurekaClient
11
+@EnableDiscoveryClient
12
+@SpringBootApplication
13
+@MapperScan(basePackages = {"com.chinaitop.depot.*.mapper"})
14
+public class DepotGrainAnalysisApplication {
15
+
16
+	public static void main(String[] args) {
17
+		SpringApplication.run(DepotGrainAnalysisApplication.class, args);
18
+	}
19
+}

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

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

+ 35 - 0
src/main/java/com/chinaitop/depot/SwaggerGrainAnalysisConfig.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 SwaggerGrainAnalysisConfig {
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.grainAnalysis.controller"))
24
+                .paths(PathSelectors.any())
25
+                .build();
26
+    }
27
+    private ApiInfo apiInfo() {
28
+        return new ApiInfoBuilder()
29
+                .title("智能粮库管理平台api文档")
30
+                .description("粮情分析报告")
31
+                .termsOfServiceUrl("http://192.168.80.25:9001")
32
+                .version("1.0")
33
+                .build();
34
+    }
35
+}

+ 254 - 0
src/main/java/com/chinaitop/depot/grainAnalysis/controller/MonthStorageGrainAnalysisController.java

@@ -0,0 +1,254 @@
1
+package com.chinaitop.depot.grainAnalysis.controller;
2
+
3
+import java.util.ArrayList;
4
+import java.util.HashMap;
5
+import java.util.List;
6
+import java.util.Map;
7
+
8
+import javax.annotation.Resource;
9
+
10
+import com.chinaitop.utils.ParameterUtil;
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
+import com.chinaitop.depot.grainAnalysis.service.StorageGrainAnalysisService;
16
+import com.chinaitop.depot.grainAnalysis.model.StorageExceptionAndOnfore;
17
+import com.chinaitop.depot.grainAnalysis.model.StorageGrainAnalysis;
18
+import com.chinaitop.depot.grainAnalysis.model.StorageGrainAnalysisExample;
19
+import com.fasterxml.jackson.databind.ObjectMapper;
20
+import com.github.pagehelper.PageHelper;
21
+import com.github.pagehelper.PageInfo;
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
+ * 月粮情分析controller
30
+ * @author User
31
+ */
32
+@RestController
33
+@RequestMapping(value = "/monthStorageGrainAnalysis")
34
+@Api(value= "MonthStorageGrainAnalysisController", description = "月粮情分析控制类")
35
+public class MonthStorageGrainAnalysisController {
36
+
37
+	@Resource
38
+	private StorageGrainAnalysisService analysisService;
39
+
40
+	/**
41
+	 * 月分析查询列表
42
+	 * 
43
+	 * @param pageNum
44
+	 * @param pageSize
45
+	 * @param storehouseId
46
+	 * @param year
47
+	 * @param month
48
+	 * @return
49
+	 */
50
+	@RequestMapping(value="/getList", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
51
+	@ApiOperation(value="月粮情分析列表", notes = "支持分页")
52
+    @ApiImplicitParams({
53
+    	@ApiImplicitParam(name="pageNum", value="页数", paramType="query"),
54
+    	@ApiImplicitParam(name="pageSize", value="每页显示条数", paramType="query"),
55
+    	@ApiImplicitParam(name="storehouseId", value="仓房ID", paramType="query"),
56
+    	@ApiImplicitParam(name="year", value="年份", paramType="query"),
57
+    	@ApiImplicitParam(name="month", value="月份", paramType="query")
58
+    })
59
+	public PageInfo<StorageGrainAnalysis> getList(Integer pageNum, Integer pageSize, Integer storehouseId,
60
+			Integer year, Integer month) {
61
+
62
+		StorageGrainAnalysisExample analysisExample = new StorageGrainAnalysisExample();
63
+		StorageGrainAnalysisExample.Criteria analysisCriteria = analysisExample.createCriteria();
64
+
65
+		if (null != storehouseId && !"".equals(storehouseId)) {
66
+			analysisCriteria.andStorehouseIdEqualTo(storehouseId);
67
+		}
68
+
69
+		if (null != year && !"".equals(year)) {
70
+			analysisCriteria.andYearEqualTo(year);
71
+		}
72
+
73
+		if (null != month && !"".equals(month)) {
74
+			analysisCriteria.andMonthEqualTo(month);
75
+		}
76
+
77
+		if (null != pageNum && null != pageSize) {
78
+			PageHelper.startPage(pageNum, pageSize);
79
+		}
80
+
81
+		analysisCriteria.andAnalysisTypeEqualTo(1); //只查询月粮情分析
82
+		
83
+		analysisExample.setOrderByClause(" id desc");
84
+
85
+		List<StorageGrainAnalysis> list = analysisService.findByCondition(analysisExample);
86
+		PageInfo<StorageGrainAnalysis> pageInfo = new PageInfo<StorageGrainAnalysis>(list);
87
+
88
+		return pageInfo;
89
+	}
90
+
91
+	/**
92
+	 * 查询月粮情详细数据
93
+	 *
94
+	 * @param id
95
+	 * @param analysisType
96
+	 * @return
97
+	 */
98
+	@RequestMapping(value="/edit", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
99
+	@ApiOperation(value="查询一条月粮情分析数据", notes = "查询一条月粮情详细的分析数据")
100
+    @ApiImplicitParams({
101
+    	@ApiImplicitParam(name="id", value="数据ID", paramType="query"),
102
+    	@ApiImplicitParam(name="analysisType", value="数据类型", paramType="query")
103
+    })
104
+	public Map<String, Object> edit(Integer id, Integer analysisType) {
105
+
106
+		Map<String, Object> map = new HashMap<>();
107
+
108
+		if (null != id && !"".equals(id)) {
109
+			map = analysisService.findByIdAnalysisObj(id, analysisType, map);
110
+		} else {
111
+			StorageGrainAnalysis grain = new StorageGrainAnalysis();
112
+			map.put("grain", grain);
113
+		}
114
+
115
+		return map;
116
+	}
117
+
118
+	/**
119
+	 * 查询三温检查数据
120
+	 *
121
+	 * @param houseId
122
+	 * @param wareId
123
+	 * @return
124
+	 */
125
+	@RequestMapping(value="/getThreeTempDate", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
126
+	@ApiOperation(value="查询一条三温检查数据", notes = "查询一条三温检查数据")
127
+    @ApiImplicitParams({
128
+    	@ApiImplicitParam(name="houseId", value="仓房ID", paramType="query"),
129
+    	@ApiImplicitParam(name="wareId", value="货位ID", paramType="query"),
130
+    	@ApiImplicitParam(name="year", value="年份", paramType="query"),
131
+    	@ApiImplicitParam(name="month", value="月份", paramType="query"),
132
+		@ApiImplicitParam(name="orgId", value="组织机构ID", paramType="query")
133
+    })
134
+	public Map<String, Object> getThreeTempDate(Integer houseId, Integer wareId, Integer year, Integer month, Integer orgId) {
135
+		Map<String, Object> map = new HashMap<>();
136
+		map = analysisService.getMonthThreeTempDate(houseId, wareId, year, month, orgId, map);
137
+		return map;
138
+	}
139
+
140
+	/**
141
+	 * 查询三温检查数据
142
+	 *
143
+	 * @param threeList
144
+	 * @return
145
+	 */
146
+	@RequestMapping(value="/getThreeTempDateTwo", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
147
+	@ApiOperation(value="查询一条三温检查数据", notes = "查询一条三温检查数据")
148
+	@ApiImplicitParams({
149
+			@ApiImplicitParam(name="threeList", value="需要查询三温的集合", paramType="query")
150
+	})
151
+	public Map<String, Object> getThreeTempDateTwo(String[] threeList) {
152
+		Map<String, Object> map = new HashMap<>();
153
+
154
+		if (null != threeList && threeList.length > 0) {
155
+			List<StorageExceptionAndOnfore> exceptionAndOnforeList = new ArrayList<>();
156
+			StorageExceptionAndOnfore exceptionAndOnfore = new StorageExceptionAndOnfore();
157
+			for (Object obj : threeList) {
158
+//				exceptionAndOnfore.setCheckDate(ParameterUtil.string2date(obj + " 00:00:00"));
159
+				exceptionAndOnforeList.add(exceptionAndOnfore);
160
+
161
+				if(ParameterUtil.isnull(threeList[1])){
162
+					break;
163
+				}
164
+			}
165
+			map.put("exceptionAndOnforeList", exceptionAndOnforeList);
166
+		}
167
+
168
+		return map;
169
+	}
170
+
171
+	/**
172
+	 * 提交
173
+	 * 
174
+	 * @param grainJson 主表数据
175
+	 * @param exceptionJson 从表数据
176
+	 * @param type 分析类型
177
+	 * @param orgId 组织机构ID
178
+	 * @param userId 用户ID
179
+	 * @return
180
+	 */
181
+	@RequestMapping(value="/update", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
182
+	@ApiOperation(value="保存月粮情分析数据", notes = "保存月粮情分析数据")
183
+    @ApiImplicitParams({
184
+    	@ApiImplicitParam(name="grainJson", value="主表数据", paramType="form"),
185
+    	@ApiImplicitParam(name="exceptionJson", value="字表数据", paramType="form"),
186
+    	@ApiImplicitParam(name="type", value="分析类型", paramType="form"),
187
+		@ApiImplicitParam(name="orgId", value="组织机构ID", paramType="form"),
188
+		@ApiImplicitParam(name="userId", value="用户ID", paramType="form")
189
+    })
190
+	public Map<String, Object> update(String grainJson, String exceptionJson, Integer type, Integer orgId, Integer userId) {
191
+		Map<String, Object> map = new HashMap<>();
192
+		
193
+		map = analysisService.updateGrainAndException(grainJson, exceptionJson, map, type, orgId, userId);
194
+		
195
+		return map;
196
+	}
197
+
198
+	/**
199
+	 * 审核提交
200
+	 * 
201
+	 * @param grainJson
202
+	 * @return
203
+	 */
204
+	@RequestMapping(value="/auditor_submit", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
205
+	@ApiOperation(value="审核提交", notes = "审核提交")
206
+    @ApiImplicitParams({
207
+    	@ApiImplicitParam(name="grainJson", value="主表数据", paramType="form")
208
+    })
209
+	public Map<String, Object> auditor_submit(String grainJson) {
210
+		Map<String, Object> map = new HashMap<>();
211
+
212
+		try {
213
+			ObjectMapper mappers = new ObjectMapper();
214
+			StorageGrainAnalysis grain = mappers.readValue(grainJson, StorageGrainAnalysis.class);
215
+			grain.setAuditorStatus(1); // 新数据设置为已审核状态
216
+			analysisService.update(grain);
217
+		} catch (Exception e) {
218
+			e.printStackTrace();
219
+		}
220
+		map.put("status", "success");
221
+		map.put("msg", "审核成功!");
222
+		
223
+		return map;
224
+	}
225
+
226
+	/**
227
+	 * 以月份为条件查询三温数据
228
+	 *
229
+	 * @param houseId 仓房ID
230
+	 * @param wareId 货位ID
231
+	 * @param year 年
232
+	 * @param month 月
233
+	 * @param orgId 粮库ID
234
+	 * @return
235
+	 */
236
+	@RequestMapping(value="/getMonithThreeTempDate", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
237
+	@ApiOperation(value="查询三温数据", notes = "以月份为条件查询三温数据")
238
+	@ApiImplicitParams({
239
+			@ApiImplicitParam(name="houseId", value="仓房ID", paramType="query"),
240
+			@ApiImplicitParam(name="wareId", value="货位ID", paramType="query"),
241
+			@ApiImplicitParam(name="year", value="年份", paramType="query"),
242
+			@ApiImplicitParam(name="month", value="月份", paramType="query"),
243
+			@ApiImplicitParam(name="orgId", value="组织机构ID", paramType="query")
244
+	})
245
+	public Map<String, Object> getMonithThreeTempDate(Integer houseId, Integer wareId, Integer year, Integer month,Integer orgId) {
246
+
247
+		Map<String, Object> map = new HashMap<>();
248
+
249
+		map = analysisService.getMonthThreeTempDate(houseId, wareId, year, month, orgId, map);
250
+
251
+		return map;
252
+	}
253
+}
254
+

+ 189 - 0
src/main/java/com/chinaitop/depot/grainAnalysis/controller/StorageGrainAnalysisController.java

@@ -0,0 +1,189 @@
1
+package com.chinaitop.depot.grainAnalysis.controller;
2
+
3
+import java.util.ArrayList;
4
+import java.util.Date;
5
+import java.util.HashMap;
6
+import java.util.List;
7
+import java.util.Map;
8
+
9
+import javax.annotation.Resource;
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.grainAnalysis.model.StorageExceptionAndOnfore;
17
+import com.chinaitop.depot.grainAnalysis.model.StorageGrainAnalysis;
18
+import com.chinaitop.depot.grainAnalysis.model.StorageGrainAnalysisExample;
19
+import com.chinaitop.depot.grainAnalysis.service.StorageGrainAnalysisService;
20
+import com.chinaitop.utils.ParameterUtil;
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
+/**
31
+ * 周粮情分析controller
32
+ * @author User
33
+ */
34
+@RestController
35
+@RequestMapping(value = "/weekStorageGrainAnalysis")
36
+@Api(value= "StorageGrainAnalysisController", description = "周粮情分析控制类")
37
+public class StorageGrainAnalysisController {
38
+
39
+	@Resource
40
+	private StorageGrainAnalysisService analysisService;
41
+
42
+	@RequestMapping(value="/getList", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
43
+	@ApiOperation(value="周粮情分析列表", notes = "支持分页")
44
+    @ApiImplicitParams({
45
+    	@ApiImplicitParam(name="pageNum", value="页数", paramType="query"),
46
+    	@ApiImplicitParam(name="pageSize", value="每页显示条数", paramType="query"),
47
+    	@ApiImplicitParam(name="storehouseId", value="仓房ID", paramType="query"),
48
+    	@ApiImplicitParam(name="storehouseCode", value="仓房编码", paramType="query"),
49
+    	@ApiImplicitParam(name="startTime", value="起始时间", paramType="query"),
50
+    	@ApiImplicitParam(name="endTime", value="结束时间", paramType="query")
51
+    })
52
+	public PageInfo<StorageGrainAnalysis> getList(Integer pageNum, Integer pageSize, Integer storehouseId,
53
+			String storehouseCode, String startTime, String endTime) {
54
+
55
+		StorageGrainAnalysisExample analysisExample = new StorageGrainAnalysisExample();
56
+		StorageGrainAnalysisExample.Criteria analysisCriteria = analysisExample.createCriteria();
57
+
58
+		if (null != storehouseId && !"".equals(storehouseId)) {
59
+			analysisCriteria.andStorehouseIdEqualTo(storehouseId);
60
+		}
61
+
62
+		if (null != storehouseCode && !"".equals(storehouseCode)) {
63
+			analysisCriteria.andStorehouseCodeLike("%"+storehouseCode+"%");
64
+		}
65
+
66
+		if (ParameterUtil.isnotnull(startTime)) {
67
+			Date starDate = ParameterUtil.string2datetime(startTime + " 00:00:00");
68
+			analysisCriteria.andCheckDateStartGreaterThanOrEqualTo(starDate);
69
+		}
70
+
71
+		if (ParameterUtil.isnotnull(endTime)) {
72
+			Date endDate = ParameterUtil.string2datetime(endTime + " 23:59:59");
73
+			analysisCriteria.andCheckDateStartLessThanOrEqualTo(endDate);
74
+		}
75
+
76
+		if (null != pageNum && null != pageSize) {
77
+			PageHelper.startPage(pageNum, pageSize);
78
+		}
79
+
80
+		analysisCriteria.andAnalysisTypeEqualTo(0); //只查询周粮情分析
81
+
82
+		analysisExample.setOrderByClause(" id desc");
83
+
84
+		List<StorageGrainAnalysis> list = analysisService.findByCondition(analysisExample);
85
+		PageInfo<StorageGrainAnalysis> pageInfo = new PageInfo<StorageGrainAnalysis>(list);
86
+
87
+		return pageInfo;
88
+	}
89
+	
90
+	@RequestMapping(value="/edit", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
91
+	@ApiOperation(value="查询一条周粮情分析数据", notes = "查询一条周粮情分析数据")
92
+    @ApiImplicitParams({
93
+    	@ApiImplicitParam(name="id", value="数据ID", paramType="query"),
94
+    	@ApiImplicitParam(name="analysisType", value="粮情分析类型数据", paramType="query")
95
+    })
96
+	public Map<String, Object> edit(Integer id, Integer analysisType) {
97
+
98
+		Map<String, Object> map = new HashMap<>();
99
+
100
+		if (null != id && !"".equals(id)) {
101
+			map = analysisService.findByIdAnalysisObj(id, analysisType, map);
102
+		} else {
103
+			StorageGrainAnalysis grain = new StorageGrainAnalysis();
104
+			map.put("grain", grain);
105
+		}
106
+
107
+		return map;
108
+	}
109
+
110
+	@RequestMapping(value="/getThreeTempDate", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
111
+	@ApiOperation(value="查询一条三温检查数据", notes = "查询一条三温检查数据")
112
+    @ApiImplicitParams({
113
+    	@ApiImplicitParam(name="threeTempList", value="温度数组", paramType="query")
114
+    })
115
+	public Map<String, Object> getThreeTempDate(String[] threeTempList) {
116
+		Map<String, Object> map = new HashMap<>();
117
+
118
+		if (null != threeTempList && threeTempList.length > 0) {
119
+			List<StorageExceptionAndOnfore> exceptionAndOnforeList = new ArrayList<>();
120
+			StorageExceptionAndOnfore exceptionAndOnfore = new StorageExceptionAndOnfore();
121
+			for (Object obj : threeTempList) {
122
+//				exceptionAndOnfore.setCheckDate(ParameterUtil.string2date(obj + " 00:00:00"));
123
+				exceptionAndOnforeList.add(exceptionAndOnfore);
124
+
125
+				if(ParameterUtil.isnull(threeTempList[1])){
126
+					break;
127
+				}
128
+			}
129
+			map.put("exceptionAndOnforeList", exceptionAndOnforeList);
130
+		}
131
+
132
+		return map;
133
+	}
134
+
135
+	/**
136
+	 * 提交
137
+	 * 
138
+	 * @param grainJson 主表数据
139
+	 * @param exceptionJson 从表数据
140
+	 * @param type 分析类型
141
+	 * @param orgId 组织机构ID
142
+	 * @param userId 用户ID
143
+	 * @return
144
+	 */
145
+	@RequestMapping(value="/update", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
146
+	@ApiOperation(value="保存周粮情分析数据", notes = "保存周粮情分析数据")
147
+    @ApiImplicitParams({
148
+    	@ApiImplicitParam(name="grainJson", value="主表数据", paramType="form"),
149
+    	@ApiImplicitParam(name="exceptionJson", value="字表数据", paramType="form"),
150
+    	@ApiImplicitParam(name="type", value="分析类型", paramType="form"),
151
+    	@ApiImplicitParam(name="orgId", value="组织机构ID", paramType="form"),
152
+    	@ApiImplicitParam(name="userId", value="用户ID", paramType="form")
153
+    })
154
+	public Map<String, Object> update( String grainJson, String exceptionJson, Integer type, Integer orgId, Integer userId) {
155
+		Map<String, Object> map = new HashMap<>();
156
+		
157
+		map = analysisService.updateGrainAndException(grainJson, exceptionJson, map, type, orgId, userId);
158
+		
159
+		return map;
160
+	}
161
+
162
+	/**
163
+	 * 审核提交
164
+	 * 
165
+	 * @param grainJson
166
+	 * @return
167
+	 */
168
+	@RequestMapping(value="/auditor_submit", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
169
+	@ApiOperation(value="审核提交", notes = "审核提交")
170
+    @ApiImplicitParams({
171
+    	@ApiImplicitParam(name="grainJson", value="主表数据", paramType="form")
172
+    })
173
+	public Map<String, Object> auditor_submit(String grainJson) {
174
+		Map<String, Object> map = new HashMap<>();
175
+		
176
+		ObjectMapper mappers = new ObjectMapper();
177
+		try {
178
+			StorageGrainAnalysis grain = mappers.readValue(grainJson, StorageGrainAnalysis.class);
179
+			grain.setAuditorStatus(1); // 新数据设置为已审核状态
180
+			analysisService.update(grain);
181
+		} catch (Exception e) {
182
+			e.printStackTrace();
183
+		}
184
+		map.put("status", "success");
185
+		map.put("msg", "审核成功!");
186
+		
187
+		return map;
188
+	}
189
+}

+ 207 - 0
src/main/java/com/chinaitop/depot/grainAnalysis/controller/YearStorageGrainAnalysisController.java

@@ -0,0 +1,207 @@
1
+package com.chinaitop.depot.grainAnalysis.controller;
2
+
3
+import java.util.ArrayList;
4
+import java.util.HashMap;
5
+import java.util.List;
6
+import java.util.Map;
7
+
8
+import javax.annotation.Resource;
9
+
10
+import com.alibaba.fastjson.JSON;
11
+import com.alibaba.fastjson.JSONObject;
12
+import com.chinaitop.utils.ParameterUtil;
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.grainAnalysis.model.StorageExceptionAndOnfore;
19
+import com.chinaitop.depot.grainAnalysis.model.StorageGrainAnalysis;
20
+import com.chinaitop.depot.grainAnalysis.model.StorageGrainAnalysisExample;
21
+import com.chinaitop.depot.grainAnalysis.service.StorageGrainAnalysisService;
22
+import com.fasterxml.jackson.databind.ObjectMapper;
23
+import com.github.pagehelper.PageHelper;
24
+import com.github.pagehelper.PageInfo;
25
+
26
+import io.swagger.annotations.Api;
27
+import io.swagger.annotations.ApiImplicitParam;
28
+import io.swagger.annotations.ApiImplicitParams;
29
+import io.swagger.annotations.ApiOperation;
30
+
31
+/**
32
+ * 年粮情分析controller
33
+ * @author User
34
+ */
35
+@RestController
36
+@RequestMapping(value = "/yearStorageGrainAnalysis")
37
+@Api(value= "YearStorageGrainAnalysisController", description = "年粮情分析控制类")
38
+public class YearStorageGrainAnalysisController {
39
+
40
+	@Resource
41
+	private StorageGrainAnalysisService analysisService;
42
+
43
+	/**
44
+	 * 年分析查询列表
45
+	 * 
46
+	 * @param pageNum
47
+	 * @param pageSize
48
+	 * @param storehouseId
49
+	 * @param year
50
+	 * @return
51
+	 */
52
+	@RequestMapping(value="/getList", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
53
+	@ApiOperation(value="年粮情分析列表", notes = "支持分页")
54
+    @ApiImplicitParams({
55
+    	@ApiImplicitParam(name="pageNum", value="页数", paramType="query"),
56
+    	@ApiImplicitParam(name="pageSize", value="每页显示条数", paramType="query"),
57
+    	@ApiImplicitParam(name="storehouseId", value="仓房ID", paramType="query"),
58
+    	@ApiImplicitParam(name="year", value="年份", paramType="query")
59
+    })
60
+	public PageInfo<StorageGrainAnalysis> getList(Integer pageNum, Integer pageSize, Integer storehouseId,
61
+			Integer year) {
62
+
63
+		StorageGrainAnalysisExample analysisExample = new StorageGrainAnalysisExample();
64
+		StorageGrainAnalysisExample.Criteria analysisCriteria = analysisExample.createCriteria();
65
+
66
+		if (null != storehouseId && !"".equals(storehouseId)) {
67
+			analysisCriteria.andStorehouseIdEqualTo(storehouseId);
68
+		}
69
+
70
+		if (null != year && !"".equals(year)) {
71
+			analysisCriteria.andYearEqualTo(year);
72
+		}
73
+
74
+		if (null != pageNum && null != pageSize) {
75
+			PageHelper.startPage(pageNum, pageSize);
76
+		}
77
+
78
+		analysisCriteria.andAnalysisTypeEqualTo(2); //只查询年粮情分析
79
+
80
+		analysisExample.setOrderByClause(" id desc");
81
+
82
+		List<StorageGrainAnalysis> list = analysisService.findByCondition(analysisExample);
83
+		PageInfo<StorageGrainAnalysis> pageInfo = new PageInfo<StorageGrainAnalysis>(list);
84
+
85
+		return pageInfo;
86
+	}
87
+
88
+	@RequestMapping(value="/edit", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
89
+	@ApiOperation(value="查询一条年粮情分析数据", notes = "查询一条年粮情分析数据")
90
+    @ApiImplicitParams({
91
+    	@ApiImplicitParam(name="id", value="数据ID", paramType="query"),
92
+    	@ApiImplicitParam(name="analysisType", value="数据类型", paramType="query")
93
+    })
94
+	public Map<String, Object> edit(Integer id, Integer analysisType) {
95
+
96
+		Map<String, Object> map = new HashMap<>();
97
+
98
+		if (null != id && !"".equals(id)) {
99
+			map = analysisService.findByIdAnalysisObj(id, analysisType, map);
100
+		} else {
101
+			StorageGrainAnalysis grain = new StorageGrainAnalysis();
102
+			map.put("grain", grain);
103
+		}
104
+
105
+		return map;
106
+	}
107
+
108
+	@RequestMapping(value="/getThreeTempDate", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
109
+	@ApiOperation(value="查询一条三温检查数据", notes = "查询一条三温检查数据")
110
+	@ApiImplicitParams({
111
+			@ApiImplicitParam(name="houseId", value="仓房ID", paramType="query"),
112
+			@ApiImplicitParam(name="wareId", value="货位ID", paramType="query"),
113
+			@ApiImplicitParam(name="year", value="年份", paramType="query"),
114
+			@ApiImplicitParam(name="orgId", value="组织机构ID", paramType="query")
115
+	})
116
+	public Map<String, Object> getThreeTempDate(Integer houseId, Integer wareId, Integer year, Integer orgId) {
117
+		Map<String, Object> map = new HashMap<>();
118
+
119
+		if (houseId == null || wareId == null) {
120
+			map.put("status", false);
121
+			map.put("msg", "请录入仓房编号和货位编号!");
122
+			return map;
123
+		}
124
+		map = analysisService.getYearThreeTempDate(houseId, wareId, year, orgId, map);
125
+
126
+		return map;
127
+	}
128
+
129
+	@RequestMapping(value="/getThreeTempDateTwo", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
130
+	@ApiOperation(value="查询一条三温检查数据", notes = "查询一条三温检查数据")
131
+	@ApiImplicitParams({
132
+			@ApiImplicitParam(name="threeList", value="需要查询三温的集合", paramType="query")
133
+	})
134
+	public Map<String, Object> getThreeTempDateTwo(String threeList) {
135
+		Map<String, Object> map = new HashMap<>();
136
+
137
+		JSONObject jsonMap = JSON.parseObject(threeList, JSONObject.class);
138
+
139
+		List<StorageExceptionAndOnfore> exceptionAndOnforeList = new ArrayList<>();
140
+		StorageExceptionAndOnfore exceptionAndOnfore = new StorageExceptionAndOnfore();
141
+		exceptionAndOnfore.setCheckDate(ParameterUtil.stringTodatetime(jsonMap.getString("checkDate")));
142
+		exceptionAndOnforeList.add(exceptionAndOnfore);
143
+
144
+		map.put("exceptionAndOnforeList", exceptionAndOnforeList);
145
+
146
+		map.put("status", true);
147
+
148
+		return map;
149
+
150
+	}
151
+
152
+	/**
153
+	 * 提交
154
+	 * 
155
+	 * @param grainJson 主表数据
156
+	 * @param exceptionJson 从表数据
157
+	 * @param type 分析类型
158
+	 * @param orgId 组织机构ID
159
+	 * @param userId 用户ID
160
+	 * @return
161
+	 */
162
+	@RequestMapping(value="/update", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
163
+	@ApiOperation(value="保存周粮情分析数据", notes = "保存周粮情分析数据")
164
+    @ApiImplicitParams({
165
+    	@ApiImplicitParam(name="grainJson", value="主表数据", paramType="form"),
166
+    	@ApiImplicitParam(name="exceptionJson", value="字表数据", paramType="form"),
167
+    	@ApiImplicitParam(name="type", value="分析类型", paramType="form"),
168
+		@ApiImplicitParam(name="orgId", value="组织机构ID", paramType="form"),
169
+		@ApiImplicitParam(name="userId", value="用户ID", paramType="form")
170
+    })
171
+	public Map<String, Object> update(String grainJson, String exceptionJson, Integer type, Integer orgId, Integer userId) {
172
+		Map<String, Object> map = new HashMap<>();
173
+		
174
+		map = analysisService.updateGrainAndException(grainJson, exceptionJson, map, type, orgId, userId);
175
+		
176
+		return map;
177
+	}
178
+
179
+	/**
180
+	 * 审核提交
181
+	 * 
182
+	 * @param grainJson
183
+	 * @return
184
+	 */
185
+	@RequestMapping(value="/auditor_submit", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
186
+	@ApiOperation(value="审核提交", notes = "审核提交")
187
+    @ApiImplicitParams({
188
+    	@ApiImplicitParam(name="grainJson", value="主表数据", paramType="form")
189
+    })
190
+	public Map<String, Object> auditor_submit(String grainJson) {
191
+		Map<String, Object> map = new HashMap<>();
192
+		
193
+		ObjectMapper mappers = new ObjectMapper();
194
+		StorageGrainAnalysis grain = null;
195
+		try {
196
+			grain = mappers.readValue(grainJson, StorageGrainAnalysis.class);
197
+			grain.setAuditorStatus(1); // 新数据设置为已审核状态
198
+			analysisService.update(grain);
199
+		} catch (Exception e) {
200
+			e.printStackTrace();
201
+		}
202
+		map.put("status", "success");
203
+		map.put("msg", "审核成功!");
204
+		
205
+		return map;
206
+	}
207
+}

+ 30 - 0
src/main/java/com/chinaitop/depot/grainAnalysis/mapper/StorageExceptionAndOnforeMapper.java

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

+ 371 - 0
src/main/java/com/chinaitop/depot/grainAnalysis/mapper/StorageExceptionAndOnforeMapper.xml

@@ -0,0 +1,371 @@
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.grainAnalysis.mapper.StorageExceptionAndOnforeMapper" >
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.grainAnalysis.model.StorageExceptionAndOnfore" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="analysis_id" property="analysisId" jdbcType="VARCHAR" />
7
+    <result column="check_date" property="checkDate" jdbcType="TIMESTAMP" />
8
+    <result column="check_type" property="checkType" jdbcType="VARCHAR" />
9
+    <result column="check_part" property="checkPart" jdbcType="VARCHAR" />
10
+    <result column="check_range" property="checkRange" jdbcType="VARCHAR" />
11
+    <result column="foodstuff_temp" property="foodstuffTemp" jdbcType="DECIMAL" />
12
+    <result column="foodstuff_water" property="foodstuffWater" jdbcType="DECIMAL" />
13
+    <result column="rat_bird_situation" property="ratBirdSituation" jdbcType="VARCHAR" />
14
+    <result column="pest_situation" property="pestSituation" jdbcType="VARCHAR" />
15
+    <result column="bad_situation" property="badSituation" jdbcType="VARCHAR" />
16
+    <result column="accident_situation" property="accidentSituation" jdbcType="VARCHAR" />
17
+    <result column="handle_plan_or_result" property="handlePlanOrResult" jdbcType="VARCHAR" />
18
+    <result column="input_date" property="inputDate" jdbcType="TIMESTAMP" />
19
+    <result column="input_person" property="inputPerson" jdbcType="INTEGER" />
20
+  </resultMap>
21
+  <sql id="Example_Where_Clause" >
22
+    <where >
23
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
24
+        <if test="criteria.valid" >
25
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
26
+            <foreach collection="criteria.criteria" item="criterion" >
27
+              <choose >
28
+                <when test="criterion.noValue" >
29
+                  and ${criterion.condition}
30
+                </when>
31
+                <when test="criterion.singleValue" >
32
+                  and ${criterion.condition} #{criterion.value}
33
+                </when>
34
+                <when test="criterion.betweenValue" >
35
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
36
+                </when>
37
+                <when test="criterion.listValue" >
38
+                  and ${criterion.condition}
39
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
40
+                    #{listItem}
41
+                  </foreach>
42
+                </when>
43
+              </choose>
44
+            </foreach>
45
+          </trim>
46
+        </if>
47
+      </foreach>
48
+    </where>
49
+  </sql>
50
+  <sql id="Update_By_Example_Where_Clause" >
51
+    <where >
52
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
53
+        <if test="criteria.valid" >
54
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
55
+            <foreach collection="criteria.criteria" item="criterion" >
56
+              <choose >
57
+                <when test="criterion.noValue" >
58
+                  and ${criterion.condition}
59
+                </when>
60
+                <when test="criterion.singleValue" >
61
+                  and ${criterion.condition} #{criterion.value}
62
+                </when>
63
+                <when test="criterion.betweenValue" >
64
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
65
+                </when>
66
+                <when test="criterion.listValue" >
67
+                  and ${criterion.condition}
68
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
69
+                    #{listItem}
70
+                  </foreach>
71
+                </when>
72
+              </choose>
73
+            </foreach>
74
+          </trim>
75
+        </if>
76
+      </foreach>
77
+    </where>
78
+  </sql>
79
+  <sql id="Base_Column_List" >
80
+    id, analysis_id, check_date, check_type, check_part, check_range, foodstuff_temp, 
81
+    foodstuff_water, rat_bird_situation, pest_situation, bad_situation, accident_situation, 
82
+    handle_plan_or_result, input_date, input_person
83
+  </sql>
84
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.grainAnalysis.model.StorageExceptionAndOnforeExample" >
85
+    select
86
+    <if test="distinct" >
87
+      distinct
88
+    </if>
89
+    <include refid="Base_Column_List" />
90
+    from storage_exception_and_onfore
91
+    <if test="_parameter != null" >
92
+      <include refid="Example_Where_Clause" />
93
+    </if>
94
+    <if test="orderByClause != null" >
95
+      order by ${orderByClause}
96
+    </if>
97
+  </select>
98
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
99
+    select 
100
+    <include refid="Base_Column_List" />
101
+    from storage_exception_and_onfore
102
+    where id = #{id,jdbcType=INTEGER}
103
+  </select>
104
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
105
+    delete from storage_exception_and_onfore
106
+    where id = #{id,jdbcType=INTEGER}
107
+  </delete>
108
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.grainAnalysis.model.StorageExceptionAndOnforeExample" >
109
+    delete from storage_exception_and_onfore
110
+    <if test="_parameter != null" >
111
+      <include refid="Example_Where_Clause" />
112
+    </if>
113
+  </delete>
114
+  <insert id="insert" parameterType="com.chinaitop.depot.grainAnalysis.model.StorageExceptionAndOnfore" >
115
+    insert into storage_exception_and_onfore (id, analysis_id, check_date, 
116
+      check_type, check_part, check_range, 
117
+      foodstuff_temp, foodstuff_water, rat_bird_situation, 
118
+      pest_situation, bad_situation, accident_situation, 
119
+      handle_plan_or_result, input_date, input_person
120
+      )
121
+    values (#{id,jdbcType=INTEGER}, #{analysisId,jdbcType=VARCHAR}, #{checkDate,jdbcType=TIMESTAMP}, 
122
+      #{checkType,jdbcType=VARCHAR}, #{checkPart,jdbcType=VARCHAR}, #{checkRange,jdbcType=VARCHAR}, 
123
+      #{foodstuffTemp,jdbcType=DECIMAL}, #{foodstuffWater,jdbcType=DECIMAL}, #{ratBirdSituation,jdbcType=VARCHAR}, 
124
+      #{pestSituation,jdbcType=VARCHAR}, #{badSituation,jdbcType=VARCHAR}, #{accidentSituation,jdbcType=VARCHAR}, 
125
+      #{handlePlanOrResult,jdbcType=VARCHAR}, #{inputDate,jdbcType=TIMESTAMP}, #{inputPerson,jdbcType=INTEGER}
126
+      )
127
+  </insert>
128
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.grainAnalysis.model.StorageExceptionAndOnfore" >
129
+    insert into storage_exception_and_onfore
130
+    <trim prefix="(" suffix=")" suffixOverrides="," >
131
+      <if test="id != null" >
132
+        id,
133
+      </if>
134
+      <if test="analysisId != null" >
135
+        analysis_id,
136
+      </if>
137
+      <if test="checkDate != null" >
138
+        check_date,
139
+      </if>
140
+      <if test="checkType != null" >
141
+        check_type,
142
+      </if>
143
+      <if test="checkPart != null" >
144
+        check_part,
145
+      </if>
146
+      <if test="checkRange != null" >
147
+        check_range,
148
+      </if>
149
+      <if test="foodstuffTemp != null" >
150
+        foodstuff_temp,
151
+      </if>
152
+      <if test="foodstuffWater != null" >
153
+        foodstuff_water,
154
+      </if>
155
+      <if test="ratBirdSituation != null" >
156
+        rat_bird_situation,
157
+      </if>
158
+      <if test="pestSituation != null" >
159
+        pest_situation,
160
+      </if>
161
+      <if test="badSituation != null" >
162
+        bad_situation,
163
+      </if>
164
+      <if test="accidentSituation != null" >
165
+        accident_situation,
166
+      </if>
167
+      <if test="handlePlanOrResult != null" >
168
+        handle_plan_or_result,
169
+      </if>
170
+      <if test="inputDate != null" >
171
+        input_date,
172
+      </if>
173
+      <if test="inputPerson != null" >
174
+        input_person,
175
+      </if>
176
+    </trim>
177
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
178
+      <if test="id != null" >
179
+        #{id,jdbcType=INTEGER},
180
+      </if>
181
+      <if test="analysisId != null" >
182
+        #{analysisId,jdbcType=VARCHAR},
183
+      </if>
184
+      <if test="checkDate != null" >
185
+        #{checkDate,jdbcType=TIMESTAMP},
186
+      </if>
187
+      <if test="checkType != null" >
188
+        #{checkType,jdbcType=VARCHAR},
189
+      </if>
190
+      <if test="checkPart != null" >
191
+        #{checkPart,jdbcType=VARCHAR},
192
+      </if>
193
+      <if test="checkRange != null" >
194
+        #{checkRange,jdbcType=VARCHAR},
195
+      </if>
196
+      <if test="foodstuffTemp != null" >
197
+        #{foodstuffTemp,jdbcType=DECIMAL},
198
+      </if>
199
+      <if test="foodstuffWater != null" >
200
+        #{foodstuffWater,jdbcType=DECIMAL},
201
+      </if>
202
+      <if test="ratBirdSituation != null" >
203
+        #{ratBirdSituation,jdbcType=VARCHAR},
204
+      </if>
205
+      <if test="pestSituation != null" >
206
+        #{pestSituation,jdbcType=VARCHAR},
207
+      </if>
208
+      <if test="badSituation != null" >
209
+        #{badSituation,jdbcType=VARCHAR},
210
+      </if>
211
+      <if test="accidentSituation != null" >
212
+        #{accidentSituation,jdbcType=VARCHAR},
213
+      </if>
214
+      <if test="handlePlanOrResult != null" >
215
+        #{handlePlanOrResult,jdbcType=VARCHAR},
216
+      </if>
217
+      <if test="inputDate != null" >
218
+        #{inputDate,jdbcType=TIMESTAMP},
219
+      </if>
220
+      <if test="inputPerson != null" >
221
+        #{inputPerson,jdbcType=INTEGER},
222
+      </if>
223
+    </trim>
224
+  </insert>
225
+  <select id="countByExample" parameterType="com.chinaitop.depot.grainAnalysis.model.StorageExceptionAndOnforeExample" resultType="java.lang.Integer" >
226
+    select count(*) from storage_exception_and_onfore
227
+    <if test="_parameter != null" >
228
+      <include refid="Example_Where_Clause" />
229
+    </if>
230
+  </select>
231
+  <update id="updateByExampleSelective" parameterType="map" >
232
+    update storage_exception_and_onfore
233
+    <set >
234
+      <if test="record.id != null" >
235
+        id = #{record.id,jdbcType=INTEGER},
236
+      </if>
237
+      <if test="record.analysisId != null" >
238
+        analysis_id = #{record.analysisId,jdbcType=VARCHAR},
239
+      </if>
240
+      <if test="record.checkDate != null" >
241
+        check_date = #{record.checkDate,jdbcType=TIMESTAMP},
242
+      </if>
243
+      <if test="record.checkType != null" >
244
+        check_type = #{record.checkType,jdbcType=VARCHAR},
245
+      </if>
246
+      <if test="record.checkPart != null" >
247
+        check_part = #{record.checkPart,jdbcType=VARCHAR},
248
+      </if>
249
+      <if test="record.checkRange != null" >
250
+        check_range = #{record.checkRange,jdbcType=VARCHAR},
251
+      </if>
252
+      <if test="record.foodstuffTemp != null" >
253
+        foodstuff_temp = #{record.foodstuffTemp,jdbcType=DECIMAL},
254
+      </if>
255
+      <if test="record.foodstuffWater != null" >
256
+        foodstuff_water = #{record.foodstuffWater,jdbcType=DECIMAL},
257
+      </if>
258
+      <if test="record.ratBirdSituation != null" >
259
+        rat_bird_situation = #{record.ratBirdSituation,jdbcType=VARCHAR},
260
+      </if>
261
+      <if test="record.pestSituation != null" >
262
+        pest_situation = #{record.pestSituation,jdbcType=VARCHAR},
263
+      </if>
264
+      <if test="record.badSituation != null" >
265
+        bad_situation = #{record.badSituation,jdbcType=VARCHAR},
266
+      </if>
267
+      <if test="record.accidentSituation != null" >
268
+        accident_situation = #{record.accidentSituation,jdbcType=VARCHAR},
269
+      </if>
270
+      <if test="record.handlePlanOrResult != null" >
271
+        handle_plan_or_result = #{record.handlePlanOrResult,jdbcType=VARCHAR},
272
+      </if>
273
+      <if test="record.inputDate != null" >
274
+        input_date = #{record.inputDate,jdbcType=TIMESTAMP},
275
+      </if>
276
+      <if test="record.inputPerson != null" >
277
+        input_person = #{record.inputPerson,jdbcType=INTEGER},
278
+      </if>
279
+    </set>
280
+    <if test="_parameter != null" >
281
+      <include refid="Update_By_Example_Where_Clause" />
282
+    </if>
283
+  </update>
284
+  <update id="updateByExample" parameterType="map" >
285
+    update storage_exception_and_onfore
286
+    set id = #{record.id,jdbcType=INTEGER},
287
+      analysis_id = #{record.analysisId,jdbcType=VARCHAR},
288
+      check_date = #{record.checkDate,jdbcType=TIMESTAMP},
289
+      check_type = #{record.checkType,jdbcType=VARCHAR},
290
+      check_part = #{record.checkPart,jdbcType=VARCHAR},
291
+      check_range = #{record.checkRange,jdbcType=VARCHAR},
292
+      foodstuff_temp = #{record.foodstuffTemp,jdbcType=DECIMAL},
293
+      foodstuff_water = #{record.foodstuffWater,jdbcType=DECIMAL},
294
+      rat_bird_situation = #{record.ratBirdSituation,jdbcType=VARCHAR},
295
+      pest_situation = #{record.pestSituation,jdbcType=VARCHAR},
296
+      bad_situation = #{record.badSituation,jdbcType=VARCHAR},
297
+      accident_situation = #{record.accidentSituation,jdbcType=VARCHAR},
298
+      handle_plan_or_result = #{record.handlePlanOrResult,jdbcType=VARCHAR},
299
+      input_date = #{record.inputDate,jdbcType=TIMESTAMP},
300
+      input_person = #{record.inputPerson,jdbcType=INTEGER}
301
+    <if test="_parameter != null" >
302
+      <include refid="Update_By_Example_Where_Clause" />
303
+    </if>
304
+  </update>
305
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.grainAnalysis.model.StorageExceptionAndOnfore" >
306
+    update storage_exception_and_onfore
307
+    <set >
308
+      <if test="analysisId != null" >
309
+        analysis_id = #{analysisId,jdbcType=VARCHAR},
310
+      </if>
311
+      <if test="checkDate != null" >
312
+        check_date = #{checkDate,jdbcType=TIMESTAMP},
313
+      </if>
314
+      <if test="checkType != null" >
315
+        check_type = #{checkType,jdbcType=VARCHAR},
316
+      </if>
317
+      <if test="checkPart != null" >
318
+        check_part = #{checkPart,jdbcType=VARCHAR},
319
+      </if>
320
+      <if test="checkRange != null" >
321
+        check_range = #{checkRange,jdbcType=VARCHAR},
322
+      </if>
323
+      <if test="foodstuffTemp != null" >
324
+        foodstuff_temp = #{foodstuffTemp,jdbcType=DECIMAL},
325
+      </if>
326
+      <if test="foodstuffWater != null" >
327
+        foodstuff_water = #{foodstuffWater,jdbcType=DECIMAL},
328
+      </if>
329
+      <if test="ratBirdSituation != null" >
330
+        rat_bird_situation = #{ratBirdSituation,jdbcType=VARCHAR},
331
+      </if>
332
+      <if test="pestSituation != null" >
333
+        pest_situation = #{pestSituation,jdbcType=VARCHAR},
334
+      </if>
335
+      <if test="badSituation != null" >
336
+        bad_situation = #{badSituation,jdbcType=VARCHAR},
337
+      </if>
338
+      <if test="accidentSituation != null" >
339
+        accident_situation = #{accidentSituation,jdbcType=VARCHAR},
340
+      </if>
341
+      <if test="handlePlanOrResult != null" >
342
+        handle_plan_or_result = #{handlePlanOrResult,jdbcType=VARCHAR},
343
+      </if>
344
+      <if test="inputDate != null" >
345
+        input_date = #{inputDate,jdbcType=TIMESTAMP},
346
+      </if>
347
+      <if test="inputPerson != null" >
348
+        input_person = #{inputPerson,jdbcType=INTEGER},
349
+      </if>
350
+    </set>
351
+    where id = #{id,jdbcType=INTEGER}
352
+  </update>
353
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.grainAnalysis.model.StorageExceptionAndOnfore" >
354
+    update storage_exception_and_onfore
355
+    set analysis_id = #{analysisId,jdbcType=VARCHAR},
356
+      check_date = #{checkDate,jdbcType=TIMESTAMP},
357
+      check_type = #{checkType,jdbcType=VARCHAR},
358
+      check_part = #{checkPart,jdbcType=VARCHAR},
359
+      check_range = #{checkRange,jdbcType=VARCHAR},
360
+      foodstuff_temp = #{foodstuffTemp,jdbcType=DECIMAL},
361
+      foodstuff_water = #{foodstuffWater,jdbcType=DECIMAL},
362
+      rat_bird_situation = #{ratBirdSituation,jdbcType=VARCHAR},
363
+      pest_situation = #{pestSituation,jdbcType=VARCHAR},
364
+      bad_situation = #{badSituation,jdbcType=VARCHAR},
365
+      accident_situation = #{accidentSituation,jdbcType=VARCHAR},
366
+      handle_plan_or_result = #{handlePlanOrResult,jdbcType=VARCHAR},
367
+      input_date = #{inputDate,jdbcType=TIMESTAMP},
368
+      input_person = #{inputPerson,jdbcType=INTEGER}
369
+    where id = #{id,jdbcType=INTEGER}
370
+  </update>
371
+</mapper>

+ 40 - 0
src/main/java/com/chinaitop/depot/grainAnalysis/mapper/StorageGrainAnalysisMapper.java

@@ -0,0 +1,40 @@
1
+package com.chinaitop.depot.grainAnalysis.mapper;
2
+
3
+import com.chinaitop.depot.grainAnalysis.model.StorageGrainAnalysis;
4
+import com.chinaitop.depot.grainAnalysis.model.StorageGrainAnalysisExample;
5
+import java.util.List;
6
+import java.util.Map;
7
+
8
+import org.apache.ibatis.annotations.Param;
9
+
10
+public interface StorageGrainAnalysisMapper {
11
+    int countByExample(StorageGrainAnalysisExample example);
12
+
13
+    int deleteByExample(StorageGrainAnalysisExample example);
14
+
15
+    int deleteByPrimaryKey(Integer id);
16
+
17
+    int insert(StorageGrainAnalysis record);
18
+
19
+    int insertSelective(StorageGrainAnalysis record);
20
+
21
+    List<StorageGrainAnalysis> selectByExample(StorageGrainAnalysisExample example);
22
+
23
+    StorageGrainAnalysis selectByPrimaryKey(Integer id);
24
+
25
+    int updateByExampleSelective(@Param("record") StorageGrainAnalysis record, @Param("example") StorageGrainAnalysisExample example);
26
+
27
+    int updateByExample(@Param("record") StorageGrainAnalysis record, @Param("example") StorageGrainAnalysisExample example);
28
+
29
+    int updateByPrimaryKeySelective(StorageGrainAnalysis record);
30
+
31
+    int updateByPrimaryKey(StorageGrainAnalysis record);
32
+
33
+    /**
34
+     * 查询一条仓房信息
35
+     * 
36
+     * @param map
37
+     * @return
38
+     */
39
+    Map<String, Object> selectStoreHouseObj(Map<String, Object> map);
40
+}

+ 563 - 0
src/main/java/com/chinaitop/depot/grainAnalysis/mapper/StorageGrainAnalysisMapper.xml

@@ -0,0 +1,563 @@
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.grainAnalysis.mapper.StorageGrainAnalysisMapper">
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.grainAnalysis.model.StorageGrainAnalysis">
5
+    <id column="id" jdbcType="INTEGER" property="id" />
6
+    <result column="analysis_id" jdbcType="VARCHAR" property="analysisId" />
7
+    <result column="org_id" jdbcType="INTEGER" property="orgId" />
8
+    <result column="org_name" jdbcType="VARCHAR" property="orgName" />
9
+    <result column="storehouse_id" jdbcType="INTEGER" property="storehouseId" />
10
+    <result column="storehouse_code" jdbcType="VARCHAR" property="storehouseCode" />
11
+    <result column="warehouse_id" jdbcType="INTEGER" property="warehouseId" />
12
+    <result column="storehouse_type" jdbcType="INTEGER" property="storehouseType" />
13
+    <result column="foodstuff_type" jdbcType="INTEGER" property="foodstuffType" />
14
+    <result column="keeper_name" jdbcType="VARCHAR" property="keeperName" />
15
+    <result column="analysis_type" jdbcType="INTEGER" property="analysisType" />
16
+    <result column="check_date_start" jdbcType="TIMESTAMP" property="checkDateStart" />
17
+    <result column="check_date_end" jdbcType="TIMESTAMP" property="checkDateEnd" />
18
+    <result column="year" jdbcType="INTEGER" property="year" />
19
+    <result column="month" jdbcType="INTEGER" property="month" />
20
+    <result column="submit_person" jdbcType="VARCHAR" property="submitPerson" />
21
+    <result column="submit_date" jdbcType="TIMESTAMP" property="submitDate" />
22
+    <result column="grain_analysis" jdbcType="VARCHAR" property="grainAnalysis" />
23
+    <result column="grain_state" jdbcType="VARCHAR" property="grainState" />
24
+    <result column="conclusion" jdbcType="VARCHAR" property="conclusion" />
25
+    <result column="chief_opinion" jdbcType="VARCHAR" property="chiefOpinion" />
26
+    <result column="remark" jdbcType="VARCHAR" property="remark" />
27
+    <result column="auditor" jdbcType="VARCHAR" property="auditor" />
28
+    <result column="auditor_date" jdbcType="TIMESTAMP" property="auditorDate" />
29
+    <result column="auditor_opinion" jdbcType="VARCHAR" property="auditorOpinion" />
30
+    <result column="auditor_status" jdbcType="INTEGER" property="auditorStatus" />
31
+    <result column="input_date" jdbcType="TIMESTAMP" property="inputDate" />
32
+  </resultMap>
33
+  <sql id="Example_Where_Clause">
34
+    <where>
35
+      <foreach collection="oredCriteria" item="criteria" separator="or">
36
+        <if test="criteria.valid">
37
+          <trim prefix="(" prefixOverrides="and" suffix=")">
38
+            <foreach collection="criteria.criteria" item="criterion">
39
+              <choose>
40
+                <when test="criterion.noValue">
41
+                  and ${criterion.condition}
42
+                </when>
43
+                <when test="criterion.singleValue">
44
+                  and ${criterion.condition} #{criterion.value}
45
+                </when>
46
+                <when test="criterion.betweenValue">
47
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
48
+                </when>
49
+                <when test="criterion.listValue">
50
+                  and ${criterion.condition}
51
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
52
+                    #{listItem}
53
+                  </foreach>
54
+                </when>
55
+              </choose>
56
+            </foreach>
57
+          </trim>
58
+        </if>
59
+      </foreach>
60
+    </where>
61
+  </sql>
62
+  <sql id="Update_By_Example_Where_Clause">
63
+    <where>
64
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
65
+        <if test="criteria.valid">
66
+          <trim prefix="(" prefixOverrides="and" suffix=")">
67
+            <foreach collection="criteria.criteria" item="criterion">
68
+              <choose>
69
+                <when test="criterion.noValue">
70
+                  and ${criterion.condition}
71
+                </when>
72
+                <when test="criterion.singleValue">
73
+                  and ${criterion.condition} #{criterion.value}
74
+                </when>
75
+                <when test="criterion.betweenValue">
76
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
77
+                </when>
78
+                <when test="criterion.listValue">
79
+                  and ${criterion.condition}
80
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
81
+                    #{listItem}
82
+                  </foreach>
83
+                </when>
84
+              </choose>
85
+            </foreach>
86
+          </trim>
87
+        </if>
88
+      </foreach>
89
+    </where>
90
+  </sql>
91
+  <sql id="Base_Column_List">
92
+    id, analysis_id, org_id, org_name, storehouse_id, storehouse_code, warehouse_id, 
93
+    storehouse_type, foodstuff_type, keeper_name, analysis_type, check_date_start, check_date_end, 
94
+    year, month, submit_person, submit_date, grain_analysis, grain_state, conclusion, 
95
+    chief_opinion, remark, auditor, auditor_date, auditor_opinion, auditor_status, input_date
96
+  </sql>
97
+  <select id="selectByExample" parameterType="com.chinaitop.depot.grainAnalysis.model.StorageGrainAnalysisExample" resultMap="BaseResultMap">
98
+    select
99
+    <if test="distinct">
100
+      distinct
101
+    </if>
102
+    <include refid="Base_Column_List" />
103
+    from storage_grain_analysis
104
+    <if test="_parameter != null">
105
+      <include refid="Example_Where_Clause" />
106
+    </if>
107
+    <if test="orderByClause != null">
108
+      order by ${orderByClause}
109
+    </if>
110
+  </select>
111
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
112
+    select 
113
+    <include refid="Base_Column_List" />
114
+    from storage_grain_analysis
115
+    where id = #{id,jdbcType=INTEGER}
116
+  </select>
117
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
118
+    delete from storage_grain_analysis
119
+    where id = #{id,jdbcType=INTEGER}
120
+  </delete>
121
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.grainAnalysis.model.StorageGrainAnalysisExample">
122
+    delete from storage_grain_analysis
123
+    <if test="_parameter != null">
124
+      <include refid="Example_Where_Clause" />
125
+    </if>
126
+  </delete>
127
+  <insert id="insert" keyProperty="id" useGeneratedKeys="true" parameterType="com.chinaitop.depot.grainAnalysis.model.StorageGrainAnalysis">
128
+    insert into storage_grain_analysis (id, analysis_id, org_id, 
129
+      org_name, storehouse_id, storehouse_code, 
130
+      warehouse_id, storehouse_type, foodstuff_type, 
131
+      keeper_name, analysis_type, check_date_start, 
132
+      check_date_end, year, month, 
133
+      submit_person, submit_date, grain_analysis, 
134
+      grain_state, conclusion, chief_opinion, 
135
+      remark, auditor, auditor_date, 
136
+      auditor_opinion, auditor_status, input_date
137
+      )
138
+    values (#{id,jdbcType=INTEGER}, #{analysisId,jdbcType=VARCHAR}, #{orgId,jdbcType=INTEGER}, 
139
+      #{orgName,jdbcType=VARCHAR}, #{storehouseId,jdbcType=INTEGER}, #{storehouseCode,jdbcType=VARCHAR}, 
140
+      #{warehouseId,jdbcType=INTEGER}, #{storehouseType,jdbcType=INTEGER}, #{foodstuffType,jdbcType=INTEGER}, 
141
+      #{keeperName,jdbcType=VARCHAR}, #{analysisType,jdbcType=INTEGER}, #{checkDateStart,jdbcType=TIMESTAMP}, 
142
+      #{checkDateEnd,jdbcType=TIMESTAMP}, #{year,jdbcType=INTEGER}, #{month,jdbcType=INTEGER}, 
143
+      #{submitPerson,jdbcType=VARCHAR}, #{submitDate,jdbcType=TIMESTAMP}, #{grainAnalysis,jdbcType=VARCHAR}, 
144
+      #{grainState,jdbcType=VARCHAR}, #{conclusion,jdbcType=VARCHAR}, #{chiefOpinion,jdbcType=VARCHAR}, 
145
+      #{remark,jdbcType=VARCHAR}, #{auditor,jdbcType=VARCHAR}, #{auditorDate,jdbcType=TIMESTAMP}, 
146
+      #{auditorOpinion,jdbcType=VARCHAR}, #{auditorStatus,jdbcType=INTEGER}, #{inputDate,jdbcType=TIMESTAMP}
147
+      )
148
+  </insert>
149
+  <insert id="insertSelective" keyProperty="id" useGeneratedKeys="true" parameterType="com.chinaitop.depot.grainAnalysis.model.StorageGrainAnalysis">
150
+    insert into storage_grain_analysis
151
+    <trim prefix="(" suffix=")" suffixOverrides=",">
152
+      <if test="id != null">
153
+        id,
154
+      </if>
155
+      <if test="analysisId != null">
156
+        analysis_id,
157
+      </if>
158
+      <if test="orgId != null">
159
+        org_id,
160
+      </if>
161
+      <if test="orgName != null">
162
+        org_name,
163
+      </if>
164
+      <if test="storehouseId != null">
165
+        storehouse_id,
166
+      </if>
167
+      <if test="storehouseCode != null">
168
+        storehouse_code,
169
+      </if>
170
+      <if test="warehouseId != null">
171
+        warehouse_id,
172
+      </if>
173
+      <if test="storehouseType != null">
174
+        storehouse_type,
175
+      </if>
176
+      <if test="foodstuffType != null">
177
+        foodstuff_type,
178
+      </if>
179
+      <if test="keeperName != null">
180
+        keeper_name,
181
+      </if>
182
+      <if test="analysisType != null">
183
+        analysis_type,
184
+      </if>
185
+      <if test="checkDateStart != null">
186
+        check_date_start,
187
+      </if>
188
+      <if test="checkDateEnd != null">
189
+        check_date_end,
190
+      </if>
191
+      <if test="year != null">
192
+        year,
193
+      </if>
194
+      <if test="month != null">
195
+        month,
196
+      </if>
197
+      <if test="submitPerson != null">
198
+        submit_person,
199
+      </if>
200
+      <if test="submitDate != null">
201
+        submit_date,
202
+      </if>
203
+      <if test="grainAnalysis != null">
204
+        grain_analysis,
205
+      </if>
206
+      <if test="grainState != null">
207
+        grain_state,
208
+      </if>
209
+      <if test="conclusion != null">
210
+        conclusion,
211
+      </if>
212
+      <if test="chiefOpinion != null">
213
+        chief_opinion,
214
+      </if>
215
+      <if test="remark != null">
216
+        remark,
217
+      </if>
218
+      <if test="auditor != null">
219
+        auditor,
220
+      </if>
221
+      <if test="auditorDate != null">
222
+        auditor_date,
223
+      </if>
224
+      <if test="auditorOpinion != null">
225
+        auditor_opinion,
226
+      </if>
227
+      <if test="auditorStatus != null">
228
+        auditor_status,
229
+      </if>
230
+      <if test="inputDate != null">
231
+        input_date,
232
+      </if>
233
+    </trim>
234
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
235
+      <if test="id != null">
236
+        #{id,jdbcType=INTEGER},
237
+      </if>
238
+      <if test="analysisId != null">
239
+        #{analysisId,jdbcType=VARCHAR},
240
+      </if>
241
+      <if test="orgId != null">
242
+        #{orgId,jdbcType=INTEGER},
243
+      </if>
244
+      <if test="orgName != null">
245
+        #{orgName,jdbcType=VARCHAR},
246
+      </if>
247
+      <if test="storehouseId != null">
248
+        #{storehouseId,jdbcType=INTEGER},
249
+      </if>
250
+      <if test="storehouseCode != null">
251
+        #{storehouseCode,jdbcType=VARCHAR},
252
+      </if>
253
+      <if test="warehouseId != null">
254
+        #{warehouseId,jdbcType=INTEGER},
255
+      </if>
256
+      <if test="storehouseType != null">
257
+        #{storehouseType,jdbcType=INTEGER},
258
+      </if>
259
+      <if test="foodstuffType != null">
260
+        #{foodstuffType,jdbcType=INTEGER},
261
+      </if>
262
+      <if test="keeperName != null">
263
+        #{keeperName,jdbcType=VARCHAR},
264
+      </if>
265
+      <if test="analysisType != null">
266
+        #{analysisType,jdbcType=INTEGER},
267
+      </if>
268
+      <if test="checkDateStart != null">
269
+        #{checkDateStart,jdbcType=TIMESTAMP},
270
+      </if>
271
+      <if test="checkDateEnd != null">
272
+        #{checkDateEnd,jdbcType=TIMESTAMP},
273
+      </if>
274
+      <if test="year != null">
275
+        #{year,jdbcType=INTEGER},
276
+      </if>
277
+      <if test="month != null">
278
+        #{month,jdbcType=INTEGER},
279
+      </if>
280
+      <if test="submitPerson != null">
281
+        #{submitPerson,jdbcType=VARCHAR},
282
+      </if>
283
+      <if test="submitDate != null">
284
+        #{submitDate,jdbcType=TIMESTAMP},
285
+      </if>
286
+      <if test="grainAnalysis != null">
287
+        #{grainAnalysis,jdbcType=VARCHAR},
288
+      </if>
289
+      <if test="grainState != null">
290
+        #{grainState,jdbcType=VARCHAR},
291
+      </if>
292
+      <if test="conclusion != null">
293
+        #{conclusion,jdbcType=VARCHAR},
294
+      </if>
295
+      <if test="chiefOpinion != null">
296
+        #{chiefOpinion,jdbcType=VARCHAR},
297
+      </if>
298
+      <if test="remark != null">
299
+        #{remark,jdbcType=VARCHAR},
300
+      </if>
301
+      <if test="auditor != null">
302
+        #{auditor,jdbcType=VARCHAR},
303
+      </if>
304
+      <if test="auditorDate != null">
305
+        #{auditorDate,jdbcType=TIMESTAMP},
306
+      </if>
307
+      <if test="auditorOpinion != null">
308
+        #{auditorOpinion,jdbcType=VARCHAR},
309
+      </if>
310
+      <if test="auditorStatus != null">
311
+        #{auditorStatus,jdbcType=INTEGER},
312
+      </if>
313
+      <if test="inputDate != null">
314
+        #{inputDate,jdbcType=TIMESTAMP},
315
+      </if>
316
+    </trim>
317
+  </insert>
318
+  <select id="countByExample" parameterType="com.chinaitop.depot.grainAnalysis.model.StorageGrainAnalysisExample" resultType="java.lang.Integer">
319
+    select count(*) from storage_grain_analysis
320
+    <if test="_parameter != null">
321
+      <include refid="Example_Where_Clause" />
322
+    </if>
323
+  </select>
324
+  <update id="updateByExampleSelective" parameterType="map">
325
+    update storage_grain_analysis
326
+    <set>
327
+      <if test="record.id != null">
328
+        id = #{record.id,jdbcType=INTEGER},
329
+      </if>
330
+      <if test="record.analysisId != null">
331
+        analysis_id = #{record.analysisId,jdbcType=VARCHAR},
332
+      </if>
333
+      <if test="record.orgId != null">
334
+        org_id = #{record.orgId,jdbcType=INTEGER},
335
+      </if>
336
+      <if test="record.orgName != null">
337
+        org_name = #{record.orgName,jdbcType=VARCHAR},
338
+      </if>
339
+      <if test="record.storehouseId != null">
340
+        storehouse_id = #{record.storehouseId,jdbcType=INTEGER},
341
+      </if>
342
+      <if test="record.storehouseCode != null">
343
+        storehouse_code = #{record.storehouseCode,jdbcType=VARCHAR},
344
+      </if>
345
+      <if test="record.warehouseId != null">
346
+        warehouse_id = #{record.warehouseId,jdbcType=INTEGER},
347
+      </if>
348
+      <if test="record.storehouseType != null">
349
+        storehouse_type = #{record.storehouseType,jdbcType=INTEGER},
350
+      </if>
351
+      <if test="record.foodstuffType != null">
352
+        foodstuff_type = #{record.foodstuffType,jdbcType=INTEGER},
353
+      </if>
354
+      <if test="record.keeperName != null">
355
+        keeper_name = #{record.keeperName,jdbcType=VARCHAR},
356
+      </if>
357
+      <if test="record.analysisType != null">
358
+        analysis_type = #{record.analysisType,jdbcType=INTEGER},
359
+      </if>
360
+      <if test="record.checkDateStart != null">
361
+        check_date_start = #{record.checkDateStart,jdbcType=TIMESTAMP},
362
+      </if>
363
+      <if test="record.checkDateEnd != null">
364
+        check_date_end = #{record.checkDateEnd,jdbcType=TIMESTAMP},
365
+      </if>
366
+      <if test="record.year != null">
367
+        year = #{record.year,jdbcType=INTEGER},
368
+      </if>
369
+      <if test="record.month != null">
370
+        month = #{record.month,jdbcType=INTEGER},
371
+      </if>
372
+      <if test="record.submitPerson != null">
373
+        submit_person = #{record.submitPerson,jdbcType=VARCHAR},
374
+      </if>
375
+      <if test="record.submitDate != null">
376
+        submit_date = #{record.submitDate,jdbcType=TIMESTAMP},
377
+      </if>
378
+      <if test="record.grainAnalysis != null">
379
+        grain_analysis = #{record.grainAnalysis,jdbcType=VARCHAR},
380
+      </if>
381
+      <if test="record.grainState != null">
382
+        grain_state = #{record.grainState,jdbcType=VARCHAR},
383
+      </if>
384
+      <if test="record.conclusion != null">
385
+        conclusion = #{record.conclusion,jdbcType=VARCHAR},
386
+      </if>
387
+      <if test="record.chiefOpinion != null">
388
+        chief_opinion = #{record.chiefOpinion,jdbcType=VARCHAR},
389
+      </if>
390
+      <if test="record.remark != null">
391
+        remark = #{record.remark,jdbcType=VARCHAR},
392
+      </if>
393
+      <if test="record.auditor != null">
394
+        auditor = #{record.auditor,jdbcType=VARCHAR},
395
+      </if>
396
+      <if test="record.auditorDate != null">
397
+        auditor_date = #{record.auditorDate,jdbcType=TIMESTAMP},
398
+      </if>
399
+      <if test="record.auditorOpinion != null">
400
+        auditor_opinion = #{record.auditorOpinion,jdbcType=VARCHAR},
401
+      </if>
402
+      <if test="record.auditorStatus != null">
403
+        auditor_status = #{record.auditorStatus,jdbcType=INTEGER},
404
+      </if>
405
+      <if test="record.inputDate != null">
406
+        input_date = #{record.inputDate,jdbcType=TIMESTAMP},
407
+      </if>
408
+    </set>
409
+    <if test="_parameter != null">
410
+      <include refid="Update_By_Example_Where_Clause" />
411
+    </if>
412
+  </update>
413
+  <update id="updateByExample" parameterType="map">
414
+    update storage_grain_analysis
415
+    set id = #{record.id,jdbcType=INTEGER},
416
+      analysis_id = #{record.analysisId,jdbcType=VARCHAR},
417
+      org_id = #{record.orgId,jdbcType=INTEGER},
418
+      org_name = #{record.orgName,jdbcType=VARCHAR},
419
+      storehouse_id = #{record.storehouseId,jdbcType=INTEGER},
420
+      storehouse_code = #{record.storehouseCode,jdbcType=VARCHAR},
421
+      warehouse_id = #{record.warehouseId,jdbcType=INTEGER},
422
+      storehouse_type = #{record.storehouseType,jdbcType=INTEGER},
423
+      foodstuff_type = #{record.foodstuffType,jdbcType=INTEGER},
424
+      keeper_name = #{record.keeperName,jdbcType=VARCHAR},
425
+      analysis_type = #{record.analysisType,jdbcType=INTEGER},
426
+      check_date_start = #{record.checkDateStart,jdbcType=TIMESTAMP},
427
+      check_date_end = #{record.checkDateEnd,jdbcType=TIMESTAMP},
428
+      year = #{record.year,jdbcType=INTEGER},
429
+      month = #{record.month,jdbcType=INTEGER},
430
+      submit_person = #{record.submitPerson,jdbcType=VARCHAR},
431
+      submit_date = #{record.submitDate,jdbcType=TIMESTAMP},
432
+      grain_analysis = #{record.grainAnalysis,jdbcType=VARCHAR},
433
+      grain_state = #{record.grainState,jdbcType=VARCHAR},
434
+      conclusion = #{record.conclusion,jdbcType=VARCHAR},
435
+      chief_opinion = #{record.chiefOpinion,jdbcType=VARCHAR},
436
+      remark = #{record.remark,jdbcType=VARCHAR},
437
+      auditor = #{record.auditor,jdbcType=VARCHAR},
438
+      auditor_date = #{record.auditorDate,jdbcType=TIMESTAMP},
439
+      auditor_opinion = #{record.auditorOpinion,jdbcType=VARCHAR},
440
+      auditor_status = #{record.auditorStatus,jdbcType=INTEGER},
441
+      input_date = #{record.inputDate,jdbcType=TIMESTAMP}
442
+    <if test="_parameter != null">
443
+      <include refid="Update_By_Example_Where_Clause" />
444
+    </if>
445
+  </update>
446
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.grainAnalysis.model.StorageGrainAnalysis">
447
+    update storage_grain_analysis
448
+    <set>
449
+      <if test="analysisId != null">
450
+        analysis_id = #{analysisId,jdbcType=VARCHAR},
451
+      </if>
452
+      <if test="orgId != null">
453
+        org_id = #{orgId,jdbcType=INTEGER},
454
+      </if>
455
+      <if test="orgName != null">
456
+        org_name = #{orgName,jdbcType=VARCHAR},
457
+      </if>
458
+      <if test="storehouseId != null">
459
+        storehouse_id = #{storehouseId,jdbcType=INTEGER},
460
+      </if>
461
+      <if test="storehouseCode != null">
462
+        storehouse_code = #{storehouseCode,jdbcType=VARCHAR},
463
+      </if>
464
+      <if test="warehouseId != null">
465
+        warehouse_id = #{warehouseId,jdbcType=INTEGER},
466
+      </if>
467
+      <if test="storehouseType != null">
468
+        storehouse_type = #{storehouseType,jdbcType=INTEGER},
469
+      </if>
470
+      <if test="foodstuffType != null">
471
+        foodstuff_type = #{foodstuffType,jdbcType=INTEGER},
472
+      </if>
473
+      <if test="keeperName != null">
474
+        keeper_name = #{keeperName,jdbcType=VARCHAR},
475
+      </if>
476
+      <if test="analysisType != null">
477
+        analysis_type = #{analysisType,jdbcType=INTEGER},
478
+      </if>
479
+      <if test="checkDateStart != null">
480
+        check_date_start = #{checkDateStart,jdbcType=TIMESTAMP},
481
+      </if>
482
+      <if test="checkDateEnd != null">
483
+        check_date_end = #{checkDateEnd,jdbcType=TIMESTAMP},
484
+      </if>
485
+      <if test="year != null">
486
+        year = #{year,jdbcType=INTEGER},
487
+      </if>
488
+      <if test="month != null">
489
+        month = #{month,jdbcType=INTEGER},
490
+      </if>
491
+      <if test="submitPerson != null">
492
+        submit_person = #{submitPerson,jdbcType=VARCHAR},
493
+      </if>
494
+      <if test="submitDate != null">
495
+        submit_date = #{submitDate,jdbcType=TIMESTAMP},
496
+      </if>
497
+      <if test="grainAnalysis != null">
498
+        grain_analysis = #{grainAnalysis,jdbcType=VARCHAR},
499
+      </if>
500
+      <if test="grainState != null">
501
+        grain_state = #{grainState,jdbcType=VARCHAR},
502
+      </if>
503
+      <if test="conclusion != null">
504
+        conclusion = #{conclusion,jdbcType=VARCHAR},
505
+      </if>
506
+      <if test="chiefOpinion != null">
507
+        chief_opinion = #{chiefOpinion,jdbcType=VARCHAR},
508
+      </if>
509
+      <if test="remark != null">
510
+        remark = #{remark,jdbcType=VARCHAR},
511
+      </if>
512
+      <if test="auditor != null">
513
+        auditor = #{auditor,jdbcType=VARCHAR},
514
+      </if>
515
+      <if test="auditorDate != null">
516
+        auditor_date = #{auditorDate,jdbcType=TIMESTAMP},
517
+      </if>
518
+      <if test="auditorOpinion != null">
519
+        auditor_opinion = #{auditorOpinion,jdbcType=VARCHAR},
520
+      </if>
521
+      <if test="auditorStatus != null">
522
+        auditor_status = #{auditorStatus,jdbcType=INTEGER},
523
+      </if>
524
+      <if test="inputDate != null">
525
+        input_date = #{inputDate,jdbcType=TIMESTAMP},
526
+      </if>
527
+    </set>
528
+    where id = #{id,jdbcType=INTEGER}
529
+  </update>
530
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.grainAnalysis.model.StorageGrainAnalysis">
531
+    update storage_grain_analysis
532
+    set analysis_id = #{analysisId,jdbcType=VARCHAR},
533
+      org_id = #{orgId,jdbcType=INTEGER},
534
+      org_name = #{orgName,jdbcType=VARCHAR},
535
+      storehouse_id = #{storehouseId,jdbcType=INTEGER},
536
+      storehouse_code = #{storehouseCode,jdbcType=VARCHAR},
537
+      warehouse_id = #{warehouseId,jdbcType=INTEGER},
538
+      storehouse_type = #{storehouseType,jdbcType=INTEGER},
539
+      foodstuff_type = #{foodstuffType,jdbcType=INTEGER},
540
+      keeper_name = #{keeperName,jdbcType=VARCHAR},
541
+      analysis_type = #{analysisType,jdbcType=INTEGER},
542
+      check_date_start = #{checkDateStart,jdbcType=TIMESTAMP},
543
+      check_date_end = #{checkDateEnd,jdbcType=TIMESTAMP},
544
+      year = #{year,jdbcType=INTEGER},
545
+      month = #{month,jdbcType=INTEGER},
546
+      submit_person = #{submitPerson,jdbcType=VARCHAR},
547
+      submit_date = #{submitDate,jdbcType=TIMESTAMP},
548
+      grain_analysis = #{grainAnalysis,jdbcType=VARCHAR},
549
+      grain_state = #{grainState,jdbcType=VARCHAR},
550
+      conclusion = #{conclusion,jdbcType=VARCHAR},
551
+      chief_opinion = #{chiefOpinion,jdbcType=VARCHAR},
552
+      remark = #{remark,jdbcType=VARCHAR},
553
+      auditor = #{auditor,jdbcType=VARCHAR},
554
+      auditor_date = #{auditorDate,jdbcType=TIMESTAMP},
555
+      auditor_opinion = #{auditorOpinion,jdbcType=VARCHAR},
556
+      auditor_status = #{auditorStatus,jdbcType=INTEGER},
557
+      input_date = #{inputDate,jdbcType=TIMESTAMP}
558
+    where id = #{id,jdbcType=INTEGER}
559
+  </update>
560
+  <select id="selectStoreHouseObj" resultType="java.util.Map" parameterType="java.util.Map">
561
+    SELECT * FROM basic_storehouse WHERE storehouse_id=#{house_id}
562
+  </select>
563
+</mapper>

+ 276 - 0
src/main/java/com/chinaitop/depot/grainAnalysis/model/StorageExceptionAndOnfore.java

@@ -0,0 +1,276 @@
1
+package com.chinaitop.depot.grainAnalysis.model;
2
+
3
+import java.math.BigDecimal;
4
+import java.util.Date;
5
+
6
+public class StorageExceptionAndOnfore {
7
+    private Integer id;
8
+
9
+    private String analysisId;
10
+
11
+    private Date checkDate;
12
+
13
+    private String checkType;
14
+
15
+    private String checkPart;
16
+
17
+    private String checkRange;
18
+
19
+    private BigDecimal foodstuffTemp;
20
+
21
+    private BigDecimal foodstuffWater;
22
+
23
+    private String ratBirdSituation;
24
+
25
+    private String pestSituation;
26
+
27
+    private String badSituation;
28
+
29
+    private String accidentSituation;
30
+
31
+    private String handlePlanOrResult;
32
+
33
+    private Date inputDate;
34
+
35
+    private Integer inputPerson;
36
+
37
+    /**
38
+     * 主键ID
39
+     * @return id 主键ID
40
+     */
41
+    public Integer getId() {
42
+        return id;
43
+    }
44
+
45
+    /**
46
+     * 主键ID
47
+     * @param id 主键ID
48
+     */
49
+    public void setId(Integer id) {
50
+        this.id = id;
51
+    }
52
+
53
+    /**
54
+     * 分析编号
55
+     * @return analysis_id 分析编号
56
+     */
57
+    public String getAnalysisId() {
58
+        return analysisId;
59
+    }
60
+
61
+    /**
62
+     * 分析编号
63
+     * @param analysisId 分析编号
64
+     */
65
+    public void setAnalysisId(String analysisId) {
66
+        this.analysisId = analysisId == null ? null : analysisId.trim();
67
+    }
68
+
69
+    /**
70
+     * 检查时间
71
+     * @return check_date 检查时间
72
+     */
73
+    public Date getCheckDate() {
74
+        return checkDate;
75
+    }
76
+
77
+    /**
78
+     * 检查时间
79
+     * @param checkDate 检查时间
80
+     */
81
+    public void setCheckDate(Date checkDate) {
82
+        this.checkDate = checkDate;
83
+    }
84
+
85
+    /**
86
+     * 检查类型
87
+     * @return check_type 检查类型
88
+     */
89
+    public String getCheckType() {
90
+        return checkType;
91
+    }
92
+
93
+    /**
94
+     * 检查类型
95
+     * @param checkType 检查类型
96
+     */
97
+    public void setCheckType(String checkType) {
98
+        this.checkType = checkType == null ? null : checkType.trim();
99
+    }
100
+
101
+    /**
102
+     * 检查部位
103
+     * @return check_part 检查部位
104
+     */
105
+    public String getCheckPart() {
106
+        return checkPart;
107
+    }
108
+
109
+    /**
110
+     * 检查部位
111
+     * @param checkPart 检查部位
112
+     */
113
+    public void setCheckPart(String checkPart) {
114
+        this.checkPart = checkPart == null ? null : checkPart.trim();
115
+    }
116
+
117
+    /**
118
+     * 检查范围
119
+     * @return check_range 检查范围
120
+     */
121
+    public String getCheckRange() {
122
+        return checkRange;
123
+    }
124
+
125
+    /**
126
+     * 检查范围
127
+     * @param checkRange 检查范围
128
+     */
129
+    public void setCheckRange(String checkRange) {
130
+        this.checkRange = checkRange == null ? null : checkRange.trim();
131
+    }
132
+
133
+    /**
134
+     * 粮温(℃)
135
+     * @return foodstuff_temp 粮温(℃)
136
+     */
137
+    public BigDecimal getFoodstuffTemp() {
138
+        return foodstuffTemp;
139
+    }
140
+
141
+    /**
142
+     * 粮温(℃)
143
+     * @param foodstuffTemp 粮温(℃)
144
+     */
145
+    public void setFoodstuffTemp(BigDecimal foodstuffTemp) {
146
+        this.foodstuffTemp = foodstuffTemp;
147
+    }
148
+
149
+    /**
150
+     * 水分(%)
151
+     * @return foodstuff_water 水分(%)
152
+     */
153
+    public BigDecimal getFoodstuffWater() {
154
+        return foodstuffWater;
155
+    }
156
+
157
+    /**
158
+     * 水分(%)
159
+     * @param foodstuffWater 水分(%)
160
+     */
161
+    public void setFoodstuffWater(BigDecimal foodstuffWater) {
162
+        this.foodstuffWater = foodstuffWater;
163
+    }
164
+
165
+    /**
166
+     * 鼠雀情况
167
+     * @return rat_bird_situation 鼠雀情况
168
+     */
169
+    public String getRatBirdSituation() {
170
+        return ratBirdSituation;
171
+    }
172
+
173
+    /**
174
+     * 鼠雀情况
175
+     * @param ratBirdSituation 鼠雀情况
176
+     */
177
+    public void setRatBirdSituation(String ratBirdSituation) {
178
+        this.ratBirdSituation = ratBirdSituation == null ? null : ratBirdSituation.trim();
179
+    }
180
+
181
+    /**
182
+     * 害虫情况
183
+     * @return pest_situation 害虫情况
184
+     */
185
+    public String getPestSituation() {
186
+        return pestSituation;
187
+    }
188
+
189
+    /**
190
+     * 害虫情况
191
+     * @param pestSituation 害虫情况
192
+     */
193
+    public void setPestSituation(String pestSituation) {
194
+        this.pestSituation = pestSituation == null ? null : pestSituation.trim();
195
+    }
196
+
197
+    /**
198
+     * 变质情况
199
+     * @return bad_situation 变质情况
200
+     */
201
+    public String getBadSituation() {
202
+        return badSituation;
203
+    }
204
+
205
+    /**
206
+     * 变质情况
207
+     * @param badSituation 变质情况
208
+     */
209
+    public void setBadSituation(String badSituation) {
210
+        this.badSituation = badSituation == null ? null : badSituation.trim();
211
+    }
212
+
213
+    /**
214
+     * 事故情况
215
+     * @return accident_situation 事故情况
216
+     */
217
+    public String getAccidentSituation() {
218
+        return accidentSituation;
219
+    }
220
+
221
+    /**
222
+     * 事故情况
223
+     * @param accidentSituation 事故情况
224
+     */
225
+    public void setAccidentSituation(String accidentSituation) {
226
+        this.accidentSituation = accidentSituation == null ? null : accidentSituation.trim();
227
+    }
228
+
229
+    /**
230
+     * 处理方案或处理效果
231
+     * @return handle_plan_or_result 处理方案或处理效果
232
+     */
233
+    public String getHandlePlanOrResult() {
234
+        return handlePlanOrResult;
235
+    }
236
+
237
+    /**
238
+     * 处理方案或处理效果
239
+     * @param handlePlanOrResult 处理方案或处理效果
240
+     */
241
+    public void setHandlePlanOrResult(String handlePlanOrResult) {
242
+        this.handlePlanOrResult = handlePlanOrResult == null ? null : handlePlanOrResult.trim();
243
+    }
244
+
245
+    /**
246
+     * 录入时间
247
+     * @return input_date 录入时间
248
+     */
249
+    public Date getInputDate() {
250
+        return inputDate;
251
+    }
252
+
253
+    /**
254
+     * 录入时间
255
+     * @param inputDate 录入时间
256
+     */
257
+    public void setInputDate(Date inputDate) {
258
+        this.inputDate = inputDate;
259
+    }
260
+
261
+    /**
262
+     * 录入人
263
+     * @return input_person 录入人
264
+     */
265
+    public Integer getInputPerson() {
266
+        return inputPerson;
267
+    }
268
+
269
+    /**
270
+     * 录入人
271
+     * @param inputPerson 录入人
272
+     */
273
+    public void setInputPerson(Integer inputPerson) {
274
+        this.inputPerson = inputPerson;
275
+    }
276
+}

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1210 - 0
src/main/java/com/chinaitop/depot/grainAnalysis/model/StorageExceptionAndOnforeExample.java


+ 491 - 0
src/main/java/com/chinaitop/depot/grainAnalysis/model/StorageGrainAnalysis.java

@@ -0,0 +1,491 @@
1
+package com.chinaitop.depot.grainAnalysis.model;
2
+
3
+import java.util.Date;
4
+
5
+public class StorageGrainAnalysis {
6
+    private Integer id;
7
+
8
+    private String analysisId;
9
+
10
+    private Integer orgId;
11
+
12
+    private String orgName;
13
+
14
+    private Integer storehouseId;
15
+
16
+    private String storehouseCode;
17
+
18
+    private Integer warehouseId;
19
+
20
+    private Integer storehouseType;
21
+
22
+    private Integer foodstuffType;
23
+
24
+    private String keeperName;
25
+
26
+    private Integer analysisType;
27
+
28
+    private Date checkDateStart;
29
+
30
+    private Date checkDateEnd;
31
+
32
+    private Integer year;
33
+
34
+    private Integer month;
35
+
36
+    private String submitPerson;
37
+
38
+    private Date submitDate;
39
+
40
+    private String grainAnalysis;
41
+
42
+    private String grainState;
43
+
44
+    private String conclusion;
45
+
46
+    private String chiefOpinion;
47
+
48
+    private String remark;
49
+
50
+    private String auditor;
51
+
52
+    private Date auditorDate;
53
+
54
+    private String auditorOpinion;
55
+
56
+    private Integer auditorStatus;
57
+
58
+    private Date inputDate;
59
+
60
+    /**
61
+     * 主键ID
62
+     * @return id 主键ID
63
+     */
64
+    public Integer getId() {
65
+        return id;
66
+    }
67
+
68
+    /**
69
+     * 主键ID
70
+     * @param id 主键ID
71
+     */
72
+    public void setId(Integer id) {
73
+        this.id = id;
74
+    }
75
+
76
+    /**
77
+     * 分析编号
78
+     * @return analysis_id 分析编号
79
+     */
80
+    public String getAnalysisId() {
81
+        return analysisId;
82
+    }
83
+
84
+    /**
85
+     * 分析编号
86
+     * @param analysisId 分析编号
87
+     */
88
+    public void setAnalysisId(String analysisId) {
89
+        this.analysisId = analysisId == null ? null : analysisId.trim();
90
+    }
91
+
92
+    /**
93
+     * 粮库ID
94
+     * @return org_id 粮库ID
95
+     */
96
+    public Integer getOrgId() {
97
+        return orgId;
98
+    }
99
+
100
+    /**
101
+     * 粮库ID
102
+     * @param orgId 粮库ID
103
+     */
104
+    public void setOrgId(Integer orgId) {
105
+        this.orgId = orgId;
106
+    }
107
+
108
+    /**
109
+     * 粮库名称
110
+     * @return org_name 粮库名称
111
+     */
112
+    public String getOrgName() {
113
+        return orgName;
114
+    }
115
+
116
+    /**
117
+     * 粮库名称
118
+     * @param orgName 粮库名称
119
+     */
120
+    public void setOrgName(String orgName) {
121
+        this.orgName = orgName == null ? null : orgName.trim();
122
+    }
123
+
124
+    /**
125
+     * 仓房名称
126
+     * @return storehouse_id 仓房名称
127
+     */
128
+    public Integer getStorehouseId() {
129
+        return storehouseId;
130
+    }
131
+
132
+    /**
133
+     * 仓房名称
134
+     * @param storehouseId 仓房名称
135
+     */
136
+    public void setStorehouseId(Integer storehouseId) {
137
+        this.storehouseId = storehouseId;
138
+    }
139
+
140
+    /**
141
+     * 仓房编号
142
+     * @return storehouse_code 仓房编号
143
+     */
144
+    public String getStorehouseCode() {
145
+        return storehouseCode;
146
+    }
147
+
148
+    /**
149
+     * 仓房编号
150
+     * @param storehouseCode 仓房编号
151
+     */
152
+    public void setStorehouseCode(String storehouseCode) {
153
+        this.storehouseCode = storehouseCode == null ? null : storehouseCode.trim();
154
+    }
155
+
156
+    /**
157
+     * 货位ID
158
+     * @return warehouse_id 货位ID
159
+     */
160
+    public Integer getWarehouseId() {
161
+        return warehouseId;
162
+    }
163
+
164
+    /**
165
+     * 货位ID
166
+     * @param warehouseId 货位ID
167
+     */
168
+    public void setWarehouseId(Integer warehouseId) {
169
+        this.warehouseId = warehouseId;
170
+    }
171
+
172
+    /**
173
+     * 仓房类型
174
+     * @return storehouse_type 仓房类型
175
+     */
176
+    public Integer getStorehouseType() {
177
+        return storehouseType;
178
+    }
179
+
180
+    /**
181
+     * 仓房类型
182
+     * @param storehouseType 仓房类型
183
+     */
184
+    public void setStorehouseType(Integer storehouseType) {
185
+        this.storehouseType = storehouseType;
186
+    }
187
+
188
+    /**
189
+     * 粮食品种
190
+     * @return foodstuff_type 粮食品种
191
+     */
192
+    public Integer getFoodstuffType() {
193
+        return foodstuffType;
194
+    }
195
+
196
+    /**
197
+     * 粮食品种
198
+     * @param foodstuffType 粮食品种
199
+     */
200
+    public void setFoodstuffType(Integer foodstuffType) {
201
+        this.foodstuffType = foodstuffType;
202
+    }
203
+
204
+    /**
205
+     * 责任保管员
206
+     * @return keeper_name 责任保管员
207
+     */
208
+    public String getKeeperName() {
209
+        return keeperName;
210
+    }
211
+
212
+    /**
213
+     * 责任保管员
214
+     * @param keeperName 责任保管员
215
+     */
216
+    public void setKeeperName(String keeperName) {
217
+        this.keeperName = keeperName == null ? null : keeperName.trim();
218
+    }
219
+
220
+    /**
221
+     * 分析类型(0周分析,1月分析,2年分析)
222
+     * @return analysis_type 分析类型(0周分析,1月分析,2年分析)
223
+     */
224
+    public Integer getAnalysisType() {
225
+        return analysisType;
226
+    }
227
+
228
+    /**
229
+     * 分析类型(0周分析,1月分析,2年分析)
230
+     * @param analysisType 分析类型(0周分析,1月分析,2年分析)
231
+     */
232
+    public void setAnalysisType(Integer analysisType) {
233
+        this.analysisType = analysisType;
234
+    }
235
+
236
+    /**
237
+     * 检查起始日期
238
+     * @return check_date_start 检查起始日期
239
+     */
240
+    public Date getCheckDateStart() {
241
+        return checkDateStart;
242
+    }
243
+
244
+    /**
245
+     * 检查起始日期
246
+     * @param checkDateStart 检查起始日期
247
+     */
248
+    public void setCheckDateStart(Date checkDateStart) {
249
+        this.checkDateStart = checkDateStart;
250
+    }
251
+
252
+    /**
253
+     * 检查结束日期
254
+     * @return check_date_end 检查结束日期
255
+     */
256
+    public Date getCheckDateEnd() {
257
+        return checkDateEnd;
258
+    }
259
+
260
+    /**
261
+     * 检查结束日期
262
+     * @param checkDateEnd 检查结束日期
263
+     */
264
+    public void setCheckDateEnd(Date checkDateEnd) {
265
+        this.checkDateEnd = checkDateEnd;
266
+    }
267
+
268
+    /**
269
+     * 年
270
+     * @return year 年
271
+     */
272
+    public Integer getYear() {
273
+        return year;
274
+    }
275
+
276
+    /**
277
+     * 年
278
+     * @param year 年
279
+     */
280
+    public void setYear(Integer year) {
281
+        this.year = year;
282
+    }
283
+
284
+    /**
285
+     * 月
286
+     * @return month 月
287
+     */
288
+    public Integer getMonth() {
289
+        return month;
290
+    }
291
+
292
+    /**
293
+     * 月
294
+     * @param month 月
295
+     */
296
+    public void setMonth(Integer month) {
297
+        this.month = month;
298
+    }
299
+
300
+    /**
301
+     * 提交人
302
+     * @return submit_person 提交人
303
+     */
304
+    public String getSubmitPerson() {
305
+        return submitPerson;
306
+    }
307
+
308
+    /**
309
+     * 提交人
310
+     * @param submitPerson 提交人
311
+     */
312
+    public void setSubmitPerson(String submitPerson) {
313
+        this.submitPerson = submitPerson == null ? null : submitPerson.trim();
314
+    }
315
+
316
+    /**
317
+     * 提交时间
318
+     * @return submit_date 提交时间
319
+     */
320
+    public Date getSubmitDate() {
321
+        return submitDate;
322
+    }
323
+
324
+    /**
325
+     * 提交时间
326
+     * @param submitDate 提交时间
327
+     */
328
+    public void setSubmitDate(Date submitDate) {
329
+        this.submitDate = submitDate;
330
+    }
331
+
332
+    /**
333
+     * 粮情分析
334
+     * @return grain_analysis 粮情分析
335
+     */
336
+    public String getGrainAnalysis() {
337
+        return grainAnalysis;
338
+    }
339
+
340
+    /**
341
+     * 粮情分析
342
+     * @param grainAnalysis 粮情分析
343
+     */
344
+    public void setGrainAnalysis(String grainAnalysis) {
345
+        this.grainAnalysis = grainAnalysis == null ? null : grainAnalysis.trim();
346
+    }
347
+
348
+    /**
349
+     * 粮情状况
350
+     * @return grain_state 粮情状况
351
+     */
352
+    public String getGrainState() {
353
+        return grainState;
354
+    }
355
+
356
+    /**
357
+     * 粮情状况
358
+     * @param grainState 粮情状况
359
+     */
360
+    public void setGrainState(String grainState) {
361
+        this.grainState = grainState == null ? null : grainState.trim();
362
+    }
363
+
364
+    /**
365
+     * 结论
366
+     * @return conclusion 结论
367
+     */
368
+    public String getConclusion() {
369
+        return conclusion;
370
+    }
371
+
372
+    /**
373
+     * 结论
374
+     * @param conclusion 结论
375
+     */
376
+    public void setConclusion(String conclusion) {
377
+        this.conclusion = conclusion == null ? null : conclusion.trim();
378
+    }
379
+
380
+    /**
381
+     * 仓储科长意见
382
+     * @return chief_opinion 仓储科长意见
383
+     */
384
+    public String getChiefOpinion() {
385
+        return chiefOpinion;
386
+    }
387
+
388
+    /**
389
+     * 仓储科长意见
390
+     * @param chiefOpinion 仓储科长意见
391
+     */
392
+    public void setChiefOpinion(String chiefOpinion) {
393
+        this.chiefOpinion = chiefOpinion == null ? null : chiefOpinion.trim();
394
+    }
395
+
396
+    /**
397
+     * 备注
398
+     * @return remark 备注
399
+     */
400
+    public String getRemark() {
401
+        return remark;
402
+    }
403
+
404
+    /**
405
+     * 备注
406
+     * @param remark 备注
407
+     */
408
+    public void setRemark(String remark) {
409
+        this.remark = remark == null ? null : remark.trim();
410
+    }
411
+
412
+    /**
413
+     * 审核人
414
+     * @return auditor 审核人
415
+     */
416
+    public String getAuditor() {
417
+        return auditor;
418
+    }
419
+
420
+    /**
421
+     * 审核人
422
+     * @param auditor 审核人
423
+     */
424
+    public void setAuditor(String auditor) {
425
+        this.auditor = auditor == null ? null : auditor.trim();
426
+    }
427
+
428
+    /**
429
+     * 审核时间
430
+     * @return auditor_date 审核时间
431
+     */
432
+    public Date getAuditorDate() {
433
+        return auditorDate;
434
+    }
435
+
436
+    /**
437
+     * 审核时间
438
+     * @param auditorDate 审核时间
439
+     */
440
+    public void setAuditorDate(Date auditorDate) {
441
+        this.auditorDate = auditorDate;
442
+    }
443
+
444
+    /**
445
+     * 审核意见
446
+     * @return auditor_opinion 审核意见
447
+     */
448
+    public String getAuditorOpinion() {
449
+        return auditorOpinion;
450
+    }
451
+
452
+    /**
453
+     * 审核意见
454
+     * @param auditorOpinion 审核意见
455
+     */
456
+    public void setAuditorOpinion(String auditorOpinion) {
457
+        this.auditorOpinion = auditorOpinion == null ? null : auditorOpinion.trim();
458
+    }
459
+
460
+    /**
461
+     * 审批状态
462
+     * @return auditor_status 审批状态
463
+     */
464
+    public Integer getAuditorStatus() {
465
+        return auditorStatus;
466
+    }
467
+
468
+    /**
469
+     * 审批状态
470
+     * @param auditorStatus 审批状态
471
+     */
472
+    public void setAuditorStatus(Integer auditorStatus) {
473
+        this.auditorStatus = auditorStatus;
474
+    }
475
+
476
+    /**
477
+     * 录入时间
478
+     * @return input_date 录入时间
479
+     */
480
+    public Date getInputDate() {
481
+        return inputDate;
482
+    }
483
+
484
+    /**
485
+     * 录入时间
486
+     * @param inputDate 录入时间
487
+     */
488
+    public void setInputDate(Date inputDate) {
489
+        this.inputDate = inputDate;
490
+    }
491
+}

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1959 - 0
src/main/java/com/chinaitop/depot/grainAnalysis/model/StorageGrainAnalysisExample.java


+ 94 - 0
src/main/java/com/chinaitop/depot/grainAnalysis/service/StorageGrainAnalysisService.java

@@ -0,0 +1,94 @@
1
+package com.chinaitop.depot.grainAnalysis.service;
2
+
3
+import java.util.List;
4
+import java.util.Map;
5
+
6
+import javax.servlet.http.HttpServletRequest;
7
+
8
+import com.chinaitop.depot.grainAnalysis.model.StorageGrainAnalysis;
9
+import com.chinaitop.depot.grainAnalysis.model.StorageGrainAnalysisExample;
10
+
11
+public interface StorageGrainAnalysisService {
12
+
13
+	/**
14
+	 * 新增
15
+	 * 
16
+	 * @param storageGrainAnalysis
17
+	 */
18
+	void add(StorageGrainAnalysis storageGrainAnalysis);
19
+
20
+	/**
21
+	 * 删除
22
+	 * 
23
+	 * @param id
24
+	 */
25
+	void remove(Integer id);
26
+
27
+	/**
28
+	 * 修改
29
+	 * 
30
+	 * @param storageGrainAnalysis
31
+	 */
32
+	void update(StorageGrainAnalysis storageGrainAnalysis);
33
+
34
+	/**
35
+	 * 查询一条数据
36
+	 * 
37
+	 * @param id 数据ID
38
+	 * @return
39
+	 */
40
+	StorageGrainAnalysis findByParmaryKey(Integer id);
41
+
42
+	/**
43
+	 * 查询一组数据
44
+	 * 
45
+	 * @param example 条件
46
+	 * @return
47
+	 */
48
+	List<StorageGrainAnalysis> findByCondition(StorageGrainAnalysisExample example);
49
+
50
+	/**
51
+	 * 查询一条分析记录的所有关联信息
52
+	 * 
53
+	 * @param id 数据ID
54
+	 * @param analysisType 分析类型
55
+	 * @param map 返回对象
56
+	 */
57
+	Map<String, Object> findByIdAnalysisObj(Integer id, Integer analysisType, Map<String, Object> map);
58
+
59
+	/**
60
+	 * 更新粮情分析和异常四无情况数据
61
+	 * 
62
+	 * @param grainJson 主表数据
63
+	 * @param exceptionJson 从表数据
64
+	 * @return
65
+	 */
66
+	Map<String, Object> updateGrainAndException(String grainJson, String exceptionJson, Map<String, Object> map, Integer type,Integer orgId, Integer userId);
67
+
68
+	/**
69
+	 * 以月份为条件查询三温数据
70
+	 * 
71
+	 * @param houseId 仓房ID
72
+	 * @param wareId 货位ID
73
+	 * @param year 年
74
+	 * @param month 月
75
+	 * @param orgId 粮库ID
76
+	 * @param map 返回对象
77
+	 * @return
78
+	 */
79
+	Map<String, Object> getMonthThreeTempDate(Integer houseId, Integer wareId, Integer year, Integer month,
80
+			Integer orgId, Map<String, Object> map);
81
+
82
+	/**
83
+	 * 以年为条件查询三温数据
84
+	 * 
85
+	 * @param houseId 仓房ID
86
+	 * @param wareId 货位ID
87
+	 * @param year 年
88
+	 * @param orgId 粮库ID
89
+	 * @param map 返回对象
90
+	 * @return
91
+	 */
92
+	Map<String, Object> getYearThreeTempDate(Integer houseId, Integer wareId, Integer year, Integer orgId,
93
+			Map<String, Object> map);
94
+}

+ 266 - 0
src/main/java/com/chinaitop/depot/grainAnalysis/service/impl/StorageGrainAnalysisServiceImpl.java

@@ -0,0 +1,266 @@
1
+package com.chinaitop.depot.grainAnalysis.service.impl;
2
+
3
+import java.util.ArrayList;
4
+import java.util.Date;
5
+import java.util.HashMap;
6
+import java.util.List;
7
+import java.util.Map;
8
+
9
+import javax.annotation.Resource;
10
+
11
+import org.springframework.stereotype.Service;
12
+
13
+import com.chinaitop.depot.grainAnalysis.mapper.StorageExceptionAndOnforeMapper;
14
+import com.chinaitop.depot.grainAnalysis.mapper.StorageGrainAnalysisMapper;
15
+import com.chinaitop.depot.grainAnalysis.model.StorageExceptionAndOnfore;
16
+import com.chinaitop.depot.grainAnalysis.model.StorageExceptionAndOnforeExample;
17
+import com.chinaitop.depot.grainAnalysis.model.StorageGrainAnalysis;
18
+import com.chinaitop.depot.grainAnalysis.model.StorageGrainAnalysisExample;
19
+import com.chinaitop.depot.grainAnalysis.service.StorageGrainAnalysisService;
20
+import com.chinaitop.utils.ParameterUtil;
21
+import com.fasterxml.jackson.core.type.TypeReference;
22
+import com.fasterxml.jackson.databind.ObjectMapper;
23
+
24
+@Service
25
+public class StorageGrainAnalysisServiceImpl implements StorageGrainAnalysisService {
26
+
27
+	@Resource
28
+	private StorageGrainAnalysisMapper analysisMapper;
29
+
30
+	@Resource
31
+	private StorageExceptionAndOnforeMapper exceptionAndOnforeMapper;
32
+
33
+	@Override
34
+	public void add(StorageGrainAnalysis storageGrainAnalysis) {
35
+		analysisMapper.insertSelective(storageGrainAnalysis);
36
+	}
37
+
38
+	@Override
39
+	public void remove(Integer id) {
40
+		analysisMapper.deleteByPrimaryKey(id);
41
+	}
42
+
43
+	@Override
44
+	public void update(StorageGrainAnalysis storageGrainAnalysis) {
45
+		analysisMapper.updateByPrimaryKeySelective(storageGrainAnalysis);
46
+	}
47
+
48
+	@Override
49
+	public StorageGrainAnalysis findByParmaryKey(Integer id) {
50
+		return analysisMapper.selectByPrimaryKey(id);
51
+	}
52
+
53
+	@Override
54
+	public List<StorageGrainAnalysis> findByCondition(StorageGrainAnalysisExample example) {
55
+		return analysisMapper.selectByExample(example);
56
+	}
57
+
58
+	@Override
59
+	public Map<String, Object> findByIdAnalysisObj(Integer id, Integer analysisType, Map<String, Object> map) {
60
+
61
+		// 查询主表数据
62
+		StorageGrainAnalysis grain = analysisMapper.selectByPrimaryKey(id);
63
+		map.put("grain", grain);
64
+
65
+		// 查询三温检查数据
66
+		Integer houseId = grain.getStorehouseId();
67
+		Integer wareId = grain.getWarehouseId();
68
+		if (analysisType == 0) {// 周分析
69
+			map.put("houseId",grain.getStorehouseId());
70
+			map.put("wareId",grain.getWarehouseId());
71
+			map.put("orgId",grain.getOrgId());
72
+			map.put("startDate",ParameterUtil.date2string(grain.getCheckDateStart()));
73
+			map.put("endDate",ParameterUtil.date2string(grain.getCheckDateEnd()));
74
+		} else if (analysisType == 1) {// 月分析
75
+			getMonthThreeTempDate(houseId, wareId, grain.getYear(), grain.getMonth(),
76
+					grain.getOrgId(), map);
77
+		} else if (analysisType == 2) {//年分析
78
+			getYearThreeTempDate(houseId, wareId, grain.getYear(), grain.getOrgId(), map);
79
+		}
80
+		
81
+		
82
+		// 查询粮情异常和四无情况数据
83
+		getExceptionAndOnfore(grain.getAnalysisId(), map);
84
+
85
+		return map;
86
+	}
87
+
88
+	@Override
89
+	public Map<String, Object> getMonthThreeTempDate(Integer houseId, Integer wareId, Integer year, Integer month,
90
+			Integer orgId, Map<String, Object> map) {
91
+		/**
92
+		 * 思路:1、将当前月的所有周分析数据拿到;
93
+		 * 2、然后按照每条周分析数据的检查时间范围来查询每周对应的三温检查数据;
94
+		 * 3、将每周的三温检查数据取到第一条作为一周的代表数据;
95
+		 * 4、将每周的三温检查代表数据放入集合中返回
96
+		 */
97
+
98
+		List list = new ArrayList();
99
+
100
+		//将当前月的所有周分析数据拿到;
101
+		StorageGrainAnalysisExample grainExample = new StorageGrainAnalysisExample();
102
+		StorageGrainAnalysisExample.Criteria grainCriteria = grainExample.createCriteria();
103
+		grainCriteria.andYearEqualTo(year);
104
+		if (month.toString().length() == 1) {
105
+			month = Integer.parseInt("0" + month.toString());
106
+		}
107
+		grainCriteria.andMonthEqualTo(month);
108
+		grainCriteria.andStorehouseIdEqualTo(houseId);
109
+		grainCriteria.andWarehouseIdEqualTo(wareId);
110
+		grainCriteria.andAnalysisTypeEqualTo(0);
111
+		grainExample.setOrderByClause("id asc");
112
+		List<StorageGrainAnalysis> grainList = analysisMapper.selectByExample(grainExample);
113
+
114
+		Map<String, Object> param_map = new HashMap<String, Object>();
115
+		param_map.put("house_id", houseId);
116
+		Map<String, Object> house_map = analysisMapper.selectStoreHouseObj(param_map);
117
+		String houseCode = house_map.get("storehouse_code")+"";
118
+		
119
+		//然后按照每条周分析数据的检查时间范围来查询每周对应的三温检查数据,每周的取一条数据组成集合返回;
120
+		if (null != grainList && grainList.size() > 0) {
121
+			for (StorageGrainAnalysis grain : grainList) {
122
+				Date startDate = grain.getCheckDateStart();
123
+				String startDate_str = ParameterUtil.date2string(startDate);
124
+
125
+				Date endDate = grain.getCheckDateEnd();
126
+				String endDate_str = ParameterUtil.date2string(endDate);
127
+
128
+				Map<String, Object> dateMap = new HashMap<>();
129
+				dateMap.put("houseId",houseCode);
130
+				dateMap.put("startDate",startDate_str);
131
+				dateMap.put("endDate",endDate_str);
132
+				dateMap.put("orgId",orgId);
133
+				list.add(dateMap);
134
+			}
135
+			
136
+			if (null == list || list.size() == 0) {
137
+				list = new ArrayList();
138
+			}
139
+		} else {
140
+			list = new ArrayList();
141
+		}
142
+		map.put("threeTempCheckList", list);
143
+
144
+		return map;
145
+	}
146
+	
147
+	@Override
148
+	public Map<String, Object> getYearThreeTempDate(Integer houseId, Integer wareId, Integer year, Integer orgId,
149
+			Map<String, Object> map) {
150
+		/**
151
+		 * 思路:1、将当前年份的所有月分析数据拿到;
152
+		 * 2、将每月的三温检查数据取到第一条作为一月的代表数据;
153
+		 * 3、将每月的三温检查代表数据放入集合中返回
154
+		 */
155
+
156
+		List list = new ArrayList();
157
+		
158
+		//将当前月的所有周分析数据拿到;
159
+		StorageGrainAnalysisExample grainExample = new StorageGrainAnalysisExample();
160
+		StorageGrainAnalysisExample.Criteria grainCriteria = grainExample.createCriteria();
161
+		grainCriteria.andYearEqualTo(year);
162
+		grainCriteria.andStorehouseIdEqualTo(houseId);
163
+		grainCriteria.andWarehouseIdEqualTo(wareId);
164
+		grainCriteria.andAnalysisTypeEqualTo(1);
165
+		grainExample.setOrderByClause("id asc");
166
+		List<StorageGrainAnalysis> grainYearList = analysisMapper.selectByExample(grainExample);
167
+		
168
+		//然后按照每条周分析数据的检查时间范围来查询每周对应的三温检查数据,每周的取一条数据组成集合返回;
169
+		if (null != grainYearList && grainYearList.size() > 0) {
170
+			list = new ArrayList();
171
+			Integer month = null;
172
+			Map<String, Object> monthMap = new HashMap<>();
173
+			for (StorageGrainAnalysis grain : grainYearList) {
174
+
175
+				//获取每个月的月分析数据
176
+//				monthMap = getMonthThreeTempDate(houseId, wareId, year, month, grain.getOrgId(), monthMap);
177
+				
178
+				//取月数据的第一条为代当前月的代表数据,最后结果是有几个月的分析数据就返回几条数据
179
+//				StorageThreetempcheck threetempcheck = ((List<StorageThreetempcheck>) monthMap.get("threeTempCheckList")).get(0);
180
+				list.add(grain.getMonth());
181
+			}
182
+			
183
+			if (null == list || list.size() == 0) {
184
+				list = new ArrayList();
185
+			}
186
+		} else {
187
+			list = new ArrayList();
188
+		}
189
+		map.put("threeTempCheckList", list);
190
+
191
+		return map;
192
+	}
193
+	
194
+	private Map<String, Object> getExceptionAndOnfore(String analysisId, Map<String, Object> map) {
195
+		StorageExceptionAndOnforeExample example = new StorageExceptionAndOnforeExample();
196
+		StorageExceptionAndOnforeExample.Criteria criteria = example.createCriteria();
197
+		criteria.andAnalysisIdEqualTo(analysisId);
198
+		example.setOrderByClause("id asc");
199
+
200
+		List<StorageExceptionAndOnfore> list = exceptionAndOnforeMapper.selectByExample(example);
201
+
202
+		map.put("exceptionAndOnforeList", list);
203
+
204
+		return map;
205
+	}
206
+
207
+	@Override
208
+	public Map<String, Object> updateGrainAndException(String grainJson,String exceptionJson,
209
+			Map<String, Object> map, Integer type,Integer orgId, Integer userId) {
210
+
211
+		ObjectMapper mappers = new ObjectMapper();
212
+		try {
213
+			StorageGrainAnalysis grain = mappers.readValue(grainJson, StorageGrainAnalysis.class);
214
+			if (grain.getId() == null || "".equals(grain.getId())) {
215
+
216
+				if (type == 0) {
217
+					Date startDate = grain.getCheckDateStart();
218
+					String startDate_str = ParameterUtil.date2string(startDate);
219
+					String year = startDate_str.substring(0, 4);
220
+			        String month = startDate_str.substring(5, 7);
221
+			        grain.setYear(Integer.parseInt(year));
222
+					grain.setMonth(Integer.parseInt(month));
223
+				}
224
+
225
+				grain.setOrgId(orgId);
226
+				grain.setInputDate(new Date());
227
+				grain.setAuditorStatus(0); // 新数据设置为未审核状态
228
+				grain.setAnalysisType(type); //分析类型:0周分析,1月分析,2年分析
229
+				analysisMapper.insertSelective(grain);
230
+			} else {
231
+				analysisMapper.updateByPrimaryKeySelective(grain);
232
+			}
233
+
234
+			//更新粮食异常和四无分析信息
235
+			List<StorageExceptionAndOnfore> exceptionList = mappers.readValue(exceptionJson,
236
+					new TypeReference<List<StorageExceptionAndOnfore>>() {
237
+					});
238
+			editException(exceptionList, grain.getAnalysisId(), userId);
239
+			map.put("status", "success");
240
+			map.put("msg", "提交成功!");
241
+		} catch (Exception e) {
242
+			e.printStackTrace();
243
+		}
244
+		return map;
245
+	}
246
+
247
+	/**
248
+	 * 更新粮食异常和四无分析信息
249
+	 * 
250
+	 * @param edcationList
251
+	 * @param analysisId
252
+	 * @param userId
253
+	 */
254
+	private void editException(List<StorageExceptionAndOnfore> edcationList, String analysisId, Integer userId) {
255
+		for (StorageExceptionAndOnfore obj : edcationList) {
256
+			if (null == obj.getId() || "".equals(obj.getId())) {
257
+				obj.setAnalysisId(analysisId);
258
+				obj.setInputPerson(userId);
259
+				exceptionAndOnforeMapper.insertSelective(obj);
260
+			} else {
261
+				exceptionAndOnforeMapper.updateByPrimaryKeySelective(obj);
262
+			}
263
+		}
264
+	}
265
+
266
+}

+ 44 - 0
src/main/java/com/chinaitop/depot/utils/CustomFilter.java

@@ -0,0 +1,44 @@
1
+package com.chinaitop.depot.utils;
2
+
3
+import java.io.IOException;
4
+
5
+import javax.servlet.Filter;
6
+import javax.servlet.FilterChain;
7
+import javax.servlet.FilterConfig;
8
+import javax.servlet.ServletException;
9
+import javax.servlet.ServletRequest;
10
+import javax.servlet.ServletResponse;
11
+import javax.servlet.http.HttpServletRequest;
12
+import javax.servlet.http.HttpSession;
13
+
14
+import org.apache.commons.lang.ObjectUtils;
15
+
16
+public class CustomFilter implements Filter {
17
+
18
+	@Override
19
+    public void init(FilterConfig filterConfig) throws ServletException {
20
+ 
21
+    }
22
+	
23
+	@Override
24
+	public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain arg2)
25
+			throws IOException, ServletException {
26
+		HttpServletRequest request = (HttpServletRequest) arg0;
27
+		HttpSession session = request.getSession();
28
+		String orgId = "";
29
+		if (session != null){
30
+			orgId = ObjectUtils.toString(session.getAttribute("orgId"),"");
31
+		}
32
+		if (!orgId.isEmpty()) {
33
+			DataPolicyEngine.set(orgId);
34
+		}
35
+		arg2.doFilter(arg0, arg1);
36
+		DataPolicyEngine.remove();
37
+	}
38
+	
39
+	@Override
40
+    public void destroy() {
41
+ 
42
+    }
43
+
44
+}

+ 61 - 0
src/main/java/com/chinaitop/depot/utils/DataPolicyEngine.java

@@ -0,0 +1,61 @@
1
+package com.chinaitop.depot.utils;
2
+
3
+import org.apache.commons.logging.Log;
4
+import org.apache.commons.logging.LogFactory;
5
+
6
+
7
+/**
8
+ * 
9
+ * @author hf
10
+ * 
11
+ * @description 数据策略(数据权限控制使用)
12
+ * 
13
+ * 
14
+ */
15
+public class DataPolicyEngine {
16
+	//log信息输出对象
17
+	protected static final Log log = LogFactory.getLog(DataPolicyEngine.class); 
18
+
19
+	//本地线程,用于存储线程公共对象
20
+	private static ThreadLocal threadLocalSession = new ThreadLocal();
21
+	
22
+	
23
+	/**
24
+	 * @description 获取本地执行线程
25
+	 *
26
+	 * @return ThreadLocal 
27
+	 * 
28
+	 */
29
+	public static ThreadLocal getThreadLocalSession() {
30
+		return threadLocalSession;
31
+	}
32
+	
33
+	/**
34
+	 * @description 在线程内设置存储对象
35
+	 * 
36
+	 */
37
+	public static void set(Object obj) {
38
+		threadLocalSession.set(obj);
39
+
40
+	}
41
+	
42
+	/**
43
+	 * @description 获取在线程内设置存储的对象
44
+	 * 
45
+	 */
46
+	public static Object get() {
47
+		return threadLocalSession.get();
48
+
49
+	}
50
+
51
+	/**
52
+	 * @description 移除在线程内设置存储的对象
53
+	 * 
54
+	 */
55
+	public static void remove() {
56
+		threadLocalSession.remove();
57
+
58
+	}
59
+	
60
+	
61
+}

+ 66 - 0
src/main/java/com/chinaitop/depot/utils/RedisConfig.java

@@ -0,0 +1,66 @@
1
+package com.chinaitop.depot.utils;
2
+
3
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
4
+import com.fasterxml.jackson.annotation.PropertyAccessor;
5
+import com.fasterxml.jackson.databind.ObjectMapper;
6
+import org.springframework.beans.factory.annotation.Autowired;
7
+import org.springframework.context.annotation.Bean;
8
+import org.springframework.context.annotation.Configuration;
9
+import org.springframework.data.redis.connection.RedisConnectionFactory;
10
+import org.springframework.data.redis.core.HashOperations;
11
+import org.springframework.data.redis.core.ListOperations;
12
+import org.springframework.data.redis.core.RedisTemplate;
13
+import org.springframework.data.redis.core.SetOperations;
14
+import org.springframework.data.redis.core.ValueOperations;
15
+import org.springframework.data.redis.core.ZSetOperations;
16
+import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
17
+import org.springframework.data.redis.serializer.StringRedisSerializer;
18
+
19
+@Configuration
20
+public class RedisConfig {
21
+    @Autowired
22
+    private RedisConnectionFactory factory;
23
+
24
+    @Bean
25
+    public RedisTemplate<String, Object> redisTemplate() {
26
+        Jackson2JsonRedisSerializer<Object> jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer<Object>(Object.class);
27
+        ObjectMapper om = new ObjectMapper();
28
+        om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
29
+        om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
30
+        jackson2JsonRedisSerializer.setObjectMapper(om);
31
+        RedisTemplate<String, Object> template = new RedisTemplate<String, Object>();
32
+        template.setConnectionFactory(factory);
33
+        template.setKeySerializer(new StringRedisSerializer());
34
+        template.setValueSerializer(jackson2JsonRedisSerializer);
35
+        template.setHashKeySerializer(jackson2JsonRedisSerializer);
36
+        template.setHashValueSerializer(jackson2JsonRedisSerializer);
37
+        template.setDefaultSerializer(new StringRedisSerializer());
38
+        template.afterPropertiesSet();
39
+        return template;
40
+    }
41
+
42
+    @Bean
43
+    public HashOperations<String, String, Object> hashOperations(RedisTemplate<String, Object> redisTemplate) {
44
+        return redisTemplate.opsForHash();
45
+    }
46
+
47
+    @Bean
48
+    public ValueOperations<String, String> valueOperations(RedisTemplate<String, String> redisTemplate) {
49
+        return redisTemplate.opsForValue();
50
+    }
51
+
52
+    @Bean
53
+    public ListOperations<String, Object> listOperations(RedisTemplate<String, Object> redisTemplate) {
54
+        return redisTemplate.opsForList();
55
+    }
56
+
57
+    @Bean
58
+    public SetOperations<String, Object> setOperations(RedisTemplate<String, Object> redisTemplate) {
59
+        return redisTemplate.opsForSet();
60
+    }
61
+
62
+    @Bean
63
+    public ZSetOperations<String, Object> zSetOperations(RedisTemplate<String, Object> redisTemplate) {
64
+        return redisTemplate.opsForZSet();
65
+    }
66
+}

+ 547 - 0
src/main/java/com/chinaitop/depot/utils/RedisUtil.java

@@ -0,0 +1,547 @@
1
+package com.chinaitop.depot.utils;
2
+
3
+import java.util.List;
4
+import java.util.Map;
5
+import java.util.Set;
6
+import java.util.concurrent.TimeUnit;
7
+import org.springframework.beans.factory.annotation.Autowired;
8
+import org.springframework.data.redis.core.HashOperations;
9
+import org.springframework.data.redis.core.ListOperations;
10
+import org.springframework.data.redis.core.RedisTemplate;
11
+import org.springframework.data.redis.core.SetOperations;
12
+import org.springframework.data.redis.core.ValueOperations;
13
+import org.springframework.stereotype.Component;
14
+import org.springframework.util.CollectionUtils;
15
+
16
+@Component
17
+public class RedisUtil {
18
+
19
+    @Autowired
20
+    private RedisTemplate<String, Object> redisTemplate;
21
+    @Autowired
22
+    private ValueOperations<String, String> valueOperations;
23
+    @Autowired
24
+    private HashOperations<String, String, Object> hashOperations;
25
+    @Autowired
26
+    private ListOperations<String, Object> listOperations;
27
+    @Autowired
28
+    private SetOperations<String, Object> setOperations;
29
+
30
+    //=============================common============================
31
+    /**
32
+     * 指定缓存失效时间
33
+     * @param key 键
34
+     * @param time 时间(秒)
35
+     * @return
36
+     */
37
+    public boolean expire(String key,long time){
38
+        try {
39
+            if(time>0){
40
+                redisTemplate.expire(key, time, TimeUnit.SECONDS);
41
+            }
42
+            return true;
43
+        } catch (Exception e) {
44
+            e.printStackTrace();
45
+            return false;
46
+        }
47
+    }
48
+
49
+    /**
50
+     * 根据key 获取过期时间
51
+     * @param key 键 不能为null
52
+     * @return 时间(秒) 返回0代表为永久有效
53
+     */
54
+    public long getExpire(String key){
55
+        return redisTemplate.getExpire(key,TimeUnit.SECONDS);
56
+    }
57
+
58
+    /**
59
+     * 判断key是否存在
60
+     * @param key 键
61
+     * @return true 存在 false不存在
62
+     */
63
+    public boolean hasKey(String key){
64
+        try {
65
+            return redisTemplate.hasKey(key);
66
+        } catch (Exception e) {
67
+            e.printStackTrace();
68
+            return false;
69
+        }
70
+    }
71
+
72
+    /**
73
+     * 删除缓存
74
+     * @param key 可以传一个值 或多个
75
+     */
76
+    @SuppressWarnings("unchecked")
77
+    public void del(String ... key){
78
+        if(key!=null&&key.length>0){
79
+            if(key.length==1){
80
+                redisTemplate.delete(key[0]);
81
+            }else{
82
+                redisTemplate.delete(CollectionUtils.arrayToList(key));
83
+            }
84
+        }
85
+    }
86
+
87
+    //============================String=============================
88
+    /**
89
+     * 普通缓存获取
90
+     * @param key 键
91
+     * @return 值
92
+     */
93
+    public Object get(String key){
94
+        return key==null?null:valueOperations.get(key);
95
+    }
96
+
97
+    /**
98
+     * 普通缓存放入
99
+     * @param key 键
100
+     * @param value 值
101
+     * @return true成功 false失败
102
+     */
103
+    public boolean set(String key,String value) {
104
+        try {
105
+            valueOperations.set(key, value);
106
+            return true;
107
+        } catch (Exception e) {
108
+            e.printStackTrace();
109
+            return false;
110
+        }
111
+
112
+    }
113
+
114
+    /**
115
+     * 普通缓存放入并设置时间
116
+     * @param key 键
117
+     * @param value 值
118
+     * @param time 时间(秒) time要大于0 如果time小于等于0 将设置无限期
119
+     * @return true成功 false 失败
120
+     */
121
+    public boolean set(String key,String value,long time){
122
+        try {
123
+            if(time>0){
124
+                valueOperations.set(key, value, time, TimeUnit.SECONDS);
125
+            }else{
126
+                set(key, value);
127
+            }
128
+            return true;
129
+        } catch (Exception e) {
130
+            e.printStackTrace();
131
+            return false;
132
+        }
133
+    }
134
+
135
+    /**
136
+     * 递增
137
+     * @param key 键
138
+     * @param by 要增加几(大于0)
139
+     * @return
140
+     */
141
+    public long incr(String key, long delta){
142
+        if(delta<0){
143
+            throw new RuntimeException("递增因子必须大于0");
144
+        }
145
+        return valueOperations.increment(key, delta);
146
+    }
147
+
148
+    /**
149
+     * 递减
150
+     * @param key 键
151
+     * @param by 要减少几(小于0)
152
+     * @return
153
+     */
154
+    public long decr(String key, long delta){
155
+        if(delta<0){
156
+            throw new RuntimeException("递减因子必须大于0");
157
+        }
158
+        return valueOperations.increment(key, -delta);
159
+    }
160
+
161
+    //================================Map=================================
162
+    /**
163
+     * HashGet
164
+     * @param key 键 不能为null
165
+     * @param item 项 不能为null
166
+     * @return 值
167
+     */
168
+    public Object hget(String key,String item){
169
+        return hashOperations.get(key, item);
170
+    }
171
+
172
+    /**
173
+     * 获取hashKey对应的所有键值
174
+     * @param key 键
175
+     * @return 对应的多个键值
176
+     */
177
+    public Map<String, Object> hmget(String key){
178
+        return hashOperations.entries(key);
179
+    }
180
+
181
+    /**
182
+     * HashSet
183
+     * @param key 键
184
+     * @param map 对应多个键值
185
+     * @return true 成功 false 失败
186
+     */
187
+    public boolean hmset(String key, Map<String,Object> map){
188
+        try {
189
+            hashOperations.putAll(key, map);
190
+            return true;
191
+        } catch (Exception e) {
192
+            e.printStackTrace();
193
+            return false;
194
+        }
195
+    }
196
+
197
+    /**
198
+     * HashSet 并设置时间
199
+     * @param key 键
200
+     * @param map 对应多个键值
201
+     * @param time 时间(秒)
202
+     * @return true成功 false失败
203
+     */
204
+    public boolean hmset(String key, Map<String,Object> map, long time){
205
+        try {
206
+            hashOperations.putAll(key, map);
207
+            if(time>0){
208
+                expire(key, time);
209
+            }
210
+            return true;
211
+        } catch (Exception e) {
212
+            e.printStackTrace();
213
+            return false;
214
+        }
215
+    }
216
+
217
+    /**
218
+     * 向一张hash表中放入数据,如果不存在将创建
219
+     * @param key 键
220
+     * @param item 项
221
+     * @param value 值
222
+     * @return true 成功 false失败
223
+     */
224
+    public boolean hset(String key,String item,Object value) {
225
+        try {
226
+            hashOperations.put(key, item, value);
227
+            return true;
228
+        } catch (Exception e) {
229
+            e.printStackTrace();
230
+            return false;
231
+        }
232
+    }
233
+
234
+    /**
235
+     * 向一张hash表中放入数据,如果不存在将创建
236
+     * @param key 键
237
+     * @param item 项
238
+     * @param value 值
239
+     * @param time 时间(秒)  注意:如果已存在的hash表有时间,这里将会替换原有的时间
240
+     * @return true 成功 false失败
241
+     */
242
+    public boolean hset(String key,String item,Object value,long time) {
243
+        try {
244
+            hashOperations.put(key, item, value);
245
+            if(time>0){
246
+                expire(key, time);
247
+            }
248
+            return true;
249
+        } catch (Exception e) {
250
+            e.printStackTrace();
251
+            return false;
252
+        }
253
+    }
254
+
255
+    /**
256
+     * 删除hash表中的值
257
+     * @param key 键 不能为null
258
+     * @param item 项 可以使多个 不能为null
259
+     */
260
+    public void hdel(String key, Object... item){
261
+        hashOperations.delete(key,item);
262
+    }
263
+
264
+    /**
265
+     * 判断hash表中是否有该项的值
266
+     * @param key 键 不能为null
267
+     * @param item 项 不能为null
268
+     * @return true 存在 false不存在
269
+     */
270
+    public boolean hHasKey(String key, String item){
271
+        return hashOperations.hasKey(key, item);
272
+    }
273
+
274
+    /**
275
+     * hash递增 如果不存在,就会创建一个 并把新增后的值返回
276
+     * @param key 键
277
+     * @param item 项
278
+     * @param by 要增加几(大于0)
279
+     * @return
280
+     */
281
+    public double hincr(String key, String item,double by){
282
+        return hashOperations.increment(key, item, by);
283
+    }
284
+
285
+    /**
286
+     * hash递减
287
+     * @param key 键
288
+     * @param item 项
289
+     * @param by 要减少记(小于0)
290
+     * @return
291
+     */
292
+    public double hdecr(String key, String item,double by){
293
+        return hashOperations.increment(key, item,-by);
294
+    }
295
+
296
+    //============================set=============================
297
+    /**
298
+     * 根据key获取Set中的所有值
299
+     * @param key 键
300
+     * @return
301
+     */
302
+    public Set<Object> sGet(String key){
303
+        try {
304
+            return setOperations.members(key);
305
+        } catch (Exception e) {
306
+            e.printStackTrace();
307
+            return null;
308
+        }
309
+    }
310
+
311
+    /**
312
+     * 根据value从一个set中查询,是否存在
313
+     * @param key 键
314
+     * @param value 值
315
+     * @return true 存在 false不存在
316
+     */
317
+    public boolean sHasKey(String key,Object value){
318
+        try {
319
+            return setOperations.isMember(key, value);
320
+        } catch (Exception e) {
321
+            e.printStackTrace();
322
+            return false;
323
+        }
324
+    }
325
+
326
+    /**
327
+     * 将数据放入set缓存
328
+     * @param key 键
329
+     * @param values 值 可以是多个
330
+     * @return 成功个数
331
+     */
332
+    public long sSet(String key, Object...values) {
333
+        try {
334
+            return setOperations.add(key, values);
335
+        } catch (Exception e) {
336
+            e.printStackTrace();
337
+            return 0;
338
+        }
339
+    }
340
+
341
+    /**
342
+     * 将set数据放入缓存
343
+     * @param key 键
344
+     * @param time 时间(秒)
345
+     * @param values 值 可以是多个
346
+     * @return 成功个数
347
+     */
348
+    public long sSetAndTime(String key,long time,Object...values) {
349
+        try {
350
+            Long count = setOperations.add(key, values);
351
+            if(time>0) expire(key, time);
352
+            return count;
353
+        } catch (Exception e) {
354
+            e.printStackTrace();
355
+            return 0;
356
+        }
357
+    }
358
+
359
+    /**
360
+     * 获取set缓存的长度
361
+     * @param key 键
362
+     * @return
363
+     */
364
+    public long sGetSetSize(String key){
365
+        try {
366
+            return setOperations.size(key);
367
+        } catch (Exception e) {
368
+            e.printStackTrace();
369
+            return 0;
370
+        }
371
+    }
372
+
373
+    /**
374
+     * 移除值为value的
375
+     * @param key 键
376
+     * @param values 值 可以是多个
377
+     * @return 移除的个数
378
+     */
379
+    public long setRemove(String key, Object ...values) {
380
+        try {
381
+            Long count = setOperations.remove(key, values);
382
+            return count;
383
+        } catch (Exception e) {
384
+            e.printStackTrace();
385
+            return 0;
386
+        }
387
+    }
388
+    //===============================list=================================
389
+
390
+    /**
391
+     * 获取list缓存的内容
392
+     * @param key 键
393
+     * @param start 开始
394
+     * @param end 结束  0 到 -1代表所有值
395
+     * @return
396
+     */
397
+    public List<Object> lGet(String key, long start, long end){
398
+        try {
399
+            return listOperations.range(key, start, end);
400
+        } catch (Exception e) {
401
+            e.printStackTrace();
402
+            return null;
403
+        }
404
+    }
405
+
406
+    /**
407
+     * 获取list缓存的所有内容
408
+     * @param key
409
+     * @return
410
+     */
411
+    public List<Object> lGetAll(String key){
412
+        return lGet(key,0,-1);
413
+    }
414
+
415
+    /**
416
+     * 获取list缓存的长度
417
+     * @param key 键
418
+     * @return
419
+     */
420
+    public long lGetListSize(String key){
421
+        try {
422
+            return listOperations.size(key);
423
+        } catch (Exception e) {
424
+            e.printStackTrace();
425
+            return 0;
426
+        }
427
+    }
428
+
429
+    /**
430
+     * 通过索引 获取list中的值
431
+     * @param key 键
432
+     * @param index 索引  index>=0时, 0 表头,1 第二个元素,依次类推;index<0时,-1,表尾,-2倒数第二个元素,依次类推
433
+     * @return
434
+     */
435
+    public Object lGetIndex(String key,long index){
436
+        try {
437
+            return listOperations.index(key, index);
438
+        } catch (Exception e) {
439
+            e.printStackTrace();
440
+            return null;
441
+        }
442
+    }
443
+
444
+    /**
445
+     * 将list放入缓存
446
+     * @param key 键
447
+     * @param value 值
448
+     * @param time 时间(秒)
449
+     * @return
450
+     */
451
+    public boolean lSet(String key, Object value) {
452
+        try {
453
+            listOperations.rightPush(key, value);
454
+            return true;
455
+        } catch (Exception e) {
456
+            e.printStackTrace();
457
+            return false;
458
+        }
459
+    }
460
+
461
+    /**
462
+     * 将list放入缓存
463
+     * @param key 键
464
+     * @param value 值
465
+     * @param time 时间(秒)
466
+     * @return
467
+     */
468
+    public boolean lSet(String key, Object value, long time) {
469
+        try {
470
+            listOperations.rightPush(key, value);
471
+            if (time > 0) expire(key, time);
472
+            return true;
473
+        } catch (Exception e) {
474
+            e.printStackTrace();
475
+            return false;
476
+        }
477
+    }
478
+
479
+    /**
480
+     * 将list放入缓存
481
+     * @param key 键
482
+     * @param value 值
483
+     * @param time 时间(秒)
484
+     * @return
485
+     */
486
+    public boolean lSet(String key, List<Object> value) {
487
+        try {
488
+            listOperations.rightPushAll(key, value);
489
+            return true;
490
+        } catch (Exception e) {
491
+            e.printStackTrace();
492
+            return false;
493
+        }
494
+    }
495
+
496
+    /**
497
+     * 将list放入缓存
498
+     * @param key 键
499
+     * @param value 值
500
+     * @param time 时间(秒)
501
+     * @return
502
+     */
503
+    public boolean lSet(String key, List<Object> value, long time) {
504
+        try {
505
+            listOperations.rightPushAll(key, value);
506
+            if (time > 0) expire(key, time);
507
+            return true;
508
+        } catch (Exception e) {
509
+            e.printStackTrace();
510
+            return false;
511
+        }
512
+    }
513
+
514
+    /**
515
+     * 根据索引修改list中的某条数据
516
+     * @param key 键
517
+     * @param index 索引
518
+     * @param value 值
519
+     * @return
520
+     */
521
+    public boolean lUpdateIndex(String key, long index,Object value) {
522
+        try {
523
+            listOperations.set(key, index, value);
524
+            return true;
525
+        } catch (Exception e) {
526
+            e.printStackTrace();
527
+            return false;
528
+        }
529
+    }
530
+
531
+    /**
532
+     * 移除N个值为value
533
+     * @param key 键
534
+     * @param count 移除多少个
535
+     * @param value 值
536
+     * @return 移除的个数
537
+     */
538
+    public long lRemove(String key,long count,Object value) {
539
+        try {
540
+            Long remove = listOperations.remove(key, count, value);
541
+            return remove;
542
+        } catch (Exception e) {
543
+            e.printStackTrace();
544
+            return 0;
545
+        }
546
+    }
547
+}

+ 39 - 0
src/main/java/com/chinaitop/depot/utils/WebConfig.java

@@ -0,0 +1,39 @@
1
+package com.chinaitop.depot.utils;
2
+
3
+import org.springframework.boot.web.servlet.FilterRegistrationBean;
4
+import org.springframework.context.annotation.Bean;
5
+import org.springframework.context.annotation.Configuration;
6
+import java.util.ArrayList;
7
+import java.util.List;
8
+
9
+/**
10
+ * @desc 注册bean, 将自定义过滤器添加到过滤器链中
11
+ * @Author hf
12
+ * @date 2019/3/11
13
+ * @return
14
+ */
15
+@Configuration
16
+public class WebConfig {
17
+
18
+   /**
19
+    * 注册过滤器,有两种方式:
20
+    * 1) 使用 @Component 注解<br>
21
+    * 2) 添加到过滤器链中,此方式适用于使用第三方的过滤器。将过滤器写到 WebConfig 类中,如下:
22
+    */
23
+   @Bean
24
+   public FilterRegistrationBean filterRegistrationBean() {
25
+
26
+      FilterRegistrationBean registrationBean = new FilterRegistrationBean();
27
+
28
+      CustomFilter filter = new CustomFilter();
29
+      registrationBean.setFilter(filter);
30
+
31
+      //设置过滤器拦截请求
32
+      List<String> urls = new ArrayList<>();
33
+      urls.add("/*");
34
+      registrationBean.setUrlPatterns(urls);
35
+
36
+      return registrationBean;
37
+   }
38
+
39
+}

+ 198 - 0
src/main/java/com/chinaitop/utils/ParameterUtil.java

@@ -0,0 +1,198 @@
1
+package com.chinaitop.utils;
2
+
3
+import java.io.BufferedInputStream;
4
+import java.io.InputStream;
5
+import java.text.DateFormat;
6
+import java.text.ParseException;
7
+import java.text.SimpleDateFormat;
8
+import java.util.Date;
9
+import java.util.List;
10
+import java.util.Properties;
11
+import java.util.TimeZone;
12
+import java.util.regex.Matcher;
13
+import java.util.regex.Pattern;
14
+
15
+public class ParameterUtil {
16
+
17
+    public static String getSysDateTime(){
18
+        String temp_str="";
19
+        Date dt = new Date();
20
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
21
+        temp_str=sdf.format(dt);
22
+        System.out.println("获取当前时间"+temp_str);
23
+        return temp_str;
24
+    }
25
+    
26
+    public static String getDateYMDHMS(Date date) {
27
+    	String str = "";
28
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
29
+        str=sdf.format(date);
30
+        System.out.println("获取当前时间"+str);
31
+        return str;
32
+    }
33
+    
34
+    public static String getSysDate(){
35
+        String temp_str="";
36
+        Date dt = new Date();
37
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
38
+        temp_str=sdf.format(dt);
39
+        return temp_str;
40
+    }
41
+
42
+    public static Date string2datetime(String dateTime){
43
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
44
+        Date date = null;
45
+        try {
46
+            date = dateFormat.parse(dateTime);
47
+        } catch (ParseException e) {
48
+            e.printStackTrace();
49
+        }
50
+        return date;
51
+    }
52
+
53
+    public static Date stringTodatetime(String dateTime){
54
+        dateTime = dateTime.substring(0,19);
55
+        dateTime = dateTime.replace("T"," ");
56
+
57
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
58
+        Date date = null;
59
+        try {
60
+            date = dateFormat.parse(dateTime);
61
+        } catch (ParseException e) {
62
+            e.printStackTrace();
63
+        }
64
+        return date;
65
+    }
66
+
67
+    public static Date string2date(String dateTime){
68
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
69
+        Date date = null;
70
+        try {
71
+            date = dateFormat.parse(dateTime);
72
+        } catch (ParseException e) {
73
+            e.printStackTrace();
74
+        }
75
+        return date;
76
+    }
77
+
78
+    public static String date2string(Date date){
79
+        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
80
+        String str=sdf.format(date);
81
+        return str;
82
+    }
83
+
84
+    /**
85
+     * 获取指定时间的时间戳
86
+     * @param datatime
87
+     * @return
88
+     */
89
+    public static String getTimeStamp(String datatime){
90
+        long timeStamp = 0;
91
+        SimpleDateFormat format =  new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
92
+        try {
93
+            Date date = format.parse(datatime);
94
+            timeStamp = date.getTime();
95
+        } catch (ParseException e) {
96
+            e.printStackTrace();
97
+        }
98
+        return String.valueOf(timeStamp);
99
+    }
100
+
101
+    /*
102
+     * 将时间戳转换为时间
103
+     */
104
+    public static String stampToDate(String s){
105
+        String res;
106
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
107
+        long lt = new Long(s);
108
+        Date date = new Date(lt);
109
+        res = simpleDateFormat.format(date);
110
+        return res;
111
+    }
112
+
113
+    public static void main(String[] args) {
114
+//        System.out.println(stampToDate("1504689208643"));
115
+//        System.out.println(getTimeStamp(getSysDateTime()));
116
+    	String ip = "([1-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}";   
117
+    	Pattern pattern = Pattern.compile(ip);  
118
+    	Matcher matcher = pattern.matcher("172.16.10.150");  
119
+    	matcher.matches();  
120
+    	//System.out.println(matcher.matches());
121
+
122
+    	String a = "1.16.10.1";
123
+    	boolean isNum = a.matches(ip);
124
+    	System.out.println(isNum);
125
+    }
126
+    public static String getBHS(String BHS){
127
+        String[] str = BHS.split(",");
128
+        StringBuffer sb = new StringBuffer();
129
+        for(int i=0;i<str.length;i++){
130
+            sb.append("'").append(str[i]).append("'").append(",");
131
+        }
132
+        String s=sb.toString();
133
+        String t=s.substring(0,s.length()-1);
134
+        return t;
135
+    }
136
+
137
+    //判断字段值是为空 不为空返回ture
138
+    public static boolean isnotnull(Object name){
139
+        return (null!=name&&!"".equals(name) && !"null".equals(name) && "null" != name);
140
+    }
141
+    
142
+    //判断字段值是为空,为空返回ture
143
+    public static boolean isnull(Object name){
144
+        return (null==name || "".equals(name) || "null".equals(name) || "null" == name);
145
+    }
146
+
147
+    //判断字段值是相等  相等返回ture
148
+    public static boolean isequal(Object name,Object value){
149
+        if(name==value||name.equals(value)){
150
+            return true;
151
+        }
152
+        return false;
153
+    }
154
+
155
+    /**
156
+     * 判断list和str数组是否全等
157
+     * @param list
158
+     * @param str
159
+     * @return
160
+     */
161
+    public static boolean isAllequal(List<String> list,String[] str){
162
+        boolean isbz = true;
163
+        for(int z=0;z<str.length;z++){
164
+            if(!isequal(list.get(z),str[z])){
165
+                isbz = false;
166
+                break;
167
+            }
168
+        }
169
+        return !isbz || !(str.length == list.size());
170
+    }
171
+
172
+    //判断字段值是否在某个集合里  在返回ture
173
+    public static boolean isallequal(Object name,String[] value){
174
+        for(int i=0;i<value.length;i++){
175
+            if(name==value[i]||name.equals(value[i])){
176
+                return true;
177
+            }
178
+        }
179
+        return false;
180
+    }
181
+
182
+    /**
183
+     * 从properties得到路径
184
+     * @param filePath
185
+     * @return
186
+     */
187
+    public static Properties readProperties(String filePath) {
188
+        Properties props = new Properties();
189
+        try {
190
+            InputStream in = new BufferedInputStream(ParameterUtil.class.getResourceAsStream(filePath));
191
+            props.load(in);
192
+        } catch (Exception e) {
193
+            e.printStackTrace();
194
+        }
195
+        return props;
196
+    }
197
+
198
+}

+ 51 - 0
src/main/resources/bootstrap.yml

@@ -0,0 +1,51 @@
1
+server:
2
+  port: 9013
3
+  tomcat:
4
+    uri-encoding: utf-8
5
+
6
+# 注册中心配置
7
+eureka:
8
+  client:
9
+    service-url:
10
+      defaultZone: http://eureka-depot-yn:9001/eureka/
11
+  instance:
12
+    prefer-ip-address: true
13
+    # 每隔10s发送一次心跳(默认30s)
14
+    lease-renewal-interval-in-seconds: 10
15
+    # 告知服务端30秒还未收到心跳的话,就将该服务移除列表(默认90s)
16
+    lease-expiration-duration-in-seconds: 30
17
+
18
+spring:
19
+  application:
20
+    name: depot-keeper-house
21
+  # 数据库配置
22
+  datasource:
23
+    driver-class-name: com.mysql.jdbc.Driver
24
+    url: jdbc:mysql://192.168.123.38:3306/depot_yunnan?useUnicode=true&characterEncoding=utf-8
25
+    username: root
26
+    password: 123456
27
+  # 缓存配置
28
+  session:
29
+    store-type: redis
30
+  redis:
31
+    database: 0
32
+    host: 192.168.123.98
33
+    port: 6666
34
+    password: depotredis
35
+    timeout: 3000
36
+    jedis:
37
+      pool:
38
+        max-active: 8
39
+        max-wait: -1
40
+        max-idle: 8
41
+        min-idle: 0
42
+  # 静态资源配置
43
+  resources:
44
+    static-locations: classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${web.upload-path}
45
+ 
46
+web:
47
+  upload-path: /home/depot/depot-web/apache-tomcat-8.0.53/webapps/ROOT/WEB-INF/classes/static
48
+
49
+  jackson:
50
+    date-format: yyyy-MM-dd
51
+    time-zone: GMT+8