Commit 2779856992a5b4f6bee5717e11bcfdb015c2d1fd

Authored by atao
0 parents

提交代码

Showing 113 changed files with 12237 additions and 0 deletions

Too many changes.

To preserve performance only 100 of 113 files are displayed.

pom.xml 0 → 100644
  1 +++ a/pom.xml
  1 +<?xml version="1.0"?>
  2 +<project
  3 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
  4 + xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  5 + <modelVersion>4.0.0</modelVersion>
  6 +
  7 + <parent>
  8 + <groupId>com.zteits</groupId>
  9 + <artifactId>zteits-maven-parent</artifactId>
  10 + <version>0.0.1-SNAPSHOT</version>
  11 + <relativePath>../zteits-cloud/zteits-maven-parent/pom.xml</relativePath>
  12 + </parent>
  13 +
  14 + <artifactId>zteits-park-portal</artifactId>
  15 + <name>zteits-park-portal</name>
  16 + <url>http://maven.apache.org</url>
  17 + <properties>
  18 + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  19 + </properties>
  20 + <dependencies>
  21 + <!--引入framewor模块 -->
  22 + <dependency>
  23 + <groupId>com.zteits</groupId>
  24 + <artifactId>zteits-framework</artifactId>
  25 + </dependency>
  26 + <dependency>
  27 + <groupId>com.zteits</groupId>
  28 + <artifactId>zteits-tool-swagger</artifactId>
  29 + </dependency>
  30 +
  31 + <dependency>
  32 + <groupId>org.springframework.boot</groupId>
  33 + <artifactId>spring-boot-starter-web</artifactId>
  34 + </dependency>
  35 + <dependency>
  36 + <groupId>org.springframework.boot</groupId>
  37 + <artifactId>spring-boot-starter-test</artifactId>
  38 + <scope>test</scope>
  39 + </dependency>
  40 + <dependency>
  41 + <groupId>com.alibaba</groupId>
  42 + <artifactId>dubbo</artifactId>
  43 + <exclusions>
  44 + <exclusion>
  45 + <groupId>org.springframework</groupId>
  46 + <artifactId>spring</artifactId>
  47 + </exclusion>
  48 + </exclusions>
  49 + </dependency>
  50 + <dependency>
  51 + <groupId>org.apache.zookeeper</groupId>
  52 + <artifactId>zookeeper</artifactId>
  53 + <exclusions>
  54 + <exclusion>
  55 + <groupId>log4j</groupId>
  56 + <artifactId>log4j</artifactId>
  57 + </exclusion>
  58 + </exclusions>
  59 + </dependency>
  60 + <dependency>
  61 + <groupId>com.alibaba</groupId>
  62 + <artifactId>fastjson</artifactId>
  63 + </dependency>
  64 + <dependency>
  65 + <groupId>mysql</groupId>
  66 + <artifactId>mysql-connector-java</artifactId>
  67 + <scope>runtime</scope>
  68 + </dependency>
  69 + <dependency>
  70 + <groupId>com.alibaba</groupId>
  71 + <artifactId>druid</artifactId>
  72 + </dependency>
  73 + <dependency>
  74 + <groupId>org.mybatis</groupId>
  75 + <artifactId>mybatis</artifactId>
  76 + </dependency>
  77 + <dependency>
  78 + <groupId>com.github.sgroschupf</groupId>
  79 + <artifactId>zkclient</artifactId>
  80 + </dependency>
  81 + <!-- spring session-->
  82 + <dependency>
  83 + <groupId>org.springframework.session</groupId>
  84 + <artifactId>spring-session</artifactId>
  85 + </dependency>
  86 + <dependency>
  87 + <groupId>javax.servlet</groupId>
  88 + <artifactId>servlet-api</artifactId>
  89 + <version>3.0-alpha-1</version>
  90 + </dependency>
  91 + <dependency>
  92 + <groupId>org.aspectj</groupId>
  93 + <artifactId>aspectjrt</artifactId>
  94 + </dependency>
  95 + <dependency>
  96 + <groupId>org.aspectj</groupId>
  97 + <artifactId>aspectjweaver</artifactId>
  98 + </dependency>
  99 + <dependency>
  100 + <groupId>org.springframework.boot</groupId>
  101 + <artifactId>spring-boot-starter-security</artifactId>
  102 + </dependency>
  103 +
  104 + <dependency>
  105 + <groupId>org.apache.httpcomponents</groupId>
  106 + <artifactId>httpclient</artifactId>
  107 + </dependency>
  108 +
  109 + <dependency>
  110 + <groupId>org.springframework.boot</groupId>
  111 + <artifactId>spring-boot-starter-actuator</artifactId>
  112 + </dependency>
  113 +
  114 + <dependency>
  115 + <groupId>commons-codec</groupId>
  116 + <artifactId>commons-codec</artifactId>
  117 + </dependency>
  118 +
  119 + <dependency>
  120 + <groupId>org.springframework.boot</groupId>
  121 + <artifactId>spring-boot-starter-websocket</artifactId>
  122 + </dependency>
  123 + <dependency>
  124 + <groupId>org.webjars</groupId>
  125 + <artifactId>webjars-locator</artifactId>
  126 + </dependency>
  127 + <dependency>
  128 + <groupId>org.webjars</groupId>
  129 + <artifactId>sockjs-client</artifactId>
  130 + <version>1.0.2</version>
  131 + </dependency>
  132 + <dependency>
  133 + <groupId>org.webjars</groupId>
  134 + <artifactId>stomp-websocket</artifactId>
  135 + <version>2.3.3</version>
  136 + </dependency>
  137 + <dependency>
  138 + <groupId>org.webjars</groupId>
  139 + <artifactId>bootstrap</artifactId>
  140 + <version>3.3.7</version>
  141 + </dependency>
  142 + <dependency>
  143 + <groupId>org.webjars</groupId>
  144 + <artifactId>jquery</artifactId>
  145 + <version>3.1.0</version>
  146 + </dependency>
  147 + </dependencies>
  148 + <build>
  149 + <plugins>
  150 + <plugin>
  151 + <groupId>org.springframework.boot</groupId>
  152 + <artifactId>spring-boot-maven-plugin</artifactId>
  153 + <configuration>
  154 + <mainClass>com.zteits.irain.portal.ParkPortalApplication</mainClass>
  155 + </configuration>
  156 + </plugin>
  157 + <plugin>
  158 + <groupId>org.apache.maven.plugins</groupId>
  159 + <artifactId>maven-assembly-plugin</artifactId>
  160 + </plugin>
  161 + </plugins>
  162 + </build>
  163 +</project>
0 164 \ No newline at end of file
... ...
src/main/java/com/zteits/irain/portal/ParkPortalApplication.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/ParkPortalApplication.java
  1 +package com.zteits.irain.portal;
  2 +
  3 +
  4 +import org.springframework.boot.SpringApplication;
  5 +import org.springframework.boot.autoconfigure.SpringBootApplication;
  6 +import org.springframework.boot.context.embedded.EmbeddedServletContainerFactory;
  7 +import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory;
  8 +import org.springframework.context.annotation.Bean;
  9 +import org.springframework.context.annotation.ComponentScan;
  10 +import org.springframework.context.annotation.EnableAspectJAutoProxy;
  11 +import org.springframework.context.annotation.ImportResource;
  12 +
  13 +/**
  14 + *
  15 + * Copyright: Copyright (c) 2017 ZTE-ITS
  16 + *
  17 + * @ClassName: IRainPortalApplication.java
  18 + * @Description:
  19 + * @version: v1.0.0
  20 + * @author: wangbiao
  21 + * @date: 2017年4月20日 上午11:44:00
  22 + * Modification History:
  23 + * Date Author Version Description
  24 + *---------------------------------------------------------*
  25 + * 2017年4月20日 wangbiao v1.0.0 创建
  26 + */
  27 +@SpringBootApplication
  28 +@ImportResource(value={"classpath:dubbo/dubbo-park-consumer.xml"})
  29 +@EnableAspectJAutoProxy
  30 +@ComponentScan(basePackages={"com.zteits.irain.portal","com.clouds.common.redis","com.clouds.common.web"})
  31 +public class ParkPortalApplication {
  32 +
  33 + public static void main(String[] args) {
  34 + SpringApplication.run(ParkPortalApplication.class, args);
  35 +
  36 +
  37 + }
  38 + @Bean
  39 + public EmbeddedServletContainerFactory servletContainer() {
  40 + TomcatEmbeddedServletContainerFactory factory =
  41 + new TomcatEmbeddedServletContainerFactory();
  42 + return factory;
  43 + }
  44 +
  45 +
  46 +
  47 +}
... ...
src/main/java/com/zteits/irain/portal/common/AESPlus.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/common/AESPlus.java
  1 +package com.zteits.irain.portal.common;
  2 +
  3 +import javax.crypto.Cipher;
  4 +import javax.crypto.spec.IvParameterSpec;
  5 +import javax.crypto.spec.SecretKeySpec;
  6 +
  7 +import org.apache.commons.codec.binary.Base64;
  8 +/**
  9 + *
  10 + *
  11 + * Copyright: Copyright (c) 2017 ZTE-ITS
  12 + *
  13 + * @ClassName: AESPlus.java
  14 + * @Description: 艾润 使用的aes加密算法 不够完美 请使用 AESUtils
  15 + * @version: v1.0.0
  16 + * @author: wangbiao
  17 + * @date: 2017年4月24日 下午5:26:10
  18 + * Modification History:
  19 + * Date Author Version Description
  20 + *---------------------------------------------------------*
  21 + * 2017年4月24日 wangbiao v1.0.0 创建
  22 + */
  23 +public class AESPlus {
  24 +
  25 + public static String encrypt(String strKey, String strIn) throws Exception {
  26 + SecretKeySpec skeySpec = getKey(strKey);
  27 + Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
  28 + IvParameterSpec iv = new IvParameterSpec(strKey.getBytes());
  29 + cipher.init(Cipher.ENCRYPT_MODE, skeySpec, iv);
  30 + byte[] encrypted = cipher.doFinal(strIn.getBytes());
  31 + return Base64.encodeBase64String(encrypted);
  32 + }
  33 +
  34 + public static String decrypt(String strKey, String strIn) throws Exception {
  35 + SecretKeySpec skeySpec = getKey(strKey);
  36 + Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
  37 + IvParameterSpec iv = new IvParameterSpec(strKey.getBytes());
  38 + cipher.init(Cipher.DECRYPT_MODE, skeySpec, iv);
  39 + byte[] encrypted1 = Base64.decodeBase64(strIn);
  40 + byte[] original = cipher.doFinal(encrypted1);
  41 + String originalString = new String(original);
  42 + return originalString;
  43 + }
  44 +
  45 + private static SecretKeySpec getKey(String strKey) throws Exception {
  46 + byte[] arrBTmp = strKey.getBytes();
  47 + byte[] arrB = new byte[16];
  48 + for (int i = 0; i < arrBTmp.length && i < arrB.length; i++) {
  49 + arrB[i] = arrBTmp[i];
  50 + }
  51 + SecretKeySpec skeySpec = new SecretKeySpec(arrB, "AES");
  52 + return skeySpec;
  53 + }
  54 +
  55 + public static void main(String[] args) throws Exception {
  56 + String key = "123456789ABCDEFG";
  57 + String content = "{\"aaa\":1,\"bbb\":\"dd\",\"ccc\":\"subing\",\"dddd\":23123}";
  58 +
  59 + String jiamijieguo = AESPlus.encrypt(key,content);
  60 + System.out.println("jiemi:"+jiamijieguo);
  61 + String jiemijieguo = AESPlus.decrypt(key,jiamijieguo);
  62 + System.out.println("jiemi:"+jiemijieguo);
  63 + }
  64 +}
0 65 \ No newline at end of file
... ...
src/main/java/com/zteits/irain/portal/common/HttpClientTutorial.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/common/HttpClientTutorial.java
  1 +package com.zteits.irain.portal.common;
  2 +
  3 +import java.io.IOException;
  4 +import java.io.UnsupportedEncodingException;
  5 +import java.net.URISyntaxException;
  6 +import java.util.ArrayList;
  7 +import java.util.Map;
  8 +
  9 +import org.apache.http.HttpEntity;
  10 +import org.apache.http.NameValuePair;
  11 +import org.apache.http.client.ClientProtocolException;
  12 +import org.apache.http.client.entity.UrlEncodedFormEntity;
  13 +import org.apache.http.client.methods.CloseableHttpResponse;
  14 +import org.apache.http.client.methods.HttpGet;
  15 +import org.apache.http.client.methods.HttpPost;
  16 +import org.apache.http.client.methods.HttpRequestBase;
  17 +import org.apache.http.client.utils.URIBuilder;
  18 +import org.apache.http.entity.StringEntity;
  19 +import org.apache.http.impl.client.CloseableHttpClient;
  20 +import org.apache.http.impl.client.HttpClients;
  21 +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
  22 +import org.apache.http.message.BasicNameValuePair;
  23 +import org.apache.http.util.EntityUtils;
  24 +import org.springframework.util.CollectionUtils;
  25 +
  26 +import com.alibaba.fastjson.JSONObject;
  27 +
  28 +public class HttpClientTutorial {
  29 + private static PoolingHttpClientConnectionManager cm;
  30 + private static String EMPTY_STR = "";
  31 + private static String UTF_8 = "UTF-8";
  32 +
  33 + private static void init() {
  34 + if (cm == null) {
  35 + cm = new PoolingHttpClientConnectionManager();
  36 + cm.setMaxTotal(50);// 整个连接池最大连接数
  37 + cm.setDefaultMaxPerRoute(5);// 每路由最大连接数,默认值是2
  38 + }
  39 + }
  40 +
  41 + /**
  42 + * 通过连接池获取HttpClient
  43 + *
  44 + * @return
  45 + */
  46 + private static CloseableHttpClient getHttpClient() {
  47 + init();
  48 + return HttpClients.custom().setConnectionManager(cm).build();
  49 + }
  50 +
  51 + /**
  52 + *
  53 + * @param url
  54 + * @return
  55 + */
  56 + public static String httpGetRequest(String url) {
  57 + HttpGet httpGet = new HttpGet(url);
  58 + return getResult(httpGet);
  59 + }
  60 +
  61 + public static String httpGetRequest(String url, Map<String, Object> params) throws URISyntaxException {
  62 + URIBuilder ub = new URIBuilder();
  63 + ub.setPath(url);
  64 +
  65 + ArrayList<NameValuePair> pairs = covertParams2NVPS(params);
  66 + ub.setParameters(pairs);
  67 +
  68 + HttpGet httpGet = new HttpGet(ub.build());
  69 + return getResult(httpGet);
  70 + }
  71 +
  72 + public static String httpGetRequest(String url, Map<String, Object> headers, Map<String, Object> params)
  73 + throws URISyntaxException {
  74 + URIBuilder ub = new URIBuilder();
  75 + ub.setPath(url);
  76 +
  77 + ArrayList<NameValuePair> pairs = covertParams2NVPS(params);
  78 + ub.setParameters(pairs);
  79 +
  80 + HttpGet httpGet = new HttpGet(ub.build());
  81 + for (Map.Entry<String, Object> param : headers.entrySet()) {
  82 + httpGet.addHeader(param.getKey(), String.valueOf(param.getValue()));
  83 + }
  84 + return getResult(httpGet);
  85 + }
  86 +
  87 + public static String httpPostRequest(String url) {
  88 + HttpPost httpPost = new HttpPost(url);
  89 + return getResult(httpPost);
  90 + }
  91 +
  92 + public static String httpPostRequest(String url, Map<String, Object> params) throws UnsupportedEncodingException {
  93 + HttpPost httpPost = new HttpPost(url);
  94 + ArrayList<NameValuePair> pairs = covertParams2NVPS(params);
  95 + httpPost.setEntity(new UrlEncodedFormEntity(pairs, UTF_8));
  96 + return getResult(httpPost);
  97 + }
  98 +
  99 +
  100 + public static String httpPostRequest(String url, Map<String, Object> headers, String paramStr) throws UnsupportedEncodingException {
  101 + HttpPost httpPost = new HttpPost(url);
  102 +
  103 + if(!CollectionUtils.isEmpty(headers)){
  104 + for (Map.Entry<String, Object> param : headers.entrySet()) {
  105 + httpPost.addHeader(param.getKey(), String.valueOf(param.getValue()));
  106 + }
  107 + }
  108 + if (null != paramStr) {
  109 + //解决中文乱码问题
  110 + StringEntity entity = new StringEntity(paramStr, "utf-8");
  111 + entity.setContentEncoding("UTF-8");
  112 + entity.setContentType("application/json");
  113 + httpPost.setEntity(entity);
  114 + }
  115 + return getResult(httpPost);
  116 + }
  117 +
  118 +
  119 +
  120 + public static String httpPostRequest(String url, Map<String, Object> headers, JSONObject jsonParam) throws UnsupportedEncodingException {
  121 + return httpPostRequest(url,headers,jsonParam.toJSONString());
  122 + }
  123 +
  124 + public static String httpPostRequest(String url, JSONObject jsonParam) throws UnsupportedEncodingException {
  125 + return httpPostRequest(url,null,jsonParam);
  126 + }
  127 +
  128 + public static String httpPostRequest(String url, Map<String, Object> headers, Map<String, Object> params)
  129 + throws UnsupportedEncodingException {
  130 + HttpPost httpPost = new HttpPost(url);
  131 +
  132 + for (Map.Entry<String, Object> param : headers.entrySet()) {
  133 + httpPost.addHeader(param.getKey(), String.valueOf(param.getValue()));
  134 + }
  135 +
  136 + ArrayList<NameValuePair> pairs = covertParams2NVPS(params);
  137 + httpPost.setEntity(new UrlEncodedFormEntity(pairs, UTF_8));
  138 +
  139 + return getResult(httpPost);
  140 + }
  141 +
  142 + private static ArrayList<NameValuePair> covertParams2NVPS(Map<String, Object> params) {
  143 + ArrayList<NameValuePair> pairs = new ArrayList<NameValuePair>();
  144 + for (Map.Entry<String, Object> param : params.entrySet()) {
  145 + pairs.add(new BasicNameValuePair(param.getKey(), String.valueOf(param.getValue())));
  146 + }
  147 +
  148 + return pairs;
  149 + }
  150 +
  151 + /**
  152 + * 处理Http请求
  153 + *
  154 + * @param request
  155 + * @return
  156 + */
  157 + private static String getResult(HttpRequestBase request) {
  158 + // CloseableHttpClient httpClient = HttpClients.createDefault();
  159 + CloseableHttpClient httpClient = getHttpClient();
  160 + try {
  161 + CloseableHttpResponse response = httpClient.execute(request);
  162 + // response.getStatusLine().getStatusCode();
  163 + HttpEntity entity = response.getEntity();
  164 + if (entity != null) {
  165 + // long len = entity.getContentLength();// -1 表示长度未知
  166 + String result = EntityUtils.toString(entity);
  167 + response.close();
  168 + // httpClient.close();
  169 + return result;
  170 + }
  171 + } catch (ClientProtocolException e) {
  172 + e.printStackTrace();
  173 + } catch (IOException e) {
  174 + e.printStackTrace();
  175 + } finally {
  176 +
  177 + }
  178 +
  179 + return EMPTY_STR;
  180 + }
  181 +
  182 +}
... ...
src/main/java/com/zteits/irain/portal/config/FilterRegistrationConfig.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/config/FilterRegistrationConfig.java
  1 +package com.zteits.irain.portal.config;
  2 +
  3 +import com.zteits.irain.portal.config.filter.ResponseHeaderFilter;
  4 +import org.springframework.boot.web.servlet.FilterRegistrationBean;
  5 +import org.springframework.context.annotation.Bean;
  6 +import org.springframework.context.annotation.Configuration;
  7 +
  8 +@Configuration
  9 +public class FilterRegistrationConfig {
  10 + /**
  11 + * 添加响应请求头Filter
  12 + * @return
  13 + * 2017年5月8日 zhaowg
  14 + */
  15 + @Bean
  16 + public FilterRegistrationBean ResponseHeaderFilterRegistration() {
  17 + FilterRegistrationBean registration = new FilterRegistrationBean(new ResponseHeaderFilter());
  18 + registration.addServletRegistrationBeans();
  19 + registration.addUrlPatterns("/*");
  20 + return registration;
  21 + }
  22 +}
... ...
src/main/java/com/zteits/irain/portal/config/RedisMsgListenerContainer.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/config/RedisMsgListenerContainer.java
  1 +package com.zteits.irain.portal.config;
  2 +
  3 +import org.springframework.context.annotation.Bean;
  4 +import org.springframework.context.annotation.Configuration;
  5 +import org.springframework.data.redis.connection.RedisConnectionFactory;
  6 +import org.springframework.data.redis.listener.PatternTopic;
  7 +import org.springframework.data.redis.listener.RedisMessageListenerContainer;
  8 +
  9 +import com.clouds.common.constants.RedisKeyEnum;
  10 +import com.zteits.irain.portal.config.listener.FreeBrethsListener;
  11 +
  12 +/**
  13 + * redis 消息队列监听容器
  14 + *
  15 + * Copyright: Copyright (c) 2017 zteits
  16 + *
  17 + * @ClassName: RedisMessageListenerContainer.java
  18 + * @Description:
  19 + * @version: v1.0.0
  20 + * @author: zhaowg
  21 + * @date: 2017年6月7日 下午3:06:30
  22 + * Modification History:
  23 + * Date Author Version Description
  24 + *---------------------------------------------------------*
  25 + * 2017年6月7日 zhaowg v1.0.0 创建
  26 + */
  27 +@Configuration
  28 +public class RedisMsgListenerContainer {
  29 +
  30 + /**
  31 + * 空闲车位监听容器
  32 + * @param connectionFactory
  33 + * @param brethsListener
  34 + * @return
  35 + * 2017年6月7日 zhaowg
  36 + */
  37 + @Bean
  38 + RedisMessageListenerContainer freeBrethscontainer(RedisConnectionFactory connectionFactory,FreeBrethsListener brethsListener) {
  39 + RedisMessageListenerContainer container = new RedisMessageListenerContainer();
  40 + container.setConnectionFactory(connectionFactory);
  41 + container.addMessageListener(brethsListener, new PatternTopic(RedisKeyEnum.PARK_FREEBERTH_PLNO_FREEBERTH_TOPIC.key()));
  42 + return container;
  43 + }
  44 +}
... ...
src/main/java/com/zteits/irain/portal/config/WebSecurityConfig.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/config/WebSecurityConfig.java
  1 +package com.zteits.irain.portal.config;
  2 +
  3 +import org.springframework.context.annotation.Configuration;
  4 +import org.springframework.security.config.annotation.web.builders.HttpSecurity;
  5 +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
  6 +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
  7 +/**
  8 + *
  9 + * Copyright: Copyright (c) 2017 ZTE-ITS
  10 + *
  11 + * @ClassName: WebSecurityConfig.java
  12 + * @Description: srping boot 安全控制
  13 + * @version: v1.0.0
  14 + * @author: wangbiao
  15 + * @date: 2017年4月20日 下午4:22:27
  16 + * Modification History:
  17 + * Date Author Version Description
  18 + *---------------------------------------------------------*
  19 + * 2017年4月20日 wangbiao v1.0.0 创建
  20 + */
  21 +@Configuration
  22 +@EnableWebSecurity
  23 +public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
  24 + @Override
  25 + protected void configure(HttpSecurity http) throws Exception {
  26 + http.headers()
  27 + .frameOptions().sameOrigin()
  28 + .httpStrictTransportSecurity().disable();
  29 + http.csrf().disable();
  30 + }
  31 +}
... ...
src/main/java/com/zteits/irain/portal/config/WebSocketConfig.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/config/WebSocketConfig.java
  1 +package com.zteits.irain.portal.config;
  2 +
  3 +import org.springframework.context.annotation.Configuration;
  4 +import org.springframework.messaging.simp.config.MessageBrokerRegistry;
  5 +import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer;
  6 +import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
  7 +import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
  8 +
  9 +@Configuration
  10 +@EnableWebSocketMessageBroker
  11 +public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {
  12 + /**
  13 + * 配置了一个简单的消息代理,如果不重载,默认情况下回自动配置一个简单的内存消息代理,用来处理以"/topic"为前缀的消息。这里重载configureMessageBroker()方法,
  14 + * 消息代理将会处理前缀为"/topic"和"/queue"的消息。
  15 + * @param registry
  16 + */
  17 + @Override
  18 + public void configureMessageBroker(MessageBrokerRegistry config) {
  19 + //这句话表示在topic和queue这两个域上可以向客户端发消息。
  20 + config.enableSimpleBroker("/queue","/topic");
  21 + //这句话表示给指定用户发送一对一的主题前缀是"/user"。
  22 + config.setUserDestinationPrefix("/user");
  23 + //这句话表示客户单向服务器端发送时的主题上面需要加"/park"作为前缀
  24 + config.setApplicationDestinationPrefixes("/park");
  25 + }
  26 + /**
  27 + * 将"/park-websocket"路径注册为STOMP端点,这个路径与发送和接收消息的目的路径有所不同,这是一个端点,客户端在订阅或发布消息到目的地址前,要连接该端点,
  28 + * 即用户发送请求url="/applicationName/park-websocket"与STOMP server进行连接。之后再转发到订阅url;
  29 + * PS:端点的作用——客户端在订阅或发布消息到目的地址前,要连接该端点。
  30 + * @param stompEndpointRegistry
  31 + */
  32 + @Override
  33 + public void registerStompEndpoints(StompEndpointRegistry registry) {
  34 + //这个和客户端创建连接时的url有关,其中setAllowedOrigins()方法表示允许连接的域名,withSockJS()方法表示支持以SockJS方式连接服务器。
  35 + registry.addEndpoint("/park-websocket").setAllowedOrigins("*").withSockJS();
  36 + }
  37 +
  38 +}
0 39 \ No newline at end of file
... ...
src/main/java/com/zteits/irain/portal/config/filter/ResponseHeaderFilter.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/config/filter/ResponseHeaderFilter.java
  1 +package com.zteits.irain.portal.config.filter;
  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.HttpServletResponse;
  12 +
  13 +/**
  14 + * 添加响应统一请求头
  15 + *
  16 + * Copyright: Copyright (c) 2017 zteits
  17 + *
  18 + * @ClassName: ResponseHeaderFilter.java
  19 + * @Description:
  20 + * @version: v1.0.0
  21 + * @author: zhaowg
  22 + * @date: 2017年5月8日 下午3:17:18
  23 + * Modification History:
  24 + * Date Author Version Description
  25 + *---------------------------------------------------------*
  26 + * 2017年5月8日 zhaowg v1.0.0 创建
  27 + */
  28 +public class ResponseHeaderFilter implements Filter{
  29 +
  30 + @Override
  31 + public void doFilter(ServletRequest request, ServletResponse response,
  32 + FilterChain chain) throws IOException, ServletException {
  33 + HttpServletResponse res = (HttpServletResponse) response;
  34 + res.addHeader("Access-Control-Allow-Origin", "*");
  35 + res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
  36 + res.addHeader("Access-Control-Allow-Headers", "Content-Type, X-Auth-Token, x-requested-with ,Authorization");
  37 + chain.doFilter(request, response);
  38 + }
  39 +
  40 + @Override
  41 + public void destroy() {
  42 + }
  43 +
  44 + @Override
  45 + public void init(FilterConfig filterConfig) throws ServletException {
  46 + }
  47 +}
... ...
src/main/java/com/zteits/irain/portal/config/listener/FreeBrethsListener.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/config/listener/FreeBrethsListener.java
  1 +package com.zteits.irain.portal.config.listener;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.List;
  5 +import java.util.concurrent.CountDownLatch;
  6 +
  7 +import org.slf4j.Logger;
  8 +import org.slf4j.LoggerFactory;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.data.redis.connection.Message;
  11 +import org.springframework.data.redis.connection.MessageListener;
  12 +import org.springframework.data.redis.core.RedisTemplate;
  13 +import org.springframework.stereotype.Component;
  14 +
  15 +import com.alibaba.fastjson.JSON;
  16 +import com.alibaba.fastjson.JSONObject;
  17 +import com.clouds.common.web.vo.BizResultVO;
  18 +import com.zteits.clouds.api.dto.run.dto.ParkSpaceStateDTO;
  19 +import com.zteits.irain.portal.service.interfaces.induction.InductionService;
  20 +import com.zteits.irain.portal.service.interfaces.induction.param.DoLevelTwoAndThreeInductionReleaseBatchRequest;
  21 +import com.zteits.irain.portal.service.interfaces.induction.param.InductionRelease;
  22 +
  23 +/**
  24 + * 空闲车位监听器<br>
  25 + *
  26 + * Copyright: Copyright (c) 2017 zteits
  27 + *
  28 + * @ClassName: FreeBrethsListener.java
  29 + * @Description:
  30 + * @version: v1.0.0
  31 + * @author: zhaowg
  32 + * @date: 2017年6月7日 下午2:41:39
  33 + * Modification History:
  34 + * Date Author Version Description
  35 + *---------------------------------------------------------*
  36 + * 2017年6月7日 zhaowg v1.0.0 创建
  37 + */
  38 +@Component
  39 +public class FreeBrethsListener implements MessageListener{
  40 + private static final Logger logger = LoggerFactory.getLogger(FreeBrethsListener.class);
  41 + @Autowired
  42 + private InductionService inductionService;
  43 + @Autowired
  44 + private RedisTemplate<String,Object> redisTemplate;
  45 + @Override
  46 + public void onMessage(Message message, byte[] pattern) {
  47 + logger.info("空闲车位消息队列,接收到的数据为:"+new String(message.getBody()));
  48 + JSONObject jsonObject = (JSONObject)redisTemplate.getValueSerializer().deserialize(message.getBody());
  49 + //空闲车位数
  50 + Integer freeBerths = jsonObject.getInteger("freeBerths");
  51 + //停车场编号
  52 + String plNo = jsonObject.getString("plNo");
  53 +
  54 + DoLevelTwoAndThreeInductionReleaseBatchRequest releaseBatchRequest = new DoLevelTwoAndThreeInductionReleaseBatchRequest();
  55 + List<InductionRelease> list = new ArrayList<>();
  56 + //传固定值
  57 + InductionRelease inductionRelease = new InductionRelease();
  58 + inductionRelease.setOwner_code("1001");
  59 + inductionRelease.setRange_code(plNo);
  60 + inductionRelease.setBerth_left(String.valueOf(freeBerths));
  61 + inductionRelease.setParking_code(plNo);
  62 + list.add(inductionRelease);
  63 + releaseBatchRequest.setJsonStr(list);
  64 + //开始调用二级诱导批量发布接口
  65 + inductionService.doLevelTwoAndThreeInductionReleaseBatch(releaseBatchRequest);
  66 + }
  67 +}
... ...
src/main/java/com/zteits/irain/portal/config/session/HttpSessionConfig.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/config/session/HttpSessionConfig.java
  1 +package com.zteits.irain.portal.config.session;
  2 +
  3 +import org.springframework.context.annotation.Bean;
  4 +import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
  5 +import org.springframework.session.web.http.HeaderHttpSessionStrategy;
  6 +import org.springframework.session.web.http.HttpSessionStrategy;
  7 +
  8 +/**
  9 + * Copyright: Copyright (c) 2017 zteits
  10 + *
  11 + * @ClassName: com.zteits.oauth.portal.config.session
  12 + * @Description:
  13 + * @version: v1.0.0
  14 + * @author: atao
  15 + * @date: 2017/5/16 下午9:23
  16 + * Modification History:
  17 + * Date Author Version Description
  18 + * ---------------------------------------------------------*
  19 + * 2017/5/16 atao v1.0.0 创建
  20 + */
  21 +//maxInactiveIntervalInSeconds
  22 +@EnableRedisHttpSession
  23 +public class HttpSessionConfig {
  24 +
  25 + @Bean
  26 + public HttpSessionStrategy httpSessionStrategy() {
  27 + return new HeaderHttpSessionStrategy();
  28 + }
  29 +
  30 +}
... ...
src/main/java/com/zteits/irain/portal/constant/IRainResultEnum.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/constant/IRainResultEnum.java
  1 +package com.zteits.irain.portal.constant;
  2 +
  3 +import com.zteits.clouds.api.apibase.bean.ErrorCode;
  4 +
  5 +/**
  6 + *
  7 + * Copyright: Copyright (c) 2017 ZTE-ITS
  8 + *
  9 + * @ClassName: IRainResultEnum.java
  10 + * @Description:
  11 + * @version: v1.0.0
  12 + * @author: wangbiao
  13 + * @date: 2017年4月20日 下午2:30:53
  14 + * Modification History:
  15 + * Date Author Version Description
  16 + *---------------------------------------------------------*
  17 + * 2017年4月20日 wangbiao v1.0.0 创建
  18 + */
  19 +public enum IRainResultEnum implements ErrorCode{
  20 + /**接口调用成功*/
  21 + SUCCESS("ok", "success");
  22 +
  23 + private String code;
  24 + private String msg;
  25 +
  26 + private IRainResultEnum(String code, String name) {
  27 + this.code = code;
  28 + this.msg = name;
  29 + }
  30 + @Override
  31 + public String getCode() {
  32 + return code;
  33 + }
  34 +
  35 + @Override
  36 + public String getMsg() {
  37 + return msg;
  38 + }
  39 +}
... ...
src/main/java/com/zteits/irain/portal/constant/ParkConstant.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/constant/ParkConstant.java
  1 +package com.zteits.irain.portal.constant;
  2 +
  3 +import java.util.HashMap;
  4 +import java.util.Map;
  5 +
  6 +public class ParkConstant {
  7 + /**接口表相关常量*/
  8 + public static class InterfaceLog{
  9 +
  10 + public static class Type{
  11 + /**进场*/
  12 + public static final int TYPE_IN_PARKING = 1;
  13 + /**出场*/
  14 + public static final int TYPE_OUT_PARKING = 2;
  15 + }
  16 +
  17 + public static class Status{
  18 + /**成功*/
  19 + public static final Byte SUCCESS = 1;
  20 + /**失败*/
  21 + public static final Byte FAIL = 0;
  22 + }
  23 +
  24 + public static class FromType{
  25 + /**艾润*/
  26 + public static final int IRAIN = 1;
  27 + /**青岛*/
  28 + public static final int QINGDAO = 2;
  29 + /**捷商*/
  30 + public static final int JIESHANG =3;
  31 + }
  32 +
  33 + public static class SourceType{
  34 + /**道闸*/
  35 + public static final int GATEWAY = 1;
  36 + /**地磁*/
  37 + public static final int GEO = 2;
  38 + }
  39 + }
  40 +
  41 + /**停车场经纬度表相关常量*/
  42 + public static class ParkingLotGeo{
  43 +
  44 + public static class GeoType{
  45 + /**停车场坐标*/
  46 + public static final int TYPE_PARKINGLOT = 1;
  47 + /**停车场入口坐标*/
  48 + public static final int TYPE_PARKINGLOT_IN = 2;
  49 + }
  50 +
  51 + }
  52 + public static class ParkingLotUseStatistic{
  53 + //统计类型:1:每20分钟;2:每1小时;3:每天
  54 + public static class StatisticType{
  55 + public static final int PER20MINUTE = 1;
  56 + public static final int PER1HOUR = 2;
  57 + public static final int PER1DAY = 3;
  58 + }
  59 + //比率:1:空置率,2:周转率
  60 + public static class BerthRatioType{
  61 + public static final int FREE = 1;
  62 + public static final int TURNOVER = 2;
  63 + }
  64 + }
  65 + /**青岛进出场上报相关常量*/
  66 + public static class QDInOutParkLot{
  67 + public static class InOutType{
  68 + /**进场*/
  69 + public static final String INPARKLOT ="1";
  70 + /**出场-正常*/
  71 + public static final String OUTPARKLOT_NOMAL = "2";
  72 + /**出场-逃逸*/
  73 + public static final String OUTPARKLOT_ESCAPE = "3";
  74 + }
  75 + }
  76 + /**停车场设备表相关常量*/
  77 + public static class ParkingLotEqp{
  78 +
  79 + public static class EqpType{
  80 + /**地磁*/
  81 + public static final int GEO = 1;
  82 + /**pos机*/
  83 + public static final int POS = 2;
  84 + }
  85 +
  86 + }
  87 + /**空闲车位表相关常量*/
  88 + public static class ParkFreeBerths{
  89 + /**更新空闲车位方式*/
  90 + public static class UpdateMethod{
  91 + /**自己根据进出场计算*/
  92 + public static final String AUTOCALC = "AUTOCALC";
  93 + /**根据上报的空闲车位直接覆盖*/
  94 + public static final String COVER = "COVER";
  95 + }
  96 + }
  97 + /**城市ID*/
  98 + public static class CityId{
  99 + /**赤峰*/
  100 + public static final Long CHIFENG = 91L;
  101 + }
  102 +}
... ...
src/main/java/com/zteits/irain/portal/service/impl/induction/InductionServiceImpl.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/service/impl/induction/InductionServiceImpl.java
  1 +package com.zteits.irain.portal.service.impl.induction;
  2 +
  3 +import java.util.HashMap;
  4 +import java.util.Map;
  5 +
  6 +import org.slf4j.Logger;
  7 +import org.slf4j.LoggerFactory;
  8 +import org.springframework.beans.factory.annotation.Value;
  9 +import org.springframework.stereotype.Component;
  10 +
  11 +import com.alibaba.fastjson.JSONObject;
  12 +import com.clouds.common.web.vo.BizResultVO;
  13 +import com.zteits.clouds.api.apibase.constants.ErrorType;
  14 +import com.zteits.irain.portal.common.HttpClientTutorial;
  15 +import com.zteits.irain.portal.service.interfaces.induction.InductionService;
  16 +import com.zteits.irain.portal.service.interfaces.induction.param.DoLevelTwoAndThreeInductionReleaseBatchRequest;
  17 +import com.zteits.irain.portal.service.interfaces.induction.param.InductionLevelOneShow;
  18 +import com.zteits.irain.portal.service.interfaces.induction.param.InductionResponse;
  19 +
  20 +/**
  21 + * 对接智慧停车诱导服务管理系统
  22 + *
  23 + * Copyright: Copyright (c) 2017 zteits
  24 + *
  25 + * @ClassName: InductionService.java
  26 + * @Description:
  27 + * @version: v1.0.0
  28 + * @author: zhaowg
  29 + * @date: 2017年5月24日 上午9:28:48
  30 + * Modification History:
  31 + * Date Author Version Description
  32 + *---------------------------------------------------------*
  33 + * 2017年5月24日 zhaowg v1.0.0 创建
  34 + */
  35 +@Component
  36 +public class InductionServiceImpl implements InductionService{
  37 +
  38 + private static final Logger logger = LoggerFactory.getLogger(InductionServiceImpl.class);
  39 +
  40 + /**一级诱导回显地址*/
  41 + @Value("${induction.showLevelOneInductionReleaseUrl}")
  42 + private String showLevelOneInductionReleaseUrl;
  43 +
  44 + /**二级三级诱导批量发布地址*/
  45 + @Value("${induction.doLevelTwoAndThreeInductionReleaseBatchUrl}")
  46 + private String doLevelTwoAndThreeInductionReleaseBatchUrl;
  47 +
  48 + @Override
  49 + public BizResultVO<?> doLevelTwoAndThreeInductionReleaseBatch(DoLevelTwoAndThreeInductionReleaseBatchRequest request) {
  50 + logger.info("开始调用二级、三级诱导批量发布接口");
  51 + BizResultVO<?> result = new BizResultVO<>();
  52 + try {
  53 + Map<String, Object> params = new HashMap<>();
  54 + params.put("owner_code", request.getOwner_code());
  55 + params.put("pwd", request.getPwd());
  56 + params.put("jsonStr", JSONObject.toJSONString(request.getJsonStr()));
  57 + logger.info("二级、三级诱导批量发布接口地址:"+doLevelTwoAndThreeInductionReleaseBatchUrl);
  58 + logger.info("二级、三级诱导批量发布接口请求参数:" + JSONObject.toJSONString(params));
  59 + String rs = HttpClientTutorial.httpPostRequest(doLevelTwoAndThreeInductionReleaseBatchUrl, params);
  60 + logger.info("二级、三级诱导批量发布接口响应参数:" + rs);
  61 + InductionResponse inductionResponse = JSONObject.parseObject(rs, InductionResponse.class);
  62 + String code = inductionResponse.getSys_code();
  63 + if("100".equals(code)){
  64 + result.setCode(ErrorType.BIZ_SUCCESS.getCode());
  65 + result.setMsg(ErrorType.BIZ_SUCCESS.getMsg());
  66 + }else{
  67 + result.setCode(code);
  68 + result.setMsg(inductionResponse.getSys_msg());
  69 + }
  70 +
  71 + } catch (Exception e) {
  72 + logger.error("调用二级、三级诱导批量发布接口报错:",e);
  73 + result.setCode(ErrorType.BIZ_ERROR.getCode());
  74 + result.setMsg(ErrorType.BIZ_ERROR.getMsg());
  75 + }
  76 + logger.info("调用二级、三级诱导批量发布接口成功,返回封装后的数据:"+JSONObject.toJSONString(result));
  77 + return result;
  78 + }
  79 +
  80 + @Override
  81 + public BizResultVO<InductionLevelOneShow> showLevelOneInductionRelease(String eqpCode) {
  82 + logger.info("开始调用一级诱导发布回显接口");
  83 + BizResultVO<InductionLevelOneShow> result = new BizResultVO<>();
  84 + try {
  85 + Map<String, Object> params = new HashMap<>();
  86 + //TODO accessToken获取
  87 + params.put("accessToken", "ffa51bdd90e86577812dddff0829941ca9");
  88 + params.put("eqpCode", eqpCode);
  89 + logger.info("一级诱导发布回显接口地址:"+showLevelOneInductionReleaseUrl);
  90 + logger.info("一级诱导发布回显接口请求参数:" + JSONObject.toJSONString(params));
  91 + String rs = HttpClientTutorial.httpPostRequest(showLevelOneInductionReleaseUrl, params);
  92 + logger.info("一级诱导发布回显接口响应参数:" + rs);
  93 + InductionResponse inductionResponse = JSONObject.parseObject(rs, InductionResponse.class);
  94 +
  95 + String code = inductionResponse.getSys_code();
  96 + if("100".equals(code)){
  97 + result.setCode(ErrorType.BIZ_SUCCESS.getCode());
  98 + result.setMsg(ErrorType.BIZ_SUCCESS.getMsg());
  99 + //获取数据
  100 + String dataStr = JSONObject.toJSONString(inductionResponse.getData());
  101 + InductionLevelOneShow inductionLevelOneShow = JSONObject.parseObject(dataStr, InductionLevelOneShow.class);
  102 + result.setData(inductionLevelOneShow);
  103 + }else{
  104 + result.setCode(code);
  105 + result.setMsg(inductionResponse.getSys_msg());
  106 + }
  107 +
  108 + } catch (Exception e) {
  109 + logger.error("调用一级诱导发布回显接口报错:",e);
  110 + result.setCode(ErrorType.BIZ_ERROR.getCode());
  111 + result.setMsg(ErrorType.BIZ_ERROR.getMsg());
  112 + }
  113 + logger.info("调用一级诱导发布回显接口成功,返回封装后的数据:"+JSONObject.toJSONString(result));
  114 + return result;
  115 + }
  116 +}
... ...
src/main/java/com/zteits/irain/portal/service/impl/inoutparklot/InOutParkLotReportServiceImpl.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/service/impl/inoutparklot/InOutParkLotReportServiceImpl.java
  1 +package com.zteits.irain.portal.service.impl.inoutparklot;
  2 +
  3 +import org.slf4j.Logger;
  4 +import org.slf4j.LoggerFactory;
  5 +import org.springframework.beans.factory.annotation.Autowired;
  6 +import org.springframework.beans.factory.annotation.Value;
  7 +import org.springframework.stereotype.Component;
  8 +
  9 +import com.alibaba.fastjson.JSON;
  10 +import com.clouds.common.cache.park.ParkingLotCacheUtil;
  11 +import com.clouds.common.utils.BeanValidatorsUtils;
  12 +import com.clouds.common.utils.ResultUtils;
  13 +import com.zteits.clouds.api.apibase.bean.BaseInfo;
  14 +import com.zteits.clouds.api.apibase.bean.BizResult;
  15 +import com.zteits.clouds.api.apibase.exception.BizException;
  16 +import com.zteits.clouds.api.dto.park.dto.ParkingLotDTO;
  17 +import com.zteits.clouds.api.dto.park.param.InParkingRequest;
  18 +import com.zteits.clouds.api.dto.park.param.OutParkingRequest;
  19 +import com.zteits.clouds.api.dto.park.param.QueryParkLotInfoByPkOutNoRequest;
  20 +import com.zteits.clouds.api.dto.park.param.UpdateParkingPlaceStatusRequest;
  21 +import com.zteits.clouds.api.service.park.IInOutParkingService;
  22 +import com.zteits.clouds.api.service.park.ParkingLotBerthsService;
  23 +import com.zteits.clouds.api.service.park.ParkingLotQueryService;
  24 +import com.zteits.clouds.api.service.pay.ParkOrderService;
  25 +import com.zteits.irain.portal.constant.ParkConstant;
  26 +import com.zteits.irain.portal.constant.ParkConstant.InterfaceLog;
  27 +import com.zteits.irain.portal.service.interfaces.inoutparklot.InOutParkLotReportService;
  28 +import com.zteits.irain.portal.service.interfaces.inoutparklot.param.RecordInParkLotRequest;
  29 +import com.zteits.irain.portal.service.interfaces.inoutparklot.param.RecordOutParkLotRequest;
  30 +import com.zteits.irain.portal.service.interfaces.parklotidleberths.ParkLotIdleBerthsService;
  31 +
  32 +@Component
  33 +public class InOutParkLotReportServiceImpl implements InOutParkLotReportService {
  34 +
  35 + private static final Logger logger = LoggerFactory.getLogger(InOutParkLotReportServiceImpl.class);
  36 + @Value("${project.syscode}")
  37 + private String sysCode;
  38 + /**进出场记录*/
  39 + @Autowired
  40 + private IInOutParkingService iInOutParkingService;
  41 + /**停车场订单service*/
  42 + @Autowired
  43 + private ParkOrderService parkOrderService;
  44 + /**空闲车位*/
  45 + @Autowired
  46 + private ParkLotIdleBerthsService lotIdleBerthsService;
  47 + @Autowired
  48 + private ParkingLotQueryService parkingLotQueryService;
  49 +
  50 + /**
  51 + * 车位操作服务
  52 + */
  53 + @Autowired
  54 + private ParkingLotBerthsService parkinglotBerthsService;
  55 +
  56 + @Override
  57 + public Long InParkLotRecord(RecordInParkLotRequest request) throws Exception {
  58 + BeanValidatorsUtils.validateWithException(request);
  59 + BaseInfo baseInfo = new BaseInfo();
  60 +
  61 + InParkingRequest InParkingRequest = request.getInParkLotReq();
  62 + InParkingRequest.setBaseRequest(baseInfo);
  63 + InParkingRequest.setSysCode(request.getSysCode());
  64 + InParkingRequest.setFromType(request.getFromType());
  65 + InParkingRequest.setSourceType(request.getSourceType());
  66 + //设置停车场编号和名称
  67 + ParkingLotDTO parkingLotDTO = this.getOurParkLotInfoByOutNo(request.getInParkLotReq().getParkCode());
  68 + InParkingRequest.setPlNo(parkingLotDTO.getPlNo());
  69 + InParkingRequest.setPlName(parkingLotDTO.getPlName());
  70 + logger.info("更新空闲车位");
  71 + int totalFreeBerths = lotIdleBerthsService.updateAndGetIdleBerthByParkNo(InParkingRequest.getInTime(),InParkingRequest.getPlNo(), ParkConstant.InterfaceLog.Type.TYPE_IN_PARKING,
  72 + InParkingRequest.getFromType(), InParkingRequest.getFreeBerths());
  73 + //设置总空闲车位数
  74 + InParkingRequest.setFreeBerths(totalFreeBerths);
  75 +
  76 + logger.info("记录进场日志请求参数:"+JSON.toJSON(InParkingRequest));
  77 + BizResult<Long> bizResult = iInOutParkingService.SaveIRainInParking(InParkingRequest);
  78 +
  79 + logger.info("插入停车订单--begin----");
  80 + BizResult<String> orderResult = parkOrderService.insertParkingOrder(InParkingRequest);
  81 + logger.info("插入停车订单--end----结果=[errorMsg={},orderId={}]",orderResult.getErrMsg(),orderResult.getData());
  82 + // 数据来源青岛,则更新进场车位状态
  83 + if (InterfaceLog.FromType.QINGDAO == request.getFromType()) {
  84 + updateBerthsStatus(baseInfo, InParkingRequest.getParkCode(),InParkingRequest.getParkingPlaceCode(),InParkingRequest.getParkingPlaceStatus());
  85 + try {
  86 + //特殊停车场的车位更新以及空闲车位数量更新
  87 + this.updateBerthsNum(baseInfo, InParkingRequest.getParkCode(), InParkingRequest.getParkingPlaceCode(), InParkingRequest.getParkingPlaceStatus());
  88 + } catch (Exception e) {
  89 + logger.error("特殊停车场的车位更新以及空闲车位数量更新异常!",e);
  90 + }
  91 + }
  92 +
  93 + if(!orderResult.isSuccess()){
  94 + throw new BizException(orderResult.getErrCode(), orderResult.getErrMsg());
  95 + }
  96 +
  97 + if(!bizResult.isSuccess()){
  98 + throw new BizException(bizResult.getErrCode(), bizResult.getErrMsg());
  99 + }
  100 + return bizResult.getData();
  101 + }
  102 + /**
  103 + * 更新空闲车位
  104 + * @param baseInfo
  105 + * @param foreignParkinglotNo
  106 + * @param foreignParkingPlaceNo
  107 + * @param parkingPlaceStatus
  108 + */
  109 + private void updateBerthsStatus(BaseInfo baseInfo, String foreignParkinglotNo,String foreignParkingPlaceNo,Integer parkingPlaceStatus) {
  110 + logger.info("数据来源青岛,则更新出场车位状态");
  111 + UpdateParkingPlaceStatusRequest updateRequest = new UpdateParkingPlaceStatusRequest();
  112 + updateRequest.setBaseRequest(baseInfo);
  113 + updateRequest.setSysCode(sysCode);
  114 + updateRequest.setForeignParkinglotNo(foreignParkinglotNo);
  115 + updateRequest.setForeignParkingPlaceNo(foreignParkingPlaceNo);
  116 + updateRequest.setParkingPlaceStatus(parkingPlaceStatus);
  117 +
  118 + BizResult<Boolean> updateResult = parkinglotBerthsService.UpdateParkingPlaceStatus(updateRequest);
  119 +
  120 + if (!updateResult.isSuccess()) {
  121 + throw new BizException(updateResult.getErrCode(), updateResult.getErrMsg());
  122 + }
  123 + }
  124 +
  125 + @Override
  126 + public Long OutParkLotRecord(RecordOutParkLotRequest request) throws Exception{
  127 + BeanValidatorsUtils.validateWithException(request);
  128 + BaseInfo baseInfo = new BaseInfo();
  129 +
  130 + OutParkingRequest OutParkingRequest = request.getOutParkLotReq();
  131 + OutParkingRequest.setBaseRequest(baseInfo);
  132 + OutParkingRequest.setSysCode(request.getSysCode());
  133 + OutParkingRequest.setFromType(request.getFromType());
  134 + OutParkingRequest.setSourceType(request.getSourceType());
  135 + //根据外部停车场编号获取自己的停车场编号和名称
  136 + ParkingLotDTO parkingLotDTO = this.getOurParkLotInfoByOutNo(request.getOutParkLotReq().getParkCode());
  137 + OutParkingRequest.setPlNo(parkingLotDTO.getPlNo());
  138 + OutParkingRequest.setPlName(parkingLotDTO.getPlName());
  139 +
  140 + logger.info("更新空闲车位");
  141 + int totalFreeBerths = lotIdleBerthsService.updateAndGetIdleBerthByParkNo(OutParkingRequest.getOutTime(),OutParkingRequest.getPlNo(), ParkConstant.InterfaceLog.Type.TYPE_OUT_PARKING,
  142 + request.getFromType(), OutParkingRequest.getFreeBerths());
  143 + //设置总空闲车位数
  144 + OutParkingRequest.setFreeBerths(totalFreeBerths);
  145 +
  146 + logger.info("记录出车日志请求参数:"+JSON.toJSONString(OutParkingRequest));
  147 + BizResult<Long> bizResult = iInOutParkingService.SaveIRainOutParking(OutParkingRequest);
  148 + logger.info("记录出车日志响应信息:"+JSON.toJSONString(bizResult));
  149 +
  150 + logger.info("出车上报更新停车订单.");
  151 + BizResult<String> orderResult = parkOrderService.updateParkingOrder(OutParkingRequest);
  152 + logger.info("出车上报更新订单响应信息:"+JSON.toJSONString(orderResult));
  153 +
  154 + // 数据来源青岛,则更新出场车位状态
  155 + if (InterfaceLog.FromType.QINGDAO == request.getFromType()) {
  156 + logger.info("数据来源青岛,则更新出场车位状态");
  157 + this.updateBerthsStatus(baseInfo, OutParkingRequest.getParkCode(), OutParkingRequest.getParkingPlaceCode(), OutParkingRequest.getParkingPlaceStatus());
  158 + try {
  159 + //特殊停车场的车位更新以及空闲车位数量更新
  160 + //20170714 zhaowg 目前没有特殊停车场,不考虑
  161 + //this.updateBerthsNum(baseInfo, OutParkingRequest.getParkCode(), OutParkingRequest.getParkingPlaceCode(), OutParkingRequest.getParkingPlaceStatus());
  162 + } catch (Exception e) {
  163 + logger.error("特殊停车场的车位更新以及空闲车位数量更新异常!",e);
  164 + }
  165 + }
  166 +
  167 +
  168 + if(!orderResult.isSuccess()){
  169 + throw new BizException(bizResult.getErrCode(), bizResult.getErrMsg());
  170 + }
  171 + if(!bizResult.isSuccess()){
  172 + throw new BizException(bizResult.getErrCode(), bizResult.getErrMsg());
  173 + }
  174 +
  175 + return bizResult.getData();
  176 + }
  177 +
  178 + /**
  179 + * 根据上报的停车场查询对应的我们自己的停车场信息
  180 + * @param parkCode
  181 + * @return
  182 + * 2017年6月7日 zhaowg
  183 + */
  184 + private ParkingLotDTO getOurParkLotInfoByOutNo(String parkCode) {
  185 + logger.info("根据上报的停车场编号["+parkCode+"]查询对应的我们自己的停车场编号");
  186 + //先查询缓存
  187 + ParkingLotDTO parkingLotDTO = ParkingLotCacheUtil.getParkLotByPlOutNo(parkCode);
  188 + if(parkingLotDTO != null){
  189 + return parkingLotDTO;
  190 + }
  191 + //查询数据库
  192 + logger.info("根据上报的停车场编号["+parkCode+"]在缓存总没有查询到对应的停车场信息,开始查询数据库");
  193 + QueryParkLotInfoByPkOutNoRequest request = new QueryParkLotInfoByPkOutNoRequest();
  194 + request.setSysCode(sysCode);
  195 + request.setPklOutNo(parkCode);
  196 + BizResult<ParkingLotDTO> bizResult = parkingLotQueryService.QueryParkingLotByPkOutNo(request );
  197 + parkingLotDTO = ResultUtils.getBizResultData(bizResult);
  198 + return parkingLotDTO;
  199 + }
  200 +
  201 + /**
  202 + * 更新park_free_berth表中空闲车位个数(特殊)
  203 + * @param baseInfo
  204 + * @param foreignParkinglotNo
  205 + * @param foreignParkingPlaceNo
  206 + * @param parkingPlaceStatus
  207 + */
  208 + private void updateBerthsNum(BaseInfo baseInfo, String foreignParkinglotNo,String foreignParkingPlaceNo,Integer parkingPlaceStatus) {
  209 + logger.info("数据来源青岛,则更新出场车位状态以及空闲停车位个数");
  210 + UpdateParkingPlaceStatusRequest updateRequest = new UpdateParkingPlaceStatusRequest();
  211 + updateRequest.setBaseRequest(baseInfo);
  212 + updateRequest.setSysCode(sysCode);
  213 + updateRequest.setForeignParkinglotNo(foreignParkinglotNo);
  214 + updateRequest.setForeignParkingPlaceNo(foreignParkingPlaceNo);
  215 + updateRequest.setParkingPlaceStatus(parkingPlaceStatus);
  216 +
  217 + BizResult<Boolean> updateResult = parkinglotBerthsService.updateFreeBerthNum(updateRequest);
  218 +
  219 + if (!updateResult.isSuccess()) {
  220 + throw new BizException(updateResult.getErrCode(), updateResult.getErrMsg());
  221 + }
  222 + }
  223 +}
... ...
src/main/java/com/zteits/irain/portal/service/impl/parklotidleberths/ParkLotIdleBerthsServiceImpl.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/service/impl/parklotidleberths/ParkLotIdleBerthsServiceImpl.java
  1 +package com.zteits.irain.portal.service.impl.parklotidleberths;
  2 +
  3 +import java.util.Date;
  4 +import java.util.HashMap;
  5 +import java.util.List;
  6 +import java.util.Map;
  7 +
  8 +import org.apache.commons.lang3.StringUtils;
  9 +import org.slf4j.Logger;
  10 +import org.slf4j.LoggerFactory;
  11 +import org.springframework.beans.factory.annotation.Autowired;
  12 +import org.springframework.beans.factory.annotation.Value;
  13 +import org.springframework.stereotype.Component;
  14 +
  15 +import com.alibaba.fastjson.JSONObject;
  16 +import com.clouds.common.cache.park.ParkFreeBerthsCacheUtil;
  17 +import com.clouds.common.cache.park.ParkingLotCacheUtil;
  18 +import com.clouds.common.cache.sys.SysCodeValueCacheUtil;
  19 +import com.clouds.common.constants.CodeValKindEnum;
  20 +import com.clouds.common.constants.RedisKeyEnum;
  21 +import com.clouds.common.redis.RedisCacheUtil;
  22 +import com.clouds.common.utils.ResultUtils;
  23 +import com.zteits.clouds.api.apibase.bean.BaseInfo;
  24 +import com.zteits.clouds.api.apibase.bean.BizResult;
  25 +import com.zteits.clouds.api.dto.park.dto.ParkingLotDTO;
  26 +import com.zteits.clouds.api.dto.park.dto.TabParkinglotDTO;
  27 +import com.zteits.clouds.api.dto.park.param.FreeBerthNumUpdateByFreeBerthNumRequest;
  28 +import com.zteits.clouds.api.dto.park.param.FreeBerthNumUpdateByInOutTypeRequest;
  29 +import com.zteits.clouds.api.service.park.ParkFreeBerthService;
  30 +import com.zteits.clouds.api.service.park.ParkingLotQueryService;
  31 +import com.zteits.irain.portal.constant.ParkConstant;
  32 +import com.zteits.irain.portal.service.interfaces.parklotidleberths.ParkLotIdleBerthsService;
  33 +@Component
  34 +public class ParkLotIdleBerthsServiceImpl implements ParkLotIdleBerthsService {
  35 +
  36 + private static final Logger logger = LoggerFactory.getLogger(ParkLotIdleBerthsServiceImpl.class);
  37 +
  38 + @Value("${project.syscode}")
  39 + private String sysCode;
  40 + @Autowired
  41 + private ParkFreeBerthService parkFreeBerthService;
  42 + @Autowired
  43 + private ParkingLotQueryService parkingLotQueryService;
  44 + @Autowired
  45 + private RedisCacheUtil redisCacheUtil;
  46 +
  47 + @Override
  48 + @Deprecated
  49 + public Map<String, TabParkinglotDTO> getIdleBerthFromRedisByParkNos(List<String> parkNos) {
  50 + Map<String, TabParkinglotDTO> result = new HashMap<>();
  51 + BaseInfo info = new BaseInfo();
  52 + //从缓存中获取
  53 + for (String plNo : parkNos) {
  54 + ParkingLotDTO parkingLotDTO = ParkingLotCacheUtil.getParkLotByPlNo(plNo);
  55 + if(parkingLotDTO==null){
  56 + continue;
  57 + }
  58 + TabParkinglotDTO tabdto = new TabParkinglotDTO();
  59 + tabdto.setPklNo(parkingLotDTO.getPlNo());
  60 + tabdto.setPklName(parkingLotDTO.getPlName());
  61 + //获取空闲车位数
  62 + Integer idleberths = ParkFreeBerthsCacheUtil.getFreeBerthsByPlNo(parkingLotDTO.getPlNo());
  63 + tabdto.setIdleberths(idleberths);
  64 + result.put(parkingLotDTO.getPlNo(), tabdto);
  65 + }
  66 + logger.info("["+info.getRequestId()+"]开始通过key获取停车场信息结束");
  67 + return result;
  68 + }
  69 +
  70 + @Override
  71 + public int updateAndGetIdleBerthByParkNo(Date inoutTime,String plNo, Integer type, Integer fromType,Integer freeBerths) {
  72 + logger.info("开始通过key:"+plNo+" 更新空闲车位,类型:"+type+"(1:进场;2:出场),来源:"+fromType+"(1:艾润;2:青岛)");
  73 +/* logger.info("进/出场时间:"+DateUtil.getDateString(inoutTime, DateUtil.YYYYMMDDHHMMSS)+",当前时间:"+DateUtil.getDateString(DateUtil.YYYYMMDDHHMMSS));
  74 + Calendar inOutCalendTime = Calendar.getInstance();
  75 + inOutCalendTime.setTime(inoutTime);
  76 + Calendar currentTime = Calendar.getInstance();
  77 + //当前时间-30分钟(防止艾润网络延迟上报)
  78 + currentTime.add(Calendar.MINUTE, -30);
  79 + if(inOutCalendTime.before(currentTime)){
  80 + logger.info("进/出场时间和当前时间误差大于1小时,不更新空闲车位数");
  81 + return ParkFreeBerthsCacheUtil.getFreeBerthsByPlNo(plNo);
  82 + }*/
  83 +
  84 + Integer idleberth = 0;
  85 + try{
  86 + freeBerths = freeBerths==null?0:freeBerths;
  87 + //更新redis中空闲车位数,返回当前总的空闲车位数
  88 + idleberth = updateRedisFreeBerthNum(type, plNo,fromType,freeBerths);
  89 +
  90 + //向Redis消息队列发送空闲车位数
  91 + ParkingLotDTO parkingLotDTO = ParkingLotCacheUtil.getParkLotByPlNo(plNo);
  92 + //判断停车场是否为赤峰
  93 + if(parkingLotDTO!=null && parkingLotDTO.getPlCityId()==ParkConstant.CityId.CHIFENG){
  94 + JSONObject jsonObject = new JSONObject();
  95 + //空闲车位数
  96 + jsonObject.put("freeBerths", idleberth);
  97 + //停车场编号
  98 + jsonObject.put("plNo", plNo);
  99 + redisCacheUtil.convertAndSend(RedisKeyEnum.PARK_FREEBERTH_PLNO_FREEBERTH_TOPIC.key(),jsonObject);
  100 + }
  101 + }catch(Exception e){
  102 + logger.error("根据停车场编号["+plNo+"]更新空闲车位报错:",e);
  103 + }
  104 + return idleberth;
  105 + }
  106 + /**
  107 + * 更新redis中空闲车位数,返回当前总的空闲车位数
  108 + * @param type 1:进场;2:出场
  109 + * @param info
  110 + * @param parkNo 自己内部停车场编号
  111 + * @param fromType 1:艾润;2:青岛
  112 + * @return
  113 + * 2017年6月7日 zhaowg
  114 + */
  115 + private Integer updateRedisFreeBerthNum(Integer type, String parkNo,Integer fromType,Integer freeBerths) {
  116 + //通过来源类型判断更新空闲车位的方式,直接覆盖还是自己计算
  117 + String updateFreeMethods = SysCodeValueCacheUtil.queryCodeNameByCodeValue(CodeValKindEnum.UPDATE_FREEBERTHS_BY_FROMTYPE,fromType.toString());
  118 + if(StringUtils.isBlank(updateFreeMethods)){
  119 + logger.error("通过来源类型【"+fromType+"】从缓存中获取对应的更新空闲车位方式失败。",new Exception("通过来源类型判断更新空闲车位的方式失败,没有找到来源类型【"+fromType+"】对应的更新空闲车位方式"));
  120 + return 0;
  121 + }
  122 + BizResult<Integer> bizResult = new BizResult<>();
  123 + //直接覆盖
  124 + if(updateFreeMethods.equals(ParkConstant.ParkFreeBerths.UpdateMethod.COVER)){
  125 + FreeBerthNumUpdateByFreeBerthNumRequest request = new FreeBerthNumUpdateByFreeBerthNumRequest();
  126 + request.setFreeBerthNum(freeBerths);
  127 + request.setPlNo(parkNo);
  128 + request.setSysCode(sysCode);
  129 + bizResult = parkFreeBerthService.updateFreeBerthNumByFreeBerthNum(request );
  130 + }else if(updateFreeMethods.equals(ParkConstant.ParkFreeBerths.UpdateMethod.AUTOCALC)){
  131 + //自己计算
  132 + FreeBerthNumUpdateByInOutTypeRequest request = new FreeBerthNumUpdateByInOutTypeRequest();
  133 + request.setInOutType(type);
  134 + request.setPlNo(parkNo);
  135 + request.setSysCode(sysCode);
  136 + bizResult = parkFreeBerthService.updateFreeBerthNumByInOutType(request);
  137 + }
  138 +
  139 + return ResultUtils.getBizResultData(bizResult);
  140 + }
  141 +}
... ...
src/main/java/com/zteits/irain/portal/service/interfaces/induction/InductionService.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/service/interfaces/induction/InductionService.java
  1 +package com.zteits.irain.portal.service.interfaces.induction;
  2 +
  3 +import com.clouds.common.web.vo.BizResultVO;
  4 +import com.zteits.irain.portal.service.interfaces.induction.param.DoLevelTwoAndThreeInductionReleaseBatchRequest;
  5 +/**
  6 + * 对接智慧停车诱导服务管理系统
  7 + * Copyright: Copyright (c) 2017 zteits
  8 + *
  9 + * @ClassName: InductionService.java
  10 + * @Description:
  11 + * @version: v1.0.0
  12 + * @author: zhaowg
  13 + * @date: 2017年5月24日 上午10:03:03
  14 + * Modification History:
  15 + * Date Author Version Description
  16 + *---------------------------------------------------------*
  17 + * 2017年5月24日 zhaowg v1.0.0 创建
  18 + */
  19 +public interface InductionService {
  20 + /**
  21 + * 二级、三级诱导批量发布
  22 + * @param owner_code
  23 + * @param pwd
  24 + * @param inductionServices
  25 + * @return
  26 + * 2017年5月24日 zhaowg
  27 + */
  28 + public BizResultVO<?> doLevelTwoAndThreeInductionReleaseBatch(DoLevelTwoAndThreeInductionReleaseBatchRequest request);
  29 + /**
  30 + * 一级诱导发布回显
  31 + * @param eqpCode 诱导设备编码
  32 + * @return
  33 + * 2017年5月24日 zhaowg
  34 + */
  35 + public BizResultVO<?> showLevelOneInductionRelease(String eqpCode);
  36 +
  37 +}
... ...
src/main/java/com/zteits/irain/portal/service/interfaces/induction/param/DoLevelTwoAndThreeInductionReleaseBatchRequest.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/service/interfaces/induction/param/DoLevelTwoAndThreeInductionReleaseBatchRequest.java
  1 +package com.zteits.irain.portal.service.interfaces.induction.param;
  2 +
  3 +import java.util.List;
  4 +
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +
  7 +/**
  8 + * 二级、三级诱导批量发布请求参数
  9 + *
  10 + * Copyright: Copyright (c) 2017 zteits
  11 + *
  12 + * @ClassName: DoLevelTwoAndThreeInductionReleaseBatchReq.java
  13 + * @Description:
  14 + * @version: v1.0.0
  15 + * @author: zhaowg
  16 + * @date: 2017年5月25日 上午9:22:20
  17 + * Modification History:
  18 + * Date Author Version Description
  19 + *---------------------------------------------------------*
  20 + * 2017年5月25日 zhaowg v1.0.0 创建
  21 + */
  22 +public class DoLevelTwoAndThreeInductionReleaseBatchRequest {
  23 + @ApiModelProperty(value="用户编码")
  24 + private String owner_code;
  25 + @ApiModelProperty(value="密码")
  26 + private String pwd;
  27 + @ApiModelProperty(value="停车场剩余泊位数")
  28 + private List<InductionRelease> jsonStr;
  29 + public String getOwner_code() {
  30 + return owner_code;
  31 + }
  32 + public void setOwner_code(String owner_code) {
  33 + this.owner_code = owner_code;
  34 + }
  35 + public String getPwd() {
  36 + return pwd;
  37 + }
  38 + public void setPwd(String pwd) {
  39 + this.pwd = pwd;
  40 + }
  41 + public List<InductionRelease> getJsonStr() {
  42 + return jsonStr;
  43 + }
  44 + public void setJsonStr(List<InductionRelease> jsonStr) {
  45 + this.jsonStr = jsonStr;
  46 + }
  47 +
  48 +}
... ...
src/main/java/com/zteits/irain/portal/service/interfaces/induction/param/InductionLevelOneShow.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/service/interfaces/induction/param/InductionLevelOneShow.java
  1 +package com.zteits.irain.portal.service.interfaces.induction.param;
  2 +/**
  3 + * 一级诱导回显
  4 + *
  5 + * Copyright: Copyright (c) 2017 zteits
  6 + *
  7 + * @ClassName: InductionLevelOneShow.java
  8 + * @Description:
  9 + * @version: v1.0.0
  10 + * @author: zhaowg
  11 + * @date: 2017年5月24日 上午10:40:07
  12 + * Modification History:
  13 + * Date Author Version Description
  14 + *---------------------------------------------------------*
  15 + * 2017年5月24日 zhaowg v1.0.0 创建
  16 + */
  17 +public class InductionLevelOneShow {
  18 + /**
  19 + * 诱导设备编码
  20 + */
  21 + private String eqpCode;
  22 + /**
  23 + * 一级诱导发布的base64图片
  24 + */
  25 + private String imageBase64;
  26 + public String getEqpCode() {
  27 + return eqpCode;
  28 + }
  29 + public void setEqpCode(String eqpCode) {
  30 + this.eqpCode = eqpCode;
  31 + }
  32 + public String getImageBase64() {
  33 + return imageBase64;
  34 + }
  35 + public void setImageBase64(String imageBase64) {
  36 + this.imageBase64 = imageBase64;
  37 + }
  38 +}
... ...
src/main/java/com/zteits/irain/portal/service/interfaces/induction/param/InductionRelease.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/service/interfaces/induction/param/InductionRelease.java
  1 +package com.zteits.irain.portal.service.interfaces.induction.param;
  2 +
  3 +import io.swagger.annotations.ApiModelProperty;
  4 +
  5 +/**
  6 + * 诱导发布VO
  7 + *
  8 + * Copyright: Copyright (c) 2017 zteits
  9 + *
  10 + * @ClassName: InductionRelease.java
  11 + * @Description:
  12 + * @version: v1.0.0
  13 + * @author: zhaowg
  14 + * @date: 2017年5月24日 上午9:31:55
  15 + * Modification History:
  16 + * Date Author Version Description
  17 + *---------------------------------------------------------*
  18 + * 2017年5月24日 zhaowg v1.0.0 创建
  19 + */
  20 +public class InductionRelease {
  21 + @ApiModelProperty(value="用户编号")
  22 + private String owner_code;
  23 + @ApiModelProperty(value="密码")
  24 + private String pwd;
  25 + @ApiModelProperty(value="停车场编码")
  26 + private String parking_code;
  27 + @ApiModelProperty(value="泊位区间编号")
  28 + private String range_code;
  29 + @ApiModelProperty(value="剩余泊位数")
  30 + private String berth_left;
  31 + public String getOwner_code() {
  32 + return owner_code;
  33 + }
  34 + public void setOwner_code(String owner_code) {
  35 + this.owner_code = owner_code;
  36 + }
  37 + public String getPwd() {
  38 + return pwd;
  39 + }
  40 + public void setPwd(String pwd) {
  41 + this.pwd = pwd;
  42 + }
  43 + public String getParking_code() {
  44 + return parking_code;
  45 + }
  46 + public void setParking_code(String parking_code) {
  47 + this.parking_code = parking_code;
  48 + }
  49 + public String getRange_code() {
  50 + return range_code;
  51 + }
  52 + public void setRange_code(String range_code) {
  53 + this.range_code = range_code;
  54 + }
  55 + public String getBerth_left() {
  56 + return berth_left;
  57 + }
  58 + public void setBerth_left(String berth_left) {
  59 + this.berth_left = berth_left;
  60 + }
  61 + @Override
  62 + public String toString() {
  63 + return "InductionRelease [owner_code=" + owner_code + ", pwd=" + pwd + ", parking_code=" + parking_code
  64 + + ", range_code=" + range_code + ", berth_left=" + berth_left + "]";
  65 + }
  66 +
  67 +}
... ...
src/main/java/com/zteits/irain/portal/service/interfaces/induction/param/InductionResponse.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/service/interfaces/induction/param/InductionResponse.java
  1 +package com.zteits.irain.portal.service.interfaces.induction.param;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +public class InductionResponse<T> implements Serializable{
  6 +
  7 + private static final long serialVersionUID = 1L;
  8 + /**100为成功,其他错误*/
  9 + private String sys_code;
  10 +
  11 + private String sys_msg;
  12 +
  13 + private T data;
  14 +
  15 + public String getSys_code() {
  16 + return sys_code;
  17 + }
  18 +
  19 + public void setSys_code(String sys_code) {
  20 + this.sys_code = sys_code;
  21 + }
  22 +
  23 + public String getSys_msg() {
  24 + return sys_msg;
  25 + }
  26 +
  27 + public void setSys_msg(String sys_msg) {
  28 + this.sys_msg = sys_msg;
  29 + }
  30 +
  31 + public T getData() {
  32 + return data;
  33 + }
  34 +
  35 + public void setData(T data) {
  36 + this.data = data;
  37 + }
  38 +
  39 + @Override
  40 + public String toString() {
  41 + return "InductionResponse [sys_code=" + sys_code + ", sys_msg=" + sys_msg + ", data=" + data + "]";
  42 + }
  43 +
  44 +}
... ...
src/main/java/com/zteits/irain/portal/service/interfaces/inoutparklot/InOutParkLotReportService.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/service/interfaces/inoutparklot/InOutParkLotReportService.java
  1 +package com.zteits.irain.portal.service.interfaces.inoutparklot;
  2 +
  3 +import com.zteits.clouds.api.apibase.bean.BizResult;
  4 +import com.zteits.irain.portal.service.interfaces.inoutparklot.param.RecordInParkLotRequest;
  5 +import com.zteits.irain.portal.service.interfaces.inoutparklot.param.RecordOutParkLotRequest;
  6 +
  7 +/**
  8 + * 进出场上报接口
  9 + *
  10 + * Copyright: Copyright (c) 2017 zteits
  11 + *
  12 + * @ClassName: InOutParkingLotService.java
  13 + * @Description:
  14 + * @version: v1.0.0
  15 + * @author: zhaowg
  16 + * @date: 2017年6月7日 上午10:02:23
  17 + * Modification History:
  18 + * Date Author Version Description
  19 + *---------------------------------------------------------*
  20 + * 2017年6月7日 zhaowg v1.0.0 创建
  21 + */
  22 +public interface InOutParkLotReportService {
  23 + /**
  24 + * 进车上报
  25 + * @param request
  26 + * @return 插入记录表主键
  27 + * 2017年6月7日 zhaowg
  28 + */
  29 + Long InParkLotRecord(RecordInParkLotRequest request) throws Exception;
  30 +
  31 + /**
  32 + * 出车上报
  33 + * @param request
  34 + * @return 插入记录表主键
  35 + * 2017年6月7日 zhaowg
  36 + */
  37 + Long OutParkLotRecord(RecordOutParkLotRequest request) throws Exception;
  38 +
  39 +}
... ...
src/main/java/com/zteits/irain/portal/service/interfaces/inoutparklot/param/RecordInParkLotRequest.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/service/interfaces/inoutparklot/param/RecordInParkLotRequest.java
  1 +package com.zteits.irain.portal.service.interfaces.inoutparklot.param;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +import javax.validation.constraints.NotNull;
  6 +
  7 +import com.zteits.clouds.api.dto.park.param.InParkingRequest;
  8 +
  9 +public class RecordInParkLotRequest implements Serializable{
  10 +
  11 + private static final long serialVersionUID = 1L;
  12 + /**系统编码*/
  13 + @NotNull
  14 + private String sysCode;
  15 + /**来源:1艾润;2青岛*/
  16 + @NotNull
  17 + private Integer fromType;
  18 + /**数据来源来源类型 1、道闸 2、地磁 等'*/
  19 + private Integer sourceType;
  20 + /**进车上报参数*/
  21 + private InParkingRequest inParkLotReq;
  22 +
  23 + public Integer getSourceType() {
  24 + return sourceType;
  25 + }
  26 +
  27 + public void setSourceType(Integer sourceType) {
  28 + this.sourceType = sourceType;
  29 + }
  30 + public String getSysCode() {
  31 + return sysCode;
  32 + }
  33 + public void setSysCode(String sysCode) {
  34 + this.sysCode = sysCode;
  35 + }
  36 + public InParkingRequest getInParkLotReq() {
  37 + return inParkLotReq;
  38 + }
  39 + public void setInParkLotReq(InParkingRequest inParkLotReq) {
  40 + this.inParkLotReq = inParkLotReq;
  41 + }
  42 + public Integer getFromType() {
  43 + return fromType;
  44 + }
  45 + public void setFromType(Integer fromType) {
  46 + this.fromType = fromType;
  47 + }
  48 +
  49 +}
... ...
src/main/java/com/zteits/irain/portal/service/interfaces/inoutparklot/param/RecordOutParkLotRequest.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/service/interfaces/inoutparklot/param/RecordOutParkLotRequest.java
  1 +package com.zteits.irain.portal.service.interfaces.inoutparklot.param;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +import javax.validation.constraints.NotNull;
  6 +
  7 +import com.zteits.clouds.api.dto.park.param.OutParkingRequest;
  8 +
  9 +public class RecordOutParkLotRequest implements Serializable{
  10 +
  11 + private static final long serialVersionUID = 1L;
  12 + /**系统编码*/
  13 + @NotNull
  14 + private String sysCode;
  15 + /**来源:1艾润;2青岛*/
  16 + @NotNull
  17 + private Integer fromType;
  18 + /**数据来源来源类型 1、道闸 2、地磁 等'*/
  19 + private Integer sourceType;
  20 + /**进车上报参数*/
  21 + private OutParkingRequest outParkLotReq;
  22 +
  23 + public Integer getSourceType() {
  24 + return sourceType;
  25 + }
  26 + public void setSourceType(Integer sourceType) {
  27 + this.sourceType = sourceType;
  28 + }
  29 + public String getSysCode() {
  30 + return sysCode;
  31 + }
  32 + public void setSysCode(String sysCode) {
  33 + this.sysCode = sysCode;
  34 + }
  35 + public Integer getFromType() {
  36 + return fromType;
  37 + }
  38 + public void setFromType(Integer fromType) {
  39 + this.fromType = fromType;
  40 + }
  41 + public OutParkingRequest getOutParkLotReq() {
  42 + return outParkLotReq;
  43 + }
  44 + public void setOutParkLotReq(OutParkingRequest outParkLotReq) {
  45 + this.outParkLotReq = outParkLotReq;
  46 + }
  47 +
  48 +
  49 +}
... ...
src/main/java/com/zteits/irain/portal/service/interfaces/parklotidleberths/ParkLotIdleBerthsService.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/service/interfaces/parklotidleberths/ParkLotIdleBerthsService.java
  1 +package com.zteits.irain.portal.service.interfaces.parklotidleberths;
  2 +
  3 +import java.util.Date;
  4 +import java.util.List;
  5 +import java.util.Map;
  6 +
  7 +import com.zteits.clouds.api.dto.park.dto.TabParkinglotDTO;
  8 +
  9 +/**
  10 + * 停车场空闲车位数
  11 + *
  12 + * Copyright: Copyright (c) 2017 zteits
  13 + *
  14 + * @ClassName: ParkLotIdleBerths.java
  15 + * @Description:
  16 + * @version: v1.0.0
  17 + * @author: zhaowg
  18 + * @date: 2017年5月25日 上午10:11:09
  19 + * Modification History:
  20 + * Date Author Version Description
  21 + *---------------------------------------------------------*
  22 + * 2017年5月25日 zhaowg v1.0.0 创建
  23 + */
  24 +public interface ParkLotIdleBerthsService {
  25 + /**
  26 + * 通过停车场编号查询空闲车位信息(临时演示使用)
  27 + * @param parkNos
  28 + * @return map key为停车场编号,value为对应的停车场信息
  29 + * 2017年5月25日 zhaowg
  30 + */
  31 + @Deprecated
  32 + Map<String, TabParkinglotDTO> getIdleBerthFromRedisByParkNos(List<String> parkNos);
  33 +
  34 + /**
  35 + * 通过停车场编号更新空闲车位信息
  36 + * @param inoutTime 进出场时间
  37 + * @param plNo 自己内部停车场编号
  38 + * @param type 类型:1:进场;2:出场
  39 + * @param fromType 1:艾润;2:青岛
  40 + * @param freeBerths 空闲车位数,来源为青岛时,直接将空闲车位数替换为freeBerths
  41 + * @return 更新后的空闲车位数
  42 + */
  43 + int updateAndGetIdleBerthByParkNo(Date inoutTime,String plNo,Integer type,Integer fromType,Integer freeBerths);
  44 +
  45 +
  46 +}
... ...
src/main/java/com/zteits/irain/portal/vo/ebochong/EBoChongEnum.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/ebochong/EBoChongEnum.java
  1 +package com.zteits.irain.portal.vo.ebochong;
  2 +
  3 +/**
  4 + * Copyright: Copyright (c) 2017 zteits
  5 + *
  6 + * @ClassName: com.zteits.irain.portal.vo.ebochong
  7 + * @Description:
  8 + * @version: v1.0.0
  9 + * @author: atao
  10 + * @date: 2017/6/23 下午3:28
  11 + * Modification History:
  12 + * Date Author Version Description
  13 + * ---------------------------------------------------------*
  14 + * 2017/6/23 atao v1.0.0 创建
  15 + */
  16 +public enum EBoChongEnum {
  17 +
  18 + COMMAND_GO(1, "放行"),
  19 + COMMAND_NOT_GO(2, "不放行"),
  20 + CODE_SUCCESS(0, "成功"),
  21 + AMOUNTTYPE_PARK(0, "停车收费"),
  22 + AMOUNTTYPE_RENEW(1, "长期续费"),
  23 + REDUCTIONTYPE_NO(0, "无减免"),
  24 + REDUCTIONTYPE_ALL(1, "全免"),
  25 + REDUCTIONTYPE_TIME(2, "免时间"),
  26 + REDUCTIONTYPE_DISCOUNT(3, "折扣"),
  27 + REDUCTIONTYPE_MONEY(4, "金额"),
  28 + CODE_FAIL(1, "失败"),
  29 + CAROUT_IN(0, "入场"),
  30 + CAROUT_OUT(1, "出场"),
  31 + PAYTYPE_PARK(0, "停车场自收费"),
  32 + PAYTYPE_EBOCHONG(1, "停车场自收费");
  33 +
  34 + private Integer value;
  35 + private String desc;
  36 +
  37 + EBoChongEnum(Integer value, String desc) {
  38 + this.desc = desc;
  39 + this.value = value;
  40 + }
  41 +
  42 + public Integer val() {
  43 + return this.value;
  44 + }
  45 +}
... ...
src/main/java/com/zteits/irain/portal/vo/ebochong/receive/ChargeListDetail.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/ebochong/receive/ChargeListDetail.java
  1 +package com.zteits.irain.portal.vo.ebochong.receive;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +/**
  6 + * Copyright: Copyright (c) 2017 zteits
  7 + *
  8 + * @ClassName: com.zteits.irain.portal.vo.ebochong.receive.req
  9 + * @Description:
  10 + * @version: v1.0.0
  11 + * @author: atao
  12 + * @date: 2017/6/23 下午3:57
  13 + * Modification History:
  14 + * Date Author Version Description
  15 + * ---------------------------------------------------------*
  16 + * 2017/6/23 atao v1.0.0 创建
  17 + */
  18 +public class ChargeListDetail implements Serializable {
  19 +
  20 + //车牌号
  21 + private String plateNo;
  22 + //卡片号码
  23 + private String cardNo;
  24 + //出入口编号
  25 + private String parkIndex;
  26 + //出入口编号
  27 + private String entranceIndex;
  28 + //过车时间,时间格式:YYYY-MM-DD HH:MM:SS
  29 + private String passTime;
  30 + //(可选)入场时间,如果入场则 该字段为空,时间格式:YYYY-MM-DD HH:MM:SS
  31 + private String inTime;
  32 + //出入方向,0-入场,1-出场
  33 + private Integer carOut;
  34 + //可选)车牌图片 URL,没有图片,则为空
  35 + private String vehicleUrl;
  36 + //实际缴费金额,单位为分,不收费, 填为 0
  37 + private Integer receivable;
  38 + //缴费类型 0:停车场自收费 1:易泊充平台缴费
  39 + private Integer payType;
  40 + //车辆唯一ID
  41 + private String uuid;
  42 + //费用类型 0:停车收费 1:长期续费
  43 + private Integer amountType;
  44 + //减免类型 0:无减免 1:全免 2:免时间 3:折扣 4:金额
  45 + private Integer reductionType;
  46 + //减免金额,单位为分
  47 + private Integer reductionMoney;
  48 +
  49 + public String getPlateNo() {
  50 + return plateNo;
  51 + }
  52 +
  53 + public void setPlateNo(String plateNo) {
  54 + this.plateNo = plateNo;
  55 + }
  56 +
  57 + public String getCardNo() {
  58 + return cardNo;
  59 + }
  60 +
  61 + public void setCardNo(String cardNo) {
  62 + this.cardNo = cardNo;
  63 + }
  64 +
  65 + public String getParkIndex() {
  66 + return parkIndex;
  67 + }
  68 +
  69 + public void setParkIndex(String parkIndex) {
  70 + this.parkIndex = parkIndex;
  71 + }
  72 +
  73 + public String getEntranceIndex() {
  74 + return entranceIndex;
  75 + }
  76 +
  77 + public void setEntranceIndex(String entranceIndex) {
  78 + this.entranceIndex = entranceIndex;
  79 + }
  80 +
  81 + public String getPassTime() {
  82 + return passTime;
  83 + }
  84 +
  85 + public void setPassTime(String passTime) {
  86 + this.passTime = passTime;
  87 + }
  88 +
  89 + public String getInTime() {
  90 + return inTime;
  91 + }
  92 +
  93 + public void setInTime(String inTime) {
  94 + this.inTime = inTime;
  95 + }
  96 +
  97 + public Integer getCarOut() {
  98 + return carOut;
  99 + }
  100 +
  101 + public void setCarOut(Integer carOut) {
  102 + this.carOut = carOut;
  103 + }
  104 +
  105 + public String getVehicleUrl() {
  106 + return vehicleUrl;
  107 + }
  108 +
  109 + public void setVehicleUrl(String vehicleUrl) {
  110 + this.vehicleUrl = vehicleUrl;
  111 + }
  112 +
  113 + public Integer getReceivable() {
  114 + return receivable;
  115 + }
  116 +
  117 + public void setReceivable(Integer receivable) {
  118 + this.receivable = receivable;
  119 + }
  120 +
  121 + public Integer getPayType() {
  122 + return payType;
  123 + }
  124 +
  125 + public void setPayType(Integer payType) {
  126 + this.payType = payType;
  127 + }
  128 +
  129 + public String getUuid() {
  130 + return uuid;
  131 + }
  132 +
  133 + public void setUuid(String uuid) {
  134 + this.uuid = uuid;
  135 + }
  136 +
  137 + public Integer getAmountType() {
  138 + return amountType;
  139 + }
  140 +
  141 + public void setAmountType(Integer amountType) {
  142 + this.amountType = amountType;
  143 + }
  144 +
  145 + public Integer getReductionType() {
  146 + return reductionType;
  147 + }
  148 +
  149 + public void setReductionType(Integer reductionType) {
  150 + this.reductionType = reductionType;
  151 + }
  152 +
  153 + public Integer getReductionMoney() {
  154 + return reductionMoney;
  155 + }
  156 +
  157 + public void setReductionMoney(Integer reductionMoney) {
  158 + this.reductionMoney = reductionMoney;
  159 + }
  160 +}
... ...
src/main/java/com/zteits/irain/portal/vo/ebochong/receive/ChargeListReq.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/ebochong/receive/ChargeListReq.java
  1 +package com.zteits.irain.portal.vo.ebochong.receive;
  2 +
  3 +import java.util.List;
  4 +
  5 +/**
  6 + * Copyright: Copyright (c) 2017 zteits
  7 + *
  8 + * @ClassName: com.zteits.irain.portal.vo.ebochong.receive.req
  9 + * @Description:
  10 + * @version: v1.0.0
  11 + * @author: atao
  12 + * @date: 2017/6/23 下午3:54
  13 + * Modification History:
  14 + * Date Author Version Description
  15 + * ---------------------------------------------------------*
  16 + * 2017/6/23 atao v1.0.0 创建
  17 + */
  18 +public class ChargeListReq extends CommonReq {
  19 + //停车场编号
  20 + private String parkIndex;
  21 + // 账单日期 例子:2016-06-30
  22 + private String date;
  23 + //停车场自收费总额,包括:现金收费、支付宝、微信缴费等除易泊充支付的所有支付方式的收费总额。单位为分
  24 + private Integer selfTotal;
  25 + //自收费笔数
  26 + private Integer selfTrans;
  27 + //易泊充支付总额,单位为分
  28 + private Integer ebcTotal;
  29 + //易泊充交易笔数
  30 + private Integer ebcTrans;
  31 + //账单列表
  32 + private List<ChargeListDetail> chargeList;
  33 +
  34 + public String getParkIndex() {
  35 + return parkIndex;
  36 + }
  37 +
  38 + public void setParkIndex(String parkIndex) {
  39 + this.parkIndex = parkIndex;
  40 + }
  41 +
  42 + public String getDate() {
  43 + return date;
  44 + }
  45 +
  46 + public void setDate(String date) {
  47 + this.date = date;
  48 + }
  49 +
  50 + public Integer getSelfTotal() {
  51 + return selfTotal;
  52 + }
  53 +
  54 + public void setSelfTotal(Integer selfTotal) {
  55 + this.selfTotal = selfTotal;
  56 + }
  57 +
  58 + public Integer getSelfTrans() {
  59 + return selfTrans;
  60 + }
  61 +
  62 + public void setSelfTrans(Integer selfTrans) {
  63 + this.selfTrans = selfTrans;
  64 + }
  65 +
  66 + public Integer getEbcTotal() {
  67 + return ebcTotal;
  68 + }
  69 +
  70 + public void setEbcTotal(Integer ebcTotal) {
  71 + this.ebcTotal = ebcTotal;
  72 + }
  73 +
  74 + public Integer getEbcTrans() {
  75 + return ebcTrans;
  76 + }
  77 +
  78 + public void setEbcTrans(Integer ebcTrans) {
  79 + this.ebcTrans = ebcTrans;
  80 + }
  81 +
  82 + public List<ChargeListDetail> getChargeList() {
  83 + return chargeList;
  84 + }
  85 +
  86 + public void setChargeList(List<ChargeListDetail> chargeList) {
  87 + this.chargeList = chargeList;
  88 + }
  89 +}
... ...
src/main/java/com/zteits/irain/portal/vo/ebochong/receive/ChargeListRes.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/ebochong/receive/ChargeListRes.java
  1 +package com.zteits.irain.portal.vo.ebochong.receive;
  2 +
  3 +import com.zteits.irain.portal.vo.ebochong.receive.CommonRes;
  4 +
  5 +/**
  6 + * Copyright: Copyright (c) 2017 zteits
  7 + *
  8 + * @ClassName: com.zteits.irain.portal.vo.ebochong.receive.res
  9 + * @Description:
  10 + * @version: v1.0.0
  11 + * @author: atao
  12 + * @date: 2017/6/23 下午4:22
  13 + * Modification History:
  14 + * Date Author Version Description
  15 + * ---------------------------------------------------------*
  16 + * 2017/6/23 atao v1.0.0 创建
  17 + */
  18 +public class ChargeListRes extends CommonRes {
  19 +}
... ...
src/main/java/com/zteits/irain/portal/vo/ebochong/receive/CommonReq.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/ebochong/receive/CommonReq.java
  1 +package com.zteits.irain.portal.vo.ebochong.receive;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +/**
  6 + * Copyright: Copyright (c) 2017 zteits
  7 + *
  8 + * @ClassName: com.zteits.irain.portal.vo.ebochong
  9 + * @Description:
  10 + * @version: v1.0.0
  11 + * @author: atao
  12 + * @date: 2017/6/23 下午3:25
  13 + * Modification History:
  14 + * Date Author Version Description
  15 + * ---------------------------------------------------------*
  16 + * 2017/6/23 atao v1.0.0 创建
  17 + */
  18 +public class CommonReq implements Serializable {
  19 +
  20 +
  21 +}
... ...
src/main/java/com/zteits/irain/portal/vo/ebochong/receive/CommonRes.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/ebochong/receive/CommonRes.java
  1 +package com.zteits.irain.portal.vo.ebochong.receive;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +/**
  6 + * Copyright: Copyright (c) 2017 zteits
  7 + *
  8 + * @ClassName: com.zteits.irain.portal.vo.ebochong
  9 + * @Description: 公共返回
  10 + * @version: v1.0.0
  11 + * @author: atao
  12 + * @date: 2017/6/22 下午5:10
  13 + * Modification History:
  14 + * Date Author Version Description
  15 + * ---------------------------------------------------------*
  16 + * 2017/6/22 atao v1.0.0 创建
  17 + */
  18 +public class CommonRes implements Serializable {
  19 + /**
  20 + * 返回错误代码
  21 + * 必填
  22 + */
  23 + private Integer code;
  24 + /**
  25 + * 返回信息
  26 + * 非必填
  27 + */
  28 + private String message;
  29 +
  30 + public Integer getCode() {
  31 + return code;
  32 + }
  33 +
  34 + public void setCode(Integer code) {
  35 + this.code = code;
  36 + }
  37 +
  38 + public String getMessage() {
  39 + return message;
  40 + }
  41 +
  42 + public void setMessage(String message) {
  43 + this.message = message;
  44 + }
  45 +}
... ...
src/main/java/com/zteits/irain/portal/vo/ebochong/receive/HandledVehicleInfoReq.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/ebochong/receive/HandledVehicleInfoReq.java
  1 +package com.zteits.irain.portal.vo.ebochong.receive;
  2 +
  3 +import com.zteits.irain.portal.vo.ebochong.receive.CommonReq;
  4 +
  5 +/**
  6 + * Copyright: Copyright (c) 2017 zteits
  7 + *
  8 + * @ClassName: com.zteits.irain.portal.vo.ebochong.receive.req
  9 + * @Description:
  10 + * @version: v1.0.0
  11 + * @author: atao
  12 + * @date: 2017/6/23 下午3:41
  13 + * Modification History:
  14 + * Date Author Version Description
  15 + * ---------------------------------------------------------*
  16 + * 2017/6/23 atao v1.0.0 创建
  17 + */
  18 +public class HandledVehicleInfoReq extends CommonReq {
  19 + //车牌号
  20 + private String plateNo;
  21 + //parkIndex
  22 + private String cardNo;
  23 + //出入口编号
  24 + private String parkIndex;
  25 + //出入口编号
  26 + private String entranceIndex;
  27 + //过车时间,时间格式:YYYY-MM-DD HH:MM:SS
  28 + private String passTime;
  29 + //(可选)入场时间,如果入场则 该字段为空,时间格式:YYYY-MM-DD HH:MM:SS
  30 + private String inTime;
  31 + //出入方向,0-入场,1-出场
  32 + private Integer carOut;
  33 + //可选)车牌图片 URL,没有图片,则为空
  34 + private String vehicleUrl;
  35 + //实际缴费金额,单位为分,不收费, 填为 0
  36 + private Integer receivable;
  37 + //缴费类型 0:停车场自收费 1:易泊充平台缴费
  38 + private Integer payType;
  39 + //剩余车位数
  40 + private Integer remaining;
  41 + //车辆唯一ID
  42 + private String uuid;
  43 +
  44 + public String getPlateNo() {
  45 + return plateNo;
  46 + }
  47 +
  48 + public void setPlateNo(String plateNo) {
  49 + this.plateNo = plateNo;
  50 + }
  51 +
  52 + public String getCardNo() {
  53 + return cardNo;
  54 + }
  55 +
  56 + public void setCardNo(String cardNo) {
  57 + this.cardNo = cardNo;
  58 + }
  59 +
  60 + public String getParkIndex() {
  61 + return parkIndex;
  62 + }
  63 +
  64 + public void setParkIndex(String parkIndex) {
  65 + this.parkIndex = parkIndex;
  66 + }
  67 +
  68 + public String getEntranceIndex() {
  69 + return entranceIndex;
  70 + }
  71 +
  72 + public void setEntranceIndex(String entranceIndex) {
  73 + this.entranceIndex = entranceIndex;
  74 + }
  75 +
  76 + public String getPassTime() {
  77 + return passTime;
  78 + }
  79 +
  80 + public void setPassTime(String passTime) {
  81 + this.passTime = passTime;
  82 + }
  83 +
  84 + public String getInTime() {
  85 + return inTime;
  86 + }
  87 +
  88 + public void setInTime(String inTime) {
  89 + this.inTime = inTime;
  90 + }
  91 +
  92 + public Integer getCarOut() {
  93 + return carOut;
  94 + }
  95 +
  96 + public void setCarOut(Integer carOut) {
  97 + this.carOut = carOut;
  98 + }
  99 +
  100 + public String getVehicleUrl() {
  101 + return vehicleUrl;
  102 + }
  103 +
  104 + public void setVehicleUrl(String vehicleUrl) {
  105 + this.vehicleUrl = vehicleUrl;
  106 + }
  107 +
  108 + public Integer getReceivable() {
  109 + return receivable;
  110 + }
  111 +
  112 + public void setReceivable(Integer receivable) {
  113 + this.receivable = receivable;
  114 + }
  115 +
  116 + public Integer getPayType() {
  117 + return payType;
  118 + }
  119 +
  120 + public void setPayType(Integer payType) {
  121 + this.payType = payType;
  122 + }
  123 +
  124 + public Integer getRemaining() {
  125 + return remaining;
  126 + }
  127 +
  128 + public void setRemaining(Integer remaining) {
  129 + this.remaining = remaining;
  130 + }
  131 +
  132 + public String getUuid() {
  133 + return uuid;
  134 + }
  135 +
  136 + public void setUuid(String uuid) {
  137 + this.uuid = uuid;
  138 + }
  139 +}
... ...
src/main/java/com/zteits/irain/portal/vo/ebochong/receive/HandledVehicleInfoRes.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/ebochong/receive/HandledVehicleInfoRes.java
  1 +package com.zteits.irain.portal.vo.ebochong.receive;
  2 +
  3 +import com.zteits.irain.portal.vo.ebochong.receive.CommonRes;
  4 +
  5 +/**
  6 + * Copyright: Copyright (c) 2017 zteits
  7 + *
  8 + * @ClassName: com.zteits.irain.portal.vo.ebochong.receive.res
  9 + * @Description:
  10 + * @version: v1.0.0
  11 + * @author: atao
  12 + * @date: 2017/6/23 下午3:47
  13 + * Modification History:
  14 + * Date Author Version Description
  15 + * ---------------------------------------------------------*
  16 + * 2017/6/23 atao v1.0.0 创建
  17 + */
  18 +public class HandledVehicleInfoRes extends CommonRes {
  19 +}
... ...
src/main/java/com/zteits/irain/portal/vo/ebochong/receive/RemainingInfoReq.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/ebochong/receive/RemainingInfoReq.java
  1 +package com.zteits.irain.portal.vo.ebochong.receive;
  2 +
  3 +import com.zteits.irain.portal.vo.ebochong.receive.CommonReq;
  4 +
  5 +/**
  6 + * Copyright: Copyright (c) 2017 zteits
  7 + *
  8 + * @ClassName: com.zteits.irain.portal.vo.ebochong.receive.req
  9 + * @Description:
  10 + * @version: v1.0.0
  11 + * @author: atao
  12 + * @date: 2017/6/23 下午3:52
  13 + * Modification History:
  14 + * Date Author Version Description
  15 + * ---------------------------------------------------------*
  16 + * 2017/6/23 atao v1.0.0 创建
  17 + */
  18 +public class RemainingInfoReq extends CommonReq {
  19 +
  20 + //停车场编号
  21 + private String parkIndex;
  22 + //剩余车位数
  23 + private Integer remaining;
  24 +
  25 + public String getParkIndex() {
  26 + return parkIndex;
  27 + }
  28 +
  29 + public void setParkIndex(String parkIndex) {
  30 + this.parkIndex = parkIndex;
  31 + }
  32 +
  33 + public Integer getRemaining() {
  34 + return remaining;
  35 + }
  36 +
  37 + public void setRemaining(Integer remaining) {
  38 + this.remaining = remaining;
  39 + }
  40 +}
... ...
src/main/java/com/zteits/irain/portal/vo/ebochong/receive/RemainingInfoRes.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/ebochong/receive/RemainingInfoRes.java
  1 +package com.zteits.irain.portal.vo.ebochong.receive;
  2 +
  3 +import com.zteits.irain.portal.vo.ebochong.receive.CommonRes;
  4 +
  5 +/**
  6 + * Copyright: Copyright (c) 2017 zteits
  7 + *
  8 + * @ClassName: com.zteits.irain.portal.vo.ebochong.receive.res
  9 + * @Description:
  10 + * @version: v1.0.0
  11 + * @author: atao
  12 + * @date: 2017/6/23 下午3:53
  13 + * Modification History:
  14 + * Date Author Version Description
  15 + * ---------------------------------------------------------*
  16 + * 2017/6/23 atao v1.0.0 创建
  17 + */
  18 +public class RemainingInfoRes extends CommonRes {
  19 +
  20 +}
... ...
src/main/java/com/zteits/irain/portal/vo/ebochong/receive/ResendVehicleInfoReq.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/ebochong/receive/ResendVehicleInfoReq.java
  1 +package com.zteits.irain.portal.vo.ebochong.receive;
  2 +
  3 +import com.zteits.irain.portal.vo.ebochong.receive.CommonReq;
  4 +
  5 +/**
  6 + * Copyright: Copyright (c) 2017 zteits
  7 + *
  8 + * @ClassName: com.zteits.irain.portal.vo.ebochong.receive.req
  9 + * @Description:
  10 + * @version: v1.0.0
  11 + * @author: atao
  12 + * @date: 2017/6/23 下午4:08
  13 + * Modification History:
  14 + * Date Author Version Description
  15 + * ---------------------------------------------------------*
  16 + * 2017/6/23 atao v1.0.0 创建
  17 + */
  18 +public class ResendVehicleInfoReq extends CommonReq {
  19 +
  20 + //返回当前补发序号
  21 + private Integer SendNo;
  22 + //车牌号
  23 + private String plateNo;
  24 + //parkIndex
  25 + private String cardNo;
  26 + //出入口编号
  27 + private String parkIndex;
  28 + //出入口编号
  29 + private String entranceIndex;
  30 + //过车时间,时间格式:YYYY-MM-DD HH:MM:SS
  31 + private String passTime;
  32 + //(可选)入场时间,如果入场则 该字段为空,时间格式:YYYY-MM-DD HH:MM:SS
  33 + private String inTime;
  34 + //出入方向,0-入场,1-出场
  35 + private Integer carOut;
  36 + //可选)车牌图片 URL,没有图片,则为空
  37 + private String vehicleUrl;
  38 + //实际缴费金额,单位为分,不收费, 填为 0
  39 + private Integer receivable;
  40 + //缴费类型 0:停车场自收费 1:易泊充平台缴费
  41 + private Integer payType;
  42 + //车辆唯一ID
  43 + private String uuid;
  44 +
  45 + public Integer getSendNo() {
  46 + return SendNo;
  47 + }
  48 +
  49 + public void setSendNo(Integer sendNo) {
  50 + SendNo = sendNo;
  51 + }
  52 +
  53 + public String getPlateNo() {
  54 + return plateNo;
  55 + }
  56 +
  57 + public void setPlateNo(String plateNo) {
  58 + this.plateNo = plateNo;
  59 + }
  60 +
  61 + public String getCardNo() {
  62 + return cardNo;
  63 + }
  64 +
  65 + public void setCardNo(String cardNo) {
  66 + this.cardNo = cardNo;
  67 + }
  68 +
  69 + public String getParkIndex() {
  70 + return parkIndex;
  71 + }
  72 +
  73 + public void setParkIndex(String parkIndex) {
  74 + this.parkIndex = parkIndex;
  75 + }
  76 +
  77 + public String getEntranceIndex() {
  78 + return entranceIndex;
  79 + }
  80 +
  81 + public void setEntranceIndex(String entranceIndex) {
  82 + this.entranceIndex = entranceIndex;
  83 + }
  84 +
  85 + public String getPassTime() {
  86 + return passTime;
  87 + }
  88 +
  89 + public void setPassTime(String passTime) {
  90 + this.passTime = passTime;
  91 + }
  92 +
  93 + public String getInTime() {
  94 + return inTime;
  95 + }
  96 +
  97 + public void setInTime(String inTime) {
  98 + this.inTime = inTime;
  99 + }
  100 +
  101 + public Integer getCarOut() {
  102 + return carOut;
  103 + }
  104 +
  105 + public void setCarOut(Integer carOut) {
  106 + this.carOut = carOut;
  107 + }
  108 +
  109 + public String getVehicleUrl() {
  110 + return vehicleUrl;
  111 + }
  112 +
  113 + public void setVehicleUrl(String vehicleUrl) {
  114 + this.vehicleUrl = vehicleUrl;
  115 + }
  116 +
  117 + public Integer getReceivable() {
  118 + return receivable;
  119 + }
  120 +
  121 + public void setReceivable(Integer receivable) {
  122 + this.receivable = receivable;
  123 + }
  124 +
  125 + public Integer getPayType() {
  126 + return payType;
  127 + }
  128 +
  129 + public void setPayType(Integer payType) {
  130 + this.payType = payType;
  131 + }
  132 +
  133 + public String getUuid() {
  134 + return uuid;
  135 + }
  136 +
  137 + public void setUuid(String uuid) {
  138 + this.uuid = uuid;
  139 + }
  140 +}
... ...
src/main/java/com/zteits/irain/portal/vo/ebochong/receive/ResendVehicleInfoRes.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/ebochong/receive/ResendVehicleInfoRes.java
  1 +package com.zteits.irain.portal.vo.ebochong.receive;
  2 +
  3 +import com.zteits.irain.portal.vo.ebochong.receive.CommonRes;
  4 +
  5 +/**
  6 + * Copyright: Copyright (c) 2017 zteits
  7 + *
  8 + * @ClassName: com.zteits.irain.portal.vo.ebochong.receive.res
  9 + * @Description:
  10 + * @version: v1.0.0
  11 + * @author: atao
  12 + * @date: 2017/6/23 下午4:08
  13 + * Modification History:
  14 + * Date Author Version Description
  15 + * ---------------------------------------------------------*
  16 + * 2017/6/23 atao v1.0.0 创建
  17 + */
  18 +public class ResendVehicleInfoRes extends CommonRes{
  19 + //返回当前补发序号
  20 + private Integer SendNo;
  21 +
  22 + public Integer getSendNo() {
  23 + return SendNo;
  24 + }
  25 +
  26 + public void setSendNo(Integer sendNo) {
  27 + SendNo = sendNo;
  28 + }
  29 +}
... ...
src/main/java/com/zteits/irain/portal/vo/ebochong/receive/UnhandledVehicleInfoReq.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/ebochong/receive/UnhandledVehicleInfoReq.java
  1 +package com.zteits.irain.portal.vo.ebochong.receive;
  2 +
  3 +import com.zteits.irain.portal.vo.ebochong.receive.CommonReq;
  4 +
  5 +/**
  6 + * Copyright: Copyright (c) 2017 zteits
  7 + *
  8 + * @ClassName: com.zteits.irain.portal.vo.ebochong.receive.req
  9 + * @Description:
  10 + * @version: v1.0.0
  11 + * @author: atao
  12 + * @date: 2017/6/23 上午10:18
  13 + * Modification History:
  14 + * Date Author Version Description
  15 + * ---------------------------------------------------------*
  16 + * 2017/6/23 atao v1.0.0 创建
  17 + */
  18 +public class UnhandledVehicleInfoReq extends CommonReq {
  19 + //车牌号
  20 + private String plateNo;
  21 + //parkIndex
  22 + private String cardNo;
  23 + //出入口编号
  24 + private String parkIndex;
  25 + //出入口编号
  26 + private String entranceIndex;
  27 + //过车时间,时间格式:YYYY-MM-DD HH:MM:SS
  28 + private String passTime;
  29 + //(可选)入场时间,如果入场则 该字段为空,时间格式:YYYY-MM-DD HH:MM:SS
  30 + private String inTime;
  31 + //出入方向,0-入场,1-出场
  32 + private Integer carOut;
  33 + //可选)车牌图片 URL,没有图片,则为空
  34 + private String vehicleUrl;
  35 + //实际缴费金额,单位为分,不收费, 填为 0
  36 + private Integer receivable;
  37 + //缴费类型 0:停车场自收费 1:易泊充平台缴费
  38 + private Integer payType;
  39 + //车辆唯一ID
  40 + private String uuid;
  41 +
  42 + public String getPlateNo() {
  43 + return plateNo;
  44 + }
  45 +
  46 + public void setPlateNo(String plateNo) {
  47 + this.plateNo = plateNo;
  48 + }
  49 +
  50 + public String getCardNo() {
  51 + return cardNo;
  52 + }
  53 +
  54 + public void setCardNo(String cardNo) {
  55 + this.cardNo = cardNo;
  56 + }
  57 +
  58 + public String getParkIndex() {
  59 + return parkIndex;
  60 + }
  61 +
  62 + public void setParkIndex(String parkIndex) {
  63 + this.parkIndex = parkIndex;
  64 + }
  65 +
  66 + public String getEntranceIndex() {
  67 + return entranceIndex;
  68 + }
  69 +
  70 + public void setEntranceIndex(String entranceIndex) {
  71 + this.entranceIndex = entranceIndex;
  72 + }
  73 +
  74 + public String getPassTime() {
  75 + return passTime;
  76 + }
  77 +
  78 + public void setPassTime(String passTime) {
  79 + this.passTime = passTime;
  80 + }
  81 +
  82 + public String getInTime() {
  83 + return inTime;
  84 + }
  85 +
  86 + public void setInTime(String inTime) {
  87 + this.inTime = inTime;
  88 + }
  89 +
  90 + public Integer getCarOut() {
  91 + return carOut;
  92 + }
  93 +
  94 + public void setCarOut(Integer carOut) {
  95 + this.carOut = carOut;
  96 + }
  97 +
  98 + public String getVehicleUrl() {
  99 + return vehicleUrl;
  100 + }
  101 +
  102 + public void setVehicleUrl(String vehicleUrl) {
  103 + this.vehicleUrl = vehicleUrl;
  104 + }
  105 +
  106 + public Integer getReceivable() {
  107 + return receivable;
  108 + }
  109 +
  110 + public void setReceivable(Integer receivable) {
  111 + this.receivable = receivable;
  112 + }
  113 +
  114 + public Integer getPayType() {
  115 + return payType;
  116 + }
  117 +
  118 + public void setPayType(Integer payType) {
  119 + this.payType = payType;
  120 + }
  121 +
  122 + public String getUuid() {
  123 + return uuid;
  124 + }
  125 +
  126 + public void setUuid(String uuid) {
  127 + this.uuid = uuid;
  128 + }
  129 +}
... ...
src/main/java/com/zteits/irain/portal/vo/ebochong/receive/UnhandledVehicleInfoRes.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/ebochong/receive/UnhandledVehicleInfoRes.java
  1 +package com.zteits.irain.portal.vo.ebochong.receive;
  2 +
  3 +import com.zteits.irain.portal.vo.ebochong.receive.CommonRes;
  4 +
  5 +/**
  6 + * Copyright: Copyright (c) 2017 zteits
  7 + *
  8 + * @ClassName: com.zteits.irain.portal.vo.ebochong.receive.res
  9 + * @Description:
  10 + * @version: v1.0.0
  11 + * @author: atao
  12 + * @date: 2017/6/23 下午3:24
  13 + * Modification History:
  14 + * Date Author Version Description
  15 + * ---------------------------------------------------------*
  16 + * 2017/6/23 atao v1.0.0 创建
  17 + */
  18 +public class UnhandledVehicleInfoRes extends CommonRes {
  19 + //是否放行, 0 – 放行,1 – 不放行
  20 + private Integer command;
  21 +
  22 + //授权金额
  23 + private String creditLimit;
  24 +
  25 + public Integer getCommand() {
  26 + return command;
  27 + }
  28 +
  29 + public void setCommand(Integer command) {
  30 + this.command = command;
  31 + }
  32 +
  33 + public String getCreditLimit() {
  34 + return creditLimit;
  35 + }
  36 +
  37 + public void setCreditLimit(String creditLimit) {
  38 + this.creditLimit = creditLimit;
  39 + }
  40 +}
... ...
src/main/java/com/zteits/irain/portal/vo/ebochong/send/AddChargeInfoReq.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/ebochong/send/AddChargeInfoReq.java
  1 +package com.zteits.irain.portal.vo.ebochong.send;
  2 +
  3 +/**
  4 + * Copyright: Copyright (c) 2017 zteits
  5 + *
  6 + * @ClassName: com.zteits.irain.portal.vo.ebochong.send
  7 + * @Description:
  8 + * @version: v1.0.0
  9 + * @author: atao
  10 + * @date: 2017/6/23 下午6:15
  11 + * Modification History:
  12 + * Date Author Version Description
  13 + * ---------------------------------------------------------*
  14 + * 2017/6/23 atao v1.0.0 创建
  15 + */
  16 +public class AddChargeInfoReq extends CommonReq {
  17 +
  18 + //实收金额,单位为分
  19 + private Integer received;
  20 +
  21 + //入场时间 例:2016-04-15 12:22:15
  22 + private String inTime;
  23 +
  24 + //缴费时间 例:2016-04-16 12:22:15
  25 + private String chargingTime;
  26 +
  27 + //允许驶出时间 例:2016-04-16 12:32:15
  28 + private String allowTime;
  29 +
  30 + //支付宝/桑德平台
  31 + private String type;
  32 +
  33 + public Integer getReceived() {
  34 + return received;
  35 + }
  36 +
  37 + public void setReceived(Integer received) {
  38 + this.received = received;
  39 + }
  40 +
  41 + public String getInTime() {
  42 + return inTime;
  43 + }
  44 +
  45 + public void setInTime(String inTime) {
  46 + this.inTime = inTime;
  47 + }
  48 +
  49 + public String getChargingTime() {
  50 + return chargingTime;
  51 + }
  52 +
  53 + public void setChargingTime(String chargingTime) {
  54 + this.chargingTime = chargingTime;
  55 + }
  56 +
  57 + public String getAllowTime() {
  58 + return allowTime;
  59 + }
  60 +
  61 + public void setAllowTime(String allowTime) {
  62 + this.allowTime = allowTime;
  63 + }
  64 +
  65 + public String getType() {
  66 + return type;
  67 + }
  68 +
  69 + public void setType(String type) {
  70 + this.type = type;
  71 + }
  72 +}
... ...
src/main/java/com/zteits/irain/portal/vo/ebochong/send/AddChargeInfoRes.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/ebochong/send/AddChargeInfoRes.java
  1 +package com.zteits.irain.portal.vo.ebochong.send;
  2 +
  3 +/**
  4 + * Copyright: Copyright (c) 2017 zteits
  5 + *
  6 + * @ClassName: com.zteits.irain.portal.vo.ebochong.send
  7 + * @Description:
  8 + * @version: v1.0.0
  9 + * @author: atao
  10 + * @date: 2017/6/26 上午9:41
  11 + * Modification History:
  12 + * Date Author Version Description
  13 + * ---------------------------------------------------------*
  14 + * 2017/6/26 atao v1.0.0 创建
  15 + */
  16 +public class AddChargeInfoRes extends CommonRes{
  17 +
  18 +}
... ...
src/main/java/com/zteits/irain/portal/vo/ebochong/send/AddVehicleReservationReq.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/ebochong/send/AddVehicleReservationReq.java
  1 +package com.zteits.irain.portal.vo.ebochong.send;
  2 +
  3 +import com.zteits.irain.portal.vo.ebochong.send.CommonReq;
  4 +
  5 +/**
  6 + * Copyright: Copyright (c) 2017 zteits
  7 + *
  8 + * @ClassName: com.zteits.irain.portal.vo.ebochong.send.req
  9 + * @Description:
  10 + * @version: v1.0.0
  11 + * @author: atao
  12 + * @date: 2017/6/23 下午5:56
  13 + * Modification History:
  14 + * Date Author Version Description
  15 + * ---------------------------------------------------------*
  16 + * 2017/6/23 atao v1.0.0 创建
  17 + */
  18 +public class AddVehicleReservationReq extends CommonReq {
  19 + //失效时间
  20 + private String expireTime;
  21 + //预约费用
  22 + private Double fee;
  23 +
  24 + public String getExpireTime() {
  25 + return expireTime;
  26 + }
  27 +
  28 + public void setExpireTime(String expireTime) {
  29 + this.expireTime = expireTime;
  30 + }
  31 +
  32 + public Double getFee() {
  33 + return fee;
  34 + }
  35 +
  36 + public void setFee(Double fee) {
  37 + this.fee = fee;
  38 + }
  39 +}
... ...
src/main/java/com/zteits/irain/portal/vo/ebochong/send/AddVehicleReservationRes.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/ebochong/send/AddVehicleReservationRes.java
  1 +package com.zteits.irain.portal.vo.ebochong.send;
  2 +
  3 +import com.zteits.irain.portal.vo.ebochong.send.CommonRes;
  4 +
  5 +/**
  6 + * Copyright: Copyright (c) 2017 zteits
  7 + *
  8 + * @ClassName: com.zteits.irain.portal.vo.ebochong.send.res
  9 + * @Description:
  10 + * @version: v1.0.0
  11 + * @author: atao
  12 + * @date: 2017/6/23 下午5:58
  13 + * Modification History:
  14 + * Date Author Version Description
  15 + * ---------------------------------------------------------*
  16 + * 2017/6/23 atao v1.0.0 创建
  17 + */
  18 +public class AddVehicleReservationRes extends CommonRes {
  19 +
  20 +
  21 +
  22 +}
... ...
src/main/java/com/zteits/irain/portal/vo/ebochong/send/CommonReq.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/ebochong/send/CommonReq.java
  1 +package com.zteits.irain.portal.vo.ebochong.send;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +/**
  6 + * Copyright: Copyright (c) 2017 zteits
  7 + *
  8 + * @ClassName: com.zteits.irain.portal.vo.ebochong
  9 + * @Description:
  10 + * @version: v1.0.0
  11 + * @author: atao
  12 + * @date: 2017/6/23 下午3:25
  13 + * Modification History:
  14 + * Date Author Version Description
  15 + * ---------------------------------------------------------*
  16 + * 2017/6/23 atao v1.0.0 创建
  17 + */
  18 +public class CommonReq implements Serializable {
  19 + //车牌号
  20 + private String plateNo;
  21 + //停车场编号
  22 + private String parkIndex;
  23 +
  24 + public String getPlateNo() {
  25 + return plateNo;
  26 + }
  27 +
  28 + public void setPlateNo(String plateNo) {
  29 + this.plateNo = plateNo;
  30 + }
  31 +
  32 + public String getParkIndex() {
  33 + return parkIndex;
  34 + }
  35 +
  36 + public void setParkIndex(String parkIndex) {
  37 + this.parkIndex = parkIndex;
  38 + }
  39 +}
... ...
src/main/java/com/zteits/irain/portal/vo/ebochong/send/CommonRes.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/ebochong/send/CommonRes.java
  1 +package com.zteits.irain.portal.vo.ebochong.send;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +/**
  6 + * Copyright: Copyright (c) 2017 zteits
  7 + *
  8 + * @ClassName: com.zteits.irain.portal.vo.ebochong
  9 + * @Description: 公共返回
  10 + * @version: v1.0.0
  11 + * @author: atao
  12 + * @date: 2017/6/22 下午5:10
  13 + * Modification History:
  14 + * Date Author Version Description
  15 + * ---------------------------------------------------------*
  16 + * 2017/6/22 atao v1.0.0 创建
  17 + */
  18 +public class CommonRes implements Serializable {
  19 + /**
  20 + * 返回错误代码
  21 + * 必填
  22 + */
  23 + private Integer code;
  24 + /**
  25 + * 返回信息
  26 + * 非必填
  27 + */
  28 + private String message;
  29 +
  30 + public Integer getCode() {
  31 + return code;
  32 + }
  33 +
  34 + public void setCode(Integer code) {
  35 + this.code = code;
  36 + }
  37 +
  38 + public String getMessage() {
  39 + return message;
  40 + }
  41 +
  42 + public void setMessage(String message) {
  43 + this.message = message;
  44 + }
  45 +}
... ...
src/main/java/com/zteits/irain/portal/vo/ebochong/send/GetVehicleChargeReq.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/ebochong/send/GetVehicleChargeReq.java
  1 +package com.zteits.irain.portal.vo.ebochong.send;
  2 +
  3 +/**
  4 + * Copyright: Copyright (c) 2017 zteits
  5 + *
  6 + * @ClassName: com.zteits.irain.portal.vo.ebochong.send
  7 + * @Description:
  8 + * @version: v1.0.0
  9 + * @author: atao
  10 + * @date: 2017/6/23 下午6:11
  11 + * Modification History:
  12 + * Date Author Version Description
  13 + * ---------------------------------------------------------*
  14 + * 2017/6/23 atao v1.0.0 创建
  15 + */
  16 +public class GetVehicleChargeReq extends CommonReq {
  17 + //车卡号码,如果不为空以卡号为准
  18 + private String cardNo;
  19 +
  20 + public String getCardNo() {
  21 + return cardNo;
  22 + }
  23 +
  24 + public void setCardNo(String cardNo) {
  25 + this.cardNo = cardNo;
  26 + }
  27 +}
  28 +
... ...
src/main/java/com/zteits/irain/portal/vo/ebochong/send/GetVehicleChargeRes.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/ebochong/send/GetVehicleChargeRes.java
  1 +package com.zteits.irain.portal.vo.ebochong.send;
  2 +
  3 +/**
  4 + * Copyright: Copyright (c) 2017 zteits
  5 + *
  6 + * @ClassName: com.zteits.irain.portal.vo.ebochong.send
  7 + * @Description:
  8 + * @version: v1.0.0
  9 + * @author: atao
  10 + * @date: 2017/6/23 下午6:12
  11 + * Modification History:
  12 + * Date Author Version Description
  13 + * ---------------------------------------------------------*
  14 + * 2017/6/23 atao v1.0.0 创建
  15 + */
  16 +public class GetVehicleChargeRes extends CommonRes {
  17 +}
... ...
src/main/java/com/zteits/irain/portal/vo/govclouds/CenterPOIInfoVO.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/govclouds/CenterPOIInfoVO.java
  1 +package com.zteits.irain.portal.vo.govclouds;
  2 +
  3 +/**
  4 + * 中心点区域坐标和名称
  5 + *
  6 + * Copyright: Copyright (c) 2017 zteits
  7 + *
  8 + * @ClassName: CenterPOIInfoVO.java
  9 + * @Description:
  10 + * @version: v1.0.0
  11 + * @author: zhaowg
  12 + * @date: 2017年7月17日 上午9:51:45
  13 + * Modification History:
  14 + * Date Author Version Description
  15 + *---------------------------------------------------------*
  16 + * 2017年7月17日 zhaowg v1.0.0 创建
  17 + */
  18 +public class CenterPOIInfoVO {
  19 + private String name;
  20 + private Double longitude;
  21 + private Double latitude;
  22 + public String getName() {
  23 + return name;
  24 + }
  25 + public void setName(String name) {
  26 + this.name = name;
  27 + }
  28 + public Double getLongitude() {
  29 + return longitude;
  30 + }
  31 + public void setLongitude(Double longitude) {
  32 + this.longitude = longitude;
  33 + }
  34 + public Double getLatitude() {
  35 + return latitude;
  36 + }
  37 + public void setLatitude(Double latitude) {
  38 + this.latitude = latitude;
  39 + }
  40 +
  41 +}
... ...
src/main/java/com/zteits/irain/portal/vo/govclouds/ParkLotStatisticVO.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/govclouds/ParkLotStatisticVO.java
  1 +package com.zteits.irain.portal.vo.govclouds;
  2 +
  3 +public class ParkLotStatisticVO {
  4 + private String plNo;//停车场编号
  5 + private String plName;//停车场名称
  6 + private Integer totalBerthsNum;//总车位数
  7 + private Integer freeBerthsNum;//空闲车位数
  8 + private Integer useingBerthsNum;//使用中的车位数
  9 + private Integer totalGeoNum;//总地磁数
  10 + private Integer onLineGeoNum;//在线地磁数
  11 + private Integer offLineGeoNum;//离线地磁数
  12 + public String getPlNo() {
  13 + return plNo;
  14 + }
  15 + public void setPlNo(String plNo) {
  16 + this.plNo = plNo;
  17 + }
  18 + public String getPlName() {
  19 + return plName;
  20 + }
  21 + public void setPlName(String plName) {
  22 + this.plName = plName;
  23 + }
  24 + public Integer getTotalBerthsNum() {
  25 + return totalBerthsNum;
  26 + }
  27 + public void setTotalBerthsNum(Integer totalBerthsNum) {
  28 + this.totalBerthsNum = totalBerthsNum;
  29 + }
  30 + public Integer getFreeBerthsNum() {
  31 + return freeBerthsNum;
  32 + }
  33 + public void setFreeBerthsNum(Integer freeBerthsNum) {
  34 + this.freeBerthsNum = freeBerthsNum;
  35 + }
  36 + public Integer getUseingBerthsNum() {
  37 + return useingBerthsNum;
  38 + }
  39 + public void setUseingBerthsNum(Integer useingBerthsNum) {
  40 + this.useingBerthsNum = useingBerthsNum;
  41 + }
  42 + public Integer getTotalGeoNum() {
  43 + return totalGeoNum;
  44 + }
  45 + public void setTotalGeoNum(Integer totalGeoNum) {
  46 + this.totalGeoNum = totalGeoNum;
  47 + }
  48 + public Integer getOnLineGeoNum() {
  49 + return onLineGeoNum;
  50 + }
  51 + public void setOnLineGeoNum(Integer onLineGeoNum) {
  52 + this.onLineGeoNum = onLineGeoNum;
  53 + }
  54 + public Integer getOffLineGeoNum() {
  55 + return offLineGeoNum;
  56 + }
  57 + public void setOffLineGeoNum(Integer offLineGeoNum) {
  58 + this.offLineGeoNum = offLineGeoNum;
  59 + }
  60 +
  61 +}
... ...
src/main/java/com/zteits/irain/portal/vo/govclouds/ParkingBusiCircleForTypeVO.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/govclouds/ParkingBusiCircleForTypeVO.java
  1 +package com.zteits.irain.portal.vo.govclouds;
  2 +
  3 +import java.io.Serializable;
  4 +import java.math.BigDecimal;
  5 +
  6 +
  7 +public class ParkingBusiCircleForTypeVO implements Serializable{
  8 +
  9 + /**
  10 + *
  11 + */
  12 + private static final long serialVersionUID = 3152080082972168574L;
  13 +
  14 + /**停车场商圈属性:1:商场、2:医院、3:小区、4:学校、5:写字楼、6:景区、7:交通场站、8:其他*/
  15 + private Integer busiCircle;
  16 +
  17 + /**停车场商圈描述.*/
  18 + private String busiCircleName;
  19 +
  20 + /** 当前在停车数量. */
  21 + private Integer currentParkCount;
  22 +
  23 + /** 当前在停车数量对应的比例. */
  24 + private BigDecimal currentParkBate;
  25 +
  26 + public Integer getBusiCircle() {
  27 + return busiCircle;
  28 + }
  29 +
  30 + public void setBusiCircle(Integer busiCircle) {
  31 + this.busiCircle = busiCircle;
  32 + }
  33 +
  34 + public String getBusiCircleName() {
  35 + return busiCircleName;
  36 + }
  37 +
  38 + public void setBusiCircleName(String busiCircleName) {
  39 + this.busiCircleName = busiCircleName;
  40 + }
  41 +
  42 + public Integer getCurrentParkCount() {
  43 + return currentParkCount;
  44 + }
  45 +
  46 + public void setCurrentParkCount(Integer currentParkCount) {
  47 + this.currentParkCount = currentParkCount;
  48 + }
  49 +
  50 + public BigDecimal getCurrentParkBate() {
  51 + return currentParkBate;
  52 + }
  53 +
  54 + public void setCurrentParkBate(BigDecimal currentParkBate) {
  55 + this.currentParkBate = currentParkBate;
  56 + }
  57 +
  58 + @Override
  59 + public String toString() {
  60 + return "ParkingBusiCircleForTypeVO [busiCircle=" + busiCircle + ", busiCircleName=" + busiCircleName
  61 + + ", currentParkCount=" + currentParkCount + ", currentParkBate=" + currentParkBate + "]";
  62 + }
  63 +
  64 +
  65 +}
... ...
src/main/java/com/zteits/irain/portal/vo/govclouds/ParkingCountForTypeVO.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/govclouds/ParkingCountForTypeVO.java
  1 +package com.zteits.irain.portal.vo.govclouds;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +
  6 +public class ParkingCountForTypeVO implements Serializable{
  7 +
  8 + /**
  9 + *
  10 + */
  11 + private static final long serialVersionUID = 3152080082972168574L;
  12 +
  13 + /**停车场类型:1:路内(占用道路停车位),2-路外.*/
  14 + private Integer plType;
  15 +
  16 + /**停车场类型描述.*/
  17 + private String plTypeName;
  18 +
  19 + /** 当前在停车数量. */
  20 + private Integer currentParkCount;
  21 +
  22 + /**占比=路内/路内停车数量+路外停车数量.*/
  23 + private String zb;
  24 +
  25 + public Integer getPlType() {
  26 + return plType;
  27 + }
  28 +
  29 + public void setPlType(Integer plType) {
  30 + this.plType = plType;
  31 + }
  32 +
  33 + public String getPlTypeName() {
  34 + return plTypeName;
  35 + }
  36 +
  37 + public void setPlTypeName(String plTypeName) {
  38 + this.plTypeName = plTypeName;
  39 + }
  40 +
  41 + public Integer getCurrentParkCount() {
  42 + return currentParkCount;
  43 + }
  44 +
  45 + public void setCurrentParkCount(Integer currentParkCount) {
  46 + this.currentParkCount = currentParkCount;
  47 + }
  48 +
  49 +
  50 + public String getZb() {
  51 + return zb;
  52 + }
  53 +
  54 + public void setZb(String zb) {
  55 + this.zb = zb;
  56 + }
  57 +
  58 + @Override
  59 + public String toString() {
  60 + return "ParkingCountForTypeVO [plType=" + plType + ", plTypeName=" + plTypeName + ", currentParkCount="
  61 + + currentParkCount + ", zb=" + zb + "]";
  62 + }
  63 +
  64 +
  65 +
  66 +
  67 +}
... ...
src/main/java/com/zteits/irain/portal/vo/govclouds/StatisticParkLotEqpCountByCountryVO.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/govclouds/StatisticParkLotEqpCountByCountryVO.java
  1 +package com.zteits.irain.portal.vo.govclouds;
  2 +
  3 +import java.util.Map;
  4 +
  5 +public class StatisticParkLotEqpCountByCountryVO {
  6 + /**
  7 + * Map<设备名称+在线/离线,Map<区县中文名称,对应的在线/离线数量>>
  8 + */
  9 + private Map<String,Map<String,Integer>> detailEqpMap;
  10 +
  11 + /**
  12 + * Map<设备名称,Map<区县中文名称,对应的总数量>>
  13 + */
  14 + private Map<String,Map<String,Integer>> totalEqpMap;
  15 +
  16 + public Map<String, Map<String, Integer>> getDetailEqpMap() {
  17 + return detailEqpMap;
  18 + }
  19 +
  20 + public void setDetailEqpMap(Map<String, Map<String, Integer>> detailEqpMap) {
  21 + this.detailEqpMap = detailEqpMap;
  22 + }
  23 +
  24 + public Map<String, Map<String, Integer>> getTotalEqpMap() {
  25 + return totalEqpMap;
  26 + }
  27 +
  28 + public void setTotalEqpMap(Map<String, Map<String, Integer>> totalEqpMap) {
  29 + this.totalEqpMap = totalEqpMap;
  30 + }
  31 +
  32 +
  33 +}
... ...
src/main/java/com/zteits/irain/portal/vo/irain/IRainResponseVO.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/irain/IRainResponseVO.java
  1 +package com.zteits.irain.portal.vo.irain;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +import com.zteits.clouds.api.apibase.bean.ErrorCode;
  6 +
  7 +/**
  8 + *
  9 + * Copyright: Copyright (c) 2017 ZTE-ITS
  10 + *
  11 + * @ClassName: ResponseData.java
  12 + * @Description: 艾润道闸 返回封装
  13 + * @version: v1.0.0
  14 + * @author: wangbiao
  15 + * @date: 2017年4月20日 下午2:23:32
  16 + * Modification History:
  17 + * Date Author Version Description
  18 + *---------------------------------------------------------*
  19 + * 2017年4月20日 wangbiao v1.0.0 创建
  20 + */
  21 +public class IRainResponseVO implements Serializable{
  22 + private static final long serialVersionUID = 1L;
  23 + private String code;
  24 + private String message;
  25 + private Integer status;
  26 +
  27 + public IRainResponseVO(ErrorCode errorCode){
  28 + super();
  29 + this.status = 0;
  30 + this.code = errorCode.getCode();
  31 + this.message = errorCode.getMsg();
  32 + }
  33 +
  34 + public IRainResponseVO() {
  35 + this.status = 0;
  36 + }
  37 +
  38 + public String getCode() {
  39 + return code;
  40 + }
  41 +
  42 + public String getMessage() {
  43 + return message;
  44 + }
  45 +
  46 + public Integer getStatus() {
  47 + return status;
  48 + }
  49 +
  50 + public void setStatus(Integer status) {
  51 + this.status = status;
  52 + }
  53 +
  54 + @Override
  55 + public String toString() {
  56 + return "ResponseData [code=" + code + ", message=" + message
  57 + + ", status=" + status + "]";
  58 + }
  59 +}
... ...
src/main/java/com/zteits/irain/portal/vo/mobile/BizResultMobileVO.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/mobile/BizResultMobileVO.java
  1 +package com.zteits.irain.portal.vo.mobile;
  2 +
  3 +import java.io.Serializable;
  4 +/**
  5 + * 专门为手机端APP设计的统一响应码
  6 + *
  7 + * Copyright: Copyright (c) 2017 zteits
  8 + *
  9 + * @ClassName: BizResultMobileVO.java
  10 + * @Description:
  11 + * @version: v1.0.0
  12 + * @author: zhaowg
  13 + * @date: 2017年5月11日 上午10:25:57
  14 + * Modification History:
  15 + * Date Author Version Description
  16 + *---------------------------------------------------------*
  17 + * 2017年5月11日 zhaowg v1.0.0 创建
  18 + */
  19 +public class BizResultMobileVO<T> implements Serializable{
  20 +
  21 + private static final long serialVersionUID = 1L;
  22 +
  23 + private String successful;
  24 +
  25 + private String total;
  26 +
  27 + private String code;
  28 +
  29 + private String message;
  30 +
  31 + private T data;
  32 +
  33 + public String getSuccessful() {
  34 + return successful;
  35 + }
  36 +
  37 + public void setSuccessful(String successful) {
  38 + this.successful = successful;
  39 + }
  40 +
  41 + public String getTotal() {
  42 + return total;
  43 + }
  44 +
  45 + public void setTotal(String total) {
  46 + this.total = total;
  47 + }
  48 +
  49 + public String getCode() {
  50 + return code;
  51 + }
  52 +
  53 + public void setCode(String code) {
  54 + this.code = code;
  55 + }
  56 +
  57 + public String getMessage() {
  58 + return message;
  59 + }
  60 +
  61 + public void setMessage(String message) {
  62 + this.message = message;
  63 + }
  64 +
  65 + public T getData() {
  66 + return data;
  67 + }
  68 +
  69 + public void setData(T data) {
  70 + this.data = data;
  71 + }
  72 +
  73 +}
... ...
src/main/java/com/zteits/irain/portal/vo/mobile/ParkingspotVO.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/mobile/ParkingspotVO.java
  1 +package com.zteits.irain.portal.vo.mobile;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +
  7 +public class ParkingspotVO implements Serializable{
  8 +
  9 + private static final long serialVersionUID = 1L;
  10 +
  11 + @ApiModelProperty(value="停车场名称")
  12 + private String name;
  13 +
  14 + @ApiModelProperty(value="经度")
  15 + private Double longitude;
  16 +
  17 + @ApiModelProperty(value="纬度")
  18 + private Double latitude;
  19 +
  20 + @ApiModelProperty(value="服务电话")
  21 + private String phone;
  22 +
  23 + @ApiModelProperty(value="停车场类型:-1:未知,0:开放场地,1:封闭场地")
  24 + private Integer type;
  25 +
  26 + @ApiModelProperty(value="停车场编码")
  27 + private String pklNo;
  28 +
  29 + @ApiModelProperty(value="停车点地址")
  30 + private String address;
  31 +
  32 + @ApiModelProperty(value="泊位数")
  33 + private Integer totalberths;
  34 +
  35 + private String description;
  36 +
  37 + @ApiModelProperty(value="空闲车位数")
  38 + private Integer idleberths;
  39 +
  40 + @ApiModelProperty(value="费率描述")
  41 + private String ratedescription;
  42 +
  43 + @ApiModelProperty(value="距离(米)")
  44 + private Double distance;
  45 +
  46 + @ApiModelProperty(value="收费详情")
  47 + private String[] chargeDetail;
  48 +
  49 + public String[] getChargeDetail() {
  50 + return chargeDetail;
  51 + }
  52 +
  53 + public void setChargeDetail(String[] chargeDetail) {
  54 + this.chargeDetail = chargeDetail;
  55 + }
  56 +
  57 + public String getName() {
  58 + return name;
  59 + }
  60 +
  61 + public void setName(String name) {
  62 + this.name = name;
  63 + }
  64 +
  65 + public Double getLongitude() {
  66 + return longitude;
  67 + }
  68 +
  69 + public void setLongitude(Double longitude) {
  70 + this.longitude = longitude;
  71 + }
  72 +
  73 + public Double getLatitude() {
  74 + return latitude;
  75 + }
  76 +
  77 + public void setLatitude(Double latitude) {
  78 + this.latitude = latitude;
  79 + }
  80 +
  81 + public String getPhone() {
  82 + return phone;
  83 + }
  84 +
  85 + public void setPhone(String phone) {
  86 + this.phone = phone;
  87 + }
  88 +
  89 + public Integer getType() {
  90 + return type;
  91 + }
  92 +
  93 + public void setType(Integer type) {
  94 + this.type = type;
  95 + }
  96 +
  97 + public String getPklNo() {
  98 + return pklNo;
  99 + }
  100 +
  101 + public void setPklNo(String pklNo) {
  102 + this.pklNo = pklNo;
  103 + }
  104 +
  105 + public String getAddress() {
  106 + return address;
  107 + }
  108 +
  109 + public void setAddress(String address) {
  110 + this.address = address;
  111 + }
  112 +
  113 + public Integer getTotalberths() {
  114 + return totalberths;
  115 + }
  116 +
  117 + public void setTotalberths(Integer totalberths) {
  118 + this.totalberths = totalberths;
  119 + }
  120 +
  121 + public String getDescription() {
  122 + return description;
  123 + }
  124 +
  125 + public void setDescription(String description) {
  126 + this.description = description;
  127 + }
  128 +
  129 + public Integer getIdleberths() {
  130 + return idleberths;
  131 + }
  132 +
  133 + public void setIdleberths(Integer idleberths) {
  134 + this.idleberths = idleberths;
  135 + }
  136 +
  137 + public String getRatedescription() {
  138 + return ratedescription;
  139 + }
  140 +
  141 + public void setRatedescription(String ratedescription) {
  142 + this.ratedescription = ratedescription;
  143 + }
  144 +
  145 + public Double getDistance() {
  146 + return distance;
  147 + }
  148 +
  149 + public void setDistance(Double distance) {
  150 + this.distance = distance;
  151 + }
  152 +
  153 +
  154 +}
0 155 \ No newline at end of file
... ...
src/main/java/com/zteits/irain/portal/vo/parkinglotcloudplatform/datastatistic/BerthsAndFlowLineChartVO.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/parkinglotcloudplatform/datastatistic/BerthsAndFlowLineChartVO.java
  1 +package com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic;
  2 +/**
  3 + * 车位空置率和车流量统计 折线图
  4 + *
  5 + * Copyright: Copyright (c) 2017 zteits
  6 + *
  7 + * @ClassName: BerthsAndFlowLineChartVO.java
  8 + * @Description:
  9 + * @version: v1.0.0
  10 + * @author: zhaowg
  11 + * @date: 2017年6月19日 上午11:49:39
  12 + * Modification History:
  13 + * Date Author Version Description
  14 + *---------------------------------------------------------*
  15 + * 2017年6月19日 zhaowg v1.0.0 创建
  16 + */
  17 +public class BerthsAndFlowLineChartVO {
  18 +
  19 + /*车位空置率*/
  20 + private LineChartVO freeBerthRatios;
  21 + /*车流量*/
  22 + private LineChartVO vehicleFlows;
  23 + public LineChartVO getFreeBerthRatios() {
  24 + return freeBerthRatios;
  25 + }
  26 + public void setFreeBerthRatios(LineChartVO freeBerthRatios) {
  27 + this.freeBerthRatios = freeBerthRatios;
  28 + }
  29 + public LineChartVO getVehicleFlows() {
  30 + return vehicleFlows;
  31 + }
  32 + public void setVehicleFlows(LineChartVO vehicleFlows) {
  33 + this.vehicleFlows = vehicleFlows;
  34 + }
  35 +
  36 +}
... ...
src/main/java/com/zteits/irain/portal/vo/parkinglotcloudplatform/datastatistic/CustIncomeForPayTypeResVO.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/parkinglotcloudplatform/datastatistic/CustIncomeForPayTypeResVO.java
  1 +package com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic;
  2 +
  3 +import java.io.Serializable;
  4 +import java.util.ArrayList;
  5 +import java.util.List;
  6 +
  7 +/**
  8 + * Copyright: Copyright (c) 2017 zteits
  9 + *
  10 + * @ClassName: com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic
  11 + * @Description:
  12 + * @version: v1.0.0
  13 + * @author: atao
  14 + * @date: 2017/6/22 下午5:33
  15 + * Modification History:
  16 + * Date Author Version Description
  17 + * ---------------------------------------------------------*
  18 + * 2017/6/22 atao v1.0.0 创建
  19 + */
  20 +public class CustIncomeForPayTypeResVO implements Serializable {
  21 + /**
  22 + * X轴展示数据
  23 + */
  24 +
  25 + private List<String> xAxisData;
  26 + /**
  27 + * 图标标题头
  28 + */
  29 + private List<String> legendData;
  30 +
  31 + /**
  32 + * 具体数据
  33 + */
  34 + private List<ChildData> series;
  35 +
  36 + public List<String> getxAxisData() {
  37 + if (null == xAxisData) {
  38 + xAxisData = new ArrayList<>();
  39 + }
  40 + return xAxisData;
  41 + }
  42 +
  43 + public void setxAxisData(List<String> xAxisData) {
  44 + this.xAxisData = xAxisData;
  45 + }
  46 +
  47 + public List<String> getLegendData() {
  48 + if (null == legendData) {
  49 + legendData = new ArrayList<>();
  50 + }
  51 + return legendData;
  52 + }
  53 +
  54 + public void setLegendData(List<String> legendData) {
  55 + this.legendData = legendData;
  56 + }
  57 +
  58 + public List<ChildData> getSeries() {
  59 + if (null == series) {
  60 + series = new ArrayList<>();
  61 + }
  62 + return series;
  63 + }
  64 +
  65 + public void setSeries(
  66 + List<ChildData> series) {
  67 + this.series = series;
  68 + }
  69 +
  70 +
  71 + public void addLegendData(String... legendDatas){
  72 + for(String str :legendDatas){
  73 + getLegendData().add(str);
  74 + }
  75 + }
  76 +
  77 + public void addXAxisData(String strig){
  78 + getxAxisData().add(strig);
  79 + }
  80 +
  81 + public void addChildData(String name, List<String> datas) {
  82 + ChildData childData = new ChildData();
  83 + childData.setName(name);
  84 + childData.getData().addAll(datas);
  85 + getSeries().add(childData);
  86 + }
  87 +
  88 + private class ChildData implements Serializable {
  89 + /**
  90 + * 对应标题头的名称
  91 + */
  92 + private String name;
  93 + /**
  94 + * 对应标题头的数据集合
  95 + */
  96 + private List<String> data;
  97 +
  98 + public String getName() {
  99 + return name;
  100 + }
  101 +
  102 + public void setName(String name) {
  103 + this.name = name;
  104 + }
  105 +
  106 + public List<String> getData() {
  107 + if (null == data) {
  108 + data = new ArrayList<>();
  109 + }
  110 + return data;
  111 + }
  112 +
  113 + public void setData(List<String> data) {
  114 + this.data = data;
  115 + }
  116 + }
  117 +
  118 +}
... ...
src/main/java/com/zteits/irain/portal/vo/parkinglotcloudplatform/datastatistic/CustIncomeTotalParkVO.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/parkinglotcloudplatform/datastatistic/CustIncomeTotalParkVO.java
  1 +package com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic;
  2 +
  3 +import java.io.Serializable;
  4 +import java.util.ArrayList;
  5 +import java.util.List;
  6 +
  7 +/**
  8 + * Copyright: Copyright (c) 2017 zteits
  9 + *
  10 + * @ClassName: com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic
  11 + * @Description:
  12 + * @version: v1.0.0
  13 + * @author: atao
  14 + * @date: 2017/6/27 下午4:14
  15 + * Modification History:
  16 + * Date Author Version Description
  17 + * ---------------------------------------------------------*
  18 + * 2017/6/27 atao v1.0.0 创建
  19 + */
  20 +public class CustIncomeTotalParkVO implements Serializable {
  21 +
  22 + /**
  23 + * 应收金额总计(元)=待支付+已支付总金额(order_total_fee).
  24 + */
  25 + private String amountDueTotal;
  26 +
  27 + /**
  28 + * 逃逸金额.
  29 + */
  30 + private String escapeAmount;
  31 +
  32 + /**
  33 + * 实收金额总计(元)=已支付/已完成总金额(order_total_fee).
  34 + */
  35 + private String payedTotalAmount;
  36 +
  37 + /**
  38 + * 环形数据
  39 + */
  40 + private List<LoopData> loopDatas;
  41 +
  42 + public void setLoopData(Integer type, String zb) {
  43 + getLoopDatas().add(new LoopData(type, zb));
  44 + }
  45 +
  46 + public String getAmountDueTotal() {
  47 + return amountDueTotal;
  48 + }
  49 +
  50 + public void setAmountDueTotal(String amountDueTotal) {
  51 + this.amountDueTotal = amountDueTotal;
  52 + }
  53 +
  54 + public String getEscapeAmount() {
  55 + return escapeAmount;
  56 + }
  57 +
  58 + public void setEscapeAmount(String escapeAmount) {
  59 + this.escapeAmount = escapeAmount;
  60 + }
  61 +
  62 + public String getPayedTotalAmount() {
  63 + return payedTotalAmount;
  64 + }
  65 +
  66 + public void setPayedTotalAmount(String payedTotalAmount) {
  67 + this.payedTotalAmount = payedTotalAmount;
  68 + }
  69 +
  70 + public List<LoopData> getLoopDatas() {
  71 + if (null == loopDatas) {
  72 + loopDatas = new ArrayList<>();
  73 + }
  74 + return loopDatas;
  75 + }
  76 +
  77 + public void setLoopDatas(List<LoopData> loopDatas) {
  78 + this.loopDatas = loopDatas;
  79 + }
  80 +
  81 + class LoopData implements Serializable {
  82 + public LoopData(Integer type, String zb) {
  83 + this.type = type;
  84 + this.zb = zb;
  85 + }
  86 +
  87 + //类型
  88 + private Integer type;
  89 + //占比
  90 + private String zb;
  91 +
  92 + public Integer getType() {
  93 + return type;
  94 + }
  95 +
  96 + public void setType(Integer type) {
  97 + this.type = type;
  98 + }
  99 +
  100 + public String getZb() {
  101 + return zb;
  102 + }
  103 +
  104 + public void setZb(String zb) {
  105 + this.zb = zb;
  106 + }
  107 + }
  108 +
  109 +}
... ...
src/main/java/com/zteits/irain/portal/vo/parkinglotcloudplatform/datastatistic/CustIncomeTotalVO.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/parkinglotcloudplatform/datastatistic/CustIncomeTotalVO.java
  1 +package com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic;
  2 +
  3 +import java.io.Serializable;
  4 +import java.math.BigDecimal;
  5 +
  6 +/**
  7 + * Copyright: Copyright (c) 2017 zteits
  8 + *
  9 + * @ClassName: com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic
  10 + * @Description:
  11 + * @version: v1.0.0
  12 + * @author: atao
  13 + * @date: 2017/6/27 下午4:51
  14 + * Modification History:
  15 + * Date Author Version Description
  16 + * ---------------------------------------------------------*
  17 + * 2017/6/27 atao v1.0.0 创建
  18 + */
  19 +public class CustIncomeTotalVO implements Serializable {
  20 +
  21 +
  22 + /**应收金额总计(元)=待支付+已支付总金额(order_total_fee).*/
  23 + private String amountDueTotal;
  24 +
  25 + /**逃逸金额.*/
  26 + private String escapeAmount;
  27 +
  28 + /**实收金额总计(元)=已支付/已完成总金额(order_total_fee).*/
  29 + private String payedTotalAmount;
  30 +
  31 + public String getAmountDueTotal() {
  32 + return amountDueTotal;
  33 + }
  34 +
  35 + public void setAmountDueTotal(String amountDueTotal) {
  36 + this.amountDueTotal = amountDueTotal;
  37 + }
  38 +
  39 + public String getEscapeAmount() {
  40 + return escapeAmount;
  41 + }
  42 +
  43 + public void setEscapeAmount(String escapeAmount) {
  44 + this.escapeAmount = escapeAmount;
  45 + }
  46 +
  47 + public String getPayedTotalAmount() {
  48 + return payedTotalAmount;
  49 + }
  50 +
  51 + public void setPayedTotalAmount(String payedTotalAmount) {
  52 + this.payedTotalAmount = payedTotalAmount;
  53 + }
  54 +}
... ...
src/main/java/com/zteits/irain/portal/vo/parkinglotcloudplatform/datastatistic/LineChartVO.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/parkinglotcloudplatform/datastatistic/LineChartVO.java
  1 +package com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic;
  2 +
  3 +import java.util.List;
  4 +
  5 +/**
  6 + * 折线图VO
  7 + *
  8 + * Copyright: Copyright (c) 2017 zteits
  9 + *
  10 + * @ClassName: LineChartVO.java
  11 + * @Description:
  12 + * @version: v1.0.0
  13 + * @author: zhaowg
  14 + * @date: 2017年6月19日 上午11:00:17
  15 + * Modification History:
  16 + * Date Author Version Description
  17 + *---------------------------------------------------------*
  18 + * 2017年6月19日 zhaowg v1.0.0 创建
  19 + */
  20 +public class LineChartVO {
  21 +
  22 + private List<String> xAxisData;
  23 +
  24 + private List<String> legendData;
  25 +
  26 + private List<SerieVO> series;
  27 +
  28 +
  29 + public List<String> getxAxisData() {
  30 + return xAxisData;
  31 + }
  32 +
  33 +
  34 + public void setxAxisData(List<String> xAxisData) {
  35 + this.xAxisData = xAxisData;
  36 + }
  37 +
  38 +
  39 + public List<String> getLegendData() {
  40 + return legendData;
  41 + }
  42 +
  43 +
  44 + public void setLegendData(List<String> legendData) {
  45 + this.legendData = legendData;
  46 + }
  47 +
  48 +
  49 + public List<SerieVO> getSeries() {
  50 + return series;
  51 + }
  52 +
  53 +
  54 + public void setSeries(List<SerieVO> series) {
  55 + this.series = series;
  56 + }
  57 +
  58 +
  59 + public static class SerieVO{
  60 +
  61 + private String name;
  62 +
  63 + private List<Integer> data;
  64 +
  65 + public String getName() {
  66 + return name;
  67 + }
  68 +
  69 + public void setName(String name) {
  70 + this.name = name;
  71 + }
  72 +
  73 + public List<Integer> getData() {
  74 + return data;
  75 + }
  76 +
  77 + public void setData(List<Integer> data) {
  78 + this.data = data;
  79 + }
  80 +
  81 + }
  82 +}
... ...
src/main/java/com/zteits/irain/portal/vo/parkinglotcloudplatform/datastatistic/OrderTransactionDetails.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/parkinglotcloudplatform/datastatistic/OrderTransactionDetails.java
  1 +/**
  2 + *
  3 + */
  4 +package com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic;
  5 +
  6 +import java.math.BigDecimal;
  7 +
  8 +/**
  9 + * @author hxz
  10 + *
  11 + */
  12 +public class OrderTransactionDetails {
  13 + private String paidTime;
  14 + private String orderNo;
  15 + private String parkinglotName;
  16 + private String plateNumber;
  17 + private String inTime;
  18 + private String outTime;
  19 + private Integer stayLong;
  20 + private String chargeRule;
  21 + private Integer payKind;
  22 + private BigDecimal amountDue;
  23 + private BigDecimal coupon;
  24 + private BigDecimal redEnvelope;
  25 + private BigDecimal paidAmount;
  26 + /**
  27 + * @return the paidTime
  28 + */
  29 + public String getPaidTime() {
  30 + return paidTime;
  31 + }
  32 + /**
  33 + * @param paidTime the paidTime to set
  34 + */
  35 + public void setPaidTime(String paidTime) {
  36 + this.paidTime = paidTime;
  37 + }
  38 + /**
  39 + * @return the orderNo
  40 + */
  41 + public String getOrderNo() {
  42 + return orderNo;
  43 + }
  44 + /**
  45 + * @param orderNo the orderNo to set
  46 + */
  47 + public void setOrderNo(String orderNo) {
  48 + this.orderNo = orderNo;
  49 + }
  50 + /**
  51 + * @return the parkinglotName
  52 + */
  53 + public String getParkinglotName() {
  54 + return parkinglotName;
  55 + }
  56 + /**
  57 + * @param parkinglotName the parkinglotName to set
  58 + */
  59 + public void setParkinglotName(String parkinglotName) {
  60 + this.parkinglotName = parkinglotName;
  61 + }
  62 + /**
  63 + * @return the plateNumber
  64 + */
  65 + public String getPlateNumber() {
  66 + return plateNumber;
  67 + }
  68 + /**
  69 + * @param plateNumber the plateNumber to set
  70 + */
  71 + public void setPlateNumber(String plateNumber) {
  72 + this.plateNumber = plateNumber;
  73 + }
  74 + /**
  75 + * @return the inTime
  76 + */
  77 + public String getInTime() {
  78 + return inTime;
  79 + }
  80 + /**
  81 + * @param inTime the inTime to set
  82 + */
  83 + public void setInTime(String inTime) {
  84 + this.inTime = inTime;
  85 + }
  86 + /**
  87 + * @return the outTime
  88 + */
  89 + public String getOutTime() {
  90 + return outTime;
  91 + }
  92 + /**
  93 + * @param outTime the outTime to set
  94 + */
  95 + public void setOutTime(String outTime) {
  96 + this.outTime = outTime;
  97 + }
  98 + /**
  99 + * @return the stayLong
  100 + */
  101 + public Integer getStayLong() {
  102 + return stayLong;
  103 + }
  104 + /**
  105 + * @param stayLong the stayLong to set
  106 + */
  107 + public void setStayLong(Integer stayLong) {
  108 + this.stayLong = stayLong;
  109 + }
  110 + /**
  111 + * @return the chargeRule
  112 + */
  113 + public String getChargeRule() {
  114 + return chargeRule;
  115 + }
  116 + /**
  117 + * @param chargeRule the chargeRule to set
  118 + */
  119 + public void setChargeRule(String chargeRule) {
  120 + this.chargeRule = chargeRule;
  121 + }
  122 + /**
  123 + * @return the payKind
  124 + */
  125 + public Integer getPayKind() {
  126 + return payKind;
  127 + }
  128 + /**
  129 + * @param payKind the payKind to set
  130 + */
  131 + public void setPayKind(Integer payKind) {
  132 + this.payKind = payKind;
  133 + }
  134 + /**
  135 + * @return the amountDue
  136 + */
  137 + public BigDecimal getAmountDue() {
  138 + return amountDue;
  139 + }
  140 + /**
  141 + * @param amountDue the amountDue to set
  142 + */
  143 + public void setAmountDue(BigDecimal amountDue) {
  144 + this.amountDue = amountDue;
  145 + }
  146 + /**
  147 + * @return the coupon
  148 + */
  149 + public BigDecimal getCoupon() {
  150 + return coupon;
  151 + }
  152 + /**
  153 + * @param coupon the coupon to set
  154 + */
  155 + public void setCoupon(BigDecimal coupon) {
  156 + this.coupon = coupon;
  157 + }
  158 + /**
  159 + * @return the redEnvelope
  160 + */
  161 + public BigDecimal getRedEnvelope() {
  162 + return redEnvelope;
  163 + }
  164 + /**
  165 + * @param redEnvelope the redEnvelope to set
  166 + */
  167 + public void setRedEnvelope(BigDecimal redEnvelope) {
  168 + this.redEnvelope = redEnvelope;
  169 + }
  170 + /**
  171 + * @return the paidAmount
  172 + */
  173 + public BigDecimal getPaidAmount() {
  174 + return paidAmount;
  175 + }
  176 + /**
  177 + * @param paidAmount the paidAmount to set
  178 + */
  179 + public void setPaidAmount(BigDecimal paidAmount) {
  180 + this.paidAmount = paidAmount;
  181 + }
  182 +
  183 +}
... ...
src/main/java/com/zteits/irain/portal/vo/parkinglotcloudplatform/datastatistic/ParkingPlaceStatisticRatio.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/parkinglotcloudplatform/datastatistic/ParkingPlaceStatisticRatio.java
  1 +/**
  2 + *
  3 + */
  4 +package com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic;
  5 +
  6 +/**
  7 + * @author hxz
  8 + *
  9 + */
  10 +public class ParkingPlaceStatisticRatio {
  11 + private String dateStr;
  12 + private String freeRatio;
  13 + private String turnover;
  14 +
  15 + /**
  16 + * @return the dateStr
  17 + */
  18 + public String getDateStr() {
  19 + return dateStr;
  20 + }
  21 + /**
  22 + * @param dateStr the dateStr to set
  23 + */
  24 + public void setDateStr(String dateStr) {
  25 + this.dateStr = dateStr;
  26 + }
  27 + /**
  28 + * @return the freeRatio
  29 + */
  30 + public String getFreeRatio() {
  31 + return freeRatio;
  32 + }
  33 + /**
  34 + * @param freeRatio the freeRatio to set
  35 + */
  36 + public void setFreeRatio(String freeRatio) {
  37 + this.freeRatio = freeRatio;
  38 + }
  39 + /**
  40 + * @return the turnover
  41 + */
  42 + public String getTurnover() {
  43 + return turnover;
  44 + }
  45 + /**
  46 + * @param turnover the turnover to set
  47 + */
  48 + public void setTurnover(String turnover) {
  49 + this.turnover = turnover;
  50 + }
  51 +}
... ...
src/main/java/com/zteits/irain/portal/vo/parkinglotcloudplatform/datastatistic/StatisticRatioSummary.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/parkinglotcloudplatform/datastatistic/StatisticRatioSummary.java
  1 +/**
  2 + *
  3 + */
  4 +package com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic;
  5 +
  6 +/**
  7 + * @author hxz
  8 + *
  9 + */
  10 +public class StatisticRatioSummary {
  11 + private String maxFreeRatio;
  12 + private String minFreeRatio;
  13 + private String maxTurnoverRatio;
  14 + private String minTurnoverRatio;
  15 + private Integer totalCount;
  16 +
  17 + /**
  18 + * @return the maxFreeRatio
  19 + */
  20 + public String getMaxFreeRatio() {
  21 + return maxFreeRatio;
  22 + }
  23 + /**
  24 + * @param maxFreeRatio the maxFreeRatio to set
  25 + */
  26 + public void setMaxFreeRatio(String maxFreeRatio) {
  27 + this.maxFreeRatio = maxFreeRatio;
  28 + }
  29 + /**
  30 + * @return the minFreeRatio
  31 + */
  32 + public String getMinFreeRatio() {
  33 + return minFreeRatio;
  34 + }
  35 + /**
  36 + * @param minFreeRatio the minFreeRatio to set
  37 + */
  38 + public void setMinFreeRatio(String minFreeRatio) {
  39 + this.minFreeRatio = minFreeRatio;
  40 + }
  41 + /**
  42 + * @return the maxTurnoverRatio
  43 + */
  44 + public String getMaxTurnoverRatio() {
  45 + return maxTurnoverRatio;
  46 + }
  47 + /**
  48 + * @param maxTurnoverRatio the maxTurnoverRatio to set
  49 + */
  50 + public void setMaxTurnoverRatio(String maxTurnoverRatio) {
  51 + this.maxTurnoverRatio = maxTurnoverRatio;
  52 + }
  53 + /**
  54 + * @return the minTurnoverRatio
  55 + */
  56 + public String getMinTurnoverRatio() {
  57 + return minTurnoverRatio;
  58 + }
  59 + /**
  60 + * @param minTurnoverRatio the minTurnoverRatio to set
  61 + */
  62 + public void setMinTurnoverRatio(String minTurnoverRatio) {
  63 + this.minTurnoverRatio = minTurnoverRatio;
  64 + }
  65 + /**
  66 + * @return the totalCount
  67 + */
  68 + public Integer getTotalCount() {
  69 + return totalCount;
  70 + }
  71 + /**
  72 + * @param totalCount the totalCount to set
  73 + */
  74 + public void setTotalCount(Integer totalCount) {
  75 + this.totalCount = totalCount;
  76 + }
  77 +
  78 +}
... ...
src/main/java/com/zteits/irain/portal/vo/parkinglotcloudplatform/datastatistic/TransactionRecord.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/parkinglotcloudplatform/datastatistic/TransactionRecord.java
  1 +/**
  2 + *
  3 + */
  4 +package com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic;
  5 +
  6 +import java.math.BigDecimal;
  7 +
  8 +/**
  9 + * @author hxz
  10 + *
  11 + */
  12 +public class TransactionRecord {
  13 + private String ID;
  14 + private String createTime;
  15 + private String parkinglotName;
  16 + private String plateNumber;
  17 + private String orderNo;
  18 + private String chargeRule;
  19 + private Integer payKind;
  20 + private BigDecimal amount;
  21 + private Integer status;
  22 + /**
  23 + * @return the iD
  24 + */
  25 + public String getID() {
  26 + return ID;
  27 + }
  28 + /**
  29 + * @param iD the iD to set
  30 + */
  31 + public void setID(String iD) {
  32 + ID = iD;
  33 + }
  34 + /**
  35 + * @return the createTime
  36 + */
  37 + public String getCreateTime() {
  38 + return createTime;
  39 + }
  40 + /**
  41 + * @param createTime the createTime to set
  42 + */
  43 + public void setCreateTime(String createTime) {
  44 + this.createTime = createTime;
  45 + }
  46 + /**
  47 + * @return the parkinglotName
  48 + */
  49 + public String getParkinglotName() {
  50 + return parkinglotName;
  51 + }
  52 + /**
  53 + * @param parkinglotName the parkinglotName to set
  54 + */
  55 + public void setParkinglotName(String parkinglotName) {
  56 + this.parkinglotName = parkinglotName;
  57 + }
  58 + /**
  59 + * @return the plateNumber
  60 + */
  61 + public String getPlateNumber() {
  62 + return plateNumber;
  63 + }
  64 + /**
  65 + * @param plateNumber the plateNumber to set
  66 + */
  67 + public void setPlateNumber(String plateNumber) {
  68 + this.plateNumber = plateNumber;
  69 + }
  70 + /**
  71 + * @return the orderNo
  72 + */
  73 + public String getOrderNo() {
  74 + return orderNo;
  75 + }
  76 + /**
  77 + * @param orderNo the orderNo to set
  78 + */
  79 + public void setOrderNo(String orderNo) {
  80 + this.orderNo = orderNo;
  81 + }
  82 + /**
  83 + * @return the chargeRule
  84 + */
  85 + public String getChargeRule() {
  86 + return chargeRule;
  87 + }
  88 + /**
  89 + * @param chargeRule the chargeRule to set
  90 + */
  91 + public void setChargeRule(String chargeRule) {
  92 + this.chargeRule = chargeRule;
  93 + }
  94 + /**
  95 + * @return the payKind
  96 + */
  97 + public Integer getPayKind() {
  98 + return payKind;
  99 + }
  100 + /**
  101 + * @param payKind the payKind to set
  102 + */
  103 + public void setPayKind(Integer payKind) {
  104 + this.payKind = payKind;
  105 + }
  106 + /**
  107 + * @return the amount
  108 + */
  109 + public BigDecimal getAmount() {
  110 + return amount;
  111 + }
  112 + /**
  113 + * @param amount the amount to set
  114 + */
  115 + public void setAmount(BigDecimal amount) {
  116 + this.amount = amount;
  117 + }
  118 + /**
  119 + * @return the status
  120 + */
  121 + public Integer getStatus() {
  122 + return status;
  123 + }
  124 + /**
  125 + * @param status the status to set
  126 + */
  127 + public void setStatus(Integer status) {
  128 + this.status = status;
  129 + }
  130 +}
... ...
src/main/java/com/zteits/irain/portal/vo/parkinglotcloudplatform/datastatistic/TransactionRequestObject.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/parkinglotcloudplatform/datastatistic/TransactionRequestObject.java
  1 +/**
  2 + *
  3 + */
  4 +package com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic;
  5 +
  6 +/**
  7 + * @author hxz
  8 + *
  9 + */
  10 +public class TransactionRequestObject {
  11 + private String beginTime;
  12 + private String endTime;
  13 + private String parkinglotID;
  14 + private Integer payKind;
  15 + private Integer recKind;
  16 + private Integer pageNum;
  17 + private Integer recsCount;
  18 + /**
  19 + * @return the beginTime
  20 + */
  21 + public String getBeginTime() {
  22 + return beginTime;
  23 + }
  24 + /**
  25 + * @param beginTime the beginTime to set
  26 + */
  27 + public void setBeginTime(String beginTime) {
  28 + this.beginTime = beginTime;
  29 + }
  30 + /**
  31 + * @return the endTime
  32 + */
  33 + public String getEndTime() {
  34 + return endTime;
  35 + }
  36 + /**
  37 + * @param endTime the endTime to set
  38 + */
  39 + public void setEndTime(String endTime) {
  40 + this.endTime = endTime;
  41 + }
  42 + /**
  43 + * @return the parkinglotID
  44 + */
  45 + public String getParkinglotID() {
  46 + return parkinglotID;
  47 + }
  48 + /**
  49 + * @param parkinglotID the parkinglotID to set
  50 + */
  51 + public void setParkinglotID(String parkinglotID) {
  52 + this.parkinglotID = parkinglotID;
  53 + }
  54 + /**
  55 + * @return the payKind
  56 + */
  57 + public Integer getPayKind() {
  58 + return payKind;
  59 + }
  60 + /**
  61 + * @param payKind the payKind to set
  62 + */
  63 + public void setPayKind(Integer payKind) {
  64 + this.payKind = payKind;
  65 + }
  66 + /**
  67 + * @return the recKind
  68 + */
  69 + public Integer getRecKind() {
  70 + return recKind;
  71 + }
  72 + /**
  73 + * @param recKind the recKind to set
  74 + */
  75 + public void setRecKind(Integer recKind) {
  76 + this.recKind = recKind;
  77 + }
  78 + /**
  79 + * @return the pageNum
  80 + */
  81 + public Integer getPageNum() {
  82 + return pageNum;
  83 + }
  84 + /**
  85 + * @param pageNum the pageNum to set
  86 + */
  87 + public void setPageNum(Integer pageNum) {
  88 + this.pageNum = pageNum;
  89 + }
  90 + /**
  91 + * @return the recsCount
  92 + */
  93 + public Integer getRecsCount() {
  94 + return recsCount;
  95 + }
  96 + /**
  97 + * @param recsCount the recsCount to set
  98 + */
  99 + public void setRecsCount(Integer recsCount) {
  100 + this.recsCount = recsCount;
  101 + }
  102 +}
... ...
src/main/java/com/zteits/irain/portal/vo/parkinglotcloudplatform/datastatistic/TransactionStatisticSummary.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/parkinglotcloudplatform/datastatistic/TransactionStatisticSummary.java
  1 +/**
  2 + *
  3 + */
  4 +package com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic;
  5 +
  6 +import java.math.BigDecimal;
  7 +
  8 +/**
  9 + * @author hxz
  10 + *
  11 + */
  12 +public class TransactionStatisticSummary {
  13 + private Integer transactionsNum;
  14 + private BigDecimal amountDueTotal;
  15 + private BigDecimal amountOfReliefTotal;
  16 + private Integer escapeCount;
  17 + private BigDecimal paidAmountTotal;
  18 + private Integer totalCount;
  19 +
  20 + /**
  21 + * @return the transactionsNum
  22 + */
  23 + public Integer getTransactionsNum() {
  24 + return transactionsNum;
  25 + }
  26 + /**
  27 + * @param transactionsNum the transactionsNum to set
  28 + */
  29 + public void setTransactionsNum(Integer transactionsNum) {
  30 + this.transactionsNum = transactionsNum;
  31 + }
  32 + /**
  33 + * @return the amountDueTotal
  34 + */
  35 + public BigDecimal getAmountDueTotal() {
  36 + return amountDueTotal;
  37 + }
  38 + /**
  39 + * @param amountDueTotal the amountDueTotal to set
  40 + */
  41 + public void setAmountDueTotal(BigDecimal amountDueTotal) {
  42 + this.amountDueTotal = amountDueTotal;
  43 + }
  44 + /**
  45 + * @return the amountOfReliefTotal
  46 + */
  47 + public BigDecimal getAmountOfReliefTotal() {
  48 + return amountOfReliefTotal;
  49 + }
  50 + /**
  51 + * @param amountOfReliefTotal the amountOfReliefTotal to set
  52 + */
  53 + public void setAmountOfReliefTotal(BigDecimal amountOfReliefTotal) {
  54 + this.amountOfReliefTotal = amountOfReliefTotal;
  55 + }
  56 + /**
  57 + * @return the escapeCount
  58 + */
  59 + public Integer getEscapeCount() {
  60 + return escapeCount;
  61 + }
  62 + /**
  63 + * @param escapeCount the escapeCount to set
  64 + */
  65 + public void setEscapeCount(Integer escapeCount) {
  66 + this.escapeCount = escapeCount;
  67 + }
  68 + /**
  69 + * @return the paidAmountTotal
  70 + */
  71 + public BigDecimal getPaidAmountTotal() {
  72 + return paidAmountTotal;
  73 + }
  74 + /**
  75 + * @param paidAmountTotal the paidAmountTotal to set
  76 + */
  77 + public void setPaidAmountTotal(BigDecimal paidAmountTotal) {
  78 + this.paidAmountTotal = paidAmountTotal;
  79 + }
  80 + /**
  81 + * @return the totalCount
  82 + */
  83 + public Integer getTotalCount() {
  84 + return totalCount;
  85 + }
  86 + /**
  87 + * @param totalCount the totalCount to set
  88 + */
  89 + public void setTotalCount(Integer totalCount) {
  90 + this.totalCount = totalCount;
  91 + }
  92 +}
0 93 \ No newline at end of file
... ...
src/main/java/com/zteits/irain/portal/vo/parkinglotdatacenter/BerthSpaceRatioVO.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/parkinglotdatacenter/BerthSpaceRatioVO.java
  1 +package com.zteits.irain.portal.vo.parkinglotdatacenter;
  2 +
  3 +import java.util.List;
  4 +
  5 +
  6 +/**
  7 + *
  8 + * 车位配比
  9 + * Copyright: Copyright (c) 2017 zteits
  10 + *
  11 + * @ClassName: BerthSpaceRatioVO.java
  12 + * @Description:
  13 + * @version: v1.0.0
  14 + * @author: langlw
  15 + * @date: 2017年7月11日 下午6:43:47
  16 + * Modification History:
  17 + * Date Author Version Description
  18 + *---------------------------------------------------------*
  19 + * 2017年7月11日 langlw v1.0.0 创建
  20 + */
  21 +public class BerthSpaceRatioVO {
  22 +
  23 + private List<BerthSeriesVO> berthSpaceRatio;
  24 + public static class BerthSeriesVO{
  25 +
  26 + private String name;
  27 +
  28 + private Double data;
  29 +
  30 +
  31 +
  32 +
  33 + public String getName() {
  34 + return name;
  35 + }
  36 +
  37 + public void setName(String name) {
  38 + this.name = name;
  39 + }
  40 +
  41 + public Double getData() {
  42 + return data;
  43 + }
  44 +
  45 + public void setData(Double data) {
  46 + this.data = data;
  47 + }
  48 +
  49 +
  50 +
  51 + }
  52 + public List<BerthSeriesVO> getBerthSpaceRatio() {
  53 + return berthSpaceRatio;
  54 + }
  55 + public void setBerthSpaceRatio(List<BerthSeriesVO> berthSpaceRatio) {
  56 + this.berthSpaceRatio = berthSpaceRatio;
  57 + }
  58 +
  59 +
  60 +}
... ...
src/main/java/com/zteits/irain/portal/vo/parkinglotdatacenter/ParkLotAndBerthsCountVO.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/parkinglotdatacenter/ParkLotAndBerthsCountVO.java
  1 +package com.zteits.irain.portal.vo.parkinglotdatacenter;
  2 +
  3 +import java.util.List;
  4 +import java.util.Map;
  5 +
  6 +
  7 +/**
  8 + *
  9 + * 停车场数量和停车位数量 vo
  10 + * Copyright: Copyright (c) 2017 zteits
  11 + *
  12 + * @ClassName: ColumnChartVO.java
  13 + * @Description:
  14 + * @version: v1.0.0
  15 + * @author: langlw
  16 + * @date: 2017年7月6日 下午3:50:17
  17 + * Modification History:
  18 + * Date Author Version Description
  19 + *---------------------------------------------------------*
  20 + * 2017年7月6日 langlw v1.0.0 创建
  21 + */
  22 +public class ParkLotAndBerthsCountVO {
  23 + //key:区县名称,value:车位数
  24 + private Map<String,Integer> pkberthsCount;
  25 + //key:区县名称,value:停车场数
  26 + private Map<String,Integer> pkCount;
  27 + public Map<String, Integer> getPkberthsCount() {
  28 + return pkberthsCount;
  29 + }
  30 + public void setPkberthsCount(Map<String, Integer> pkberthsCount) {
  31 + this.pkberthsCount = pkberthsCount;
  32 + }
  33 + public Map<String, Integer> getPkCount() {
  34 + return pkCount;
  35 + }
  36 + public void setPkCount(Map<String, Integer> pkCount) {
  37 + this.pkCount = pkCount;
  38 + }
  39 +
  40 +
  41 +}
... ...
src/main/java/com/zteits/irain/portal/vo/parkinglotdatacenter/guide/FirstGuideInfoVO.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/parkinglotdatacenter/guide/FirstGuideInfoVO.java
  1 +package com.zteits.irain.portal.vo.parkinglotdatacenter.guide;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.List;
  5 +
  6 +/**
  7 + * Copyright: Copyright (c) 2017 zteits
  8 + *
  9 + * @ClassName: com.zteits.irain.portal.vo.parkinglotdatacenter.guide
  10 + * @Description: 一级诱导展示信息
  11 + * @version: v1.0.0
  12 + * @author: atao
  13 + * @date: 2017/7/11 下午3:27
  14 + * Modification History:
  15 + * Date Author Version Description
  16 + * ---------------------------------------------------------*
  17 + * 2017/7/11 atao v1.0.0 创建
  18 + */
  19 +public class FirstGuideInfoVO extends GuideInfoVO {
  20 + /**
  21 + * 一级诱导展示图片路径
  22 + */
  23 + private String filePath;
  24 +
  25 + private List<GuideFirstConfigDetail> configs;
  26 +
  27 + public String getFilePath() {
  28 + return filePath;
  29 + }
  30 +
  31 + public void setFilePath(String filePath) {
  32 + this.filePath = filePath;
  33 + }
  34 +
  35 + public List<GuideFirstConfigDetail> getConfigs() {
  36 + return configs;
  37 + }
  38 +
  39 + public void setConfigs(
  40 + List<GuideFirstConfigDetail> configs) {
  41 + this.configs = configs;
  42 + }
  43 +
  44 + public void setConfigs(String plNo, Integer plNameHeight, Integer plNameWidth, Integer freeHeight,
  45 + Integer freeWidth, Integer freeNum, Integer allBerthNum) {
  46 + if (null == configs) {
  47 + configs = new ArrayList<>();
  48 + }
  49 + configs.add(new GuideFirstConfigDetail(plNo, plNameHeight, plNameWidth, freeHeight,
  50 + freeWidth, freeNum, allBerthNum));
  51 + }
  52 +
  53 + class GuideFirstConfigDetail {
  54 + public GuideFirstConfigDetail(String plNo, Integer plNameHeight, Integer plNameWidth, Integer freeHeight,
  55 + Integer freeWidth, Integer freeNum, Integer allBerthNum) {
  56 + this.plNo = plNo;
  57 + this.plNameHeight = plNameHeight;
  58 + this.plNameWidth = plNameWidth;
  59 + this.freeHeight = freeHeight;
  60 + this.freeWidth = freeWidth;
  61 + this.freeNum = freeNum;
  62 + this.allBerthNum = allBerthNum;
  63 + }
  64 +
  65 + /**
  66 + * 所属停车场编码.
  67 + */
  68 + private String plNo;
  69 +
  70 + /**
  71 + * 距离左上角顶点 停车场名称高度 单位:像素.
  72 + */
  73 + private Integer plNameHeight;
  74 +
  75 + /**
  76 + * 距离左上角顶点 停车场名称宽度 单位:像素.
  77 + */
  78 + private Integer plNameWidth;
  79 +
  80 + /**
  81 + * 距离左上角顶点 空余停车位高度 单位:像素.
  82 + */
  83 + private Integer freeHeight;
  84 +
  85 + /**
  86 + * 距离左上角顶点 空余停车位宽度 单位:像素.
  87 + */
  88 + private Integer freeWidth;
  89 +
  90 + /**
  91 + * 空余车位数
  92 + */
  93 + private Integer freeNum;
  94 +
  95 + /**
  96 + * 停车场停车位总量
  97 + */
  98 + private Integer allBerthNum;
  99 +
  100 + public String getPlNo() {
  101 + return plNo;
  102 + }
  103 +
  104 + public void setPlNo(String plNo) {
  105 + this.plNo = plNo;
  106 + }
  107 +
  108 + public Integer getPlNameHeight() {
  109 + return plNameHeight;
  110 + }
  111 +
  112 + public void setPlNameHeight(Integer plNameHeight) {
  113 + this.plNameHeight = plNameHeight;
  114 + }
  115 +
  116 + public Integer getPlNameWidth() {
  117 + return plNameWidth;
  118 + }
  119 +
  120 + public void setPlNameWidth(Integer plNameWidth) {
  121 + this.plNameWidth = plNameWidth;
  122 + }
  123 +
  124 + public Integer getFreeHeight() {
  125 + return freeHeight;
  126 + }
  127 +
  128 + public void setFreeHeight(Integer freeHeight) {
  129 + this.freeHeight = freeHeight;
  130 + }
  131 +
  132 + public Integer getFreeWidth() {
  133 + return freeWidth;
  134 + }
  135 +
  136 + public void setFreeWidth(Integer freeWidth) {
  137 + this.freeWidth = freeWidth;
  138 + }
  139 +
  140 + public Integer getFreeNum() {
  141 + return freeNum;
  142 + }
  143 +
  144 + public void setFreeNum(Integer freeNum) {
  145 + this.freeNum = freeNum;
  146 + }
  147 +
  148 + public Integer getAllBerthNum() {
  149 + return allBerthNum;
  150 + }
  151 +
  152 + public void setAllBerthNum(Integer allBerthNum) {
  153 + this.allBerthNum = allBerthNum;
  154 + }
  155 + }
  156 +}
... ...
src/main/java/com/zteits/irain/portal/vo/parkinglotdatacenter/guide/GuideInfoVO.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/parkinglotdatacenter/guide/GuideInfoVO.java
  1 +package com.zteits.irain.portal.vo.parkinglotdatacenter.guide;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +/**
  6 + * Copyright: Copyright (c) 2017 zteits
  7 + *
  8 + * @ClassName: com.zteits.irain.portal.vo.parkinglotdatacenter.guide
  9 + * @Description: 诱导屏基础信息
  10 + * @version: v1.0.0
  11 + * @author: atao
  12 + * @date: 2017/7/11 下午3:21
  13 + * Modification History:
  14 + * Date Author Version Description
  15 + * ---------------------------------------------------------*
  16 + * 2017/7/11 atao v1.0.0 创建
  17 + */
  18 +public class GuideInfoVO implements Serializable {
  19 + /**
  20 + * 诱导屏编码
  21 + */
  22 + private String guideNo;
  23 +
  24 + /**
  25 + * 诱导屏级别
  26 + */
  27 + private Integer level;
  28 +
  29 + public String getGuideNo() {
  30 + return guideNo;
  31 + }
  32 +
  33 + public void setGuideNo(String guideNo) {
  34 + this.guideNo = guideNo;
  35 + }
  36 +
  37 + public Integer getLevel() {
  38 + return level;
  39 + }
  40 +
  41 + public void setLevel(Integer level) {
  42 + this.level = level;
  43 + }
  44 +}
... ...
src/main/java/com/zteits/irain/portal/vo/parkinglotdatacenter/guide/SecondGuideInfoVO.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/parkinglotdatacenter/guide/SecondGuideInfoVO.java
  1 +package com.zteits.irain.portal.vo.parkinglotdatacenter.guide;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.List;
  5 +
  6 +/**
  7 + * Copyright: Copyright (c) 2017 zteits
  8 + *
  9 + * @ClassName: com.zteits.irain.portal.vo.parkinglotdatacenter.guide
  10 + * @Description:
  11 + * @version: v1.0.0
  12 + * @author: atao
  13 + * @date: 2017/7/11 下午3:33
  14 + * Modification History:
  15 + * Date Author Version Description
  16 + * ---------------------------------------------------------*
  17 + * 2017/7/11 atao v1.0.0 创建
  18 + */
  19 +public class SecondGuideInfoVO extends GuideInfoVO {
  20 +
  21 + /**
  22 + * 二级诱导屏详细信息
  23 + */
  24 + List<GuideDetail> guideInfos;
  25 +
  26 + public List<GuideDetail> getGuideInfos() {
  27 + return guideInfos;
  28 + }
  29 +
  30 + public void setGuideInfos(List<GuideDetail> guideInfos) {
  31 + this.guideInfos = guideInfos;
  32 + }
  33 +
  34 + public void addGuideDetail(String plNo, String plName, Integer freeNum, Integer guidePoint) {
  35 + if (null == guideInfos) {
  36 + guideInfos = new ArrayList<>();
  37 + }
  38 + GuideDetail guideDetail = new GuideDetail(plNo, plName, freeNum, guidePoint);
  39 + guideInfos.add(guideDetail);
  40 +
  41 + }
  42 +
  43 +}
  44 +
  45 +class GuideDetail {
  46 +
  47 + /**
  48 + * 停车场编码
  49 + */
  50 + private String plNo;
  51 +
  52 + /**
  53 + * 停车场名称
  54 + */
  55 + private String plName;
  56 + /**
  57 + * 空余车位数
  58 + */
  59 + private Integer freeNum;
  60 +
  61 + /**
  62 + * 诱导指向
  63 + */
  64 + private Integer guidePoint;
  65 +
  66 + public GuideDetail() {
  67 + }
  68 +
  69 + public GuideDetail(String plNo, String plName, Integer freeNum, Integer guidePoint) {
  70 + this.plNo = plNo;
  71 + this.plName = plName;
  72 + this.freeNum = freeNum;
  73 + this.guidePoint = guidePoint;
  74 + }
  75 +
  76 + public String getPlNo() {
  77 + return plNo;
  78 + }
  79 +
  80 + public void setPlNo(String plNo) {
  81 + this.plNo = plNo;
  82 + }
  83 +
  84 + public String getPlName() {
  85 + return plName;
  86 + }
  87 +
  88 + public void setPlName(String plName) {
  89 + this.plName = plName;
  90 + }
  91 +
  92 + public Integer getFreeNum() {
  93 + return freeNum;
  94 + }
  95 +
  96 + public void setFreeNum(Integer freeNum) {
  97 + this.freeNum = freeNum;
  98 + }
  99 +
  100 + public Integer getGuidePoint() {
  101 + return guidePoint;
  102 + }
  103 +
  104 + public void setGuidePoint(Integer guidePoint) {
  105 + this.guidePoint = guidePoint;
  106 + }
  107 +}
  108 +
  109 +
... ...
src/main/java/com/zteits/irain/portal/vo/parkinglotdatacenter/guide/ThirdGuidInfoVO.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/parkinglotdatacenter/guide/ThirdGuidInfoVO.java
  1 +package com.zteits.irain.portal.vo.parkinglotdatacenter.guide;
  2 +
  3 +/**
  4 + * Copyright: Copyright (c) 2017 zteits
  5 + *
  6 + * @ClassName: com.zteits.irain.portal.vo.parkinglotdatacenter.guide
  7 + * @Description:
  8 + * @version: v1.0.0
  9 + * @author: atao
  10 + * @date: 2017/7/11 下午3:52
  11 + * Modification History:
  12 + * Date Author Version Description
  13 + * ---------------------------------------------------------*
  14 + * 2017/7/11 atao v1.0.0 创建
  15 + */
  16 +public class ThirdGuidInfoVO extends GuideInfoVO {
  17 +
  18 + /**
  19 + * 空余车位数
  20 + */
  21 + private Integer freeNum;
  22 +
  23 + /**
  24 + * 限高:0-不限,1-限高.
  25 + */
  26 + private Integer highLimitStatus;
  27 +
  28 + /**
  29 + * 限高:单位米.
  30 + */
  31 + private Integer highLimitNum;
  32 +
  33 + /**
  34 + * 急转弯:0-不是,1-是.
  35 + */
  36 + private Integer sharpTurnStatus;
  37 +
  38 + /**
  39 + * 0:12小时制 1:24小时制.
  40 + */
  41 + private String timeSystem;
  42 +
  43 + /**
  44 + * 停车场楼层位置状态 0-无,1-有
  45 + */
  46 + private Integer floorStatus;
  47 + /**
  48 + * 停车场楼层位置
  49 + */
  50 + private String floor;
  51 +
  52 + public Integer getFreeNum() {
  53 + return freeNum;
  54 + }
  55 +
  56 + public void setFreeNum(Integer freeNum) {
  57 + this.freeNum = freeNum;
  58 + }
  59 +
  60 + public Integer getHighLimitStatus() {
  61 + return highLimitStatus;
  62 + }
  63 +
  64 + public void setHighLimitStatus(Integer highLimitStatus) {
  65 + this.highLimitStatus = highLimitStatus;
  66 + }
  67 +
  68 + public Integer getHighLimitNum() {
  69 + return highLimitNum;
  70 + }
  71 +
  72 + public void setHighLimitNum(Integer highLimitNum) {
  73 + this.highLimitNum = highLimitNum;
  74 + }
  75 +
  76 + public Integer getSharpTurnStatus() {
  77 + return sharpTurnStatus;
  78 + }
  79 +
  80 + public void setSharpTurnStatus(Integer sharpTurnStatus) {
  81 + this.sharpTurnStatus = sharpTurnStatus;
  82 + }
  83 +
  84 + public String getTimeSystem() {
  85 + return timeSystem;
  86 + }
  87 +
  88 + public void setTimeSystem(String timeSystem) {
  89 + this.timeSystem = timeSystem;
  90 + }
  91 +
  92 + public Integer getFloorStatus() {
  93 + return floorStatus;
  94 + }
  95 +
  96 + public void setFloorStatus(Integer floorStatus) {
  97 + this.floorStatus = floorStatus;
  98 + }
  99 +
  100 + public String getFloor() {
  101 + return floor;
  102 + }
  103 +
  104 + public void setFloor(String floor) {
  105 + this.floor = floor;
  106 + }
  107 +}
... ...
src/main/java/com/zteits/irain/portal/vo/qingdao/RespondMessage.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/qingdao/RespondMessage.java
  1 +/**
  2 + *
  3 + */
  4 +package com.zteits.irain.portal.vo.qingdao;
  5 +
  6 +/**
  7 + * @author hxz
  8 + *
  9 + */
  10 +public class RespondMessage {
  11 + private String status;
  12 + private String errorCode;
  13 +
  14 + /**
  15 + * @return the status
  16 + */
  17 + public String getStatus() {
  18 + return status;
  19 + }
  20 + /**
  21 + * @param status the status to set
  22 + */
  23 + public void setStatus(String status) {
  24 + this.status = status;
  25 + }
  26 + /**
  27 + * @return the errorCode
  28 + */
  29 + public String getErrorCode() {
  30 + return errorCode;
  31 + }
  32 + /**
  33 + * @param errorCode the errorCode to set
  34 + */
  35 + public void setErrorCode(String errorCode) {
  36 + this.errorCode = errorCode;
  37 + }
  38 +}
... ...
src/main/java/com/zteits/irain/portal/vo/qingdao/eqppossync/GeoTotalNumSyncReq.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/qingdao/eqppossync/GeoTotalNumSyncReq.java
  1 +package com.zteits.irain.portal.vo.qingdao.eqppossync;
  2 +
  3 +import java.util.List;
  4 +
  5 +public class GeoTotalNumSyncReq {
  6 + private Integer numonline;
  7 +
  8 + private Integer numoffline;
  9 +
  10 + private List<String> parkingNolist;
  11 +
  12 + public Integer getNumonline() {
  13 + return numonline;
  14 + }
  15 +
  16 + public void setNumonline(Integer numonline) {
  17 + this.numonline = numonline;
  18 + }
  19 +
  20 + public Integer getNumoffline() {
  21 + return numoffline;
  22 + }
  23 +
  24 + public void setNumoffline(Integer numoffline) {
  25 + this.numoffline = numoffline;
  26 + }
  27 +
  28 + public List<String> getParkingNolist() {
  29 + return parkingNolist;
  30 + }
  31 +
  32 + public void setParkingNolist(List<String> parkingNolist) {
  33 + this.parkingNolist = parkingNolist;
  34 + }
  35 +
  36 +}
... ...
src/main/java/com/zteits/irain/portal/vo/qingdao/eqppossync/PosTotalNumSyncReq.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/qingdao/eqppossync/PosTotalNumSyncReq.java
  1 +package com.zteits.irain.portal.vo.qingdao.eqppossync;
  2 +
  3 +public class PosTotalNumSyncReq {
  4 + private Integer numinuse;
  5 +
  6 + private Integer numunused;
  7 +
  8 + public Integer getNuminuse() {
  9 + return numinuse;
  10 + }
  11 +
  12 + public void setNuminuse(Integer numinuse) {
  13 + this.numinuse = numinuse;
  14 + }
  15 +
  16 + public Integer getNumunused() {
  17 + return numunused;
  18 + }
  19 +
  20 + public void setNumunused(Integer numunused) {
  21 + this.numunused = numunused;
  22 + }
  23 +
  24 +
  25 +}
... ...
src/main/java/com/zteits/irain/portal/vo/qingdao/inoutpark/QDInOutParkReq.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/vo/qingdao/inoutpark/QDInOutParkReq.java
  1 +package com.zteits.irain.portal.vo.qingdao.inoutpark;
  2 +/**
  3 + * 青岛进出场上报对应报文
  4 + *
  5 + * Copyright: Copyright (c) 2017 zteits
  6 + *
  7 + * @ClassName: QDInOutParkReq.java
  8 + * @Description:
  9 + * @version: v1.0.0
  10 + * @author: zhaowg
  11 + * @date: 2017年6月22日 下午2:36:04
  12 + * Modification History:
  13 + * Date Author Version Description
  14 + *---------------------------------------------------------*
  15 + * 2017年6月22日 zhaowg v1.0.0 创建
  16 + */
  17 +public class QDInOutParkReq {
  18 + /**
  19 + * 车牌编号
  20 + */
  21 + private String vehicleNo;
  22 + private String inOut;
  23 + private String inTime;
  24 + private String outTime;
  25 + /**
  26 + * 进出场图片
  27 + */
  28 + private String inImageName;
  29 + /**
  30 + * 车场编号
  31 + */
  32 + private String parkinglotNo;
  33 + /**
  34 + * 订单编号
  35 + */
  36 + private String orderNo;
  37 + /**
  38 + * 付款金额
  39 + */
  40 + private Float amount;
  41 + /**
  42 + * 应付金额
  43 + */
  44 + private Float recAmount;
  45 + /**
  46 + * 空闲车位
  47 + */
  48 + private Integer free;
  49 + /**
  50 + * 支付类型
  51 + */
  52 + private Integer payType;
  53 + private String description;
  54 + /**
  55 + * 车位编码
  56 + */
  57 + private String parkingNo;
  58 +
  59 + public String getVehicleNo() {
  60 + return vehicleNo;
  61 + }
  62 + public void setVehicleNo(String vehicleNo) {
  63 + this.vehicleNo = vehicleNo;
  64 + }
  65 + public String getInOut() {
  66 + return inOut;
  67 + }
  68 + public void setInOut(String inOut) {
  69 + this.inOut = inOut;
  70 + }
  71 + public String getInTime() {
  72 + return inTime;
  73 + }
  74 + public void setInTime(String inTime) {
  75 + this.inTime = inTime;
  76 + }
  77 + public String getOutTime() {
  78 + return outTime;
  79 + }
  80 + public void setOutTime(String outTime) {
  81 + this.outTime = outTime;
  82 + }
  83 + public String getInImageName() {
  84 + return inImageName;
  85 + }
  86 + public void setInImageName(String inImageName) {
  87 + this.inImageName = inImageName;
  88 + }
  89 + public String getParkinglotNo() {
  90 + return parkinglotNo;
  91 + }
  92 + public void setParkinglotNo(String parkinglotNo) {
  93 + this.parkinglotNo = parkinglotNo;
  94 + }
  95 + public String getOrderNo() {
  96 + return orderNo;
  97 + }
  98 + public void setOrderNo(String orderNo) {
  99 + this.orderNo = orderNo;
  100 + }
  101 +
  102 + public Float getAmount() {
  103 + return amount;
  104 + }
  105 + public void setAmount(Float amount) {
  106 + this.amount = amount;
  107 + }
  108 + public Float getRecAmount() {
  109 + return recAmount;
  110 + }
  111 + public void setRecAmount(Float recAmount) {
  112 + this.recAmount = recAmount;
  113 + }
  114 + public Integer getFree() {
  115 + return free;
  116 + }
  117 + public void setFree(Integer free) {
  118 + this.free = free;
  119 + }
  120 +
  121 + public Integer getPayType() {
  122 + return payType;
  123 + }
  124 + public void setPayType(Integer payType) {
  125 + this.payType = payType;
  126 + }
  127 + public String getDescription() {
  128 + return description;
  129 + }
  130 + public void setDescription(String description) {
  131 + this.description = description;
  132 + }
  133 + public String getParkingNo() {
  134 + return parkingNo;
  135 + }
  136 + public void setParkingNo(String parkingNo) {
  137 + this.parkingNo = parkingNo;
  138 + }
  139 +}
... ...
src/main/java/com/zteits/irain/portal/web/HomeController.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/web/HomeController.java
  1 +package com.zteits.irain.portal.web;
  2 +
  3 +import com.clouds.common.annotation.NoAuth;
  4 +import org.springframework.stereotype.Controller;
  5 +import org.springframework.web.bind.annotation.RequestMapping;
  6 +
  7 +@Controller
  8 +@NoAuth(desc = "swagger api接口显示 无需权限校验")
  9 +public class HomeController {
  10 + @RequestMapping("/")
  11 + public String home() {
  12 + return "redirect:swagger-ui.html";
  13 + }
  14 +}
... ...
src/main/java/com/zteits/irain/portal/web/InductionController.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/web/InductionController.java
  1 +package com.zteits.irain.portal.web;
  2 +
  3 +import org.springframework.beans.factory.annotation.Autowired;
  4 +import org.springframework.web.bind.annotation.PostMapping;
  5 +import org.springframework.web.bind.annotation.RequestBody;
  6 +import org.springframework.web.bind.annotation.RequestMapping;
  7 +import org.springframework.web.bind.annotation.RequestParam;
  8 +import org.springframework.web.bind.annotation.RestController;
  9 +
  10 +import com.clouds.common.web.vo.BizResultVO;
  11 +import com.zteits.irain.portal.service.interfaces.induction.InductionService;
  12 +import com.zteits.irain.portal.service.interfaces.induction.param.DoLevelTwoAndThreeInductionReleaseBatchRequest;
  13 +
  14 +import io.swagger.annotations.Api;
  15 +import io.swagger.annotations.ApiOperation;
  16 +import io.swagger.annotations.ApiParam;
  17 +@Api(value = "诱导服务",description="诱导服务")
  18 +@RestController
  19 +@RequestMapping("induction")
  20 +public class InductionController {
  21 + @Autowired
  22 + private InductionService inductionService;
  23 +
  24 + @ApiOperation("二级、三级诱导批量发布")
  25 + @PostMapping("doLevelTwoAndThreeInductionReleaseBatch")
  26 + public BizResultVO<?> doLevelTwoAndThreeInductionReleaseBatch(@RequestBody DoLevelTwoAndThreeInductionReleaseBatchRequest request){
  27 + BizResultVO<?> bizResultVO = inductionService.doLevelTwoAndThreeInductionReleaseBatch(request);
  28 + return bizResultVO;
  29 + }
  30 +
  31 + @ApiOperation("一级诱导发布回显")
  32 + @PostMapping("showLevelOneInductionRelease")
  33 + public BizResultVO<?> showLevelOneInductionRelease(@ApiParam("诱导设备编号")@RequestParam String eqpCode){
  34 + BizResultVO<?> bizResultVO = inductionService.showLevelOneInductionRelease(eqpCode);
  35 + return bizResultVO;
  36 + }
  37 +}
... ...
src/main/java/com/zteits/irain/portal/web/RefreshCacheController.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/web/RefreshCacheController.java
  1 +package com.zteits.irain.portal.web;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.List;
  5 +
  6 +import org.slf4j.Logger;
  7 +import org.slf4j.LoggerFactory;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.web.bind.annotation.PostMapping;
  10 +import org.springframework.web.bind.annotation.RequestParam;
  11 +import org.springframework.web.bind.annotation.RestController;
  12 +
  13 +import com.clouds.common.cache.park.ParkFreeBerthsCacheUtil;
  14 +import com.clouds.common.web.vo.BizResultVO;
  15 +import com.zteits.clouds.api.apibase.bean.BizResult;
  16 +import com.zteits.clouds.api.dto.park.param.RefreshParkCacheRequest;
  17 +import com.zteits.clouds.api.dto.sys.param.RefreshSysCacheRequest;
  18 +import com.zteits.clouds.api.service.park.RefreshParkCacheService;
  19 +import com.zteits.clouds.api.service.sys.RefreshSysCacheService;
  20 +import com.zteits.irain.portal.service.impl.induction.InductionServiceImpl;
  21 +import com.zteits.irain.portal.service.interfaces.induction.InductionService;
  22 +import com.zteits.irain.portal.service.interfaces.induction.param.DoLevelTwoAndThreeInductionReleaseBatchRequest;
  23 +import com.zteits.irain.portal.service.interfaces.induction.param.InductionRelease;
  24 +
  25 +import io.swagger.annotations.Api;
  26 +import io.swagger.annotations.ApiOperation;
  27 +import io.swagger.annotations.ApiParam;
  28 +
  29 +/**
  30 + * 刷新缓存
  31 + *
  32 + * Copyright: Copyright (c) 2017 zteits
  33 + *
  34 + * @ClassName: RefreshCacheController.java
  35 + * @Description:
  36 + * @version: v1.0.0
  37 + * @author: zhaowg
  38 + * @date: 2017年7月10日 下午2:42:04
  39 + * Modification History:
  40 + * Date Author Version Description
  41 + *---------------------------------------------------------*
  42 + * 2017年7月10日 zhaowg v1.0.0 创建
  43 + */
  44 +@Api(value="刷新缓存",description="刷新缓存")
  45 +@RestController
  46 +public class RefreshCacheController{
  47 + private static final Logger logger = LoggerFactory.getLogger(RefreshCacheController.class);
  48 +
  49 + @Autowired
  50 + private RefreshParkCacheService refreshParkCacheService;
  51 + @Autowired
  52 + private RefreshSysCacheService refreshSysCacheService ;
  53 + @Autowired
  54 + private InductionService inductionService;
  55 +
  56 + @ApiOperation(value="刷新PARK缓存")
  57 + @PostMapping("refreshParkCache")
  58 + public BizResultVO<String> RefreshParkCacheService(@RequestParam @ApiParam("-1:全部刷新;2:刷新停车场信息;3:刷新经纬度信息;4:刷新空闲车位信息;5:刷新艾润停车场编号对应关系")Integer type){
  59 + RefreshParkCacheRequest request = new RefreshParkCacheRequest();
  60 + request.setSysCode("PARK");
  61 + request.setType(type);
  62 + BizResult<String> bizResult = refreshParkCacheService.refreshCache(request );
  63 + return new BizResultVO<String>(bizResult);
  64 +
  65 + }
  66 + @ApiOperation(value="刷新SYS缓存")
  67 + @PostMapping("refreshSysCache")
  68 + public BizResultVO<String> RefreshSysCacheService(@RequestParam @ApiParam("-1:全部刷新;1:刷新字典表")Integer type){
  69 + RefreshSysCacheRequest request = new RefreshSysCacheRequest();
  70 + request.setSysCode("PARK");
  71 + request.setType(type);
  72 + BizResult<String> bizResult = refreshSysCacheService.refreshSysCache(request );
  73 + return new BizResultVO<String>(bizResult);
  74 + }
  75 +
  76 + @ApiOperation("更新空闲车位数")
  77 + @PostMapping("updateFreeBerths")
  78 + public BizResultVO<Integer> UpdateFreeBerths(@RequestParam @ApiParam("停车场编号") String plNo,
  79 + @RequestParam @ApiParam("空闲车位数")Integer freeBerths){
  80 + logger.info("更新空闲车位数,车位编码:"+plNo+" 空闲车位数:"+freeBerths);
  81 + ParkFreeBerthsCacheUtil.setFreeBerthsByPlNo(plNo, freeBerths);
  82 + DoLevelTwoAndThreeInductionReleaseBatchRequest releaseBatchRequest = new DoLevelTwoAndThreeInductionReleaseBatchRequest();
  83 + List<InductionRelease> list = new ArrayList<>();
  84 + //传固定值
  85 + InductionRelease inductionRelease = new InductionRelease();
  86 + inductionRelease.setOwner_code("1001");
  87 + inductionRelease.setRange_code(plNo);
  88 + inductionRelease.setBerth_left(String.valueOf(freeBerths));
  89 + inductionRelease.setParking_code(plNo);
  90 + list.add(inductionRelease);
  91 + releaseBatchRequest.setJsonStr(list);
  92 + BizResultVO<?> bizResultVO = inductionService.doLevelTwoAndThreeInductionReleaseBatch(releaseBatchRequest );
  93 + //查询空闲车位数
  94 + Integer integer = ParkFreeBerthsCacheUtil.getFreeBerthsByPlNo(plNo);
  95 + return new BizResultVO<Integer>().setData(integer);
  96 +
  97 + }
  98 +}
... ...
src/main/java/com/zteits/irain/portal/web/ebochong/receive/EBoChongReceiveController.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/web/ebochong/receive/EBoChongReceiveController.java
  1 +package com.zteits.irain.portal.web.ebochong.receive;
  2 +
  3 +import java.io.BufferedReader;
  4 +import java.io.IOException;
  5 +
  6 +import javax.servlet.http.HttpServletRequest;
  7 +import javax.servlet.http.HttpServletResponse;
  8 +
  9 +import com.alibaba.fastjson.JSONObject;
  10 +
  11 +import com.clouds.common.utils.EBoChongAESUtil;
  12 +import com.clouds.common.utils.ResultUtils;
  13 +import com.xiaoleilu.hutool.date.DateUtil;
  14 +import com.zteits.clouds.api.apibase.bean.BaseInfo;
  15 +import com.zteits.clouds.api.apibase.bean.BizResult;
  16 +import com.zteits.clouds.api.dto.park.dto.ParkingLotDTO;
  17 +import com.zteits.clouds.api.dto.park.param.FreeBerthNumUpdateByFreeBerthNumRequest;
  18 +import com.zteits.clouds.api.dto.park.param.InParkingRequest;
  19 +import com.zteits.clouds.api.dto.park.param.InterfaceLogSaveRequest;
  20 +import com.zteits.clouds.api.dto.park.param.OutParkingRequest;
  21 +import com.zteits.clouds.api.dto.park.param.QueryParkLotInfoByPkNoRequest;
  22 +import com.zteits.clouds.api.service.park.IInOutParkingService;
  23 +import com.zteits.clouds.api.service.park.InterfaceLogService;
  24 +import com.zteits.clouds.api.service.park.ParkFreeBerthService;
  25 +import com.zteits.clouds.api.service.park.ParkingLotQueryService;
  26 +import com.zteits.irain.portal.constant.ParkConstant.InterfaceLog;
  27 +import com.zteits.irain.portal.constant.ParkConstant.InterfaceLog.Type;
  28 +import com.zteits.irain.portal.vo.ebochong.EBoChongEnum;
  29 +import com.zteits.irain.portal.vo.ebochong.receive.ChargeListReq;
  30 +import com.zteits.irain.portal.vo.ebochong.receive.ChargeListRes;
  31 +import com.zteits.irain.portal.vo.ebochong.receive.CommonRes;
  32 +import com.zteits.irain.portal.vo.ebochong.receive.HandledVehicleInfoReq;
  33 +import com.zteits.irain.portal.vo.ebochong.receive.HandledVehicleInfoRes;
  34 +import com.zteits.irain.portal.vo.ebochong.receive.RemainingInfoReq;
  35 +import com.zteits.irain.portal.vo.ebochong.receive.RemainingInfoRes;
  36 +import com.zteits.irain.portal.vo.ebochong.receive.ResendVehicleInfoReq;
  37 +import com.zteits.irain.portal.vo.ebochong.receive.ResendVehicleInfoRes;
  38 +import com.zteits.irain.portal.vo.ebochong.receive.UnhandledVehicleInfoReq;
  39 +import com.zteits.irain.portal.vo.ebochong.receive.UnhandledVehicleInfoRes;
  40 +import io.swagger.annotations.Api;
  41 +import io.swagger.annotations.ApiOperation;
  42 +import org.slf4j.Logger;
  43 +import org.slf4j.LoggerFactory;
  44 +import org.springframework.beans.factory.annotation.Autowired;
  45 +import org.springframework.beans.factory.annotation.Value;
  46 +import org.springframework.util.StringUtils;
  47 +import org.springframework.web.bind.annotation.PostMapping;
  48 +import org.springframework.web.bind.annotation.RequestMapping;
  49 +import org.springframework.web.bind.annotation.RestController;
  50 +
  51 +/**
  52 + * Copyright: Copyright (c) 2017 zteits
  53 + *
  54 + * @ClassName: com.zteits.irain.portal.web.ebochong.receive
  55 + * @Description: 易泊冲 数据接收 接口
  56 + * @version: v1.0.0
  57 + * @author: atao
  58 + * @date: 2017/6/22 下午4:57
  59 + * Modification History:
  60 + * Date Author Version Description
  61 + * ---------------------------------------------------------*
  62 + * 2017/6/22 atao v1.0.0 创建
  63 + */
  64 +@Api(value = "杰商上报接口")
  65 +@RestController
  66 +@RequestMapping("/ebochong")
  67 +public class EBoChongReceiveController {
  68 +
  69 + @Value("${project.syscode}")
  70 + private String sysCode;
  71 +
  72 + @Autowired
  73 + private ParkFreeBerthService parkFreeBerthService;
  74 + @Autowired
  75 + private IInOutParkingService iInOutParkingService;
  76 + @Autowired
  77 + private ParkingLotQueryService parkingLotQueryService;
  78 +
  79 + @Autowired
  80 + private InterfaceLogService interfaceLogService;
  81 +
  82 + @Value("${ebochong.key}")
  83 + private String key;
  84 +
  85 + private static final Logger logger = LoggerFactory.getLogger(EBoChongReceiveController.class);
  86 +
  87 + @ApiOperation("发送未处理过车信息")
  88 + @PostMapping("/SendUnhandledVehicleInfo")
  89 + public void SendUnhandledVehicleInfo(HttpServletRequest request, HttpServletResponse response) {
  90 + String data = getRequestBody(request);
  91 + logger.info("===发送未处理过车信息 data={}", data);
  92 + try {
  93 + data = EBoChongAESUtil.decryptAES(data, key);
  94 + } catch (Exception e) {
  95 + e.printStackTrace();
  96 + }
  97 + logger.info("===发送未处理过车信息 解密后data={}", data);
  98 + UnhandledVehicleInfoReq req = JSONObject.parseObject(data, UnhandledVehicleInfoReq.class);
  99 + logger.info("===发送未处理过车信息 格式化对象 req={}", JSONObject.toJSONString(req));
  100 +
  101 + UnhandledVehicleInfoRes res = new UnhandledVehicleInfoRes();
  102 + res.setCommand(EBoChongEnum.COMMAND_GO.val());
  103 + res.setCreditLimit("100");
  104 + res.setMessage("测试");
  105 + logger.info("===发送未处理过车信息 res={}", JSONObject.toJSONString(res));
  106 + setResponse(response, res);
  107 + }
  108 +
  109 + @ApiOperation("发送已处理过车信息")
  110 + @PostMapping("/SendHandledVehicleInfo")
  111 + public void SendHandledVehicleInfo(HttpServletRequest request, HttpServletResponse response) {
  112 +
  113 + BaseInfo baseInfo = new BaseInfo();
  114 + String requestId = baseInfo.getRequestId();
  115 + String entryReq = getRequestBody(request);
  116 + logger.info("===发送已处理过车信息 data={}", entryReq);
  117 + String data = EBoChongAESUtil.decryptAES(entryReq, key);
  118 + logger.info("===发送已处理过车信息 解密后data={}", data);
  119 + HandledVehicleInfoReq req = JSONObject.parseObject(data, HandledVehicleInfoReq.class);
  120 + logger.info("===发送已处理过车信息 格式化对象 req={}", JSONObject.toJSONString(req));
  121 +
  122 + //记录日志
  123 + InterfaceLogSaveRequest logSaveRequest = new InterfaceLogSaveRequest(sysCode, baseInfo,
  124 + InterfaceLog.Type.TYPE_IN_PARKING, data, InterfaceLog.FromType.JIESHANG);
  125 + //设置未解密的字符串
  126 + logSaveRequest.setEncryptParam(entryReq);
  127 + //设置未同步
  128 + logSaveRequest.setSyncStatus(1);
  129 +
  130 + if (req.getCarOut() == 0) {
  131 + logSaveRequest.setType(InterfaceLog.Type.TYPE_IN_PARKING);
  132 + //入场
  133 + InParkingRequest inParkingRequest = new InParkingRequest();
  134 + inParkingRequest.setSysCode("123456");
  135 + inParkingRequest.setCardno(req.getCardNo());
  136 + inParkingRequest.setFreeBerths(req.getRemaining());
  137 + inParkingRequest.setFromType(4);
  138 + inParkingRequest.setInArmCode("");
  139 + inParkingRequest.setInTime(DateUtil.parse(req.getInTime()));
  140 + inParkingRequest.setParkCode(req.getParkIndex());
  141 + inParkingRequest.setRecordId(req.getUuid());
  142 + inParkingRequest.setPlNo(req.getParkIndex());
  143 + inParkingRequest.setVplNumber(req.getPlateNo());
  144 + inParkingRequest.setPlName(queryParkingLotNameByPlNo(req.getParkIndex()));
  145 + logger.info("===调用dubbo服务停车记录保存 dubboReq={}", JSONObject.toJSONString(inParkingRequest));
  146 + BizResult<Long> bizResult = iInOutParkingService.SaveIRainInParking(inParkingRequest);
  147 + logger.info("===调用dubbo服务停车记录保存 dubboRes={}", JSONObject.toJSONString(bizResult));
  148 + } else {
  149 + logSaveRequest.setType(Type.TYPE_OUT_PARKING);
  150 + //出场
  151 + OutParkingRequest outParkingRequest = new OutParkingRequest();
  152 + outParkingRequest.setSysCode("123456");
  153 + outParkingRequest.setCardno(req.getCardNo());
  154 + outParkingRequest.setFreeBerths(req.getRemaining());
  155 + outParkingRequest.setFromType(4);
  156 + outParkingRequest.setInTime(DateUtil.parse(req.getInTime()));
  157 + outParkingRequest.setParkCode(req.getParkIndex());
  158 + outParkingRequest.setRecordId(req.getUuid());
  159 + outParkingRequest.setPlNo(req.getParkIndex());
  160 + outParkingRequest.setVplNumber(req.getPlateNo());
  161 + outParkingRequest.setPlName(queryParkingLotNameByPlNo(req.getParkIndex()));
  162 + logger.info("===调用dubbo服务停车记录保存 dubboReq={}", JSONObject.toJSONString(outParkingRequest));
  163 + BizResult<Long> bizResult = iInOutParkingService.SaveIRainOutParking(outParkingRequest);
  164 + logger.info("===调用dubbo服务停车记录保存 dubboRes={}", JSONObject.toJSONString(bizResult));
  165 + }
  166 +
  167 + HandledVehicleInfoRes res = new HandledVehicleInfoRes();
  168 + res.setMessage("测试");
  169 + res.setCode(EBoChongEnum.CODE_SUCCESS.val());
  170 + logger.info("===发送已处理过车信息 res={}", JSONObject.toJSONString(res));
  171 +
  172 + try {
  173 + FreeBerthNumUpdateByFreeBerthNumRequest dubboReq = new FreeBerthNumUpdateByFreeBerthNumRequest();
  174 + dubboReq.setPlNo(req.getParkIndex());
  175 + dubboReq.setFreeBerthNum(req.getRemaining());
  176 + dubboReq.setSysCode("123456");
  177 + logger.info("===调用dubbo服务更新空余车位信息 dubboReq={}", JSONObject.toJSONString(dubboReq));
  178 + BizResult<Integer> result = parkFreeBerthService.updateFreeBerthNumByFreeBerthNum(dubboReq);
  179 + logger.info("===调用dubbo服务更新空余车位信息 dubboRes={}", JSONObject.toJSONString(result));
  180 + //保存接口日志
  181 + interfaceLogService.SaveInterfaceLog(logSaveRequest);
  182 + } catch (Exception e) {
  183 + logger.info("===更新空余车位数捕获异常", e);
  184 + }
  185 +
  186 + setResponse(response, res);
  187 +
  188 + }
  189 +
  190 + @ApiOperation("发送剩余停车位信息")
  191 + @PostMapping("/SendRemainingInfo")
  192 + public void SendRemainingInfo(HttpServletRequest request, HttpServletResponse response) {
  193 + String data = getRequestBody(request);
  194 + logger.info("===发送剩余停车位信息 data={}", data);
  195 + data = EBoChongAESUtil.decryptAES(data, key);
  196 + logger.info("===发送剩余停车位信息 解密后data={}", data);
  197 + RemainingInfoReq req = JSONObject.parseObject(data, RemainingInfoReq.class);
  198 + logger.info("===发送剩余停车位信息 格式化对象 req={}", JSONObject.toJSONString(req));
  199 + FreeBerthNumUpdateByFreeBerthNumRequest dubboReq = new FreeBerthNumUpdateByFreeBerthNumRequest();
  200 + dubboReq.setPlNo(req.getParkIndex());
  201 + dubboReq.setFreeBerthNum(req.getRemaining());
  202 + dubboReq.setSysCode("123456");
  203 + logger.info("===调用dubbo服务更新空余车位信息 dubboReq={}", JSONObject.toJSONString(dubboReq));
  204 + BizResult<Integer> result = parkFreeBerthService.updateFreeBerthNumByFreeBerthNum(dubboReq);
  205 + logger.info("===调用dubbo服务更新空余车位信息 dubboRes={}", JSONObject.toJSONString(result));
  206 + RemainingInfoRes res = new RemainingInfoRes();
  207 + res.setMessage("测试");
  208 + res.setCode(EBoChongEnum.CODE_SUCCESS.val());
  209 + logger.info("===发送剩余停车位信息 res={}", JSONObject.toJSONString(res));
  210 + setResponse(response, res);
  211 + }
  212 +
  213 + @ApiOperation("发送停车场对账信息")
  214 + @PostMapping("/SendChargeList")
  215 + public void SendChargeList(HttpServletRequest request, HttpServletResponse response) {
  216 + String data = getRequestBody(request);
  217 + logger.info("===发送停车场对账信息 data={}", data);
  218 + data = EBoChongAESUtil.decryptAES(data, key);
  219 + logger.info("===发送停车场对账信息 解密后data={}", data);
  220 + ChargeListReq req = JSONObject.parseObject(data, ChargeListReq.class);
  221 + logger.info("===发送停车场对账信息 格式化对象 req={}", JSONObject.toJSONString(req));
  222 +
  223 + ChargeListRes res = new ChargeListRes();
  224 + res.setMessage("测试");
  225 + res.setCode(EBoChongEnum.CODE_SUCCESS.val());
  226 + logger.info("===发送停车场对账信息 res={}", JSONObject.toJSONString(res));
  227 + setResponse(response, res);
  228 + }
  229 +
  230 + @ApiOperation("补发过车信息")
  231 + @PostMapping("/ResendVehicleInfo")
  232 + public void ResendVehicleInfo(HttpServletRequest request, HttpServletResponse response) {
  233 + String data = getRequestBody(request);
  234 + logger.info("===补发过车信息 data={}", data);
  235 + data = EBoChongAESUtil.decryptAES(data, key);
  236 + logger.info("===补发过车信息 解密后data={}", data);
  237 + ResendVehicleInfoReq req = JSONObject.parseObject(data, ResendVehicleInfoReq.class);
  238 + logger.info("===补发过车信息 格式化对象 req={}", JSONObject.toJSONString(req));
  239 +
  240 + ResendVehicleInfoRes res = new ResendVehicleInfoRes();
  241 + res.setSendNo(req.getSendNo());
  242 + res.setMessage("测试");
  243 + res.setCode(EBoChongEnum.CODE_SUCCESS.val());
  244 + logger.info("===补发过车信息 res={}", JSONObject.toJSONString(res));
  245 + setResponse(response, res);
  246 + }
  247 +
  248 + private String getRequestBody(HttpServletRequest request) {
  249 + StringBuffer sb = new StringBuffer();
  250 + String line;
  251 + BufferedReader reader = null;
  252 + try {
  253 + reader = request.getReader();
  254 + while ((line = reader.readLine()) != null) {
  255 + sb.append(line);
  256 + }
  257 + } catch (IOException e) {
  258 + logger.info("杰商 接收数据报错=====");
  259 + e.printStackTrace();
  260 + }
  261 +
  262 + String jbstring = sb.toString();
  263 + return jbstring;
  264 + }
  265 +
  266 + private void setResponse(HttpServletResponse response, CommonRes res) {
  267 + try {
  268 + String jsonData = JSONObject.toJSONString(res);
  269 + String data = EBoChongAESUtil.encryptAES(jsonData, key).toUpperCase();
  270 + logger.info("====接收数据响应加密数据为:encryptData=" + data);
  271 + response.setCharacterEncoding("UTF-8");
  272 + response.getWriter().write(data);
  273 + } catch (IOException e) {
  274 + e.printStackTrace();
  275 + }
  276 + }
  277 +
  278 + private String queryParkingLotNameByPlNo(String plNo) {
  279 + if (StringUtils.isEmpty(plNo)) {
  280 + return "";
  281 + }
  282 + QueryParkLotInfoByPkNoRequest request = new QueryParkLotInfoByPkNoRequest();
  283 + request.setPklNo(plNo);
  284 + request.setSysCode("123456");
  285 +
  286 + BizResult<ParkingLotDTO> result = parkingLotQueryService.QueryParkingLotByPkNo(request);
  287 + if (ResultUtils.isSuccess(result)) {
  288 + return result.getData().getPlName();
  289 + } else {
  290 + return "";
  291 + }
  292 + }
  293 +
  294 + public static void main(String[] args) {
  295 + String key = "2xJLZAlyolvMMz4+c/8nRA==";
  296 + String str = "{\"plateNo\":\"粤PME680\",\"cardNo\":\"\",\"carType\":0,\"parkIndex\":\"001\","
  297 + + "\"entranceIndex\":\"001\",\"passTime\":\"2016-09-01 23:12:34 \",\"inTime\":\"2016-09-01 23:12:34 \","
  298 + + "\"carOut\":0,\"vehicleUrl\":\"\",\"receivable\":0,\"uuid\":\"900150983CD24FB0D6963F7D28E17F72\","
  299 + + "\"payType\":0}";
  300 +
  301 + str = EBoChongAESUtil.encryptAES(str, key);
  302 + System.out.println(str);
  303 + }
  304 +
  305 +}
... ...
src/main/java/com/zteits/irain/portal/web/ebochong/send/EBoChongSendController.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/web/ebochong/send/EBoChongSendController.java
  1 +package com.zteits.irain.portal.web.ebochong.send;
  2 +
  3 +import java.io.UnsupportedEncodingException;
  4 +import java.util.HashMap;
  5 +import java.util.Map;
  6 +
  7 +import com.alibaba.fastjson.JSONObject;
  8 +
  9 +import com.clouds.common.utils.EBoChongAESUtil;
  10 +import com.zteits.irain.portal.common.HttpClientTutorial;
  11 +import com.zteits.irain.portal.vo.ebochong.send.AddChargeInfoReq;
  12 +import com.zteits.irain.portal.vo.ebochong.send.AddChargeInfoRes;
  13 +import com.zteits.irain.portal.vo.ebochong.send.AddVehicleReservationReq;
  14 +import com.zteits.irain.portal.vo.ebochong.send.AddVehicleReservationRes;
  15 +import com.zteits.irain.portal.vo.ebochong.send.GetVehicleChargeReq;
  16 +import com.zteits.irain.portal.vo.ebochong.send.GetVehicleChargeRes;
  17 +import io.swagger.annotations.Api;
  18 +import io.swagger.annotations.ApiOperation;
  19 +import org.slf4j.Logger;
  20 +import org.slf4j.LoggerFactory;
  21 +import org.springframework.beans.factory.annotation.Value;
  22 +import org.springframework.web.bind.annotation.PostMapping;
  23 +import org.springframework.web.bind.annotation.RequestBody;
  24 +import org.springframework.web.bind.annotation.RequestMapping;
  25 +import org.springframework.web.bind.annotation.RestController;
  26 +
  27 +/**
  28 + * Copyright: Copyright (c) 2017 zteits
  29 + *
  30 + * @ClassName: com.zteits.irain.portal.web.ebochong.send
  31 + * @Description: 杰商 数据发送 接口
  32 + * @version: v1.0.0
  33 + * @author: atao
  34 + * @date: 2017/6/22 下午4:55
  35 + * Modification History:
  36 + * Date Author Version Description
  37 + * ---------------------------------------------------------*
  38 + * 2017/6/22 atao v1.0.0 创建
  39 + */
  40 +@Api("杰商下发接口")
  41 +@RestController
  42 +@RequestMapping("/ebochong")
  43 +public class EBoChongSendController {
  44 + @Value("${ebochong.url}")
  45 + private String url;
  46 + @Value("${ebochong.clientCode}")
  47 + private String clientCode;
  48 + @Value("${ebochong.key}")
  49 + private String key;
  50 +
  51 + private static final Logger logger = LoggerFactory.getLogger(EBoChongSendController.class);
  52 +
  53 + @ApiOperation("添加预约车辆信息接口")
  54 + @PostMapping("/addVehicleReservation")
  55 + public AddVehicleReservationRes addVehicleReservation(@RequestBody AddVehicleReservationReq req)
  56 + throws UnsupportedEncodingException {
  57 + logger.info("杰商 添加预约车辆信息接口 入参为:req={}", JSONObject.toJSONString(req));
  58 + logger.info("杰商 添加预约车辆信息接口 请求的URL为:url={}", url);
  59 + Map<String, Object> headers = getCommonHeader();
  60 + String data = EBoChongAESUtil.encryptAES(JSONObject.toJSONString(req),key);
  61 + logger.info("杰商 添加预约车辆信息接口 加密后的数据为: data={}",data);
  62 + String result = HttpClientTutorial.httpPostRequest(url, headers, data);
  63 + logger.info("杰商 添加预约车辆信息接口 返回的数据为:result={}",result);
  64 + AddVehicleReservationRes res = JSONObject.parseObject(result, AddVehicleReservationRes.class);
  65 + logger.info("杰商 添加预约车辆信息接口 响应为:res={}", JSONObject.toJSONString(res));
  66 + return res;
  67 + }
  68 +
  69 + @ApiOperation("获取车辆收费金额")
  70 + @PostMapping("/getVehicleCharge")
  71 + public GetVehicleChargeRes getVehicleCharge(@RequestBody GetVehicleChargeReq req)
  72 + throws UnsupportedEncodingException {
  73 + logger.info("杰商 获取车辆收费金额 入参为:req={}", JSONObject.toJSONString(req));
  74 + logger.info("杰商 获取车辆收费金额 请求的URL为:url={}", url);
  75 + Map<String, Object> headers = getCommonHeader();
  76 + String data = EBoChongAESUtil.encryptAES(JSONObject.toJSONString(req),key);
  77 + logger.info("杰商 获取车辆收费金额 加密后的数据为: data={}",data);
  78 + String result = HttpClientTutorial.httpPostRequest(url, headers, data);
  79 + logger.info("杰商 获取车辆收费金额 返回的数据为:result={}",result);
  80 + GetVehicleChargeRes res = JSONObject.parseObject(result, GetVehicleChargeRes.class);
  81 + logger.info("杰商 获取车辆收费金额 响应为:res={}", JSONObject.toJSONString(res));
  82 +
  83 + return res;
  84 + }
  85 +
  86 + @ApiOperation("添加收费信息")
  87 + @PostMapping("/addChargeInfo")
  88 + public AddChargeInfoRes addChargeInfo(@RequestBody AddChargeInfoReq req) throws UnsupportedEncodingException {
  89 + logger.info("杰商 添加收费信息 入参为:req={}", JSONObject.toJSONString(req));
  90 + logger.info("杰商 添加收费信息 请求的URL为:url={}", url);
  91 + Map<String, Object> headers = getCommonHeader();
  92 + String data = EBoChongAESUtil.encryptAES(JSONObject.toJSONString(req),key);
  93 + logger.info("杰商 添加收费信息 加密后的数据为: data={}",data);
  94 + String result = HttpClientTutorial.httpPostRequest(url, headers, data);
  95 + logger.info("杰商 添加收费信息 返回的数据为:result={}",result);
  96 + AddChargeInfoRes res = JSONObject.parseObject(result, AddChargeInfoRes.class);
  97 + logger.info("杰商 添加收费信息 响应为:res={}", JSONObject.toJSONString(res));
  98 +
  99 + return res;
  100 + }
  101 +
  102 + /**
  103 + * 获取公共请求头
  104 + *
  105 + * @return
  106 + */
  107 + private Map<String, Object> getCommonHeader() {
  108 + Map<String, Object> maps = new HashMap<>();
  109 + maps.put("ClientCode", clientCode);
  110 + maps.put("Content-Type", "application/json");
  111 + return maps;
  112 + }
  113 +
  114 +}
... ...
src/main/java/com/zteits/irain/portal/web/govclouds/DataGeneralizeController.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/web/govclouds/DataGeneralizeController.java
  1 +package com.zteits.irain.portal.web.govclouds;
  2 +import java.util.ArrayList;
  3 +import java.util.HashMap;
  4 +import java.util.List;
  5 +import java.util.Map;
  6 +import java.util.Map.Entry;
  7 +
  8 +import org.slf4j.Logger;
  9 +import org.slf4j.LoggerFactory;
  10 +import org.springframework.beans.factory.annotation.Autowired;
  11 +import org.springframework.beans.factory.annotation.Value;
  12 +import org.springframework.web.bind.annotation.PostMapping;
  13 +import org.springframework.web.bind.annotation.RequestBody;
  14 +import org.springframework.web.bind.annotation.RequestMapping;
  15 +import org.springframework.web.bind.annotation.ResponseBody;
  16 +import org.springframework.web.bind.annotation.RestController;
  17 +
  18 +import com.alibaba.dubbo.common.utils.CollectionUtils;
  19 +import com.alibaba.fastjson.JSONObject;
  20 +import com.clouds.common.cache.park.EqpAndPosStatusSyncCacheUtil;
  21 +import com.clouds.common.cache.sys.SysCodeValueCacheUtil;
  22 +import com.clouds.common.constants.CodeValKindEnum;
  23 +import com.clouds.common.utils.ResultUtils;
  24 +import com.clouds.common.web.vo.BizResultVO;
  25 +import com.google.common.collect.Lists;
  26 +import com.google.common.collect.Maps;
  27 +import com.zteits.clouds.api.apibase.bean.BizResult;
  28 +import com.zteits.clouds.api.apibase.constants.ErrorType;
  29 +import com.zteits.clouds.api.apibase.exception.BizException;
  30 +import com.zteits.clouds.api.dto.govclouds.ParkTransactionDTO;
  31 +import com.zteits.clouds.api.dto.park.dto.ParkFreeBerthsCountStatisticByCountryDTO;
  32 +import com.zteits.clouds.api.dto.park.dto.ParkLotCountStatisticByCountryDTO;
  33 +import com.zteits.clouds.api.dto.park.dto.ParkLotEqpTypeCountStatisticByCountryDTO;
  34 +import com.zteits.clouds.api.dto.park.dto.ParkingLotDTO;
  35 +import com.zteits.clouds.api.dto.park.param.ParkTransactionRequest;
  36 +import com.zteits.clouds.api.dto.park.param.StatisticParkLotCountByCountryRequest;
  37 +import com.zteits.clouds.api.service.govclouds.ParkTransactionService;
  38 +import com.zteits.clouds.api.service.park.ParkFreeBerthService;
  39 +import com.zteits.clouds.api.service.park.ParkingLotEqpService;
  40 +import com.zteits.clouds.api.service.park.ParkingLotQueryService;
  41 +import com.zteits.irain.portal.vo.govclouds.StatisticParkLotEqpCountByCountryVO;
  42 +import com.zteits.irain.portal.vo.parkinglotdatacenter.BerthSpaceRatioVO;
  43 +import com.zteits.irain.portal.vo.parkinglotdatacenter.BerthSpaceRatioVO.BerthSeriesVO;
  44 +import com.zteits.irain.portal.vo.parkinglotdatacenter.ParkLotAndBerthsCountVO;
  45 +
  46 +import io.swagger.annotations.Api;
  47 +import io.swagger.annotations.ApiOperation;
  48 +
  49 +/**
  50 + * 数据概括 相关Controller
  51 + *
  52 + * Copyright: Copyright (c) 2017 zteits
  53 + *
  54 + * @ClassName: DataGeneralizeController.java
  55 + * @Description:
  56 + * @version: v1.0.0
  57 + * @author: zhaowg
  58 + * @date: 2017年6月27日 下午2:11:07
  59 + * Modification History:
  60 + * Date Author Version Description
  61 + *---------------------------------------------------------*
  62 + * 2017年6月27日 zhaowg v1.0.0 创建
  63 + */
  64 +@RestController
  65 +@Api(value="数据中心-数据概括",description="数据中心-数据概括")
  66 +@RequestMapping("/dataGeneralize")
  67 +public class DataGeneralizeController {
  68 + private Logger logger = LoggerFactory.getLogger(DataGeneralizeController.class);
  69 +
  70 + @Value("${project.syscode}")
  71 + private String sysCode;
  72 + @Autowired
  73 + private ParkingLotQueryService parkingLotQueryService;
  74 + @Autowired
  75 + private ParkingLotEqpService parkingLotEqpService;
  76 + @Autowired
  77 + private ParkFreeBerthService parkFreeBerthService;
  78 + @Autowired
  79 + private ParkTransactionService parkTransactionService;
  80 +
  81 + /**
  82 + * 这里用的是@SendToUser,这就是发送给单一客户端的标志。本例中,
  83 + * 客户端接收一对一消息的主题应该是“/user/” + 用户Id + “/message” ,这里的用户id可以是一个普通的字符串,只要每个用户端都使用自己的id并且服务端知道每个用户的id就行。
  84 + * @return
  85 + */
  86 + @ApiOperation(value="空闲车位雷达图")
  87 + @PostMapping("freeBerthRadarChart")
  88 + @ResponseBody
  89 +// @MessageMapping("/freeBerthRadarChartByWebSocket")
  90 +// @SendToUser("/freeBerthRadarChartByWebSocket")
  91 + public BizResultVO<Map<String,Integer>> getFreeBerthRadarChart(@RequestBody StatisticParkLotCountByCountryRequest request){
  92 + if(null == request.getCityId()){
  93 + throw new BizException(ErrorType.PARAMM_NULL, "城市编号");
  94 + }
  95 + logger.info("对城市:"+request.getCityId()+" 按照区域统计空闲车位数量等信息");
  96 + Map<String,Integer> freeBerthsMap = Maps.newHashMap();
  97 + //TODO 空闲车位数量 先查询缓存
  98 + BizResult<List<ParkFreeBerthsCountStatisticByCountryDTO>> bizResultParkLot = parkFreeBerthService.StatisticParkFreeBerthsCountByCountry(request);
  99 + logger.info("调用后场dubbo服务,响应为: result={}", JSONObject.toJSONString(bizResultParkLot));
  100 + //如果不成功
  101 + if (!ResultUtils.isSuccess(bizResultParkLot)) {
  102 + return new BizResultVO<>(bizResultParkLot.getErrCode(), bizResultParkLot.getErrMsg());
  103 + }
  104 + List<ParkFreeBerthsCountStatisticByCountryDTO> parkFreeBerthList=bizResultParkLot.getData();
  105 + //空闲车位数
  106 + if(CollectionUtils.isNotEmpty(parkFreeBerthList)){
  107 + for (ParkFreeBerthsCountStatisticByCountryDTO dto : parkFreeBerthList) {
  108 + String countryName = dto.getPlCountryName();
  109 + //停车位个数
  110 + Integer pkberthsCount = dto.getFreeBerthsNum()==null?0:dto.getFreeBerthsNum();
  111 + freeBerthsMap.put(countryName, pkberthsCount);
  112 + }
  113 + }
  114 + return new BizResultVO<Map<String,Integer>>().setData(freeBerthsMap);
  115 + }
  116 +
  117 + @ApiOperation(value="统计停车场服务次数线上线下排行")
  118 + @PostMapping("queryParkTransaction")
  119 + @ResponseBody
  120 + public BizResultVO<List<ParkTransactionDTO>> queryParkTransaction(@RequestBody StatisticParkLotCountByCountryRequest request){
  121 + BizResultVO<List<ParkTransactionDTO>> parkTransVO = new BizResultVO<>();
  122 + //先查询城市下面的停车场
  123 + BizResult<List<ParkingLotDTO>> result = parkingLotQueryService.queryParkLotByCountry(request);
  124 + if (ResultUtils.isError(result)) {
  125 + //如果失败
  126 + parkTransVO.setCode(result.getErrCode().getCode());
  127 + parkTransVO.setMsg(result.getErrMsg());
  128 + return parkTransVO;
  129 + }
  130 + ParkTransactionRequest pRequest = new ParkTransactionRequest();
  131 + pRequest = this.getParkingLot(result.getData()); //拼接参数
  132 + //TODO 停车场线上线下服务次数排行
  133 + BizResult<List<ParkTransactionDTO>> bizResultParkLot = parkTransactionService.queryParkTransaction(pRequest);
  134 + if (ResultUtils.isError(bizResultParkLot)) {
  135 + //如果失败
  136 + parkTransVO.setCode(bizResultParkLot.getErrCode().getCode());
  137 + parkTransVO.setMsg(bizResultParkLot.getErrMsg());
  138 + return parkTransVO;
  139 + }
  140 + List<ParkTransactionDTO> parkingLotList = new ArrayList<ParkTransactionDTO>();
  141 + parkingLotList = this.changeParkTrans(result.getData(), bizResultParkLot.getData());
  142 + parkTransVO.setData(parkingLotList);
  143 + return parkTransVO;
  144 + }
  145 + /**
  146 + * 拼接参数-查询线上排行
  147 + * @param parkList
  148 + * @return
  149 + */
  150 + private ParkTransactionRequest getParkingLot(List<ParkingLotDTO> parkList){
  151 + ParkTransactionRequest pRequest = new ParkTransactionRequest();
  152 + List<ParkTransactionDTO> parkTransList = new ArrayList<ParkTransactionDTO>();
  153 + for(ParkingLotDTO parkingLotDTO:parkList){
  154 + ParkTransactionDTO parkTransactionDTO = new ParkTransactionDTO();
  155 + parkTransactionDTO.setParkId(parkingLotDTO.getPlNo());
  156 + parkTransactionDTO.setParkName(parkingLotDTO.getPlName());
  157 + parkTransList.add(parkTransactionDTO);
  158 + }
  159 + pRequest.setParkTransactionDTO(parkTransList);
  160 + pRequest.setSysCode("城市下面包含的所有停车场");
  161 + return pRequest;
  162 + }
  163 +
  164 + /**
  165 + * list
  166 + * @param list
  167 + * @return
  168 + */
  169 + private List<ParkTransactionDTO> changeParkTrans(List<ParkingLotDTO> parkingLotList,List<ParkTransactionDTO> list){
  170 + for(ParkTransactionDTO parkTransactionDTO:list){
  171 + for(ParkingLotDTO parkingLotDTO:parkingLotList){
  172 + if(parkingLotDTO.getPlNo().equals(parkTransactionDTO.getParkId())){
  173 + parkTransactionDTO.setParkName(parkingLotDTO.getPlName());
  174 + }
  175 + }
  176 + }
  177 + return list;
  178 + }
  179 +
  180 + @ApiOperation(value="停车场柱图")
  181 + @PostMapping("parkinglotColumnChart")
  182 + @ResponseBody
  183 + public BizResultVO<ParkLotAndBerthsCountVO> getParkAndBerthAndEquChart(@RequestBody StatisticParkLotCountByCountryRequest request){
  184 + if(null == request.getCityId()){
  185 + throw new BizException(ErrorType.PARAMM_NULL, "城市编号");
  186 + }
  187 + logger.info("对城市:"+request.getCityId()+" 按照区域统计停车场、车位数量等信息");
  188 + //停车场数量 先查询缓存
  189 + BizResult<List<ParkLotCountStatisticByCountryDTO>> bizResultParkLot = parkingLotQueryService.StatisticParkLotCountByCountry(request);
  190 + logger.info("调用后场dubbo服务,响应为: result={}", JSONObject.toJSONString(bizResultParkLot));
  191 + //如果不成功
  192 + if (!ResultUtils.isSuccess(bizResultParkLot)) {
  193 + return new BizResultVO<>(bizResultParkLot.getErrCode(), bizResultParkLot.getErrMsg());
  194 + }
  195 + List<ParkLotCountStatisticByCountryDTO> parkLotCountList=bizResultParkLot.getData();
  196 + //停车场车位数
  197 + Map<String,Integer> berthsCountMap = Maps.newHashMap();
  198 + //停车场数
  199 + Map<String,Integer> parkLotCountMap = Maps.newHashMap();
  200 +
  201 + if(CollectionUtils.isNotEmpty(parkLotCountList)){
  202 + for (ParkLotCountStatisticByCountryDTO dto : parkLotCountList) {
  203 + String countryName = dto.getPlCountryName();
  204 + //停车场个数
  205 + int pkCount = dto.getParkLotCount()==null?0:dto.getParkLotCount();
  206 + parkLotCountMap.put(countryName, pkCount);
  207 + //停车位个数
  208 + int pkberthsCount = dto.getTotalBerths();
  209 + berthsCountMap.put(countryName, pkberthsCount);
  210 + }
  211 + }
  212 + ParkLotAndBerthsCountVO parkLotAndBerthsCountVO = new ParkLotAndBerthsCountVO();
  213 + parkLotAndBerthsCountVO.setPkberthsCount(berthsCountMap);
  214 + parkLotAndBerthsCountVO.setPkCount(parkLotCountMap);
  215 + return new BizResultVO<ParkLotAndBerthsCountVO>().setData(parkLotAndBerthsCountVO);
  216 + }
  217 +
  218 +
  219 + /**
  220 + * 返回值说明:Map<设备名称,Map<区县中文名称,对应的数量>>
  221 + * @param request
  222 + * @return
  223 + * 2017年7月12日 zhaowg
  224 + */
  225 + @ApiOperation(value="根据某市按照区域统计设备数量")
  226 + @PostMapping("statisticParkLotEqpCountByCountry")
  227 + @ResponseBody
  228 + public BizResultVO<StatisticParkLotEqpCountByCountryVO> StatisticParkLotEqpCountByCountry(@RequestBody StatisticParkLotCountByCountryRequest request){
  229 + logger.info("对城市:"+request.getCityId()+" 按照区域统计设备数量等信息");
  230 + StatisticParkLotEqpCountByCountryVO result = new StatisticParkLotEqpCountByCountryVO();
  231 + // 通过设备类型+是否在线或离线,和区域分组
  232 + Map<String, Map<String, Integer>> detailEquTypeGroupMap = Maps.newLinkedHashMap();
  233 + // 通过设备类型,和区域分组
  234 + Map<String, Map<String, Integer>> totalEquTypeGroupMap = Maps.newHashMap();
  235 + result.setDetailEqpMap(detailEquTypeGroupMap);
  236 + result.setTotalEqpMap(totalEquTypeGroupMap);
  237 +
  238 + // 设备类型编号和名称对应关系
  239 + Map<String, String> equNamemap = SysCodeValueCacheUtil.queryCodeValueAndNames(null, CodeValKindEnum.PARKING_LOT_EQP_TYPE_, request.getCityId()+"");
  240 + if(equNamemap==null || equNamemap.isEmpty()){
  241 + return new BizResultVO<StatisticParkLotEqpCountByCountryVO>().setData(result);
  242 + }
  243 +
  244 + //将为赋值的设备初始化 离线在前,在线在后
  245 + for (Entry<String, String> e : equNamemap.entrySet()) {
  246 + String equName = e.getValue();
  247 + //不包含某个设备,初始化
  248 + if(!detailEquTypeGroupMap.containsKey(equName+"在线")){
  249 + detailEquTypeGroupMap.put(equName+"在线", Maps.newHashMap());
  250 + }
  251 + if(!detailEquTypeGroupMap.containsKey(equName+"离线")){
  252 + detailEquTypeGroupMap.put(equName+"离线", Maps.newHashMap());
  253 + }
  254 + if(!totalEquTypeGroupMap.containsKey(equName)){
  255 + totalEquTypeGroupMap.put(equName, Maps.newHashMap());
  256 + }
  257 +
  258 + }
  259 +
  260 + BizResult<List<ParkLotEqpTypeCountStatisticByCountryDTO>> bizResultParkEqp = parkingLotEqpService.StatisticParkLotEqpCountByCountry(request);
  261 + //如果不成功 或空 返回0
  262 + if (ResultUtils.isSuccess(bizResultParkEqp)) {
  263 + List<ParkLotEqpTypeCountStatisticByCountryDTO> parkEquTypeList=bizResultParkEqp.getData();
  264 + if(CollectionUtils.isNotEmpty(parkEquTypeList)){
  265 + for (ParkLotEqpTypeCountStatisticByCountryDTO dto : parkEquTypeList) {
  266 + //TODO 临时方案,zhaowg3 20170726 原因:红山区目前地磁状态同步接口未做,只同步总的在线,离线数量,故直接获取他同步的结果即可
  267 + if(dto.getPlCountryId()==923){
  268 + continue;
  269 + }
  270 + ////////////////////////////////////以上为临时方案//////////////////
  271 +
  272 +
  273 +
  274 + //获取对应的设备名称
  275 + String equTypeName = equNamemap.get(dto.getEqpType()+"");
  276 + //获取设备状态 设备状态:1-未安装,2-使用中,3-损坏
  277 + Integer eqpState = dto.getEqpState();
  278 + if(eqpState == null || eqpState==1){
  279 + continue;
  280 + }
  281 + //记录在线/离线数量
  282 + String detailKey = equTypeName+(eqpState==2?"在线":"离线");
  283 + if(!detailEquTypeGroupMap.containsKey(detailKey)){
  284 + Map<String, Integer> equCountMap=Maps.newHashMap();
  285 + equCountMap.put(dto.getPlCountryName(), dto.getEqpNum());
  286 + detailEquTypeGroupMap.put(detailKey, equCountMap);
  287 + }else{
  288 + detailEquTypeGroupMap.get(detailKey).put(dto.getPlCountryName(), dto.getEqpNum());
  289 + }
  290 +
  291 + //记录某个设备总数
  292 + String totalKey = equTypeName;
  293 + if(!totalEquTypeGroupMap.containsKey(totalKey)){
  294 + Map<String, Integer> equCountMap=Maps.newHashMap();
  295 + equCountMap.put(dto.getPlCountryName(), dto.getEqpNum());
  296 + totalEquTypeGroupMap.put(totalKey, equCountMap);
  297 + }else{
  298 + Map<String, Integer> countryMap = totalEquTypeGroupMap.get(totalKey);
  299 + Integer eqpTotalNum = dto.getEqpNum();
  300 + if(countryMap.containsKey(dto.getPlCountryName())){
  301 + eqpTotalNum = countryMap.get(dto.getPlCountryName())+dto.getEqpNum();
  302 + }
  303 + totalEquTypeGroupMap.get(totalKey).put(dto.getPlCountryName(), eqpTotalNum);
  304 + }
  305 + }
  306 + }
  307 + }
  308 +
  309 + //TODO 临时方案,zhaowg3 20170726 原因:红山区目前地磁状态同步接口未做,只同步总的在线,离线数量,故直接获取他同步的结果
  310 + this.tmpHongShanQuEqpData(detailEquTypeGroupMap,totalEquTypeGroupMap);
  311 +
  312 + return new BizResultVO<StatisticParkLotEqpCountByCountryVO>().setData(result);
  313 + }
  314 +
  315 + //TODO 临时方案,zhaowg3 20170726 原因:红山区目前地磁状态同步接口未做,只同步总的在线,离线数量,故直接获取他同步的结果
  316 + private void tmpHongShanQuEqpData(Map<String, Map<String, Integer>> equTypeGroupMap, Map<String, Map<String, Integer>> totalEquTypeGroupMap) {
  317 + Map<String, String> map = EqpAndPosStatusSyncCacheUtil.getGeoPosTotalNum();
  318 + String[] geostatus = map.get("geo").split(",");
  319 +
  320 + totalEquTypeGroupMap.get("地磁").put("红山区", Integer.valueOf(geostatus[0])+Integer.valueOf(geostatus[1]));
  321 +
  322 + if(equTypeGroupMap.containsKey("地磁在线")){
  323 + equTypeGroupMap.get("地磁在线").put("红山区", Integer.valueOf(geostatus[0]));
  324 + }else{
  325 + Map<String, Integer> tmpMap = new HashMap<String, Integer>();
  326 + tmpMap.put("红山区", Integer.valueOf(geostatus[0]));
  327 + equTypeGroupMap.put("地磁在线",tmpMap);
  328 + }
  329 + if(equTypeGroupMap.containsKey("地磁离线")){
  330 + equTypeGroupMap.get("地磁离线").put("红山区", Integer.valueOf(geostatus[1]));
  331 + }else{
  332 + Map<String, Integer> tmpMap = new HashMap<String, Integer>();
  333 + tmpMap.put("红山区", Integer.valueOf(geostatus[1]));
  334 + equTypeGroupMap.put("地磁离线",tmpMap);
  335 + }
  336 +
  337 + String[] posstatus = map.get("pos").split(",");
  338 + totalEquTypeGroupMap.get("POS机").put("红山区", Integer.valueOf(posstatus[0])+Integer.valueOf(posstatus[1]));
  339 + if(equTypeGroupMap.containsKey("POS机离线")){
  340 + equTypeGroupMap.get("POS机离线").put("红山区", Integer.valueOf(posstatus[1]));
  341 + }else{
  342 + Map<String, Integer> tmpMap = new HashMap<String, Integer>();
  343 + tmpMap.put("红山区", Integer.valueOf(posstatus[1]));
  344 + equTypeGroupMap.put("POS机离线",tmpMap);
  345 + }
  346 + if(equTypeGroupMap.containsKey("POS机在线")){
  347 + equTypeGroupMap.get("POS机在线").put("红山区", Integer.valueOf(posstatus[0]));
  348 + }else{
  349 + Map<String, Integer> tmpMap = new HashMap<String, Integer>();
  350 + tmpMap.put("红山区", Integer.valueOf(posstatus[0]));
  351 + equTypeGroupMap.put("POS机在线",tmpMap);
  352 + }
  353 + }
  354 +
  355 + @ApiOperation("查询某个城市首页要显示的区县")
  356 + @PostMapping("displayCountryByCityId")
  357 + public BizResultVO<List<String>> getDisplayCountry(@RequestBody StatisticParkLotCountByCountryRequest request){
  358 + Map<String, String> map = SysCodeValueCacheUtil.queryCodeValueAndNames(null, CodeValKindEnum.DATA_CENTRE_INDEX_DISPLAY_, request.getCityId()+"");
  359 + if(map == null || map.isEmpty()){
  360 + return new BizResultVO<List<String>>().setData(Lists.newArrayList());
  361 + }
  362 + List<String> displayCountry = Lists.newArrayList();
  363 + map.entrySet().forEach(e->{displayCountry.add(e.getValue());});
  364 + return new BizResultVO<List<String>>().setData(displayCountry);
  365 + }
  366 +
  367 + @ApiOperation(value="车位配比图")
  368 + @PostMapping("berthSpaceRatioChart")
  369 + @ResponseBody
  370 + public BizResultVO<BerthSpaceRatioVO> getBerthSpaceRatioChart(@RequestBody StatisticParkLotCountByCountryRequest request){
  371 + if(null == request.getCityId()){
  372 + throw new BizException(ErrorType.PARAMM_NULL, "城市编号");
  373 + }
  374 + logger.info("对城市:"+request.getCityId()+" 按照区域统计空闲车位数量信息");
  375 + BerthSpaceRatioVO berthSpaceRatioVO=new BerthSpaceRatioVO();
  376 + // 车位配比 区域和配比值对应关系
  377 + Map<String, String> berthSpaceRatiomap = SysCodeValueCacheUtil.queryCodeValueAndNames(null, CodeValKindEnum.DATA_CENTRE_INDEX_BERTH_RATIO_, request.getCityId()+"");
  378 + List<BerthSeriesVO> b=Lists.newArrayList();
  379 + for (Entry<String, String> entry : berthSpaceRatiomap.entrySet()) {
  380 + BerthSeriesVO berthSeriesVO=new BerthSeriesVO();
  381 + berthSeriesVO.setName(entry.getKey());
  382 + String value=entry.getValue()==null?"0":entry.getValue();
  383 + berthSeriesVO.setData(Double.valueOf(value).doubleValue());
  384 + b.add(berthSeriesVO);
  385 + }
  386 +
  387 + berthSpaceRatioVO.setBerthSpaceRatio(b);
  388 +
  389 + return new BizResultVO<BerthSpaceRatioVO>().setData(berthSpaceRatioVO);
  390 + }
  391 +}
... ...
src/main/java/com/zteits/irain/portal/web/govclouds/GuideScreenController.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/web/govclouds/GuideScreenController.java
  1 +package com.zteits.irain.portal.web.govclouds;
  2 +
  3 +import java.util.List;
  4 +import java.util.Map;
  5 +
  6 +import com.alibaba.fastjson.JSONObject;
  7 +
  8 +import com.clouds.common.cache.park.ParkingLotCacheUtil;
  9 +import com.clouds.common.constants.SysFileTypeEnum;
  10 +import com.clouds.common.utils.ResultUtils;
  11 +import com.clouds.common.web.vo.BizResultVO;
  12 +import com.zteits.clouds.api.apibase.bean.BaseInfo;
  13 +import com.zteits.clouds.api.apibase.bean.BizResult;
  14 +import com.zteits.clouds.api.apibase.bean.PageBean;
  15 +import com.zteits.clouds.api.apibase.constants.BasicEnum;
  16 +import com.zteits.clouds.api.apibase.constants.DataStatusEnum;
  17 +import com.zteits.clouds.api.apibase.constants.ErrorType;
  18 +import com.zteits.clouds.api.apibase.exception.BizException;
  19 +import com.zteits.clouds.api.dto.park.dto.GuideFirstInfoConfigDTO;
  20 +import com.zteits.clouds.api.dto.park.dto.GuideParkRelDTO;
  21 +import com.zteits.clouds.api.dto.park.dto.GuideScreenDTO;
  22 +import com.zteits.clouds.api.dto.park.dto.GuideScreenGeoDTO;
  23 +import com.zteits.clouds.api.dto.park.dto.GuideScreenLevelStatisticsDTO;
  24 +import com.zteits.clouds.api.dto.park.dto.ParkingLotDTO;
  25 +import com.zteits.clouds.api.dto.park.param.GuideFirstInfoConfigQueryRequest;
  26 +import com.zteits.clouds.api.dto.park.param.GuideScreenGetBaseInfoRequest;
  27 +import com.zteits.clouds.api.dto.park.param.GuideScreenGetInfoRequest;
  28 +import com.zteits.clouds.api.dto.park.param.GuideScreenListByAreaCodesRequest;
  29 +import com.zteits.clouds.api.dto.park.param.GuideScreenListGeoRequest;
  30 +import com.zteits.clouds.api.dto.park.param.GuideScreenStatisticsByAreaCodesRequest;
  31 +import com.zteits.clouds.api.dto.park.param.ParkFreeBerthGetByPlnoRequest;
  32 +import com.zteits.clouds.api.dto.park.param.QueryParkLotInfoByPkNoRequest;
  33 +import com.zteits.clouds.api.dto.pay.TdCFileDTO;
  34 +import com.zteits.clouds.api.dto.pay.param.SysFileGetBySourceIdAndTypeRequest;
  35 +import com.zteits.clouds.api.service.park.GuideScreenService;
  36 +import com.zteits.clouds.api.service.park.ParkFreeBerthService;
  37 +import com.zteits.clouds.api.service.park.ParkingLotQueryService;
  38 +import com.zteits.clouds.api.service.pay.TdCFileService;
  39 +import com.zteits.irain.portal.vo.parkinglotdatacenter.guide.FirstGuideInfoVO;
  40 +import com.zteits.irain.portal.vo.parkinglotdatacenter.guide.GuideInfoVO;
  41 +import com.zteits.irain.portal.vo.parkinglotdatacenter.guide.SecondGuideInfoVO;
  42 +import com.zteits.irain.portal.vo.parkinglotdatacenter.guide.ThirdGuidInfoVO;
  43 +import io.swagger.annotations.Api;
  44 +import io.swagger.annotations.ApiOperation;
  45 +
  46 +import org.slf4j.Logger;
  47 +import org.slf4j.LoggerFactory;
  48 +import org.springframework.beans.factory.annotation.Autowired;
  49 +import org.springframework.util.CollectionUtils;
  50 +import org.springframework.util.StringUtils;
  51 +import org.springframework.web.bind.annotation.PostMapping;
  52 +import org.springframework.web.bind.annotation.RequestBody;
  53 +import org.springframework.web.bind.annotation.RequestMapping;
  54 +import org.springframework.web.bind.annotation.RestController;
  55 +
  56 +import static com.google.common.collect.Lists.*;
  57 +
  58 +/**
  59 + * Copyright: Copyright (c) 2017 zteits
  60 + *
  61 + * @ClassName: com.zteits.irain.portal.web.parkinglotdatacentre
  62 + * @Description: 诱导屏portal接口
  63 + * @version: v1.0.0
  64 + * @author: atao
  65 + * @date: 2017/7/4 下午3:10
  66 + * Modification History:
  67 + * Date Author Version Description
  68 + * ---------------------------------------------------------*
  69 + * 2017/7/4 atao v1.0.0 创建
  70 + */
  71 +
  72 +@Api("诱导屏操作接口")
  73 +@RestController
  74 +@RequestMapping("/guideScreen")
  75 +public class GuideScreenController {
  76 +
  77 + private Logger log = LoggerFactory.getLogger(GuideScreenController.class);
  78 + @Autowired
  79 + private GuideScreenService guideScreenService;
  80 +
  81 + @Autowired
  82 + private ParkFreeBerthService parkFreeBerthService;
  83 +
  84 + @Autowired
  85 + private TdCFileService tdCFileService;
  86 +
  87 + @Autowired
  88 + private ParkingLotQueryService parkingLotQueryService;
  89 +
  90 + /**
  91 + * 根据行政区域编码 以及 诱导屏幕等级 查询诱导屏信息
  92 + *
  93 + * @param request 请求入参 必填
  94 + * @return
  95 + */
  96 + @PostMapping("/listGuideScreenByAreaCodes")
  97 + @ApiOperation("根据行政区域编码 以及 诱导屏幕等级 查询诱导屏信息")
  98 + BizResultVO<PageBean<GuideScreenDTO>> listGuideScreenByAreaCodes(
  99 + @RequestBody GuideScreenListByAreaCodesRequest request) {
  100 + request.setSysCode(BasicEnum.SYS_CODE.getValue());
  101 + log.info("根据行政区域编码 以及 诱导屏幕等级 查询诱导屏信息 req={}", JSONObject.toJSONString(request));
  102 + BizResult<PageBean<GuideScreenDTO>> result = guideScreenService.listGuideScreenByAreaCodes(request);
  103 + log.info("根据行政区域编码 以及 诱导屏幕等级 查询诱导屏信息 result={}", JSONObject.toJSONString(result));
  104 + return new BizResultVO<>(result);
  105 + }
  106 +
  107 + /**
  108 + * 根据行政区编码 统计各个诱导屏数量
  109 + *
  110 + * @param request 请求入参 必填
  111 + * @return
  112 + */
  113 + @PostMapping("/statisticsGuideScreenLevelByAreaCodes")
  114 + @ApiOperation("根据行政区编码 统计各个诱导屏数量")
  115 + BizResultVO<List<GuideScreenLevelStatisticsDTO>> statisticsGuideScreenLevelByAreaCodes(
  116 + @RequestBody GuideScreenStatisticsByAreaCodesRequest request) {
  117 + request.setSysCode(BasicEnum.SYS_CODE.getValue());
  118 + log.info("根据行政区编码 统计各个诱导屏数量 req={}", JSONObject.toJSONString(request));
  119 + BizResult<List<GuideScreenLevelStatisticsDTO>> result = guideScreenService
  120 + .statisticsGuideScreenLevelByAreaCodes(request);
  121 + log.info("根据行政区编码 统计各个诱导屏数量 result={}", JSONObject.toJSONString(result));
  122 + return new BizResultVO<>(result);
  123 + }
  124 +
  125 + /**
  126 + * 根据区域编码 与级别 查询诱导屏的经纬度
  127 + *
  128 + * @param request 请求入参 必填
  129 + * @return
  130 + */
  131 + @PostMapping("/listGuideScreenGeo")
  132 + @ApiOperation("根据区域编码 与级别 查询诱导屏的经纬度")
  133 + BizResultVO<List<GuideScreenGeoDTO>> listGuideScreenGeo(@RequestBody GuideScreenListGeoRequest request) {
  134 + log.info("根据区域编码 与级别 查询诱导屏的经纬度 req={}", JSONObject.toJSONString(request));
  135 + BizResult<List<GuideScreenGeoDTO>> result = guideScreenService.listGuideScreenGeo(request);
  136 + log.info("根据区域编码 与级别 查询诱导屏的经纬度 result={}", JSONObject.toJSONString(result));
  137 + return new BizResultVO<>(result);
  138 + }
  139 +
  140 + /**
  141 + * 根据诱导牌编号 查询诱导屏信息
  142 + *
  143 + * @param request 请求入参 必填
  144 + * @return
  145 + */
  146 + @ApiOperation("根据诱导牌编号 查询诱导屏信息")
  147 + @PostMapping("/getGuideScreenInfo")
  148 + BizResultVO<GuideInfoVO> getGuideScreenInfo(@RequestBody GuideScreenGetInfoRequest request) {
  149 + BizResultVO<GuideInfoVO> bizResultVO = new BizResultVO<>();
  150 + GuideInfoVO guideInfoVO = new GuideInfoVO();
  151 + log.info("根据诱导牌编号 查询诱导屏信息 req={}", JSONObject.toJSONString(request));
  152 + if (StringUtils.isEmpty(request.getGuideNo())) {
  153 + throw new BizException(ErrorType.PARAMM_NULL, "诱导屏编号");
  154 + }
  155 + GuideScreenGetBaseInfoRequest baseInfoRequest = new GuideScreenGetBaseInfoRequest();
  156 + baseInfoRequest.setDataState(request.getDataState());
  157 + baseInfoRequest.setGuideNo(request.getGuideNo());
  158 + baseInfoRequest.setSysCode(request.getSysCode());
  159 + BizResult<GuideScreenDTO> baseInfoResult = guideScreenService.getBaseGuideScreenInfo(baseInfoRequest);
  160 +
  161 + if (ResultUtils.isError(baseInfoResult)) {
  162 + throw new BizException(baseInfoResult.getErrCode(), baseInfoResult.getErrMsg());
  163 + }
  164 +
  165 + GuideScreenDTO guideScreenDTO = baseInfoResult.getData();
  166 + if (null == guideScreenDTO || StringUtils.isEmpty(guideScreenDTO.getGuideNo()) || StringUtils.isEmpty(
  167 + guideScreenDTO.getGuideName())) {
  168 + throw new BizException(ErrorType.BIZ_ERROR, "诱导屏不存在!");
  169 +
  170 + }
  171 + guideInfoVO.setGuideNo(guideScreenDTO.getGuideNo());
  172 + guideInfoVO.setLevel(guideScreenDTO.getLevel());
  173 +
  174 + if (1 == guideInfoVO.getLevel()) {
  175 + log.info("查询一级诱导屏信息");
  176 + guideInfoVO = getFirstGuideInfo(guideInfoVO, request.getSysCode());
  177 + } else if (2 == guideInfoVO.getLevel()) {
  178 + log.info("查询二级诱导屏信息");
  179 + guideInfoVO = getSecondGuideInfo(guideInfoVO, request.getSysCode());
  180 + } else if (3 == guideInfoVO.getLevel()) {
  181 + log.info("查询三级诱导屏信息");
  182 + guideInfoVO = getThridGuideInfo(guideInfoVO, request.getSysCode());
  183 +
  184 + } else {
  185 + log.info("未匹配到诱导屏等级信息");
  186 + }
  187 +
  188 + log.info("根据诱导牌编号 查询诱导屏信息 result={}", JSONObject.toJSONString(guideInfoVO));
  189 +
  190 + bizResultVO.setData(guideInfoVO);
  191 + bizResultVO.setCode(ErrorType.BIZ_SUCCESS.getCode());
  192 + bizResultVO.setMsg("成功");
  193 + return bizResultVO;
  194 + }
  195 +
  196 + /**
  197 + * 获取一级诱导信息
  198 + *
  199 + * @param guideInfoVO
  200 + * @return
  201 + */
  202 + private GuideInfoVO getFirstGuideInfo(GuideInfoVO guideInfoVO, String sysCode) {
  203 +
  204 + FirstGuideInfoVO firstGuideInfoVO = new FirstGuideInfoVO();
  205 + firstGuideInfoVO.setGuideNo(guideInfoVO.getGuideNo());
  206 + firstGuideInfoVO.setLevel(guideInfoVO.getLevel());
  207 +
  208 + SysFileGetBySourceIdAndTypeRequest request = new SysFileGetBySourceIdAndTypeRequest();
  209 + request.setSourceId(guideInfoVO.getGuideNo());
  210 + request.setFileType(SysFileTypeEnum.GuideFirstFile.val());
  211 + request.setSysCode(sysCode);
  212 + BizResult<TdCFileDTO> bizResult = tdCFileService.getSysFileBySourceIdAndType(request);
  213 + if (ResultUtils.isSuccess(bizResult)) {
  214 + firstGuideInfoVO.setFilePath(bizResult.getData().getFilePath());
  215 + } else {
  216 + log.info("未查询到一级诱导图片 sourceId={},type={}", request.getSourceId(), request.getFileType());
  217 + }
  218 +
  219 + //1、根据诱导屏编号查询一级诱导屏图片配置信息
  220 + GuideFirstInfoConfigQueryRequest guideFirstInfoConfigQueryRequest = new GuideFirstInfoConfigQueryRequest();
  221 + guideFirstInfoConfigQueryRequest.setGuideNo(guideInfoVO.getGuideNo());
  222 + guideFirstInfoConfigQueryRequest.setSysCode(sysCode);
  223 + BizResult<List<GuideFirstInfoConfigDTO>> guideConfigsResult = guideScreenService
  224 + .queryFirstGuideInfoConfigByGuideNo(
  225 + guideFirstInfoConfigQueryRequest);
  226 +
  227 + //2、组装配置信息
  228 + if (ResultUtils.isError(guideConfigsResult)) {
  229 + throw new BizException(guideConfigsResult.getErrCode(), guideConfigsResult.getErrMsg());
  230 + }
  231 + List<GuideFirstInfoConfigDTO> guideConfigs = guideConfigsResult.getData();
  232 +
  233 + //3、根据停车场编码 查询空余车位数
  234 + List<String> plNos = newArrayList();
  235 + guideConfigs.forEach(item->{plNos.add(item.getPlNo());});
  236 + ParkFreeBerthGetByPlnoRequest parkFreeBerthGetByPlnoRequest = new ParkFreeBerthGetByPlnoRequest();
  237 + parkFreeBerthGetByPlnoRequest.setSysCode(sysCode);
  238 + parkFreeBerthGetByPlnoRequest.setPlNos(plNos);
  239 + BizResult<Map<String, Integer>> result = parkFreeBerthService.getParkFreeBerthByPlno(parkFreeBerthGetByPlnoRequest);
  240 + log.info("空余车位信息查询,返回信息为:result={}", JSONObject.toJSONString(result));
  241 +
  242 + Map<String,Integer> freeBerthsMap = ResultUtils.getBizResultData(result);
  243 +
  244 + for (GuideFirstInfoConfigDTO dto : guideConfigs) {
  245 +
  246 + Integer freeNum = freeBerthsMap.get(dto.getPlNo());
  247 +
  248 + //4、根据停车场编码查询车辆总数
  249 + //4.1先从缓存中查询
  250 + ParkingLotDTO parkingLotDTO = ParkingLotCacheUtil.getParkLotByPlNo(dto.getPlNo());
  251 + if (null == parkingLotDTO) {
  252 + //4.2 缓存中不存在,调用dubbo服务查询
  253 + QueryParkLotInfoByPkNoRequest queryParkLotInfoByPkNoRequest = new QueryParkLotInfoByPkNoRequest();
  254 + queryParkLotInfoByPkNoRequest.setPklNo(dto.getPlNo());
  255 + queryParkLotInfoByPkNoRequest.setSysCode(sysCode);
  256 + BizResult<ParkingLotDTO> parkingLotDTOBizResult = parkingLotQueryService.QueryParkingLotByPkNo(
  257 + queryParkLotInfoByPkNoRequest);
  258 + log.info("停车场总车位信息查询,返回信息为:result={}", JSONObject.toJSONString(parkingLotDTOBizResult));
  259 + if (ResultUtils.isSuccess(parkingLotDTOBizResult)) {
  260 + parkingLotDTO = parkingLotDTOBizResult.getData();
  261 + }
  262 + }
  263 + Integer allBerthNum = null;
  264 + if (null != parkingLotDTO) {
  265 + allBerthNum = parkingLotDTO.getPlBerthNum();
  266 + }
  267 +
  268 + firstGuideInfoVO.setConfigs(dto.getPlNo(), dto.getPlNameHeight(), dto.getPlNameWidth(), dto.getFreeHeight(),
  269 + dto.getFreeWidth(), freeNum, allBerthNum);
  270 +
  271 + }
  272 +
  273 + return firstGuideInfoVO;
  274 +
  275 + }
  276 +
  277 + /**
  278 + * 获取二级诱导信息
  279 + *
  280 + * @param guideInfoVO
  281 + * @return
  282 + */
  283 + private GuideInfoVO getSecondGuideInfo(GuideInfoVO guideInfoVO, String sysCode) {
  284 +
  285 + SecondGuideInfoVO secondGuideInfoVO = new SecondGuideInfoVO();
  286 + secondGuideInfoVO.setGuideNo(guideInfoVO.getGuideNo());
  287 + secondGuideInfoVO.setLevel(guideInfoVO.getLevel());
  288 + GuideScreenGetInfoRequest request = new GuideScreenGetInfoRequest();
  289 + request.setGuideNo(guideInfoVO.getGuideNo());
  290 + request.setDataState(DataStatusEnum.DATA_STATUS_VALID.value());
  291 + request.setSysCode(sysCode);
  292 + BizResult<List<GuideParkRelDTO>> bizResult = guideScreenService.getGuideScreenInfo(request);
  293 +
  294 + if (ResultUtils.isError(bizResult)) {
  295 + throw new BizException(bizResult.getErrCode(), bizResult.getErrMsg());
  296 + }
  297 + List<GuideParkRelDTO> guideParkRelDTOS = bizResult.getData();
  298 + //3、根据停车场编码 查询空余车位数
  299 + List<String> plNos = newArrayList();
  300 + guideParkRelDTOS.forEach(item->{plNos.add(item.getPlNo());});
  301 + ParkFreeBerthGetByPlnoRequest parkFreeBerthGetByPlnoRequest = new ParkFreeBerthGetByPlnoRequest();
  302 + parkFreeBerthGetByPlnoRequest.setSysCode(sysCode);
  303 + parkFreeBerthGetByPlnoRequest.setPlNos(plNos);
  304 + BizResult<Map<String, Integer>> result = parkFreeBerthService.getParkFreeBerthByPlno(parkFreeBerthGetByPlnoRequest);
  305 + log.info("空余车位信息查询,返回信息为:result={}", JSONObject.toJSONString(result));
  306 +
  307 +
  308 + for (GuideParkRelDTO dto : guideParkRelDTOS) {
  309 + Integer freeBerth = result.getData().get(dto.getPlNo());
  310 + secondGuideInfoVO.addGuideDetail(dto.getPlNo(), dto.getPlName(), freeBerth, dto.getGuidePoint());
  311 + }
  312 +
  313 + return secondGuideInfoVO;
  314 +
  315 + }
  316 +
  317 + /**
  318 + * 获取三级诱导信息
  319 + *
  320 + * @param guideInfoVO
  321 + * @return
  322 + */
  323 + private GuideInfoVO getThridGuideInfo(GuideInfoVO guideInfoVO, String sysCode) {
  324 + GuideScreenGetInfoRequest request = new GuideScreenGetInfoRequest();
  325 + request.setSysCode(sysCode);
  326 + request.setGuideNo(guideInfoVO.getGuideNo());
  327 + request.setDataState(DataStatusEnum.DATA_STATUS_VALID.value());
  328 + BizResult<List<GuideParkRelDTO>> bizResult = guideScreenService.getGuideScreenInfo(request);
  329 + if (ResultUtils.isError(bizResult)) {
  330 + throw new BizException(bizResult.getErrCode(), bizResult.getErrMsg());
  331 + }
  332 + ThirdGuidInfoVO thirdGuidInfoVO = new ThirdGuidInfoVO();
  333 + thirdGuidInfoVO.setGuideNo(guideInfoVO.getGuideNo());
  334 + thirdGuidInfoVO.setLevel(guideInfoVO.getLevel());
  335 + if (!CollectionUtils.isEmpty(bizResult.getData())) {
  336 + GuideParkRelDTO guideParkRelDTO = bizResult.getData().get(0);
  337 + thirdGuidInfoVO.setHighLimitNum(guideParkRelDTO.getHighLimitNum());
  338 + thirdGuidInfoVO.setHighLimitStatus(guideParkRelDTO.getHighLimitStatus());
  339 + thirdGuidInfoVO.setSharpTurnStatus(guideParkRelDTO.getSharpTurnStatus());
  340 + thirdGuidInfoVO.setTimeSystem(guideParkRelDTO.getTimeSystem());
  341 + thirdGuidInfoVO.setFloor(guideParkRelDTO.getFloor());
  342 + thirdGuidInfoVO.setFloorStatus(guideParkRelDTO.getFloorStatus());
  343 + ParkFreeBerthGetByPlnoRequest temp = new ParkFreeBerthGetByPlnoRequest();
  344 + temp.setSysCode(sysCode);
  345 + List<String> plNos = newArrayList();
  346 + plNos.add(guideParkRelDTO.getPlNo());
  347 + temp.setPlNos(plNos );
  348 + BizResult<Map<String,Integer>> result = parkFreeBerthService.getParkFreeBerthByPlno(temp);
  349 + if (ResultUtils.isError(result)) {
  350 + log.info("空余车位信息查询报错,返回信息为:result={}", JSONObject.toJSONString(result));
  351 + thirdGuidInfoVO.setFreeNum(null);
  352 + } else {
  353 + thirdGuidInfoVO.setFreeNum(result.getData().get(guideParkRelDTO.getPlNo()));
  354 + }
  355 + }
  356 +
  357 + return thirdGuidInfoVO;
  358 + }
  359 +
  360 + /**
  361 + * 查询诱导屏信息(用于地图展示)
  362 + *
  363 + * @param request 请求入参
  364 + * @return
  365 + */
  366 + @PostMapping("/listGuideScreenForMap")
  367 + @ApiOperation("查询所有诱导屏信息用于地图展示")
  368 + BizResultVO<PageBean<GuideScreenDTO>> listGuideScreenForMap(
  369 + @RequestBody GuideScreenListByAreaCodesRequest request) {
  370 + BaseInfo info = new BaseInfo();
  371 + info.setPageSize(100);
  372 + request.setSysCode(BasicEnum.SYS_CODE.getValue());
  373 + request.setBaseRequest(info);
  374 + BizResult<PageBean<GuideScreenDTO>> result = guideScreenService.listGuideScreenByAreaCodes(request);
  375 + log.info("查询所有诱导屏信息用于地图展示 result={}", JSONObject.toJSONString(result));
  376 + return new BizResultVO<>(result);
  377 + }
  378 +
  379 +}
... ...
src/main/java/com/zteits/irain/portal/web/govclouds/HotSpotAreaController.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/web/govclouds/HotSpotAreaController.java
  1 +/**
  2 + *
  3 + */
  4 +package com.zteits.irain.portal.web.govclouds;
  5 +
  6 +import java.util.List;
  7 +import java.util.Map;
  8 +import java.util.Map.Entry;
  9 +import java.util.Set;
  10 +
  11 +import javax.validation.Valid;
  12 +
  13 +import org.apache.commons.lang3.StringUtils;
  14 +import org.slf4j.Logger;
  15 +import org.slf4j.LoggerFactory;
  16 +import org.springframework.util.CollectionUtils;
  17 +import org.springframework.web.bind.annotation.PostMapping;
  18 +import org.springframework.web.bind.annotation.RequestBody;
  19 +import org.springframework.web.bind.annotation.RequestMapping;
  20 +import org.springframework.web.bind.annotation.RequestParam;
  21 +import org.springframework.web.bind.annotation.RestController;
  22 +
  23 +import com.alibaba.fastjson.JSON;
  24 +import com.clouds.common.cache.park.ParkingLotGeoCacheUtil;
  25 +import com.clouds.common.cache.sys.SysCodeValueCacheUtil;
  26 +import com.clouds.common.constants.CodeValKindEnum;
  27 +import com.clouds.common.utils.SMSNotification;
  28 +import com.clouds.common.web.BizController;
  29 +import com.clouds.common.web.vo.BizResultVO;
  30 +import com.google.common.collect.Lists;
  31 +import com.google.common.collect.Sets;
  32 +import com.zteits.clouds.api.apibase.constants.LonLatTypeEnum;
  33 +import com.zteits.clouds.api.dto.govclouds.dto.ParkinglotMarkerDTO;
  34 +import com.zteits.clouds.api.dto.govclouds.param.CenterPOIInfoRequest;
  35 +import com.zteits.clouds.api.dto.govclouds.param.WarningNoticeRequest;
  36 +import com.zteits.clouds.api.dto.park.dto.ParkinglotAndGeoInfoDTO;
  37 +import com.zteits.irain.portal.vo.govclouds.CenterPOIInfoVO;
  38 +
  39 +import io.swagger.annotations.Api;
  40 +import io.swagger.annotations.ApiOperation;
  41 +
  42 +/**
  43 + * @author hxz
  44 + *
  45 + */
  46 +@Api(value="停车数据LBS 热点区域",description="停车数据LBS 热点区域")
  47 +@RestController
  48 +@RequestMapping("/hotspot")
  49 +public class HotSpotAreaController extends BizController {
  50 + private static final Logger logger = LoggerFactory.getLogger(HotSpotAreaController.class);
  51 +
  52 + @ApiOperation("热点区域-热点周边停车场")
  53 + @PostMapping("/parkinglots")
  54 + public BizResultVO<List<ParkinglotMarkerDTO>> getParkinglotsInHotSpotRound(@Valid @RequestBody List<CenterPOIInfoRequest> request) {
  55 + logger.info("poi 中心点{}", request);
  56 + List<ParkinglotMarkerDTO> list = Lists.newArrayList();
  57 + //去重
  58 + Set<String> distinctPlNos = Sets.newHashSet();
  59 + for (CenterPOIInfoRequest centerPOIInfoRequest : request) {
  60 + List<ParkinglotAndGeoInfoDTO> andGeoInfoDTOs = ParkingLotGeoCacheUtil.queryParkLotsWithCoordinate(LonLatTypeEnum.LON_LAT_TYPE_1,centerPOIInfoRequest.getLongitude(), centerPOIInfoRequest.getLatitude(), centerPOIInfoRequest.getRadius()+0.00, null);
  61 + if(CollectionUtils.isEmpty(andGeoInfoDTOs)){
  62 + continue;
  63 + }
  64 + for (ParkinglotAndGeoInfoDTO parkinglotAndGeoInfoDTO : andGeoInfoDTOs) {
  65 + ParkinglotMarkerDTO markerDTO = new ParkinglotMarkerDTO();
  66 + String plno = parkinglotAndGeoInfoDTO.getPlNo();
  67 + if(distinctPlNos.contains(plno)){
  68 + continue;
  69 + }
  70 + distinctPlNos.add(plno);
  71 + markerDTO.setPlNo(parkinglotAndGeoInfoDTO.getPlNo());
  72 + markerDTO.setAddress(parkinglotAndGeoInfoDTO.getPlAddress());
  73 + markerDTO.setLatitude(parkinglotAndGeoInfoDTO.getLatId().doubleValue());
  74 + markerDTO.setLongitude(parkinglotAndGeoInfoDTO.getLonId().doubleValue());
  75 + markerDTO.setParkinglotName(parkinglotAndGeoInfoDTO.getPlName());
  76 + markerDTO.setTotalBerthNum(parkinglotAndGeoInfoDTO.getPlBerthNum());
  77 + list.add(markerDTO);
  78 + }
  79 + }
  80 + logger.info("已获得热点区域 {}", list);
  81 + return new BizResultVO<List<ParkinglotMarkerDTO>>().setData(list);
  82 + }
  83 +
  84 + @ApiOperation("获取某个城市的热点区域坐标")
  85 + @PostMapping("/getHotspotByCityId")
  86 + public BizResultVO<List<CenterPOIInfoVO>> getCenterPOIs(@RequestParam String cityId,@RequestParam String sysCode){
  87 + logger.info("获取城市:"+cityId+" 的热点区域坐标");
  88 + Map<String, String> map = SysCodeValueCacheUtil.queryCodeValueAndNames(null, CodeValKindEnum.GOV_CLOUDS_HOTSPOT_AREA_, cityId);
  89 + List<CenterPOIInfoVO> centerPOIInfoVOs = Lists.newArrayList();
  90 + if(map!=null && !map.isEmpty()){
  91 + for (Entry<String, String> entry : map.entrySet()) {
  92 + String name = entry.getValue();
  93 + CenterPOIInfoVO infoVO = new CenterPOIInfoVO();
  94 + infoVO.setName(name);
  95 + String[] geo = entry.getKey().split(",");
  96 + Double lon = Double.valueOf(geo[0]);
  97 + Double lat = Double.valueOf(geo[1]);
  98 + infoVO.setLatitude(lat);
  99 + infoVO.setLongitude(lon);
  100 + centerPOIInfoVOs.add(infoVO);
  101 + }
  102 + }
  103 + return new BizResultVO<List<CenterPOIInfoVO>>().setData(centerPOIInfoVOs);
  104 + }
  105 +
  106 + @ApiOperation("热点区域 预警下发")
  107 + @PostMapping("/smsWarningNotice")
  108 + public BizResultVO<Boolean> smsWarningNotice(@RequestBody WarningNoticeRequest request) throws Exception {
  109 + logger.info("热点区域 预警下发:"+JSON.toJSONString(request));
  110 + List<String> phones = request.getPhones();
  111 + for (String phone: phones) {
  112 + if(StringUtils.isBlank(phone)){
  113 + continue;
  114 + }
  115 + // sms notify
  116 + //判断是否开启短信发送
  117 + String isopensmssend = SysCodeValueCacheUtil.queryCodeValue(CodeValKindEnum.HOTAREA_IS_OPEN_SMS_SEND);
  118 + if(StringUtils.isBlank(isopensmssend)||isopensmssend.equalsIgnoreCase("FALSE")){
  119 + logger.info("没有配置是否开启短信发送开关,或短信发送开关为false,不下发短信");
  120 + }else{
  121 + SMSNotification.sendSms(phone, request.getContent(), null);
  122 + }
  123 + }
  124 + return new BizResultVO<Boolean>().setData(true);
  125 + }
  126 +}
... ...
src/main/java/com/zteits/irain/portal/web/govclouds/ParkingContrailController.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/web/govclouds/ParkingContrailController.java
  1 +package com.zteits.irain.portal.web.govclouds;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.List;
  5 +
  6 +import javax.servlet.http.HttpServletRequest;
  7 +import javax.servlet.http.HttpServletResponse;
  8 +
  9 +import org.slf4j.Logger;
  10 +import org.slf4j.LoggerFactory;
  11 +import org.springframework.beans.BeanUtils;
  12 +import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.stereotype.Controller;
  14 +import org.springframework.util.CollectionUtils;
  15 +import org.springframework.web.bind.annotation.PostMapping;
  16 +import org.springframework.web.bind.annotation.RequestBody;
  17 +import org.springframework.web.bind.annotation.RequestMapping;
  18 +import org.springframework.web.bind.annotation.ResponseBody;
  19 +
  20 +import com.alibaba.fastjson.JSONObject;
  21 +import com.clouds.common.web.BizController;
  22 +import com.clouds.common.web.vo.BizResultVO;
  23 +import com.zteits.clouds.api.apibase.bean.BizResult;
  24 +import com.zteits.clouds.api.apibase.bean.PageBean;
  25 +import com.zteits.clouds.api.dto.govclouds.dto.ParkingCountForTypeDTO;
  26 +import com.zteits.clouds.api.dto.govclouds.dto.ParkingTrackDTO;
  27 +import com.zteits.clouds.api.dto.govclouds.param.QueryParkingCountRequest;
  28 +import com.zteits.clouds.api.dto.govclouds.param.QueryParkingTrackRequest;
  29 +import com.zteits.clouds.api.service.govclouds.ParkPreferenceService;
  30 +import com.zteits.irain.portal.vo.govclouds.ParkingBusiCircleForTypeVO;
  31 +import com.zteits.irain.portal.vo.govclouds.ParkingCountForTypeVO;
  32 +
  33 +import io.swagger.annotations.Api;
  34 +import io.swagger.annotations.ApiOperation;
  35 +/**
  36 + * 政府云平台--->数据分析--->停车轨迹.<br/>
  37 + *
  38 + * Copyright: Copyright (c) 2017 zteits
  39 + *
  40 + * @ClassName: ParkingContrailController.java
  41 + * @Description:
  42 + * @version: v1.0.0
  43 + * @author: wangfs
  44 + * @date: 2017年7月13日 上午9:36:52
  45 + * Modification History:
  46 + * Date Author Version Description
  47 + *---------------------------------------------------------*
  48 + * 2017年7月13日 wangfs v1.0.0 创建
  49 + */
  50 +@Api(value = "政府云平台--->数据分析--->停车轨迹", description = "政府云平台--->数据分析--->停车轨迹")
  51 +@Controller
  52 +@RequestMapping("/parkingContrail")
  53 +public class ParkingContrailController extends BizController{
  54 +
  55 + private static final Logger logger = LoggerFactory.getLogger(ParkingContrailController.class);
  56 + @Autowired
  57 + private ParkPreferenceService parkPreferenceService;
  58 +
  59 + @ApiOperation("停车编好->饼图")
  60 + @PostMapping("/parkingCountForPlType")
  61 + @ResponseBody
  62 + public BizResultVO<List<ParkingCountForTypeVO>> parkingCountForPlType(@RequestBody QueryParkingCountRequest parkingCountRequest,HttpServletRequest request, HttpServletResponse response) throws Exception{
  63 + BizResult<List<ParkingCountForTypeVO>> result = new BizResult<List<ParkingCountForTypeVO>>();
  64 + List<ParkingCountForTypeVO> list = new ArrayList<ParkingCountForTypeVO>();
  65 + logger.info("---begin停车轨迹-->停车编好->饼图Controller,入参="+JSONObject.toJSON(parkingCountRequest));
  66 + BizResult<List<ParkingCountForTypeDTO>> bizResult =parkPreferenceService.queryParkingCountForPlType(parkingCountRequest);
  67 + //int sumCurrentParkCount = 0;
  68 + if(bizResult != null && !CollectionUtils.isEmpty(bizResult.getData())){
  69 + for(ParkingCountForTypeDTO dto:bizResult.getData()){
  70 + if(dto != null){
  71 + //sumCurrentParkCount+= dto.getCurrentParkCount();
  72 + ParkingCountForTypeVO parkingCountForTypeVO = new ParkingCountForTypeVO();
  73 + BeanUtils.copyProperties(dto, parkingCountForTypeVO);
  74 + list.add(parkingCountForTypeVO);
  75 + }
  76 + }
  77 +
  78 + }
  79 + result.setErrCode(bizResult.getErrCode());
  80 + result.setErrMsg(bizResult.getErrMsg());
  81 + result.setData(list);
  82 + logger.info("---begin停车轨迹-->停车编好->饼图Controller,结果="+result);
  83 +
  84 + return new BizResultVO<List<ParkingCountForTypeVO>>(result);
  85 + }
  86 +
  87 +
  88 + @ApiOperation("停车商圈属性对应的停车数量->柱状图")
  89 + @PostMapping("/parkingCountForBusiCircle")
  90 + @ResponseBody
  91 + public BizResultVO<List<ParkingBusiCircleForTypeVO>> parkingCountForBusiCircle(@RequestBody QueryParkingCountRequest parkingCountRequest,HttpServletRequest request, HttpServletResponse response) throws Exception{
  92 + BizResultVO<List<ParkingBusiCircleForTypeVO>> result = new BizResultVO<List<ParkingBusiCircleForTypeVO>>();
  93 + List<ParkingBusiCircleForTypeVO> list = new ArrayList<ParkingBusiCircleForTypeVO>();
  94 + logger.info("---begin停车轨迹-->停车商圈属性对应的停车数量->柱状图Controller,入参="+JSONObject.toJSON(parkingCountRequest));
  95 + BizResult<List<ParkingCountForTypeDTO>> bizResult =parkPreferenceService.queryParkingBusiCircleForPlType(parkingCountRequest);
  96 + if(bizResult != null && !CollectionUtils.isEmpty(bizResult.getData())){
  97 + for(ParkingCountForTypeDTO dto:bizResult.getData()){
  98 + if(dto != null){
  99 + ParkingBusiCircleForTypeVO parkingBusiCircleForTypeVO = new ParkingBusiCircleForTypeVO();
  100 + BeanUtils.copyProperties(dto, parkingBusiCircleForTypeVO);
  101 + list.add(parkingBusiCircleForTypeVO);
  102 + }
  103 + }
  104 + }
  105 + result.setData(list);
  106 + logger.info("---begin停车轨迹-->停车商圈属性对应的停车数量->柱状图Controller,结果="+result);
  107 + return result;
  108 + }
  109 +
  110 + @ApiOperation("停车车轨迹")
  111 + @PostMapping("/queryParkingTrack")
  112 + @ResponseBody
  113 + public BizResultVO<ParkingTrackDTO> queryParkingTrack(@RequestBody QueryParkingTrackRequest queryParkingTrackRequest,HttpServletRequest request, HttpServletResponse response) throws Exception{
  114 + BizResultVO<List<ParkingTrackDTO>> result = new BizResultVO<List<ParkingTrackDTO>>();
  115 + logger.info("---begin停车轨迹-->根据车牌查询该车的行车轨迹Controller,入参={}",JSONObject.toJSON(queryParkingTrackRequest));
  116 + BizResult<ParkingTrackDTO> bizResult =parkPreferenceService.queryParkingTrack(queryParkingTrackRequest);
  117 + logger.info("---begin停车轨迹-->根据车牌查询该车的行车轨迹Controller,结果={}",result);
  118 + return new BizResultVO<ParkingTrackDTO>(bizResult);
  119 + }
  120 +
  121 +
  122 +
  123 +
  124 +
  125 +}
  126 +
  127 +
  128 +
  129 +
  130 +
  131 +
  132 +
  133 +
  134 +
  135 +
  136 +
  137 +
  138 +
  139 +
  140 +
... ...
src/main/java/com/zteits/irain/portal/web/govclouds/ParkingLBSController.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/web/govclouds/ParkingLBSController.java
  1 +package com.zteits.irain.portal.web.govclouds;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.List;
  5 +import java.util.Map;
  6 +
  7 +import org.slf4j.Logger;
  8 +import org.slf4j.LoggerFactory;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.web.bind.annotation.PostMapping;
  11 +import org.springframework.web.bind.annotation.RequestBody;
  12 +import org.springframework.web.bind.annotation.RequestMapping;
  13 +import org.springframework.web.bind.annotation.ResponseBody;
  14 +import org.springframework.web.bind.annotation.RestController;
  15 +
  16 +import com.alibaba.fastjson.JSONObject;
  17 +import com.clouds.common.web.vo.BizResultVO;
  18 +import com.xiaoleilu.hutool.util.CollectionUtil;
  19 +import com.zteits.clouds.api.apibase.bean.BizResult;
  20 +import com.zteits.clouds.api.apibase.bean.PageBean;
  21 +import com.zteits.clouds.api.apibase.constants.ErrorType;
  22 +import com.zteits.clouds.api.apibase.constants.LonLatTypeEnum;
  23 +import com.zteits.clouds.api.apibase.exception.BizException;
  24 +import com.zteits.clouds.api.dto.govclouds.dto.ParkinglotHeatmapDTO;
  25 +import com.zteits.clouds.api.dto.govclouds.dto.ParkinglotHeatmapDayDTO;
  26 +import com.zteits.clouds.api.dto.govclouds.dto.ParkinglotHeatmapHourDTO;
  27 +import com.zteits.clouds.api.dto.govclouds.param.QueryHeatmapByDateRequest;
  28 +import com.zteits.clouds.api.dto.park.dto.ParkingLotDTO;
  29 +import com.zteits.clouds.api.dto.park.param.ParkFreeBerthGetByPlnoRequest;
  30 +import com.zteits.clouds.api.dto.park.param.PlNoQueryBycountryAndParkNameRequest;
  31 +import com.zteits.clouds.api.dto.park.param.QueryParkLotInfoByPkNoRequest;
  32 +import com.zteits.clouds.api.dto.park.param.QueryParkingLotByCountryRequest;
  33 +import com.zteits.clouds.api.service.govclouds.ParkHeatmapService;
  34 +import com.zteits.clouds.api.service.park.ParkFreeBerthService;
  35 +import com.zteits.clouds.api.service.park.ParkingLotQueryService;
  36 +import com.zteits.irain.portal.constant.ParkConstant;
  37 +
  38 +import io.swagger.annotations.Api;
  39 +import io.swagger.annotations.ApiOperation;
  40 +
  41 +/**
  42 + * 停车LBS,相关Controller.<br/>
  43 + *
  44 + * Copyright: Copyright (c) 2017 zteits
  45 + *
  46 + * @ClassName: ParkingLBSController
  47 + * @Description:
  48 + * @version: v1.0.0
  49 + * @author: xiejianpeng
  50 + * @date: 2017年7月7日 下午4:52:41
  51 + * Modification History:
  52 + * Date Author Version Description
  53 + * ---------------------------------------------------------*
  54 + * 2017年7月7日 xiejianpeng v1.0.0 创建
  55 + */
  56 +@RestController
  57 +@Api(value = "数据中心-停车LBS", description = "数据中心-停车LBS")
  58 +@RequestMapping("/parkingLBS")
  59 +public class ParkingLBSController {
  60 +
  61 + private Logger logger = LoggerFactory.getLogger(ParkingLBSController.class);
  62 +
  63 + @Autowired
  64 + private ParkingLotQueryService parkingLotQueryService;
  65 +
  66 + @Autowired
  67 + private ParkHeatmapService parkHeatmapService;
  68 +
  69 + @Autowired
  70 + private ParkFreeBerthService parkFreeBerthService;
  71 +
  72 + @ApiOperation(value = "停车场分页查询-根据市、区县id、停车场名称或地址")
  73 + @PostMapping("/queryParkLotByCountryAndParkName")
  74 + @ResponseBody
  75 + public BizResultVO<PageBean<ParkingLotDTO>> queryParkLotByCountryAndParkName(
  76 + @RequestBody QueryParkingLotByCountryRequest request) {
  77 + logger.info("开始-根据市id、区县id和停车场名称或地址查询停车场信息 req={}", JSONObject.toJSONString(request));
  78 + if(request.getLonLatType()==null){
  79 + //默认百度
  80 + request.setLonLatType(LonLatTypeEnum.LON_LAT_TYPE_1.value());
  81 + }
  82 + if(request.getGeoType()==null){
  83 + //默认停车场坐标
  84 + request.setGeoType(ParkConstant.ParkingLotGeo.GeoType.TYPE_PARKINGLOT);
  85 + }
  86 + BizResult<PageBean<ParkingLotDTO>> result = parkingLotQueryService.queryParkLotByCountryAndParkName(request);
  87 + logger.info("开始-根据市id、区县id和停车场名称或地址查询停车场信息 result={}", JSONObject.toJSONString(result));
  88 + return new BizResultVO<>(result);
  89 + }
  90 +
  91 + @ApiOperation(value = "根据停车场编号查询停车场详细信息")
  92 + @PostMapping("/queryParkingLotByPkNo")
  93 + @ResponseBody
  94 + public BizResultVO<ParkingLotDTO> queryParkingLotByPkNo(@RequestBody QueryParkLotInfoByPkNoRequest request) {
  95 + logger.info("开始-根据停车场编号查询停车场详细信息 req={}", JSONObject.toJSONString(request));
  96 + BizResult<ParkingLotDTO> result = parkingLotQueryService.QueryParkingLotByPkNo(request);
  97 + logger.info("开始-根据停车场编号查询停车场详细信息 result={}", JSONObject.toJSONString(result));
  98 + return new BizResultVO<>(result);
  99 + }
  100 +
  101 + @ApiOperation(value = "根据区县id、停车场名称或地址查询停车场经纬度信息")
  102 + @PostMapping("/queryParkingLotGeoByCountryAndParkName")
  103 + @ResponseBody
  104 + public BizResultVO<List<ParkingLotDTO>> queryParkingLotGeoByCountryAndParkName(@RequestBody
  105 + PlNoQueryBycountryAndParkNameRequest request) {
  106 +
  107 + if (CollectionUtil.isEmpty(request.getCountryId())) {
  108 + throw new BizException(ErrorType.PARAMM_NULL, "区县ID不能为空!");
  109 + }
  110 + if(request.getLonLatType()==null){
  111 + //默认百度
  112 + request.setLonLatType(LonLatTypeEnum.LON_LAT_TYPE_1.value());
  113 + }
  114 + if(request.getGeoType()==null){
  115 + //默认停车场坐标
  116 + request.setGeoType(ParkConstant.ParkingLotGeo.GeoType.TYPE_PARKINGLOT);
  117 + }
  118 + BizResult<List<ParkingLotDTO>> result = parkingLotQueryService.queryParkingLotGeoByCountryAndParkName(request);
  119 + return new BizResultVO<>(result);
  120 + }
  121 +
  122 + /*@ApiOperation(value = "根据停车场编号查询停车场经纬度信息")
  123 + @PostMapping("/queryParkingLotGeoByPkNo")
  124 + @ResponseBody
  125 + public BizResultVO<ParkingLotGeoDTO> queryParkingLotGeoByPkNo(@RequestBody QueryParkLotInfoByPkNoRequest request) {
  126 + logger.info("开始-根据停车场编号查询停车场经纬度 req={}", JSONObject.toJSONString(request));
  127 + if(request.getLonLatType() == null){
  128 + request.setLonLatType(1);
  129 + }
  130 + BizResult<ParkingLotGeoDTO> result = parkingLotGeoQueryService.queryParkingLotGeoByParkNo(request);
  131 + logger.info("开始-根据停车场编号查询停车场经纬度 result={}", JSONObject.toJSONString(result));
  132 + return new BizResultVO<>(result);
  133 + }*/
  134 +
  135 + @ApiOperation(value = "根据停车场编号列表查询停车场空闲车位数")
  136 + @PostMapping("/queryParkFreeBerthsByPkNos")
  137 + @ResponseBody
  138 + public BizResultVO<Map<String, Integer>> queryParkFreeBerthsByPkNos(
  139 + @RequestBody ParkFreeBerthGetByPlnoRequest request) {
  140 + logger.info("开始-根据停车场编号查询停车场经纬度 req={}", JSONObject.toJSONString(request));
  141 + BizResult<Map<String, Integer>> bizResult = parkFreeBerthService.getParkFreeBerthByPlno(request);
  142 + logger.info("开始-根据停车场编号查询停车场经纬度 result={}", JSONObject.toJSONString(bizResult));
  143 + return new BizResultVO<>(bizResult);
  144 + }
  145 +
  146 + @ApiOperation(value = "查询省市的停车热点-按小时统计")
  147 + @PostMapping("/queryParkHeatmapByHour")
  148 + @ResponseBody
  149 + public BizResultVO<List<ParkinglotHeatmapDTO>> queryParkHeatmapByHour(
  150 + @RequestBody QueryHeatmapByDateRequest request) {
  151 + logger.info("开始-查询按小时统计的省市的停车热点 req={}", JSONObject.toJSONString(request));
  152 + /** 查询热力图-小时统计*/
  153 + BizResult<List<ParkinglotHeatmapHourDTO>> result = parkHeatmapService.queryParkHeatmapByHour(request);
  154 + List<ParkinglotHeatmapDTO> heatmapDTOList = new ArrayList<ParkinglotHeatmapDTO>();
  155 + for (ParkinglotHeatmapHourDTO heatmapHourDTO : result.getData()) {
  156 + ParkinglotHeatmapDTO parkinglotHeatmapDTO = new ParkinglotHeatmapDTO();
  157 + parkinglotHeatmapDTO.setLat(heatmapHourDTO.getLat());
  158 + parkinglotHeatmapDTO.setLon(heatmapHourDTO.getLon());
  159 + parkinglotHeatmapDTO.setCurrentParkCount(heatmapHourDTO.getCurrentParkCount());
  160 + heatmapDTOList.add(parkinglotHeatmapDTO);
  161 + }
  162 + BizResultVO<List<ParkinglotHeatmapDTO>> resultVO = new BizResultVO<>();
  163 + resultVO.setData(heatmapDTOList);
  164 + logger.info("结束-查询按小时统计的省市的停车热点 result={}", JSONObject.toJSONString(result));
  165 + return resultVO;
  166 + }
  167 +
  168 + @ApiOperation(value = "查询省市的停车热点-按日期统计")
  169 + @PostMapping("/queryParkHeatmapByDay")
  170 + @ResponseBody
  171 + public BizResultVO<List<ParkinglotHeatmapDTO>> queryParkHeatmapByDay(
  172 + @RequestBody QueryHeatmapByDateRequest request) {
  173 + logger.info("开始-查询按日期统计的省市的停车热点 req={}", JSONObject.toJSONString(request));
  174 + /** 查询热力图-小时统计*/
  175 + BizResult<List<ParkinglotHeatmapDayDTO>> result = parkHeatmapService.queryParkHeatmapByDay(request);
  176 + List<ParkinglotHeatmapDTO> heatmapDTOList = new ArrayList<ParkinglotHeatmapDTO>();
  177 + for (ParkinglotHeatmapDayDTO heatmapDayDTO : result.getData()) {
  178 + ParkinglotHeatmapDTO parkinglotHeatmapDTO = new ParkinglotHeatmapDTO();
  179 + parkinglotHeatmapDTO.setLat(heatmapDayDTO.getLat());
  180 + parkinglotHeatmapDTO.setLon(heatmapDayDTO.getLon());
  181 + parkinglotHeatmapDTO.setCurrentParkCount(heatmapDayDTO.getCurrentParkCount());
  182 + heatmapDTOList.add(parkinglotHeatmapDTO);
  183 + }
  184 + BizResultVO<List<ParkinglotHeatmapDTO>> resultVO = new BizResultVO<>();
  185 + resultVO.setData(heatmapDTOList);
  186 + logger.info("结束-查询按日期统计的省市的停车热点 result={}", JSONObject.toJSONString(result));
  187 + return resultVO;
  188 + }
  189 +
  190 +}
0 191 \ No newline at end of file
... ...
src/main/java/com/zteits/irain/portal/web/govclouds/TbAreaController.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/web/govclouds/TbAreaController.java
  1 +package com.zteits.irain.portal.web.govclouds;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.HashMap;
  5 +import java.util.List;
  6 +import java.util.Map;
  7 +
  8 +import org.slf4j.Logger;
  9 +import org.slf4j.LoggerFactory;
  10 +import org.springframework.beans.factory.annotation.Autowired;
  11 +import org.springframework.beans.factory.annotation.Value;
  12 +import org.springframework.util.CollectionUtils;
  13 +import org.springframework.web.bind.annotation.GetMapping;
  14 +import org.springframework.web.bind.annotation.PostMapping;
  15 +import org.springframework.web.bind.annotation.RequestBody;
  16 +import org.springframework.web.bind.annotation.RequestMapping;
  17 +import org.springframework.web.bind.annotation.RequestParam;
  18 +import org.springframework.web.bind.annotation.RestController;
  19 +
  20 +import com.alibaba.fastjson.JSONObject;
  21 +import com.clouds.common.cache.sys.SysCodeValueCacheUtil;
  22 +import com.clouds.common.constants.CodeValKindEnum;
  23 +import com.clouds.common.web.vo.BizResultVO;
  24 +import com.google.common.collect.Lists;
  25 +import com.zteits.clouds.api.apibase.bean.BizResult;
  26 +import com.zteits.clouds.api.apibase.bean.PageBean;
  27 +import com.zteits.clouds.api.apibase.constants.ErrorType;
  28 +import com.zteits.clouds.api.apibase.exception.BizException;
  29 +import com.zteits.clouds.api.dto.park.param.StatisticParkLotCountByCountryRequest;
  30 +import com.zteits.clouds.api.dto.park.param.UpdateFreeBerthRequest;
  31 +import com.zteits.clouds.api.dto.sys.SysRoleDTO;
  32 +import com.zteits.clouds.api.dto.sys.TbAreaDTO;
  33 +import com.zteits.clouds.api.dto.sys.param.TbAreaQueryRequest;
  34 +import com.zteits.clouds.api.service.sys.TbAreaService;
  35 +import com.zteits.irain.portal.web.irain.UpdateFreeBerthController;
  36 +
  37 +import io.swagger.annotations.Api;
  38 +import io.swagger.annotations.ApiOperation;
  39 +
  40 +/**
  41 + * 区域服务
  42 + *
  43 + * Copyright: Copyright (c) 2017 zteits
  44 + *
  45 + * @ClassName: TbAreaController.java
  46 + * @Description:
  47 + * @version: v1.0.0
  48 + * @author: langlw
  49 + * @date: 2017年7月18日 下午4:32:28 Modification History: Date Author Version
  50 + * Description ---------------------------------------------------------*
  51 + * 2017年7月18日 langlw v1.0.0 创建
  52 + */
  53 +@RestController
  54 +@Api(value = "区域服务", description = "区域服务")
  55 +@RequestMapping("/area")
  56 +public class TbAreaController {
  57 + private static final Logger logger = LoggerFactory.getLogger(TbAreaController.class);
  58 +
  59 + @Value("${project.syscode}")
  60 + private String sysCode;
  61 + @Autowired
  62 + private TbAreaService tbAreaService;
  63 +
  64 + @ApiOperation("查询区域下一级")
  65 + @PostMapping("queryNextLowerLeverById")
  66 + public BizResultVO<List<Map<String, String>>> queryNextLowerLeverById(@RequestBody StatisticParkLotCountByCountryRequest request) {
  67 +
  68 + if (null == request.getCityId()) {
  69 + throw new BizException(ErrorType.PARAMM_NULL, "区域ID");
  70 + }
  71 + logger.info("请求参数:", JSONObject.toJSONString(request));
  72 + Map<String, String> map = SysCodeValueCacheUtil.queryCodeValueAndNames(null, CodeValKindEnum.GOV_CLOUDS_LBS_AREA_, request.getCityId()+"");
  73 + List<Map<String, String>> list=new ArrayList<>();
  74 + map.entrySet().forEach(e->{
  75 + Map<String,String> mapitem = new HashMap<>();
  76 + mapitem.put(e.getKey(), e.getValue());
  77 + list.add(mapitem);
  78 + });
  79 + logger.info("打印json结果:"+JSONObject.toJSONString(list));
  80 + return new BizResultVO<List<Map<String, String>>>().setData(list);
  81 + }
  82 +
  83 +}
... ...
src/main/java/com/zteits/irain/portal/web/irain/IRainParkingController.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/web/irain/IRainParkingController.java
  1 +package com.zteits.irain.portal.web.irain;
  2 +
  3 +import java.util.Date;
  4 +import java.util.HashMap;
  5 +import java.util.Map;
  6 +import java.util.Map.Entry;
  7 +
  8 +import org.slf4j.Logger;
  9 +import org.slf4j.LoggerFactory;
  10 +import org.springframework.beans.factory.annotation.Autowired;
  11 +import org.springframework.beans.factory.annotation.Value;
  12 +import org.springframework.web.bind.annotation.RequestMapping;
  13 +import org.springframework.web.bind.annotation.RequestMethod;
  14 +import org.springframework.web.bind.annotation.RequestParam;
  15 +import org.springframework.web.bind.annotation.RestController;
  16 +
  17 +import com.alibaba.dubbo.common.utils.StringUtils;
  18 +import com.alibaba.fastjson.JSON;
  19 +import com.alibaba.fastjson.JSONArray;
  20 +import com.alibaba.fastjson.JSONObject;
  21 +import com.clouds.common.utils.ExceptionUtil;
  22 +import com.clouds.common.web.BizController;
  23 +import com.zteits.clouds.api.apibase.bean.BaseInfo;
  24 +import com.zteits.clouds.api.apibase.constants.ErrorType;
  25 +import com.zteits.clouds.api.apibase.exception.BizException;
  26 +import com.zteits.clouds.api.dto.park.param.InParkingRequest;
  27 +import com.zteits.clouds.api.dto.park.param.OutParkingRequest;
  28 +import com.zteits.clouds.api.dto.park.param.InterfaceLogSaveRequest;
  29 +import com.zteits.clouds.api.service.park.InterfaceLogService;
  30 +import com.zteits.irain.portal.common.AESPlus;
  31 +import com.zteits.irain.portal.common.HttpClientTutorial;
  32 +import com.zteits.irain.portal.constant.IRainResultEnum;
  33 +import com.zteits.irain.portal.constant.ParkConstant.InterfaceLog;
  34 +import com.zteits.irain.portal.service.interfaces.inoutparklot.InOutParkLotReportService;
  35 +import com.zteits.irain.portal.service.interfaces.inoutparklot.param.RecordInParkLotRequest;
  36 +import com.zteits.irain.portal.service.interfaces.inoutparklot.param.RecordOutParkLotRequest;
  37 +import com.zteits.irain.portal.vo.irain.IRainResponseVO;
  38 +
  39 +import io.swagger.annotations.Api;
  40 +import io.swagger.annotations.ApiOperation;
  41 +
  42 +/**
  43 + * Copyright: Copyright (c) 2017 ZTE-ITS
  44 + *
  45 + * @ClassName: IRainParkingController.java
  46 + * @Description:艾润 进出停车场
  47 + * @version: v1.0.0
  48 + * @author: wangbiao
  49 + * @date: 2017年4月20日 上午11:51:45
  50 + * Modification History:
  51 + * Date Author Version Description
  52 + *---------------------------------------------------------*
  53 + * 2017年4月20日 wangbiao v1.0.0 创建
  54 + */
  55 +@Api(value="艾润 进车上报、出车上报控制",description="艾润 进车上报、出车上报")
  56 +@RestController
  57 +@RequestMapping("/parking")
  58 +public class IRainParkingController extends BizController{
  59 + @Value("${irain.aes}")
  60 + private String irain_aes;
  61 + @Value("${project.syscode}")
  62 + private String sysCode;
  63 + @Value("${server.port}")
  64 + private String serverPort;
  65 +
  66 + private static final Logger logger = LoggerFactory.getLogger(IRainParkingController.class);
  67 +
  68 + @Autowired
  69 + private InterfaceLogService interfaceLogService;
  70 + @Autowired
  71 + private InOutParkLotReportService inOutParkLotReportService;
  72 +
  73 + @ApiOperation("进车上报")
  74 + @RequestMapping(value = "/inParking",method = RequestMethod.POST)
  75 + public IRainResponseVO inParking(@RequestParam(value = "param", required = true) String param){
  76 + BaseInfo baseInfo = new BaseInfo();
  77 + String requestId = baseInfo.getRequestId();
  78 + logger.info("[RequestId:"+requestId+"]irain 进车上报返回加密内容:"+param);
  79 + IRainResponseVO iRainResponseVO = null;
  80 + //记录日志
  81 + InterfaceLogSaveRequest logSaveRequest = new InterfaceLogSaveRequest(sysCode,baseInfo,InterfaceLog.Type.TYPE_IN_PARKING, param,InterfaceLog.FromType.IRAIN);
  82 + //设置未解密的字符串
  83 + logSaveRequest.setEncryptParam(param);
  84 + //设置未同步
  85 + logSaveRequest.setSyncStatus(1);
  86 + try {
  87 + if(StringUtils.isBlank(param)){
  88 + throw new BizException(ErrorType.PARAMM_NULL, "请求报文");
  89 + }
  90 + //解密
  91 + String decryptAESparam = "";
  92 + decryptAESparam = AESPlus.decrypt(irain_aes,param);
  93 + logger.info("[RequestId:"+requestId+"]irain 进车上报返解密:"+decryptAESparam);
  94 + logSaveRequest.setRequestBody(decryptAESparam);
  95 +
  96 + //TODO 临时调用
  97 + this.tmpInvokeOldInOutController("inParking", decryptAESparam);
  98 +
  99 + //组织请求参数
  100 + RecordInParkLotRequest request = new RecordInParkLotRequest();
  101 + request.setFromType(InterfaceLog.FromType.IRAIN);
  102 + request.setSourceType(InterfaceLog.SourceType.GATEWAY);
  103 + request.setSysCode(sysCode);
  104 + JSONObject humbObj = underlineObjConverHumpObj(decryptAESparam);
  105 + InParkingRequest iRainInParkingRequest = JSON.parseObject(humbObj.toJSONString(), InParkingRequest.class);
  106 + request.setInParkLotReq(iRainInParkingRequest);
  107 + //调用进车服务
  108 + Long outId = inOutParkLotReportService.InParkLotRecord(request );
  109 +
  110 + //保存转化之后的请求数据
  111 + logSaveRequest.setRequestConversionBody(JSON.toJSONString(iRainInParkingRequest));
  112 +
  113 + //记录外部主键
  114 + logSaveRequest.setOutId(outId);
  115 + logSaveRequest.setStatus(InterfaceLog.Status.SUCCESS);
  116 + iRainResponseVO = new IRainResponseVO(IRainResultEnum.SUCCESS);
  117 + } catch (Exception e) {
  118 + e.printStackTrace();
  119 + logSaveRequest.setMessage(ExceptionUtil.getTrace(e));
  120 + logSaveRequest.setStatus(InterfaceLog.Status.FAIL);
  121 + iRainResponseVO = new IRainResponseVO(ErrorType.BIZ_ERROR);
  122 + }finally{
  123 + logSaveRequest.setResponseBody(JSONObject.toJSONString(iRainResponseVO));
  124 + logSaveRequest.setResponseTime(new Date());
  125 + //保存日志
  126 + try{
  127 + interfaceLogService.SaveInterfaceLog(logSaveRequest);
  128 + }catch(Exception e){
  129 + e.printStackTrace();
  130 + }
  131 + }
  132 + logger.info("[RequestId:"+requestId+"]irain 进车上报 返回:"+JSONObject.toJSON(iRainResponseVO));
  133 + return iRainResponseVO;
  134 + }
  135 +
  136 + /**
  137 + * 出车上报
  138 + * @param param (aes加密后的JSON字符串)
  139 + */
  140 + @ApiOperation("出车上报")
  141 + @RequestMapping(value = "/outParking" ,method = RequestMethod.POST)
  142 + public IRainResponseVO outParking(@RequestParam(value = "param", required = true) String param){
  143 + BaseInfo baseInfo = new BaseInfo();
  144 + String requestId = baseInfo.getRequestId();
  145 + logger.info("[RequestId:"+requestId+"]irain 出车上报返回加密内容:"+param);
  146 + IRainResponseVO iRainResponseVO = null;
  147 + //记录日志
  148 + InterfaceLogSaveRequest logSaveRequest = new InterfaceLogSaveRequest(sysCode, baseInfo, InterfaceLog.Type.TYPE_OUT_PARKING,
  149 + param, InterfaceLog.FromType.IRAIN);
  150 + //设置未解密的字符串
  151 + logSaveRequest.setEncryptParam(param);
  152 + //设置未同步
  153 + logSaveRequest.setSyncStatus(1);
  154 + try {
  155 + //解密
  156 + String decryptAESparam = "";
  157 + decryptAESparam = AESPlus.decrypt(irain_aes,param);
  158 + logger.info("[RequestId:"+requestId+"]irain 出车上报返解密:"+decryptAESparam);
  159 + logSaveRequest.setRequestBody(decryptAESparam);
  160 +
  161 + //TODO 临时调用
  162 + this.tmpInvokeOldInOutController("outParking", decryptAESparam);
  163 +
  164 + //组织请求参数
  165 + RecordOutParkLotRequest request = new RecordOutParkLotRequest();
  166 + request.setFromType(InterfaceLog.FromType.IRAIN);
  167 + request.setSysCode(sysCode);
  168 + request.setSourceType(InterfaceLog.SourceType.GATEWAY);
  169 + //创建后场请求对象
  170 + JSONObject humbObj = underlineObjConverHumpObj(decryptAESparam);
  171 + OutParkingRequest iRainOutParkingRequest = JSON.parseObject(humbObj.toJSONString(), OutParkingRequest.class);
  172 +
  173 + if(iRainOutParkingRequest == null){
  174 + throw new BizException(ErrorType.PARAMM_NULL,"请求对象");
  175 + }
  176 + request.setOutParkLotReq(iRainOutParkingRequest);
  177 +
  178 + logger.info("调用出车服务请求参数:"+JSON.toJSONString(request));
  179 + Long outId = inOutParkLotReportService.OutParkLotRecord(request );
  180 +
  181 + //保存转化之后的请求数据
  182 + logSaveRequest.setRequestConversionBody(JSON.toJSONString(iRainOutParkingRequest));
  183 +
  184 + //记录外部主键
  185 + logSaveRequest.setOutId(outId);
  186 + logSaveRequest.setStatus(InterfaceLog.Status.SUCCESS);
  187 + iRainResponseVO = new IRainResponseVO(IRainResultEnum.SUCCESS);
  188 + } catch (Exception e) {
  189 + e.printStackTrace();
  190 + logSaveRequest.setMessage(ExceptionUtil.getTrace(e));
  191 + logSaveRequest.setStatus(InterfaceLog.Status.FAIL);
  192 + iRainResponseVO = new IRainResponseVO(ErrorType.BIZ_ERROR);
  193 + }finally{
  194 + logSaveRequest.setResponseBody(JSONObject.toJSONString(iRainResponseVO));
  195 + logSaveRequest.setResponseTime(new Date());
  196 + //保存日志
  197 + try{
  198 + interfaceLogService.SaveInterfaceLog(logSaveRequest);
  199 + }catch(Exception e){
  200 + e.printStackTrace();
  201 + }
  202 +
  203 + }
  204 + logger.info("[RequestId:"+requestId+"]irain 进车上报 返回:"+JSONObject.toJSON(iRainResponseVO));
  205 + return iRainResponseVO;
  206 + }
  207 +
  208 + /**
  209 + * 下划线bean转驼峰bean
  210 + * @return
  211 + * 2017年5月5日 zhaowg
  212 + * @throws IllegalAccessException
  213 + * @throws InstantiationException
  214 + */
  215 + private JSONObject underlineObjConverHumpObj(String param) throws InstantiationException, IllegalAccessException{
  216 + JSONObject humpObj = new JSONObject();
  217 + JSONObject underlineObj = JSON.parseObject(param);
  218 + for (Entry<String, Object> entry : underlineObj.entrySet()) {
  219 + //下划线key
  220 + String humpName = underlineConverHump(entry.getKey());
  221 + if(humpName.equals("chargeItems") && StringUtils.isNotEmpty((String)entry.getValue())){
  222 + JSONArray chargeItem = JSON.parseArray((String)entry.getValue());
  223 + JSONArray newChargeItems = new JSONArray();
  224 + for (Object object : chargeItem) {
  225 + JSONObject obj = this.underlineObjConverHumpObj(JSON.toJSONString(object));
  226 + newChargeItems.add(obj);
  227 + }
  228 + humpObj.put(humpName,newChargeItems);
  229 + }else if(humpName.equals("inTime") || humpName.equals("outTime") || humpName.equals("time")){
  230 + String value = String.valueOf((Integer)entry.getValue());
  231 + if(value.length()==10){//UNIX时间戳
  232 + humpObj.put(humpName, ((Integer)entry.getValue())*1000L);
  233 + }else{
  234 + humpObj.put(humpName, entry.getValue());
  235 + }
  236 + }else{
  237 + humpObj.put(humpName, entry.getValue());
  238 + }
  239 + }
  240 + return humpObj;
  241 + }
  242 + /**
  243 + * 将下划线转换为驼峰:vpl_own——>vplOwn
  244 + * @param underlineName
  245 + * @return
  246 + * 2017年5月5日 zhaowg
  247 + */
  248 + private String underlineConverHump(String underlineName){
  249 + if(StringUtils.isBlank(underlineName)){
  250 + return "";
  251 + }
  252 + String[] underlines = underlineName.split("_");
  253 + StringBuilder humpName = new StringBuilder();
  254 + for (int i = 0; i < underlines.length; i++) {
  255 + String underline = underlines[i];
  256 + if(i==0){
  257 + humpName.append(underline);
  258 + }else{
  259 + humpName.append(underline.substring(0, 1).toUpperCase()+underline.substring(1));
  260 + }
  261 + }
  262 + return humpName.toString();
  263 + }
  264 + /**
  265 + * 临时解决,调用旧的park-portal 进出场服务
  266 + * @param path
  267 + * @param params
  268 + * 2017年6月27日 zhaowg
  269 + */
  270 + private void tmpInvokeOldInOutController(String path,String param){
  271 + /*String url = "http://127.0.0.1:"+oldServerPort+"/parking/"+path;
  272 + logger.info("开始调用艾润进出场上报旧的服务:"+url);
  273 + new Thread(new Runnable() {
  274 + @Override
  275 + public void run() {
  276 +
  277 + logger.info("开始调用艾润进出场上报旧的服务:"+url);
  278 +
  279 + String decryptAESparam = "";
  280 + try {
  281 + logger.info("调用旧服务加密前:"+param);
  282 + decryptAESparam = AESPlus.encrypt(irain_aes,param);
  283 + logger.info("调用旧服务加密后:"+decryptAESparam);
  284 + } catch (Exception e) {
  285 + logger.info("irain 进车上报返解密异常:"+e);
  286 + }
  287 + Map<String, Object> params = new HashMap<>();
  288 + params.put("param", decryptAESparam);
  289 + String rs ="";
  290 + try {
  291 + rs = HttpClientTutorial.httpPostRequest(url, params);
  292 + logger.info("调用艾润进出场上报旧的服务完成:"+rs);
  293 + } catch (Exception e) {
  294 + logger.error("调用艾润进出场上报旧的服务报错:",e);
  295 + }
  296 +
  297 + }
  298 + }).start();*/
  299 + }
  300 + @RequestMapping(value = "/testIn",method = RequestMethod.POST)
  301 + public String billQuery(String param) {
  302 + String decryptAESparam = "";
  303 + try {
  304 + decryptAESparam = AESPlus.encrypt(irain_aes,param);
  305 + } catch (Exception e) {
  306 + logger.info("irain 进车上报返解密异常:"+e);
  307 + }
  308 + Map<String, Object> params = new HashMap<>();
  309 + params.put("param", decryptAESparam);
  310 + String rs ="";
  311 + try {
  312 + rs = HttpClientTutorial.httpPostRequest("http://127.0.0.1:"+serverPort+"/parking/inParking", params);
  313 + logger.info("irain 查询停车费用返回:" + JSONObject.toJSONString(rs));
  314 + } catch (Exception e) {
  315 + logger.info("irain 查询停车费用出错:" + e);
  316 + }
  317 + return rs;
  318 + }
  319 +
  320 +
  321 + @RequestMapping(value = "/testOut",method = RequestMethod.POST)
  322 + public String billQuery1(String param) {
  323 + String decryptAESparam = "";
  324 + try {
  325 + decryptAESparam = AESPlus.encrypt(irain_aes,param);
  326 + } catch (Exception e) {
  327 + logger.info("irain 进车上报返解密异常:"+e);
  328 + }
  329 + Map<String, Object> params = new HashMap<>();
  330 + params.put("param", decryptAESparam);
  331 + String rs ="";
  332 + try {
  333 + rs = HttpClientTutorial.httpPostRequest("http://127.0.0.1:"+serverPort+"/parking/outParking", params);
  334 + logger.info("irain 查询停车费用返回:" + JSONObject.toJSONString(rs));
  335 + } catch (Exception e) {
  336 + logger.info("irain 查询停车费用出错:" + e);
  337 + }
  338 + return rs;
  339 + }
  340 +
  341 +}
... ...
src/main/java/com/zteits/irain/portal/web/irain/IRainPayController.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/web/irain/IRainPayController.java
  1 +package com.zteits.irain.portal.web.irain;
  2 +
  3 +import java.util.HashMap;
  4 +import java.util.Map;
  5 +
  6 +import org.slf4j.Logger;
  7 +import org.slf4j.LoggerFactory;
  8 +import org.springframework.beans.factory.annotation.Value;
  9 +import org.springframework.web.bind.annotation.RequestMapping;
  10 +import org.springframework.web.bind.annotation.RequestMethod;
  11 +import org.springframework.web.bind.annotation.RestController;
  12 +
  13 +import com.alibaba.fastjson.JSONObject;
  14 +import com.clouds.common.utils.MD5Utils;
  15 +import com.zteits.irain.portal.common.HttpClientTutorial;
  16 +
  17 +/**
  18 + *
  19 + * Copyright: Copyright (c) 2017 ZTE-ITS
  20 + *
  21 + * @ClassName: IRainPayController.java
  22 + * @Description: 支付订单 同步给 艾润
  23 + * @version: v1.0.0
  24 + * @author: wangbiao
  25 + * @date: 2017年4月20日 上午11:51:45 Modification History: Date Author Version
  26 + * Description ---------------------------------------------------------*
  27 + * 2017年4月20日 wangbiao v1.0.0 创建
  28 + */
  29 +@RestController
  30 +@RequestMapping("/pay")
  31 +public class IRainPayController {
  32 + @Value("${irain.url}")
  33 + private String irain_ur;
  34 + @Value("${irain.appid}")
  35 + private String irain_appid;
  36 + @Value("${irain.appsecret}")
  37 + private String irain_appsecret;
  38 + @Value("${irain.park_code}")
  39 + private String park_code;
  40 +
  41 + private static final Logger logger = LoggerFactory.getLogger(IRainPayController.class);
  42 +
  43 + /**
  44 + * 订单支付 中兴智能交通——>艾润
  45 + *
  46 + * @param param (aes加密后的JSON字符串)
  47 + */
  48 + @RequestMapping(value = "/issued",method = RequestMethod.POST)
  49 + public String issued() {
  50 + /**** 以下为模拟入参 实际入参 由app提供-------------------------------------*/
  51 + Long time = System.currentTimeMillis();
  52 + String md5 = MD5Utils.enMD5(irain_appid+irain_appsecret+time);
  53 + Map<String, Object> params = new HashMap<>();
  54 + params.put("appid", irain_appid);
  55 + params.put("sign", md5);
  56 + params.put("timestamp", time);
  57 + params.put("vpl_number", "蒙AS4321");
  58 + params.put("park_code", "734861a1e8656ffa51bdd90829941ca9");
  59 + params.put("amount", 10000);
  60 + String rs="";
  61 + try {
  62 + logger.info("irain 支付订单入参:" + JSONObject.toJSONString(params));
  63 + rs = HttpClientTutorial.httpPostRequest(irain_ur+"/pay/Issued", params);
  64 + logger.info("irain 支付订单返回:" + JSONObject.toJSONString(rs));
  65 + } catch (Exception e) {
  66 + logger.info("irain 支付订单出错:" + e);
  67 + }
  68 + return JSONObject.toJSONString(rs);
  69 + }
  70 +
  71 + @RequestMapping(value = "/test_issued",method = RequestMethod.POST)
  72 + public String test_issued(String vpl_number,Integer amount) {
  73 + /**** 以下为模拟入参 实际入参 由app提供-------------------------------------*/
  74 + Long time = System.currentTimeMillis();
  75 + String md5 = MD5Utils.enMD5(irain_appid+irain_appsecret+time);
  76 + Map<String, Object> params = new HashMap<>();
  77 + params.put("appid", irain_appid);
  78 + params.put("sign", md5);
  79 + params.put("timestamp", time);
  80 + params.put("vpl_number", vpl_number);
  81 + params.put("park_code", park_code);
  82 + params.put("amount", amount);
  83 + String rs="";
  84 + try {
  85 + logger.info("irain 支付订单入参:" + JSONObject.toJSONString(params));
  86 + rs = HttpClientTutorial.httpPostRequest(irain_ur+"/pay/Issued", params);
  87 + logger.info("irain 支付订单返回:" + JSONObject.toJSONString(rs));
  88 + } catch (Exception e) {
  89 + logger.info("irain 支付订单出错:" + e);
  90 + }
  91 + return JSONObject.toJSONString(rs);
  92 + }
  93 +
  94 +}
... ...
src/main/java/com/zteits/irain/portal/web/irain/IRainQueryController.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/web/irain/IRainQueryController.java
  1 +package com.zteits.irain.portal.web.irain;
  2 +
  3 +import java.util.HashMap;
  4 +import java.util.Map;
  5 +
  6 +import org.slf4j.Logger;
  7 +import org.slf4j.LoggerFactory;
  8 +import org.springframework.beans.factory.annotation.Value;
  9 +import org.springframework.web.bind.annotation.RequestMapping;
  10 +import org.springframework.web.bind.annotation.RequestMethod;
  11 +import org.springframework.web.bind.annotation.RestController;
  12 +
  13 +import com.alibaba.fastjson.JSONObject;
  14 +import com.clouds.common.utils.MD5Utils;
  15 +import com.zteits.irain.portal.common.HttpClientTutorial;
  16 +
  17 +/**
  18 + *
  19 + * Copyright: Copyright (c) 2017 ZTE-ITS
  20 + *
  21 + * @ClassName: IRainQueryController.java
  22 + * @Description: 查询艾润 控制器
  23 + * @version: v1.0.0
  24 + * @author: wangbiao
  25 + * @date: 2017年4月20日 上午11:51:45 Modification History: Date Author Version
  26 + * Description ---------------------------------------------------------*
  27 + * 2017年4月20日 wangbiao v1.0.0 创建
  28 + */
  29 +@RestController
  30 +@RequestMapping("/query")
  31 +public class IRainQueryController {
  32 + @Value("${irain.url}")
  33 + private String irain_ur;
  34 + @Value("${irain.appid}")
  35 + private String irain_appid;
  36 + @Value("${irain.appsecret}")
  37 + private String irain_appsecret;
  38 + @Value("${irain.park_code}")
  39 + private String park_code;
  40 +
  41 +
  42 + private static final Logger logger = LoggerFactory.getLogger(IRainQueryController.class);
  43 +
  44 + /**
  45 + * 订单支付 中兴智能交通——>艾润
  46 + *
  47 + * @param param (aes加密后的JSON字符串)
  48 + */
  49 + @RequestMapping(value = "/billQuery", method = RequestMethod.POST)
  50 + public String billQuery(String param) {
  51 + /**** 以下为模拟入参 实际入参 由app提供-------------------------------------*/
  52 +
  53 + Long time = System.currentTimeMillis();
  54 + String md5 = MD5Utils.enMD5(irain_appid+irain_appsecret+time);
  55 + Map<String, Object> params = new HashMap<>();
  56 + params.put("appid", irain_appid);
  57 + params.put("sign", md5);
  58 + params.put("timestamp", time);
  59 + params.put("vpl_number", "蒙AS4321");
  60 + params.put("park_code", "2a94dbdfb232b39f1a1309a13fa11e28");
  61 + String rs = "";
  62 + try {
  63 + logger.info("irain 查询停车费用入参:" + JSONObject.toJSONString(params));
  64 + rs = HttpClientTutorial.httpPostRequest(irain_ur+"/bill/Query", params);
  65 + logger.info("irain 查询停车费用返回:" + JSONObject.toJSONString(rs));
  66 + } catch (Exception e) {
  67 + logger.info("irain 查询停车费用出错:" + e);
  68 + }
  69 + return JSONObject.toJSONString(rs);
  70 + }
  71 +
  72 + @RequestMapping(value = "/test_billQuery", method = RequestMethod.POST)
  73 + public String testBillQuery(String vpl_number) {
  74 + /**** 以下为模拟入参 实际入参 由app提供-------------------------------------*/
  75 +
  76 + Long time = System.currentTimeMillis();
  77 + String md5 = MD5Utils.enMD5(irain_appid+irain_appsecret+time);
  78 + Map<String, Object> params = new HashMap<>();
  79 + params.put("appid", irain_appid);
  80 + params.put("sign", md5);
  81 + params.put("timestamp", time);
  82 + params.put("vpl_number", vpl_number);
  83 + params.put("park_code", park_code);
  84 + String rs = "";
  85 + try {
  86 + logger.info("irain 查询停车费用入参:" + JSONObject.toJSONString(params));
  87 + rs = HttpClientTutorial.httpPostRequest(irain_ur+"/bill/Query", params);
  88 + logger.info("irain 查询停车费用返回:" + JSONObject.toJSONString(rs));
  89 + } catch (Exception e) {
  90 + logger.info("irain 查询停车费用出错:" + e);
  91 + }
  92 + return JSONObject.toJSONString(rs);
  93 + }
  94 +
  95 +}
... ...
src/main/java/com/zteits/irain/portal/web/irain/UpdateFreeBerthController.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/web/irain/UpdateFreeBerthController.java
  1 +package com.zteits.irain.portal.web.irain;
  2 +
  3 +import java.util.List;
  4 +import java.util.Map;
  5 +
  6 +import org.slf4j.Logger;
  7 +import org.slf4j.LoggerFactory;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.beans.factory.annotation.Value;
  10 +import org.springframework.web.bind.annotation.GetMapping;
  11 +import org.springframework.web.bind.annotation.PostMapping;
  12 +import org.springframework.web.bind.annotation.RequestBody;
  13 +import org.springframework.web.bind.annotation.RequestMapping;
  14 +import org.springframework.web.bind.annotation.RequestParam;
  15 +import org.springframework.web.bind.annotation.RestController;
  16 +
  17 +import com.alibaba.fastjson.JSONObject;
  18 +import com.clouds.common.cache.park.ParkingLotCacheUtil;
  19 +import com.clouds.common.cache.sys.SysCodeValueCacheUtil;
  20 +import com.clouds.common.constants.CodeValKindEnum;
  21 +import com.clouds.common.utils.ResultUtils;
  22 +import com.clouds.common.web.vo.BizResultVO;
  23 +import com.google.common.collect.Lists;
  24 +import com.zteits.clouds.api.apibase.bean.BizResult;
  25 +import com.zteits.clouds.api.apibase.constants.ErrorType;
  26 +import com.zteits.clouds.api.apibase.exception.BizException;
  27 +import com.zteits.clouds.api.dto.park.dto.ParkingLotDTO;
  28 +import com.zteits.clouds.api.dto.park.param.QueryParkLotInfoByPkOutNoRequest;
  29 +import com.zteits.clouds.api.dto.park.param.StatisticParkLotCountByCountryRequest;
  30 +import com.zteits.clouds.api.dto.park.param.UpdateFreeBerthRequest;
  31 +import com.zteits.clouds.api.service.park.ParkingLotQueryService;
  32 +import com.zteits.irain.portal.service.interfaces.parklotidleberths.ParkLotIdleBerthsService;
  33 +
  34 +import io.swagger.annotations.Api;
  35 +import io.swagger.annotations.ApiOperation;
  36 +/**
  37 + * 更新空闲车位
  38 + * 被SQL触发器调用
  39 + * Copyright: Copyright (c) 2017 zteits
  40 + *
  41 + * @ClassName: UpdateFreeBerthController.java
  42 + * @Description:
  43 + * @version: v1.0.0
  44 + * @author: langlw
  45 + * @date: 2017年7月18日 上午9:44:36
  46 + * Modification History:
  47 + * Date Author Version Description
  48 + *---------------------------------------------------------*
  49 + * 2017年7月18日 langlw v1.0.0 创建
  50 + */
  51 +@RestController
  52 +@Api(value="更新空闲车位",description="更新空闲车位")
  53 +@RequestMapping("/freeBerth")
  54 +public class UpdateFreeBerthController {
  55 + private static final Logger logger = LoggerFactory.getLogger(UpdateFreeBerthController.class);
  56 +
  57 + @Value("${project.syscode}")
  58 + private String sysCode;
  59 + @Autowired
  60 + private ParkLotIdleBerthsService parkLotIdleBerthsService;
  61 + @Autowired
  62 + private ParkingLotQueryService parkingLotQueryService;
  63 +
  64 +
  65 + @ApiOperation("更新空闲车位总数")
  66 + @GetMapping("updateFreeBerth")
  67 + public BizResultVO<Boolean> getDisplayCountry(@RequestParam String plOutNo,
  68 + @RequestParam Integer fromType,@RequestParam String freeBerth){
  69 + //通过上报停车场编号查询对应的自己内部停车场编号
  70 + logger.info("根据上报的停车场编号["+plOutNo+"]在缓存总没有查询到对应的停车场信息,开始查询数据库");
  71 + QueryParkLotInfoByPkOutNoRequest request = new QueryParkLotInfoByPkOutNoRequest();
  72 + request.setSysCode(sysCode);
  73 + request.setPklOutNo(plOutNo);
  74 + BizResult<ParkingLotDTO> bizResult = parkingLotQueryService.QueryParkingLotByPkOutNo(request );
  75 + ParkingLotDTO parkingLotDTO = ResultUtils.getBizResultData(bizResult);
  76 + String plNo = parkingLotDTO.getPlNo();
  77 + //更新空闲车位数
  78 + UpdateFreeBerthRequest updaterequest=new UpdateFreeBerthRequest();
  79 + updaterequest.setFreeBerths(Integer.valueOf(freeBerth));
  80 + updaterequest.setPlNo(plNo);
  81 + updaterequest.setFromType(fromType);
  82 + updaterequest.setSysCode(sysCode);
  83 + logger.info("请求参数:"+JSONObject.toJSONString(request));
  84 + int freeBerths = parkLotIdleBerthsService.updateAndGetIdleBerthByParkNo(updaterequest.getInoutTime(), updaterequest.getPlNo(), updaterequest.getType(), updaterequest.getFromType(), updaterequest.getFreeBerths());
  85 + logger.info("调用后场服务:更新车位总数", freeBerths);
  86 + return new BizResultVO<Boolean>().setData(true);
  87 + }
  88 +
  89 +
  90 +}
... ...
src/main/java/com/zteits/irain/portal/web/mobile/ParkLotController.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/web/mobile/ParkLotController.java
  1 +package com.zteits.irain.portal.web.mobile;
  2 +
  3 +import java.util.List;
  4 +
  5 +import javax.validation.Valid;
  6 +
  7 +import org.slf4j.Logger;
  8 +import org.slf4j.LoggerFactory;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.beans.factory.annotation.Value;
  11 +import org.springframework.util.CollectionUtils;
  12 +import org.springframework.web.bind.annotation.PostMapping;
  13 +import org.springframework.web.bind.annotation.RequestBody;
  14 +import org.springframework.web.bind.annotation.RequestMapping;
  15 +import org.springframework.web.bind.annotation.RestController;
  16 +
  17 +import com.alibaba.fastjson.JSON;
  18 +import com.clouds.common.cache.park.ParkFreeBerthsCacheUtil;
  19 +import com.clouds.common.cache.park.ParkingLotGeoCacheUtil;
  20 +import com.google.common.collect.Lists;
  21 +import com.zteits.clouds.api.apibase.bean.BaseInfo;
  22 +import com.zteits.clouds.api.apibase.constants.LonLatTypeEnum;
  23 +import com.zteits.clouds.api.dto.park.dto.ParkinglotAndGeoInfoDTO;
  24 +import com.zteits.clouds.api.dto.park.param.GetParkLotRequest;
  25 +import com.zteits.clouds.api.service.park.ParkingLotQueryService;
  26 +import com.zteits.irain.portal.vo.mobile.BizResultMobileVO;
  27 +import com.zteits.irain.portal.vo.mobile.ParkingspotVO;
  28 +
  29 +import io.swagger.annotations.Api;
  30 +import io.swagger.annotations.ApiOperation;
  31 +/**
  32 + * 停车场信息查询
  33 + *
  34 + * Copyright: Copyright (c) 2017 zteits
  35 + *
  36 + * @ClassName: ParkingLotController.java
  37 + * @Description:
  38 + * @version: v1.0.0
  39 + * @author: zhaowg
  40 + * @date: 2017年6月6日 上午11:31:10
  41 + * Modification History:
  42 + * Date Author Version Description
  43 + *---------------------------------------------------------*
  44 + * 2017年6月6日 zhaowg v1.0.0 创建
  45 + */
  46 +@Api(value = "停车场信息查询",description="停车场信息查询")
  47 +@RestController
  48 +@RequestMapping("/parklot")
  49 +public class ParkLotController {
  50 +
  51 + @Value("${project.syscode}")
  52 + private String sysCode;
  53 +
  54 + private static final Logger logger = LoggerFactory.getLogger(ParkLotController.class);
  55 +
  56 + @Autowired
  57 + private ParkingLotQueryService tabParkingLotService;
  58 +
  59 + @ApiOperation("查询停车场信息")
  60 + @PostMapping("queryParkingLots")
  61 + public BizResultMobileVO<List<ParkingspotVO>> queryParkingLots(@Valid @RequestBody GetParkLotRequest request){
  62 + if(request.getBaseRequest()==null){
  63 + request.setBaseRequest(new BaseInfo());
  64 + }
  65 + logger.info("["+request.getBaseRequest().getRequestId()+"]开始调用查询停车场信息:"+JSON.toJSONString(request));
  66 + List<ParkinglotAndGeoInfoDTO> dtos = Lists.newArrayList();
  67 + if(request.getType().equals(GetParkLotRequest.TYPE_RECORD_COUNT)){
  68 + dtos = ParkingLotGeoCacheUtil.queryParkLotsWithDistanceAndCoordinateByCountAsc
  69 + (LonLatTypeEnum.LON_LAT_TYPE_3,Double.valueOf(request.getLongitude()), Double.valueOf(request.getLatitude()), Long.valueOf(request.getLimit()));
  70 + }else if(request.getType().equals(GetParkLotRequest.TYPE_DISTANCE)){
  71 + dtos = ParkingLotGeoCacheUtil.queryParkLotsWithDistanceAndCoordinateByAsc
  72 + (LonLatTypeEnum.LON_LAT_TYPE_3,Double.valueOf(request.getLongitude()), Double.valueOf(request.getLatitude()), Double.valueOf(request.getLimit()), null);
  73 + }
  74 + List<ParkingspotVO> vos = Lists.newArrayList();
  75 + if(!CollectionUtils.isEmpty(dtos)){
  76 + for (ParkinglotAndGeoInfoDTO dto : dtos) {
  77 + ParkingspotVO vo = new ParkingspotVO();
  78 + vo.setAddress(dto.getPlAddress());
  79 + vo.setChargeDetail(dto.getPlRate()==null?new String[]{}:dto.getPlRate().split("#"));
  80 + vo.setDescription("");
  81 + vo.setDistance(dto.getDistance());
  82 + //获取空闲车位数
  83 + Integer idleberths = ParkFreeBerthsCacheUtil.getFreeBerthsByPlNo(dto.getPlNo());
  84 + vo.setIdleberths(idleberths);
  85 + vo.setLatitude(dto.getLatId().doubleValue());
  86 + vo.setLongitude(dto.getLonId().doubleValue());
  87 + vo.setName(dto.getPlName());
  88 + vo.setPhone(dto.getServiceTel());
  89 + vo.setPklNo(dto.getPlNo());
  90 + vo.setRatedescription("");
  91 + vo.setTotalberths(dto.getPlBerthNum());
  92 + vo.setType(dto.getPlType());
  93 + vos.add(vo);
  94 + }
  95 + }
  96 + BizResultMobileVO<List<ParkingspotVO>> bizResultVO = new BizResultMobileVO<List<ParkingspotVO>>();
  97 + bizResultVO.setCode("0");
  98 + bizResultVO.setSuccessful("true");
  99 + bizResultVO.setTotal(vos.size()+"");
  100 + bizResultVO.setData(vos);
  101 + logger.info("["+request.getBaseRequest().getRequestId()+"]调用查询停车场信息成功:"+JSON.toJSONString(bizResultVO));
  102 + return bizResultVO;
  103 + }
  104 +
  105 +}
... ...
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/BerthsStatisticController.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/BerthsStatisticController.java
  1 +/**
  2 + *
  3 + */
  4 +package com.zteits.irain.portal.web.parkinglotcloudplatform.datastatistic;
  5 +
  6 +import java.sql.Timestamp;
  7 +import java.text.SimpleDateFormat;
  8 +import java.util.ArrayList;
  9 +import java.util.Calendar;
  10 +import java.util.Date;
  11 +import java.util.List;
  12 +import java.util.Map;
  13 +import java.util.Map.Entry;
  14 +
  15 +import javax.servlet.http.HttpServletRequest;
  16 +import javax.servlet.http.HttpServletResponse;
  17 +
  18 +import org.apache.poi.xssf.usermodel.XSSFSheet;
  19 +import org.slf4j.Logger;
  20 +import org.slf4j.LoggerFactory;
  21 +import org.springframework.beans.factory.annotation.Autowired;
  22 +import org.springframework.beans.factory.annotation.Value;
  23 +import org.springframework.stereotype.Controller;
  24 +import org.springframework.web.bind.annotation.GetMapping;
  25 +import org.springframework.web.bind.annotation.PostMapping;
  26 +import org.springframework.web.bind.annotation.RequestBody;
  27 +import org.springframework.web.bind.annotation.RequestMapping;
  28 +import org.springframework.web.bind.annotation.RequestParam;
  29 +import org.springframework.web.bind.annotation.ResponseBody;
  30 +
  31 +import com.alibaba.dubbo.common.utils.CollectionUtils;
  32 +import com.alibaba.fastjson.JSON;
  33 +import com.clouds.common.cache.park.ParkingLotCacheUtil;
  34 +import com.clouds.common.redis.RedisCacheUtil;
  35 +import com.clouds.common.utils.DateUtil;
  36 +import com.clouds.common.utils.ResultUtils;
  37 +import com.clouds.common.utils.excle.ExcelUtil;
  38 +import com.clouds.common.utils.excle.ExcleFillDateManager;
  39 +import com.clouds.common.utils.excle.Layouter;
  40 +import com.clouds.common.web.BizController;
  41 +import com.clouds.common.web.vo.BizResultVO;
  42 +import com.clouds.common.web.vo.EasyUIDataGridVO;
  43 +import com.google.common.collect.Lists;
  44 +import com.google.common.collect.Maps;
  45 +import com.zteits.clouds.api.apibase.bean.BaseInfo;
  46 +import com.zteits.clouds.api.apibase.bean.BizResult;
  47 +import com.zteits.clouds.api.apibase.bean.PageBean;
  48 +import com.zteits.clouds.api.apibase.constants.ErrorType;
  49 +import com.zteits.clouds.api.apibase.exception.BizException;
  50 +import com.zteits.clouds.api.dto.park.dto.ParkingLotDTO;
  51 +import com.zteits.clouds.api.dto.park.dto.ParkingLotUseStatisticDTO;
  52 +import com.zteits.clouds.api.dto.park.dto.ParkingLotUseStatisticMaxAndMinDTO;
  53 +import com.zteits.clouds.api.dto.park.param.ParkingLotUseStatisticForPageRequest;
  54 +import com.zteits.clouds.api.service.park.ParkingLotUseStatisticService;
  55 +import com.zteits.irain.portal.constant.ParkConstant;
  56 +import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.LineChartVO;
  57 +import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.LineChartVO.SerieVO;
  58 +
  59 +import io.swagger.annotations.Api;
  60 +import io.swagger.annotations.ApiOperation;
  61 +
  62 +/**
  63 + * @author hxz
  64 + *
  65 + */
  66 +@Api("停车场云平台 数据统计 车位使用管理")
  67 +@Controller
  68 +@RequestMapping("/parking")
  69 +public class BerthsStatisticController extends BizController {
  70 + private static final Logger logger = LoggerFactory.getLogger(BerthsStatisticController.class);
  71 + @Value("${project.syscode}")
  72 + private String sysCode;
  73 + @Autowired
  74 + private ParkingLotUseStatisticService parkingLotStatisticService;
  75 +
  76 + /**
  77 + *
  78 + * @param requestObject
  79 + * @return
  80 + */
  81 + @ApiOperation("统计摘要")
  82 + @PostMapping("getstatisticsummary")
  83 + @ResponseBody
  84 + public BizResultVO<ParkingLotUseStatisticMaxAndMinDTO> GetStatisticSummary(
  85 + @RequestBody ParkingLotUseStatisticForPageRequest requestObject) {
  86 + Calendar beginc = Calendar.getInstance();
  87 + beginc.setTime(requestObject.getBeginTime());
  88 + int beginYear = beginc.get(Calendar.YEAR);
  89 + int beginMonth = beginc.get(Calendar.MONTH) + 1;
  90 + int beginDay = beginc.get(Calendar.DAY_OF_MONTH);
  91 +
  92 + Calendar endc = Calendar.getInstance();
  93 + endc.setTime(requestObject.getEndTime());
  94 + int endYear = endc.get(Calendar.YEAR);
  95 + int endMonth = endc.get(Calendar.MONTH) + 1;
  96 + int endDay = endc.get(Calendar.DAY_OF_MONTH);
  97 +
  98 + if (beginYear == endYear && beginMonth == endMonth && beginDay == endDay) {
  99 + // 2表示按每小时统计
  100 + requestObject.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1HOUR);
  101 + } else {
  102 + // 3表示按每天统计
  103 + requestObject.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1DAY);
  104 + }
  105 + BizResult<ParkingLotUseStatisticMaxAndMinDTO> respondObject = parkingLotStatisticService
  106 + .QueryBerthUseStatisticMaxAndMin(requestObject);
  107 + return new BizResultVO<>(respondObject);
  108 + }
  109 +
  110 + @ApiOperation("获取车位使用情况统计列表")
  111 + @PostMapping("getstatisticlist")
  112 + @ResponseBody
  113 + public BizResultVO<EasyUIDataGridVO<ParkingLotUseStatisticDTO>> GetParkingPlaceStatistic(
  114 + @RequestBody ParkingLotUseStatisticForPageRequest requestObject)
  115 + throws InstantiationException, IllegalAccessException {
  116 + if (null == requestObject.getBeginTime() || null==requestObject.getEndTime()) {
  117 + throw new BizException(ErrorType.PARAMM_NULL, "开始时间和结束时间");
  118 + }
  119 +
  120 + Calendar beginc = Calendar.getInstance();
  121 + beginc.setTime(requestObject.getBeginTime());
  122 + int beginYear = beginc.get(Calendar.YEAR);
  123 + int beginMonth = beginc.get(Calendar.MONTH) + 1;
  124 + int beginDay = beginc.get(Calendar.DAY_OF_MONTH);
  125 +
  126 + Calendar endc = Calendar.getInstance();
  127 + endc.setTime(requestObject.getEndTime());
  128 + int endYear = endc.get(Calendar.YEAR);
  129 + int endMonth = endc.get(Calendar.MONTH) + 1;
  130 + int endDay = endc.get(Calendar.DAY_OF_MONTH);
  131 +
  132 + if (beginYear == endYear && beginMonth == endMonth && beginDay == endDay) {
  133 + // 2表示按每小时统计
  134 + requestObject.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1HOUR);
  135 + } else {
  136 + // 3表示按每天统计
  137 + requestObject.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1DAY);
  138 + }
  139 + BizResult<PageBean<ParkingLotUseStatisticDTO>> respondObject = parkingLotStatisticService
  140 + .queryParkingLotUseStatisticForPage(requestObject);
  141 + return returnJqGridData(respondObject, ParkingLotUseStatisticDTO.class);
  142 + }
  143 +
  144 + @ApiOperation("导出车流量数据统计excel")
  145 + @GetMapping("exportBerthStatisticExcel")
  146 + public void excelParkingLotUseStatistic(@RequestParam String beginTime, @RequestParam String endTime,
  147 + @RequestParam String plNos, HttpServletRequest requests, HttpServletResponse response) {
  148 + ParkingLotUseStatisticForPageRequest request = new ParkingLotUseStatisticForPageRequest();
  149 + request.setSysCode(sysCode);
  150 + request.setBeginTime(DateUtil.to_date(beginTime, DateUtil.DATETIME_FORMAT));
  151 + request.setEndTime(DateUtil.to_date(endTime, DateUtil.DATETIME_FORMAT));
  152 + List<String> plNoslist = new ArrayList<>();
  153 + plNoslist.add(plNos);
  154 + request.setPlNos(plNoslist);
  155 + request.setBaseRequest(new BaseInfo(1, 0));
  156 +
  157 + Calendar beginc = Calendar.getInstance();
  158 + beginc.setTime(request.getBeginTime());
  159 + int beginYear = beginc.get(Calendar.YEAR);
  160 + int beginMonth = beginc.get(Calendar.MONTH) + 1;
  161 + int beginDay = beginc.get(Calendar.DAY_OF_MONTH);
  162 +
  163 + Calendar endc = Calendar.getInstance();
  164 + endc.setTime(request.getEndTime());
  165 + int endYear = endc.get(Calendar.YEAR);
  166 + int endMonth = endc.get(Calendar.MONTH) + 1;
  167 + int endDay = endc.get(Calendar.DAY_OF_MONTH);
  168 +
  169 + if (beginYear == endYear && beginMonth == endMonth && beginDay == endDay) {
  170 + // 2表示按每小时统计
  171 + request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1HOUR);
  172 + } else {
  173 + // 3表示按每天统计
  174 + request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1DAY);
  175 + }
  176 + BizResult<PageBean<ParkingLotUseStatisticDTO>> bizResult = parkingLotStatisticService
  177 + .queryParkingLotUseStatisticForPage(request);
  178 + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  179 + SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd");
  180 + String[] title = new String[] { "时间", "空置率", "周转率" };
  181 + String sheetName = "车位管理";
  182 + String fileName = "车位管理" + format2.format(new Date());
  183 + // 1.创建excel信息
  184 + XSSFSheet workSheet = ExcelUtil.createExcel(sheetName);
  185 + // 2.设置excel表头和表体
  186 + Layouter.buildReport(workSheet, title, 0, 0);
  187 + // 3.填充数据
  188 + List<Object[]> contentList = new ArrayList<Object[]>();
  189 + List<ParkingLotUseStatisticDTO> list = new ArrayList<>();
  190 + if (CollectionUtils.isNotEmpty(bizResult.getData().getDataList())) {
  191 + list = bizResult.getData().getDataList();
  192 + }
  193 + for (ParkingLotUseStatisticDTO e : list) {
  194 + Object[] obj = new Object[title.length];
  195 + int index = 0;
  196 + obj[index++] = format.format(e.getStatisticBeginTime());
  197 + obj[index++] = e.getFreeRatio() *100 +"%";
  198 + obj[index++] = e.getTurnoverRatio();
  199 + contentList.add(obj);
  200 + }
  201 + ExcleFillDateManager fillUserManager = new ExcleFillDateManager();
  202 + fillUserManager.fillSalesOrga(workSheet, title, contentList, 2);
  203 + // 4.excel输出配置
  204 + ExcelUtil.write(response, workSheet, fileName);
  205 + }
  206 +
  207 + /**
  208 + * 根据时间获取车位空置率折线图
  209 + *
  210 + * @param request
  211 + * @return
  212 + */
  213 + @ApiOperation("根据时间获取车位空置率折线图")
  214 + @PostMapping("getFreeRatioBerthForLineChart")
  215 + @ResponseBody
  216 + public BizResultVO<LineChartVO> getFreeRatioBerthForLineChart(
  217 + @RequestBody ParkingLotUseStatisticForPageRequest request) {
  218 + //根据权限获取停车场列表
  219 + if (null == request.getBeginTime() || null==request.getEndTime()) {
  220 + throw new BizException(ErrorType.PARAMM_NULL, "开始时间和结束时间");
  221 + }
  222 + logger.info("根据停车场编号获取该停车场车位空置率折线图");
  223 + Calendar beginTime = Calendar.getInstance();
  224 + beginTime.setTime(request.getBeginTime());
  225 +
  226 + Calendar endTime = Calendar.getInstance();
  227 + endTime.setTime(request.getEndTime());
  228 +
  229 + Long dayDifference = DateUtil.getTimeDifference(new Timestamp(request.getEndTime().getTime()),
  230 + new Timestamp(request.getBeginTime().getTime()));
  231 + List<String> xAxisData = Lists.newArrayList();
  232 + String dateType="";
  233 + int berthRatio=ParkConstant.ParkingLotUseStatistic.BerthRatioType.FREE;
  234 + if (dayDifference == 0L) {
  235 + // 1个小时为一个时间戳
  236 + request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1HOUR);
  237 + int totaltimestampCount = endTime.get(Calendar.HOUR_OF_DAY);
  238 + for (int i = 0; i <= totaltimestampCount; i++) {
  239 + String hour = String.format("%02d", i);
  240 + xAxisData.add(hour + ":" + "00");
  241 + }
  242 + request.setBaseRequest(new BaseInfo(1, 0));
  243 + dateType="HH:mm";
  244 + LineChartVO freeBerthRatios=getFreeBerthRatios(request, xAxisData, dateType,berthRatio);
  245 + return new BizResultVO<LineChartVO>().setData(freeBerthRatios);
  246 + } else if (dayDifference <= 3L) {
  247 + // 1小时为一个时间戳
  248 + request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1HOUR);
  249 + int totaltimestampCount = endTime.get(Calendar.HOUR_OF_DAY);
  250 + String day = "";
  251 + String month = "";
  252 + for (int i = 0; i < dayDifference.intValue(); i++) {
  253 + beginTime.add(Calendar.DAY_OF_MONTH, 1);
  254 + int beginMonth = beginTime.get(Calendar.MONTH) + 1;
  255 + int beginDay = beginTime.get(Calendar.DAY_OF_MONTH);
  256 + month = String.format("%02d", (beginMonth));
  257 + day = String.format("%02d", (beginDay));
  258 + for (int j = 0; j < totaltimestampCount; j++) {
  259 + String hour = String.format("%02d", (j));
  260 + xAxisData.add(month + "-" + day + " " + hour);
  261 + }
  262 + }
  263 + request.setBaseRequest(new BaseInfo(1, 0));
  264 + dateType="MM-dd HH";
  265 + LineChartVO freeBerthRatios=getFreeBerthRatios(request, xAxisData, dateType,berthRatio);
  266 + return new BizResultVO<LineChartVO>().setData(freeBerthRatios);
  267 + } else {
  268 + // 1天为一个时间戳
  269 + request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1DAY);
  270 + for (int i = 0; i < dayDifference.intValue(); i++) {
  271 + beginTime.add(Calendar.DAY_OF_MONTH, 1);
  272 + int beginMonth = beginTime.get(Calendar.MONTH) + 1;
  273 + int beginDay = beginTime.get(Calendar.DAY_OF_MONTH);
  274 + String month = String.format("%02d", (beginMonth));
  275 + String day = String.format("%02d", (beginDay));
  276 + xAxisData.add(month + "-" + day);
  277 + }
  278 + }
  279 + request.setBaseRequest(new BaseInfo(1, 0));
  280 + dateType="MM-dd";
  281 + LineChartVO freeBerthRatios=getFreeBerthRatios(request, xAxisData, dateType,berthRatio);
  282 + return new BizResultVO<LineChartVO>().setData(freeBerthRatios);
  283 +
  284 + }
  285 +
  286 + /**
  287 + * 根据时间获取车位周转率折线图
  288 + *
  289 + * @param request
  290 + * @return
  291 + */
  292 + @ApiOperation("根据时间获取车位周转率折线图")
  293 + @PostMapping("getTurnOverBerthForLineChart")
  294 + @ResponseBody
  295 + public BizResultVO<LineChartVO> getTurnOverBerthForLineChart(
  296 + @RequestBody ParkingLotUseStatisticForPageRequest request) {
  297 +
  298 + logger.info("根据停车场编号获取该停车场车位周转率折线图");
  299 + if (null == request.getBeginTime() || null==request.getEndTime()) {
  300 + throw new BizException(ErrorType.PARAMM_NULL, "开始时间和结束时间");
  301 + }
  302 + Calendar beginTime = Calendar.getInstance();
  303 + beginTime.setTime(request.getBeginTime());
  304 +
  305 + Calendar endTime = Calendar.getInstance();
  306 + endTime.setTime(request.getEndTime());
  307 +
  308 + Long dayDifference = DateUtil.getTimeDifference(new Timestamp(request.getEndTime().getTime()),
  309 + new Timestamp(request.getBeginTime().getTime()));
  310 + List<String> xAxisData = Lists.newArrayList();
  311 + String dateType="";
  312 + int berthRatio=ParkConstant.ParkingLotUseStatistic.BerthRatioType.TURNOVER;
  313 + if (dayDifference == 0L) {
  314 + //1个小时为一个时间戳
  315 + request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1HOUR);
  316 + int totaltimestampCount = endTime.get(Calendar.HOUR_OF_DAY);
  317 + for (int j = 0; j <= totaltimestampCount; j++) {
  318 + String hour = String.format("%02d", (j));
  319 + xAxisData.add(hour + ":" + "00");
  320 + }
  321 +
  322 + request.setBaseRequest(new BaseInfo(1, 0));
  323 + dateType="HH:mm";
  324 + LineChartVO freeBerthRatios=getFreeBerthRatios(request, xAxisData, dateType,berthRatio);
  325 + return new BizResultVO<LineChartVO>().setData(freeBerthRatios);
  326 + } else if (dayDifference <= 3L) {
  327 + // 1小时为一个时间戳
  328 + request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1HOUR);
  329 + int totaltimestampCount = endTime.get(Calendar.HOUR_OF_DAY);
  330 + String day = "";
  331 + String month = "";
  332 + for (int i = 0; i < dayDifference.intValue(); i++) {
  333 + beginTime.add(Calendar.DAY_OF_MONTH, 1);
  334 + int beginMonth = beginTime.get(Calendar.MONTH) + 1;
  335 + int beginDay = beginTime.get(Calendar.DAY_OF_MONTH);
  336 + month = String.format("%02d", (beginMonth));
  337 + day = String.format("%02d", (beginDay));
  338 + for (int j = 0; j < totaltimestampCount; j++) {
  339 + String hour = String.format("%02d", (j));
  340 + xAxisData.add(month + "-" + day + " " + hour);
  341 + }
  342 + }
  343 + request.setBaseRequest(new BaseInfo(1, 0));
  344 + dateType="MM-dd HH";
  345 + LineChartVO freeBerthRatios=getFreeBerthRatios(request, xAxisData, dateType,berthRatio);
  346 + return new BizResultVO<LineChartVO>().setData(freeBerthRatios);
  347 + } else {
  348 + // 1天为一个时间戳
  349 + request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1DAY);
  350 + for (int i = 0; i < dayDifference.intValue(); i++) {
  351 + beginTime.add(Calendar.DAY_OF_MONTH, 1);
  352 + int beginMonth = beginTime.get(Calendar.MONTH) + 1;
  353 + int beginDay = beginTime.get(Calendar.DAY_OF_MONTH);
  354 + String month = String.format("%02d", (beginMonth));
  355 + String day = String.format("%02d", (beginDay));
  356 + xAxisData.add(month + "-" + day);
  357 + }
  358 + request.setBaseRequest(new BaseInfo(1, 0));
  359 + dateType="MM-dd";
  360 + LineChartVO freeBerthRatios=getFreeBerthRatios(request, xAxisData, dateType,berthRatio);
  361 + return new BizResultVO<LineChartVO>().setData(freeBerthRatios);
  362 + }
  363 +
  364 + }
  365 +
  366 +
  367 + private LineChartVO getFreeBerthRatios(ParkingLotUseStatisticForPageRequest request,
  368 + List<String> xAxisData,String dateType ,int berthRatio){
  369 + logger.info("调用DUBBO服务入参:" + JSON.toJSONString(request));
  370 + BizResult<PageBean<ParkingLotUseStatisticDTO>> bizResult = parkingLotStatisticService
  371 + .queryParkingLotUseStatisticForPage(request);
  372 + PageBean<ParkingLotUseStatisticDTO> pageBean = ResultUtils.getBizResultData(bizResult);
  373 + List<ParkingLotUseStatisticDTO> useStatisticDTOs = Lists.newArrayList();
  374 + if (pageBean != null) {
  375 + useStatisticDTOs = pageBean.getDataList();
  376 + }
  377 +
  378 + // 停车场编号和名称对应关系
  379 + Map<String, String> parkNameMap = Maps.newHashMap();
  380 + // 通过停车场,和统计时间分组
  381 + Map<String, Map<String, Double>> parkLotMap = Maps.newHashMap();
  382 + if (!CollectionUtils.isEmpty(useStatisticDTOs)) {
  383 + for (ParkingLotUseStatisticDTO statisticDTO : useStatisticDTOs) {
  384 + String key = statisticDTO.getPlNo();
  385 + parkNameMap.put(key, statisticDTO.getPlName());
  386 + String statisBeginTime = DateUtil.getDateString(statisticDTO.getStatisticBeginTime(), dateType);
  387 + // 保存空置率
  388 + if (!parkLotMap.containsKey(key)) {
  389 + Map<String, Double> timeAndVal = Maps.newHashMap();
  390 + if(ParkConstant.ParkingLotUseStatistic.BerthRatioType.FREE == berthRatio){
  391 + timeAndVal.put(statisBeginTime, statisticDTO.getFreeRatio() * 100);
  392 + parkLotMap.put(key, timeAndVal);
  393 + }else if(ParkConstant.ParkingLotUseStatistic.BerthRatioType.TURNOVER == berthRatio){
  394 + timeAndVal.put(statisBeginTime, statisticDTO.getTurnoverRatio() * 100);
  395 + parkLotMap.put(key, timeAndVal);
  396 + }
  397 + } else {
  398 + if(ParkConstant.ParkingLotUseStatistic.BerthRatioType.FREE == berthRatio){
  399 + parkLotMap.get(key).put(statisBeginTime, statisticDTO.getFreeRatio() * 100);
  400 + }else if(ParkConstant.ParkingLotUseStatistic.BerthRatioType.TURNOVER == berthRatio){
  401 + parkLotMap.get(key).put(statisBeginTime, statisticDTO.getTurnoverRatio() * 100);
  402 + }
  403 + }
  404 +
  405 + }
  406 + }
  407 + //判断是否包含所有待查询的停车场信息
  408 + if(request.getPlNos().size()>parkLotMap.size()){
  409 + for (String plNo:request.getPlNos()) {
  410 + if(!parkLotMap.containsKey(plNo)){
  411 + ParkingLotDTO parkingLotDTO=ParkingLotCacheUtil.getParkLotByPlNo(plNo);
  412 + parkNameMap.put(plNo, parkingLotDTO.getPlName());
  413 + parkLotMap.put(plNo, Maps.newHashMap());
  414 + }
  415 + }
  416 + }
  417 +
  418 + // 封装车位统计信息
  419 + LineChartVO freeBerthRatios = new LineChartVO();
  420 + List<String> freeBerthRatios_legendData = Lists.newArrayList();
  421 + freeBerthRatios_legendData.addAll(parkNameMap.values());
  422 + freeBerthRatios.setLegendData(freeBerthRatios_legendData);
  423 + freeBerthRatios.setxAxisData(xAxisData);
  424 + List<SerieVO> series = Lists.newArrayList();
  425 +
  426 + if (parkLotMap != null && !parkLotMap.isEmpty()) {
  427 + for (Entry<String, Map<String, Double>> parkLotEntry : parkLotMap.entrySet()) {
  428 + SerieVO serieVO = new SerieVO();
  429 + // 获取停车场名称
  430 + String name = parkNameMap.get(parkLotEntry.getKey());
  431 + serieVO.setName(name);
  432 + // 设置每个时间戳对应的空置率
  433 + Map<String, Double> freeRatioMaps = parkLotEntry.getValue();
  434 + // 保存上一次的空置率,当某个时间点没有数据时,则保持和上次一致
  435 + Integer lastFreeRatio = 0;
  436 + List<Integer> freeRations = Lists.newArrayList();
  437 + for (String timestamp : xAxisData) {
  438 + if (freeRatioMaps.containsKey(timestamp)) {
  439 + lastFreeRatio = freeRatioMaps.get(timestamp).intValue();
  440 + }else{
  441 + lastFreeRatio = 0;
  442 + }
  443 + freeRations.add(lastFreeRatio);
  444 + }
  445 + serieVO.setData(freeRations);
  446 + series.add(serieVO);
  447 + }
  448 + }
  449 + freeBerthRatios.setSeries(series);
  450 + return freeBerthRatios;
  451 + }
  452 +
  453 +}
... ...
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/BillManageController.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/BillManageController.java
  1 +package com.zteits.irain.portal.web.parkinglotcloudplatform.datastatistic;
  2 +
  3 +import java.math.BigDecimal;
  4 +import java.text.SimpleDateFormat;
  5 +import java.util.ArrayList;
  6 +import java.util.Date;
  7 +import java.util.List;
  8 +import java.util.Map;
  9 +
  10 +import javax.servlet.http.HttpServletRequest;
  11 +import javax.servlet.http.HttpServletResponse;
  12 +
  13 +import org.apache.poi.xssf.usermodel.XSSFSheet;
  14 +import org.slf4j.Logger;
  15 +import org.slf4j.LoggerFactory;
  16 +import org.springframework.beans.factory.annotation.Autowired;
  17 +import org.springframework.stereotype.Controller;
  18 +import org.springframework.web.bind.annotation.RequestBody;
  19 +import org.springframework.web.bind.annotation.RequestMapping;
  20 +import org.springframework.web.bind.annotation.RequestMethod;
  21 +import org.springframework.web.bind.annotation.ResponseBody;
  22 +
  23 +import com.alibaba.dubbo.common.utils.StringUtils;
  24 +import com.alibaba.fastjson.JSONArray;
  25 +import com.alibaba.fastjson.JSONObject;
  26 +import com.clouds.common.constants.SessionEnum;
  27 +import com.clouds.common.entity.UserInfo;
  28 +import com.clouds.common.utils.excle.ExcelUtil;
  29 +import com.clouds.common.utils.excle.ExcleFillDateManager;
  30 +import com.clouds.common.utils.excle.Layouter;
  31 +import com.clouds.common.web.BizController;
  32 +import com.clouds.common.web.SessionCommUtil;
  33 +import com.zteits.clouds.api.apibase.bean.BizResult;
  34 +import com.zteits.clouds.api.apibase.bean.PageBean;
  35 +import com.zteits.clouds.api.dto.clouds.dto.BillManageDTO;
  36 +import com.zteits.clouds.api.dto.clouds.param.BillQueryRequest;
  37 +import com.zteits.clouds.api.dto.pay.param.TdCompanyParkQueryRequest;
  38 +import com.zteits.clouds.api.service.clouds.BillManageForDayService;
  39 +import com.zteits.clouds.api.service.pay.TdCustCompanyService;
  40 +
  41 +import io.swagger.annotations.Api;
  42 +import io.swagger.annotations.ApiOperation;
  43 +
  44 +/**
  45 + * 日账单controller类.<br/>
  46 + *
  47 + * Copyright: Copyright (c) 2017 zteits
  48 + *
  49 + * @ClassName: BillManageController.java
  50 + * @Description:
  51 + * @version: v1.0.0
  52 + * @author: wangfs
  53 + * @date: 2017年6月30日 下午1:14:16
  54 + * Modification History:
  55 + * Date Author Version Description
  56 + *---------------------------------------------------------*
  57 + * 2017年6月30日 wangfs v1.0.0 创建
  58 + */
  59 +
  60 +@Api(value = "停车场云平台 日账单", description = "停车场云平台 日账单")
  61 +@Controller
  62 +@RequestMapping("/bill")
  63 +public class BillManageController extends BizController {
  64 + private Logger logger = LoggerFactory.getLogger(BillManageController.class);
  65 + @Autowired
  66 + private BillManageForDayService billManageForDayService;
  67 +
  68 + @Autowired
  69 + private TdCustCompanyService tdCustCompanyService;
  70 +
  71 + @Autowired
  72 + private SessionCommUtil sessionCommUtil;
  73 +
  74 + @Autowired
  75 + private Map<String,TdCustCompanyService> map;
  76 +
  77 + private SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  78 +
  79 + @ApiOperation("日账汇总单查询")
  80 + @RequestMapping("/queryBillforDayForPage")
  81 + @ResponseBody
  82 + public void queryBillforDayTotalForPage(@RequestBody BillQueryRequest billQueryRequest, HttpServletRequest request,
  83 + HttpServletResponse response) throws Exception {
  84 + TdCustCompanyService sert = map.get("tdCustCompanyService");
  85 + logger.info("---begin--日账汇总单查询调用后场dubbo服务,入参={}", JSONObject.toJSON(billQueryRequest));
  86 + System.out.println("seesionId="+request.getSession().getId());
  87 + UserInfo userInfo = sessionCommUtil.getUserInfo();
  88 + logger.info("从session中获取的用户信息={}" + JSONObject.toJSONString(userInfo));
  89 + TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest();
  90 + if (userInfo != null) {
  91 +
  92 + tdCompanyParkQueryRequest.setSysCode(billQueryRequest.getSysCode());
  93 + tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds());
  94 + tdCompanyParkQueryRequest.setSessionId(request.getSession().getId());
  95 + billQueryRequest.setParkIdList(this.queryParkNoByCustIds(tdCompanyParkQueryRequest));
  96 + }
  97 +
  98 + BizResult<PageBean<BillManageDTO>> result = billManageForDayService.queryBillforDayTotalForPage(billQueryRequest);
  99 + result.setErrMsg(billQueryRequest.getParkIdList().toString());
  100 + logger.info("---end--日账汇总单查询调用后场dubbo服务,结果={}", JSONObject.toJSONString(result));
  101 + this.returnJsonDataGrid(response, result);
  102 + }
  103 +
  104 + /**
  105 + * 查询日账单.<br/>
  106 + *
  107 + * @param request
  108 + * @param response
  109 + * @throws Exception
  110 + */
  111 + @ApiOperation("日账单查看")
  112 + @RequestMapping(value = "/queryBillForDay", method = RequestMethod.POST)
  113 + @ResponseBody
  114 + public void queryBillForDay(@RequestBody BillQueryRequest billQueryRequest, HttpServletRequest request,
  115 + HttpServletResponse response) throws Exception {
  116 + BizResult<PageBean<BillManageDTO>> result = new BizResult<PageBean<BillManageDTO>>();
  117 + logger.info("---begin---日账单查看调用后场dubbo服务,入参={}", JSONObject.toJSONString(billQueryRequest));
  118 + TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest();
  119 + UserInfo userInfo = (UserInfo) request.getSession().getAttribute(SessionEnum.USER_INFO.key());
  120 + logger.info("从session中获取的用户信息={}" + JSONObject.toJSONString(userInfo));
  121 + if (userInfo != null) {
  122 +
  123 + tdCompanyParkQueryRequest.setSysCode(billQueryRequest.getSysCode());
  124 + tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds());
  125 + tdCompanyParkQueryRequest.setSessionId(request.getSession().getId());
  126 + billQueryRequest.setUserName(userInfo.getName());
  127 + billQueryRequest.setParkIdList(this.queryParkNoByCustIds(tdCompanyParkQueryRequest));
  128 +
  129 + }
  130 + result = billManageForDayService.queryBillforDayDeatilPage(billQueryRequest);
  131 + logger.info("---end---日账单查看调用后场dubbo服务,结果={}", JSONObject.toJSON(result));
  132 +
  133 + this.returnJsonDataGrid(response, result);
  134 + }
  135 +
  136 + /**
  137 + * 获取登录用户信息.<br/>
  138 + * @param request
  139 + * @param response
  140 + * @throws Exception
  141 + */
  142 + @RequestMapping(value = "/queryUserInfoForName", method = RequestMethod.POST)
  143 + public void queryUserInfoForName( HttpServletRequest request,
  144 + HttpServletResponse response) throws Exception {
  145 + UserInfo userInfo = (UserInfo) request.getSession().getAttribute(SessionEnum.USER_INFO.key());
  146 + this.returnJson(response, userInfo);
  147 + }
  148 +
  149 +
  150 +
  151 +
  152 +
  153 + /**
  154 + * 日账单导出.<br/>
  155 + *
  156 + * @param request
  157 + * @param response
  158 + * @throws Exception
  159 + */
  160 + @RequestMapping("/exportToExcleForBillForDay")
  161 + public void exportToExcleForBillForDay(String sysCode, String beginTime, String endTime, String aliTotalFee ,
  162 + String aliDealCount,String wxTotalFee,String wxDealCount,String cashTotalFee,String cashDealCount,
  163 + String orderTotalFee,String orderDealCount,
  164 + HttpServletRequest request,String parkIds,String userName,
  165 + HttpServletResponse response) throws Exception {
  166 +
  167 + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  168 + //获取session中的用户信息
  169 + UserInfo userInfo = sessionCommUtil.getUserInfo();
  170 + BillQueryRequest billQueryRequest = new BillQueryRequest();
  171 +
  172 + billQueryRequest.setBeginTime(format.parse(beginTime));
  173 + billQueryRequest.setEndTime(format.parse(endTime));
  174 + billQueryRequest.setSysCode(sysCode);
  175 + billQueryRequest.getBaseRequest().setPageSize(0);
  176 + List<String> parkList= new ArrayList<String>();
  177 + if(StringUtils.isNotEmpty(parkIds)){
  178 + for(String str :parkIds.split(",")){
  179 + if(StringUtils.isNotEmpty(str)){
  180 + parkList.add(str.trim());
  181 + }
  182 + }
  183 + }
  184 + billQueryRequest.setParkIdList(parkList);
  185 + /**查询日账单汇总信息.*/
  186 + BizResult<PageBean<BillManageDTO>> result = billManageForDayService.queryBillforDayDeatilPage(billQueryRequest);
  187 + String[] titleOne = new String[2];
  188 + titleOne[0] = "用户: " + (StringUtils.isNotEmpty(userName) ? userName : "");
  189 + titleOne[1] = "时间: "+beginTime+" "+endTime;
  190 + String[] titleTwo = new String[] {"","现金", "微信", "支付宝", "合计"};
  191 + String[] titleThree = new String[] { "停车场名称", "现金", "微信", "支付宝", "合计"};
  192 + String sheetName = "日账单";
  193 + String fileName = "日账单管理" + format.format(new Date());
  194 +
  195 +
  196 + // 1.创建excel信息
  197 + XSSFSheet workSheet = ExcelUtil.createExcel(sheetName);
  198 + // 2.设置excel表头和表体
  199 + Layouter.buildBillForDay(workSheet, titleOne, 0, 0);//创建第一行标题
  200 + Layouter.buildHeaders(workSheet, titleTwo, 0, 0);//创建第2行标题
  201 + Layouter.buildHeaders(workSheet, titleThree, 3, 0);//创建第3行标题
  202 + // 3.填充数据
  203 + List<Object[]> contentListTwo = new ArrayList<Object[]>();
  204 + for(int i = 0;i<2;i++){
  205 + Object[] str = new Object[titleTwo.length];
  206 + if(i == 0){
  207 + str[0] = "交易笔数";
  208 + str[1] = (cashDealCount == null ? "0" : cashDealCount);
  209 + str[2] = (wxDealCount== null ? "0" : wxDealCount);
  210 + str[3] = (aliDealCount== null ? "0" : aliDealCount);
  211 + str[4] = (orderDealCount== null ? "0" : orderDealCount);
  212 + }else{
  213 + str[0] = "总收入(元)";
  214 + str[1] = (cashTotalFee == null ? "0" : new BigDecimal(cashTotalFee).divide(new BigDecimal("100"),2, BigDecimal.ROUND_HALF_UP)) ;
  215 + str[2] = (wxTotalFee== null ? "0" : new BigDecimal(wxTotalFee).divide(new BigDecimal("100"),2, BigDecimal.ROUND_HALF_UP)) ;
  216 + str[3] = (aliTotalFee== null ? "0" : new BigDecimal(aliTotalFee).divide(new BigDecimal("100"),2, BigDecimal.ROUND_HALF_UP)) ;
  217 + str[4] = (orderTotalFee== null ? "0" : new BigDecimal(orderTotalFee).divide(new BigDecimal("100"),2, BigDecimal.ROUND_HALF_UP)) ;
  218 + }
  219 + contentListTwo.add(str);
  220 + }
  221 + ExcleFillDateManager fillUserManagerTwo = new ExcleFillDateManager();
  222 + fillUserManagerTwo.fillSalesOrga(workSheet, titleTwo, contentListTwo, 2); //第2行标题
  223 +
  224 + //
  225 + List<Object[]> contentList = new ArrayList<Object[]>();
  226 + if(result != null && result.getData() != null){
  227 + List<BillManageDTO> list = result.getData().getDataList();
  228 + if(list != null && list.size()>0){
  229 + for (int i = 0; i < list.size(); i++) {
  230 + BillManageDTO e = list.get(i);
  231 + Object[] obj = new Object[titleThree.length];
  232 + int index = 0;
  233 + obj[index++] = e.getParkName();
  234 + obj[index++] = (e.getCashTotalFee()== null ? "0" : e.getCashTotalFee().divide(new BigDecimal("100"),2, BigDecimal.ROUND_HALF_UP)) ;
  235 + obj[index++] = (e.getWxTotalFee()== null ? "0" : e.getWxTotalFee().divide(new BigDecimal("100"),2, BigDecimal.ROUND_HALF_UP)) ;
  236 + obj[index++] = (e.getAliTotalFee()== null ? "0" : e.getAliTotalFee().divide(new BigDecimal("100"),2, BigDecimal.ROUND_HALF_UP)) ;
  237 + obj[index++] = (e.getAliTotalFee()== null ? "0" : e.getAliTotalFee().divide(new BigDecimal("100"),2, BigDecimal.ROUND_HALF_UP)) ;
  238 + contentList.add(obj);
  239 + }
  240 + }
  241 + }
  242 +
  243 + ExcleFillDateManager fillUserManager = new ExcleFillDateManager();
  244 + fillUserManager.fillSalesOrga(workSheet, titleThree, contentList, 5);
  245 + // 4.excel输出配置
  246 + ExcelUtil.write(response, workSheet, fileName);
  247 +
  248 +
  249 + }
  250 +
  251 + /**
  252 + * 通过session信息获取停车场编码.<br/>
  253 + *
  254 + * @param billQueryRequest
  255 + * @param userInfo
  256 + * @return
  257 + * @throws Exception
  258 + */
  259 + private List<String> queryParkNoByCustIds(TdCompanyParkQueryRequest tdCompanyParkQueryRequest) throws Exception {
  260 + /** 查询停车场编码. */
  261 + BizResult<List<String>> parkNoResult = tdCustCompanyService.queryParkNoByCustIds(tdCompanyParkQueryRequest);
  262 + if (parkNoResult.isSuccess() && parkNoResult != null && parkNoResult.getData() != null) {
  263 + logger.info("根据登录获取到对应的停车场编码=" + JSONArray.toJSONString(parkNoResult.getData()));
  264 + return parkNoResult.getData();
  265 + } else {
  266 + logger.info("根据登录用户没有获取到对应的停车场编码");
  267 + return null;
  268 + }
  269 +
  270 + }
  271 +
  272 +
  273 +
  274 +}
... ...
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/InOutParkStatisticController.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/InOutParkStatisticController.java
  1 +package com.zteits.irain.portal.web.parkinglotcloudplatform.datastatistic;
  2 +
  3 +import java.sql.Timestamp;
  4 +import java.text.SimpleDateFormat;
  5 +import java.util.ArrayList;
  6 +import java.util.Calendar;
  7 +import java.util.Date;
  8 +import java.util.List;
  9 +import java.util.Map;
  10 +
  11 +import javax.servlet.http.HttpServletRequest;
  12 +import javax.servlet.http.HttpServletResponse;
  13 +import javax.servlet.http.HttpSession;
  14 +
  15 +import org.apache.poi.xssf.usermodel.XSSFSheet;
  16 +import org.slf4j.Logger;
  17 +import org.slf4j.LoggerFactory;
  18 +import org.springframework.beans.factory.annotation.Autowired;
  19 +import org.springframework.beans.factory.annotation.Value;
  20 +import org.springframework.security.config.authentication.UserServiceBeanDefinitionParser;
  21 +import org.springframework.stereotype.Controller;
  22 +import org.springframework.web.bind.annotation.GetMapping;
  23 +import org.springframework.web.bind.annotation.PostMapping;
  24 +import org.springframework.web.bind.annotation.RequestBody;
  25 +import org.springframework.web.bind.annotation.RequestMapping;
  26 +import org.springframework.web.bind.annotation.RequestParam;
  27 +import org.springframework.web.bind.annotation.ResponseBody;
  28 +import org.springframework.web.bind.annotation.RestController;
  29 +
  30 +import com.alibaba.dubbo.common.utils.CollectionUtils;
  31 +import com.alibaba.dubbo.common.utils.StringUtils;
  32 +import com.alibaba.fastjson.JSON;
  33 +import com.clouds.common.entity.UserInfo;
  34 +import com.clouds.common.utils.AmountUtils;
  35 +import com.clouds.common.utils.DateUtil;
  36 +import com.clouds.common.utils.ResultUtils;
  37 +import com.clouds.common.utils.excle.ExcelUtil;
  38 +import com.clouds.common.utils.excle.ExcleFillDateManager;
  39 +import com.clouds.common.utils.excle.Layouter;
  40 +import com.clouds.common.web.BizController;
  41 +import com.clouds.common.web.SessionCommUtil;
  42 +import com.clouds.common.web.vo.BizResultVO;
  43 +import com.clouds.common.web.vo.EasyUIDataGridVO;
  44 +import com.google.common.collect.Lists;
  45 +import com.google.common.collect.Maps;
  46 +import com.zteits.clouds.api.apibase.bean.BaseInfo;
  47 +import com.zteits.clouds.api.apibase.bean.BizResult;
  48 +import com.zteits.clouds.api.apibase.bean.PageBean;
  49 +import com.zteits.clouds.api.apibase.constants.ErrorType;
  50 +import com.zteits.clouds.api.apibase.exception.BizException;
  51 +import com.zteits.clouds.api.dto.clouds.dto.BillManageDTO;
  52 +import com.zteits.clouds.api.dto.park.dto.InOutParkDTO;
  53 +import com.zteits.clouds.api.dto.park.dto.ParkingLotUseStatisticDTO;
  54 +import com.zteits.clouds.api.dto.park.dto.ParkingLotUseStatisticSumDTO;
  55 +import com.zteits.clouds.api.dto.park.param.InOutParkRequest;
  56 +import com.zteits.clouds.api.dto.park.param.ParkingLotUseStatisticForPageRequest;
  57 +import com.zteits.clouds.api.dto.pay.param.TdCompanyParkQueryRequest;
  58 +import com.zteits.clouds.api.service.clouds.InOutParkStatisticService;
  59 +import com.zteits.clouds.api.service.park.ParkingLotUseStatisticService;
  60 +import com.zteits.clouds.api.service.pay.TdCustCompanyService;
  61 +import com.zteits.irain.portal.constant.ParkConstant;
  62 +import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.LineChartVO;
  63 +import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.LineChartVO.SerieVO;
  64 +
  65 +import io.swagger.annotations.Api;
  66 +import io.swagger.annotations.ApiOperation;
  67 +
  68 +/**
  69 + * 企业云平台->数据统计->进出场上报。
  70 + *
  71 + * Copyright: Copyright (c) 2017 zteits
  72 + *
  73 + * @ClassName: InOutParkStatisticController.java
  74 + * @Description:
  75 + * @version: v1.0.0
  76 + * @author: langlw
  77 + * @date: 2017年7月26日 上午11:30:04
  78 + * Modification History:
  79 + * Date Author Version Description
  80 + *---------------------------------------------------------*
  81 + * 2017年7月26日 langlw v1.0.0 创建
  82 + */
  83 +@Api(value = "企业云平台->数据统计->进出场上报数据统计", description = "企业云平台->数据统计->进出场上报数据统计")
  84 +@Controller
  85 +@RequestMapping(value = "/inOutParkStatistic")
  86 +public class InOutParkStatisticController extends BizController {
  87 + private static final Logger logger = LoggerFactory.getLogger(InOutParkStatisticController.class);
  88 +
  89 + @Value("${project.syscode}")
  90 + private String sysCode;
  91 + @Autowired
  92 + private ParkingLotUseStatisticService parkingLotStatisticService;
  93 + @Autowired
  94 + private InOutParkStatisticService inOutParkStatisticService;
  95 +
  96 +
  97 + @ApiOperation("数据统计进出场上报")
  98 + @PostMapping("queryInOutParkForList")
  99 + @ResponseBody
  100 + public BizResultVO<EasyUIDataGridVO<InOutParkDTO>> queryInOutParkForList(
  101 + @RequestBody InOutParkRequest request) throws Exception {
  102 + logger.info("调用DUBBO服务入参:" + JSON.toJSONString(request));
  103 + if (null == request.getBeginTime() || null==request.getEndTime()) {
  104 + throw new BizException(ErrorType.PARAMM_NULL, "开始时间和结束时间");
  105 + }
  106 + BizResult<PageBean<InOutParkDTO>> bizResult = inOutParkStatisticService.queryInOutParkForList(request);
  107 + return returnJqGridData(bizResult, InOutParkDTO.class);
  108 + }
  109 +
  110 + @ApiOperation("数据统计进出场上报折线图")
  111 + @PostMapping("queryInOutParkForChart")
  112 + @ResponseBody
  113 + public BizResultVO<LineChartVO> queryInOutParkForChart(
  114 + @RequestBody InOutParkRequest request) throws Exception {
  115 + if (null == request.getBeginTime() || null==request.getEndTime() || null == request.getPlNos()) {
  116 + throw new BizException(ErrorType.PARAMM_NULL, "开始时间和结束时间、停车场编号集合");
  117 + }
  118 +
  119 + ParkingLotUseStatisticForPageRequest UseStatisticRequest=new ParkingLotUseStatisticForPageRequest();
  120 + UseStatisticRequest.setPlNos(request.getPlNos());
  121 + UseStatisticRequest.setBeginTime(request.getBeginTime());
  122 + UseStatisticRequest.setEndTime(request.getEndTime());
  123 + UseStatisticRequest.setBaseRequest(new BaseInfo(1, 0));
  124 + UseStatisticRequest.setSysCode(sysCode);
  125 +
  126 + Calendar beginTime = Calendar.getInstance();
  127 + beginTime.setTime(request.getBeginTime());
  128 +
  129 + Calendar endTime = Calendar.getInstance();
  130 + endTime.setTime(request.getEndTime());
  131 +
  132 + Long dayDifference = DateUtil.getTimeDifference(new Timestamp(request.getEndTime().getTime()),
  133 + new Timestamp(request.getBeginTime().getTime()));
  134 + List<String> xAxisData = Lists.newArrayList();
  135 + String dateType="";
  136 +
  137 + if (dayDifference == 0L) {
  138 + //同一天
  139 + // 20分钟为一个时间戳
  140 + UseStatisticRequest.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER20MINUTE);
  141 + int totaltimestampCount = (endTime.get(Calendar.HOUR_OF_DAY)-beginTime.get(Calendar.HOUR_OF_DAY))*3;
  142 + for (int i = 0; i < totaltimestampCount; i++) {
  143 + int hour1 = beginTime.get(Calendar.HOUR_OF_DAY)+i/3;
  144 + String hour = String.format("%02d", hour1);
  145 + String minute = String.format("%02d", (i % 3) * 20);
  146 + xAxisData.add(hour + ":" + minute);
  147 + }
  148 + dateType="HH:mm";
  149 + LineChartVO vehicleFlows=getVehicleFlows(UseStatisticRequest, xAxisData, dateType);
  150 + return new BizResultVO<LineChartVO>().setData(vehicleFlows);
  151 +
  152 + } else if (dayDifference <= 3L) {
  153 + // 1小时为一个时间戳
  154 + UseStatisticRequest.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1HOUR);
  155 + int totaltimestampCount = endTime.get(Calendar.HOUR_OF_DAY);
  156 + String day = "";
  157 + String month = "";
  158 + for (int i = 0; i < dayDifference.intValue(); i++) {
  159 + int beginMonth = beginTime.get(Calendar.MONTH) + 1;
  160 + int beginDay = beginTime.get(Calendar.DAY_OF_MONTH);
  161 + month = String.format("%02d", (beginMonth));
  162 + day = String.format("%02d", (beginDay));
  163 + int endDay = endTime.get(Calendar.DAY_OF_MONTH);
  164 + if(beginDay != endDay){
  165 + totaltimestampCount = 24;
  166 + }
  167 + for (int j = 0; j < totaltimestampCount; j++) {
  168 + String hour = String.format("%02d", (j));
  169 + xAxisData.add(month + "-" + day + " " + hour);
  170 + }
  171 + beginTime.add(Calendar.DAY_OF_MONTH, 1);
  172 + }
  173 + dateType="MM-dd HH";
  174 + LineChartVO vehicleFlows=getVehicleFlows(UseStatisticRequest, xAxisData, dateType);
  175 + return new BizResultVO<LineChartVO>().setData(vehicleFlows);
  176 +
  177 + } else {
  178 + // 1天为一个时间戳
  179 + UseStatisticRequest.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1DAY);
  180 + for (int i = 0; i < dayDifference.intValue()+1; i++) {
  181 + int beginMonth = beginTime.get(Calendar.MONTH) + 1;
  182 + int beginDay = beginTime.get(Calendar.DAY_OF_MONTH);
  183 + String month = String.format("%02d", (beginMonth));
  184 + String day = String.format("%02d", (beginDay));
  185 + xAxisData.add(month + "-" + day);
  186 + beginTime.add(Calendar.DAY_OF_MONTH, 1);
  187 +
  188 + }
  189 + dateType="MM-dd";
  190 + LineChartVO vehicleFlows=getVehicleFlows(UseStatisticRequest, xAxisData, dateType);
  191 + return new BizResultVO<LineChartVO>().setData(vehicleFlows);
  192 +
  193 + }
  194 + }
  195 +
  196 +
  197 + /**
  198 + * 进出场折线图
  199 + * @param request
  200 + * @param xAxisData
  201 + * @param dateType
  202 + * @return
  203 + * 2017年7月28日 zhaowg
  204 + */
  205 + private LineChartVO getVehicleFlows(ParkingLotUseStatisticForPageRequest request,
  206 + List<String> xAxisData,String dateType){
  207 + // 调用后场服务
  208 + logger.info("调用DUBBO服务入参:" + JSON.toJSONString(request));
  209 + BizResult<PageBean<ParkingLotUseStatisticDTO>> bizResult = parkingLotStatisticService
  210 + .queryParkingLotUseStatisticForPage(request);
  211 + PageBean<ParkingLotUseStatisticDTO> pageBean = ResultUtils.getBizResultData(bizResult);
  212 + List<ParkingLotUseStatisticDTO> useStatisticDTOs = Lists.newArrayList();
  213 + if (pageBean != null) {
  214 + useStatisticDTOs = pageBean.getDataList();
  215 + }
  216 +
  217 + // 保存进场次数,时间戳和进场次数对应关系
  218 + Map<String, Integer> inParkMap = Maps.newHashMap();
  219 + // 保存出场次数,时间戳和出场次数对应关系
  220 + Map<String, Integer> outParkMap = Maps.newHashMap();
  221 + // 停车场编号和名称对应关系
  222 + Map<String, String> parkNameMap = Maps.newHashMap();
  223 + if (!CollectionUtils.isEmpty(useStatisticDTOs)) {
  224 + for (ParkingLotUseStatisticDTO statisticDTO : useStatisticDTOs) {
  225 + String key = statisticDTO.getPlNo();
  226 + parkNameMap.put(key, statisticDTO.getPlName());
  227 + String statisBeginTime = DateUtil.getDateString(statisticDTO.getStatisticBeginTime(), dateType);
  228 + //保存进场车流量和出场车流量
  229 + inParkMap.put(statisBeginTime, (inParkMap.get(statisBeginTime)==null?0:inParkMap.get(statisBeginTime))+statisticDTO.getTmpVehicleFlow());
  230 + outParkMap.put(statisBeginTime, (outParkMap.get(statisBeginTime)==null?0:outParkMap.get(statisBeginTime))+statisticDTO.getOutParkCount());
  231 + }
  232 + }
  233 +
  234 + // 封装进出场上报统计
  235 + LineChartVO vehicleFlows = new LineChartVO();
  236 + List<String> vehicleFlows_legendData = Lists.newArrayList();
  237 + vehicleFlows_legendData.add("进场");
  238 + vehicleFlows_legendData.add("出场");
  239 + vehicleFlows.setLegendData(vehicleFlows_legendData);
  240 + vehicleFlows.setxAxisData(xAxisData);
  241 + List<SerieVO> vehicleSeries = Lists.newArrayList();
  242 + // 进场
  243 + SerieVO inParkSerieVo = new SerieVO();
  244 + inParkSerieVo.setName("进场");
  245 + List<Integer> inParkSerieVoData = Lists.newArrayList();
  246 + // 出场
  247 + SerieVO outParkSerieVo = new SerieVO();
  248 + outParkSerieVo.setName("出场");
  249 + List<Integer> outParkSerieVoData = Lists.newArrayList();
  250 + // 保存上一次的进出场车值,当某个时间点没有数据时,则保持和上次一致
  251 + Integer lastfixFlow = 0;
  252 + Integer lasttmpFlow = 0;
  253 + for (String timestamp : xAxisData) {
  254 +
  255 + if (inParkMap.containsKey(timestamp)) {
  256 + lastfixFlow = inParkMap.get(timestamp).intValue();
  257 + }else{
  258 + lastfixFlow =0;
  259 + }
  260 + inParkSerieVoData.add(lastfixFlow);
  261 +
  262 + if (outParkMap.containsKey(timestamp)) {
  263 + lasttmpFlow = outParkMap.get(timestamp).intValue();
  264 + }else{
  265 + lasttmpFlow = 0;
  266 + }
  267 + outParkSerieVoData.add(lasttmpFlow);
  268 + }
  269 + inParkSerieVo.setData(inParkSerieVoData);
  270 + vehicleSeries.add(inParkSerieVo);
  271 + outParkSerieVo.setData(outParkSerieVoData);
  272 + vehicleSeries.add(outParkSerieVo);
  273 +
  274 + vehicleFlows.setSeries(vehicleSeries);
  275 + return vehicleFlows;
  276 + }
  277 +
  278 +
  279 +
  280 + @ApiOperation("导出进出场统计excel")
  281 + @GetMapping("exportInOutParkStatisticExcel")
  282 + public void exportInOutParkStatisticExcel(@RequestParam String beginTime, @RequestParam String endTime,
  283 + @RequestParam List<String> plNos,@RequestParam String parkNames,
  284 + Integer inOutStatus,Integer parkType,
  285 + HttpServletRequest requests, HttpServletResponse response) throws Exception {
  286 + ParkingLotUseStatisticForPageRequest request = new ParkingLotUseStatisticForPageRequest();
  287 + request.setSysCode(sysCode);
  288 + request.setBeginTime(DateUtil.to_date(beginTime, DateUtil.DATETIME_FORMAT));
  289 + request.setEndTime(DateUtil.to_date(endTime, DateUtil.DATETIME_FORMAT));
  290 + request.setPlNos(plNos);
  291 + request.setBaseRequest(new BaseInfo(1, 0));
  292 + request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER20MINUTE);
  293 + BizResult<ParkingLotUseStatisticSumDTO> bizResultSum = parkingLotStatisticService.QueryInOutParkStatisticSum(request);
  294 +
  295 + InOutParkRequest inOutParkRequest =new InOutParkRequest();
  296 + inOutParkRequest.setBaseRequest(new BaseInfo(1, 0));
  297 + inOutParkRequest.setSysCode(sysCode);
  298 + inOutParkRequest.setBeginTime(DateUtil.to_date(beginTime, DateUtil.DATETIME_FORMAT));
  299 + inOutParkRequest.setEndTime(DateUtil.to_date(endTime, DateUtil.DATETIME_FORMAT));
  300 + inOutParkRequest.setPlNos(plNos);
  301 + inOutParkRequest.setInOutStatus(inOutStatus);
  302 + inOutParkRequest.setParkType(parkType);
  303 + BizResult<PageBean<InOutParkDTO>> bizResult = inOutParkStatisticService.queryInOutParkForList(inOutParkRequest);
  304 +
  305 +
  306 +
  307 + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  308 + SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd");
  309 + String[] title = new String[] { "停车场", "车牌号", "车辆类型", "进出场状态","进场时间","出场时间","停车时长" };
  310 + String sheetName = "车辆进出场统计";
  311 + String fileName = "车辆进出场统计" + format2.format(new Date());
  312 +
  313 + String[] billTitle = new String[8];
  314 + if (bizResultSum != null && bizResultSum.getData() != null) {
  315 + ParkingLotUseStatisticSumDTO dto = bizResultSum.getData();
  316 +
  317 + billTitle[0] = "车辆进出场统计";
  318 + billTitle[1] = "汇总";
  319 + billTitle[2] = "停车场: " +parkNames;
  320 + billTitle[3] = "进场时间: " + beginTime;
  321 + billTitle[4] = "出场时间:" + endTime;
  322 + billTitle[5] = "进场车辆总数: " + (dto.getInParkSum() != null ? dto.getInParkSum() : 0);
  323 + billTitle[6] = "出场车辆总数: " + (dto.getOutParkSum() != null ? dto.getOutParkSum() : 0);
  324 + billTitle[7] = "具体明细";
  325 + } else {
  326 + billTitle[0] = "车辆进出场统计";
  327 + billTitle[1] = "汇总";
  328 + billTitle[2] = "停车场:";
  329 + billTitle[3] = "进场时间:" ;
  330 + billTitle[4] = "出场时间:" ;
  331 + billTitle[5] = "进场车辆总数:";
  332 + billTitle[6] = "出场车辆总数:";
  333 + billTitle[7] = "具体明细";
  334 + }
  335 +
  336 +
  337 +
  338 +
  339 + // 1.创建excel信息
  340 + XSSFSheet workSheet = ExcelUtil.createExcel(sheetName);
  341 + // 2.设置excel表头和表体
  342 + Layouter.buildReportBillForDay(workSheet, title, 0, 0, billTitle);
  343 + // 3.填充数据
  344 + List<Object[]> contentList = new ArrayList<Object[]>();
  345 + List<InOutParkDTO> list = new ArrayList<>();
  346 + if (CollectionUtils.isNotEmpty(bizResult.getData().getDataList())) {
  347 + list = bizResult.getData().getDataList();
  348 + }
  349 + for (InOutParkDTO e : list) {
  350 + Object[] obj = new Object[title.length];
  351 + int index = 0;
  352 + obj[index++] = e.getParkName();
  353 + obj[index++] = e.getCarNumber();
  354 + //TODO
  355 + if(null!=e.getParkType()){
  356 + if(1==e.getParkType()){
  357 + obj[index++] ="固定停车";
  358 + }else{
  359 + obj[index++] ="临时停车";
  360 + }
  361 + }else{
  362 + obj[index++] ="临时停车";
  363 + }
  364 +
  365 + if(null !=e.getInOutState()){
  366 + if(1==e.getInOutState() || 2==e.getInOutState() || 3==e.getInOutState()){
  367 + obj[index++] ="在场";
  368 + }else{
  369 + obj[index++] ="出场";
  370 + }
  371 + }else{
  372 + obj[index++] ="出场";
  373 + }
  374 + obj[index++] = format.format(e.getInTime());
  375 + obj[index++] = e.getOutTime() != null? format.format(e.getOutTime()) : "";
  376 + obj[index++] = e.getParkingDuration() != null? DateUtil.secondToTime(e.getParkingDuration()) : "";
  377 + contentList.add(obj);
  378 + }
  379 + ExcleFillDateManager fillUserManager = new ExcleFillDateManager();
  380 + fillUserManager.fillSalesOrga(workSheet, title, contentList, 9);
  381 + // 4.excel输出配置
  382 + ExcelUtil.write(response, workSheet, fileName);
  383 + }
  384 +
  385 +}
... ...
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/IndexPageStatisticController.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/IndexPageStatisticController.java
  1 +package com.zteits.irain.portal.web.parkinglotcloudplatform.datastatistic;
  2 +
  3 +import java.math.BigDecimal;
  4 +import java.math.RoundingMode;
  5 +import java.util.ArrayList;
  6 +import java.util.Calendar;
  7 +import java.util.Date;
  8 +import java.util.List;
  9 +import java.util.Map;
  10 +import java.util.Map.Entry;
  11 +
  12 +import javax.validation.Valid;
  13 +
  14 +import org.slf4j.Logger;
  15 +import org.slf4j.LoggerFactory;
  16 +import org.springframework.beans.factory.annotation.Autowired;
  17 +import org.springframework.web.bind.annotation.PostMapping;
  18 +import org.springframework.web.bind.annotation.RequestBody;
  19 +import org.springframework.web.bind.annotation.RequestMapping;
  20 +import org.springframework.web.bind.annotation.RestController;
  21 +
  22 +import com.alibaba.dubbo.common.utils.CollectionUtils;
  23 +import com.alibaba.fastjson.JSON;
  24 +import com.alibaba.fastjson.JSONObject;
  25 +import com.clouds.common.cache.park.ParkingLotCacheUtil;
  26 +import com.clouds.common.utils.DateUtil;
  27 +import com.clouds.common.utils.ResultUtils;
  28 +import com.clouds.common.web.BizController;
  29 +import com.clouds.common.web.vo.BizResultVO;
  30 +import com.google.common.collect.Lists;
  31 +import com.google.common.collect.Maps;
  32 +import com.zteits.clouds.api.apibase.bean.BaseInfo;
  33 +import com.zteits.clouds.api.apibase.bean.BizResult;
  34 +import com.zteits.clouds.api.apibase.bean.PageBean;
  35 +import com.zteits.clouds.api.dto.clouds.dto.CustIncomeForPayTypeDTO;
  36 +import com.zteits.clouds.api.dto.clouds.dto.CustIncomeTotalDTO;
  37 +import com.zteits.clouds.api.dto.clouds.dto.CustIncomeTotalParkDTO;
  38 +import com.zteits.clouds.api.dto.clouds.param.CustIncomeTotalQueryRequset;
  39 +import com.zteits.clouds.api.dto.park.dto.ParkingLotDTO;
  40 +import com.zteits.clouds.api.dto.park.dto.ParkingLotUseStatisticDTO;
  41 +import com.zteits.clouds.api.dto.park.param.ParkingLotUseStatisticForPageRequest;
  42 +import com.zteits.clouds.api.dto.park.param.RealTimeVehicleFlowQueryRequest;
  43 +import com.zteits.clouds.api.service.clouds.CustIncomeService;
  44 +import com.zteits.clouds.api.service.park.IInOutParkingService;
  45 +import com.zteits.clouds.api.service.park.ParkingLotUseStatisticService;
  46 +import com.zteits.irain.portal.constant.ParkConstant;
  47 +import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.BerthsAndFlowLineChartVO;
  48 +import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.CustIncomeForPayTypeResVO;
  49 +import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.CustIncomeTotalParkVO;
  50 +import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.CustIncomeTotalVO;
  51 +import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.LineChartVO;
  52 +import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.LineChartVO.SerieVO;
  53 +
  54 +import io.swagger.annotations.ApiOperation;
  55 +
  56 +/**
  57 + * Copyright: Copyright (c) 2017 zteits
  58 + *
  59 + * @ClassName: com.zteits.irain.portal.web.parkinglotcloudplatform.datastatistic
  60 + * @Description:
  61 + * @version: v1.0.0
  62 + * @author: atao
  63 + * @date: 2017/6/19 下午5:11
  64 + * Modification History:
  65 + * Date Author Version Description
  66 + * ---------------------------------------------------------*
  67 + * 2017/6/19 atao v1.0.0 创建
  68 + */
  69 +@RestController
  70 +@RequestMapping("/index")
  71 +public class IndexPageStatisticController extends BizController {
  72 +
  73 + private Logger logger = LoggerFactory.getLogger(IndexPageStatisticController.class);
  74 +
  75 + @Autowired
  76 + private CustIncomeService cusIncomeService;
  77 + /**
  78 + * 进出场记录
  79 + */
  80 + @Autowired
  81 + private IInOutParkingService iInOutParkingService;
  82 + @Autowired
  83 + private ParkingLotUseStatisticService parkingLotStatisticService;
  84 +
  85 + /**
  86 + * 云平台首页->企业客户负责所有的停车场汇总.<br/>
  87 + *
  88 + * @return
  89 + * @throws Exception
  90 + */
  91 + @ApiOperation("企业客户负责所有的停车场汇总")
  92 + @PostMapping("/queryCustIncomeTotal")
  93 + public BizResultVO<CustIncomeTotalVO> queryCustIncomeTotal(
  94 + @RequestBody CustIncomeTotalQueryRequset custIncomeTotalQueryRequset)
  95 + throws Exception {
  96 +
  97 + BizResultVO<CustIncomeTotalVO> bizResultVO = new BizResultVO<>();
  98 +
  99 + BizResult<CustIncomeTotalDTO> result = cusIncomeService.queryCustIncomeTotal(custIncomeTotalQueryRequset);
  100 +
  101 + if (ResultUtils.isError(result)) {
  102 + //如果失败
  103 + bizResultVO.setCode(result.getErrCode().getCode());
  104 + bizResultVO.setMsg(result.getErrMsg());
  105 + return bizResultVO;
  106 + }
  107 + CustIncomeTotalVO vo = new CustIncomeTotalVO();
  108 + vo.setAmountDueTotal(result.getData().getAmountDueTotal().setScale(2, BigDecimal.ROUND_HALF_UP).toString());
  109 + vo.setEscapeAmount(result.getData().getEscapeAmount().setScale(2, BigDecimal.ROUND_HALF_UP).toString());
  110 + vo.setPayedTotalAmount(result.getData().getPayedTotalAmount().setScale(2, BigDecimal.ROUND_HALF_UP).toString());
  111 +
  112 + bizResultVO.setData(vo);
  113 +
  114 + return bizResultVO;
  115 + }
  116 +
  117 + /**
  118 + * 云平台首页->企业客户负责某个停车收入情况.<br/>
  119 + *
  120 + * @return
  121 + * @throws Exception
  122 + */
  123 + @ApiOperation("企业客户负责某个停车收入情况")
  124 + @PostMapping("/queryCustIncomeTotalForPark")
  125 + public BizResultVO<CustIncomeTotalParkVO> queryCustIncomeTotalForPark(
  126 + @RequestBody CustIncomeTotalQueryRequset custIncomeTotalQueryRequset) throws Exception {
  127 +
  128 + logger.info("企业客户负责某个停车收入情况 入参为: req={}", JSONObject.toJSONString(custIncomeTotalQueryRequset));
  129 +
  130 + BizResultVO bizResultVO = new BizResultVO();
  131 + BizResult<CustIncomeTotalParkDTO> result = cusIncomeService.queryCustIncomeTotalForPark(
  132 + custIncomeTotalQueryRequset);
  133 + logger.info("企业客户负责某个停车收入情况 调用Dubbo接口响应为: result={}", JSONObject.toJSONString(result));
  134 + if (ResultUtils.isError(result)) {
  135 + //如果失败
  136 + bizResultVO.setCode(result.getErrCode().getCode());
  137 + bizResultVO.setMsg(result.getErrMsg());
  138 + return bizResultVO;
  139 + }
  140 + CustIncomeTotalParkDTO dto = result.getData();
  141 + BigDecimal amountDueTotal = dto.getAmountDueTotal();
  142 + BigDecimal escapeAmount = dto.getEscapeAmount();
  143 + BigDecimal payedTotalAmount = dto.getPayedTotalAmount();
  144 +
  145 +
  146 +
  147 + CustIncomeTotalParkVO vo = new CustIncomeTotalParkVO();
  148 +
  149 + //金额为分
  150 + vo.setAmountDueTotal(amountDueTotal.setScale(2, BigDecimal.ROUND_HALF_UP).toString());
  151 + vo.setEscapeAmount(escapeAmount.setScale(2, BigDecimal.ROUND_HALF_UP).toString());
  152 + vo.setPayedTotalAmount(payedTotalAmount.setScale(2, BigDecimal.ROUND_HALF_UP).toString());
  153 + //占比乘以100取两位小数
  154 + //应收
  155 + if (null == amountDueTotal || amountDueTotal.doubleValue()==0) {
  156 + vo.setLoopData(1, "00.00");
  157 + vo.setLoopData(2, "00.00");
  158 +
  159 + } else {
  160 + //实收
  161 + vo.setLoopData(1, payedTotalAmount.divide(amountDueTotal, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100.00"))
  162 + .setScale(2, BigDecimal.ROUND_HALF_UP).toString());
  163 + //逃逸
  164 + vo.setLoopData(2, escapeAmount.divide(amountDueTotal, 4, BigDecimal.ROUND_HALF_UP).multiply(
  165 + new BigDecimal("100.00"))
  166 + .setScale(2, BigDecimal.ROUND_HALF_UP).toString());
  167 + }
  168 +
  169 + bizResultVO.setData(vo);
  170 + return bizResultVO;
  171 + }
  172 +
  173 + /**
  174 + * 云平台首页->企业客户负责某个停车不同的支付方式收入情况.<br/>
  175 + *
  176 + * @return
  177 + * @throws Exception
  178 + */
  179 + @ApiOperation("企业客户负责某个停车不同的支付方式收入情况")
  180 + @PostMapping("/queryCustIncomeForPayType")
  181 + public BizResultVO<CustIncomeForPayTypeResVO> queryCustIncomeForPayType(
  182 + @RequestBody CustIncomeTotalQueryRequset custIncomeTotalQueryRequset) throws Exception {
  183 + logger.info("调用后场dubbo服务,入参为: request={}", JSONObject.toJSONString(custIncomeTotalQueryRequset));
  184 + BizResult<List<CustIncomeForPayTypeDTO>> result = cusIncomeService.queryCustIncomeForPayType(
  185 + custIncomeTotalQueryRequset);
  186 +
  187 + logger.info("调用后场dubbo服务,响应为: result={}", JSONObject.toJSONString(result));
  188 + //如果不成功
  189 + if (!ResultUtils.isSuccess(result)) {
  190 + return new BizResultVO<>(result.getErrCode(), result.getErrMsg());
  191 + }
  192 + List<CustIncomeForPayTypeDTO> data = result.getData();
  193 +
  194 + CustIncomeForPayTypeResVO res = new CustIncomeForPayTypeResVO();
  195 + res.addLegendData("费用", "占比");
  196 +
  197 + BigDecimal total = BigDecimal.ZERO;
  198 + List<String> amount = new ArrayList<>();
  199 + for (CustIncomeForPayTypeDTO dto : data) {
  200 + //添加X轴数据
  201 + res.addXAxisData(dto.getPayTypeName());
  202 + total = total.add(dto.getPayedTotalAmount());
  203 + logger.info("返回的类型 和 数据为: payTypeName={},payedTotalAmount={},total={}", dto.getPayTypeName(),
  204 + dto.getPayedTotalAmount().toString(), total.toString());
  205 + amount.add(dto.getPayedTotalAmount().setScale(2, BigDecimal.ROUND_HALF_UP)
  206 + .doubleValue() + "");
  207 + }
  208 + //计算占比
  209 + List<String> zb = new ArrayList<>();
  210 + for (CustIncomeForPayTypeDTO dto : data) {
  211 + logger.info("计算占比 total={}", total.toString());
  212 + if (BigDecimal.ZERO.equals(total) || total.doubleValue() == 0.00) {
  213 + zb.add("0.00");
  214 + } else {
  215 + zb.add(dto.getPayedTotalAmount().divide(total, 4, RoundingMode.HALF_UP)
  216 + .multiply(new BigDecimal("100.00")).doubleValue() + "");
  217 + }
  218 +
  219 + }
  220 + res.addChildData("费用", amount);
  221 + res.addChildData("占比", zb);
  222 + BizResultVO<CustIncomeForPayTypeResVO> resResult = new BizResultVO<>();
  223 + resResult.setData(res);
  224 + logger.info("返回到前台的数据为: res={}", JSONObject.toJSONString(res));
  225 + return resResult;
  226 + }
  227 +
  228 + /**
  229 + * 根据停车场编号,获取该停车场今日车流量(当天0:00到操作时间的车流量) 折线图
  230 + *
  231 + * @param request
  232 + * @return 2017年6月19日 zhaowg
  233 + */
  234 + @ApiOperation("根据停车场编号获取该停车场今日车流量和车位折线图")
  235 + @PostMapping("getTodayVehicleFlowForLineChart")
  236 + public BizResultVO<BerthsAndFlowLineChartVO> getTodayVehicleFlowForLineChart(
  237 + @RequestBody @Valid ParkingLotUseStatisticForPageRequest request) {
  238 + logger.info("根据停车场编号获取该停车场今日车流量和车位折线图");
  239 + //开始时间 今日0点开始
  240 + Calendar beginTime = Calendar.getInstance();
  241 + beginTime.set(Calendar.HOUR_OF_DAY, 0);
  242 + beginTime.set(Calendar.MINUTE, 0);
  243 + beginTime.set(Calendar.SECOND, 0);
  244 +
  245 + //获取当前时间
  246 + Calendar curTime = Calendar.getInstance();
  247 + int curMinute = curTime.get(Calendar.MINUTE);
  248 + if (curMinute >= 0 && curMinute < 20) {
  249 + //统计到当前时间点
  250 + curTime.add(Calendar.MINUTE, 0);
  251 + } else if (curMinute >= 20 && curMinute < 40) {
  252 + //统计到当前小时的20分钟
  253 + curTime.add(Calendar.MINUTE, 20);
  254 + } else if (curMinute >= 40 && curMinute <= 59) {
  255 + //统计到当前小时的40分钟
  256 + curTime.add(Calendar.MINUTE, 40);
  257 + }
  258 + curTime.set(Calendar.SECOND, 0);
  259 +
  260 + //20分钟为一个时间戳
  261 + List<String> xAxisData = Lists.newArrayList();
  262 + int totaltimestampCount = curTime.get(Calendar.HOUR_OF_DAY) * 3 + curMinute / 20;
  263 + for (int i = 0; i < totaltimestampCount; i++) {
  264 + String hour = String.format("%02d", (i / 3));
  265 + String minute = String.format("%02d", (i % 3) * 20);
  266 + xAxisData.add(hour + ":" + minute);
  267 + }
  268 +
  269 + //调用后场服务
  270 + request.setBeginTime(beginTime.getTime());
  271 + request.setEndTime(curTime.getTime());
  272 + //每20分钟统计一次
  273 + request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER20MINUTE);
  274 + request.setBaseRequest(new BaseInfo(1, 0));
  275 + logger.info("调用DUBBO服务入参:"+JSON.toJSONString(request));
  276 + BizResult<PageBean<ParkingLotUseStatisticDTO>> bizResult = parkingLotStatisticService
  277 + .queryParkingLotUseStatisticForPage(request);
  278 + PageBean<ParkingLotUseStatisticDTO> pageBean = ResultUtils.getBizResultData(bizResult);
  279 + List<ParkingLotUseStatisticDTO> useStatisticDTOs = Lists.newArrayList();
  280 + if (pageBean != null) {
  281 + useStatisticDTOs = pageBean.getDataList();
  282 + }
  283 +
  284 + //保存固定车流量,时间戳和车流量对应关系
  285 + Map<String, Integer> fixVehicleFlowMap = Maps.newHashMap();
  286 + //保存临时车流量,时间戳和车流量对应关系
  287 + Map<String, Integer> tmpVehicleFlowMap = Maps.newHashMap();
  288 + //停车场编号和名称对应关系
  289 + Map<String, String> parkNameMap = Maps.newHashMap();
  290 + //通过停车场,和统计时间分组
  291 + Map<String, Map<String, Double>> parkLotMap = Maps.newHashMap();
  292 + if (!CollectionUtils.isEmpty(useStatisticDTOs)) {
  293 + for (ParkingLotUseStatisticDTO statisticDTO : useStatisticDTOs) {
  294 + String key = statisticDTO.getPlNo();
  295 + parkNameMap.put(key, statisticDTO.getPlName());
  296 + String statisBeginTime = DateUtil.getDateString(statisticDTO.getStatisticBeginTime(), "HH:mm");
  297 + //保存空置率
  298 + if (!parkLotMap.containsKey(key)) {
  299 + Map<String, Double> timeAndVal = Maps.newHashMap();
  300 + timeAndVal.put(statisBeginTime, statisticDTO.getFreeRatio() * 100);
  301 + parkLotMap.put(key, timeAndVal);
  302 + } else {
  303 + parkLotMap.get(key).put(statisBeginTime, statisticDTO.getFreeRatio() * 100);
  304 + }
  305 +
  306 + //保存固定车流量和临时车流量
  307 + fixVehicleFlowMap.put(statisBeginTime, (fixVehicleFlowMap.get(statisBeginTime)==null?0:fixVehicleFlowMap.get(statisBeginTime))+statisticDTO.getFixVehicleFlow());
  308 + tmpVehicleFlowMap.put(statisBeginTime, (tmpVehicleFlowMap.get(statisBeginTime)==null?0:tmpVehicleFlowMap.get(statisBeginTime))+statisticDTO.getTmpVehicleFlow());
  309 + }
  310 + }
  311 + //判断是否包含所有待查询的停车场信息
  312 + if(request.getPlNos().size()>parkLotMap.size()){
  313 + for (String plNo:request.getPlNos()) {
  314 + if(!parkLotMap.containsKey(plNo)){
  315 + ParkingLotDTO parkingLotDTO=ParkingLotCacheUtil.getParkLotByPlNo(plNo);
  316 + parkNameMap.put(plNo, parkingLotDTO.getPlName());
  317 + parkLotMap.put(plNo, Maps.newHashMap());
  318 + }
  319 + }
  320 + }
  321 + //封装车位统计信息
  322 + LineChartVO freeBerthRatios = new LineChartVO();
  323 + List<String> freeBerthRatios_legendData = Lists.newArrayList();
  324 + freeBerthRatios_legendData.addAll(parkNameMap.values());
  325 + freeBerthRatios.setLegendData(freeBerthRatios_legendData);
  326 + freeBerthRatios.setxAxisData(xAxisData);
  327 + List<SerieVO> series = Lists.newArrayList();
  328 +
  329 + if (parkLotMap != null && !parkLotMap.isEmpty()) {
  330 + for (Entry<String, Map<String, Double>> parkLotEntry : parkLotMap.entrySet()) {
  331 + SerieVO serieVO = new SerieVO();
  332 + //获取停车场名称
  333 + String name = parkNameMap.get(parkLotEntry.getKey());
  334 + serieVO.setName(name);
  335 + //设置每个时间戳对应的空置率
  336 + Map<String, Double> freeRatioMaps = parkLotEntry.getValue();
  337 + //保存上一次的空置率,当某个时间点没有数据时,则保持和上次一致
  338 + Integer lastFreeRatio = 0;
  339 + List<Integer> freeRations = Lists.newArrayList();
  340 + for (String timestamp : xAxisData) {
  341 + if (freeRatioMaps.containsKey(timestamp)) {
  342 + lastFreeRatio = freeRatioMaps.get(timestamp).intValue();
  343 + }else{
  344 + lastFreeRatio = 0;
  345 + }
  346 + freeRations.add(lastFreeRatio);
  347 + }
  348 + serieVO.setData(freeRations);
  349 + series.add(serieVO);
  350 + }
  351 + }
  352 + freeBerthRatios.setSeries(series);
  353 +
  354 + //封装车流量统计
  355 + LineChartVO vehicleFlows = new LineChartVO();
  356 + List<String> vehicleFlows_legendData = Lists.newArrayList();
  357 + vehicleFlows_legendData.add("临时车");
  358 + vehicleFlows_legendData.add("固定车");
  359 + vehicleFlows.setLegendData(vehicleFlows_legendData);
  360 + vehicleFlows.setxAxisData(xAxisData);
  361 + List<SerieVO> vehicleSeries = Lists.newArrayList();
  362 + //固定车
  363 + SerieVO fixSerieVo = new SerieVO();
  364 + fixSerieVo.setName("固定车");
  365 + List<Integer> fixSerieVoData = Lists.newArrayList();
  366 + //临时车
  367 + SerieVO tmpSerieVo = new SerieVO();
  368 + tmpSerieVo.setName("临时车");
  369 + List<Integer> tmpSerieVoData = Lists.newArrayList();
  370 + //保存上一次的临时车值,当某个时间点没有数据时,则保持和上次一致
  371 + Integer lastfixFlow = 0;
  372 + Integer lasttmpFlow = 0;
  373 + for (String timestamp : xAxisData) {
  374 + if (fixVehicleFlowMap.containsKey(timestamp)) {
  375 + lastfixFlow = fixVehicleFlowMap.get(timestamp).intValue();
  376 + }else{
  377 + lastfixFlow = 0;
  378 + }
  379 + fixSerieVoData.add(lastfixFlow);
  380 +
  381 + if (tmpVehicleFlowMap.containsKey(timestamp)) {
  382 + lasttmpFlow = tmpVehicleFlowMap.get(timestamp).intValue();
  383 + }else{
  384 + lasttmpFlow = 0;
  385 + }
  386 + tmpSerieVoData.add(lasttmpFlow);
  387 + }
  388 + fixSerieVo.setData(fixSerieVoData);
  389 + vehicleSeries.add(fixSerieVo);
  390 + tmpSerieVo.setData(tmpSerieVoData);
  391 + vehicleSeries.add(tmpSerieVo);
  392 +
  393 + vehicleFlows.setSeries(vehicleSeries);
  394 +
  395 + BerthsAndFlowLineChartVO chartVO = new BerthsAndFlowLineChartVO();
  396 + chartVO.setFreeBerthRatios(freeBerthRatios);
  397 + chartVO.setVehicleFlows(vehicleFlows);
  398 + return new BizResultVO<BerthsAndFlowLineChartVO>().setData(chartVO);
  399 + }
  400 +
  401 + //实时查询当前总车流量
  402 + // @MessageMapping("/realtimeGetCurVehicleFlow")
  403 + // @SendTo("/topic/curVehicleFlow")
  404 + @ApiOperation("实时查询当前总车流量")
  405 + @PostMapping("/realtimeGetCurVehicleFlow")
  406 + public BizResultVO<Long> realtimeVehicleFlowByWebSocket(@RequestBody RealTimeVehicleFlowQueryRequest request) {
  407 + BizResult<Long> bizResult = iInOutParkingService.QueryRealTimeVehicleFlow(request);
  408 + return new BizResultVO<Long>(bizResult);
  409 + }
  410 +
  411 + /**
  412 + * 实时查询今日空置率<br>
  413 + * 今日空置率:当天0:00到操作时间的每个时间戳的空置率做加权算法,<br>
  414 + * 0:00-7:00加权10%,7:00-9:00加权40%,9:00-17:00加权15%,17:00-21:00加权25%,21:00-24:00加权10%,加权后的空置率之和除以时间戳数,得到“今日空置率”
  415 + *
  416 + * @return 2017年6月19日 zhaowg
  417 + */
  418 + // @MessageMapping("/realtimeGetCurFreeRatio")
  419 + // @SendTo("/topic/curFreeRatio")
  420 + @ApiOperation("实时查询今日空置率")
  421 + @PostMapping("realtimeGetCurFreeRatio")
  422 + public BizResultVO<String> realtimeFreeRatio(@RequestBody ParkingLotUseStatisticForPageRequest request) {
  423 + //开始时间 今日0点开始
  424 + Calendar beginTime = Calendar.getInstance();
  425 + beginTime.set(Calendar.HOUR_OF_DAY, 0);
  426 + beginTime.set(Calendar.MINUTE, 0);
  427 + beginTime.set(Calendar.SECOND, 0);
  428 + request.setBeginTime(beginTime.getTime());
  429 + Calendar endTime = Calendar.getInstance();
  430 + request.setEndTime(endTime.getTime());
  431 + request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER20MINUTE);
  432 + request.setBaseRequest(new BaseInfo(1, 0));//不分页;
  433 + BizResult<PageBean<ParkingLotUseStatisticDTO>> bizResult = parkingLotStatisticService
  434 + .queryParkingLotUseStatisticForPage(request);
  435 + PageBean<ParkingLotUseStatisticDTO> pageBean = ResultUtils.getBizResultData(bizResult);
  436 + if (pageBean == null || pageBean.getDataList() == null) {
  437 + return new BizResultVO<String>().setData("0");
  438 + }
  439 + Double totalfreeRatio = 0.00;
  440 + for (ParkingLotUseStatisticDTO statisticDTO : pageBean.getDataList()) {
  441 + totalfreeRatio += this.weightForFreeRation(statisticDTO.getStatisticBeginTime(),
  442 + statisticDTO.getFreeRatio(), statisticDTO.getPlNo());
  443 + }
  444 + logger.info("加权后的空置率之和:" + totalfreeRatio + " 时间戳个数:" + pageBean.getDataList().size());
  445 + Double avgFreeRation = totalfreeRatio / pageBean.getDataList().size();
  446 + String result = String.format("%.2f", avgFreeRation);
  447 + return new BizResultVO<String>().setData(result);
  448 + }
  449 +
  450 + /**
  451 + * 根据时间段 给空置率加权<br>
  452 + * 0:00-7:00加权10%,7:00-9:00加权40%,9:00-17:00加权15%,17:00-21:00加权25%,21:00-24:00加权10%,加权后的空置率之和除以时间戳数,得到“今日空置率”
  453 + *
  454 + * @param statisticBeginTime
  455 + * @param freeRatio 2017年6月19日 zhaowg
  456 + */
  457 + private Double weightForFreeRation(Date statisticBeginTime, Double freeRatio, String plNo) {
  458 + freeRatio = freeRatio * 100;//转换为百分比形式
  459 + /*logger.info(
  460 + "停车场编号:" + plNo + " 统计时间:" + DateUtil.getDateString(statisticBeginTime, DateUtil.DATETIME_FORMAT) + " 空置率:"
  461 + + freeRatio);*/
  462 + Calendar calendar = Calendar.getInstance();
  463 + calendar.setTime(statisticBeginTime);
  464 + int hour = calendar.get(Calendar.HOUR_OF_DAY);
  465 + if (hour <= 7) {
  466 + return freeRatio * 0.1;
  467 + } else if (hour <= 9) {
  468 + return freeRatio * 0.4;
  469 + } else if (hour <= 17) {
  470 + return freeRatio * 0.15;
  471 + } else if (hour <= 21) {
  472 + return freeRatio * 0.25;
  473 + } else {
  474 + return freeRatio * 0.1;
  475 + }
  476 + }
  477 +
  478 + public static void main(String[] args) {
  479 + BigDecimal m = BigDecimal.ZERO;
  480 + BigDecimal n = m.add(BigDecimal.TEN);
  481 + System.out.println(new BigDecimal("00.0").doubleValue() == 0);
  482 + }
  483 +
  484 +}
... ...
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/MonthBillManagementController.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/MonthBillManagementController.java
  1 +/**
  2 + *
  3 + */
  4 +package com.zteits.irain.portal.web.parkinglotcloudplatform.datastatistic;
  5 +
  6 +import java.io.IOException;
  7 +import java.math.BigDecimal;
  8 +import java.net.URLEncoder;
  9 +import java.text.SimpleDateFormat;
  10 +import java.util.ArrayList;
  11 +import java.util.Date;
  12 +import java.util.List;
  13 +
  14 +import javax.servlet.ServletOutputStream;
  15 +import javax.servlet.http.HttpServletRequest;
  16 +import javax.servlet.http.HttpServletResponse;
  17 +import javax.servlet.http.HttpSession;
  18 +
  19 +import org.apache.poi.xssf.usermodel.XSSFSheet;
  20 +import org.apache.poi.xssf.usermodel.XSSFWorkbook;
  21 +import org.slf4j.Logger;
  22 +import org.slf4j.LoggerFactory;
  23 +import org.springframework.beans.factory.annotation.Autowired;
  24 +import org.springframework.beans.factory.annotation.Value;
  25 +import org.springframework.stereotype.Controller;
  26 +import org.springframework.web.bind.annotation.GetMapping;
  27 +import org.springframework.web.bind.annotation.PostMapping;
  28 +import org.springframework.web.bind.annotation.RequestBody;
  29 +import org.springframework.web.bind.annotation.RequestMapping;
  30 +import org.springframework.web.bind.annotation.RequestParam;
  31 +import org.springframework.web.bind.annotation.ResponseBody;
  32 +import org.springframework.web.bind.annotation.RestController;
  33 +
  34 +import com.alibaba.dubbo.common.utils.CollectionUtils;
  35 +import com.alibaba.dubbo.common.utils.StringUtils;
  36 +import com.alibaba.fastjson.JSONArray;
  37 +import com.alibaba.fastjson.JSONObject;
  38 +import com.clouds.common.constants.SessionEnum;
  39 +import com.clouds.common.entity.UserInfo;
  40 +import com.clouds.common.utils.AmountUtils;
  41 +import com.clouds.common.utils.DateUtil;
  42 +import com.clouds.common.utils.ResultUtils;
  43 +import com.clouds.common.utils.excle.ExcelUtil;
  44 +import com.clouds.common.utils.excle.ExcleFillDateManager;
  45 +import com.clouds.common.utils.excle.Layouter;
  46 +import com.clouds.common.web.BizController;
  47 +import com.clouds.common.web.SessionCommUtil;
  48 +import com.clouds.common.web.vo.BizResultVO;
  49 +import com.clouds.common.web.vo.EasyUIDataGridVO;
  50 +import com.zteits.clouds.api.apibase.bean.BaseInfo;
  51 +import com.zteits.clouds.api.apibase.bean.BizResult;
  52 +import com.zteits.clouds.api.apibase.bean.PageBean;
  53 +import com.zteits.clouds.api.apibase.constants.ErrorType;
  54 +import com.zteits.clouds.api.apibase.exception.BizException;
  55 +import com.zteits.clouds.api.dto.clouds.dto.BillManageDTO;
  56 +import com.zteits.clouds.api.dto.clouds.dto.BillManageDetailDTO;
  57 +import com.zteits.clouds.api.dto.clouds.dto.BillManageDetailForMonthDTO;
  58 +import com.zteits.clouds.api.dto.clouds.dto.BillManageForMonthDTO;
  59 +import com.zteits.clouds.api.dto.clouds.dto.BillManageForMonthDetailDTO;
  60 +import com.zteits.clouds.api.dto.clouds.dto.MonthBillMngtStatisticByParkinglotDTO;
  61 +import com.zteits.clouds.api.dto.clouds.dto.MonthBillMngtStatisticDTO;
  62 +import com.zteits.clouds.api.dto.clouds.dto.MonthBillSummaryStatisticDTO;
  63 +import com.zteits.clouds.api.dto.clouds.dto.YearMonthCardStatisticDTO;
  64 +import com.zteits.clouds.api.dto.clouds.param.BillQueryRequest;
  65 +import com.zteits.clouds.api.dto.clouds.param.MonthBillRequest;
  66 +import com.zteits.clouds.api.dto.pay.param.TdCompanyParkQueryRequest;
  67 +import com.zteits.clouds.api.dto.pay.param.YearMonthCardStatisticRequest;
  68 +import com.zteits.clouds.api.service.clouds.MonthBillManagementService;
  69 +import com.zteits.clouds.api.service.clouds.YearMonthCardStatisticService;
  70 +import com.zteits.clouds.api.service.pay.TdCustCompanyService;
  71 +
  72 +import io.swagger.annotations.Api;
  73 +import io.swagger.annotations.ApiOperation;
  74 +
  75 +/**
  76 + * @author hxz
  77 + *
  78 + */
  79 +@Api(value = "结算管理 账单管理 月账单管理", description = "停车场云平台 月账单管理")
  80 +@Controller
  81 +@RequestMapping("/monthbill")
  82 +public class MonthBillManagementController extends BizController {
  83 + private static final Logger logger = LoggerFactory.getLogger(MonthBillManagementController.class);
  84 +
  85 + @Autowired
  86 + private MonthBillManagementService monthBillManagementService;
  87 + @Autowired
  88 + private YearMonthCardStatisticService yearMonthCardStatisticService;
  89 +
  90 + @Autowired
  91 + private TdCustCompanyService tdCustCompanyService;
  92 + @Autowired
  93 + private HttpSession session;
  94 + @Autowired
  95 + private SessionCommUtil sessionCommUtil;
  96 + @Value("${project.syscode}")
  97 + private String sysCode;
  98 +
  99 + @ApiOperation("月账单查询汇总统计")
  100 + @PostMapping("/summaryStatistic")
  101 + @ResponseBody
  102 + public BizResultVO<MonthBillSummaryStatisticDTO> getMonthBillSummaryStatistic(
  103 + @RequestBody MonthBillRequest request) {
  104 + logger.info("月账单查询汇总统计请求对象 req={}", JSONObject.toJSONString(request));
  105 + BizResult<MonthBillSummaryStatisticDTO> respondResult = monthBillManagementService
  106 + .getMonthBillSummaryStatistic(request);
  107 + logger.info("月账单查询汇总统计响应结果 respondResult={}", JSONObject.toJSONString(respondResult));
  108 + return new BizResultVO<>(respondResult);
  109 + }
  110 +
  111 + /**
  112 + * 临停收费, 按支付方式汇总统计,tp表示临停
  113 + *
  114 + * @param request
  115 + */
  116 + @ApiOperation("临停收费, 按支付方式汇总统计,tp表示临停")
  117 + @PostMapping("/tpStatistic")
  118 + @ResponseBody
  119 + public BizResultVO<MonthBillMngtStatisticDTO> getMonthBillMngtTPStatistic(@RequestBody MonthBillRequest request) {
  120 + logger.info("临停收费, 按支付方式汇总统计 req={}", JSONObject.toJSONString(request));
  121 + BizResult<MonthBillMngtStatisticDTO> respondResult = monthBillManagementService
  122 + .getMonthBillMngtTPStatistic(request);
  123 + logger.info("临停收费, 按支付方式汇总统计 respondResult={}", JSONObject.toJSONString(respondResult));
  124 + return new BizResultVO<>(respondResult);
  125 + }
  126 +
  127 + /**
  128 + * <!-- 临停收费,按照停车场分组后,按支付方式分类统计 TP ByParkinglot-->
  129 + *
  130 + * @param request
  131 + * @return
  132 + */
  133 + @ApiOperation("临停收费, 按照停车场分组后,按支付方式分类统计,tp表示临停,Pklt表示停车场")
  134 + @PostMapping("/tpPkltStatistic")
  135 + @ResponseBody
  136 + BizResultVO<List<MonthBillMngtStatisticByParkinglotDTO>> getMonthBillMngtTPStatisticByParkinglot(
  137 + @RequestBody MonthBillRequest request) {
  138 + logger.info("临停收费, 停车场分组,按支付方式分类 req={}", JSONObject.toJSONString(request));
  139 + BizResult<List<MonthBillMngtStatisticByParkinglotDTO>> respondResult = monthBillManagementService
  140 + .getMonthBillMngtTPStatisticByParkinglot(request);
  141 + logger.info("临停收费, 停车场分组,按支付方式分类respondResult={}", JSONObject.toJSONString(respondResult));
  142 + return new BizResultVO<>(respondResult);
  143 + }
  144 +
  145 + /**
  146 + * <!-- 月卡、年卡, 按支付方式汇总统计 CardMY-->
  147 + *
  148 + * @param request
  149 + * @return
  150 + */
  151 + @ApiOperation("月卡、年卡, 按支付方式汇总统计")
  152 + @PostMapping("/cardStatistic")
  153 + @ResponseBody
  154 + BizResultVO<MonthBillMngtStatisticDTO> getMonthBillMngtCardMYStatistic(@RequestBody MonthBillRequest request) {
  155 + logger.info("月卡、年卡, 按支付方式分类 req={}", JSONObject.toJSONString(request));
  156 + BizResult<MonthBillMngtStatisticDTO> respondResult = monthBillManagementService
  157 + .getMonthBillMngtCardMYStatistic(request);
  158 + logger.info("月卡、年卡, 按支付方式分类respondResult={}", JSONObject.toJSONString(respondResult));
  159 + return new BizResultVO<>(respondResult);
  160 + }
  161 +
  162 + /**
  163 + * <!-- 月卡、年卡,按照停车场分组后,按支付方式分类统计CardMY ByParkinglot-->
  164 + *
  165 + * @param request
  166 + * @return
  167 + */
  168 + @ApiOperation("月卡、年卡, 按支付方式汇总统计,Pklt表示停车场")
  169 + @PostMapping("/cardPkltStatistic")
  170 + @ResponseBody
  171 + BizResultVO<List<MonthBillMngtStatisticByParkinglotDTO>> getMonthBillMngtCardMYStatisticByParkinglot(
  172 + @RequestBody MonthBillRequest request) {
  173 + logger.info("月卡、年卡, 停车场分组,按支付方式分类 req={}", JSONObject.toJSONString(request));
  174 + BizResult<List<MonthBillMngtStatisticByParkinglotDTO>> respondResult = monthBillManagementService
  175 + .getMonthBillMngtCardMYStatisticByParkinglot(request);
  176 + logger.info("月卡、年卡, 停车场分组,按支付方式分类respondResult={}", JSONObject.toJSONString(respondResult));
  177 + return new BizResultVO<>(respondResult);
  178 + }
  179 +
  180 + // ----------------------------------------------------2017-8-1新添加-----------------------------------------------
  181 +
  182 + /**
  183 + *
  184 + * @param request
  185 + * @return
  186 + * @throws Exception
  187 + */
  188 + @ApiOperation("月账单管理统计列表")
  189 + @PostMapping("/queryBillforMonthList")
  190 + @ResponseBody
  191 + public BizResultVO<EasyUIDataGridVO<BillManageForMonthDTO>> queryBillforMonthList(
  192 + @RequestBody BillQueryRequest billQueryRequest, HttpServletRequest request, HttpServletResponse response)
  193 + throws Exception {
  194 + // 2.调用接口查询当前登录人管辖的停车场名称
  195 + UserInfo userInfo = sessionCommUtil.getUserInfo();
  196 + List<String> plNos = new ArrayList<>();
  197 + if (userInfo != null) {
  198 + TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest();
  199 + tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds());
  200 + tdCompanyParkQueryRequest.setSessionId(session.getId());
  201 + tdCompanyParkQueryRequest.setSysCode(sysCode);
  202 + BizResult<List<String>> bizResult = tdCustCompanyService.queryParkNoByCustIds(tdCompanyParkQueryRequest);
  203 + // 拥有的停车场编号
  204 + plNos = ResultUtils.getBizResultData(bizResult);
  205 + }
  206 +// if (CollectionUtils.isEmpty(plNos)) {
  207 +// throw new BizException(ErrorType.PARK_LOT_NOT_EXISTS, "停车场plnos不存在");
  208 +// }
  209 + billQueryRequest.setParkIdList(plNos);
  210 + logger.info("月账单管理统计列表 req={}", JSONObject.toJSONString(billQueryRequest));
  211 + BizResult<List<BillManageForMonthDTO>> respondResult = monthBillManagementService
  212 + .queryBillforMonthList(billQueryRequest);
  213 + logger.info("月账单管理统计列表 respondResult={}", JSONObject.toJSONString(respondResult));
  214 + return returnJqGridDataByList(respondResult, BillManageForMonthDTO.class);
  215 + }
  216 +
  217 + /**
  218 + *
  219 + * @param request
  220 + * @return
  221 + */
  222 + @ApiOperation("月账单管理对账单统计明细")
  223 + @PostMapping("/queryBillforMonthDetail")
  224 + @ResponseBody
  225 + public BizResultVO<EasyUIDataGridVO<BillManageForMonthDetailDTO>> queryBillforMonthDetail(
  226 + @RequestBody BillQueryRequest billQueryRequest, HttpServletRequest request, HttpServletResponse response)
  227 + throws Exception {
  228 + // 2.调用接口查询当前登录人管辖的停车场名称
  229 + UserInfo userInfo = sessionCommUtil.getUserInfo();
  230 + List<String> plNos = new ArrayList<>();
  231 + if (userInfo != null) {
  232 + TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest();
  233 + tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds());
  234 + tdCompanyParkQueryRequest.setSessionId(session.getId());
  235 + tdCompanyParkQueryRequest.setSysCode(sysCode);
  236 + BizResult<List<String>> bizResult = tdCustCompanyService.queryParkNoByCustIds(tdCompanyParkQueryRequest);
  237 + // 拥有的停车场编号
  238 + plNos = ResultUtils.getBizResultData(bizResult);
  239 + }
  240 +// if (CollectionUtils.isEmpty(plNos)) {
  241 +// throw new BizException(ErrorType.PARK_LOT_NOT_EXISTS, "停车场plnos不存在");
  242 +// }
  243 + billQueryRequest.setParkIdList(plNos);
  244 + logger.info("月账单管理对账单统计明细 req={}", JSONObject.toJSONString(billQueryRequest));
  245 + BizResult<List<BillManageForMonthDetailDTO>> respondResult = monthBillManagementService
  246 + .queryBillforMonthDetail(billQueryRequest);
  247 + logger.info("月账单管理对账单统计明细 respondResult={}", JSONObject.toJSONString(respondResult));
  248 + return returnJqGridDataByList(respondResult, BillManageForMonthDetailDTO.class);
  249 + }
  250 +
  251 + /**
  252 + * 月账单临停导出.<br/>
  253 + *
  254 + * @param request
  255 + * @param response
  256 + */
  257 + @ApiOperation("月账单临停导出")
  258 + @GetMapping("/exportToExcleForBillForMonthTmp")
  259 + public void exportToExcleForBillForMonthTmp(@RequestParam List<String> parkIdList,
  260 + @RequestParam List<Integer> orderTypeList,@RequestParam String beginTime,
  261 + @RequestParam String endTime, HttpServletRequest request, HttpServletResponse response) {
  262 + logger.info("---begin--日账单导出调用后场dubbo服务,入参 beginTime={},endTime={}", beginTime, endTime);
  263 + BizResult<PageBean<BillManageDetailForMonthDTO>> result = new BizResult<PageBean<BillManageDetailForMonthDTO>>();
  264 + try {
  265 + BillQueryRequest billQueryRequest = new BillQueryRequest();
  266 + if (null == beginTime || null == endTime) {
  267 + throw new BizException(ErrorType.PARAMM_NULL, "开始时间和结束时间");
  268 + }
  269 +
  270 + billQueryRequest.setSysCode(sysCode);
  271 + billQueryRequest.setBeginTime(DateUtil.to_date(beginTime, DateUtil.DATETIME_FORMAT));
  272 + billQueryRequest.setEndTime(DateUtil.to_date(endTime, DateUtil.DATETIME_FORMAT));
  273 + billQueryRequest.setParkIdList(parkIdList);
  274 + billQueryRequest.setOrderTypeList(orderTypeList);
  275 + billQueryRequest.setBaseRequest(new BaseInfo(1, 0));
  276 + /** 查询月账单. */
  277 + result = monthBillManagementService.queryBillforMonthDetailForList(billQueryRequest);
  278 + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  279 + SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd");
  280 + String[] title = new String[] { "流水号", "时间", "车主车牌号", "进场时间", "出场时间", "停车时长", "收费规则", "支付方式", "应收金额", "优惠券",
  281 + "红包", "实收金额", "共计" };
  282 + String sheetName = "月账单";
  283 + String fileName = "月账单管理" + format2.format(new Date());
  284 +
  285 + // 1.创建excel信息
  286 + XSSFSheet workSheet = ExcelUtil.createExcel(sheetName);
  287 + // 2.设置excel表头和表体
  288 + Layouter.buildReport(workSheet, title, 0, 0);
  289 + // 3.填充数据
  290 + List<Object[]> contentList = new ArrayList<Object[]>();
  291 +
  292 + List<BillManageDetailForMonthDTO> list = new ArrayList<BillManageDetailForMonthDTO>();
  293 + if (CollectionUtils.isNotEmpty(result.getData().getDataList())) {
  294 + list = result.getData().getDataList();
  295 + }
  296 + for (BillManageDetailForMonthDTO e : list) {
  297 + Object[] obj = new Object[title.length];
  298 + int index = 0;
  299 + obj[index++] = StringUtils.isNotEmpty(e.getPayOrderNo()) ? e.getPayOrderNo() : "";
  300 + obj[index++] = e.getPayFinishTime() != null
  301 + ? DateUtil.getDateString(e.getPayFinishTime(), DateUtil.DATETIME_FORMAT) : "";
  302 + obj[index++] = StringUtils.isNotEmpty(e.getCarNum()) ? e.getCarNum() : "";
  303 + obj[index++] = e.getParkInTime() != null
  304 + ? DateUtil.getDateString(e.getParkInTime(), DateUtil.DATETIME_FORMAT) : "";
  305 + obj[index++] = e.getParkOutTime() != null
  306 + ? DateUtil.getDateString(e.getParkOutTime(), DateUtil.DATETIME_FORMAT) : "";
  307 + obj[index++] = e.getParkingDuration() != null ? e.getParkingDuration() : DateUtil.secondToTime(0);
  308 + obj[index++] = "";
  309 + if (e.getPayType() != null) {
  310 + switch (e.getPayType()) {
  311 + case 1:
  312 + obj[index++] = "支付宝";
  313 + break;
  314 + case 2:
  315 + obj[index++] = "微信";
  316 + break;
  317 + case 3:
  318 + obj[index++] = "银联";
  319 + break;
  320 + case 4:
  321 + obj[index++] = "微信";
  322 + break;
  323 + default:
  324 + obj[index++] = "现金";
  325 + break;
  326 + }
  327 + } else {
  328 + obj[index++] = "";
  329 + }
  330 + obj[index++] = e.getAmountDueTotal() != null ? AmountUtils.changeF2Y(e.getAmountDueTotal().longValue())
  331 + : "0.00";
  332 + obj[index++] = "0.00";
  333 + obj[index++] = "0.00";
  334 + obj[index++] = e.getPayedTotalAmount() != null
  335 + ? AmountUtils.changeF2Y(e.getPayedTotalAmount().longValue()) : "0.00";
  336 + obj[index++] = e.getAmountDueTotal() != null ? AmountUtils.changeF2Y(e.getAmountDueTotal().longValue())
  337 + : "0.00";
  338 + contentList.add(obj);
  339 + }
  340 +
  341 + ExcleFillDateManager fillUserManager = new ExcleFillDateManager();
  342 + fillUserManager.fillSalesOrga(workSheet, title, contentList, 2);
  343 + // 4.excel输出配置
  344 + ExcelUtil.write(response, workSheet, fileName);
  345 + } catch (Exception e) {
  346 + result.setErrorInfo(ErrorType.BIZ_ERROR, "系统错误!");
  347 + e.printStackTrace();
  348 + }
  349 +
  350 + }
  351 +
  352 + /**
  353 + * 月账单年卡月卡导出.<br/>
  354 + *
  355 + * @param request
  356 + * @param response
  357 + */
  358 + @ApiOperation("月账单年卡月卡导出")
  359 + @GetMapping("/exportToExcleForBillForYearOrMonth")
  360 + public void exportToExcleForBillForYearOrMonth(@RequestParam List<String> parkIdList,
  361 + @RequestParam String beginTime,@RequestParam String endTime,
  362 + HttpServletRequest request, HttpServletResponse response) {
  363 + logger.info("---begin--月账单年卡月卡导出调用后场dubbo服务,入参 beginTime={},endTime={}", beginTime, endTime);
  364 + BizResult<PageBean<YearMonthCardStatisticDTO>> result = new BizResult<PageBean<YearMonthCardStatisticDTO>>();
  365 + try {
  366 + YearMonthCardStatisticRequest yearMonthCardStatisticRequest = new YearMonthCardStatisticRequest();
  367 + if (null == beginTime || null == endTime) {
  368 + throw new BizException(ErrorType.PARAMM_NULL, "开始时间和结束时间");
  369 + }
  370 +
  371 + yearMonthCardStatisticRequest.setSysCode(sysCode);
  372 + yearMonthCardStatisticRequest.setBeginTime(DateUtil.to_date(beginTime, DateUtil.DATETIME_FORMAT));
  373 + yearMonthCardStatisticRequest.setEndTime(DateUtil.to_date(endTime, DateUtil.DATETIME_FORMAT));
  374 + yearMonthCardStatisticRequest.setParkIdList(parkIdList);
  375 + yearMonthCardStatisticRequest.setBaseRequest(new BaseInfo(1, 0));
  376 + /** 查询月账单年卡月卡. */
  377 + result = yearMonthCardStatisticService.queryYearMonthCardStatistic(yearMonthCardStatisticRequest);
  378 +
  379 + SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd");
  380 + String[] title = new String[] { "交易单号", "交易时间", "种类", "卡名称", "车牌号", "支付金额", "有效期" };
  381 + String sheetName = "月账单";
  382 + String fileName = "月账单管理" + format2.format(new Date());
  383 +
  384 + // 1.创建excel信息
  385 + XSSFSheet workSheet = ExcelUtil.createExcel(sheetName);
  386 + // 2.设置excel表头和表体
  387 + Layouter.buildReport(workSheet, title, 0, 0);
  388 + // 3.填充数据
  389 + List<Object[]> contentList = new ArrayList<Object[]>();
  390 +
  391 + List<YearMonthCardStatisticDTO> list = new ArrayList<YearMonthCardStatisticDTO>();
  392 +
  393 + if (CollectionUtils.isNotEmpty(result.getData().getDataList())) {
  394 + list = result.getData().getDataList();
  395 + }
  396 + for (YearMonthCardStatisticDTO e : list) {
  397 + Object[] obj = new Object[title.length];
  398 + int index = 0;
  399 + obj[index++] = StringUtils.isNotEmpty(e.getOrderId()) ? e.getOrderId() : "";
  400 + obj[index++] = e.getPayFinishTime() != null
  401 + ? DateUtil.getDateString(e.getPayFinishTime(), DateUtil.DATETIME_FORMAT) : "";
  402 + String yearOrMonthCard = "";
  403 + if (null != e.getOrderType()) {
  404 + if (2 == e.getOrderType()) {
  405 + yearOrMonthCard = "年卡";
  406 + obj[index++] = yearOrMonthCard;
  407 + } else if (3 == e.getOrderType()) {
  408 + yearOrMonthCard = "月卡";
  409 + obj[index++] = yearOrMonthCard;
  410 + }
  411 + } else {
  412 + obj[index++] = "";
  413 + }
  414 + obj[index++] = StringUtils.isNotEmpty(e.getParkName()) ? e.getParkName() + yearOrMonthCard : "";
  415 +
  416 + obj[index++] = StringUtils.isNotEmpty(e.getCarNumber()) ? e.getCarNumber() : "";
  417 +
  418 + obj[index++] = e.getAmount() != null ? AmountUtils.changeF2Y(e.getAmount().longValue()) : "0.00";
  419 + String effDate = "";
  420 + String expDate = "";
  421 + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
  422 + if (null != e.getEffDate()) {
  423 + effDate = format.format(e.getEffDate());
  424 + }
  425 + if (null != e.getExpDate()) {
  426 + expDate = format.format(e.getExpDate());
  427 + }
  428 +
  429 + obj[index++] = effDate + " - " + expDate;
  430 +
  431 + contentList.add(obj);
  432 + }
  433 +
  434 + ExcleFillDateManager fillUserManager = new ExcleFillDateManager();
  435 + fillUserManager.fillSalesOrga(workSheet, title, contentList, 2);
  436 + // 4.excel输出配置
  437 + ExcelUtil.write(response, workSheet, fileName);
  438 + } catch (Exception e) {
  439 + result.setErrorInfo(ErrorType.BIZ_ERROR, "系统错误!");
  440 + e.printStackTrace();
  441 + }
  442 +
  443 + }
  444 +
  445 +
  446 +
  447 +
  448 + /**
  449 + * 月账单所有导出.<br/>
  450 + *
  451 + * @param request
  452 + * @param response
  453 + */
  454 + @ApiOperation("月账单所有导出")
  455 + @GetMapping("/exportToExcleForBillForAll")
  456 + public void exportToExcleForBillForAll(
  457 + @RequestParam String beginTime,
  458 + @RequestParam String endTime, HttpServletRequest request, HttpServletResponse response) {
  459 + BizResult<List<BillManageForMonthDetailDTO>> respondResult= new BizResult<List<BillManageForMonthDetailDTO>>();
  460 + try {
  461 + BillQueryRequest billQueryRequest=new BillQueryRequest();
  462 + if (null == beginTime || null == endTime) {
  463 + throw new BizException(ErrorType.PARAMM_NULL, "开始时间和结束时间");
  464 + }
  465 +
  466 + billQueryRequest.setSysCode(sysCode);
  467 + billQueryRequest.setBeginTime(DateUtil.to_date(beginTime, DateUtil.DATETIME_FORMAT));
  468 + billQueryRequest.setEndTime(DateUtil.to_date(endTime, DateUtil.DATETIME_FORMAT));
  469 + billQueryRequest.setBaseRequest(new BaseInfo(1, 0));
  470 + // 2.调用接口查询当前登录人管辖的停车场名称
  471 + UserInfo userInfo = sessionCommUtil.getUserInfo();
  472 + List<String> plNos = new ArrayList<>();
  473 + if (userInfo != null) {
  474 + TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest();
  475 + tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds());
  476 + tdCompanyParkQueryRequest.setSessionId(session.getId());
  477 + tdCompanyParkQueryRequest.setSysCode(sysCode);
  478 + BizResult<List<String>> bizResult = tdCustCompanyService.queryParkNoByCustIds(tdCompanyParkQueryRequest);
  479 + // 拥有的停车场编号
  480 + plNos = ResultUtils.getBizResultData(bizResult);
  481 + }
  482 + billQueryRequest.setParkIdList(plNos);
  483 + logger.info("月账单导出所有 req={}", JSONObject.toJSONString(billQueryRequest));
  484 + respondResult = monthBillManagementService
  485 + .queryBillforMonthDetail(billQueryRequest);
  486 + logger.info("月账单导出所有 respondResult={}", JSONObject.toJSONString(respondResult));
  487 +
  488 + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  489 + SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd");
  490 + String[] title = new String[] { "停车场名称", "现金", "微信", "支付宝", "合计"};
  491 + String[] sheetName = new String[]{"临停收费","年卡月卡收费"};
  492 + String fileName = "月账单管理" + format2.format(new Date());
  493 +
  494 + // 1.创建excel信息,多个sheet页
  495 + XSSFWorkbook workbook = new XSSFWorkbook();
  496 + XSSFSheet workSheetTmp = workbook.createSheet(sheetName[0]);
  497 + XSSFSheet workSheetYearOrMonth = workbook.createSheet(sheetName[1]);
  498 + XSSFSheet[] worksheet= new XSSFSheet[]{workSheetTmp,workSheetYearOrMonth};
  499 + // 2.设置excel表头和表体
  500 + Layouter.buildReport(workSheetTmp, title, 0, 0);
  501 + Layouter.buildReport(workSheetYearOrMonth, title, 0, 0);
  502 + // 3.填充数据
  503 + List<Object[]> contentYearOrMonthList = new ArrayList<Object[]>();
  504 + List<Object[]> contentTmpList = new ArrayList<Object[]>();
  505 + List<BillManageForMonthDetailDTO> list = new ArrayList<BillManageForMonthDetailDTO>();
  506 + if (CollectionUtils.isNotEmpty(respondResult.getData())) {
  507 + list = respondResult.getData();
  508 + }
  509 + for (BillManageForMonthDetailDTO e : list) {
  510 + Object[] obj = new Object[title.length];
  511 + int index = 0;
  512 + obj[index++] = StringUtils.isNotEmpty(e.getParkName()) ? e.getParkName() : "";
  513 + obj[index++] = e.getTmpCashAmount() != null
  514 + ? AmountUtils.changeF2Y(e.getTmpCashAmount().longValue()) : "0.00";
  515 + obj[index++] = e.getTmpWeChatAmount() != null ? AmountUtils.changeF2Y(e.getTmpWeChatAmount().longValue())
  516 + : "0.00";
  517 + obj[index++] = e.getTmpAlipayAmount() != null ? AmountUtils.changeF2Y(e.getTmpAlipayAmount().longValue())
  518 + : "0.00";
  519 + obj[index++] = e.getTmpAll() != null ? AmountUtils.changeF2Y(e.getTmpAll().longValue())
  520 + : "0.00";
  521 + contentTmpList.add(obj);
  522 + }
  523 + for (BillManageForMonthDetailDTO e : list) {
  524 + Object[] obj = new Object[title.length];
  525 + int index = 0;
  526 + obj[index++] = StringUtils.isNotEmpty(e.getParkName()) ? e.getParkName() : "";
  527 + obj[index++] = e.getYearMontCashAmount() != null
  528 + ? AmountUtils.changeF2Y(e.getYearMontCashAmount().longValue()) : "0.00";
  529 + obj[index++] = e.getYearMonthWeChatAmount() != null ? AmountUtils.changeF2Y(e.getYearMonthWeChatAmount().longValue())
  530 + : "0.00";
  531 + obj[index++] = e.getYearMonthAlipayAmount() != null ? AmountUtils.changeF2Y(e.getYearMonthAlipayAmount().longValue())
  532 + : "0.00";
  533 + obj[index++] = e.getYearMonthAll() != null ? AmountUtils.changeF2Y(e.getYearMonthAll().longValue())
  534 + : "0.00";
  535 + contentYearOrMonthList.add(obj);
  536 + }
  537 +
  538 + ExcleFillDateManager fillUserManager = new ExcleFillDateManager();
  539 + fillUserManager.fillSalesOrga(workSheetTmp, title, contentTmpList, 2);
  540 + ExcleFillDateManager fillUserManagerYearOrMonth = new ExcleFillDateManager();
  541 + fillUserManagerYearOrMonth.fillSalesOrga(workSheetYearOrMonth, title, contentYearOrMonthList, 2);
  542 + // 4.excel输出配置
  543 + ExcelUtil.write(response, worksheet, fileName);
  544 +
  545 + } catch (Exception e) {
  546 + respondResult.setErrorInfo(ErrorType.BIZ_ERROR, "系统错误!");
  547 + e.printStackTrace();
  548 + }
  549 +
  550 + }
  551 +
  552 +
  553 +
  554 +
  555 +
  556 +
  557 +
  558 +
  559 + /**
  560 + * 通过session信息获取停车场编码.<br/>
  561 + *
  562 + * @param billQueryRequest
  563 + * @param userInfo
  564 + * @return
  565 + * @throws Exception
  566 + */
  567 + private List<String> queryParkNoByCustIds(TdCompanyParkQueryRequest tdCompanyParkQueryRequest) throws Exception {
  568 + /** 查询停车场编码. */
  569 + BizResult<List<String>> parkNoResult = tdCustCompanyService.queryParkNoByCustIds(tdCompanyParkQueryRequest);
  570 + if (parkNoResult.isSuccess() && parkNoResult != null && parkNoResult.getData() != null) {
  571 + logger.info("根据登录获取到对应的停车场编码=" + JSONArray.toJSONString(parkNoResult.getData()));
  572 + return parkNoResult.getData();
  573 + } else {
  574 + logger.info("根据登录用户没有获取到对应的停车场编码");
  575 + return null;
  576 + }
  577 +
  578 + }
  579 +
  580 +
  581 +
  582 +}
... ...
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/ParkLotStatisticController.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/ParkLotStatisticController.java
  1 +package com.zteits.irain.portal.web.parkinglotcloudplatform.datastatistic;
  2 +
  3 +import java.util.List;
  4 +import java.util.Map;
  5 +
  6 +import javax.servlet.http.HttpSession;
  7 +
  8 +import org.apache.commons.lang3.StringUtils;
  9 +import org.slf4j.Logger;
  10 +import org.slf4j.LoggerFactory;
  11 +import org.springframework.beans.factory.annotation.Autowired;
  12 +import org.springframework.web.bind.annotation.PostMapping;
  13 +import org.springframework.web.bind.annotation.RequestMapping;
  14 +import org.springframework.web.bind.annotation.RequestParam;
  15 +import org.springframework.web.bind.annotation.RestController;
  16 +
  17 +import com.alibaba.dubbo.common.utils.CollectionUtils;
  18 +import com.clouds.common.cache.park.ParkingLotCacheUtil;
  19 +import com.clouds.common.entity.UserInfo;
  20 +import com.clouds.common.utils.ResultUtils;
  21 +import com.clouds.common.web.SessionCommUtil;
  22 +import com.clouds.common.web.vo.BizResultVO;
  23 +import com.google.common.collect.Lists;
  24 +import com.zteits.clouds.api.apibase.bean.BizResult;
  25 +import com.zteits.clouds.api.apibase.constants.ErrorType;
  26 +import com.zteits.clouds.api.apibase.exception.BizException;
  27 +import com.zteits.clouds.api.dto.park.dto.ParkingLotDTO;
  28 +import com.zteits.clouds.api.dto.park.param.ParkFreeBerthGetByPlnoRequest;
  29 +import com.zteits.clouds.api.dto.park.param.QueryParkLotInfoByPkNoRequest;
  30 +import com.zteits.clouds.api.dto.pay.param.TdCompanyParkQueryRequest;
  31 +import com.zteits.clouds.api.service.park.ParkFreeBerthService;
  32 +import com.zteits.clouds.api.service.park.ParkingLotQueryService;
  33 +import com.zteits.clouds.api.service.pay.TdCustCompanyService;
  34 +import com.zteits.irain.portal.vo.govclouds.ParkLotStatisticVO;
  35 +import com.zteits.irain.portal.web.parkinglotcloudplatform.parklotmanage.ParkLotManageController;
  36 +
  37 +import io.swagger.annotations.Api;
  38 +import io.swagger.annotations.ApiOperation;
  39 +/**
  40 + *
  41 + * Copyright: Copyright (c) 2017 zteits
  42 + *
  43 + * @ClassName: ParkLotStatisticController.java
  44 + * @Description:
  45 + * @version: v1.0.0
  46 + * @author: zhaowg
  47 + * @date: 2017年8月7日 下午5:21:16
  48 + * Modification History:
  49 + * Date Author Version Description
  50 + *---------------------------------------------------------*
  51 + * 2017年8月7日 zhaowg v1.0.0 创建
  52 + */
  53 +
  54 +@Api("停车场信息统计")
  55 +@RestController
  56 +@RequestMapping("parklotstatistic")
  57 +public class ParkLotStatisticController {
  58 + private Logger logger = LoggerFactory.getLogger(ParkLotManageController.class);
  59 + @Autowired
  60 + private HttpSession session;
  61 + @Autowired
  62 + private SessionCommUtil sessionCommUtil;
  63 + @Autowired
  64 + private TdCustCompanyService tdCustCompanyService;
  65 + @Autowired
  66 + private ParkingLotQueryService parkingLotQueryService;
  67 + @Autowired
  68 + private ParkFreeBerthService parkFreeBerthService;
  69 +
  70 + @ApiOperation("获取停车场信息统计")
  71 + @PostMapping("getParkLotStatistic")
  72 + public BizResultVO<List<ParkLotStatisticVO>> getParkLotStatistic(@RequestParam String sysCode) throws Exception{
  73 + List<ParkLotStatisticVO> result = Lists.newArrayList();
  74 + //拥有的停车场编号
  75 + List<String> plNos = this.GetParkLotNosByCurrUser(sysCode);
  76 + //查询对应的停车场信息
  77 + if(CollectionUtils.isEmpty(plNos)){
  78 + return new BizResultVO<List<ParkLotStatisticVO>>().setData(result);
  79 + }
  80 + //空闲车位数
  81 + ParkFreeBerthGetByPlnoRequest request = new ParkFreeBerthGetByPlnoRequest();
  82 + request.setPlNos(plNos);
  83 + request.setSysCode(sysCode);
  84 + BizResult<Map<String, Integer>> freeBerthsNumBizResult = parkFreeBerthService.getParkFreeBerthByPlno(request );
  85 + Map<String, Integer> freeBerthsNumMap = ResultUtils.getBizResultData(freeBerthsNumBizResult);
  86 + for (String plNo : plNos) {
  87 + //先查询缓存
  88 + ParkingLotDTO lotDTO = ParkingLotCacheUtil.getParkLotByPlNo(plNo);
  89 + if(lotDTO == null){
  90 + //查询数据库
  91 + QueryParkLotInfoByPkNoRequest request1 = new QueryParkLotInfoByPkNoRequest();
  92 + request1.setSysCode(sysCode);
  93 + request1.setPklNo(plNo);
  94 + BizResult<ParkingLotDTO> bizResult2 = parkingLotQueryService.QueryParkingLotByPkNo(request1);
  95 + lotDTO = ResultUtils.getBizResultData(bizResult2);
  96 + }
  97 + if(lotDTO == null || StringUtils.isBlank(lotDTO.getPlName()) || lotDTO.getPlName().equals("null")){
  98 + continue;
  99 + }
  100 + ParkLotStatisticVO lotStatisticVO = new ParkLotStatisticVO();
  101 + lotStatisticVO.setPlNo(plNo);
  102 + lotStatisticVO.setPlName(lotDTO.getPlName());
  103 + lotStatisticVO.setFreeBerthsNum(freeBerthsNumMap.get(plNo));
  104 + lotStatisticVO.setTotalBerthsNum(lotDTO.getPlBerthNum());
  105 + lotStatisticVO.setUseingBerthsNum(lotDTO.getPlBerthNum()-freeBerthsNumMap.get(plNo));
  106 + //设置地磁在线离线数量
  107 + //TODO 临时方案,只有红山区有数据
  108 + result.add(lotStatisticVO);
  109 + }
  110 + return new BizResultVO<List<ParkLotStatisticVO>>().setData(result);
  111 + }
  112 +
  113 + private List<String> GetParkLotNosByCurrUser(String sysCode) throws Exception {
  114 + logger.info("根据登录人权限获取停车场列表");
  115 + List<String> plNos = Lists.newArrayList();
  116 + //2.调用接口查询当前登录人管辖的停车场名称
  117 + plNos.add("A320211000");
  118 + plNos.add("B1504020C7");
  119 + /*UserInfo userInfo = sessionCommUtil.getUserInfo();
  120 + if(userInfo!=null){
  121 + TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest();
  122 + tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds());
  123 + tdCompanyParkQueryRequest.setSysCode(sysCode);
  124 + tdCompanyParkQueryRequest.setSessionId(session.getId());
  125 + BizResult<List<String>> bizResult = tdCustCompanyService.queryParkNoByCustIds(tdCompanyParkQueryRequest );
  126 + plNos = ResultUtils.getBizResultData(bizResult);
  127 + }else{
  128 + throw new BizException(ErrorType.AUTH_TOKEN_NOT_EXISTS);
  129 + }*/
  130 + return plNos;
  131 + }
  132 +}
... ...
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/TransactionStatisticController.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/TransactionStatisticController.java
  1 +/**
  2 + *
  3 + */
  4 +package com.zteits.irain.portal.web.parkinglotcloudplatform.datastatistic;
  5 +
  6 +import java.text.SimpleDateFormat;
  7 +import java.util.ArrayList;
  8 +import java.util.Date;
  9 +import java.util.List;
  10 +
  11 +import javax.servlet.http.HttpServletRequest;
  12 +import javax.servlet.http.HttpServletResponse;
  13 +
  14 +import org.apache.poi.xssf.usermodel.XSSFSheet;
  15 +import org.slf4j.Logger;
  16 +import org.slf4j.LoggerFactory;
  17 +import org.springframework.beans.factory.annotation.Autowired;
  18 +import org.springframework.beans.factory.annotation.Value;
  19 +import org.springframework.web.bind.annotation.GetMapping;
  20 +import org.springframework.web.bind.annotation.PostMapping;
  21 +import org.springframework.web.bind.annotation.RequestBody;
  22 +import org.springframework.web.bind.annotation.RequestMapping;
  23 +import org.springframework.web.bind.annotation.RequestParam;
  24 +import org.springframework.web.bind.annotation.RestController;
  25 +
  26 +import com.alibaba.dubbo.common.utils.CollectionUtils;
  27 +import com.alibaba.dubbo.common.utils.StringUtils;
  28 +import com.alibaba.fastjson.JSON;
  29 +import com.alibaba.fastjson.JSONObject;
  30 +import com.clouds.common.utils.AmountUtils;
  31 +import com.clouds.common.utils.DateUtil;
  32 +import com.clouds.common.utils.ExceptionUtil;
  33 +import com.clouds.common.utils.excle.ExcelUtil;
  34 +import com.clouds.common.utils.excle.ExcleFillDateManager;
  35 +import com.clouds.common.utils.excle.Layouter;
  36 +import com.clouds.common.web.BizController;
  37 +import com.clouds.common.web.vo.BizResultVO;
  38 +import com.zteits.clouds.api.apibase.bean.BaseInfo;
  39 +import com.zteits.clouds.api.apibase.bean.BizResult;
  40 +import com.zteits.clouds.api.apibase.bean.PageBean;
  41 +import com.zteits.clouds.api.apibase.constants.ErrorType;
  42 +import com.zteits.clouds.api.apibase.exception.BizException;
  43 +import com.zteits.clouds.api.dto.clouds.dto.OrderTransDTO;
  44 +import com.zteits.clouds.api.dto.clouds.dto.OrderTransDetailDTO;
  45 +import com.zteits.clouds.api.dto.clouds.dto.OrderTransFoldLineDTO;
  46 +import com.zteits.clouds.api.dto.clouds.param.OrderTransactionQueryRequest;
  47 +import com.zteits.clouds.api.dto.park.param.InterfaceLogSaveRequest;
  48 +import com.zteits.clouds.api.dto.pay.TdBOrderDTO;
  49 +import com.zteits.clouds.api.dto.pay.param.TdBOrderRequest;
  50 +import com.zteits.clouds.api.service.clouds.OrderTransactionService;
  51 +import com.zteits.clouds.api.service.park.InterfaceLogService;
  52 +import com.zteits.clouds.api.service.pay.TdBOrderService;
  53 +import com.zteits.irain.portal.constant.ParkConstant.InterfaceLog;
  54 +//import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.OrderTransactionDetails;
  55 +//import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.TransactionRecord;
  56 +//import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.TransactionRequestObject;
  57 +//import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.TransactionStatisticSummary;
  58 +
  59 +import io.swagger.annotations.Api;
  60 +import io.swagger.annotations.ApiOperation;
  61 +
  62 +/**
  63 + * Unification object used for responding request from web front .
  64 + * @author hxz
  65 + *
  66 + */
  67 +class TransactionStatisticRespondObject <T, D> {
  68 + //private List<TransactionRecord> transactionRecordList;
  69 + //private TransactionStatisticSummary tranStcSummary;
  70 + private List<T> transactionRecordList;
  71 + private D tranStcSummary;
  72 +
  73 + /**
  74 + * @return the transactionRecordList
  75 + */
  76 + public List<T> getTransactionRecordList() {
  77 + return transactionRecordList;
  78 + }
  79 + /**
  80 + * @param transactionRecordList the transactionRecordList to set
  81 + */
  82 + public void setTransactionRecordList(List<T> transactionRecordList) {
  83 + this.transactionRecordList = transactionRecordList;
  84 + }
  85 + /**
  86 + * @return the tranStcSummary
  87 + */
  88 + public D getTranStcSummary() {
  89 + return tranStcSummary;
  90 + }
  91 + /**
  92 + * @param tranStcSummary the tranStcSummary to set
  93 + */
  94 + public void setTranStcSummary(D tranStcSummary) {
  95 + this.tranStcSummary = tranStcSummary;
  96 + }
  97 +}
  98 +
  99 +/**
  100 + * @author hxz
  101 + *
  102 + */
  103 +@Api("停车场云平台 数据统计 交易管理")
  104 +@RestController
  105 +@RequestMapping("/transaction")
  106 +public class TransactionStatisticController extends BizController {
  107 + private static final Logger logger = LoggerFactory.getLogger(TransactionStatisticController.class);
  108 +
  109 + @Value("${project.syscode}")
  110 + private String sysCode;
  111 +
  112 + @Autowired
  113 + private InterfaceLogService interfaceLogService;
  114 +
  115 + @Autowired
  116 + private OrderTransactionService orderTransactionService;
  117 +
  118 + @Autowired
  119 + private TdBOrderService tdborderservice;
  120 +
  121 + /**
  122 + *
  123 + * @param ID, 订单ID
  124 + * @return
  125 + * @throws Exception
  126 + */
  127 + @ApiOperation("获取交易详情")
  128 + @PostMapping("getordertrancdetails")
  129 + public Object GetOrderTrancDetails (@RequestBody TdBOrderRequest request) throws Exception {
  130 + logger.info("[{}]获取交易详情请求参数",request.getOrderId());
  131 + BizResult<TdBOrderDTO> bizResult = tdborderservice.queryOrderByOrderId(request);
  132 + logger.info("[{}]获取交易详情结果",bizResult);
  133 + return new BizResultVO<>(bizResult);
  134 + }
  135 +
  136 + @ApiOperation("停车收入统计-->收入汇总查询")
  137 + @PostMapping("/gettransactionstatisticsummary")
  138 + public Object GetTransactionStatisticSummary (@RequestBody OrderTransactionQueryRequest requestObject) throws Exception{
  139 + logger.info("[{}]--begin调用后场,停车收入统计-->收入汇总查询,入参={}",requestObject.getBaseRequest().getRequestId(),JSONObject.toJSON(requestObject));
  140 + BizResult<OrderTransDTO> respondObject = orderTransactionService.queryOrderTransaction(requestObject);
  141 + logger.info("[{}]--end调用后场,停车收入统计-->收入汇总查询.");
  142 + return new BizResultVO<>(respondObject);
  143 + }
  144 +
  145 + @ApiOperation("停车收入统计-->明细数据")
  146 + @PostMapping("/gettransactionstatisticlist")
  147 + public Object GetTransactionStatisticList (@RequestBody OrderTransactionQueryRequest requestObject) throws Exception{
  148 +
  149 + BizResult<PageBean<OrderTransDetailDTO>> respondObject = orderTransactionService.queryOrderTransactionDetail(requestObject);
  150 +
  151 + return returnJqGridData(respondObject, OrderTransDetailDTO.class);
  152 + }
  153 +
  154 + @ApiOperation("停车收入统计-->折线图")
  155 + @PostMapping("/getOrderTransactionFoldLine")
  156 + public BizResultVO<List<OrderTransFoldLineDTO>> getOrderTransactionFoldLine(@RequestBody OrderTransactionQueryRequest requestObject) throws Exception{
  157 +
  158 + logger.info("[{}]--begin调用后场,停车收入统计-->折线图,入参={}",requestObject.getBaseRequest().getRequestId(),JSONObject.toJSON(requestObject));
  159 + BizResult<List<OrderTransFoldLineDTO>> result = orderTransactionService.queryOrderTransactionFoldLine(requestObject);
  160 + logger.info("[{}]--end调用后场,停车收入统计-->折线图.",requestObject.getBaseRequest().getRequestId());
  161 + return new BizResultVO<List<OrderTransFoldLineDTO>>(result);
  162 + }
  163 +
  164 + /**
  165 + * Unification interface used for responding web front request.
  166 + * @param reqjsonstr
  167 + * @return
  168 + */
  169 + @ApiOperation("获取交易相关统计数据 统一接口处理 ")
  170 + @RequestMapping("/gettransactionstatistic")
  171 + public Object GetTransactionStatistic(@RequestBody String reqjsonstr) {
  172 + BaseInfo baseInfo = new BaseInfo();
  173 + String requestId = baseInfo.getRequestId();
  174 +
  175 + logger.info("[RequestId:" + requestId + "]停车场云平台数据统计交易管理请求参数:" + reqjsonstr);
  176 +
  177 + // Write log
  178 + InterfaceLogSaveRequest logSaveRequest = new InterfaceLogSaveRequest(sysCode,
  179 + baseInfo, -1, reqjsonstr, -1);
  180 +
  181 + // Object responding web front request.
  182 + // TransactionStatisticRespondObject<TransactionStatisticSummary, TransactionRecord> respondObject
  183 + TransactionStatisticRespondObject<OrderTransDetailDTO, OrderTransDTO> respondObject
  184 + = new TransactionStatisticRespondObject<OrderTransDetailDTO, OrderTransDTO>();
  185 +
  186 + try {
  187 + if (StringUtils.isBlank(reqjsonstr)) {
  188 + throw new BizException(ErrorType.PARAMM_NULL, "请求报文");
  189 + }
  190 +
  191 + // Request Object from web front.
  192 + //TransactionRequestObject tro = JSON.parseObject(reqjsonstr, TransactionRequestObject.class);
  193 + OrderTransactionQueryRequest requestObject = JSON.parseObject(reqjsonstr, OrderTransactionQueryRequest.class);
  194 +
  195 + // Get the "TransactionStatisticSummary" object through interface from 王富生.
  196 + //TransactionStatisticSummary tss = null;
  197 + BizResult<OrderTransDTO> tranStcSummary = orderTransactionService.queryOrderTransaction(requestObject);
  198 + respondObject.setTranStcSummary(tranStcSummary.getData());
  199 +
  200 + // Get the list of "TransactionRecord" through interface from 王富生.
  201 + BizResult<PageBean<OrderTransDetailDTO>> tranRecordList = orderTransactionService.queryOrderTransactionDetail(requestObject);
  202 + List<OrderTransDetailDTO> transactionRecordList = tranRecordList.getData().getDataList();
  203 + respondObject.setTransactionRecordList(transactionRecordList);
  204 +
  205 + // Set log foreign key.
  206 + // logSaveRequest.setOutId();
  207 + logSaveRequest.setStatus(InterfaceLog.Status.SUCCESS);
  208 + } catch (Exception e) {
  209 + logSaveRequest.setMessage(ExceptionUtil.getTrace(e));
  210 + logSaveRequest.setStatus(InterfaceLog.Status.FAIL);
  211 + logger.info(e.toString());
  212 + } finally {
  213 + logSaveRequest.setResponseBody(JSONObject.toJSONString(respondObject));
  214 + logSaveRequest.setResponseTime(new Date());
  215 + //保存日志
  216 + try{
  217 + interfaceLogService.SaveInterfaceLog(logSaveRequest);
  218 + }catch(Exception e){
  219 + e.printStackTrace();
  220 + }
  221 + }
  222 +
  223 + return respondObject;
  224 + }
  225 +
  226 +
  227 +
  228 +
  229 + @ApiOperation("导出交易管理数据统计excel")
  230 + @GetMapping("exportTransactionStatisticExcel")
  231 + public void excelParkingLotUseStatistic(@RequestParam String beginTime,
  232 + @RequestParam String endTime, @RequestParam List plNos,
  233 + Integer recType,
  234 + HttpServletRequest requests,
  235 + HttpServletResponse response) throws Exception{
  236 +
  237 + OrderTransactionQueryRequest request=new OrderTransactionQueryRequest();
  238 + request.setSysCode(sysCode);
  239 + request.setBeginTime(DateUtil.to_date(beginTime, DateUtil.DATETIME_FORMAT));
  240 + request.setEndTime(DateUtil.to_date(endTime, DateUtil.DATETIME_FORMAT));
  241 +// List<String> plNoslist=new ArrayList<>();
  242 +// plNoslist.add(plNos);
  243 + request.setParkIds(plNos);
  244 + request.setRecType(recType);
  245 + request.setBaseRequest(new BaseInfo(1, 0));
  246 + BizResult<PageBean<OrderTransDetailDTO>> bizResult=orderTransactionService.queryOrderTransactionDetail(request);
  247 + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  248 + SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd");
  249 + String[] title = new String[]{"交易时间","缴费状态","停车场名称","车牌号","订单号","停车类型","支付方式","金额","免费理由"};
  250 +
  251 + String sheetName="交易管理";
  252 + String fileName = "交易管理"+format2.format(new Date());
  253 + // 1.创建excel信息
  254 + XSSFSheet workSheet = ExcelUtil.createExcel(sheetName);
  255 + // 2.设置excel表头和表体
  256 + Layouter.buildReport(workSheet,title,0, 0);
  257 + //3.填充数据
  258 + List<Object[]> contentList=new ArrayList<Object[]>();
  259 + List<OrderTransDetailDTO> list =new ArrayList<>();
  260 + if(CollectionUtils.isNotEmpty(bizResult.getData().getDataList())){
  261 + list= bizResult.getData().getDataList();
  262 + }
  263 + for (OrderTransDetailDTO e: list) {
  264 + Object[] obj=new Object[title.length];
  265 + int index=0;
  266 + obj[index++]=e.getCreateTime() != null ? format.format(e.getCreateTime()) : "";
  267 + if(e.getOrderState() != null){
  268 + obj[index++]=(e.getOrderState() == 5 ? "异常缴费" :"正常缴费");
  269 + }else{
  270 + obj[index++]="-";
  271 + }
  272 + obj[index++]=e.getParkName();
  273 + obj[index++]=e.getCarNum();
  274 + obj[index++]=e.getOrderNo();
  275 + if(1==e.getPayType()){
  276 + obj[index++]="免费停车";
  277 + }else if(2==e.getPayType()){
  278 + obj[index++]="收费停车";
  279 + }else{
  280 + obj[index++]="-";
  281 + }
  282 + if(e.getPayType() != null){
  283 + switch (e.getPayType()) {
  284 + case 1:
  285 + obj[index++]="支付宝";
  286 + break;
  287 + case 2:
  288 + obj[index++]="微信";
  289 + break;
  290 + case 3:
  291 + obj[index++]="银联";
  292 + break;
  293 + case 4:
  294 + obj[index++]="微信";
  295 + break;
  296 + default:
  297 + obj[index++]="现金";
  298 + break;
  299 + }
  300 + }else{
  301 + obj[index++]="";
  302 + }
  303 + obj[index++]=(e.getOrderTotalFee() != null ? AmountUtils.changeF2Y(e.getOrderTotalFee().longValue()) : "");
  304 +
  305 + if(e.getFreeReason() != null){
  306 + switch (e.getFreeReason()) {
  307 + case 0:
  308 + obj[index++]="短时停车免费";
  309 + break;
  310 + case 7:
  311 + obj[index++]="授权车免费";
  312 + break;
  313 + case 8:
  314 + obj[index++]="手动免费开闸";
  315 + break;
  316 + default:
  317 + obj[index++]="-";
  318 + break;
  319 + }
  320 + }else{
  321 + obj[index++]="-";
  322 + }
  323 + contentList.add(obj);
  324 + }
  325 + ExcleFillDateManager fillUserManager=new ExcleFillDateManager();
  326 + fillUserManager.fillSalesOrga(workSheet,title,contentList,2);
  327 + // 4.excel输出配置
  328 + ExcelUtil.write(response, workSheet, fileName);
  329 + }
  330 +
  331 +}
... ...
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/VehicleFlowStatisticController.java 0 → 100644
  1 +++ a/src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/VehicleFlowStatisticController.java
  1 +package com.zteits.irain.portal.web.parkinglotcloudplatform.datastatistic;
  2 +
  3 +import java.sql.Timestamp;
  4 +import java.text.SimpleDateFormat;
  5 +import java.util.ArrayList;
  6 +import java.util.Calendar;
  7 +import java.util.Date;
  8 +import java.util.List;
  9 +import java.util.Map;
  10 +import java.util.Map.Entry;
  11 +
  12 +import javax.servlet.http.HttpServletRequest;
  13 +import javax.servlet.http.HttpServletResponse;
  14 +import javax.servlet.http.HttpSession;
  15 +
  16 +import org.apache.poi.xssf.usermodel.XSSFSheet;
  17 +import org.slf4j.Logger;
  18 +import org.slf4j.LoggerFactory;
  19 +import org.springframework.beans.factory.annotation.Autowired;
  20 +import org.springframework.beans.factory.annotation.Value;
  21 +import org.springframework.stereotype.Controller;
  22 +import org.springframework.web.bind.annotation.GetMapping;
  23 +import org.springframework.web.bind.annotation.PostMapping;
  24 +import org.springframework.web.bind.annotation.RequestBody;
  25 +import org.springframework.web.bind.annotation.RequestMapping;
  26 +import org.springframework.web.bind.annotation.RequestParam;
  27 +import org.springframework.web.bind.annotation.ResponseBody;
  28 +
  29 +import com.alibaba.dubbo.common.utils.CollectionUtils;
  30 +import com.alibaba.fastjson.JSON;
  31 +import com.alibaba.fastjson.JSONObject;
  32 +import com.clouds.common.entity.UserInfo;
  33 +import com.clouds.common.utils.DateUtil;
  34 +import com.clouds.common.utils.ResultUtils;
  35 +import com.clouds.common.utils.excle.ExcelUtil;
  36 +import com.clouds.common.utils.excle.ExcleFillDateManager;
  37 +import com.clouds.common.utils.excle.Layouter;
  38 +import com.clouds.common.web.BizController;
  39 +import com.clouds.common.web.SessionCommUtil;
  40 +import com.clouds.common.web.vo.BizResultVO;
  41 +import com.clouds.common.web.vo.EasyUIDataGridVO;
  42 +import com.google.common.collect.Lists;
  43 +import com.google.common.collect.Maps;
  44 +import com.zteits.clouds.api.apibase.bean.BaseInfo;
  45 +import com.zteits.clouds.api.apibase.bean.BizResult;
  46 +import com.zteits.clouds.api.apibase.bean.PageBean;
  47 +import com.zteits.clouds.api.apibase.constants.ErrorType;
  48 +import com.zteits.clouds.api.apibase.exception.BizException;
  49 +import com.zteits.clouds.api.dto.park.dto.ParkingLotUseStatisticDTO;
  50 +import com.zteits.clouds.api.dto.park.dto.ParkingLotUseStatisticMaxAndMinDTO;
  51 +import com.zteits.clouds.api.dto.park.param.ParkingLotUseStatisticForPageRequest;
  52 +import com.zteits.clouds.api.dto.pay.param.TdCompanyParkQueryRequest;
  53 +import com.zteits.clouds.api.service.park.ParkingLotUseStatisticService;
  54 +import com.zteits.clouds.api.service.pay.TdCustCompanyService;
  55 +import com.zteits.irain.portal.constant.ParkConstant;
  56 +import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.BerthsAndFlowLineChartVO;
  57 +import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.LineChartVO;
  58 +import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.LineChartVO.SerieVO;
  59 +
  60 +import io.swagger.annotations.Api;
  61 +import io.swagger.annotations.ApiOperation;
  62 +
  63 +/**
  64 + *
  65 + * 停车场车流量数据统计 Copyright: Copyright (c) 2017 zteits
  66 + *
  67 + * @ClassName: ParkingLotUseStatisticController.java
  68 + * @Description:
  69 + * @version: v1.0.0
  70 + * @author: langlw
  71 + * @date: 2017年6月14日 下午3:02:39 Modification History: Date Author Version
  72 + * Description ---------------------------------------------------------*
  73 + * 2017年6月14日 langlw v1.0.0 创建
  74 + */
  75 +@Api(value = "停车场车流量数据统计", description = "停车场车流量数据统计")
  76 +@Controller
  77 +@RequestMapping(value = "/VehicleFlowStatistic")
  78 +public class VehicleFlowStatisticController extends BizController {
  79 + private Logger logger = LoggerFactory.getLogger(VehicleFlowStatisticController.class);
  80 +
  81 + @Value("${project.syscode}")
  82 + private String sysCode;
  83 +
  84 + @Autowired
  85 + private ParkingLotUseStatisticService parkingLotStatisticService;
  86 + @Autowired
  87 + private HttpSession session;
  88 + @Autowired
  89 + private SessionCommUtil sessionCommUtil;
  90 + @Autowired
  91 + private TdCustCompanyService tdCustCompanyService;
  92 +
  93 + @ApiOperation("分页查询车流量数据统计车位总流量")
  94 + @PostMapping("getVehicleFlowStatisticForPage")
  95 + @ResponseBody
  96 + public BizResultVO<EasyUIDataGridVO<ParkingLotUseStatisticDTO>> queryParkingLotUseStatisticForPage(
  97 + @RequestBody ParkingLotUseStatisticForPageRequest request) throws Exception {
  98 + if (null == request.getBeginTime() || null==request.getEndTime()) {
  99 + throw new BizException(ErrorType.PARAMM_NULL, "开始时间和结束时间");
  100 + }
  101 + Calendar beginc = Calendar.getInstance();
  102 + beginc.setTime(request.getBeginTime());
  103 + int beginYear = beginc.get(Calendar.YEAR);
  104 + int beginMonth = beginc.get(Calendar.MONTH) + 1;
  105 + int beginDay = beginc.get(Calendar.DAY_OF_MONTH);
  106 +
  107 + Calendar endc = Calendar.getInstance();
  108 + endc.setTime(request.getEndTime());
  109 + int endYear = endc.get(Calendar.YEAR);
  110 + int endMonth = endc.get(Calendar.MONTH) + 1;
  111 + int endDay = endc.get(Calendar.DAY_OF_MONTH);
  112 +
  113 + if (beginYear == endYear && beginMonth == endMonth && beginDay == endDay) {
  114 + // 2表示按每小时统计
  115 + request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1HOUR);
  116 + } else {
  117 + // 3表示按每天统计
  118 + request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1DAY);
  119 + }
  120 +
  121 + BizResult<PageBean<ParkingLotUseStatisticDTO>> bizResult = parkingLotStatisticService
  122 + .queryParkingLotUseStatisticForPage(request);
  123 + return returnJqGridData(bizResult, ParkingLotUseStatisticDTO.class);
  124 + }
  125 +
  126 + @ApiOperation("查询车流量最大值与最小值")
  127 + @PostMapping("getVehicleFlowMaxAndMin")
  128 + @ResponseBody
  129 + public BizResultVO<ParkingLotUseStatisticMaxAndMinDTO> QueryParkingLotUseStatisticMaxAndMin(
  130 + @RequestBody ParkingLotUseStatisticForPageRequest request) {
  131 + Calendar beginc = Calendar.getInstance();
  132 + beginc.setTime(request.getBeginTime());
  133 + int beginYear = beginc.get(Calendar.YEAR);
  134 + int beginMonth = beginc.get(Calendar.MONTH) + 1;
  135 + int beginDay = beginc.get(Calendar.DAY_OF_MONTH);
  136 +
  137 + Calendar endc = Calendar.getInstance();
  138 + endc.setTime(request.getEndTime());
  139 + int endYear = endc.get(Calendar.YEAR);
  140 + int endMonth = endc.get(Calendar.MONTH) + 1;
  141 + int endDay = endc.get(Calendar.DAY_OF_MONTH);
  142 +
  143 + if (beginYear == endYear && beginMonth == endMonth && beginDay == endDay) {
  144 + // 2表示按每小时统计
  145 + request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1HOUR);
  146 + } else {
  147 + // 3表示按每天统计
  148 + request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1DAY);
  149 + }
  150 + BizResult<ParkingLotUseStatisticMaxAndMinDTO> bizResult = parkingLotStatisticService
  151 + .QueryVehicleFlowStatisticMaxAndMin(request);
  152 + return new BizResultVO<>(bizResult);
  153 + }
  154 +
  155 + @ApiOperation("导出车流量数据统计excel")
  156 + @GetMapping("exportVehicleFlowStatisticExcel")
  157 + public void excelParkingLotUseStatistic(@RequestParam String beginTime, @RequestParam String endTime,
  158 + @RequestParam String plNos, HttpServletRequest requests, HttpServletResponse response) {
  159 + ParkingLotUseStatisticForPageRequest request = new ParkingLotUseStatisticForPageRequest();
  160 + request.setSysCode(sysCode);
  161 + request.setBeginTime(DateUtil.to_date(beginTime, DateUtil.DATETIME_FORMAT));
  162 + request.setEndTime(DateUtil.to_date(endTime, DateUtil.DATETIME_FORMAT));
  163 + List<String> plNoslist = new ArrayList<>();
  164 + plNoslist.add(plNos);
  165 + request.setPlNos(plNoslist);
  166 + request.setBaseRequest(new BaseInfo(1, 0));
  167 + Calendar beginc = Calendar.getInstance();
  168 + beginc.setTime(request.getBeginTime());
  169 + int beginYear = beginc.get(Calendar.YEAR);
  170 + int beginMonth = beginc.get(Calendar.MONTH) + 1;
  171 + int beginDay = beginc.get(Calendar.DAY_OF_MONTH);
  172 +
  173 + Calendar endc = Calendar.getInstance();
  174 + endc.setTime(request.getEndTime());
  175 + int endYear = endc.get(Calendar.YEAR);
  176 + int endMonth = endc.get(Calendar.MONTH) + 1;
  177 + int endDay = endc.get(Calendar.DAY_OF_MONTH);
  178 +
  179 + if (beginYear == endYear && beginMonth == endMonth && beginDay == endDay) {
  180 + // 2表示按每小时统计
  181 + request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1HOUR);
  182 + } else {
  183 + // 3表示按每天统计
  184 + request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1DAY);
  185 + }
  186 + BizResult<PageBean<ParkingLotUseStatisticDTO>> bizResult = parkingLotStatisticService
  187 + .queryParkingLotUseStatisticForPage(request);
  188 + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  189 + SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd");
  190 + String[] title = new String[] { "时间", "总车流量", "临时车流量", "固定车流量" };
  191 + String sheetName = "车流量管理";
  192 + String fileName = "车流量管理" + format2.format(new Date());
  193 + // 1.创建excel信息
  194 + XSSFSheet workSheet = ExcelUtil.createExcel(sheetName);
  195 + // 2.设置excel表头和表体
  196 + Layouter.buildReport(workSheet, title, 0, 0);
  197 + // 3.填充数据
  198 + List<Object[]> contentList = new ArrayList<Object[]>();
  199 + List<ParkingLotUseStatisticDTO> list = new ArrayList<>();
  200 + if (CollectionUtils.isNotEmpty(bizResult.getData().getDataList())) {
  201 + list = bizResult.getData().getDataList();
  202 + }
  203 + for (ParkingLotUseStatisticDTO e : list) {
  204 + Object[] obj = new Object[title.length];
  205 + int index = 0;
  206 + obj[index++] = format.format(e.getStatisticBeginTime());
  207 + obj[index++] = e.getVehicleFlow();
  208 + obj[index++] = e.getTmpVehicleFlow();
  209 + obj[index++] = e.getFixVehicleFlow();
  210 + contentList.add(obj);
  211 + }
  212 + ExcleFillDateManager fillUserManager = new ExcleFillDateManager();
  213 + fillUserManager.fillSalesOrga(workSheet, title, contentList, 2);
  214 + // 4.excel输出配置
  215 + ExcelUtil.write(response, workSheet, fileName);
  216 + }
  217 +
  218 + /**
  219 + * 根据时间获取车流量折线图
  220 + *
  221 + * @param request
  222 + * @return
  223 + * @throws Exception
  224 + */
  225 + @ApiOperation("根据时间获取车流量折线图")
  226 + @PostMapping("getVehicleFlowForLineChart")
  227 + @ResponseBody
  228 + public BizResultVO<LineChartVO> getVehicleFlowForLineChart(
  229 + @RequestBody ParkingLotUseStatisticForPageRequest request) throws Exception {
  230 +
  231 + if (null == request.getBeginTime() || null==request.getEndTime()) {
  232 + throw new BizException(ErrorType.PARAMM_NULL, "开始时间和结束时间");
  233 + }
  234 + //2.调用接口查询当前登录人管辖的停车场名称
  235 + UserInfo userInfo = sessionCommUtil.getUserInfo();
  236 + List<String> plNos = new ArrayList<>();
  237 + if(userInfo!=null){
  238 + TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest();
  239 + tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds());
  240 + tdCompanyParkQueryRequest.setSessionId(session.getId());
  241 + tdCompanyParkQueryRequest.setSysCode(sysCode);
  242 + BizResult<List<String>> bizResult = tdCustCompanyService.queryParkNoByCustIds(tdCompanyParkQueryRequest);
  243 + //拥有的停车场编号
  244 + plNos = ResultUtils.getBizResultData(bizResult);
  245 + }
  246 + if(CollectionUtils.isEmpty(plNos)){
  247 + throw new BizException(ErrorType.PARK_LOT_NOT_EXISTS, "停车场plnos不存在");
  248 + }
  249 + request.setPlNos(plNos);
  250 +
  251 + logger.info("根据停车场编号获取该停车场今日车流量和车位折线图");
  252 + Calendar beginTime = Calendar.getInstance();
  253 + beginTime.setTime(request.getBeginTime());
  254 +
  255 + Calendar endTime = Calendar.getInstance();
  256 + endTime.setTime(request.getEndTime());
  257 +
  258 + Long dayDifference = DateUtil.getTimeDifference(new Timestamp(request.getEndTime().getTime()),
  259 + new Timestamp(request.getBeginTime().getTime()));
  260 + List<String> xAxisData = Lists.newArrayList();
  261 + request.setBaseRequest(new BaseInfo(1, 0));
  262 + String dateType="";
  263 +
  264 + if (dayDifference == 0L) {
  265 + // 20分钟为一个时间戳
  266 + request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER20MINUTE);
  267 + int totaltimestampCount = endTime.get(Calendar.HOUR_OF_DAY) * 3;
  268 + for (int i = 0; i < totaltimestampCount; i++) {
  269 + String hour = String.format("%02d", (i / 3));
  270 + String minute = String.format("%02d", (i % 3) * 20);
  271 + xAxisData.add(hour + ":" + minute);
  272 + }
  273 + dateType="HH:mm";
  274 + LineChartVO vehicleFlows=getVehicleFlows(request, xAxisData, dateType);
  275 + return new BizResultVO<LineChartVO>().setData(vehicleFlows);
  276 +
  277 + } else if (dayDifference <= 3L) {
  278 + // 1小时为一个时间戳
  279 + request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1HOUR);
  280 + int totaltimestampCount = endTime.get(Calendar.HOUR_OF_DAY);
  281 + String day = "";
  282 + String month = "";
  283 + for (int i = 0; i < dayDifference.intValue(); i++) {
  284 + beginTime.add(Calendar.DAY_OF_MONTH, 1);
  285 + int beginMonth = beginTime.get(Calendar.MONTH) + 1;
  286 + int beginDay = beginTime.get(Calendar.DAY_OF_MONTH);
  287 + month = String.format("%02d", (beginMonth));
  288 + day = String.format("%02d", (beginDay));
  289 + for (int j = 0; j < totaltimestampCount; j++) {
  290 + String hour = String.format("%02d", (j));
  291 + xAxisData.add(month + "-" + day + " " + hour);
  292 + }
  293 + }
  294 + dateType="MM-dd HH";
  295 + LineChartVO vehicleFlows=getVehicleFlows(request, xAxisData, dateType);
  296 + return new BizResultVO<LineChartVO>().setData(vehicleFlows);
  297 +
  298 + } else {
  299 + // 1天为一个时间戳
  300 + request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1DAY);
  301 + for (int i = 0; i < dayDifference.intValue(); i++) {
  302 + beginTime.add(Calendar.DAY_OF_MONTH, 1);
  303 + int beginMonth = beginTime.get(Calendar.MONTH) + 1;
  304 + int beginDay = beginTime.get(Calendar.DAY_OF_MONTH);
  305 + String month = String.format("%02d", (beginMonth));
  306 + String day = String.format("%02d", (beginDay));
  307 + xAxisData.add(month + "-" + day);
  308 +
  309 + }
  310 + dateType="MM-dd";
  311 + LineChartVO vehicleFlows=getVehicleFlows(request, xAxisData, dateType);
  312 + return new BizResultVO<LineChartVO>().setData(vehicleFlows);
  313 +
  314 + }
  315 +
  316 + }
  317 +
  318 +
  319 + private LineChartVO getVehicleFlows(ParkingLotUseStatisticForPageRequest request,
  320 + List<String> xAxisData,String dateType){
  321 + // 调用后场服务
  322 + logger.info("调用DUBBO服务入参:" + JSON.toJSONString(request));
  323 + BizResult<PageBean<ParkingLotUseStatisticDTO>> bizResult = parkingLotStatisticService
  324 + .queryParkingLotUseStatisticForPage(request);
  325 + PageBean<ParkingLotUseStatisticDTO> pageBean = ResultUtils.getBizResultData(bizResult);
  326 + List<ParkingLotUseStatisticDTO> useStatisticDTOs = Lists.newArrayList();
  327 + if (pageBean != null) {
  328 + useStatisticDTOs = pageBean.getDataList();
  329 + }
  330 +
  331 + // 保存固定车流量,时间戳和车流量对应关系
  332 + Map<String, Integer> fixVehicleFlowMap = Maps.newHashMap();
  333 + // 保存临时车流量,时间戳和车流量对应关系
  334 + Map<String, Integer> tmpVehicleFlowMap = Maps.newHashMap();
  335 + // 停车场编号和名称对应关系
  336 + Map<String, String> parkNameMap = Maps.newHashMap();
  337 + // 通过停车场,和统计时间分组
  338 + // Map<String, Map<String, Double>> parkLotMap = Maps.newHashMap();
  339 + if (!CollectionUtils.isEmpty(useStatisticDTOs)) {
  340 + for (ParkingLotUseStatisticDTO statisticDTO : useStatisticDTOs) {
  341 + String key = statisticDTO.getPlNo();
  342 + parkNameMap.put(key, statisticDTO.getPlName());
  343 + String statisBeginTime = DateUtil.getDateString(statisticDTO.getStatisticBeginTime(), dateType);
  344 + //保存固定车流量和临时车流量
  345 + fixVehicleFlowMap.put(statisBeginTime, (fixVehicleFlowMap.get(statisBeginTime)==null?0:fixVehicleFlowMap.get(statisBeginTime))+statisticDTO.getFixVehicleFlow());
  346 + tmpVehicleFlowMap.put(statisBeginTime, (tmpVehicleFlowMap.get(statisBeginTime)==null?0:tmpVehicleFlowMap.get(statisBeginTime))+statisticDTO.getTmpVehicleFlow());
  347 + }
  348 + }
  349 +
  350 + // 封装车流量统计
  351 + LineChartVO vehicleFlows = new LineChartVO();
  352 + List<String> vehicleFlows_legendData = Lists.newArrayList();
  353 + vehicleFlows_legendData.add("临时车");
  354 + vehicleFlows_legendData.add("固定车");
  355 + vehicleFlows.setLegendData(vehicleFlows_legendData);
  356 + vehicleFlows.setxAxisData(xAxisData);
  357 + List<SerieVO> vehicleSeries = Lists.newArrayList();
  358 + // 固定车
  359 + SerieVO fixSerieVo = new SerieVO();
  360 + fixSerieVo.setName("固定车");
  361 + List<Integer> fixSerieVoData = Lists.newArrayList();
  362 + // 临时车
  363 + SerieVO tmpSerieVo = new SerieVO();
  364 + tmpSerieVo.setName("临时车");
  365 + List<Integer> tmpSerieVoData = Lists.newArrayList();
  366 + // 保存上一次的临时车值,当某个时间点没有数据时,则保持和上次一致
  367 + Integer lastfixFlow = 0;
  368 + Integer lasttmpFlow = 0;
  369 + for (String timestamp : xAxisData) {
  370 +
  371 + if (fixVehicleFlowMap.containsKey(timestamp)) {
  372 + lastfixFlow = fixVehicleFlowMap.get(timestamp).intValue();
  373 + }else{
  374 + lastfixFlow =0;
  375 + }
  376 + fixSerieVoData.add(lastfixFlow);
  377 +
  378 + if (tmpVehicleFlowMap.containsKey(timestamp)) {
  379 + lasttmpFlow = tmpVehicleFlowMap.get(timestamp).intValue();
  380 + }else{
  381 + lasttmpFlow = 0;
  382 + }
  383 + tmpSerieVoData.add(lasttmpFlow);
  384 + }
  385 + fixSerieVo.setData(fixSerieVoData);
  386 + vehicleSeries.add(fixSerieVo);
  387 + tmpSerieVo.setData(tmpSerieVoData);
  388 + vehicleSeries.add(tmpSerieVo);
  389 +
  390 + vehicleFlows.setSeries(vehicleSeries);
  391 + return vehicleFlows;
  392 + }
  393 +
  394 + public static void main(String[] args) {
  395 + String json="{\"id\":\"1\",\"platform\":\"android\",\"parameter\":{\"drid\":\"177277364\",\"sex\":\"1\",\"type\":\"2\",\"creatorname\":\"Mrw\",\"username\":\"jack\",\"pwd\":\"123456\",\"remark\":\"平板用户\",\"createtime\":\"2017-07-24 23:59:59\"}}";
  396 + JSONObject object =(JSONObject)JSONObject.parse(json);
  397 + System.out.println(object.get("id"));
  398 + System.out.println(object.get("platform"));
  399 + JSONObject parameter =(JSONObject)object.get("parameter");
  400 + System.out.println(parameter.get("drid"));
  401 + System.out.println(parameter.get("sex"));
  402 + }
  403 +
  404 +
  405 +}
... ...