Pre Merge pull request !1 from 白美平/main
commit
26ffacf227
Binary file not shown.
@ -0,0 +1,18 @@
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.7/apache-maven-3.8.7-bin.zip
|
||||
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar
|
||||
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="Spring" name="Spring">
|
||||
<configuration />
|
||||
</facet>
|
||||
</component>
|
||||
</module>
|
||||
@ -0,0 +1,84 @@
|
||||
package com.nmgs;
|
||||
|
||||
import com.nmgs.util.PathUtil;
|
||||
import com.trkf.PasswordEncryption.PassWordUtils;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.env.EnvironmentPostProcessor;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
import org.springframework.core.env.PropertiesPropertySource;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.util.Properties;
|
||||
|
||||
@Configuration
|
||||
public class MyEnvironmentPostProcessor implements EnvironmentPostProcessor {
|
||||
|
||||
@Override
|
||||
public void postProcessEnvironment(ConfigurableEnvironment configurableEnvironment, SpringApplication application) {
|
||||
System.out.println("WhiteListManageSys读取公用配置文件======");
|
||||
//公用配置文件路径
|
||||
String path = PathUtil.applicationPath;
|
||||
//本项目配置文件路径
|
||||
String NewPath = PathUtil.projectApplicationPath;
|
||||
System.out.println("Loading local settings from : " + path);
|
||||
System.out.println("Loading local settings from : " + NewPath);
|
||||
Properties properties = new Properties();
|
||||
Properties Newproperties = new Properties();
|
||||
try {
|
||||
File fileproperties = new File(path);
|
||||
File fileNewproperties = new File(NewPath);
|
||||
// 判断文件夹是否存在
|
||||
if (!fileproperties.exists()) {
|
||||
fileproperties.createNewFile();
|
||||
}
|
||||
if (!fileNewproperties.exists()) {
|
||||
fileNewproperties.createNewFile();
|
||||
}
|
||||
properties.load(new FileInputStream(path));
|
||||
String DBType = properties.getProperty("DBType") == null ? "1" : properties.getProperty("DBType");
|
||||
Newproperties.load(new FileInputStream(NewPath));
|
||||
properties.setProperty("spring.logback.logPath",PathUtil.TomcatPath+"/logs");
|
||||
properties.setProperty("spring.datasource.url",properties.getProperty("DBUrl"));
|
||||
properties.setProperty("spring.datasource.username",properties.getProperty("DBUserName"));
|
||||
properties.setProperty("spring.datasource.password",PassWordUtils.decrypt(properties.getProperty("DBPassWord")));
|
||||
if(DBType.equals("1")){
|
||||
properties.setProperty("spring.datasource.driver-class-name",Newproperties.getProperty("sqlClassName"));
|
||||
properties.setProperty("spring.datasource.validationQuery",Newproperties.getProperty("sqlvalidationQuery"));
|
||||
properties.setProperty("spring.datasource.hikari.connection-test-query",Newproperties.getProperty("sqlvalidationQuery"));
|
||||
}else if(DBType.equals("2")){
|
||||
properties.setProperty("spring.datasource.driver-class-name",Newproperties.getProperty("OracleClassName"));
|
||||
properties.setProperty("spring.datasource.validationQuery",Newproperties.getProperty("OraclevalidationQuery"));
|
||||
properties.setProperty("spring.datasource.hikari.connection-test-query",Newproperties.getProperty("OraclevalidationQuery"));
|
||||
}else if(DBType.equals("3")){
|
||||
properties.setProperty("spring.datasource.driver-class-name",Newproperties.getProperty("DMClassName"));
|
||||
properties.setProperty("spring.datasource.validationQuery",Newproperties.getProperty("DMvalidationQuery"));
|
||||
properties.setProperty("spring.datasource.hikari.connection-test-query",Newproperties.getProperty("DMvalidationQuery"));
|
||||
}else if(DBType.equals("4")){
|
||||
properties.setProperty("spring.datasource.driver-class-name",Newproperties.getProperty("MySQLClassName"));
|
||||
properties.setProperty("spring.datasource.validationQuery",Newproperties.getProperty("MySQLvalidationQuery"));
|
||||
properties.setProperty("spring.datasource.hikari.connection-test-query",Newproperties.getProperty("MySQLvalidationQuery"));
|
||||
} else if (DBType.equals("5")) {
|
||||
properties.setProperty("spring.datasource.driver-class-name", Newproperties.getProperty("MySQLGOADENDBClassName"));
|
||||
properties.setProperty("spring.datasource.validationQuery", Newproperties.getProperty("MySQLGOADENDBvalidationQuery"));
|
||||
properties.setProperty("spring.datasource.hikari.connection-test-query", Newproperties.getProperty("MySQLGOADENDBvalidationQuery"));
|
||||
}
|
||||
System.out.println("---------------------------specialEvent本次载入数据库----------------------");
|
||||
System.out.println("server.port: " + properties.getProperty("server.port"));
|
||||
System.out.println(" url : " + properties.getProperty("spring.datasource.url"));
|
||||
System.out.println(" username : " + properties.getProperty("spring.datasource.username"));
|
||||
System.out.println(" password : " + properties.getProperty("spring.datasource.password"));
|
||||
System.out.println(" driver-class-name : " + properties.getProperty("spring.datasource.driver-class-name"));
|
||||
//环境名称随意取,但尽量不能和其他环境名称相同,避免不生效
|
||||
PropertiesPropertySource propertySource = new PropertiesPropertySource("environmentPostProcessor", properties);
|
||||
PropertiesPropertySource newPropertySource = new PropertiesPropertySource("newEnvironmentPostProcessor", Newproperties);
|
||||
//外部的文件是最先导入的
|
||||
configurableEnvironment.getPropertySources().addFirst(propertySource);
|
||||
//如果公用配置文件没有配置的则使用本项目的配置文件
|
||||
configurableEnvironment.getPropertySources().addLast(newPropertySource);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package com.nmgs;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
@EnableAsync
|
||||
@SpringBootApplication
|
||||
@EnableTransactionManagement
|
||||
public class WhiteListManageSysApplication extends SpringBootServletInitializer {
|
||||
@Override
|
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
|
||||
return builder.sources(WhiteListManageSysApplication.class);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(WhiteListManageSysApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package com.nmgs.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
|
||||
/**
|
||||
* <h2>操作日志注解</h2>
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*/
|
||||
@Target({ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface OperationLogDesc {
|
||||
/**
|
||||
* 操作模块
|
||||
*/
|
||||
String module();
|
||||
|
||||
/**
|
||||
* 操作事件
|
||||
*/
|
||||
String events();
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
package com.nmgs.config;
|
||||
|
||||
/**
|
||||
* 启用跨域配置
|
||||
* 编写SpringMVCConfig类使用FilterConfig中的配置
|
||||
*
|
||||
* @author Administrator
|
||||
*/
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.cors.CorsConfiguration;
|
||||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
import org.springframework.web.filter.CorsFilter;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Configuration
|
||||
public class CorsConfig implements WebMvcConfigurer {
|
||||
|
||||
@Resource
|
||||
private FilterConfig filterconfig;
|
||||
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
// 设置拦截类
|
||||
registry.addInterceptor(filterconfig)
|
||||
.addPathPatterns("/**")
|
||||
// 是否允许证书
|
||||
.excludePathPatterns(
|
||||
"/MenuIndex/**",
|
||||
"/Manager/**",
|
||||
"/logManager/**",
|
||||
"/wxCarUserInfo/**",
|
||||
"/404/**",
|
||||
"/MenuIndex/**",
|
||||
"/index.html",
|
||||
"/assets/**",
|
||||
"/img/**",
|
||||
"/static/**",
|
||||
"/doc.html",
|
||||
"/error/**"
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 跨越配置
|
||||
*/
|
||||
@Bean
|
||||
public CorsFilter corsFilter() {
|
||||
CorsConfiguration config = new CorsConfiguration();
|
||||
// 设置容许跨域请求的域名
|
||||
config.addAllowedOriginPattern("*");
|
||||
// config.addAllowedOrigin("*");
|
||||
// 设置容许的方法
|
||||
config.addAllowedMethod("*");
|
||||
// 容许任何头
|
||||
config.addAllowedHeader("*");
|
||||
config.addExposedHeader("token");
|
||||
//是否支持cookie跨域
|
||||
config.setAllowCredentials(true);
|
||||
UrlBasedCorsConfigurationSource configSource = new UrlBasedCorsConfigurationSource();
|
||||
configSource.registerCorsConfiguration("/**", config);
|
||||
return new CorsFilter(configSource);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.nmgs.config;
|
||||
|
||||
import org.springframework.boot.web.server.ErrorPage;
|
||||
import org.springframework.boot.web.server.ErrorPageRegistrar;
|
||||
import org.springframework.boot.web.server.ErrorPageRegistry;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class ErrorConfig implements ErrorPageRegistrar {
|
||||
|
||||
@Override
|
||||
public void registerErrorPages(ErrorPageRegistry registry) {
|
||||
ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND, "/index.html");
|
||||
registry.addErrorPages(error404Page);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package com.nmgs.config;
|
||||
|
||||
/**
|
||||
* 允许跨域请求
|
||||
*
|
||||
* @author Administrator
|
||||
*/
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class FilterConfig implements HandlerInterceptor {
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||
if(request.getHeader("Origin")==null){
|
||||
System.out.println("request.getHeader(\"Origin\")=======>为空");
|
||||
response.setHeader("Access-Control-Allow-Origin", "*");//支持跨域请求
|
||||
}else{
|
||||
System.out.println("request.getHeader(\"Origin\")=======>" + request.getHeader("Origin"));
|
||||
response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin"));//支持跨域请求
|
||||
}
|
||||
response.setHeader("Access-Control-Allow-Credentials", "true");//是否支持cookie跨域
|
||||
response.setHeader("Access-Control-Allow-Methods", "*");//X-forwared-port,X-forwarded-host,
|
||||
response.setHeader("Access-Control-Allow-Headers", "Authorization,Origin, X-Requested-With, Content-Type, Accept,Access-Token");//Origin, X-Requested-With, Content-Type, Accept,Access-Token
|
||||
response.setHeader("Set-Cookie", "SameSite=None");
|
||||
String token = request.getHeader("token");
|
||||
String userId = request.getHeader("userId");
|
||||
if(userId != null){
|
||||
request.getSession().setAttribute("userId",userId);
|
||||
}
|
||||
if (token != null) {
|
||||
if (token.equals("test")) {
|
||||
return true;
|
||||
}
|
||||
//boolean result = TokenUtil.verify(token,request);
|
||||
if (true) {
|
||||
log.info("通过拦截器");
|
||||
return true;
|
||||
}
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
|
||||
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
response.setContentType("application/json; charset=utf-8");
|
||||
JSONObject res = new JSONObject();
|
||||
res.put("status", "-1");
|
||||
res.put("msg", "鉴权失败");
|
||||
PrintWriter out = null;
|
||||
out = response.getWriter();
|
||||
out.write(res.toString());
|
||||
out.flush();
|
||||
out.close();
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package com.nmgs.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import springfox.documentation.RequestHandler;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
@Configuration
|
||||
@EnableSwagger2WebMvc
|
||||
public class Knife4jConfiguration {
|
||||
|
||||
@Bean(value = "dockerBean")
|
||||
public Docket dockerBean() {
|
||||
//指定使用Swagger2规范
|
||||
Docket docket=new Docket(DocumentationType.SWAGGER_2)
|
||||
.apiInfo(new ApiInfoBuilder()
|
||||
//描述字段支持Markdown语法
|
||||
.description("白名单管理系统")
|
||||
.termsOfServiceUrl("http://域名:端口/WhiteListManageSys/")
|
||||
.contact("天润科丰")
|
||||
.version("1.0")
|
||||
.build())
|
||||
//分组名称
|
||||
.groupName("白名单服务")
|
||||
.select()
|
||||
//这里指定Controller扫描包路径
|
||||
.apis(basePackage("com.nmgs.controller"+";"+"com.nmgs.AppController"))
|
||||
//.apis(basePackage("com.nmgs.controller"))
|
||||
.paths(PathSelectors.any())
|
||||
.build();
|
||||
return docket;
|
||||
}
|
||||
|
||||
/**
|
||||
* 扫描多个包
|
||||
* @param basePackage
|
||||
* @return
|
||||
*/
|
||||
private static Function<Class<?>, Boolean> handlerPackage(final String basePackage) {
|
||||
return (input) -> {
|
||||
// 循环判断匹配
|
||||
for (String strPackage : basePackage.split(";")) {
|
||||
boolean isMatch = input.getPackage().getName().startsWith(strPackage);
|
||||
if (isMatch) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
public static Predicate<RequestHandler> basePackage(final String basePackage) {
|
||||
return (input) -> {
|
||||
return (Boolean)declaringClass(input).map(handlerPackage(basePackage)).orElse(true);
|
||||
};
|
||||
}
|
||||
|
||||
private static Optional<? extends Class<?>> declaringClass(RequestHandler input) {
|
||||
return Optional.ofNullable(input.declaringClass());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package com.nmgs.config;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.DbType;
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||
import com.nmgs.util.PropertiesUtil;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class MybatisPlusConfig {
|
||||
@Bean
|
||||
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||
if(PropertiesUtil.getValue("DBType").equals("1")){
|
||||
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.SQL_SERVER2005));
|
||||
}else if(PropertiesUtil.getValue("DBType").equals("2")){
|
||||
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.ORACLE));
|
||||
}else if(PropertiesUtil.getValue("DBType").equals("3")){
|
||||
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.DM));
|
||||
}else if(PropertiesUtil.getValue("DBType").equals("4")){
|
||||
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
|
||||
}
|
||||
return interceptor;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.nmgs.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
@Configuration
|
||||
@EnableAsync
|
||||
public class ThreadPoolConfig {
|
||||
|
||||
@Bean("specaiEventThreadPool") //线程池实例名,多个线程池配置需要声明,一个线程池可有可无
|
||||
public Executor executorNormal() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
executor.setCorePoolSize(3);
|
||||
executor.setMaxPoolSize(5);
|
||||
executor.setQueueCapacity(3);
|
||||
executor.setKeepAliveSeconds(60);
|
||||
executor.setThreadNamePrefix("NORMAL--");
|
||||
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.AbortPolicy());
|
||||
executor.initialize();
|
||||
return executor;
|
||||
}
|
||||
@Bean
|
||||
public ThreadPoolTaskScheduler threadPoolTaskScheduler() {
|
||||
ThreadPoolTaskScheduler ThreadPoolTaskScheduler = new ThreadPoolTaskScheduler();
|
||||
// ThreadPoolTaskScheduler.initialize();
|
||||
return ThreadPoolTaskScheduler;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package com.nmgs.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.socket.config.annotation.EnableWebSocket;
|
||||
|
||||
@Configuration
|
||||
@EnableWebSocket
|
||||
public class WebSocketConfig {
|
||||
//如果是外部tomcat 启动war 包,需要注释掉,要不会报错
|
||||
/* @Bean
|
||||
public ServerEndpointExporter serverEndpointExporter() {
|
||||
|
||||
return new ServerEndpointExporter();
|
||||
}*/
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
package com.nmgs.controller;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.support.ExcelTypeEnum;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.nmgs.annotation.OperationLogDesc;
|
||||
import com.nmgs.config.ResultData;
|
||||
import com.nmgs.entity.*;
|
||||
import com.nmgs.service.impl.ExcelDateImpl;
|
||||
import com.nmgs.util.ExcelUtil;
|
||||
import com.nmgs.util.LogUtil;
|
||||
import com.nmgs.util.PubTools;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.models.HttpMethod;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.net.URLEncoder;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/exportData")
|
||||
@Api(tags="导出")
|
||||
public class ExportData {
|
||||
|
||||
@Autowired
|
||||
private ExcelDateImpl excelDateImpl;
|
||||
|
||||
@GetMapping(value="/exportWhiteCarnoList")
|
||||
@ApiOperation(httpMethod="GET",value = "白名单数据导出")
|
||||
@OperationLogDesc(module = "白名单管理",events = "白名单数据导出")
|
||||
public void exportDivOutPortGroadList(String paramsData,@RequestBody(required = false) Object req,HttpServletResponse response) throws SQLException {
|
||||
try {
|
||||
if(req==null && !PubTools.isNull(paramsData)){
|
||||
req=JSONObject.parse(paramsData);
|
||||
}
|
||||
List<WhiteCarnoListDto> list = excelDateImpl.exportDivOutPortGroadList((Map<String, Object>)req);
|
||||
ExcelUtil.exportExcel(response,list, WhiteCarnoListDto.class,"白名单数据信息","白名单数据信息");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
LogUtil.WriteLog_Error("白名单数据导出失败"+e.getMessage(),"ExportData");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package com.nmgs.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.nmgs.annotation.OperationLogDesc;
|
||||
import com.nmgs.config.ResultData;
|
||||
import com.nmgs.service.impl.SelectDataImpl;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.sql.SQLException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 下拉框内容查询
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/selectData")
|
||||
@Api(tags="下拉值查询")
|
||||
public class SelectController {
|
||||
@Autowired
|
||||
public SelectDataImpl selectDataImpl;
|
||||
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd");
|
||||
//获取查验数据
|
||||
@PostMapping(value="/getListByType")
|
||||
@ApiOperation(httpMethod="POST",value = "下拉值查询")
|
||||
public ResultData<List> submitCheck(HttpServletRequest request, @RequestBody Object req) throws SQLException {
|
||||
JSONObject paramsData=new JSONObject();
|
||||
if(req instanceof Map){
|
||||
paramsData=(JSONObject)JSONObject.toJSON(req);
|
||||
}else if(req instanceof JSONObject){
|
||||
paramsData=(JSONObject)req;
|
||||
}
|
||||
List ret=selectDataImpl.getDataByType(paramsData);
|
||||
if(ret==null){
|
||||
return ResultData.fail(-1,"查询数据失败");
|
||||
}
|
||||
return ResultData.success("查询成功",ret,0);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
package com.nmgs.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nmgs.annotation.OperationLogDesc;
|
||||
import com.nmgs.config.ResultData;
|
||||
import com.nmgs.entity.WhiteAccountText;
|
||||
import com.nmgs.service.IWhiteAccountSerive;
|
||||
import com.nmgs.util.PubTools;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.sql.SQLException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 单位信息管理
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/whiteAccount")
|
||||
@Api(tags = "单位信息管理")
|
||||
public class WhiteAccountTextController {
|
||||
|
||||
|
||||
public IWhiteAccountSerive iWhiteAccountSerive;
|
||||
@Autowired
|
||||
public void setiWhiteAccountSerive(IWhiteAccountSerive iWhiteAccountSerive) {
|
||||
this.iWhiteAccountSerive = iWhiteAccountSerive;
|
||||
}
|
||||
|
||||
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd");
|
||||
@PostMapping(value="/getAccountByPage")
|
||||
@ApiOperation(httpMethod="POST",value="查询单位信息管理数据")
|
||||
public Object getListByPage(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> req) throws SQLException {
|
||||
Page<WhiteAccountText> whiteCarnoListList =null;
|
||||
try{
|
||||
whiteCarnoListList = iWhiteAccountSerive.getWhiteAccountTextByPage(req);
|
||||
if (PubTools.isEmpty(whiteCarnoListList)) {
|
||||
return ResultData.fail(-1,"数据查询失败");
|
||||
}
|
||||
}catch (Exception e){
|
||||
String throwableStr = e.getCause().toString();
|
||||
if(throwableStr.contains(":")){
|
||||
throwableStr = throwableStr.substring(throwableStr.indexOf(":") + 1);
|
||||
}
|
||||
return ResultData.fail(-1,"数据查询失败==>"+throwableStr);
|
||||
}
|
||||
return whiteCarnoListList;
|
||||
}
|
||||
|
||||
@PostMapping(value = "/addData")
|
||||
@OperationLogDesc(module = "单位信息管理>新增", events = "新增记录")
|
||||
@ApiOperation(httpMethod="POST",value="新增记录")
|
||||
public ResultData<String> addData(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> req) throws Exception {
|
||||
int ret = iWhiteAccountSerive.insertData((WhiteAccountText)PubTools.map2Object(req,WhiteAccountText.class));
|
||||
if(ret>-1){
|
||||
return ResultData.success("新增成功","",0);
|
||||
}else{
|
||||
if(ret==-2){
|
||||
return ResultData.fail("单位编码已经存在!");
|
||||
}
|
||||
}
|
||||
return ResultData.fail("新增失败");
|
||||
}
|
||||
@PostMapping(value = "/batchDelDatas")
|
||||
@OperationLogDesc(module = "单位信息管理>批量删除", events = "删除记录")
|
||||
@ApiOperation(httpMethod="POST",value="删除记录")
|
||||
public ResultData<String> batchDelDatas(HttpServletRequest request, @RequestBody Object req) throws Exception {
|
||||
int ret = iWhiteAccountSerive.batchDelDatas(req);
|
||||
if(ret>-1){
|
||||
return ResultData.success("删除成功","",0);
|
||||
}
|
||||
return ResultData.fail("删除失败");
|
||||
}
|
||||
@PostMapping(value = "/updateById")
|
||||
@OperationLogDesc(module = "单位信息管理>修改", events = "修改记录")
|
||||
@ApiOperation(httpMethod="POST",value="修改记录")
|
||||
public ResultData<String> updateById(HttpServletRequest request, @RequestBody(required = false) WhiteAccountText req) throws Exception {
|
||||
try{
|
||||
int ret = iWhiteAccountSerive.updateById(req);
|
||||
if(ret>-1){
|
||||
return ResultData.success("保存成功");
|
||||
}
|
||||
}catch (Exception e){
|
||||
return ResultData.fail("保存失败:"+e.getMessage());
|
||||
}
|
||||
|
||||
return ResultData.fail("保存失败");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,159 @@
|
||||
package com.nmgs.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.poi.excel.ExcelReader;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.nmgs.config.ResultData;
|
||||
import com.nmgs.entity.WhiteCarnoList;
|
||||
import com.nmgs.entity.WhiteCarnoLogTable;
|
||||
import com.nmgs.service.IWhiteBatchImportSerive;
|
||||
import com.nmgs.util.LogUtil;
|
||||
import com.nmgs.util.PubTools;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/whiteBatchImport")
|
||||
@Api(tags = "白名单批量导入")
|
||||
public class WhiteBatchImportController {
|
||||
|
||||
public IWhiteBatchImportSerive iWhiteBatchImportSerive;
|
||||
@Autowired
|
||||
public void setiWhiteBatchImportSerive(IWhiteBatchImportSerive iWhiteBatchImportSerive) {
|
||||
this.iWhiteBatchImportSerive = iWhiteBatchImportSerive;
|
||||
}
|
||||
|
||||
//实现Spring Boot 的文件下载功能,映射网址为/download
|
||||
@ApiOperation(value = "模板下载",httpMethod = "GET",ignoreJsonView = false )
|
||||
@ApiImplicitParams(
|
||||
@ApiImplicitParam(value = "fileName",defaultValue = "gasstation")
|
||||
)
|
||||
@RequestMapping(value = "/download", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
|
||||
@ResponseBody
|
||||
public String downloadFile(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException {
|
||||
String fileName = request.getParameter("fileName");
|
||||
if(PubTools.isNull(fileName)){
|
||||
fileName="白名单模板空白";
|
||||
}
|
||||
fileName =fileName+".xlsx";
|
||||
String fileP=com.nmgs.util.PathUtil.webappsPath+"//"+ fileName;
|
||||
LogUtil.WriteLog_Info("模板下载地址====="+fileP,"WhiteBatchImportController");
|
||||
File file = new File(fileP);
|
||||
// 如果文件名存在,则进行下载
|
||||
if (file.exists()) {
|
||||
// 配置文件下载
|
||||
response.setHeader("content-type", "application/octet-stream");
|
||||
response.setContentType("application/octet-stream");
|
||||
// 下载文件能正常显示中文
|
||||
response.addHeader("Content-Length", String.valueOf(file.length()));
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(file.getName(), "UTF-8"));
|
||||
|
||||
// 实现文件下载
|
||||
byte[] buffer = new byte[1024*1024*100];
|
||||
FileInputStream fis = null;
|
||||
BufferedInputStream bis = null;
|
||||
try {
|
||||
fis = new FileInputStream(file);
|
||||
bis = new BufferedInputStream(fis);
|
||||
OutputStream os = response.getOutputStream();
|
||||
int i = bis.read(buffer);
|
||||
while (i != -1) {
|
||||
os.write(buffer, 0, i);
|
||||
i = bis.read(buffer);
|
||||
}
|
||||
|
||||
System.out.println("Download the song successfully!");
|
||||
return "下载成功!";
|
||||
}
|
||||
catch (Exception e) {
|
||||
System.out.println("Download the song failed!");
|
||||
return "下载失败!";
|
||||
}
|
||||
finally {
|
||||
if (bis != null) {
|
||||
try {
|
||||
bis.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (fis != null) {
|
||||
try {
|
||||
fis.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
//return "Download the song successfully!";
|
||||
}
|
||||
}else{
|
||||
return file.getPath()+"文件不存在!";
|
||||
}
|
||||
}
|
||||
/**
|
||||
* excel 导入
|
||||
* @param params
|
||||
* @throws Exception
|
||||
*/
|
||||
@PostMapping("/importExcel")
|
||||
public ResultData<JSONObject> importExcel(@RequestBody Object params ) throws Exception {
|
||||
JSONObject ret=iWhiteBatchImportSerive.insertData(params);
|
||||
return ResultData.success("",ret,1);
|
||||
}
|
||||
@PostMapping("/uploadFile")
|
||||
public ResultData<String> uploadFile(HttpServletRequest request, HttpServletResponse response,@RequestParam("file") MultipartFile file) throws UnsupportedEncodingException {
|
||||
response.setHeader("content-type", "application/octet-stream");
|
||||
response.setContentType("application/octet-stream");
|
||||
// 下载文件能正常显示中文
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(file.getName(), "UTF-8"));
|
||||
//当前项目的目录
|
||||
SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMdd");
|
||||
String fileDirName = sdf.format(new Date());
|
||||
String folderPath = com.nmgs.util.PathUtil.webappsPath + "\\CarNoFile\\"+fileDirName;
|
||||
//每天创建一个文件目录
|
||||
SimpleDateFormat sdfs=new SimpleDateFormat("hhmmss");
|
||||
String afterSuffix = sdfs.format(new Date());
|
||||
String originalFilename = file.getOriginalFilename();
|
||||
String[] split = originalFilename.split("\\.");
|
||||
File fileTemp=new File(folderPath);
|
||||
if (!fileTemp.exists())
|
||||
{
|
||||
fileTemp.mkdirs();
|
||||
}
|
||||
String fileName="";
|
||||
if (file != null){
|
||||
try
|
||||
{
|
||||
fileName = split[0]+afterSuffix+"."+split[1];
|
||||
File fileDocument=new File(folderPath,fileName);
|
||||
File fileExists=new File(folderPath+"//"+fileName);
|
||||
if(fileExists.exists()){
|
||||
fileExists.delete();
|
||||
}else{
|
||||
fileDocument.mkdir();
|
||||
file.transferTo(fileDocument);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return ResultData.fail("文件异常:"+ ex.getMessage());
|
||||
}
|
||||
}
|
||||
return ResultData.success(1,fileName);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,84 @@
|
||||
package com.nmgs.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nmgs.annotation.OperationLogDesc;
|
||||
import com.nmgs.config.ResultData;
|
||||
import com.nmgs.entity.WhiteAccountText;
|
||||
import com.nmgs.entity.WhiteCarnoDic;
|
||||
import com.nmgs.service.IWhiteAccountSerive;
|
||||
import com.nmgs.service.IWhiteCarnoDicService;
|
||||
import com.nmgs.util.PubTools;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.sql.SQLException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 单位信息管理
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/whiteCarnoDic")
|
||||
@Api(tags = "自定义白名单管理")
|
||||
public class WhiteCarnoDicController {
|
||||
|
||||
|
||||
public IWhiteCarnoDicService iWhiteCarnoDicService;
|
||||
@Autowired
|
||||
public void setiWhiteCarnoDicService(IWhiteCarnoDicService iWhiteCarnoDicService) {
|
||||
this.iWhiteCarnoDicService = iWhiteCarnoDicService;
|
||||
}
|
||||
|
||||
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd");
|
||||
@PostMapping(value="/getCarnoDicByPage")
|
||||
@ApiOperation(httpMethod="POST",value="查询自定义白名单管理数据")
|
||||
public Object getCarnoDicByPage(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> req) throws SQLException {
|
||||
Page<WhiteCarnoDic> whiteCarnoListList =null;
|
||||
try{
|
||||
whiteCarnoListList = iWhiteCarnoDicService.getWhiteCarnoDicByPage(req);
|
||||
if (PubTools.isEmpty(whiteCarnoListList)) {
|
||||
return ResultData.fail(-1,"数据查询失败");
|
||||
}
|
||||
}catch (Exception e){
|
||||
String throwableStr = e.getCause().toString();
|
||||
if(throwableStr.contains(":")){
|
||||
throwableStr = throwableStr.substring(throwableStr.indexOf(":") + 1);
|
||||
}
|
||||
return ResultData.fail(-1,"数据查询失败==>"+throwableStr);
|
||||
}
|
||||
return whiteCarnoListList;
|
||||
}
|
||||
|
||||
@PostMapping(value = "/addCarnoDicData")
|
||||
@OperationLogDesc(module = "自定义白名单管理>新增", events = "新增记录")
|
||||
@ApiOperation(httpMethod="POST",value="新增记录")
|
||||
public ResultData<String> addCarnoDicData(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> req) throws Exception {
|
||||
int ret = iWhiteCarnoDicService.insertData(req);
|
||||
if(ret>-1){
|
||||
return ResultData.success("新增成功","",0);
|
||||
}else{
|
||||
if(ret==-2){
|
||||
return ResultData.fail("此数据已存在!");
|
||||
}
|
||||
}
|
||||
return ResultData.fail("新增失败");
|
||||
}
|
||||
@PostMapping(value = "/batchDelCarnoDicDatas")
|
||||
@OperationLogDesc(module = "自定义白名单管理>批量删除", events = "删除记录")
|
||||
@ApiOperation(httpMethod="POST",value="删除记录")
|
||||
public ResultData<String> batchDelCarnoDicDatas(HttpServletRequest request, @RequestBody Object req) throws Exception {
|
||||
int ret = iWhiteCarnoDicService.batchDelDatas(req);
|
||||
if(ret>-1){
|
||||
return ResultData.success("删除成功","",0);
|
||||
}
|
||||
return ResultData.fail("删除失败");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,136 @@
|
||||
package com.nmgs.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nmgs.annotation.OperationLogDesc;
|
||||
import com.nmgs.config.ResultData;
|
||||
import com.nmgs.entity.WhiteCarnoList;
|
||||
import com.nmgs.service.IWhiteCarnoListSerive;
|
||||
import com.nmgs.util.PubTools;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.sql.SQLException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 白名单管理
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/whiteCarnoList")
|
||||
@Api(tags = "白名单管理")
|
||||
public class WhiteCarnoListController {
|
||||
|
||||
@Autowired
|
||||
public IWhiteCarnoListSerive divOutPortDroadSerive;
|
||||
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd");
|
||||
@PostMapping(value="/getListByPage")
|
||||
@ApiOperation(httpMethod="POST",value="查询分页白名单数据")
|
||||
public Object getListByPage(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> req) throws SQLException {
|
||||
Page<WhiteCarnoList> whiteCarnoListList =null;
|
||||
try{
|
||||
whiteCarnoListList = divOutPortDroadSerive.getWhiteCarnoListByPage(req);
|
||||
if (PubTools.isEmpty(whiteCarnoListList)) {
|
||||
return ResultData.fail(-1,"数据查询失败");
|
||||
}
|
||||
}catch (Exception e){
|
||||
String throwableStr = e.getCause().toString();
|
||||
if(throwableStr.contains(":")){
|
||||
throwableStr = throwableStr.substring(throwableStr.indexOf(":") + 1);
|
||||
}
|
||||
return ResultData.fail(-1,"数据查询失败==>"+throwableStr);
|
||||
}
|
||||
return whiteCarnoListList;
|
||||
}
|
||||
|
||||
@PostMapping(value = "/addData")
|
||||
@OperationLogDesc(module = "白名单管理>新增", events = "新增记录")
|
||||
@ApiOperation(httpMethod="POST",value="新增记录")
|
||||
public ResultData<String> addData(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> req) throws Exception {
|
||||
int ret = divOutPortDroadSerive.insertData((WhiteCarnoList)PubTools.map2Object(req,WhiteCarnoList.class));
|
||||
if(ret>-1){
|
||||
return ResultData.success("新增成功");
|
||||
}else{
|
||||
if(ret==-2){
|
||||
return ResultData.fail("白名单存在该信息!");
|
||||
}
|
||||
}
|
||||
return ResultData.fail("新增失败");
|
||||
}
|
||||
@PostMapping(value = "/batchDelDatas")
|
||||
@OperationLogDesc(module = "白名单管理>批量删除", events = "删除记录")
|
||||
@ApiOperation(httpMethod="POST",value="删除记录")
|
||||
public ResultData<String> batchDelDatas(HttpServletRequest request, @RequestBody Object req) throws Exception {
|
||||
int ret = divOutPortDroadSerive.batchDelDatas(req);
|
||||
if(ret>-1){
|
||||
return ResultData.success("删除成功");
|
||||
}
|
||||
return ResultData.fail("删除失败");
|
||||
}
|
||||
@PostMapping(value = "/updateById")
|
||||
@OperationLogDesc(module = "白名单管理>修改", events = "修改记录")
|
||||
@ApiOperation(httpMethod="POST",value="修改记录")
|
||||
public ResultData<String> updateById(HttpServletRequest request, @RequestBody(required = false) WhiteCarnoList req) throws Exception {
|
||||
try{
|
||||
int ret = divOutPortDroadSerive.updateById(req);
|
||||
if(ret>-1){
|
||||
return ResultData.success("保存成功");
|
||||
}
|
||||
}catch (Exception e){
|
||||
return ResultData.fail("保存失败:"+e.getMessage());
|
||||
}
|
||||
|
||||
return ResultData.fail("保存失败");
|
||||
}
|
||||
@PostMapping(value = "/batchUpdateById")
|
||||
@OperationLogDesc(module = "白名单管理>批量修改", events = "批量修改记录")
|
||||
@ApiOperation(httpMethod="POST",value="批量修改记录")
|
||||
public ResultData<String> batchUpdateById(HttpServletRequest request, @RequestBody(required = false) Map<String,Object> req) throws Exception {
|
||||
try{
|
||||
int ret = divOutPortDroadSerive.batchUpdateById(req);
|
||||
if(ret>-1){
|
||||
return ResultData.success("保存成功");
|
||||
}
|
||||
}catch (Exception e){
|
||||
return ResultData.fail("保存失败:"+e.getMessage());
|
||||
}
|
||||
|
||||
return ResultData.fail("保存失败");
|
||||
}
|
||||
@PostMapping(value = "/getVersion")
|
||||
@ApiOperation(httpMethod="POST",value="生成最新版本号")
|
||||
public ResultData<Map> getVersion(HttpServletRequest request, @RequestBody(required = false) Map<String,Object> req) throws Exception {
|
||||
try{
|
||||
Map ret = divOutPortDroadSerive.getVersion(req);
|
||||
if(!PubTools.isEmpty(ret)){
|
||||
return ResultData.success("生成最新版本号成功",ret,1);
|
||||
}
|
||||
}catch (Exception e){
|
||||
return ResultData.fail("生成最新版本号失败:"+e.getMessage());
|
||||
}
|
||||
|
||||
return ResultData.fail("生成最新版本号失败");
|
||||
}
|
||||
@PostMapping(value = "/publishVersion")
|
||||
@OperationLogDesc(module = "白名单管理>发布新版本", events = "发布新版本")
|
||||
@ApiOperation(httpMethod="POST",value="发布新版本")
|
||||
public ResultData<String> publishVersion(HttpServletRequest request, @RequestBody(required = false) Map<String,Object> req) throws Exception {
|
||||
try{
|
||||
int ret = divOutPortDroadSerive.publishVersion(req);
|
||||
if(ret>-1){
|
||||
return ResultData.success("发布成功","发布成功",1);
|
||||
}
|
||||
}catch (Exception e){
|
||||
return ResultData.fail("发布失败:"+e.getMessage());
|
||||
}
|
||||
|
||||
return ResultData.fail("发布失败");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.nmgs.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nmgs.annotation.OperationLogDesc;
|
||||
import com.nmgs.config.ResultData;
|
||||
import com.nmgs.entity.WhiteCarnoList;
|
||||
import com.nmgs.entity.WhiteCarnoLogTable;
|
||||
import com.nmgs.service.IWhiteCarnoListSerive;
|
||||
import com.nmgs.service.IWhiteCarnoLogService;
|
||||
import com.nmgs.util.PubTools;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.sql.SQLException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 白名单管理
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/whiteCarnoLog")
|
||||
@Api(tags = "白名单日志管理")
|
||||
public class WhiteCarnoLogController {
|
||||
|
||||
@Autowired
|
||||
public IWhiteCarnoLogService iWhiteCarnoLogSerive;
|
||||
/* @Autowired
|
||||
public void setiWhiteCarnoLogSerive(IWhiteCarnoLogService iWhiteCarnoLogSerive) {
|
||||
this.iWhiteCarnoLogSerive = iWhiteCarnoLogSerive;
|
||||
}*/
|
||||
|
||||
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd");
|
||||
@PostMapping(value="/getListByPage")
|
||||
@ApiOperation(httpMethod="POST",value="查询分页白名单日志数据")
|
||||
public Object getListByPage(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> req) throws SQLException {
|
||||
Page<WhiteCarnoLogTable> whiteCarnoListList =null;
|
||||
try{
|
||||
whiteCarnoListList=iWhiteCarnoLogSerive.getWhiteCarnoLogByPage(req);
|
||||
if (PubTools.isEmpty(whiteCarnoListList)) {
|
||||
return ResultData.fail(-1,"数据查询失败");
|
||||
}
|
||||
}catch (Exception e){
|
||||
String throwableStr=e.toString();
|
||||
if(throwableStr.contains(":")){
|
||||
throwableStr = throwableStr.substring(throwableStr.indexOf(":") + 1);
|
||||
}
|
||||
return ResultData.fail(-1,"数据查询失败==>"+throwableStr);
|
||||
}
|
||||
return whiteCarnoListList;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package com.nmgs.entity;
|
||||
|
||||
/**
|
||||
* 存放系统中用到的常量
|
||||
*/
|
||||
public class Consistent {
|
||||
//属于交通集团的路段NO
|
||||
public static int[] ROAD_JTJT = {10, 15, 11, 20, 24, 25, 26, 27, 28, 37, 38, 39, 42, 43, 46, 48, 49, 50, 53, 54, 60, 61, 62, 63, 64, 65, 66, 67, 81, 84, 85, 86, 87, 88, 89, 90};
|
||||
//白名单数据操作类型
|
||||
public static int ADD=1;
|
||||
public static String ADD_NAME="新增产生";
|
||||
public static int UPDATE=3;
|
||||
public static String UPDATE_NAME="修改产生";
|
||||
public static int UPDATE_BATCH=5;
|
||||
public static String UPDATE_BATCH_NAME="批量更新产生";
|
||||
public static int DELETE=2;
|
||||
public static String DELETE_NAME="删除产生";
|
||||
public static int UPDATE_VERSION=4;
|
||||
public static String UPDATE_VERSION_NAME="版本更新产生";
|
||||
public static int IMPORT_BATCH=6;
|
||||
public static String IMPORT_BATCH_NAME="批量导入产生";
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package com.nmgs.entity;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class MyReturnMap {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public static Map<String, Object> returnMap = new HashMap();
|
||||
|
||||
public MyReturnMap() {
|
||||
}
|
||||
|
||||
public static void setMap(Map<String, Object> newMap) {
|
||||
returnMap.putAll(newMap);
|
||||
}
|
||||
|
||||
static {
|
||||
returnMap.put("InfoType", "1");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package com.nmgs.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("WHITE_ACCOUNT_TEXT")
|
||||
public class WhiteAccountText {
|
||||
@TableField("ACOUNTID")
|
||||
private int acountid;
|
||||
@TableField("ACOUNTNAME")
|
||||
private String acountname;
|
||||
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package com.nmgs.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("WHITE_CARNO_DIC_TABLE")
|
||||
public class WhiteCarnoDic {
|
||||
@TableField("MEMO")
|
||||
private String memo;
|
||||
@TableField("DISCRP")
|
||||
private String discrp;
|
||||
@TableField("DICNAME")
|
||||
private String dicname;
|
||||
@TableField("UNUSER1")
|
||||
private String unuser1;
|
||||
@TableField("UNUSER2")
|
||||
private int unuser2;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,87 @@
|
||||
package com.nmgs.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("WHITE_CARNO_TABLE")
|
||||
public class WhiteCarnoList {
|
||||
@TableId(type = IdType.AUTO)
|
||||
private String id;
|
||||
@TableField("ACARNO")
|
||||
private String acarno;
|
||||
@TableField("COLOR")
|
||||
private int color;
|
||||
@TableField("DT")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||
private Date dt;
|
||||
@TableField("BEGDT")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||
private Date begdt;
|
||||
@TableField("ENDDT")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||
private Date enddt;
|
||||
@TableField("VEHICLE_TYPE")
|
||||
private int vehicleType;
|
||||
@TableField("DATAFLAG")
|
||||
private String dataflag;
|
||||
@TableField("DESCRIB")
|
||||
private String describ;
|
||||
@TableField("BEGDATE")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||
private Date begdate;
|
||||
@TableField("ACCOUNT")
|
||||
private int account;
|
||||
@TableField("VERNO")
|
||||
private String verno;
|
||||
@TableField("BAK1")
|
||||
private String bak1;
|
||||
@TableField("BAK2")
|
||||
private String bak2;
|
||||
@TableField("BAK3")
|
||||
private String bak3;
|
||||
@TableField("MEMO")
|
||||
private String memo;
|
||||
@TableField("VEHICLE_CLASS")
|
||||
private int vehicleClass;
|
||||
@TableField("DISCRP")
|
||||
private String discrp;
|
||||
@TableField(exist = false)
|
||||
private String colorName;
|
||||
@TableField(exist = false)
|
||||
private String flagName;
|
||||
@TableField(exist = false)
|
||||
private String accountName;
|
||||
@TableField(exist = false)
|
||||
private String vehicleClassName;
|
||||
@TableField(exist = false)
|
||||
private String vehicleTypeName;
|
||||
@TableField(exist = false)
|
||||
private String promperty;
|
||||
@TableField(exist = false)
|
||||
private String opermano;
|
||||
@TableField(exist = false)
|
||||
private String opermaname;
|
||||
@TableField(exist = false)
|
||||
private String qm;
|
||||
@TableField(exist = false)
|
||||
private String mfld;
|
||||
@TableField(exist = false)
|
||||
private String mfzzh;
|
||||
@TableField(exist = false)
|
||||
private String zdyzh;
|
||||
|
||||
public WhiteCarnoList(String verno) {
|
||||
this.verno = verno;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,182 @@
|
||||
package com.nmgs.entity;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.alibaba.excel.annotation.write.style.ContentFontStyle;
|
||||
import com.alibaba.excel.annotation.write.style.ContentStyle;
|
||||
import com.alibaba.excel.enums.poi.BorderStyleEnum;
|
||||
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
|
||||
import com.alibaba.excel.enums.poi.VerticalAlignmentEnum;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class WhiteCarnoListDto {
|
||||
@ExcelProperty("ID")
|
||||
@ColumnWidth(10)
|
||||
@ContentStyle(verticalAlignment= VerticalAlignmentEnum.CENTER,horizontalAlignment = HorizontalAlignmentEnum.CENTER,
|
||||
borderBottom = BorderStyleEnum.THIN,
|
||||
borderLeft = BorderStyleEnum.THIN,
|
||||
borderRight = BorderStyleEnum.THIN)
|
||||
@ExcelIgnore
|
||||
private int id;
|
||||
@ExcelProperty("启用时间")
|
||||
@ColumnWidth(30)
|
||||
@ContentStyle(verticalAlignment=VerticalAlignmentEnum.CENTER,horizontalAlignment = HorizontalAlignmentEnum.CENTER,
|
||||
borderBottom = BorderStyleEnum.THIN,
|
||||
borderLeft = BorderStyleEnum.THIN,
|
||||
borderRight = BorderStyleEnum.THIN)
|
||||
private Date begdate;
|
||||
@ExcelProperty("车牌")
|
||||
@ColumnWidth(10)
|
||||
@ContentStyle(verticalAlignment=VerticalAlignmentEnum.CENTER,horizontalAlignment = HorizontalAlignmentEnum.CENTER,
|
||||
borderBottom = BorderStyleEnum.THIN,
|
||||
borderLeft = BorderStyleEnum.THIN,
|
||||
borderRight = BorderStyleEnum.THIN)
|
||||
private String acarno;
|
||||
@ExcelProperty("车牌颜色")
|
||||
//@ExcelIgnore
|
||||
@ColumnWidth(10)
|
||||
@ContentStyle(verticalAlignment=VerticalAlignmentEnum.CENTER,horizontalAlignment = HorizontalAlignmentEnum.CENTER,
|
||||
borderBottom = BorderStyleEnum.THIN,
|
||||
borderLeft = BorderStyleEnum.THIN,
|
||||
borderRight = BorderStyleEnum.THIN)
|
||||
private String colorName;
|
||||
@ExcelProperty("起始时间")
|
||||
@ColumnWidth(30)
|
||||
@ContentStyle(verticalAlignment=VerticalAlignmentEnum.CENTER,horizontalAlignment = HorizontalAlignmentEnum.CENTER,
|
||||
borderBottom = BorderStyleEnum.THIN,
|
||||
borderLeft = BorderStyleEnum.THIN,
|
||||
borderRight = BorderStyleEnum.THIN)
|
||||
private Date begdt;
|
||||
@ExcelProperty("终止时间")
|
||||
@ColumnWidth(30)
|
||||
@ContentStyle(verticalAlignment=VerticalAlignmentEnum.CENTER,horizontalAlignment = HorizontalAlignmentEnum.CENTER,
|
||||
borderBottom = BorderStyleEnum.THIN,
|
||||
borderLeft = BorderStyleEnum.THIN,
|
||||
borderRight = BorderStyleEnum.THIN)
|
||||
private Date enddt;
|
||||
@ExcelProperty("类型")
|
||||
@ColumnWidth(10)
|
||||
@ContentStyle(verticalAlignment=VerticalAlignmentEnum.CENTER,horizontalAlignment = HorizontalAlignmentEnum.CENTER,
|
||||
borderBottom = BorderStyleEnum.THIN,
|
||||
borderLeft = BorderStyleEnum.THIN,
|
||||
borderRight = BorderStyleEnum.THIN)
|
||||
private String vehicleClassName;
|
||||
@ExcelProperty("状态")
|
||||
@ColumnWidth(10)
|
||||
@ContentStyle(verticalAlignment=VerticalAlignmentEnum.CENTER,horizontalAlignment = HorizontalAlignmentEnum.CENTER,
|
||||
borderBottom = BorderStyleEnum.THIN,
|
||||
borderLeft = BorderStyleEnum.THIN,
|
||||
borderRight = BorderStyleEnum.THIN)
|
||||
private String flagName;
|
||||
@ExcelProperty("车型")
|
||||
@ExcelIgnore
|
||||
@ColumnWidth(10)
|
||||
@ContentStyle(verticalAlignment=VerticalAlignmentEnum.CENTER,horizontalAlignment = HorizontalAlignmentEnum.CENTER,
|
||||
borderBottom = BorderStyleEnum.THIN,
|
||||
borderLeft = BorderStyleEnum.THIN,
|
||||
borderRight = BorderStyleEnum.THIN)
|
||||
private int vehicleName;
|
||||
@ExcelProperty("状态码")
|
||||
@ExcelIgnore
|
||||
@ColumnWidth(10)
|
||||
@ContentStyle(verticalAlignment=VerticalAlignmentEnum.CENTER,horizontalAlignment = HorizontalAlignmentEnum.CENTER,
|
||||
borderBottom = BorderStyleEnum.THIN,
|
||||
borderLeft = BorderStyleEnum.THIN,
|
||||
borderRight = BorderStyleEnum.THIN)
|
||||
private String dataflag;
|
||||
@ExcelProperty("车辆描述")
|
||||
@ColumnWidth(10)
|
||||
@ContentStyle(verticalAlignment=VerticalAlignmentEnum.CENTER,horizontalAlignment = HorizontalAlignmentEnum.CENTER,
|
||||
borderBottom = BorderStyleEnum.THIN,
|
||||
borderLeft = BorderStyleEnum.THIN,
|
||||
borderRight = BorderStyleEnum.THIN)
|
||||
private String describ;
|
||||
@ExcelProperty("录入时间")
|
||||
@ColumnWidth(30)
|
||||
@ContentStyle(verticalAlignment=VerticalAlignmentEnum.CENTER,horizontalAlignment = HorizontalAlignmentEnum.CENTER,
|
||||
borderBottom = BorderStyleEnum.THIN,
|
||||
borderLeft = BorderStyleEnum.THIN,
|
||||
borderRight = BorderStyleEnum.THIN)
|
||||
private Date dt;
|
||||
@ExcelProperty("所属分公司编号")
|
||||
@ExcelIgnore
|
||||
@ColumnWidth(10)
|
||||
@ContentStyle(verticalAlignment=VerticalAlignmentEnum.CENTER,horizontalAlignment = HorizontalAlignmentEnum.CENTER,
|
||||
borderBottom = BorderStyleEnum.THIN,
|
||||
borderLeft = BorderStyleEnum.THIN,
|
||||
borderRight = BorderStyleEnum.THIN)
|
||||
private int account;
|
||||
@ExcelProperty("所属公司")
|
||||
@ColumnWidth(10)
|
||||
@ContentStyle(verticalAlignment=VerticalAlignmentEnum.CENTER,horizontalAlignment = HorizontalAlignmentEnum.CENTER,
|
||||
borderBottom = BorderStyleEnum.THIN,
|
||||
borderLeft = BorderStyleEnum.THIN,
|
||||
borderRight = BorderStyleEnum.THIN)
|
||||
private String accountName;
|
||||
@ExcelProperty("版本")
|
||||
@ColumnWidth(10)
|
||||
@ContentStyle(verticalAlignment=VerticalAlignmentEnum.CENTER,horizontalAlignment = HorizontalAlignmentEnum.CENTER,
|
||||
borderBottom = BorderStyleEnum.THIN,
|
||||
borderLeft = BorderStyleEnum.THIN,
|
||||
borderRight = BorderStyleEnum.THIN)
|
||||
private String verno;
|
||||
@ExcelProperty("备注1")
|
||||
@ExcelIgnore
|
||||
@ColumnWidth(10)
|
||||
@ContentStyle(verticalAlignment=VerticalAlignmentEnum.CENTER,horizontalAlignment = HorizontalAlignmentEnum.CENTER,
|
||||
borderBottom = BorderStyleEnum.THIN,
|
||||
borderLeft = BorderStyleEnum.THIN,
|
||||
borderRight = BorderStyleEnum.THIN)
|
||||
private String bak1;
|
||||
@ExcelProperty("备注2")
|
||||
@ExcelIgnore
|
||||
@ColumnWidth(10)
|
||||
@ContentStyle(verticalAlignment=VerticalAlignmentEnum.CENTER,horizontalAlignment = HorizontalAlignmentEnum.CENTER,
|
||||
borderBottom = BorderStyleEnum.THIN,
|
||||
borderLeft = BorderStyleEnum.THIN,
|
||||
borderRight = BorderStyleEnum.THIN)
|
||||
private String bak2;
|
||||
@ExcelProperty("备注3")
|
||||
@ExcelIgnore
|
||||
@ColumnWidth(10)
|
||||
@ContentStyle(verticalAlignment=VerticalAlignmentEnum.CENTER,horizontalAlignment = HorizontalAlignmentEnum.CENTER,
|
||||
borderBottom = BorderStyleEnum.THIN,
|
||||
borderLeft = BorderStyleEnum.THIN,
|
||||
borderRight = BorderStyleEnum.THIN)
|
||||
private String bak3;
|
||||
@ExcelProperty("减免路段/收费站")
|
||||
@ColumnWidth(10)
|
||||
@ContentStyle(verticalAlignment=VerticalAlignmentEnum.CENTER,horizontalAlignment = HorizontalAlignmentEnum.CENTER,
|
||||
borderBottom = BorderStyleEnum.THIN,
|
||||
borderLeft = BorderStyleEnum.THIN,
|
||||
borderRight = BorderStyleEnum.THIN)
|
||||
private String discrp;
|
||||
@ExcelProperty("车种code")
|
||||
@ExcelIgnore
|
||||
@ColumnWidth(10)
|
||||
@ContentStyle(verticalAlignment=VerticalAlignmentEnum.CENTER,horizontalAlignment = HorizontalAlignmentEnum.CENTER,
|
||||
borderBottom = BorderStyleEnum.THIN,
|
||||
borderLeft = BorderStyleEnum.THIN,
|
||||
borderRight = BorderStyleEnum.THIN)
|
||||
private int vehicleClass;
|
||||
@ExcelProperty("重点提示")
|
||||
@ColumnWidth(10)
|
||||
@ContentStyle(verticalAlignment=VerticalAlignmentEnum.CENTER,horizontalAlignment = HorizontalAlignmentEnum.CENTER,
|
||||
borderBottom = BorderStyleEnum.THIN,
|
||||
borderLeft = BorderStyleEnum.THIN,
|
||||
borderRight = BorderStyleEnum.THIN)
|
||||
@ContentFontStyle(color = 10)
|
||||
private String promperty;
|
||||
|
||||
}
|
||||
@ -0,0 +1,83 @@
|
||||
package com.nmgs.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("WHITE_CARNO_LOG_TABLE")
|
||||
public class WhiteCarnoLogTable {
|
||||
@TableId(type = IdType.INPUT)
|
||||
private String id;
|
||||
@TableField("ACARNO")
|
||||
private String acarno;
|
||||
@TableField("COLOR")
|
||||
private int color;
|
||||
@TableField("DT")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||
private Date dt;
|
||||
@TableField("BEGDT")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||
private Date begdt;
|
||||
@TableField("ENDDT")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||
private Date enddt;
|
||||
@TableField("VEHICLE_TYPE")
|
||||
private int vehicleType;
|
||||
@TableField("DATAFLAG")
|
||||
private String dataflag;
|
||||
@TableField("DESCRIB")
|
||||
private String describ;
|
||||
@TableField("BEGDATE")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||
private Date begdate;
|
||||
@TableField("ACCOUNT")
|
||||
private int account;
|
||||
@TableField("VERNO")
|
||||
private String verno;
|
||||
@TableField("BAK1")
|
||||
private String bak1;
|
||||
@TableField("BAK2")
|
||||
private String bak2;
|
||||
@TableField("BAK3")
|
||||
private String bak3;
|
||||
@TableField("MEMO")
|
||||
private String memo;
|
||||
@TableField("VEHICLE_CLASS")
|
||||
private int vehicleClass;
|
||||
@TableField(exist = false)
|
||||
private String flagName;
|
||||
@TableField(exist = false)
|
||||
private String accountName;
|
||||
@TableField(exist = false)
|
||||
private String colorName;
|
||||
@TableField(exist = false)
|
||||
private String vehicleClassName;
|
||||
@TableField(exist = false)
|
||||
private String vehicleTypeName;
|
||||
@TableField("OPERTYPE")
|
||||
private Integer opertype;
|
||||
@TableField("OPERTYPENAME")
|
||||
private String opertypename;
|
||||
@TableField("OPERDATE")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||
private Date operdate;
|
||||
@TableField("OPERMANO")
|
||||
private String opermano;
|
||||
@TableField("OPERMANAME")
|
||||
private String opermaname;
|
||||
@TableField("COMNO")
|
||||
private String comno="test";
|
||||
@TableField("IDBUSINESS")
|
||||
private String idbusiness;
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package com.nmgs.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("white_account_text")
|
||||
public class WhiteComnoText {
|
||||
@TableField("VALUE")
|
||||
private String value;
|
||||
@TableField("TEXT")
|
||||
private String text;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package com.nmgs.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("white_vehicle_class")
|
||||
public class WhiteVehicleClass {
|
||||
@TableField("VALUE")
|
||||
private String value;
|
||||
@TableField("TEXT")
|
||||
private String text;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package com.nmgs.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("white_vehicle_type")
|
||||
public class WhiteVehicleType {
|
||||
@TableField("VALUE")
|
||||
private String value;
|
||||
@TableField("TEXT")
|
||||
private String text;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package com.nmgs.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nmgs.entity.MyReturnMap;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@org.apache.ibatis.annotations.Mapper
|
||||
public interface Mapper extends BaseMapper<MyReturnMap> {
|
||||
|
||||
|
||||
Map<String, Object> select(@Param("sql") String sql);
|
||||
List selectforlist(@Param("sql") String sql);
|
||||
int update(@Param("sql") String sql);
|
||||
IPage<Map<String,Object>> selectpage(@Param("sql") String sql, Page<Map<String, Object>> page);
|
||||
Map<String, Object> selectlow(@Param("sql") String sql);
|
||||
List selectforlistlow(@Param("sql") String sql);
|
||||
|
||||
int insert(@Param("sql") String sql);
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nmgs.mapper.Mapper">
|
||||
<select id="select" parameterType="String" resultType="java.util.HashMap">
|
||||
${sql}
|
||||
</select>
|
||||
<select id="selectforlist" parameterType="String" resultType="java.util.HashMap">
|
||||
${sql}
|
||||
</select>
|
||||
<update id="update" parameterType="String">
|
||||
${sql}
|
||||
</update>
|
||||
|
||||
<insert id="insert" parameterType="String">
|
||||
${sql}
|
||||
</insert>
|
||||
<select id="selectpage" parameterType="String" resultType="java.util.HashMap">
|
||||
${sql}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectlow" parameterType="String" resultType="java.util.HashMap">
|
||||
${sql}
|
||||
</select>
|
||||
<select id="selectforlistlow" parameterType="String" resultType="java.util.HashMap">
|
||||
${sql}
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,20 @@
|
||||
package com.nmgs.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nmgs.entity.WhiteAccountText;
|
||||
import com.nmgs.entity.WhiteAccountText;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface WhiteAccountMapper extends BaseMapper<WhiteAccountText> {
|
||||
Page<WhiteAccountText> getWhiteAccountByPage(Page<WhiteAccountText> page, @Param("params") Map<String, Object> params);
|
||||
int insertData(@Param("params") WhiteAccountText params);
|
||||
int delDataById(@Param("ids") List<Integer> ids);
|
||||
int updateById(@Param("params") WhiteAccountText params);
|
||||
List<WhiteAccountText> getWhiteAccountText(@Param("params") Map<String, Object> params);
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nmgs.mapper.WhiteAccountMapper">
|
||||
|
||||
<select id="getWhiteAccountByPage" parameterType="java.util.HashMap" resultType="com.nmgs.entity.WhiteAccountText">
|
||||
select
|
||||
t.ACOUNTID,t.ACOUNTNAME
|
||||
FROM WHITE_ACCOUNT_TEXT t
|
||||
<where>
|
||||
<if test="params.id != null and params.id != ''">
|
||||
AND t.acountid = #{params.id}
|
||||
</if>
|
||||
|
||||
<if test="params.name != null and params.name != ''">
|
||||
AND t.acountname like '%'|| #{params.name} || '%'
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<update id="updateById" parameterType="com.nmgs.entity.WhiteAccountText">
|
||||
update WHITE_ACCOUNT_TEXT
|
||||
<set>
|
||||
acountname=#{params.acountname},
|
||||
</set>
|
||||
where acountid=#{params.acountid}
|
||||
</update>
|
||||
<insert id="insertData" parameterType="com.nmgs.entity.WhiteAccountText">
|
||||
insert into WHITE_ACCOUNT_TEXT(VALUE,TEXT) values(#{params.acountid},#{params.text})
|
||||
</insert>
|
||||
<delete id="delDataById">
|
||||
DELETE FROM WHITE_ACCOUNT_TEXT WHERE acountid IN
|
||||
<foreach item="str" collection="ids" open="(" separator="," close=")">
|
||||
#{str}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="getWhiteAccountText" parameterType="java.util.HashMap" resultType="com.nmgs.entity.WhiteAccountText">
|
||||
select
|
||||
t.acountid,t.acountname
|
||||
FROM WHITE_ACCOUNT_TEXT t
|
||||
<where>
|
||||
<if test="params.id != null and params.id != ''">
|
||||
AND t.acountid = #{params.id}
|
||||
</if>
|
||||
|
||||
<if test="params.name != null and params.name != ''">
|
||||
AND t.acountname like '%'|| #{params.name} || '%'
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,20 @@
|
||||
package com.nmgs.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nmgs.entity.WhiteAccountText;
|
||||
import com.nmgs.entity.WhiteCarnoDic;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface WhiteCarnoDicMapper extends BaseMapper<WhiteCarnoDic> {
|
||||
Page<WhiteCarnoDic> getWhiteCarnoDicByPage(Page<WhiteCarnoDic> page, @Param("params") Map<String, Object> params);
|
||||
int insertData(@Param("params") WhiteCarnoDic params);
|
||||
int delDataById(@Param("ids") List<String> ids);
|
||||
int updateById(@Param("params") WhiteCarnoDic params);
|
||||
List<WhiteCarnoDic> getWhiteCarnoDicList(@Param("params") Map<String, Object> params);
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nmgs.mapper.WhiteCarnoDicMapper">
|
||||
|
||||
<select id="getWhiteCarnoDicByPage" parameterType="java.util.HashMap" resultType="com.nmgs.entity.WhiteCarnoDic">
|
||||
select
|
||||
t.memo,t.discrp,t.dicname,t.unuser1,t.unuser2
|
||||
FROM WHITE_CARNO_DIC_TABLE t
|
||||
<where>
|
||||
<if test="params.memo != null and params.memo != ''">
|
||||
AND t.memo = #{params.memo}
|
||||
</if>
|
||||
|
||||
<if test="params.dicname != null and params.dicname != ''">
|
||||
AND t.dicname like '%'|| #{params.dicname} || '%'
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<insert id="insertData" parameterType="com.nmgs.entity.WhiteCarnoDic">
|
||||
insert into WHITE_CARNO_DIC_TABLE(memo,discrp,dicname) values(#{params.memo},#{params.discrp},#{params.dicname})
|
||||
</insert>
|
||||
<delete id="delDataById">
|
||||
DELETE FROM WHITE_CARNO_DIC_TABLE WHERE memo IN
|
||||
<foreach item="str" collection="ids" open="(" separator="," close=")">
|
||||
#{str}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="getWhiteCarnoDicList" parameterType="java.util.HashMap" resultType="com.nmgs.entity.WhiteCarnoDic">
|
||||
select
|
||||
t.memo,t.discrp,t.dicname,t.unuser1,t.unuser2
|
||||
FROM WHITE_CARNO_DIC_TABLE t
|
||||
<where>
|
||||
<if test="params.memo != null and params.memo != ''">
|
||||
AND t.memo = #{params.memo}
|
||||
</if>
|
||||
<if test="params.dicname != null and params.dicname != ''">
|
||||
AND t.dicname like '%'|| #{params.dicname} || '%'
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,25 @@
|
||||
package com.nmgs.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nmgs.entity.WhiteCarnoList;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface WhiteCarnoListMapper extends BaseMapper<WhiteCarnoList> {
|
||||
Page<WhiteCarnoList> getWhiteCarnoListByPage(Page<WhiteCarnoList> page, @Param("params") Map<String, Object> params);
|
||||
int insertData(@Param("params") WhiteCarnoList params);
|
||||
int insertDataBatch(@Param("list") List<WhiteCarnoList> params);
|
||||
int delDataBatch(@Param("ids") List<String> ids);
|
||||
int updateById(@Param("params") WhiteCarnoList params);
|
||||
List<WhiteCarnoList> getWhiteCarnoList(@Param("params") Map<String, Object> params);
|
||||
|
||||
int batchUpdateById(@Param("ids") String[] str,@Param("params") Map<String, Object> params);
|
||||
|
||||
public List<WhiteCarnoList> getWhiteCarno(@Param("params") Map<String, Object> params);
|
||||
public int publishVersion(@Param("params") Map<String, Object> params);
|
||||
}
|
||||
@ -0,0 +1,522 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nmgs.mapper.WhiteCarnoListMapper">
|
||||
|
||||
<select id="getWhiteCarnoListByPage" parameterType="java.util.HashMap" resultType="com.nmgs.entity.WhiteCarnoList">
|
||||
select
|
||||
t.id,t.acarno,t.COLOR,t.DT,t.BEGDT,t.ENDDT,
|
||||
t.VEHICLE_TYPE,t.DATAFLAG,t.DESCRIB,t.BEGDATE,
|
||||
t.ACCOUNT,t.VERNO,t.bak1,t.bak2,t.bak3,t.memo,t.VEHICLE_CLASS,t.DISCRP,
|
||||
<if test="params.DBTYPE ==1">
|
||||
(case when t.ENDDT< dateadd(day,0,#{params.CURRENTDATE}) THEN '已过期'
|
||||
when t.ENDDT< dateadd(day,0,#{params.CURRENTWILLDATE}) THEN '将到期'
|
||||
else '正常' end) AS promperty,
|
||||
</if>
|
||||
<if test="params.DBTYPE ==2">
|
||||
(case
|
||||
when t.ENDDT< to_Date(#{params.CURRENTDATE},'YYYY-MM-DD HH24:mi:ss') THEN '已过期'
|
||||
when t.ENDDT< to_Date(#{params.CURRENTWILLDATE},'YYYY-MM-DD HH24:mi:ss') THEN '将到期'
|
||||
else '正常' end) AS promperty,
|
||||
</if>
|
||||
<if test="params.DBTYPE ==3">
|
||||
(case
|
||||
when t.ENDDT< to_Date(#{params.CURRENTDATE},'YYYY-MM-DD HH24:mi:ss') THEN '已过期'
|
||||
when t.ENDDT< to_Date(#{params.CURRENTWILLDATE},'YYYY-MM-DD HH24:mi:ss') THEN '将到期'
|
||||
else '正常' end) AS promperty,
|
||||
</if>
|
||||
<if test="params.DBTYPE ==4">
|
||||
(case
|
||||
when t.ENDDT< STR_TO_DATE(#{params.CURRENTDATE},'%Y-%m-%d %H:%k:%s') THEN '已过期'
|
||||
when t.ENDDT< STR_TO_DATE(#{params.CURRENTWILLDATE},'%Y-%m-%d %H:%k:%s') THEN '将到期'
|
||||
else '正常' end) AS promperty,
|
||||
</if>
|
||||
(case when t.DATAFLAG='1' then '在用' else '停用' end) as flagName,
|
||||
wct.acountname as accountName,wpc.text as colorName,wvc.text as vehicleClassName,'' as vehicleTypeName
|
||||
FROM WHITE_CARNO_TABLE t
|
||||
left join white_ACCOUNT_text wct on(t.ACCOUNT = wct.acountid)
|
||||
left join white_plate_color wpc on(t.COLOR = wpc.value)
|
||||
left join WHITE_VEHICLE_CLASS wvc on(t.VEHICLE_CLASS = wvc.value)
|
||||
<where>
|
||||
<if test="params.id != null and params.id != ''">
|
||||
AND t.id = #{params.id}
|
||||
</if>
|
||||
<if test="params.queryStartTime!= null and params.queryStartTime!= ''">
|
||||
<if test="params.DBTYPE == 1">
|
||||
AND t.BEGDT >= dateadd(day,0,#{params.queryStartTime})
|
||||
</if>
|
||||
<if test="params.DBTYPE == 2">
|
||||
AND t.BEGDT >= TO_DATE(#{params.queryStartTime}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 3">
|
||||
AND t.BEGDT >= TO_DATE(#{params.queryStartTime}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 4">
|
||||
AND t.BEGDT >= STR_TO_DATE(#{params.queryStartTime}, '%Y-%m-%d %H:%k:%s')
|
||||
</if>
|
||||
</if>
|
||||
<if test="params.queryEndTime!= null and params.queryEndTime!= ''">
|
||||
<if test="params.DBTYPE == 1">
|
||||
AND t.BEGDT <= dateadd(day,0,#{params.queryEndTime})
|
||||
</if>
|
||||
<if test="params.DBTYPE == 2">
|
||||
AND t.BEGDT <= TO_DATE(#{params.queryEndTime}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 3">
|
||||
AND t.BEGDT <= TO_DATE(#{params.queryEndTime}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 4">
|
||||
AND t.BEGDT <= STR_TO_DATE(#{params.queryEndTime}, '%Y-%m-%d %H:%k:%s')
|
||||
</if>
|
||||
</if>
|
||||
<if test="params.queryEndTimeS!= null and params.queryEndTimeS!= ''">
|
||||
<if test="params.DBTYPE == 1">
|
||||
AND t.ENDDT = dateadd(day,0,#{params.queryEndTimeS})
|
||||
</if>
|
||||
<if test="params.DBTYPE == 2">
|
||||
AND t.ENDDT >= TO_DATE(#{params.queryEndTimeS}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 3">
|
||||
AND t.ENDDT >= TO_DATE(#{params.queryEndTimeS}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 4">
|
||||
AND t.ENDDT >= STR_TO_DATE(#{params.queryEndTimeS}, '%Y-%m-%d %H:%k:%s')
|
||||
</if>
|
||||
</if>
|
||||
<if test="params.queryEndTimeE!= null and params.queryEndTimeE!= ''">
|
||||
<if test="params.DBTYPE == 1">
|
||||
AND t.ENDDT <= dateadd(day,0,#{params.queryEndTimeE})
|
||||
</if>
|
||||
<if test="params.DBTYPE == 2">
|
||||
AND t.ENDDT <= TO_DATE(#{params.queryEndTimeE}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 3">
|
||||
AND t.ENDDT <= TO_DATE(#{params.queryEndTimeE}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 4">
|
||||
AND t.ENDDT <= STR_TO_DATE(#{params.queryEndTimeE}, '%Y-%m-%d %H:%k:%s')
|
||||
</if>
|
||||
</if>
|
||||
|
||||
<if test="params.queryOperStartTime!= null and params.queryOperStartTime!= ''">
|
||||
<if test="params.DBTYPE == 1">
|
||||
AND t.BEGDATE >= dateadd(day,0,#{params.queryOperStartTime})
|
||||
</if>
|
||||
<if test="params.DBTYPE == 2">
|
||||
AND t.BEGDATE >= TO_DATE(#{params.queryOperStartTime}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 3">
|
||||
AND t.BEGDATE >= TO_DATE(#{params.queryOperStartTime}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 4">
|
||||
AND t.BEGDATE >= STR_TO_DATE(#{params.queryOperStartTime}, '%Y-%m-%d %H:%k:%s')
|
||||
</if>
|
||||
</if>
|
||||
<if test="params.queryOperEndTime!= null and params.queryOperEndTime!= ''">
|
||||
<if test="params.DBTYPE == 1">
|
||||
AND t.BEGDATE <= dateadd(day,0,#{params.queryOperEndTime})
|
||||
</if>
|
||||
<if test="params.DBTYPE == 2">
|
||||
AND t.BEGDATE <= TO_DATE(#{params.queryOperEndTime}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 3">
|
||||
AND t.BEGDATE <= TO_DATE(#{params.queryOperEndTime}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 4">
|
||||
AND t.BEGDATE <= STR_TO_DATE(#{params.queryOperEndTime}, '%Y-%m-%d %H:%k:%s')
|
||||
</if>
|
||||
</if>
|
||||
<if test="params.queryCreateTimeS!= null and params.queryCreateTimeS!= ''">
|
||||
<if test="params.DBTYPE == 1">
|
||||
AND t.DT >= dateadd(day,0,#{params.queryCreateTimeS})
|
||||
</if>
|
||||
<if test="params.DBTYPE == 2">
|
||||
AND t.DT >= TO_DATE(#{params.queryCreateTimeS}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 3">
|
||||
AND t.DT >= TO_DATE(#{params.queryCreateTimeS}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 4">
|
||||
AND t.DT >= STR_TO_DATE(#{params.queryCreateTimeS}, '%Y-%m-%d %H:%k:%s')
|
||||
</if>
|
||||
</if>
|
||||
<if test="params.queryCreateTimeE!= null and params.queryCreateTimeE!= ''">
|
||||
<if test="params.DBTYPE == 1">
|
||||
AND t.DT <= dateadd(day,0,#{params.queryCreateTimeE})
|
||||
</if>
|
||||
<if test="params.DBTYPE == 2">
|
||||
AND t.DT <= TO_DATE(#{params.queryCreateTimeE}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 3">
|
||||
AND t.DT <= TO_DATE(#{params.queryCreateTimeE}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 4">
|
||||
AND t.DT <= STR_TO_DATE(#{params.queryCreateTimeE}, '%Y-%m-%d %H:%k:%s')
|
||||
</if>
|
||||
</if>
|
||||
<if test="params.WILLDATE!= null and params.WILLDATE!= ''">
|
||||
<if test="params.DBTYPE == 1">
|
||||
AND t.ENDDT < dateadd(day,0,#{params.WILLDATE})
|
||||
</if>
|
||||
<if test="params.DBTYPE == 2">
|
||||
AND t.ENDDT < TO_DATE(#{params.WILLDATE}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 3">
|
||||
AND t.ENDDT < TO_DATE(#{params.WILLDATE}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 4">
|
||||
AND t.ENDDT < STR_TO_DATE(#{params.WILLDATE}, '%Y-%m-%d %H:%k:%s')
|
||||
</if>
|
||||
</if>
|
||||
<if test="params.SVEHICLEID != null and params.SVEHICLEID != ''">
|
||||
AND t.acarno like '%'|| #{params.SVEHICLEID} || '%'
|
||||
</if>
|
||||
<if test="params.SCOMNO != null and params.SCOMNO != ''">
|
||||
AND t.ACCOUNT = #{params.SCOMNO}
|
||||
</if>
|
||||
<if test="params.SSTATUS != null and params.SSTATUS != ''">
|
||||
AND t.DATAFLAG = #{params.SSTATUS}
|
||||
</if>
|
||||
<if test="params.SVECHECLASS != null and params.SVECHECLASS != ''">
|
||||
AND t.VEHICLECLASS = #{params.SVECHECLASS}
|
||||
</if>
|
||||
<if test="params.SVECHETYPE != null and params.SVECHETYPE != ''">
|
||||
AND t.VEHICLETYPE = #{params.SVECHETYPE}
|
||||
</if>
|
||||
<if test="params.SDESCRIBE != null and params.SDESCRIBE != ''">
|
||||
AND t.DESCRIB = #{params.SDESCRIBE}
|
||||
</if>
|
||||
<if test="params.SPROMPOTY != null and params.SPROMPOTY != ''">
|
||||
<!-- 7天之内 将要过期 -->
|
||||
<if test="params.SPROMPOTY =='WILL'">
|
||||
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<update id="updateById" parameterType="com.nmgs.entity.WhiteCarnoList">
|
||||
update WHITE_CARNO_TABLE
|
||||
<set>
|
||||
ACARNO=#{params.acarno},
|
||||
COLOR=#{params.color},
|
||||
BEGDT= #{params.begdt},
|
||||
ENDDT= #{params.enddt},
|
||||
VEHICLE_TYPE=#{params.vehicleType} ,
|
||||
DATAFLAG= #{params.dataflag},
|
||||
DESCRIB= #{params.describ},
|
||||
BEGDATE= #{params.begdate},
|
||||
ACCOUNT= #{params.account},
|
||||
<if test="params.verno !='' and params.verno != null">
|
||||
VERNO= #{params.verno},
|
||||
</if>
|
||||
<if test="params.bak1 !='' and params.bak1 != null">
|
||||
BAK1= #{params.bak1},
|
||||
</if>
|
||||
<if test="params.bak2 !='' and params.bak2 != null">
|
||||
BAK2= #{params.bak12},
|
||||
</if>
|
||||
<if test="params.bak3 !='' and params.bak3 != null">
|
||||
BAK3= #{params.bak3},
|
||||
</if>
|
||||
<if test="params.discrp !='' and params.discrp != null">
|
||||
DISCRP= #{params.discrp},
|
||||
</if>
|
||||
<if test="params.vehicleClass !='' and params.vehicleClass != null">
|
||||
VEHICLE_CLASS=#{params.vehicleClass},
|
||||
</if>
|
||||
MEMO= #{params.memo}
|
||||
|
||||
</set>
|
||||
where ID=#{params.id}
|
||||
</update>
|
||||
<update id="batchUpdateById" parameterType="java.util.HashMap">
|
||||
update WHITE_CARNO_TABLE
|
||||
<set>
|
||||
<if test="params.DBType == 1">
|
||||
BEGDT = dateadd(day,0,#{params.begdt}),
|
||||
ENDDT= dateadd(day,0,#{params.enddt}),
|
||||
</if>
|
||||
<if test="params.DBType == 2">
|
||||
BEGDT= TO_DATE(#{params.begdt}, 'YYYY-MM-DD HH24:mi:ss'),
|
||||
ENDDT= TO_DATE(#{params.enddt}, 'YYYY-MM-DD HH24:mi:ss'),
|
||||
</if>
|
||||
<if test="params.DBType == 3">
|
||||
BEGDT = TO_DATE(#{params.begdt}, 'YYYY-MM-DD HH24:mi:ss'),
|
||||
ENDDT= TO_DATE(#{params.enddt}, 'YYYY-MM-DD HH24:mi:ss'),
|
||||
</if>
|
||||
<if test="params.DBType == 4">
|
||||
BEGDT= STR_TO_DATE(#{params.begdt}, '%Y-%m-%d %H:%k:%s'),
|
||||
ENDDT= STR_TO_DATE(#{params.enddt}, '%Y-%m-%d %H:%k:%s'),
|
||||
</if>
|
||||
DATAFLAG= #{params.dataflag},
|
||||
ACCOUNT= #{params.account}
|
||||
</set>
|
||||
where ID IN
|
||||
<foreach item="str" collection="ids" open="(" separator="," close=")">
|
||||
#{str}
|
||||
</foreach>
|
||||
</update>
|
||||
<update id="publishVersion" parameterType="java.util.HashMap">
|
||||
update WHITE_CARNO_TABLE
|
||||
<set>
|
||||
<if test="params.DBType == 1">
|
||||
BEGDATE = dateadd(day,0,#{params.begdate})
|
||||
</if>
|
||||
<if test="params.DBType == 2">
|
||||
BEGDATE= TO_DATE(#{params.begdate}, 'YYYY-MM-DD HH24:mi:ss'),
|
||||
</if>
|
||||
<if test="params.DBType == 3">
|
||||
BEGDATE = TO_DATE(#{params.begdate}, 'YYYY-MM-DD HH24:mi:ss'),
|
||||
</if>
|
||||
<if test="params.DBType == 4">
|
||||
BEGDATE= STR_TO_DATE(#{params.begdate}, '%Y-%m-%d %H:%k:%s'),
|
||||
</if>
|
||||
VERNO= #{params.verno}
|
||||
</set>
|
||||
</update>
|
||||
|
||||
<insert id="insertData" parameterType="com.nmgs.entity.WhiteCarnoList">
|
||||
insert into WHITE_CARNO_TABLE(ID,
|
||||
acarno,
|
||||
COLOR,
|
||||
DT,BEGDT,ENDDT,
|
||||
VEHICLE_TYPE,
|
||||
DATAFLAG,DESCRIB,BEGDATE,ACCOUNT,VERNO,
|
||||
BAK1,BAK2,BAK3,MEMO,
|
||||
VEHICLE_CLASS,DISCRP)
|
||||
values(#{params.id},
|
||||
#{params.acarno},
|
||||
#{params.color},
|
||||
#{params.dt},
|
||||
#{params.begdt},
|
||||
#{params.enddt},
|
||||
#{params.vehicleType},
|
||||
#{params.dataflag},#{params.describ},#{params.begdate},
|
||||
#{params.account},#{params.verno},#{params.bak1},
|
||||
#{params.bak2},#{params.bak3},#{params.memo},
|
||||
#{params.vehicleClass},#{params.discrp}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertDataBatch" parameterType="java.util.List">
|
||||
insert into WHITE_CARNO_TABLE(ID,acarno,COLOR,DT,BEGDT,ENDDT,VEHICLE_TYPE,
|
||||
DATAFLAG,DESCRIB,BEGDATE,ACCOUNT,VERNO,BAK1,BAK2,BAK3,MEMO,
|
||||
VEHICLE_CLASS,DISCRP) values
|
||||
<foreach collection="list" item="params" separator=",">
|
||||
(#{params.id},#{params.acarno},#{params.color},#{params.dt},#{params.begdt},
|
||||
#{params.enddt},#{params.vehicleType},#{params.dataflag},#{params.describ},#{params.begdate},
|
||||
#{params.account},#{params.verno},#{params.bak1},#{params.bak2},#{params.bak3},#{params.memo},#{params.vehicleClass},#{params.discrp}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<delete id="delDataBatch">
|
||||
DELETE FROM WHITE_CARNO_TABLE WHERE ID IN
|
||||
<foreach item="str" collection="ids" open="(" separator="," close=")">
|
||||
#{str}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="getWhiteCarnoList" parameterType="java.util.HashMap" resultType="com.nmgs.entity.WhiteCarnoList">
|
||||
select
|
||||
t.id,t.acarno,t.COLOR,t.DT,t.BEGDT,t.ENDDT,
|
||||
t.VEHICLE_TYPE,t.DATAFLAG,t.DESCRIB,t.BEGDATE,
|
||||
t.ACCOUNT,t.VERNO,t.bak1,t.bak2,t.bak3,t.memo,t.VEHICLE_CLASS,t.DISCRP,
|
||||
<if test="params.DBTYPE ==1">
|
||||
(case when t.ENDDT< dateadd(day,0,#{params.CURRENTDATE}) THEN '已过期'
|
||||
when t.ENDDT< dateadd(day,0,#{params.CURRENTWILLDATE}) THEN '将到期'
|
||||
else '正常' end) AS promperty,
|
||||
</if>
|
||||
<if test="params.DBTYPE ==2">
|
||||
(case
|
||||
when t.ENDDT< to_Date(#{params.CURRENTDATE},'YYYY-MM-DD HH24:mi:ss') THEN '已过期'
|
||||
when t.ENDDT< to_Date(#{params.CURRENTWILLDATE},'YYYY-MM-DD HH24:mi:ss') THEN '将到期'
|
||||
else '正常' end) AS promperty,
|
||||
</if>
|
||||
<if test="params.DBTYPE ==3">
|
||||
(case
|
||||
when t.ENDDT< to_Date(#{params.CURRENTDATE},'YYYY-MM-DD HH24:mi:ss') THEN '已过期'
|
||||
when t.ENDDT< to_Date(#{params.CURRENTWILLDATE},'YYYY-MM-DD HH24:mi:ss') THEN '将到期'
|
||||
else '正常' end) AS promperty,
|
||||
</if>
|
||||
<if test="params.DBTYPE ==4">
|
||||
(case
|
||||
when t.ENDDT< STR_TO_DATE(#{params.CURRENTDATE},'%Y-%m-%d %H:%k:%s') THEN '已过期'
|
||||
when t.ENDDT< STR_TO_DATE(#{params.CURRENTWILLDATE},'%Y-%m-%d %H:%k:%s') THEN '将到期'
|
||||
else '正常' end) AS promperty,
|
||||
</if>
|
||||
|
||||
(case when t.DATAFLAG='1' then '在用' else '停用' end) as flagName,
|
||||
wct.acountname as accountName,wpc.text as colorName,wvc.text as vehicleClassName,'' as vehicleTypeName
|
||||
FROM WHITE_CARNO_TABLE t
|
||||
left join white_account_text wct on(t.ACCOUNT = wct.acountid)
|
||||
left join white_plate_color wpc on(t.COLOR = wpc.value)
|
||||
left join WHITE_VEHICLE_CLASS wvc on(t.VEHICLE_CLASS = wvc.value)
|
||||
<where>
|
||||
<if test="params.id != null and params.id != ''">
|
||||
AND t.id = #{params.id}
|
||||
</if>
|
||||
<if test="params.queryStartTime!= null and params.queryStartTime!= ''">
|
||||
<if test="params.DBTYPE == 1">
|
||||
AND t.BEGDT >= dateadd(day,0,#{params.queryStartTime})
|
||||
</if>
|
||||
<if test="params.DBTYPE == 2">
|
||||
AND t.BEGDT >= TO_DATE(#{params.queryStartTime}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 3">
|
||||
AND t.BEGDT >= TO_DATE(#{params.queryStartTime}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 4">
|
||||
AND t.BEGDT >= STR_TO_DATE(#{params.queryStartTime}, '%Y-%m-%d %H:%k:%s')
|
||||
</if>
|
||||
</if>
|
||||
<if test="params.queryEndTime!= null and params.queryEndTime!= ''">
|
||||
<if test="params.DBTYPE == 1">
|
||||
AND t.BEGDT <= dateadd(day,0,#{params.queryEndTime})
|
||||
</if>
|
||||
<if test="params.DBTYPE == 2">
|
||||
AND t.BEGDT <= TO_DATE(#{params.queryEndTime}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 3">
|
||||
AND t.BEGDT <= TO_DATE(#{params.queryEndTime}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 4">
|
||||
AND t.BEGDT <= STR_TO_DATE(#{params.queryEndTime}, '%Y-%m-%d %H:%k:%s')
|
||||
</if>
|
||||
</if>
|
||||
<if test="params.queryEndTimeS!= null and params.queryEndTimeS!= ''">
|
||||
<if test="params.DBTYPE == 1">
|
||||
AND t.ENDDT = dateadd(day,0,#{params.queryEndTimeS})
|
||||
</if>
|
||||
<if test="params.DBTYPE == 2">
|
||||
AND t.ENDDT >= TO_DATE(#{params.queryEndTimeS}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 3">
|
||||
AND t.ENDDT >= TO_DATE(#{params.queryEndTimeS}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 4">
|
||||
AND t.ENDDT >= STR_TO_DATE(#{params.queryEndTimeS}, '%Y-%m-%d %H:%k:%s')
|
||||
</if>
|
||||
</if>
|
||||
<if test="params.queryEndTimeE!= null and params.queryEndTimeE!= ''">
|
||||
<if test="params.DBTYPE == 1">
|
||||
AND t.ENDDT <= dateadd(day,0,#{params.queryEndTimeE})
|
||||
</if>
|
||||
<if test="params.DBTYPE == 2">
|
||||
AND t.ENDDT <= TO_DATE(#{params.queryEndTimeE}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 3">
|
||||
AND t.ENDDT <= TO_DATE(#{params.queryEndTimeE}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 4">
|
||||
AND t.ENDDT <= STR_TO_DATE(#{params.queryEndTimeE}, '%Y-%m-%d %H:%k:%s')
|
||||
</if>
|
||||
</if>
|
||||
|
||||
<if test="params.queryOperStartTime!= null and params.queryOperStartTime!= ''">
|
||||
<if test="params.DBTYPE == 1">
|
||||
AND t.BEGDATE >= dateadd(day,0,#{params.queryOperStartTime})
|
||||
</if>
|
||||
<if test="params.DBTYPE == 2">
|
||||
AND t.BEGDATE >= TO_DATE(#{params.queryOperStartTime}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 3">
|
||||
AND t.BEGDATE >= TO_DATE(#{params.queryOperStartTime}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 4">
|
||||
AND t.BEGDATE >= STR_TO_DATE(#{params.queryOperStartTime}, '%Y-%m-%d %H:%k:%s')
|
||||
</if>
|
||||
</if>
|
||||
<if test="params.queryOperEndTime!= null and params.queryOperEndTime!= ''">
|
||||
<if test="params.DBTYPE == 1">
|
||||
AND t.BEGDATE <= dateadd(day,0,#{params.queryOperEndTime})
|
||||
</if>
|
||||
<if test="params.DBTYPE == 2">
|
||||
AND t.BEGDATE <= TO_DATE(#{params.queryOperEndTime}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 3">
|
||||
AND t.BEGDATE <= TO_DATE(#{params.queryOperEndTime}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 4">
|
||||
AND t.BEGDATE <= STR_TO_DATE(#{params.queryOperEndTime}, '%Y-%m-%d %H:%k:%s')
|
||||
</if>
|
||||
</if>
|
||||
<if test="params.queryCreateTimeS!= null and params.queryCreateTimeS!= ''">
|
||||
<if test="params.DBTYPE == 1">
|
||||
AND t.DT >= dateadd(day,0,#{params.queryCreateTimeS})
|
||||
</if>
|
||||
<if test="params.DBTYPE == 2">
|
||||
AND t.DT >= TO_DATE(#{params.queryCreateTimeS}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 3">
|
||||
AND t.DT >= TO_DATE(#{params.queryCreateTimeS}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 4">
|
||||
AND t.DT >= STR_TO_DATE(#{params.queryCreateTimeS}, '%Y-%m-%d %H:%k:%s')
|
||||
</if>
|
||||
</if>
|
||||
<if test="params.queryCreateTimeE!= null and params.queryCreateTimeE!= ''">
|
||||
<if test="params.DBTYPE == 1">
|
||||
AND t.DT <= dateadd(day,0,#{params.queryCreateTimeE})
|
||||
</if>
|
||||
<if test="params.DBTYPE == 2">
|
||||
AND t.DT <= TO_DATE(#{params.queryCreateTimeE}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 3">
|
||||
AND t.DT <= TO_DATE(#{params.queryCreateTimeE}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 4">
|
||||
AND t.DT <= STR_TO_DATE(#{params.queryCreateTimeE}, '%Y-%m-%d %H:%k:%s')
|
||||
</if>
|
||||
</if>
|
||||
<if test="params.WILLDATE!= null and params.WILLDATE!= ''">
|
||||
<if test="params.DBTYPE == 1">
|
||||
AND t.ENDDT < dateadd(day,0,#{params.WILLDATE})
|
||||
</if>
|
||||
<if test="params.DBTYPE == 2">
|
||||
AND t.ENDDT < TO_DATE(#{params.WILLDATE}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 3">
|
||||
AND t.ENDDT < TO_DATE(#{params.WILLDATE}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 4">
|
||||
AND t.ENDDT < STR_TO_DATE(#{params.WILLDATE}, '%Y-%m-%d %H:%k:%s')
|
||||
</if>
|
||||
</if>
|
||||
<if test="params.SVEHICLEID != null and params.SVEHICLEID != ''">
|
||||
AND t.acarno like '%'|| #{params.SVEHICLEID} || '%'
|
||||
</if>
|
||||
<if test="params.acarNo != null and params.acarNo != ''">
|
||||
AND t.acarno =#{params.acarNo}
|
||||
</if>
|
||||
<if test="params.color != null and params.color != ''">
|
||||
AND t.COLOR =#{params.color}
|
||||
</if>
|
||||
<if test="params.SCOMNO != null and params.SCOMNO != ''">
|
||||
AND t.account = #{params.SCOMNO}
|
||||
</if>
|
||||
<if test="params.SSTATUS != null and params.SSTATUS != ''">
|
||||
AND t.dataflag = #{params.SSTATUS}
|
||||
</if>
|
||||
<if test="params.SVECHECLASS != null and params.SVECHECLASS != ''">
|
||||
AND t.VEHICLECLASS = #{params.SVECHECLASS}
|
||||
</if>
|
||||
<if test="params.SVECHETYPE != null and params.SVECHETYPE != ''">
|
||||
AND t.VEHICLETYPE = #{params.SVECHETYPE}
|
||||
</if>
|
||||
<if test="params.SDESCRIBE != null and params.SDESCRIBE != ''">
|
||||
AND t.DESCRIB = #{params.SDESCRIBE}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getWhiteCarno" parameterType="java.util.HashMap" resultType="com.nmgs.entity.WhiteCarnoList">
|
||||
select
|
||||
max(t.VERNO) as verno
|
||||
FROM WHITE_CARNO_TABLE t
|
||||
<where>
|
||||
<if test="params.whereSql != null and params.whereSql != ''">
|
||||
${params.whereSql}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,22 @@
|
||||
package com.nmgs.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nmgs.entity.WhiteCarnoList;
|
||||
import com.nmgs.entity.WhiteCarnoLogTable;
|
||||
import com.nmgs.entity.WhiteOperationLog;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 白名单数据操作日志
|
||||
*/
|
||||
@Mapper
|
||||
public interface WhiteCarnoLogMapper extends BaseMapper<WhiteCarnoLogTable> {
|
||||
int insertBatch(@Param("list") List<WhiteCarnoLogTable> list);
|
||||
|
||||
Page<WhiteCarnoLogTable> getWhiteCarnoLogByPage(Page<WhiteCarnoLogTable> page, @Param("params") Map<String, Object> params);
|
||||
}
|
||||
@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nmgs.mapper.WhiteCarnoLogMapper">
|
||||
<insert id="insertBatch" parameterType="java.util.List">
|
||||
<foreach collection="list" item="params" separator=";">
|
||||
insert into WHITE_CARNO_LOG_TABLE(ID,acarno,COLOR,DT,BEGDT,ENDDT,VEHICLE_TYPE,
|
||||
STATUS,DESCRIB,BEGDATE,ACCOUNT,VERNO,BAK1,BAK2,BAK3,MEMO,
|
||||
VEHICLE_CLASS,OPERTYPE,OPERTYPENAME,OPERDATE,OPERMANO,OPERMANAME,COMNO,IDBUSINESS)
|
||||
values
|
||||
(#{params.id},#{params.acarno},#{params.color},#{params.dt},#{params.begdt},
|
||||
#{params.enddt},#{params.vehicleType},#{params.dataflag},#{params.describ},#{params.begdate},
|
||||
#{params.account},#{params.verno},#{params.bak1},#{params.bak2},#{params.bak3},#{params.memo},
|
||||
#{params.vehicleClass},#{params.opertype},#{params.opertypename},#{params.operdate},
|
||||
#{params.opermano},#{params.opermaname},#{params.comno},#{params.idbusiness}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="getWhiteCarnoLogByPage" parameterType="java.util.HashMap" resultType="com.nmgs.entity.WhiteCarnoLogTable">
|
||||
select
|
||||
t.id,t.acarno,t.COLOR,t.DT,t.BEGDT,t.ENDDT,
|
||||
t.VEHICLE_TYPE,t.DATAFLAG,t.DESCRIB,t.BEGDATE,
|
||||
t.ACCOUNT,t.VERNO,t.bak1,t.bak2,t.bak3,t.memo,t.VEHICLE_CLASS AS vehicleClass,
|
||||
(case when t.DATAFLAG='1' then '在用' else '停用' end) as flagName,
|
||||
wct.acountname as accountName,wpc.text as colorName,wvc.text as vehicleClassName,'' as vehicleTypeName,
|
||||
t.OPERTYPE,t.OPERTYPENAME,t.OPERDATE,t.OPERMANO,t.OPERMANAME,t.COMNO,t.IDBUSINESS
|
||||
FROM WHITE_CARNO_LOG_TABLE t
|
||||
left join white_ACCOUNT_text wct on(t.ACCOUNT = wct.acountid)
|
||||
left join white_plate_color wpc on(t.COLOR = wpc.value)
|
||||
left join WHITE_VEHICLE_CLASS wvc on(t.VEHICLE_CLASS = wvc.value)
|
||||
|
||||
<where>
|
||||
<if test="params.id != null and params.id != ''">
|
||||
AND t.id = #{params.id}
|
||||
</if>
|
||||
<if test="params.queryOperStartTime!= null and params.queryOperStartTime!= ''">
|
||||
<if test="params.DBTYPE == 1">
|
||||
AND t.OPERDATE >= dateadd(day,0,#{params.queryOperStartTime})
|
||||
</if>
|
||||
<if test="params.DBTYPE == 2">
|
||||
AND t.OPERDATE >= TO_DATE(#{params.queryOperStartTime}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 3">
|
||||
AND t.OPERDATE >= TO_DATE(#{params.queryOperStartTime}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 4">
|
||||
AND t.OPERDATE >= STR_TO_DATE(#{params.queryOperStartTime}, '%Y-%m-%d %H:%k:%s')
|
||||
</if>
|
||||
</if>
|
||||
<if test="params.queryOperEndTime!= null and params.queryOperEndTime!= ''">
|
||||
<if test="params.DBTYPE == 1">
|
||||
AND t.OPERDATE <= dateadd(day,0,#{params.queryOperEndTime})
|
||||
</if>
|
||||
<if test="params.DBTYPE == 2">
|
||||
AND t.OPERDATE <= TO_DATE(#{params.queryOperEndTime}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 3">
|
||||
AND t.OPERDATE <= TO_DATE(#{params.queryOperEndTime}, 'YYYY-MM-DD HH24:mi:ss')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 4">
|
||||
AND t.OPERDATE <= STR_TO_DATE(#{params.queryOperEndTime}, '%Y-%m-%d %H:%k:%s')
|
||||
</if>
|
||||
</if>
|
||||
<if test="params.SVEHICLEID != null and params.SVEHICLEID != ''">
|
||||
AND t.acarno like '%'|| #{params.SVEHICLEID} || '%'
|
||||
</if>
|
||||
<if test="params.SCOLOR != null and params.SCOLOR != ''">
|
||||
AND t.COLOR = #{params.SCOLOR}
|
||||
</if>
|
||||
<if test="params.SOPERTYPE != null and params.SOPERTYPE != ''">
|
||||
AND t.OPERTYPE = #{params.SOPERTYPE}
|
||||
</if>
|
||||
<if test="params.SOPERMANAME != null and params.SOPERMANAME != ''">
|
||||
AND t.OPERMANAME like '%'|| #{params.SOPERMANAME} || '%'
|
||||
</if>
|
||||
<if test="params.SVECHECLASS != null and params.SVECHECLASS != ''">
|
||||
AND t.VEHICLECLASS = #{params.SVECHECLASS}
|
||||
</if>
|
||||
<if test="params.SVECHETYPE != null and params.SVECHETYPE != ''">
|
||||
AND t.VEHICLETYPE = #{params.SVECHETYPE}
|
||||
</if>
|
||||
<if test="params.SDESCRIBE != null and params.SDESCRIBE != ''">
|
||||
AND t.DESCRIB = #{params.SDESCRIBE}
|
||||
</if>
|
||||
</where>
|
||||
order by t.OPERDATE DESC
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,10 @@
|
||||
package com.nmgs.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nmgs.entity.WhiteOperationLog;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface WhiteOperationLogMapper extends BaseMapper<WhiteOperationLog> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
package com.nmgs.service;
|
||||
|
||||
import com.nmgs.entity.WhiteOperationLog;
|
||||
|
||||
public interface IOperationLogService {
|
||||
int saveData(WhiteOperationLog operationLog);
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
package com.nmgs.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface ISelectData {
|
||||
public List getDataByType(JSONObject paramsData);
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
package com.nmgs.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nmgs.entity.WhiteAccountText;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface IWhiteAccountSerive {
|
||||
/**
|
||||
* 分页查询白名单
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
Page<WhiteAccountText> getWhiteAccountTextByPage(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 单条数据插入
|
||||
* @param whiteCarnoList
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
int insertData(WhiteAccountText whiteCarnoList) throws Exception;
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param params
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
int batchDelDatas(Object params) throws Exception;
|
||||
|
||||
/**
|
||||
* 修改某一条数据
|
||||
* @param params
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
int updateById(WhiteAccountText params) throws Exception;
|
||||
|
||||
/**
|
||||
* 查询全部数据
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<WhiteAccountText> getWhiteAccountText(Map<String, Object> params);
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package com.nmgs.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nmgs.entity.WhiteAccountText;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface IWhiteBatchImportSerive {
|
||||
|
||||
/**
|
||||
* 白名单批量导入
|
||||
* @param params
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
JSONObject insertData(Object params) throws Exception;
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package com.nmgs.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nmgs.entity.WhiteAccountText;
|
||||
import com.nmgs.entity.WhiteCarnoDic;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface IWhiteCarnoDicService {
|
||||
/**
|
||||
* 分页查自定义询白名单
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
Page<WhiteCarnoDic> getWhiteCarnoDicByPage(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 单条数据插入
|
||||
* @param params
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
int insertData(Map<String, Object> params) throws Exception;
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param params
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
int batchDelDatas(Object params) throws Exception;
|
||||
|
||||
/**
|
||||
* 查询全部数据
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<WhiteCarnoDic> getWhiteCarnoDicList(Map<String, Object> params);
|
||||
}
|
||||
@ -0,0 +1,92 @@
|
||||
package com.nmgs.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nmgs.entity.WhiteCarnoList;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface IWhiteCarnoListSerive {
|
||||
/**
|
||||
* 分页查询白名单
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
Page<WhiteCarnoList> getWhiteCarnoListByPage(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 单条数据插入
|
||||
* @param whiteCarnoList
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
int insertData(WhiteCarnoList whiteCarnoList) throws Exception;
|
||||
|
||||
/**
|
||||
* 批量插入
|
||||
* @param list
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
int insertDataBatch(List<WhiteCarnoList> list) throws Exception;
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param params
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
int batchDelDatas(Object params) throws Exception;
|
||||
|
||||
/**
|
||||
* 修改某一条数据
|
||||
* @param params
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
int updateById(WhiteCarnoList params) throws Exception;
|
||||
|
||||
/**
|
||||
* 查询全部数据
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<WhiteCarnoList> getWhiteCarnoList(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 批量修改记录
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
int batchUpdateById(Map<String, Object> req) throws Exception;
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
int getIOCount();
|
||||
|
||||
/**
|
||||
* 发布新版本
|
||||
* @param req
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
int publishVersion(Map<String, Object> req) throws Exception;
|
||||
|
||||
/**
|
||||
* 获得最新生成的版本号
|
||||
* @param req
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
Map<String,String> getVersion(Map<String, Object> req) throws Exception;
|
||||
|
||||
/**
|
||||
* 查询数据
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<WhiteCarnoList> getWhiteCarno(Map<String, Object> params);
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package com.nmgs.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nmgs.entity.WhiteCarnoList;
|
||||
import com.nmgs.entity.WhiteCarnoLogTable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface IWhiteCarnoLogService extends IService<WhiteCarnoLogTable> {
|
||||
int saveData(WhiteCarnoLogTable operationLog);
|
||||
|
||||
// int insertBatch(List<WhiteCarnoLogTable> list);
|
||||
|
||||
/**
|
||||
* 分页查询白名单操作日志
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
public Page<WhiteCarnoLogTable> getWhiteCarnoLogByPage(Map<String, Object> params);
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package com.nmgs.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nmgs.entity.*;
|
||||
import com.nmgs.mapper.Mapper;
|
||||
import com.nmgs.service.IWhiteCarnoListSerive;
|
||||
import com.nmgs.util.LogUtil;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class ExcelDateImpl {
|
||||
|
||||
@Autowired
|
||||
public Mapper mapperI;
|
||||
|
||||
@Autowired
|
||||
public IWhiteCarnoListSerive iDivOutPortDroadSerive;
|
||||
|
||||
public List<WhiteCarnoListDto> exportDivOutPortGroadList(Map<String, Object> req) {
|
||||
List<WhiteCarnoListDto> listRet=new ArrayList<WhiteCarnoListDto>();
|
||||
//从配置文件中读取数据库连接类型
|
||||
List<WhiteCarnoList> records = iDivOutPortDroadSerive.getWhiteCarnoList(req);
|
||||
try{
|
||||
if(records.size()>0){
|
||||
//解析特情值不是查询总数
|
||||
for(int i=0;i<records.size();i++){
|
||||
WhiteCarnoListDto dto=new WhiteCarnoListDto();
|
||||
BeanUtils.copyProperties(records.get(i),dto);
|
||||
listRet.add(dto);
|
||||
}
|
||||
}
|
||||
}catch(Exception e){
|
||||
LogUtil.WriteLog_Error("查询白名单数据失败==="+e.getMessage(),"ExcelDateImpl");
|
||||
return new ArrayList();
|
||||
}
|
||||
return listRet;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.nmgs.service.impl;
|
||||
|
||||
import com.nmgs.entity.WhiteOperationLog;
|
||||
import com.nmgs.mapper.WhiteOperationLogMapper;
|
||||
import com.nmgs.service.IOperationLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class OperationLogServiceImpl implements IOperationLogService {
|
||||
@Autowired
|
||||
WhiteOperationLogMapper whiteOperationLogMapper;
|
||||
@Override
|
||||
public int saveData(WhiteOperationLog operationLog) {
|
||||
return whiteOperationLogMapper.insert(operationLog);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,82 @@
|
||||
package com.nmgs.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.nmgs.mapper.Mapper;
|
||||
import com.nmgs.service.ISelectData;
|
||||
import com.nmgs.util.LogUtil;
|
||||
import com.nmgs.util.PubTools;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 下拉值查询
|
||||
*/
|
||||
@Service
|
||||
public class SelectDataImpl implements ISelectData {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHH");
|
||||
@Autowired
|
||||
public Mapper mapperI;
|
||||
@Override
|
||||
public List getDataByType(JSONObject paramsData) {
|
||||
List ret = new ArrayList();
|
||||
String sql="";
|
||||
String selectType=paramsData.get("selectType").toString();
|
||||
String roadNoSql="";
|
||||
if(!PubTools.isEmpty(paramsData.get("roadNoSql"))){
|
||||
roadNoSql=paramsData.get("roadNoSql").toString();
|
||||
}
|
||||
if("ROAD".equals(selectType)){//自定义白名单全部路段
|
||||
sql="select a.roadno value,a.roadname||':'||a.roadno label from ROAD_TABLE a where 1=1 ";
|
||||
if(!PubTools.isNull(roadNoSql)){
|
||||
sql += roadNoSql;
|
||||
}
|
||||
sql +=" order by a.roadname ";
|
||||
} else if("ROAD_STA_STA".equals(selectType)){//自定义白名单全:站站路段,需要排除全部路段
|
||||
sql="select a.roadno value,a.roadname||':'||a.roadno label from ROAD_TABLE a where 1=1 ";
|
||||
if(!PubTools.isNull(roadNoSql)){
|
||||
sql += roadNoSql;
|
||||
}
|
||||
sql +=" order by a.roadname ";
|
||||
} else if ("STANONAME".equals(selectType)) {//站名称
|
||||
sql = "select a.stano as value,a.staname||':'||a.stano as label from NAME_TABLE a where 1=1 AND a.STATYPE=1 ";
|
||||
if(!PubTools.isNull(roadNoSql)){
|
||||
sql += roadNoSql;
|
||||
}
|
||||
sql += " order by a.roadname,a.STANAME ";
|
||||
}else if("GANTRY".equals(selectType)){//省界门架出口名称
|
||||
sql="select distinct a.gantryhex as value,a.name as label from GANTRY_TABLE a where a.boundarytype=2 group by a.name,a.gantryhex order by a.name ";
|
||||
}else if("INTERFLOW".equals(selectType)){//互通名称
|
||||
sql="select distinct a.INTER_HEX as value,a.INTER_NAME as label from DIV_INTERFLOW_TABLE a where a.IN_OUT='OUT' order by a.INTER_HEX ";
|
||||
} else if ("PLATECOLOR".equals(selectType)) {//车牌颜色
|
||||
sql = "select a.value as VALUE,a.text as LABEL from PLATECOLOR_TEXT a order by a.value ";
|
||||
} else if ("EXITFEETYPE".equals(selectType)) {//计费类型
|
||||
sql = "select a.value as VALUE,a.text as LABEL from EXITFEETYPE_TEXT a order by a.value ";
|
||||
} else if ("SPECIAL".equals(selectType)) {//特情
|
||||
sql = "select a.value as VALUE,a.text as LABEL from FLAG_TEXT a order by a.value ";
|
||||
}else if ("COMNO".equals(selectType)) {//所属公司,白名单使用
|
||||
sql = "select a.acountid as VALUE,a.acountname as LABEL from WHITE_ACCOUNT_TEXT a order by a.acountname ";
|
||||
}else if ("WHITE_VEH_CLASS".equals(selectType)) {//车种,白名单使用
|
||||
sql = "select a.value as VALUE,a.text as LABEL from WHITE_VEHICLE_CLASS a WHERE a.useflag='1' order by a.value ";
|
||||
}else if ("WHITE_PLATECOLOR".equals(selectType)) {//车牌颜色,白名单使用
|
||||
sql = "select a.value as VALUE,a.text as LABEL from white_PLATE_COLOR a WHERE a.useflag='1' order by a.value ";
|
||||
}else if ("WHITE_ZDYZH".equals(selectType)) {//自定义组合,白名单使用
|
||||
sql = "select a.memo as VALUE,a.DICNAME as LABEL,a.DISCRP as discrp from WHITE_CARNO_DIC_TABLE a WHERE 1=1 ";
|
||||
}
|
||||
|
||||
try {
|
||||
ret=mapperI.selectforlist(sql);
|
||||
} catch (Exception e) {
|
||||
LogUtil.WriteLog_Error("下拉数据"+selectType+"查询失败=====" + e.getMessage(), "SelectDataImpl");
|
||||
ret = new ArrayList();
|
||||
}
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,110 @@
|
||||
package com.nmgs.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nmgs.entity.WhiteAccountText;
|
||||
import com.nmgs.mapper.Mapper;
|
||||
import com.nmgs.mapper.WhiteAccountMapper;
|
||||
import com.nmgs.service.IWhiteAccountSerive;
|
||||
import com.nmgs.util.LogUtil;
|
||||
import com.nmgs.util.PropertiesUtil;
|
||||
import com.nmgs.util.PubTools;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Service
|
||||
public class WhiteAccountSeriveImpl implements IWhiteAccountSerive {
|
||||
@Autowired
|
||||
public WhiteAccountMapper whiteAccountMapper;
|
||||
@Autowired
|
||||
public Mapper mapperI;
|
||||
SimpleDateFormat dateTimeFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
@Override
|
||||
public Page<WhiteAccountText> getWhiteAccountTextByPage(Map<String, Object> params) {
|
||||
//从配置文件中读取数据库连接类型
|
||||
params.put("DBTYPE", PropertiesUtil.getValue("DBType"));
|
||||
//设置分页
|
||||
Integer pageNum = (Integer) params.get("pageNum");
|
||||
Integer pageSize = (Integer) params.get("pageSize");
|
||||
Page<WhiteAccountText> page = new Page<>(pageNum,pageSize);
|
||||
page = whiteAccountMapper.getWhiteAccountByPage(page,params);
|
||||
return page;
|
||||
|
||||
}
|
||||
@Override
|
||||
public int insertData(WhiteAccountText whiteAccountText) throws Exception {
|
||||
int ret=-1;
|
||||
try{
|
||||
//先根据车牌号与颜色判断是否已经存在
|
||||
Map<String,Object> params=new HashMap<String,Object>();
|
||||
params.put("id",whiteAccountText.getAcountid());
|
||||
List<WhiteAccountText> whiteCarnoList1 = whiteAccountMapper.getWhiteAccountText(params);
|
||||
if(whiteCarnoList1.size()>0){
|
||||
return -2;//白名单存在该信息!
|
||||
}
|
||||
ret= whiteAccountMapper.insert(whiteAccountText);
|
||||
}catch (Exception e){
|
||||
LogUtil.WriteLog_Error("新增单位信息出错:"+e.getMessage(),"WhiteAccountSeriveImpl");
|
||||
throw new Exception(e);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@Override
|
||||
public int batchDelDatas(Object params) throws Exception {
|
||||
int ret=-1;
|
||||
List<Integer> ids=new ArrayList<Integer>();
|
||||
try{
|
||||
if(!PubTools.isEmpty(params)){
|
||||
if(params instanceof ArrayList){
|
||||
List<Map<String,Object>> whiteAccount= (ArrayList<Map<String,Object>>) params;
|
||||
if(whiteAccount.size()>0){
|
||||
for(int i=0;i<whiteAccount.size();i++){
|
||||
WhiteAccountText wcl=(WhiteAccountText)PubTools.map2Object(whiteAccount.get(i),WhiteAccountText.class);
|
||||
ids.add(wcl.getAcountid());
|
||||
}
|
||||
}
|
||||
}else if(params instanceof JSONArray){
|
||||
JSONArray json=(JSONArray)params;
|
||||
if(json.size()>0){
|
||||
for(int i=0;i<json.size();i++){
|
||||
JSONObject jo=(JSONObject)json.get(i);
|
||||
WhiteAccountText wcl= jo.toJavaObject(WhiteAccountText.class);
|
||||
ids.add(wcl.getAcountid());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(ids.size()>0){
|
||||
ret= whiteAccountMapper.delDataById(ids);
|
||||
}
|
||||
}catch (Exception e){
|
||||
throw new Exception(e);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateById(WhiteAccountText params) throws Exception {
|
||||
int ret=-1;
|
||||
try{
|
||||
ret= whiteAccountMapper.updateById(params);
|
||||
}catch (Exception e){
|
||||
throw new Exception(e);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WhiteAccountText> getWhiteAccountText(Map<String, Object> params) {
|
||||
//从配置文件中读取数据库连接类型
|
||||
params.put("DBTYPE", PubTools.getDBType());
|
||||
List<WhiteAccountText> records = whiteAccountMapper.getWhiteAccountText(params);
|
||||
return records;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,132 @@
|
||||
package com.nmgs.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nmgs.entity.WhiteAccountText;
|
||||
import com.nmgs.entity.WhiteCarnoDic;
|
||||
import com.nmgs.mapper.Mapper;
|
||||
import com.nmgs.mapper.WhiteCarnoDicMapper;
|
||||
import com.nmgs.service.IWhiteCarnoDicService;
|
||||
import com.nmgs.util.LogUtil;
|
||||
import com.nmgs.util.PropertiesUtil;
|
||||
import com.nmgs.util.PubTools;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class WhiteCarnoDicSeviceImpl implements IWhiteCarnoDicService {
|
||||
@Autowired
|
||||
public WhiteCarnoDicMapper whiteCarnoDicMapper;
|
||||
@Autowired
|
||||
public Mapper mapperI;
|
||||
SimpleDateFormat dateTimeFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
@Override
|
||||
public Page<WhiteCarnoDic> getWhiteCarnoDicByPage(Map<String, Object> params) {
|
||||
//从配置文件中读取数据库连接类型
|
||||
params.put("DBTYPE", PubTools.getDBType());
|
||||
//设置分页
|
||||
Integer pageNum = (Integer) params.get("pageNum");
|
||||
Integer pageSize = (Integer) params.get("pageSize");
|
||||
Page<WhiteCarnoDic> page = new Page<>(pageNum,pageSize);
|
||||
page = whiteCarnoDicMapper.getWhiteCarnoDicByPage(page,params);
|
||||
return page;
|
||||
|
||||
}
|
||||
@Override
|
||||
public int insertData(Map<String, Object> params) throws Exception {
|
||||
int ret=-1;
|
||||
try{
|
||||
//先根据车牌号与颜色判断是否已经存在
|
||||
WhiteCarnoDic whiteAccountText=new WhiteCarnoDic();
|
||||
String memo=params.get("memo").toString();//免费路段的值
|
||||
String memoSS=params.get("memoSS").toString();//站站免费中的路段值
|
||||
String memoDb="";
|
||||
if (!PubTools.isNull(memo)){
|
||||
String[] ckgFree=memo.split(",");
|
||||
for (int i = 0; i < ckgFree.length; i++){
|
||||
String r = ckgFree[i]+"";
|
||||
if (!PubTools.isNull(ckgFree[i]+"")){
|
||||
//不足两位补0,
|
||||
if (Integer.parseInt(ckgFree[i]+"") < 10){
|
||||
memoDb += PubTools.GetHex("0" + ckgFree[i]+"" + "0" + ckgFree[i]+"" + "00" + "0" + ckgFree[i]+"" + "00");
|
||||
}else if(Integer.parseInt(ckgFree[i]+"") < 100 && Integer.parseInt(ckgFree[i]+"")>=10){//两位的
|
||||
memoDb += PubTools.GetHex(ckgFree[i]+"" + ckgFree[i]+"" + "00" + ckgFree[i]+"" + "00");
|
||||
}else{
|
||||
memoDb += PubTools.GetHex(ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!PubTools.isNull(memoSS)){
|
||||
String[] ckgFree=memoSS.split(",");
|
||||
for (int i = 0; i < ckgFree.length; i++){
|
||||
String r = ckgFree[i]+"";
|
||||
memoDb += PubTools.GetHex(r);
|
||||
}
|
||||
}
|
||||
whiteAccountText.setDicname(params.get("dicname").toString());
|
||||
whiteAccountText.setDiscrp(params.get("discrp").toString());
|
||||
whiteAccountText.setMemo(memoDb);
|
||||
Map<String,Object> paramsQuery=new HashMap<String,Object>();
|
||||
paramsQuery.put("memo",whiteAccountText.getMemo());
|
||||
List<WhiteCarnoDic> whiteCarnoList1 = whiteCarnoDicMapper.getWhiteCarnoDicList(paramsQuery);
|
||||
if(whiteCarnoList1.size()>0){
|
||||
return -2;//字典表中存在该信息!
|
||||
}
|
||||
ret= whiteCarnoDicMapper.insert(whiteAccountText);
|
||||
}catch (Exception e){
|
||||
LogUtil.WriteLog_Error("新增自定义白名单出错:"+e.getMessage(),"WhiteCarnoDicSeviceImpl");
|
||||
throw new Exception(e);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@Override
|
||||
public int batchDelDatas(Object params) throws Exception {
|
||||
int ret=-1;
|
||||
List<String> ids=new ArrayList<String>();
|
||||
try{
|
||||
if(!PubTools.isEmpty(params)){
|
||||
if(params instanceof ArrayList){
|
||||
List<Map<String,Object>> whiteAccount= (ArrayList<Map<String,Object>>) params;
|
||||
if(whiteAccount.size()>0){
|
||||
for(int i=0;i<whiteAccount.size();i++){
|
||||
WhiteCarnoDic wcl=(WhiteCarnoDic)PubTools.map2Object(whiteAccount.get(i),WhiteCarnoDic.class);
|
||||
ids.add(wcl.getMemo());
|
||||
}
|
||||
}
|
||||
}else if(params instanceof JSONArray){
|
||||
JSONArray json=(JSONArray)params;
|
||||
if(json.size()>0){
|
||||
for(int i=0;i<json.size();i++){
|
||||
JSONObject jo=(JSONObject)json.get(i);
|
||||
WhiteCarnoDic wcl= jo.toJavaObject(WhiteCarnoDic.class);
|
||||
ids.add(wcl.getMemo());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(ids.size()>0){
|
||||
ret= whiteCarnoDicMapper.delDataById(ids);
|
||||
}
|
||||
}catch (Exception e){
|
||||
throw new Exception(e);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@Override
|
||||
public List<WhiteCarnoDic> getWhiteCarnoDicList(Map<String, Object> params) {
|
||||
//从配置文件中读取数据库连接类型
|
||||
params.put("DBTYPE", PubTools.getDBType());
|
||||
List<WhiteCarnoDic> records = whiteCarnoDicMapper.getWhiteCarnoDicList(params);
|
||||
return records;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,416 @@
|
||||
package com.nmgs.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.UUID;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nmgs.entity.Consistent;
|
||||
import com.nmgs.entity.WhiteCarnoList;
|
||||
import com.nmgs.entity.WhiteCarnoLogTable;
|
||||
import com.nmgs.mapper.WhiteCarnoListMapper;
|
||||
import com.nmgs.mapper.Mapper;
|
||||
import com.nmgs.service.IWhiteCarnoListSerive;
|
||||
import com.nmgs.service.ISelectData;
|
||||
import com.nmgs.service.IWhiteCarnoLogService;
|
||||
import com.nmgs.util.*;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Service
|
||||
public class WhiteCarnoListSeriveImpl implements IWhiteCarnoListSerive {
|
||||
@Autowired
|
||||
public WhiteCarnoListMapper whiteCarnoListMapper;
|
||||
@Autowired
|
||||
public Mapper mapperI;
|
||||
@Autowired
|
||||
public ISelectData iSelectData;
|
||||
|
||||
IWhiteCarnoLogService iWhiteCarnoLogService;
|
||||
@Autowired
|
||||
public void setiWhiteCarnoLogService(IWhiteCarnoLogService iWhiteCarnoLogService) {
|
||||
this.iWhiteCarnoLogService = iWhiteCarnoLogService;
|
||||
}
|
||||
SimpleDateFormat dateTimeFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
@Override
|
||||
public Page<WhiteCarnoList> getWhiteCarnoListByPage(Map<String, Object> params) {
|
||||
//从配置文件中读取数据库连接类型
|
||||
params.put("DBTYPE", PubTools.getDBType());
|
||||
//设置分页
|
||||
Integer pageNum = (Integer) params.get("pageNum");
|
||||
Integer pageSize = (Integer) params.get("pageSize");
|
||||
String whiteOutTimeT = PropertiesUtil.getValue("WhiteOutTime");
|
||||
params.put("CURRENTDATE",PubTools.getCurrentDate());
|
||||
params.put("CURRENTWILLDATE",PubTools.getAddNumDate(Integer.parseInt(whiteOutTimeT)));
|
||||
Page<WhiteCarnoList> page = new Page<>(pageNum,pageSize);
|
||||
//到期数据条件需要做处理
|
||||
if(!PubTools.isEmpty(params.get("SPROMPOTY"))){
|
||||
String sprompoty = params.get("SPROMPOTY").toString();
|
||||
if("2".equals(sprompoty)){//将到期,从配置文件获取距离结束日期 还有几天算将到期
|
||||
String whiteOutTime = PropertiesUtil.getValue("WhiteOutTime");
|
||||
params.put("WILLDATE",PubTools.getAddNumDate(Integer.parseInt(whiteOutTime)));
|
||||
}else if("3".equals(sprompoty)){//已到期
|
||||
params.put("WILLDATE",PubTools.getCurrentDate());
|
||||
}else{
|
||||
|
||||
}
|
||||
}
|
||||
page = whiteCarnoListMapper.getWhiteCarnoListByPage(page,params);
|
||||
/* //获取数据
|
||||
List<WhiteCarnoList> records = page.getRecords();
|
||||
//解析里面字典数据
|
||||
for (WhiteCarnoList divOutPortDroad : records) {
|
||||
divOutPortDroad.setVehicleClassName(iSelectData.getSelect("VECHECLASS", divOutPortDroad.getVehicleClass()+""));
|
||||
divOutPortDroad.setVehicleTypeName(iSelectData.getSelect("VECHETYPE", divOutPortDroad.getVehicleType()+""));
|
||||
divOutPortDroad.setVehicleColorName(iSelectData.getSelect("PLATECOLOR", divOutPortDroad.getVehicleColor()+""));
|
||||
}
|
||||
page.setRecords(records);*/
|
||||
return page;
|
||||
|
||||
}
|
||||
@Override
|
||||
public int insertData(WhiteCarnoList whiteCarnoList) throws Exception {
|
||||
int ret=-1;
|
||||
try{
|
||||
//先根据车牌号与颜色判断是否已经存在
|
||||
Map<String,Object> params=new HashMap<String,Object>();
|
||||
params.put("acarNo",whiteCarnoList.getAcarno());
|
||||
params.put("color",whiteCarnoList.getColor());
|
||||
List<WhiteCarnoList> whiteCarnoList1 = whiteCarnoListMapper.getWhiteCarnoList(params);
|
||||
if(whiteCarnoList1.size()>0){
|
||||
return -2;//白名单存在该信息!
|
||||
}
|
||||
whiteCarnoList.setId(UUID.randomUUID().toString().replace("-","").substring(0,32));
|
||||
whiteCarnoList.setDt(dateTimeFormatter.parse(dateTimeFormatter.format(new Date())));
|
||||
String memoDb="";
|
||||
if(!PubTools.isNull(whiteCarnoList.getQm()) && "1".equals(whiteCarnoList.getQm())){//免费类型:全免的话默认为零
|
||||
memoDb="0000000000";
|
||||
whiteCarnoList.setDiscrp("");
|
||||
}else{
|
||||
//免费路段处理
|
||||
if (!PubTools.isNull(whiteCarnoList.getMfld())){
|
||||
String[] ckgFree=whiteCarnoList.getMfld().split(",");
|
||||
for (int i = 0; i < ckgFree.length; i++){
|
||||
String r = ckgFree[i]+"";
|
||||
if (!PubTools.isNull(ckgFree[i]+"")){
|
||||
//不足两位补0,
|
||||
if (Integer.parseInt(ckgFree[i]+"") < 10){
|
||||
memoDb += PubTools.GetHex("0" + ckgFree[i]+"" + "0" + ckgFree[i]+"" + "00" + "0" + ckgFree[i]+"" + "00");
|
||||
}else if(Integer.parseInt(ckgFree[i]+"") < 100 && Integer.parseInt(ckgFree[i]+"")>=10){//两位的
|
||||
memoDb += PubTools.GetHex(ckgFree[i]+"" + ckgFree[i]+"" + "00" + ckgFree[i]+"" + "00");
|
||||
}else{
|
||||
memoDb += PubTools.GetHex(ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//免费站站组合
|
||||
if (!PubTools.isNull(whiteCarnoList.getMfzzh())){
|
||||
String[] ckgFree=whiteCarnoList.getMfzzh().split(",");
|
||||
for (int i = 0; i < ckgFree.length; i++){
|
||||
String r = ckgFree[i]+"";
|
||||
memoDb += PubTools.GetHex(r);
|
||||
}
|
||||
}
|
||||
//自定义组合
|
||||
if (!PubTools.isNull(whiteCarnoList.getZdyzh())){
|
||||
String[] ckgFree=whiteCarnoList.getZdyzh().split(",");
|
||||
for (int i = 0; i < ckgFree.length; i++){
|
||||
String r = ckgFree[i]+"";
|
||||
memoDb += r;
|
||||
}
|
||||
}
|
||||
}
|
||||
whiteCarnoList.setMemo(memoDb);
|
||||
ret= whiteCarnoListMapper.insert(whiteCarnoList);
|
||||
if(ret>0){
|
||||
WhiteCarnoLogTable wclt=new WhiteCarnoLogTable();
|
||||
BeanUtils.copyProperties(whiteCarnoList,wclt,"id");
|
||||
wclt.setId(UUID.randomUUID().toString().replace("-","").substring(0,32));
|
||||
wclt.setOperdate(dateTimeFormatter.parse(dateTimeFormatter.format(new Date())));
|
||||
wclt.setOpertype(Consistent.ADD);
|
||||
wclt.setOpertypename(Consistent.ADD_NAME);
|
||||
wclt.setIdbusiness(whiteCarnoList.getId());
|
||||
iWhiteCarnoLogService.saveData(wclt);
|
||||
}
|
||||
}catch (Exception e){
|
||||
LogUtil.WriteLog_Error("新增白名单出错:"+e.getMessage(),"WhiteCarnoListSeriveImpl");
|
||||
throw new Exception(e);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@Override
|
||||
public int insertDataBatch(List<WhiteCarnoList> whiteCarnoList) throws Exception {
|
||||
int ret=-1;
|
||||
try{
|
||||
ret= whiteCarnoListMapper.insertDataBatch(whiteCarnoList);
|
||||
}catch (Exception e){
|
||||
throw new Exception(e);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@Override
|
||||
public int batchDelDatas(Object params) throws Exception {
|
||||
int ret=-1;
|
||||
List<String> ids=new ArrayList<String>();
|
||||
List<WhiteCarnoLogTable> listLog=new ArrayList<WhiteCarnoLogTable>();
|
||||
try{
|
||||
JSONArray json=new JSONArray();
|
||||
if(!PubTools.isEmpty(params)){
|
||||
if(params instanceof ArrayList){
|
||||
List<Map<String,Object>> whiteCarnoList= (ArrayList<Map<String,Object>>) params;
|
||||
if(whiteCarnoList.size()>0){
|
||||
for(int i=0;i<whiteCarnoList.size();i++){
|
||||
WhiteCarnoList wcl=(WhiteCarnoList)PubTools.map2Object(whiteCarnoList.get(i),WhiteCarnoList.class);
|
||||
ids.add(wcl.getId());
|
||||
WhiteCarnoLogTable wclt=new WhiteCarnoLogTable();
|
||||
BeanUtils.copyProperties(wcl,wclt,"id");
|
||||
wclt.setId(UUID.randomUUID().toString().replace("-","").substring(0,32));
|
||||
wclt.setOperdate(dateTimeFormatter.parse(dateTimeFormatter.format(new Date())));
|
||||
wclt.setOpertype(Consistent.DELETE);
|
||||
wclt.setOpertypename(Consistent.DELETE_NAME);
|
||||
wclt.setIdbusiness(wcl.getId());
|
||||
listLog.add(wclt);
|
||||
}
|
||||
}
|
||||
}else if(params instanceof JSONArray){
|
||||
json=(JSONArray)params;
|
||||
if(json.size()>0){
|
||||
for(int i=0;i<json.size();i++){
|
||||
JSONObject jo=(JSONObject)json.get(i);
|
||||
WhiteCarnoList wcl= jo.toJavaObject(WhiteCarnoList.class);
|
||||
ids.add(wcl.getId());
|
||||
WhiteCarnoLogTable wclt=new WhiteCarnoLogTable();
|
||||
BeanUtils.copyProperties(wcl,wclt,"id");
|
||||
wclt.setId(UUID.randomUUID().toString().replace("-","").substring(0,32));
|
||||
wclt.setOperdate(dateTimeFormatter.parse(dateTimeFormatter.format(new Date())));
|
||||
wclt.setOpertype(Consistent.DELETE);
|
||||
wclt.setOpertypename(Consistent.DELETE_NAME);
|
||||
wclt.setIdbusiness(wcl.getId());
|
||||
listLog.add(wclt);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(ids.size()>0){
|
||||
ret= whiteCarnoListMapper.delDataBatch(ids);
|
||||
if(ret>0){
|
||||
iWhiteCarnoLogService.saveBatch(listLog);
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
throw new Exception(e);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateById(WhiteCarnoList params) throws Exception {
|
||||
int ret=-1;
|
||||
try{
|
||||
String memoDb="";
|
||||
if(!PubTools.isNull(params.getQm()) && "1".equals(params.getQm())){//免费类型:全免的话默认为零
|
||||
memoDb="0000000000";
|
||||
}else{
|
||||
|
||||
//免费路段处理
|
||||
if (!PubTools.isNull(params.getMfld())){
|
||||
String[] ckgFree=params.getMfld().split(",");
|
||||
for (int i = 0; i < ckgFree.length; i++){
|
||||
String r = ckgFree[i]+"";
|
||||
if (!PubTools.isNull(ckgFree[i]+"")){
|
||||
//不足两位补0,
|
||||
if (Integer.parseInt(ckgFree[i]+"") < 10){
|
||||
memoDb += PubTools.GetHex("0" + ckgFree[i]+"" + "0" + ckgFree[i]+"" + "00" + "0" + ckgFree[i]+"" + "00");
|
||||
}else if(Integer.parseInt(ckgFree[i]+"") < 100 && Integer.parseInt(ckgFree[i]+"")>=10){//两位的
|
||||
memoDb += PubTools.GetHex(ckgFree[i]+"" + ckgFree[i]+"" + "00" + ckgFree[i]+"" + "00");
|
||||
}else{
|
||||
memoDb += PubTools.GetHex(ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//免费站站组合
|
||||
if (!PubTools.isNull(params.getMfzzh())){
|
||||
String[] ckgFree=params.getMfzzh().split(",");
|
||||
for (int i = 0; i < ckgFree.length; i++){
|
||||
String r = ckgFree[i]+"";
|
||||
memoDb += PubTools.GetHex(r);
|
||||
}
|
||||
}
|
||||
//自定义组合
|
||||
if (!PubTools.isNull(params.getZdyzh())){
|
||||
String[] ckgFree=params.getZdyzh().split(",");
|
||||
for (int i = 0; i < ckgFree.length; i++){
|
||||
String r = ckgFree[i]+"";
|
||||
memoDb += r;
|
||||
}
|
||||
}
|
||||
}
|
||||
params.setMemo(memoDb);
|
||||
ret= whiteCarnoListMapper.updateById(params);
|
||||
WhiteCarnoLogTable wclt=new WhiteCarnoLogTable();
|
||||
BeanUtils.copyProperties(params,wclt,"id");
|
||||
wclt.setId(UUID.randomUUID().toString().replace("-","").substring(0,32));
|
||||
wclt.setOperdate(dateTimeFormatter.parse(dateTimeFormatter.format(new Date())));
|
||||
wclt.setOpertype(Consistent.UPDATE);
|
||||
wclt.setOpertypename(Consistent.UPDATE_NAME);
|
||||
wclt.setIdbusiness(params.getId());
|
||||
iWhiteCarnoLogService.saveData(wclt);
|
||||
}catch (Exception e){
|
||||
throw new Exception(e);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WhiteCarnoList> getWhiteCarnoList(Map<String, Object> params) {
|
||||
//从配置文件中读取数据库连接类型
|
||||
params.put("DBTYPE", PubTools.getDBType());
|
||||
String whiteOutTimeT = PropertiesUtil.getValue("WhiteOutTime");
|
||||
params.put("CURRENTDATE",PubTools.getCurrentDate());
|
||||
params.put("CURRENTWILLDATE",PubTools.getAddNumDate(Integer.parseInt(whiteOutTimeT)));
|
||||
//到期数据条件需要做处理
|
||||
if(!PubTools.isEmpty(params.get("SPROMPOTY"))){
|
||||
String sprompoty = params.get("SPROMPOTY").toString();
|
||||
if("2".equals(sprompoty)){//将到期,从配置文件获取距离结束日期 还有几天算将到期
|
||||
String whiteOutTime = PropertiesUtil.getValue("WhiteOutTime");
|
||||
params.put("WILLDATE",PubTools.getAddNumDate(Integer.parseInt(whiteOutTime)));
|
||||
}else if("3".equals(sprompoty)){//已到期
|
||||
params.put("WILLDATE",PubTools.getCurrentDate());
|
||||
}else{
|
||||
|
||||
}
|
||||
}
|
||||
List<WhiteCarnoList> records = whiteCarnoListMapper.getWhiteCarnoList(params);
|
||||
//获取数据
|
||||
//解析里面字典数据
|
||||
/* for (WhiteCarnoList divOutPortDroad : records) {
|
||||
divOutPortDroad.setVehicleClassName(iSelectData.getSelect("VECHECLASS", divOutPortDroad.getVehicleClass()+""));
|
||||
divOutPortDroad.setVehicleTypeName(iSelectData.getSelect("VECHETYPE", divOutPortDroad.getVehicleType()+""));
|
||||
divOutPortDroad.setVehicleColorName(iSelectData.getSelect("PLATECOLOR", divOutPortDroad.getColor()+""));
|
||||
}*/
|
||||
return records;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchUpdateById(Map<String, Object> req) throws Exception {
|
||||
try{
|
||||
req.put("DBType",PubTools.getDBType());
|
||||
if(!PubTools.isEmpty(req.get("id"))){
|
||||
String[] ids = req.get("id").toString().split(",");
|
||||
int i = whiteCarnoListMapper.batchUpdateById(ids, req);
|
||||
if(i>0){
|
||||
for(String str:ids){
|
||||
Map<String,Object> params2=new HashMap<String,Object>();
|
||||
params2.put("id",str);
|
||||
List<WhiteCarnoList> whiteCarnoList1 = whiteCarnoListMapper.getWhiteCarnoList(params2);
|
||||
WhiteCarnoList params = whiteCarnoList1.get(0);
|
||||
WhiteCarnoLogTable wclt=new WhiteCarnoLogTable();
|
||||
BeanUtils.copyProperties(params,wclt,"id");
|
||||
wclt.setId(UUID.randomUUID().toString().replace("-","").substring(0,32));
|
||||
wclt.setOperdate(dateTimeFormatter.parse(dateTimeFormatter.format(new Date())));
|
||||
wclt.setOpertype(Consistent.UPDATE);
|
||||
wclt.setOpertypename(Consistent.UPDATE_NAME);
|
||||
wclt.setIdbusiness(params.getId());
|
||||
wclt.setOpermano(req.get("opermano").toString());
|
||||
wclt.setOpermaname(req.get("opermaname").toString());
|
||||
iWhiteCarnoLogService.saveData(wclt);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}catch (Exception e){
|
||||
throw new Exception(e);
|
||||
}
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIOCount() {
|
||||
String sql="select COUNT(1) from CARNO_TABLE where ACARNO like '%I%' or ACARNO like '%O%'";
|
||||
List selectforlist = this.mapperI.selectforlist(sql);
|
||||
return selectforlist.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int publishVersion(Map<String, Object> req) throws Exception {
|
||||
req.put("DBType",PubTools.getDBType());
|
||||
int ret= this.whiteCarnoListMapper.publishVersion(req);
|
||||
if(ret>-1){
|
||||
WhiteCarnoLogTable wclt = new WhiteCarnoLogTable();
|
||||
wclt.setId(UUID.randomUUID().toString().replace("-","").substring(0,32));
|
||||
wclt.setOperdate(dateTimeFormatter.parse(dateTimeFormatter.format(new Date())));
|
||||
wclt.setOpertype(Consistent.UPDATE_VERSION);
|
||||
wclt.setOpertypename(Consistent.UPDATE_VERSION_NAME);
|
||||
wclt.setIdbusiness("0000000000000");
|
||||
wclt.setOpermano(req.get("opermano").toString());
|
||||
wclt.setOpermaname(req.get("opermaname").toString());
|
||||
wclt.setAcarno("版本更新");
|
||||
wclt.setColor(1);
|
||||
wclt.setBegdate(dateTimeFormatter.parse(dateTimeFormatter.format(new Date())));
|
||||
wclt.setBegdt(dateTimeFormatter.parse(dateTimeFormatter.format(new Date())));
|
||||
wclt.setEnddt(dateTimeFormatter.parse(dateTimeFormatter.format(new Date())));
|
||||
wclt.setDescrib("为版本更新时产生的日志");
|
||||
wclt.setDt(dateTimeFormatter.parse(dateTimeFormatter.format(new Date())));
|
||||
wclt.setAccount(0);
|
||||
wclt.setVerno(req.get("verno").toString());
|
||||
iWhiteCarnoLogService.saveData(wclt);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String,String> getVersion(Map<String, Object> req) throws Exception {
|
||||
req.put("DBType",PubTools.getDBType());
|
||||
String verN = "";
|
||||
String oldVerno = "0";
|
||||
Map<String,String> map=new HashMap<String,String>();
|
||||
//获取当前时间
|
||||
SimpleDateFormat sdf=new SimpleDateFormat("yyMMdd");
|
||||
String nydm = sdf.format(new Date());
|
||||
int newymd = Integer.parseInt(nydm);
|
||||
if(PubTools.isEmpty(req)){
|
||||
req=new HashMap<String, Object>();
|
||||
}
|
||||
req.put("whereSql"," t.VERNO !='0' and VERNO is not null");
|
||||
List<WhiteCarnoList> whiteCarno = this.getWhiteCarno(req);
|
||||
//获取老版本数据
|
||||
if (whiteCarno.size() > 0 && !PubTools.isEmpty(whiteCarno.get(0))) {
|
||||
if ( !PubTools.isNull(whiteCarno.get(0).getVerno()) && whiteCarno.get(0).getVerno().length() > 6) {
|
||||
//获取老版本版本号
|
||||
oldVerno =whiteCarno.get(0).getVerno();
|
||||
//获取老版本时间
|
||||
String oymd = oldVerno.substring(0, 6);
|
||||
int oldymd = Integer.parseInt(oymd);
|
||||
if (oldymd == newymd) {//当天更改的 每次加 1
|
||||
int count = Integer.parseInt(oldVerno.substring(oldVerno.length() - 1));
|
||||
int i = count + 1;
|
||||
verN = nydm + (i+"");
|
||||
}
|
||||
else{
|
||||
verN = (nydm + "1");
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
verN = nydm + "1";
|
||||
}
|
||||
map.put("oldVerno",oldVerno);
|
||||
map.put("verno",verN);
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WhiteCarnoList> getWhiteCarno(Map<String, Object> params) {
|
||||
return this.whiteCarnoListMapper.getWhiteCarno(params);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
package com.nmgs.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nmgs.entity.WhiteCarnoList;
|
||||
import com.nmgs.entity.WhiteCarnoLogTable;
|
||||
import com.nmgs.entity.WhiteOperationLog;
|
||||
import com.nmgs.mapper.WhiteCarnoLogMapper;
|
||||
import com.nmgs.mapper.WhiteOperationLogMapper;
|
||||
import com.nmgs.service.IOperationLogService;
|
||||
import com.nmgs.service.IWhiteCarnoLogService;
|
||||
import com.nmgs.util.PropertiesUtil;
|
||||
import com.nmgs.util.PubTools;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class WhiteCarnoLogServiceImpl extends ServiceImpl<WhiteCarnoLogMapper,WhiteCarnoLogTable> implements IWhiteCarnoLogService {
|
||||
|
||||
WhiteCarnoLogMapper whiteOperationLogMapper;
|
||||
@Autowired
|
||||
public void setWhiteOperationLogMapper(WhiteCarnoLogMapper whiteOperationLogMapper) {
|
||||
this.whiteOperationLogMapper = whiteOperationLogMapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int saveData(WhiteCarnoLogTable operationLog) {
|
||||
return whiteOperationLogMapper.insert(operationLog);
|
||||
}
|
||||
@Override
|
||||
public Page<WhiteCarnoLogTable> getWhiteCarnoLogByPage(Map<String, Object> params) {
|
||||
//从配置文件中读取数据库连接类型
|
||||
params.put("DBTYPE", PubTools.getDBType());
|
||||
//设置分页
|
||||
Integer pageNum = (Integer) params.get("pageNum");
|
||||
Integer pageSize = (Integer) params.get("pageSize");
|
||||
Page<WhiteCarnoLogTable> page = new Page<>(pageNum,pageSize);
|
||||
page = whiteOperationLogMapper.getWhiteCarnoLogByPage(page,params);
|
||||
return page;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,175 @@
|
||||
package com.nmgs.util;
|
||||
|
||||
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 时间工具类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||
{
|
||||
public static String YYYY = "yyyy";
|
||||
|
||||
public static String YYYY_MM = "yyyy-MM";
|
||||
|
||||
public static String YYYY_MM_DD = "yyyy-MM-dd";
|
||||
|
||||
public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
|
||||
|
||||
public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
private static String[] parsePatterns = {
|
||||
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
|
||||
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
|
||||
"yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
|
||||
|
||||
/**
|
||||
* 获取当前Date型日期
|
||||
*
|
||||
* @return Date() 当前日期
|
||||
*/
|
||||
public static Date getNowDate()
|
||||
{
|
||||
return new Date();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前日期, 默认格式为yyyy-MM-dd
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public static String getDate()
|
||||
{
|
||||
return dateTimeNow(YYYY_MM_DD);
|
||||
}
|
||||
|
||||
public static final String getTime()
|
||||
{
|
||||
return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
|
||||
}
|
||||
|
||||
public static final String dateTimeNow()
|
||||
{
|
||||
return dateTimeNow(YYYYMMDDHHMMSS);
|
||||
}
|
||||
|
||||
public static final String dateTimeNow(final String format)
|
||||
{
|
||||
return parseDateToStr(format, new Date());
|
||||
}
|
||||
|
||||
public static final String dateTime(final Date date)
|
||||
{
|
||||
return parseDateToStr(YYYY_MM_DD, date);
|
||||
}
|
||||
|
||||
public static final String parseDateToStr(final String format, final Date date)
|
||||
{
|
||||
return new SimpleDateFormat(format).format(date);
|
||||
}
|
||||
|
||||
public static final Date dateTime(final String format, final String ts)
|
||||
{
|
||||
try
|
||||
{
|
||||
return new SimpleDateFormat(format).parse(ts);
|
||||
}
|
||||
catch (ParseException e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期路径 即年/月/日 如2018/08/08
|
||||
*/
|
||||
public static final String datePath()
|
||||
{
|
||||
Date now = new Date();
|
||||
return DateFormatUtils.format(now, "yyyy-MM-dd");
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期路径 即年/月/日 如20180808
|
||||
*/
|
||||
public static final String dateTime()
|
||||
{
|
||||
Date now = new Date();
|
||||
return DateFormatUtils.format(now, "yyyyMMdd");
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期型字符串转化为日期 格式
|
||||
*/
|
||||
public static Date parseDate(Object str)
|
||||
{
|
||||
if (str == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
try
|
||||
{
|
||||
return parseDate(str.toString(), parsePatterns);
|
||||
}
|
||||
catch (ParseException e)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取服务器启动时间
|
||||
*/
|
||||
public static Date getServerStartDate()
|
||||
{
|
||||
long time = ManagementFactory.getRuntimeMXBean().getStartTime();
|
||||
return new Date(time);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算两个时间差
|
||||
*/
|
||||
public static String getDatePoor(Date endDate, Date nowDate) {
|
||||
long nd = 1000 * 24 * 60 * 60;
|
||||
long nh = 1000 * 60 * 60;
|
||||
long nm = 1000 * 60;
|
||||
long ns = 1000;
|
||||
// 获得两个时间的毫秒时间差异
|
||||
long diff = endDate.getTime() - nowDate.getTime();
|
||||
// 计算差多少天
|
||||
long day = diff / nd;
|
||||
// 计算差多少小时
|
||||
long hour = diff % nd / nh;
|
||||
// 计算差多少分钟
|
||||
long min = diff % nd % nh / nm;
|
||||
// 计算差多少秒//输出结果
|
||||
long sec = diff % nd % nh % nm / ns;
|
||||
return day + "天" + hour + "小时" + min + "分钟" + sec + "秒";
|
||||
}
|
||||
public static String getDatePoorForMinSec(Date endDate, Date nowDate) {
|
||||
long nm = 1000 * 60;
|
||||
long ns = 1000;
|
||||
// 获得两个时间的毫秒时间差异
|
||||
long diff = endDate.getTime() - nowDate.getTime();
|
||||
// 计算差多少分钟
|
||||
long min = diff / nm;
|
||||
// 计算差多少秒//输出结果
|
||||
long sec = diff % nm / ns;
|
||||
return min + "分钟" + sec + "秒";
|
||||
}
|
||||
public static long getDatePoorForSec(Date endDate, Date nowDate) {
|
||||
long ns = 1000;
|
||||
// 获得两个时间的毫秒时间差异
|
||||
long diff = endDate.getTime() - nowDate.getTime();
|
||||
// 计算差多少秒//输出结果
|
||||
long sec = diff / ns;
|
||||
return sec;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.nmgs.util;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
|
||||
public class ExceptionUtil {
|
||||
public static String getExceptionStr(Exception e){
|
||||
StringWriter stringWriter = new StringWriter();
|
||||
PrintWriter writer = new PrintWriter(stringWriter);
|
||||
e.printStackTrace(writer);
|
||||
StringBuffer buffer = stringWriter.getBuffer();
|
||||
return buffer.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,106 @@
|
||||
package com.nmgs.util;
|
||||
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.RandomAccessFile;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Date;
|
||||
import java.util.Properties;
|
||||
|
||||
public class LogUtil {
|
||||
|
||||
|
||||
public static void WriteLog_Info(String msg, String disStr) {
|
||||
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd-HH");
|
||||
String fileName = f.format(new Date()) + "_Info";
|
||||
WriteLog(fileName, msg, disStr);
|
||||
}
|
||||
|
||||
public static void WriteLog_Error(String msg, String disStr) {
|
||||
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd-HH");
|
||||
String fileName = f.format(new Date()) + "_Error";
|
||||
WriteLog(fileName, msg, disStr);
|
||||
}
|
||||
|
||||
private static void WriteLog(String suffix, String content, String disStr) {
|
||||
try {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
|
||||
Properties Newproperties = new Properties();
|
||||
Newproperties.load(new FileInputStream((PathUtil.projectApplicationPath)));
|
||||
String baseDir = PathUtil.TomcatPath + "/logs/" + Newproperties.getProperty("spring.logback.appName") + "/" + disStr + "/";
|
||||
fileCreat(baseDir);
|
||||
StringBuffer sb = new StringBuffer();
|
||||
String str = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss SSS")) + "-->类【" + disStr + "】:";
|
||||
sb.append(str);
|
||||
sb.append(content);
|
||||
sb.append("\r\n");
|
||||
|
||||
File logPathFile = new File(baseDir);
|
||||
if (!logPathFile.isDirectory()) {
|
||||
Boolean _f = logPathFile.mkdir();
|
||||
}
|
||||
|
||||
String fileDic = format.format(new Date());
|
||||
File filedir = new File(baseDir + fileDic);
|
||||
if (!filedir.isDirectory()) {
|
||||
filedir.mkdir();
|
||||
File[] fs = logPathFile.listFiles();
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
int delFlag = Integer.parseInt(now.minus(7, ChronoUnit.DAYS).format(DateTimeFormatter.ofPattern("yyyyMMdd")));
|
||||
if (fs != null) {
|
||||
for (File f : fs) {
|
||||
int deldir = Integer.parseInt(f.getName());
|
||||
if (deldir < delFlag) {
|
||||
if (f.isDirectory()) {
|
||||
deleteDirectory(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
String fullFilePath = baseDir + fileDic + "/" + suffix + ".txt";
|
||||
|
||||
try (RandomAccessFile reader = new RandomAccessFile(new File(fullFilePath), "rw");
|
||||
) {
|
||||
// FileLock lock1 = reader.getChannel().lock()
|
||||
reader.seek(reader.length());
|
||||
reader.write(sb.toString().getBytes());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
System.out.println(e.getMessage());
|
||||
}
|
||||
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
System.out.println(exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static void deleteDirectory(File file) {
|
||||
if (file.isFile()) {// 表示该文件不是文件夹
|
||||
file.delete();
|
||||
} else {
|
||||
// 首先得到当前的路径
|
||||
String[] childFilePaths = file.list();
|
||||
for (String childFilePath : childFilePaths) {
|
||||
File childFile = new File(file.getAbsolutePath() + "/" + childFilePath);
|
||||
deleteDirectory(childFile);
|
||||
}
|
||||
file.delete();
|
||||
}
|
||||
}
|
||||
|
||||
public static void fileCreat(String path) {
|
||||
File file = new File(path);
|
||||
if (!file.isDirectory()) {
|
||||
file.mkdirs();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package com.nmgs.util;
|
||||
|
||||
import java.text.Normalizer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
public class LogUtils {
|
||||
public static final String LOG_APP_USER = "AppUser";
|
||||
public static final String LOG_APP_DEBUG = "AppDebug";
|
||||
public static final String LOG_SECURITY = "Sec";
|
||||
public static final String LOG_DATA = "Data";
|
||||
public static final String SQL_MSG = "SqlMsg";
|
||||
|
||||
public static Logger getAppLog() {
|
||||
Logger log = LogManager.getLogger("AppUser");
|
||||
return log;
|
||||
}
|
||||
|
||||
public static Logger getAppDebugLog() {
|
||||
Logger log = LogManager.getLogger("AppDebug");
|
||||
return log;
|
||||
}
|
||||
|
||||
public static Logger getSecLog() {
|
||||
Logger log = LogManager.getLogger("Sec");
|
||||
return log;
|
||||
}
|
||||
|
||||
public static Logger getDataLog() {
|
||||
Logger log = LogManager.getLogger("Data");
|
||||
return log;
|
||||
}
|
||||
|
||||
public static Logger getSqlLog() {
|
||||
Logger log = LogManager.getLogger("SqlMsg");
|
||||
return log;
|
||||
}
|
||||
|
||||
public static Logger getLog(String moduleName) {
|
||||
Logger log = LogManager.getLogger(moduleName);
|
||||
return log;
|
||||
}
|
||||
|
||||
public static String filterLogForging(String str) {
|
||||
List<String> sensitiveStr = new ArrayList();
|
||||
sensitiveStr.add("%0d");
|
||||
sensitiveStr.add("%0a");
|
||||
sensitiveStr.add("%0A");
|
||||
sensitiveStr.add("%0D");
|
||||
sensitiveStr.add("\r");
|
||||
sensitiveStr.add("\n");
|
||||
String normalize = Normalizer.normalize(str, Normalizer.Form.NFKC);
|
||||
Iterator<String> iterator = sensitiveStr.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
normalize.replace((CharSequence) iterator.next(), "");
|
||||
}
|
||||
return normalize;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.nmgs.util;
|
||||
|
||||
public class PlateRegexutil {
|
||||
public static boolean isregex (String plateid) {
|
||||
String start = "(" +
|
||||
"京|津|冀|晋|蒙|辽|吉|黑|沪|苏|浙|皖|闽|赣|鲁|" +
|
||||
"豫|鄂|湘|粤|桂|琼|渝|川|贵|云|藏|陕|甘|青|宁|" +
|
||||
"新|港|澳|" +
|
||||
"军|空|海|北|沈|兰|济|南|广|成|临" +
|
||||
")";
|
||||
|
||||
String regex[] = {
|
||||
start + "[a-zA-Z]{1}[a-zA-Z0-9]{6}", //新能源车牌
|
||||
start + "[a-zA-Z]{1}[a-zA-Z0-9]{5}", //常规车牌
|
||||
start + "[a-zA-Z]{1}[a-zA-Z0-9]{4}(警|使|学|挂|领|港|澳|超|临)", //常规特种车牌
|
||||
"(WJ)[0-9]{2}[a-zA-Z0-9]{5}", //武警普通
|
||||
"(WJ)[0-9]{2}(消|边|通|森|金|警|电)[a-zA-Z0-9]{4}", //武警特种
|
||||
"(WJ)[a-zA-Z0-9]{1}[a-zA-Z0-9]{5}",
|
||||
"(WJ)[0-9]{2}(消|边|通|森|金|警|电|[a-zA-Z0-9])[a-zA-Z0-9]{4}", //武警(综合)
|
||||
"(WJ)(消|边|通|森|金|警|电|[a-zA-Z0-9])[a-zA-Z0-9]{5}",
|
||||
start + "[a-zA-Z]{1}[a-zA-Z0-9]{4}(警|使|学|挂|领|港|澳|超|临|[a-zA-Z0-9])"//常规(综合)
|
||||
};
|
||||
//总综合
|
||||
// regex = new String[]{"(" + start + "[a-zA-Z]{1}[a-zA-Z0-9]{4}(警|使|学|挂|领|港|澳|超|临|[a-zA-Z0-9]))|((WJ)[0-9]{2}(消|边|通|森|金|警|电|[a-zA-Z0-9])[a-zA-Z0-9]{4})"};
|
||||
|
||||
boolean relseltflag=false;
|
||||
for (int j = 0; j < regex.length; j++) {
|
||||
if (plateid.matches(regex[j])) {
|
||||
relseltflag= true;
|
||||
}
|
||||
}
|
||||
return relseltflag;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,96 @@
|
||||
package com.nmgs.util;
|
||||
|
||||
|
||||
import com.trkf.PasswordEncryption.PassWordUtils;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
public class main {
|
||||
private static long[] Crc32Table = {
|
||||
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
|
||||
0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
|
||||
0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
|
||||
0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
|
||||
0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,
|
||||
0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
|
||||
0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC,
|
||||
0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
|
||||
0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
|
||||
0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
|
||||
0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940,
|
||||
0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
|
||||
0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116,
|
||||
0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
|
||||
0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
|
||||
0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
|
||||
0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A,
|
||||
0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
|
||||
0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818,
|
||||
0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
|
||||
0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
|
||||
0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
|
||||
0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C,
|
||||
0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
|
||||
0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,
|
||||
0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
|
||||
0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
|
||||
0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
|
||||
0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086,
|
||||
0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
|
||||
0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4,
|
||||
0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
|
||||
0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,
|
||||
0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
|
||||
0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,
|
||||
0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
|
||||
0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE,
|
||||
0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
|
||||
0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
|
||||
0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
|
||||
0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252,
|
||||
0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
|
||||
0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60,
|
||||
0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
|
||||
0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
|
||||
0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
|
||||
0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04,
|
||||
0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
|
||||
0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A,
|
||||
0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
|
||||
0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,
|
||||
0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
|
||||
0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E,
|
||||
0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
|
||||
0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,
|
||||
0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
|
||||
0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,
|
||||
0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
|
||||
0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0,
|
||||
0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
|
||||
0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6,
|
||||
0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
|
||||
0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
|
||||
0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
|
||||
};
|
||||
|
||||
public static void main(String[] args) throws ParseException, UnsupportedEncodingException {
|
||||
// String memo="A900000000".substring(2,6);
|
||||
// System.out.println(Long.parseLong(memo,16));
|
||||
System.out.println(PassWordUtils.encrypt("sysadmin"));
|
||||
System.out.println(PassWordUtils.encrypt("123456"));
|
||||
SimpleDateFormat dateTimeFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
String r = "0041", s1 = "00001425", s2 = "00001964";
|
||||
r = r.substring(r.length() - 2, 2);
|
||||
s1 = s1.substring(s1.length() - 4, s1.length());
|
||||
s2 = s2.substring(s2.length() - 4, s2.length());
|
||||
System.out.println(" r=====>"+r); // 输出格式化后的Date
|
||||
System.out.println(" s1=====>"+s1); // 输出格式化后的Date
|
||||
System.out.println(" s2=====>"+s2); // 输出格式化后的Date
|
||||
// crc32.update(bytes);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
Manifest-Version: 1.0
|
||||
Main-Class:
|
||||
Class-Path: spring-ws-core-3.1.6.jar xmlschema-core-2.2.3.jar java-jwt-4
|
||||
.3.0.jar spring-boot-starter-logging-2.7.11.jar commons-lang3-3.12.0.ja
|
||||
r spring-websocket-5.3.27.jar spring-xml-3.1.6.jar wsdl4j-1.6.3.jar tom
|
||||
cat-embed-websocket-9.0.80.jar japidocs-1.4.4.jar xmlbeans-2.3.0.jar ac
|
||||
tivation-1.1.jar tomcat-annotations-api-9.0.74.jar spring-data-keyvalue
|
||||
-2.7.11.jar javaparser-core-3.6.16.jar jakarta.annotation-api-1.3.5.jar
|
||||
fastjson2-extension-2.0.25.jar classmate-1.5.1.jar mysql-connector-jav
|
||||
a-8.0.23.jar spring-data-commons-2.7.11.jar spring-context-support-5.3.
|
||||
27.jar mybatis-plus-boot-starter-3.5.3.1.jar spring-data-redis-2.7.11.j
|
||||
ar spring-session-data-redis-2.7.1.jar mybatis-plus-core-3.5.3.1.jar lo
|
||||
g4j-api-2.17.2.jar poi-ooxml-3.8.jar stax2-api-3.1.4.jar spring-web-5.3
|
||||
.27.jar axis-1.4.jar mybatisplus-plus-1.7.3-RELEASE.jar slf4j-api-1.7.3
|
||||
6.jar hutool-all-5.8.25.jar cxf-spring-boot-autoconfigure-3.2.5.jar cxf
|
||||
-spring-boot-starter-jaxws-3.2.5.jar lombok-1.18.26.jar spring-ws-suppo
|
||||
rt-3.1.6.jar jackson-databind-2.13.5.jar asm-5.2.jar xml-resolver-1.2.j
|
||||
ar freemarker-2.3.32.jar spring-boot-starter-ws-1.3.3.RELEASE.jar jboss
|
||||
-logging-3.4.3.Final.jar spring-session-core-2.7.1.jar fastjson-2.0.25.
|
||||
jar spring-beans-5.3.27.jar cxf-rt-bindings-soap-3.2.5.jar woodstox-cor
|
||||
e-5.0.3.jar spring-oxm-5.3.27.jar jakarta.validation-api-2.0.2.jar spri
|
||||
ng-boot-starter-2.7.11.jar DmJdbcDriver18-1.8.0.jar hibernate-validator
|
||||
-6.2.0.Final.jar snakeyaml-1.30.jar spring-aop-5.3.27.jar spring-core-5
|
||||
.3.27.jar spring-boot-starter-jdbc-2.7.11.jar jackson-datatype-jsr310-2
|
||||
.13.5.jar cxf-rt-transports-http-3.2.5.jar tomcat-embed-core-9.0.74.jar
|
||||
mybatis-spring-2.0.7.jar cxf-rt-frontend-jaxws-3.2.5.jar mybatis-plus-
|
||||
3.5.3.1.jar spring-boot-2.7.11.jar spring-boot-starter-json-2.7.11.jar
|
||||
mybatis-3.5.10.jar sqljdbc4-3.0.jar cxf-core-3.2.5.jar spring-boot-star
|
||||
ter-web-2.7.11.jar spring-context-5.3.27.jar spring-boot-autoconfigure-
|
||||
2.7.11.jar jsqlparser-4.4.jar cxf-rt-ws-policy-3.2.5.jar javax.mail-1.6
|
||||
.0.jar xml-apis-1.0.b2.jar spring-messaging-5.3.27.jar spring-webmvc-5.
|
||||
3.27.jar jackson-core-2.13.5.jar cxf-rt-frontend-simple-3.2.5.jar commo
|
||||
ns-codec-1.15.jar spring-boot-starter-websocket-2.7.11.jar spring-tx-5.
|
||||
3.27.jar logback-classic-1.2.12.jar spring-session-jdbc-2.7.1.jar mybat
|
||||
is-plus-annotation-3.5.3.1.jar spring-jms-5.3.27.jar spring-jcl-5.3.27.
|
||||
jar cxf-rt-databinding-jaxb-3.2.5.jar jackson-module-parameter-names-2.
|
||||
13.5.jar neethi-3.1.1.jar jackson-annotations-2.13.5.jar cxf-rt-ws-addr
|
||||
-3.2.5.jar log4j-to-slf4j-2.17.2.jar protobuf-java-3.11.4.jar validatio
|
||||
n-api-2.0.1.Final.jar fastjson2-2.0.25.jar jul-to-slf4j-1.7.36.jar myba
|
||||
tis-plus-extension-3.5.3.1.jar EndPassJava-1.0.0.jar spring-jdbc-5.3.27
|
||||
.jar HikariCP-4.0.3.jar logback-core-1.2.12.jar poi-3.8.jar cxf-rt-bind
|
||||
ings-xml-3.2.5.jar stax-api-1.0.1.jar poi-ooxml-schemas-3.8.jar cxf-rt-
|
||||
wsdl-3.2.5.jar custom-spring-boot-resttemplate-1.0.0.jar jackson-dataty
|
||||
pe-jdk8-2.13.5.jar spring-expression-5.3.27.jar dom4j-1.6.1.jar
|
||||
|
||||
@ -0,0 +1,2 @@
|
||||
org.springframework.boot.env.EnvironmentPostProcessor=\
|
||||
com.nmgs.MyEnvironmentPostProcessor
|
||||
Binary file not shown.
@ -0,0 +1,52 @@
|
||||
#\u65E5\u5FD7\u9ED8\u8BA4\u914D\u7F6E
|
||||
spring.logback.appName=WhiteListManageSys
|
||||
spring.logback.level=INFO
|
||||
spring.logback.myMaxHistory=30
|
||||
spring.logback.myFileSize=10MB
|
||||
spring.logback.myTotalSizeCap=2GB
|
||||
#\u7F16\u7801\u8BBE\u7F6E
|
||||
server.servlet.encoding.charset=UTF-8
|
||||
server.servlet.encoding.enabled=true
|
||||
server.servlet.encoding.force=true
|
||||
spring.messages.encoding=UTF-8
|
||||
spring.profiles.active=dev
|
||||
# \u8FDE\u63A5\u6C60\u914D\u7F6E
|
||||
spring.datasource.hikari.maximum-pool-size=25
|
||||
spring.datasource.hikari.auto-commit=true
|
||||
spring.datasource.hikari.idle-timeout=0
|
||||
spring.datasource.hikari.pool-name=DatebookHikariCP
|
||||
spring.datasource.hikari.max-lifetime=600000
|
||||
spring.datasource.hikari.connection-timeout=3600000
|
||||
spring.datasource.hikari.minimum-idle=1
|
||||
spring.datasource.hikari.allow-pool-suspension=true
|
||||
spring.datasource.hikari.register-mbeans=true
|
||||
spring.datasource.hikari.leak-detection-threshold=600000
|
||||
spring.devtools.restart.enabled=true
|
||||
spring.devtools.restart.additional-paths=src/main
|
||||
spring.session.store-type=none
|
||||
#spring-session
|
||||
spring.session.timeout=PT30M
|
||||
spring.sql.init.mode=always
|
||||
#\u89E3\u9664\u6587\u4EF6\u4E0A\u4F20\u5927\u5C0F\u9650\u5236
|
||||
spring.servlet.multipart.enabled=true
|
||||
spring.servlet.multipart.max-file-size=-1
|
||||
spring.servlet.multipart.max-request-size=-1
|
||||
server.tomcat.max-swallow-size=-1
|
||||
server.tomcat.max-threads=1000
|
||||
#mybatis-plus\u6253\u5370SQL\u8BED\u53E5
|
||||
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
logging.level.com.nmgs.ssmpback.mapper=debug
|
||||
logging.level.com.baomidou.mybatisplus.core.mapper=ERROR
|
||||
#\u81EA\u5B9A\u4E49\u9ED8\u8BA4\u914D\u7F6E
|
||||
sqlClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
sqlvalidationQuery=SELECT 1
|
||||
OracleClassName=oracle.jdbc.driver.OracleDriver
|
||||
OraclevalidationQuery=SELECT 1 FROM DUAL
|
||||
DMClassName=dm.jdbc.driver.DmDriver
|
||||
DMvalidationQuery=SELECT 1
|
||||
#MySQLClassName=com.mysql.jdbc.Driver
|
||||
MySQLClassName=com.goldendb.jdbc.Driver
|
||||
MySQLvalidationQuery=SELECT 1
|
||||
MySQLGOADENDBClassName=com.goldendb.jdbc.Driver
|
||||
MySQLGOADENDBvalidationQuery=SELECT 1
|
||||
spring.web.resources.static-locations= classpath:/static/View/
|
||||
Loading…
Reference in New Issue