kchh
parent
3fe8f3209a
commit
a885435154
|
@ -0,0 +1,20 @@
|
||||||
|
#FROM openjdk:8
|
||||||
|
##adoptopenjdk/openjdk8:ubi
|
||||||
|
#LABEL name="docker" version="1.0.0" author="wsnet" maintainer="wsnet@wsmis.com"
|
||||||
|
#COPY target/com.haitongauto.rtosam.jar rtosam-image.jar
|
||||||
|
#CMD ["java","-jar","rtosam-image.jar"]
|
||||||
|
|
||||||
|
|
||||||
|
FROM openjdk:8
|
||||||
|
#adoptopenjdk/openjdk8:ubi
|
||||||
|
LABEL name="docker" version="1.0.0" author="wsnet" maintainer="wsnet@wsmis.com"
|
||||||
|
COPY target/com.haitongauto.rtosam.jar rtosam-image.jar
|
||||||
|
|
||||||
|
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
||||||
|
RUN echo 'Asia/Shanghai' >/etc/timezone
|
||||||
|
EXPOSE 8083
|
||||||
|
|
||||||
|
ENV PROFILES_OPTS=""
|
||||||
|
ENV JAVA_OPTS=""
|
||||||
|
|
||||||
|
ENTRYPOINT [ "sh", "-c","java $PROFILES_OPTS $JAVA_OPTS -jar rtosam-image.jar" ]
|
|
@ -0,0 +1,5 @@
|
||||||
|
FROM openjdk:8
|
||||||
|
#adoptopenjdk/openjdk8:ubi
|
||||||
|
LABEL name="docker" version="1.0.0" author="wsnet" maintainer="wsnet@wsmis.com"
|
||||||
|
COPY target/com.haitongauto.rtosam.jar rtosam-image.jar
|
||||||
|
CMD ["java","-jar","rtosam-image.jar"]
|
|
@ -0,0 +1,247 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<artifactId>rtos-wh</artifactId>
|
||||||
|
<groupId>org.example</groupId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>wx-applet-admin</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mybatis.spring.boot</groupId>
|
||||||
|
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||||
|
<version>2.2.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 配置 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.postgresql</groupId>
|
||||||
|
<artifactId>postgresql</artifactId>
|
||||||
|
<version>42.2.2</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>1.18.20</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>fastjson</artifactId>
|
||||||
|
<version>1.2.7</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.lowagie</groupId>
|
||||||
|
<artifactId>itext</artifactId>
|
||||||
|
<version>2.0.8</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.pdfbox</groupId>
|
||||||
|
<artifactId>pdfbox</artifactId>
|
||||||
|
<version>2.0.19</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<version>2.6.6</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 分页插件 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.pagehelper</groupId>
|
||||||
|
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||||
|
<version>1.4.2</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.pagehelper</groupId>
|
||||||
|
<artifactId>pagehelper</artifactId>
|
||||||
|
<version>5.3.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.bestvike</groupId>
|
||||||
|
<artifactId>linq</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.example</groupId>
|
||||||
|
<artifactId>models</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.example</groupId>
|
||||||
|
<artifactId>utils</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.example</groupId>
|
||||||
|
<artifactId>mapper</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.example</groupId>
|
||||||
|
<artifactId>interfaces</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.nuzar</groupId>
|
||||||
|
<artifactId>nuzar-security</artifactId>
|
||||||
|
<version>2.6.14.10-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<!--哪吒组件1-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.nuzar</groupId>
|
||||||
|
<artifactId>rtops-openapi-client</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
<!--哪吒组件2-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.nuzar</groupId>
|
||||||
|
<artifactId>nuzar-security</artifactId>
|
||||||
|
<version>2.6.14.10-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
<!--哪吒组件依赖-1-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.security</groupId>
|
||||||
|
<artifactId>spring-security-web</artifactId>
|
||||||
|
<version>5.6.9</version>
|
||||||
|
</dependency>
|
||||||
|
<!--哪吒组件依赖-2-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.security</groupId>
|
||||||
|
<artifactId>spring-security-config</artifactId>
|
||||||
|
<version>5.6.9</version>
|
||||||
|
</dependency>
|
||||||
|
<!--哪吒组件依赖-3-->
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-oauth2-resource-server -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
|
||||||
|
<version>2.6.14</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-oauth2-client -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-oauth2-client</artifactId>
|
||||||
|
<version>2.6.14</version>
|
||||||
|
</dependency>
|
||||||
|
<!--哪吒组件依赖-4-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.security</groupId>
|
||||||
|
<artifactId>spring-security-oauth2-resource-server</artifactId>
|
||||||
|
<version>5.6.9</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.security</groupId>
|
||||||
|
<artifactId>spring-security-oauth2-client</artifactId>
|
||||||
|
<version>5.6.9</version>
|
||||||
|
</dependency>
|
||||||
|
<!--哪吒组件依赖-5-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.security</groupId>
|
||||||
|
<artifactId>spring-security-core</artifactId>
|
||||||
|
<version>5.6.9</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
||||||
|
<!-- <version>3.0.6</version>-->
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
|
||||||
|
<!-- <version>4.0.3</version>-->
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>top.jfunc.json</groupId>
|
||||||
|
<artifactId>Json-Gson</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>top.jfunc.json</groupId>
|
||||||
|
<artifactId>Json-Gson</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>top.jfunc.json</groupId>
|
||||||
|
<artifactId>Json-Gson</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.owasp.encoder</groupId>
|
||||||
|
<artifactId>encoder</artifactId>
|
||||||
|
<version>1.2.3</version> <!-- 替换为最新版本 -->
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-text</artifactId>
|
||||||
|
<version>1.9</version> <!-- 替换为当前版本 -->
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<finalName>com.haitongauto.rtosam</finalName>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<version>2.2.2.RELEASE</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>repackage</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<version>3.2.1</version>
|
||||||
|
|
||||||
|
<configuration>
|
||||||
|
<!--添加该配置,上面的yaml的智能补全将禁止编译打包到目标项目-->
|
||||||
|
<excludes>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||||
|
</excludes>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.haitongauto.rtosam;
|
||||||
|
|
||||||
|
import com.haitongauto.rtosam.job.FileDeleteJob;
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||||
|
|
||||||
|
@MapperScan("com.haitongauto.mapper")
|
||||||
|
@EnableFeignClients(basePackages = {"com.haitongauto.interfaces"})
|
||||||
|
@SpringBootApplication(scanBasePackages = {"com.haitongauto.interfaces","com.haitongauto.rtosam"})
|
||||||
|
public class ApplicationAppletAdmin {
|
||||||
|
/**
|
||||||
|
* 启动微信小程序后台管理系统服务
|
||||||
|
* @param args args
|
||||||
|
*/
|
||||||
|
public static void main(String[] args){
|
||||||
|
SpringApplication.run(ApplicationAppletAdmin.class,args);
|
||||||
|
//启动文件删除定时任务
|
||||||
|
//FileDeleteJob fileDeleteJob=new FileDeleteJob();
|
||||||
|
//fileDeleteJob.doFileDeleteJob();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,49 @@
|
||||||
|
package com.haitongauto.rtosam;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
|
||||||
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拦截器的属性配置
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
@ConditionalOnClass(WebMvcConfigurer.class)
|
||||||
|
public class InterceptorConfiguration implements WebMvcConfigurer {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ObjectMapper objectMapper;
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
public void EnumObjectMapper() {
|
||||||
|
// 解决enum不匹配问题 默认值为false
|
||||||
|
objectMapper.configure(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权限验证过滤器
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public PermInterceptor permInterceptor() {
|
||||||
|
return new PermInterceptor();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@ConditionalOnBean(PermInterceptor.class)
|
||||||
|
public void addInterceptors(InterceptorRegistry registry) {
|
||||||
|
// 拦截器
|
||||||
|
InterceptorRegistration registration = registry.addInterceptor(permInterceptor());
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,116 @@
|
||||||
|
package com.haitongauto.rtosam;
|
||||||
|
|
||||||
|
import com.haitongauto.interfaces.UsersApi;
|
||||||
|
import com.haitongauto.models.ido.login.UserInfoRes;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.BeanFactory;
|
||||||
|
import org.springframework.util.AntPathMatcher;
|
||||||
|
import org.springframework.web.context.support.WebApplicationContextUtils;
|
||||||
|
import org.springframework.web.servlet.HandlerInterceptor;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权限过滤器
|
||||||
|
*/
|
||||||
|
public class PermInterceptor implements HandlerInterceptor {
|
||||||
|
public static final String[] SWAGGER_EXCLUDE_PATHS = {"/doc.html", "/swagger-resources/**", "/webjars/**", "/v2/**", "/favicon.ico", "/swagger-ui.htmL/**", "/health/ping"};
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||||
|
String uri = request.getRequestURI();
|
||||||
|
AntPathMatcher antPathMatcher = new AntPathMatcher();
|
||||||
|
for (String p : SWAGGER_EXCLUDE_PATHS) {
|
||||||
|
if (antPathMatcher.match(p, uri)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//判断是否登录
|
||||||
|
String userId = "";
|
||||||
|
String username = "";
|
||||||
|
// 小程序mini-app, 客户平台customer,app端app,pad端pad,海通后台web
|
||||||
|
try {
|
||||||
|
BeanFactory factory = WebApplicationContextUtils.getRequiredWebApplicationContext(request.getServletContext());
|
||||||
|
//老系统同步新系统 没有token(直接放过)
|
||||||
|
// if (StringUtils.equalsAny(request.getRequestURI(), "/appointment/execTruckOrderNsFin")) {
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
UsersApi openApi = factory.getBean(UsersApi.class);
|
||||||
|
UserInfoRes info = openApi.getUserInfo().getData();
|
||||||
|
if (StringUtils.equalsIgnoreCase(info.getMediaType(), "customer") && StringUtils.equalsAny(request.getRequestURI()
|
||||||
|
, "/admin/AnnouncementInfo"
|
||||||
|
, "/admin/QueryOperateIntroductionBySort"
|
||||||
|
, "/admin/AnnouncementListForCondition"
|
||||||
|
)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StringUtils.equalsIgnoreCase(info.getMediaType(), "app")
|
||||||
|
|| StringUtils.equalsIgnoreCase(info.getMediaType(), "pad")
|
||||||
|
|| StringUtils.equalsIgnoreCase(info.getMediaType(), "web")) {
|
||||||
|
return true;
|
||||||
|
} else if (StringUtils.equalsIgnoreCase(info.getMediaType(), "mini-app")) {
|
||||||
|
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
|
||||||
|
// 可以设置响应体
|
||||||
|
response.getWriter().write("Access Forbidden");
|
||||||
|
return false;
|
||||||
|
} else if (StringUtils.equalsIgnoreCase(info.getMediaType(), "customer")) {
|
||||||
|
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
|
||||||
|
// 可以设置响应体
|
||||||
|
response.getWriter().write("Access Forbidden");
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
|
||||||
|
// 可以设置响应体
|
||||||
|
response.getWriter().write("Access Forbidden");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
// response.setStatus(HttpServletResponse.SC_FORBIDDEN);
|
||||||
|
// // 可以设置响应体
|
||||||
|
// response.getWriter().write("Access Forbidden");
|
||||||
|
// return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
|
||||||
|
// UserContext.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否有权限
|
||||||
|
* 1.从请求头中获取token
|
||||||
|
*
|
||||||
|
* 2.通过token从redis中获取当前登录对象(object)
|
||||||
|
*
|
||||||
|
* 3.通过对象查询数据库是否存在当前对象
|
||||||
|
*
|
||||||
|
* 4.获取登录对象的登录名 判断是否是(admin或者总经理)这两个账号拥有最高权限
|
||||||
|
*
|
||||||
|
* 5.判断是否被授权,(获取临时授权时设置的开始时间,结束时间,当前时间),
|
||||||
|
*
|
||||||
|
* 获取这个三个时间的时间戳,判断当前时间是否在开始时间和结束时间之间
|
||||||
|
*
|
||||||
|
* 如果开始时间和结束时间为空的话表示当前登录对象未被临时授权,会执行后面的 4,5,6,
|
||||||
|
*
|
||||||
|
* 如果有时间,但是当前时间不在这个时间段也会执行 4,5,6
|
||||||
|
*
|
||||||
|
* 如果有时间,并且当前时间在这个时间段之中,就会直接返回true
|
||||||
|
*
|
||||||
|
* 6.从请求头中获取当前接口的地址,
|
||||||
|
*
|
||||||
|
* 7.通过当前登录对象的id查询权限
|
||||||
|
*
|
||||||
|
* 8.判断当前登录对象的权限中是否包含当前接口的地址,如果包含,允许当前登录对象访问,如果不包含,则不允许当前登录人访问
|
||||||
|
* ————————————————
|
||||||
|
* 版权声明:本文为CSDN博主「原你是阳光(#`O′)」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
|
||||||
|
* 原文链接:https://blog.csdn.net/weixin_58696998/article/details/124663181
|
||||||
|
* @param request
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.haitongauto.rtosam.api;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/health")
|
||||||
|
public class HeathCheckController {
|
||||||
|
|
||||||
|
@GetMapping("/ping")
|
||||||
|
public String ping() {
|
||||||
|
return "pong";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,270 @@
|
||||||
|
package com.haitongauto.rtosam.api.admin;
|
||||||
|
|
||||||
|
import com.haitongauto.models.dto.AnnouncementsDto;
|
||||||
|
import com.haitongauto.models.pojo.Announcement;
|
||||||
|
import com.haitongauto.rtosam.service.admin.AnnouncementAdminService;
|
||||||
|
import com.haitongauto.rtosam.service.admin.ResponseService;
|
||||||
|
import com.haitongauto.rtosam.service.base.AnnouncementService;
|
||||||
|
import com.haitongauto.models.dto.Pages;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.haitongauto.utils.StringHelper;
|
||||||
|
import org.apache.commons.lang3.StringEscapeUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 后台管理接口:公告管理
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/admin")
|
||||||
|
public class AnnouncementAdminController {
|
||||||
|
@Autowired
|
||||||
|
ResponseService response;
|
||||||
|
@Autowired
|
||||||
|
AnnouncementAdminService announcementAdminService;
|
||||||
|
@Autowired
|
||||||
|
AnnouncementService announcementService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发布人员(作者)去重列表
|
||||||
|
*
|
||||||
|
* @return 返回去重后的作者列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getAuthorList")
|
||||||
|
public String getAuthorList() {
|
||||||
|
// 获取去重后的发布人(作者/操作员)列表数据
|
||||||
|
List<String> authorList = announcementAdminService.getAuthorList();
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = authorList != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("AuthorList", authorList);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据特定条件查询历史公告
|
||||||
|
*
|
||||||
|
* @param tilKeywords:标题关键字
|
||||||
|
* @param releaseDate:发布日期范围(YYYY-MM-DD - YYYY-MM-DD)备注:日期范围分隔符" - "必须两边留一个空格
|
||||||
|
* @param sort:类别(1-小程序,2-客服平台)
|
||||||
|
* @param authors:作者/发布人/操作员 return 返回历史公告列表数据
|
||||||
|
*/
|
||||||
|
@RequestMapping("/AnnouncementListForCondition")
|
||||||
|
public String announcementListForCondition(String tilKeywords, String releaseDate, Integer sort, String authors, Pages pages) {
|
||||||
|
//拆分日期范围
|
||||||
|
String dateStart = null;
|
||||||
|
String dateEnd = null;
|
||||||
|
if (releaseDate != null && !releaseDate.isEmpty()) {
|
||||||
|
String[] dates = releaseDate.split("\\|");
|
||||||
|
if (dates.length > 0) {
|
||||||
|
dateStart = dates[0];
|
||||||
|
dateEnd = dates[0];
|
||||||
|
if (dates.length == 2) {
|
||||||
|
dateEnd = dates[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//解析分页参数
|
||||||
|
Integer pageNum = (pages != null && pages.getPageNum() != null && pages.getPageNum() > 0) ? pages.getPageNum() : 1;
|
||||||
|
Integer pageSize = (pages != null && pages.getPageSize() != null && pages.getPageSize() > 0) ? pages.getPageSize() : 10;
|
||||||
|
|
||||||
|
//调用Service分页方法,获取分页数据对象 PageInfo
|
||||||
|
PageInfo<Announcement> pagesInfo = announcementAdminService.AnnouncementListForCondition(tilKeywords, dateStart, dateEnd, sort, authors, pageNum, pageSize);
|
||||||
|
|
||||||
|
//读取分页结果
|
||||||
|
Integer pageCount = pagesInfo.getPages(); //总页数
|
||||||
|
long recordTotal = pagesInfo.getTotal(); //记录总数
|
||||||
|
List<Announcement> myList = pagesInfo.getList(); //当前页的列表数据
|
||||||
|
|
||||||
|
List<AnnouncementsDto> announcementsDtoList = new ArrayList<>();
|
||||||
|
if (myList != null && myList.size() > 0) {
|
||||||
|
//当前页的列表数据
|
||||||
|
announcementsDtoList = announcementAdminService.AnnouncementListConvert(myList);
|
||||||
|
|
||||||
|
}
|
||||||
|
//分页数据添加到pages
|
||||||
|
assert pages != null;
|
||||||
|
pages.setPageCount(pageCount);
|
||||||
|
pages.setRecordTotal(recordTotal);
|
||||||
|
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = myList != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("AnnouncementsList", announcementsDtoList);
|
||||||
|
data.put("Pages", pages);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据特定条件查询历史公告
|
||||||
|
* return 返回历史公告列表数据
|
||||||
|
*/
|
||||||
|
@RequestMapping("/AnnouncementListForWeek")
|
||||||
|
public String AnnouncementListForWeek() {
|
||||||
|
List<Announcement> myList = announcementAdminService.AnnouncementListForWeek();
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = true;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("AnnouncementsList", myList);
|
||||||
|
//添加到返回对象
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告详情
|
||||||
|
*
|
||||||
|
* @param announcement_id : 公告id
|
||||||
|
* @return 公告详情
|
||||||
|
*/
|
||||||
|
@RequestMapping("/AnnouncementInfo")
|
||||||
|
public String announcementInfo(@RequestParam("announcement_id") String announcement_id) {
|
||||||
|
String msg = "";
|
||||||
|
if (announcement_id == null || announcement_id.isEmpty()) {
|
||||||
|
msg = "公告id不能为空";
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data, msg);
|
||||||
|
}
|
||||||
|
Announcement announcements = announcementService.getById(announcement_id);
|
||||||
|
AnnouncementsDto announcementsDto = new AnnouncementsDto();
|
||||||
|
if (announcements != null) {
|
||||||
|
announcementsDto.setId(announcements.getId());
|
||||||
|
announcementsDto.setTitle(announcements.getTitle());
|
||||||
|
announcementsDto.setSort(announcements.getSort());
|
||||||
|
if (announcements.getSort() != null) {
|
||||||
|
switch (announcements.getSort()) {
|
||||||
|
case 1:
|
||||||
|
announcementsDto.setSort_name("小程序");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
announcementsDto.setSort_name("客服平台");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
announcementsDto.setAbstracts(announcements.getAbstracts());
|
||||||
|
String content = announcements.getAnnouncement();
|
||||||
|
if (content != null && !content.isEmpty()) {
|
||||||
|
String decodedHtml = StringEscapeUtils.unescapeHtml4(content);
|
||||||
|
announcementsDto.setAnnouncement(decodedHtml);
|
||||||
|
announcementsDto.setAnnouncement_text(StringHelper.getTxtByHtml(decodedHtml));
|
||||||
|
}
|
||||||
|
announcementsDto.setAuthor(announcements.getAuthor());
|
||||||
|
announcementsDto.setReading_volume(announcements.getReading_volume());
|
||||||
|
if (announcements.getCreate_time() != null) {
|
||||||
|
announcementsDto.setCreate_time(announcements.getCreate_time());
|
||||||
|
}
|
||||||
|
if (announcements.getUpdate_time() != null) {
|
||||||
|
announcementsDto.setUpdate_time(announcements.getUpdate_time());
|
||||||
|
}
|
||||||
|
announcementsDto.setIs_del(announcements.getIs_del());
|
||||||
|
}
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = announcements != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("Announcements", announcementsDto);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存修改
|
||||||
|
*
|
||||||
|
* @param announcement 公告
|
||||||
|
* @return 保存修改结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/AnnouncementUpdate")
|
||||||
|
public String announcementUpdate(Announcement announcement) {
|
||||||
|
String announcementStr = announcement.getAnnouncement();
|
||||||
|
if (announcementStr != null && !announcementStr.isEmpty()) {
|
||||||
|
//对参数值进行 XSS 过滤
|
||||||
|
//String encodedValue = ESAPI.encoder().encodeForHTML(announcementStr);
|
||||||
|
//String safeComment = Encode.forHtml(announcementStr);
|
||||||
|
//announcement.setAnnouncement(safeComment);
|
||||||
|
}
|
||||||
|
announcement.setIs_del(0);
|
||||||
|
Integer x = announcementService.update(announcement);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x > 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("result", x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增发布
|
||||||
|
*
|
||||||
|
* @param announcement 公告
|
||||||
|
* @return 返回公告插入结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/AnnouncementsInsert")
|
||||||
|
public String announcementsInsert(Announcement announcement) {
|
||||||
|
String announcementStr = announcement.getAnnouncement();
|
||||||
|
if (announcementStr != null && !announcementStr.isEmpty()) {
|
||||||
|
//String safeComment = Encode.forHtml(announcementStr);
|
||||||
|
//announcement.setAnnouncement(safeComment);
|
||||||
|
}
|
||||||
|
announcement.setIs_del(0);
|
||||||
|
announcement.setReading_volume(0);
|
||||||
|
String id = announcementService.insert(announcement);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = id != null && !id.isEmpty();
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("result", id);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除一条公告
|
||||||
|
*
|
||||||
|
* @param announcement_id 公告id
|
||||||
|
* @return 返回删除一条公告结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/AnnouncementDel")
|
||||||
|
public String announcementDel(@RequestParam("announcement_id") String announcement_id) {
|
||||||
|
String msg = "";
|
||||||
|
if (announcement_id == null || announcement_id.isEmpty()) {
|
||||||
|
msg = "公告id不能为空";
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data, msg);
|
||||||
|
}
|
||||||
|
Integer x = announcementService.logicDel(announcement_id);
|
||||||
|
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("result", x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,275 @@
|
||||||
|
package com.haitongauto.rtosam.api.admin;
|
||||||
|
|
||||||
|
import com.bestvike.linq.Linq;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.haitongauto.interfaces.DicInterface;
|
||||||
|
import com.haitongauto.interfaces.PortAreaInterface;
|
||||||
|
import com.haitongauto.models.dto.AppointmentQueryExl;
|
||||||
|
import com.haitongauto.models.dto.DicDto;
|
||||||
|
import com.haitongauto.models.pojo.*;
|
||||||
|
import com.haitongauto.rtosam.service.admin.AppointmentAdminService;
|
||||||
|
import com.haitongauto.rtosam.service.admin.ResponseService;
|
||||||
|
import com.haitongauto.rtosam.service.base.AppointmentService;
|
||||||
|
import com.haitongauto.models.dto.AppointmentQuery;
|
||||||
|
import com.haitongauto.models.dto.Pages;
|
||||||
|
|
||||||
|
import com.haitongauto.rtosam.service.base.UsersService;
|
||||||
|
import com.haitongauto.utils.FileDownloadUtil;
|
||||||
|
import com.haitongauto.utils.FormatDateTime;
|
||||||
|
import com.haitongauto.utils.excel.ExcelGenerateHelper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 后台管理接口:车辆预约
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/admin")
|
||||||
|
public class AppointmentAdminController {
|
||||||
|
@Autowired
|
||||||
|
ResponseService response;
|
||||||
|
@Autowired
|
||||||
|
AppointmentAdminService appointmentAdminService;
|
||||||
|
@Autowired
|
||||||
|
AppointmentService appointmentService;
|
||||||
|
@Autowired
|
||||||
|
UsersService usersService;
|
||||||
|
@Autowired
|
||||||
|
DicInterface dicInterface;
|
||||||
|
@Autowired
|
||||||
|
PortAreaInterface portAreaInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆预约:通过港区、司机关键字、预约时间范围、进港类型、状态(1-已预约,0-已取消)、运输方式(0-自开/1-板车运输)单独或组合查询
|
||||||
|
*
|
||||||
|
* @param port_area_id:港区id
|
||||||
|
* @param keywords:关键字(姓名、手机号、板车号)
|
||||||
|
* @param start_date:时间范围开始
|
||||||
|
* @param end_date:时间范围结束
|
||||||
|
* @param enter_type:进港类型(1-外贸出口,2-外贸进口,2-整车物流,3-特保区出口,4-特保区进口,5-内贸出口,6-内贸进口)
|
||||||
|
* @param appointment_state:预约状态(0-已取消,1-已预约)
|
||||||
|
* @param transport_type:运输方式(0-自开/1-板车运)
|
||||||
|
* @param pages:分页参数(pagesNum:当前页码,pagesSize:每页记录条数)
|
||||||
|
* @return 返回条件查询分页预约信息
|
||||||
|
*/
|
||||||
|
@RequestMapping("/AppointmentListForCondition")
|
||||||
|
public String appointmentListForCondition(String users_id, String port_area_id, String keywords, String start_date, String end_date, String enter_type, Integer appointment_state, String transport_type, Pages pages) {
|
||||||
|
//解析分页参数
|
||||||
|
Integer pageNum = (pages != null && pages.getPageNum() != null && pages.getPageNum() > 0) ? pages.getPageNum() : 1;
|
||||||
|
Integer pageSize = (pages != null && pages.getPageSize() != null && pages.getPageSize() > 0) ? pages.getPageSize() : 10;
|
||||||
|
|
||||||
|
//调用Service分页方法,获取分页数据对象 PageInfo
|
||||||
|
PageInfo<Appointment> pageInfo = appointmentAdminService.AppointmentListForCondition(users_id, port_area_id, keywords, start_date, end_date, enter_type, appointment_state, transport_type, pageNum, pageSize);
|
||||||
|
|
||||||
|
//读取分页结果
|
||||||
|
Integer pageCount = pageInfo.getPages(); //总页数
|
||||||
|
long recordTotal = pageInfo.getTotal(); //记录总数
|
||||||
|
List<Appointment> myList = pageInfo.getList(); //当前页的列表数据
|
||||||
|
List<AppointmentQuery> AppointmentList = new ArrayList<>();
|
||||||
|
if (pageNum <= pageCount) {
|
||||||
|
//转换为列表显示数据
|
||||||
|
AppointmentList = appointmentAdminService.AppointmentListConvert(myList);
|
||||||
|
}
|
||||||
|
|
||||||
|
//分页数据添加到pages
|
||||||
|
assert pages != null;
|
||||||
|
pages.setPageCount(pageCount);
|
||||||
|
pages.setRecordTotal(recordTotal);
|
||||||
|
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = myList != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("AppointmentList", AppointmentList);
|
||||||
|
data.put("Pages", pages);
|
||||||
|
//添加到返回对象
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取指定预约的货物明细
|
||||||
|
*
|
||||||
|
* @param appointment_id 预约id
|
||||||
|
* @return 返回预约的货物明细
|
||||||
|
*/
|
||||||
|
@RequestMapping("/appointmentGoodsDetail")
|
||||||
|
public String appointmentGoodsDetail(@RequestParam("appointment_id") String appointment_id) {
|
||||||
|
String msg = "";
|
||||||
|
if (appointment_id == null || appointment_id.isEmpty()) {
|
||||||
|
msg = "预约id不能为空";
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data, msg);
|
||||||
|
}
|
||||||
|
Appointment appointment = appointmentService.getById(appointment_id);
|
||||||
|
//1-司机信息
|
||||||
|
Map<Object, Object> driverInfo = new HashMap<>();
|
||||||
|
if (appointment != null) {
|
||||||
|
driverInfo.put("truck_number", appointment.getTruck_number());//板车号
|
||||||
|
driverInfo.put("tel_number", appointment.getTel_number());//司机手机
|
||||||
|
driverInfo.put("head_frame_number", appointment.getTruck_vin());//车头车架号
|
||||||
|
driverInfo.put("vehicle_weight", appointment.getVehicle_weight());//板车自重
|
||||||
|
driverInfo.put("driving_license", appointment.getDriving_license());//行驶证
|
||||||
|
//司机名称
|
||||||
|
Users users = usersService.getById(appointment.getUsers_id());
|
||||||
|
if (users != null) {
|
||||||
|
driverInfo.put("users_name", users.getUsers_name());
|
||||||
|
} else {
|
||||||
|
driverInfo.put("users_name", null);
|
||||||
|
}
|
||||||
|
//预约与取消时间
|
||||||
|
if (appointment.getApproach_date() != null) {
|
||||||
|
//预约时间
|
||||||
|
driverInfo.put("appointment_time", appointment.getApproach_date());
|
||||||
|
} else {
|
||||||
|
driverInfo.put("appointment_time", null);//预约时间'
|
||||||
|
}
|
||||||
|
//取消时间
|
||||||
|
if (appointment.getCancel_time() != null) {
|
||||||
|
driverInfo.put("cancel_appointment_time", appointment.getCancel_time());
|
||||||
|
} else {
|
||||||
|
driverInfo.put("cancel_appointment_time", null);
|
||||||
|
}
|
||||||
|
//-预约状态(1-已预约,2-已签到,3-已进港,5-操作中,6-已完成,7-已离港,4-已取消,9-异常:预期未完成操作的);
|
||||||
|
switch (appointment.getAppointment_state()) {
|
||||||
|
case 1:
|
||||||
|
driverInfo.put("appointment_state", "已预约");//预约状态
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
driverInfo.put("appointment_state", "已签到");//预约状态
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
driverInfo.put("appointment_state", "已进港");//预约状态
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
driverInfo.put("appointment_state", "已取消");//预约状态
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
driverInfo.put("appointment_state", "作业中");//预约状态
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
driverInfo.put("appointment_state", "已完成");//预约状态
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
driverInfo.put("appointment_state", "已离港");//预约状态
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
driverInfo.put("appointment_state", "异常:预期未完成操作的");//预约状态
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//2-预约信息
|
||||||
|
Map<Object, Object> appointmentInfo = new HashMap<>();
|
||||||
|
if (appointment != null) {
|
||||||
|
if (appointment.getApproach_date() != null) {
|
||||||
|
appointmentInfo.put("approach_date", appointment.getApproach_date());//-预约进场日期
|
||||||
|
}
|
||||||
|
appointmentInfo.put("transport_type", appointment.getTransport_type());//运输方式Id
|
||||||
|
List<DicDto> dicDtoList = dicInterface.getDicList("TRANSPORT_TYPE");
|
||||||
|
if (dicDtoList != null) {
|
||||||
|
DicDto transportType = Linq.of(dicDtoList).firstOrDefault(p -> p.getId().equals(appointment.getTransport_type()));
|
||||||
|
if (transportType != null) {
|
||||||
|
appointmentInfo.put("transport_type_name", transportType.getText());//运输方式;
|
||||||
|
} else {
|
||||||
|
appointmentInfo.put("transport_type_name", null);//运输方式;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
appointmentInfo.put("pam_id", appointment.getPort_area_id());//进港港区Id;
|
||||||
|
List<PortArea> portAreaList = portAreaInterface.getPortArea();
|
||||||
|
if (portAreaList != null) {
|
||||||
|
PortArea portArea = Linq.of(portAreaList).firstOrDefault(p -> p.getId().equals(appointment.getPort_area_id()));
|
||||||
|
if (portArea != null) {
|
||||||
|
appointmentInfo.put("port_area", portArea.getPort_area_name());//进港港区;
|
||||||
|
} else {
|
||||||
|
appointmentInfo.put("port_area", null);//进港港区;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
appointmentInfo.put("enter_port_type", appointment.getEnter_type());//进港类型Id;
|
||||||
|
List<DicDto> enterTypeList = dicInterface.getDicList("ENTER_PORT_TYPE");
|
||||||
|
if (enterTypeList != null) {
|
||||||
|
DicDto enterPortType = Linq.of(enterTypeList).firstOrDefault(p -> p.getId().equals(appointment.getEnter_type()));
|
||||||
|
if (enterPortType != null) {
|
||||||
|
appointmentInfo.put("enter_port_type_name", enterPortType.getText());//进港类型;
|
||||||
|
} else {
|
||||||
|
appointmentInfo.put("enter_port_type_name", null);//进港类型;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
appointmentInfo.put("goods_quantity", appointment.getGoods_quantity());//货物数量;
|
||||||
|
}
|
||||||
|
|
||||||
|
//3-明细信息
|
||||||
|
List<AppointmentDetail> appointmentDetails = appointmentAdminService.appointmentGoodsDetail(appointment_id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = appointmentDetails != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("appointment_id", appointment_id);
|
||||||
|
data.put("driverInfo", driverInfo);
|
||||||
|
data.put("appointmentInfo", appointmentInfo);
|
||||||
|
data.put("AppointmentDetailList", appointmentDetails);
|
||||||
|
//添加到返回对象
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆预约导出
|
||||||
|
* @param ids 预约ids
|
||||||
|
* @param response response
|
||||||
|
*/
|
||||||
|
//@PostMapping("/AppointmentListExporty")后期改为post请求(王琛要求提醒)
|
||||||
|
@GetMapping("/AppointmentListExporty")
|
||||||
|
public void appointmentListExporty(String ids, HttpServletResponse response) {
|
||||||
|
//调用Service分页方法,获取分页数据对象 PageInfo
|
||||||
|
List<Appointment> myList = null;
|
||||||
|
if (ids != null && !ids.isEmpty()) {
|
||||||
|
List<String> idlist = Linq.of(ids.split(",")).toList();
|
||||||
|
myList = appointmentAdminService.AppointmentListExportyByIds(idlist);
|
||||||
|
}
|
||||||
|
//转换为列表显示数据
|
||||||
|
List<AppointmentQueryExl> AppointmentList = appointmentAdminService.AppointmentListConvert1(myList);
|
||||||
|
//昨天日期文件夹
|
||||||
|
String yesTodayStr = FormatDateTime.getYesTodayStr();
|
||||||
|
String yesTodayFilePath = "wx-applet-admin/src/main/resources/static/doc/exl/" + yesTodayStr + "/";
|
||||||
|
File yesTodayFolders = new File(yesTodayFilePath);
|
||||||
|
//如果存在,则删除昨天日期文件夹
|
||||||
|
if (yesTodayFolders.exists()) {
|
||||||
|
boolean b = yesTodayFolders.delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
//今日日期文件夹
|
||||||
|
String todayStrStr = FormatDateTime.getTodayStr();
|
||||||
|
String todayFilePath = "wx-applet-admin/src/main/resources/static/doc/exl/" + todayStrStr + "/";
|
||||||
|
File todayFolders = new File(todayFilePath);
|
||||||
|
//如果不存在,创建日期文件夹
|
||||||
|
if (!todayFolders.exists()) {
|
||||||
|
boolean b = todayFolders.mkdirs();
|
||||||
|
}
|
||||||
|
//调用导出方法
|
||||||
|
String fileName = ExcelGenerateHelper.outPutExcelReturnFileName(AppointmentList, AppointmentQueryExl.class, todayFilePath);
|
||||||
|
InputStream inputStream = FileDownloadUtil.fileToInputStream(fileName);
|
||||||
|
|
||||||
|
//将文件流返回客户端
|
||||||
|
FileDownloadUtil.writeFile(response, inputStream);
|
||||||
|
|
||||||
|
//判断请求是否成功
|
||||||
|
// Boolean bl = (myList != null) ? true : false;
|
||||||
|
// //创建返回数据data
|
||||||
|
// Map<String, Object> data = new HashMap<>();
|
||||||
|
// data.put("mes", "请求成功,开始导出...");
|
||||||
|
// //添加到返回对象
|
||||||
|
// String dataJson = response.getResponseDataJavaJson(bl, data);
|
||||||
|
// //返回
|
||||||
|
// return dataJson;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,120 @@
|
||||||
|
package com.haitongauto.rtosam.api.admin;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.haitongauto.models.pojo.Feedback;
|
||||||
|
import com.haitongauto.rtosam.service.admin.FeedbackAdminService;
|
||||||
|
import com.haitongauto.rtosam.service.admin.ResponseService;
|
||||||
|
import com.haitongauto.rtosam.service.base.FeedbackService;
|
||||||
|
import com.haitongauto.models.dto.Pages;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 后台管理接口:意见反馈
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/admin")
|
||||||
|
public class FeedbackAdminController {
|
||||||
|
@Autowired
|
||||||
|
ResponseService response;
|
||||||
|
@Autowired
|
||||||
|
FeedbackAdminService feedbackAdminService;
|
||||||
|
@Autowired
|
||||||
|
FeedbackService feedbackService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据联系方式、用户名称查询意见反馈
|
||||||
|
*
|
||||||
|
* @param nikeName:用户昵称/姓名
|
||||||
|
* @param linkTel:联系方式 @return:返回列表数据
|
||||||
|
*/
|
||||||
|
@RequestMapping("/feedbackListForCondition")
|
||||||
|
public String feedbackListForCondition(String users_id, String linkTel, String nikeName, Pages pages) {
|
||||||
|
//解析分页参数
|
||||||
|
Integer pageNum = (pages != null && pages.getPageNum() != null && pages.getPageNum() > 0) ? pages.getPageNum() : 1;
|
||||||
|
Integer pageSize = (pages != null && pages.getPageSize() != null && pages.getPageSize() > 0) ? pages.getPageSize() : 10;
|
||||||
|
//调用Service分页方法,获取分页数据对象 PageInfo
|
||||||
|
PageInfo<Feedback> pagesInfo = feedbackAdminService.feedbackListForCondition(users_id, linkTel, nikeName, pageNum, pageSize);
|
||||||
|
//读取分页结果
|
||||||
|
Integer pageCount = pagesInfo.getPages(); //总页数
|
||||||
|
long recordTotal = pagesInfo.getTotal(); //记录总数
|
||||||
|
List<Feedback> myList = new ArrayList<>(); //当前页的列表数据
|
||||||
|
if (pageNum <= pageCount) {
|
||||||
|
myList = pagesInfo.getList(); //当前页的列表数据
|
||||||
|
}
|
||||||
|
//分页数据添加到pages
|
||||||
|
assert pages != null;
|
||||||
|
pages.setPageCount(pageCount);
|
||||||
|
pages.setRecordTotal(recordTotal);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = myList != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("Pages", pages);
|
||||||
|
data.put("FeedbackList", myList);
|
||||||
|
//添加到返回对象
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 意见反馈详情
|
||||||
|
*
|
||||||
|
* @param feedback_id : 公告id
|
||||||
|
* @return 意见反馈详情
|
||||||
|
*/
|
||||||
|
@RequestMapping("/FeedbackInfo")
|
||||||
|
public String FeedbackInfo(@RequestParam("feedback_id") String feedback_id) {
|
||||||
|
String msg = "";
|
||||||
|
if (feedback_id == null || feedback_id.isEmpty()) {
|
||||||
|
msg = "意见反馈id不能为空";
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data, msg);
|
||||||
|
}
|
||||||
|
Feedback feedback = feedbackService.getById(feedback_id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = feedback != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("Feedback", feedback);
|
||||||
|
//添加到返回对象
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除意见反馈
|
||||||
|
*
|
||||||
|
* @param feedback_id 意见反馈id
|
||||||
|
* @return 返回删除意见反馈结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/FeedbackDel")
|
||||||
|
public String FeedbackDel(@RequestParam("feedback_id") String feedback_id) {
|
||||||
|
String msg = "";
|
||||||
|
if (feedback_id == null || feedback_id.isEmpty()) {
|
||||||
|
msg = "意见反馈id不能为空";
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data, msg);
|
||||||
|
}
|
||||||
|
Integer x = feedbackService.logicDel(feedback_id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("result", x);
|
||||||
|
//添加到返回对象
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,327 @@
|
||||||
|
package com.haitongauto.rtosam.api.admin;
|
||||||
|
|
||||||
|
import com.haitongauto.interfaces.*;
|
||||||
|
import com.haitongauto.models.dto.DicDto;
|
||||||
|
import com.haitongauto.models.dto.EnterPortTypeDtol;
|
||||||
|
import com.haitongauto.models.ido.BasicDataIdo;
|
||||||
|
import com.haitongauto.models.ido.CustomerRes;
|
||||||
|
import com.haitongauto.models.ido.ShipVoyIdo;
|
||||||
|
import com.haitongauto.models.pojo.*;
|
||||||
|
import com.haitongauto.rtosam.service.admin.ResponseService;
|
||||||
|
import com.haitongauto.rtosam.service.base.PortAreasService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 后台管理接口:基础资源
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/home")
|
||||||
|
public class HomeController {
|
||||||
|
@Autowired
|
||||||
|
PortAreaInterface portAreaInterface;
|
||||||
|
@Autowired
|
||||||
|
DicInterface dicInterface;
|
||||||
|
@Autowired
|
||||||
|
CustomerServiceInterface customerServiceInterface;
|
||||||
|
@Autowired
|
||||||
|
ResponseService response;
|
||||||
|
@Autowired
|
||||||
|
PortAreasService portAreasService;
|
||||||
|
@Autowired
|
||||||
|
EnterPortTypeInterface enterPortTypeInterface;
|
||||||
|
@Resource
|
||||||
|
private CusOrderApi cusOrderApi;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 港区列表(用于打卡设置,所以取理工数据表)
|
||||||
|
*
|
||||||
|
* @return 返回港区列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getPortAreaList")
|
||||||
|
public String getPortAreaList() {
|
||||||
|
List<PortArea> portAreaList = portAreasService.getList();
|
||||||
|
//List<PortArea> portAreaList = ;
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = portAreaList != null;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("PortAreaList", portAreaList);
|
||||||
|
//封装返回数据
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进港类型
|
||||||
|
*
|
||||||
|
* @return 返回进港类型
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getEnterPortTypesList")
|
||||||
|
public String getEnterPortTypesList() {
|
||||||
|
List<EnterPortTypeDtol> enterPortTypesList = enterPortTypeInterface.getEnterPortTypeList();
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = true;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("EnterPortTypesList", enterPortTypesList);
|
||||||
|
//封装返回数据
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运输方式 TRANSPORT_TYPE
|
||||||
|
*
|
||||||
|
* @return 返回运输方式
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getTransportTypeList")
|
||||||
|
public String getTransportTypeList() {
|
||||||
|
//通过外部接口获取
|
||||||
|
List<DicDto> myList = dicInterface.getDicList("TRANSPORT_TYPE");
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = myList != null;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("TransportTypesList", myList);
|
||||||
|
//封装数据
|
||||||
|
//返回
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 货物类型 CARGO_TYPE
|
||||||
|
*
|
||||||
|
* @return 返回货物类型
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getGoodsTypesList")
|
||||||
|
public String getGoodsTypesList() {
|
||||||
|
//通过外部接口获取
|
||||||
|
List<DicDto> myList = dicInterface.getDicList("APP_CARGO_TYPE");
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = myList != null;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("GoodsTypesList", myList);
|
||||||
|
//封装数据
|
||||||
|
//返回
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (出口/出口)进场计划船名/航次(计划审核通过)
|
||||||
|
*
|
||||||
|
* @param code 进港类型
|
||||||
|
* @return 返回船名/航次(计划审核通过)
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getPlanShipVoyList")
|
||||||
|
public String getPlanShipVoyList(@RequestParam("code") String code,
|
||||||
|
@RequestParam("q") String q,
|
||||||
|
@RequestParam("portAreaId") String portAreaId,
|
||||||
|
@RequestParam("current") Integer current,
|
||||||
|
@RequestParam("size") Integer size) {
|
||||||
|
List<ShipVoyIdo> dataList = new ArrayList<>();
|
||||||
|
switch (code) {
|
||||||
|
case "NE": {
|
||||||
|
//内贸出口
|
||||||
|
CustomerRes<List<BasicDataIdo>> data = cusOrderApi.getNEOutPlanShipList("");
|
||||||
|
List<BasicDataIdo> mydataList = data.getData();
|
||||||
|
if (mydataList != null && mydataList.size() > 0) {
|
||||||
|
for (BasicDataIdo basicDataIdo : mydataList) {
|
||||||
|
ShipVoyIdo shipVoyIdo = new ShipVoyIdo();
|
||||||
|
shipVoyIdo.setShipId(basicDataIdo.getId());
|
||||||
|
shipVoyIdo.setShipName(basicDataIdo.getText() + "/" + basicDataIdo.getExtra1());
|
||||||
|
shipVoyIdo.setShipEnName(basicDataIdo.getExtra1());
|
||||||
|
dataList.add(shipVoyIdo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "WE"://外贸出口
|
||||||
|
{
|
||||||
|
CustomerRes<List<ShipVoyIdo>> data = cusOrderApi.getWEOutPlanShipList(q, portAreaId, current, size);
|
||||||
|
dataList = data.getData();
|
||||||
|
for (ShipVoyIdo ship : dataList) {
|
||||||
|
ship.setShipName(ship.getShipName() + "/" + ship.getShipEnName());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "NI"://内贸进口
|
||||||
|
case "WI"://外贸进口
|
||||||
|
{
|
||||||
|
//CustomerRes<List<BasicDataIdo>> data = cusOrderApi.getInPlanShipVoyList("");
|
||||||
|
//dataList = data.getData();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "BC": {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = true;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("ShipList", dataList);
|
||||||
|
//封装数据
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (出口/出口)进场计划品牌 (计划审核通过)
|
||||||
|
*
|
||||||
|
* @param code 进港类型
|
||||||
|
* @return 返回品牌 (计划审核通过)
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getPlanBrandsList")
|
||||||
|
public String getPlanBrandsList(@RequestParam("code") String code, @RequestParam("shipName") String shipName, @RequestParam("voyage") String voyage) {
|
||||||
|
String msg = "";
|
||||||
|
if (shipName == null || shipName.isEmpty()) {
|
||||||
|
msg = "船名不能为空";
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data, msg);
|
||||||
|
}
|
||||||
|
//取船名的中文名
|
||||||
|
shipName = shipName.split("/")[0];
|
||||||
|
|
||||||
|
List<BasicDataIdo> dataList = null;
|
||||||
|
switch (code) {
|
||||||
|
case "NE"://内贸出口
|
||||||
|
{
|
||||||
|
CustomerRes<List<BasicDataIdo>> data = cusOrderApi.getNEOutPlanBrandsList("");
|
||||||
|
dataList = data.getData();
|
||||||
|
if (dataList != null && dataList.size() > 0) {
|
||||||
|
for (BasicDataIdo item : dataList) {
|
||||||
|
String extra1 = item.getExtra1();
|
||||||
|
if (extra1 != null && !extra1.isEmpty()) {
|
||||||
|
item.setText(item.getText() + "/" + extra1);
|
||||||
|
} else {
|
||||||
|
item.setText(item.getText() + "/");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "WE"://外贸出口
|
||||||
|
{
|
||||||
|
CustomerRes<List<BasicDataIdo>> data = cusOrderApi.getWEOutPlanBrandsList("", shipName, 1, 100);
|
||||||
|
dataList = data.getData();
|
||||||
|
if (dataList != null && dataList.size() > 0) {
|
||||||
|
for (BasicDataIdo item : dataList) {
|
||||||
|
String extra1 = item.getExtra1();
|
||||||
|
if (extra1 != null && !extra1.isEmpty()) {
|
||||||
|
item.setText(item.getText() + "/" + extra1);
|
||||||
|
} else {
|
||||||
|
item.setText(item.getText() + "/");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "NI"://内贸进口
|
||||||
|
case "WI"://外贸进口
|
||||||
|
{
|
||||||
|
CustomerRes<List<BasicDataIdo>> data = cusOrderApi.getInPlanBrandsList("", shipName, voyage);
|
||||||
|
dataList = data.getData();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "BC": {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = dataList != null;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("BrandsList", dataList);
|
||||||
|
//封装数据
|
||||||
|
//返回
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (出口/出口)进场计划港口(计划审核通过)
|
||||||
|
*
|
||||||
|
* @return 返回 港口(计划审核通过)
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getPlanPortsList")
|
||||||
|
public String getPlanPortsList(@RequestParam("code") String code, @RequestParam("shipId") String shipId) {
|
||||||
|
String msg = "";
|
||||||
|
if (shipId == null || shipId.isEmpty()) {
|
||||||
|
msg = "船舶id不能为空";
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data, msg);
|
||||||
|
}
|
||||||
|
List<BasicDataIdo> dataList = null;
|
||||||
|
switch (code) {
|
||||||
|
case "NE"://内贸出口
|
||||||
|
{
|
||||||
|
CustomerRes<List<BasicDataIdo>> data = cusOrderApi.getNEOutPlanPortsList("");
|
||||||
|
dataList = data.getData();
|
||||||
|
if (dataList != null && dataList.size() > 0) {
|
||||||
|
for (BasicDataIdo item : dataList) {
|
||||||
|
String extra1 = item.getExtra1();
|
||||||
|
if (extra1 != null && !extra1.isEmpty()) {
|
||||||
|
item.setText(item.getText() + "/" + extra1);
|
||||||
|
} else {
|
||||||
|
item.setText(item.getText() + "/");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "WE"://外贸出口
|
||||||
|
{
|
||||||
|
CustomerRes<List<BasicDataIdo>> data = cusOrderApi.getWEOutPlanPortsList("", shipId, 1, 100);
|
||||||
|
dataList = data.getData();
|
||||||
|
if (dataList != null && dataList.size() > 0) {
|
||||||
|
for (BasicDataIdo port : dataList) {
|
||||||
|
String extra1 = port.getExtra1();
|
||||||
|
if (extra1 != null && !extra1.isEmpty()) {
|
||||||
|
port.setText(port.getText() + "/" + extra1);
|
||||||
|
} else {
|
||||||
|
port.setText(port.getText() + "/");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "NI"://内贸进口
|
||||||
|
case "WI"://外贸进口
|
||||||
|
{
|
||||||
|
CustomerRes<List<BasicDataIdo>> data = cusOrderApi.getInPlanPortsList("");
|
||||||
|
dataList = data.getData();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "BC": {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = dataList != null;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("PortsList", dataList);
|
||||||
|
//封装数据
|
||||||
|
//返回
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,186 @@
|
||||||
|
package com.haitongauto.rtosam.api.admin;
|
||||||
|
|
||||||
|
import com.bestvike.linq.Linq;
|
||||||
|
import com.haitongauto.models.pojo.NoviceIntroduction;
|
||||||
|
import com.haitongauto.rtosam.service.admin.ResponseService;
|
||||||
|
import com.haitongauto.rtosam.service.admin.ToPdfService;
|
||||||
|
import com.haitongauto.rtosam.service.base.NoviceIntroductionService;
|
||||||
|
import com.haitongauto.rtosam.service.admin.NoviceIntroductionAdminService;
|
||||||
|
import com.haitongauto.utils.FileDownloadUtil;
|
||||||
|
import com.haitongauto.utils.FormatDateTime;
|
||||||
|
import org.apache.commons.lang3.StringEscapeUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 后台管理接口:操作说明
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/admin")
|
||||||
|
public class OperateIntroductionAdminController {
|
||||||
|
@Autowired
|
||||||
|
ResponseService response;
|
||||||
|
@Autowired
|
||||||
|
NoviceIntroductionService noviceIntroductionService;
|
||||||
|
@Autowired
|
||||||
|
NoviceIntroductionAdminService noviceIntroductionAdminService;
|
||||||
|
@Autowired
|
||||||
|
ToPdfService toPdfService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑(添加/修改)
|
||||||
|
*
|
||||||
|
* @param noviceIntroduction : 操作指南实例
|
||||||
|
* @return 返回编辑结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/OperateIntroductionEdit")
|
||||||
|
public String operateIntroductionEdit(NoviceIntroduction noviceIntroduction) {
|
||||||
|
String msg = "";
|
||||||
|
if (noviceIntroduction.getTitle() == null || noviceIntroduction.getTitle().isEmpty()) {
|
||||||
|
msg = "标题不能为空,请填写标题";
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data, msg);
|
||||||
|
}
|
||||||
|
if (noviceIntroduction.getSort() == null || noviceIntroduction.getSort() <= 0) {
|
||||||
|
msg = "平台类别无效,请填写正确的平台类别";
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data, msg);
|
||||||
|
}
|
||||||
|
Integer sort = noviceIntroduction.getSort();
|
||||||
|
if (sort == null) {
|
||||||
|
sort = 1;
|
||||||
|
}
|
||||||
|
NoviceIntroduction mynoviceIntroduction = noviceIntroductionAdminService.getNoviceIntroductionBySort(sort);
|
||||||
|
|
||||||
|
Integer x = 0;
|
||||||
|
noviceIntroduction.setIs_del(0);
|
||||||
|
//System.out.print("Sort ======= "+mynoviceIntroduction.getSort()+"/"+sort);
|
||||||
|
|
||||||
|
if (mynoviceIntroduction != null) {
|
||||||
|
noviceIntroduction.setId(mynoviceIntroduction.getId());
|
||||||
|
x = noviceIntroductionService.update(noviceIntroduction);
|
||||||
|
} else {
|
||||||
|
String noviceIntroduction_id = noviceIntroductionService.insert(noviceIntroduction);
|
||||||
|
x = (noviceIntroduction_id != null && noviceIntroduction_id.length() > 0) ? 1 : null;
|
||||||
|
}
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("result", x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据平台编号查找新手攻略
|
||||||
|
*
|
||||||
|
* @param sort 类别(1-小程序,2-客服平台,3-生产APP)
|
||||||
|
* @return 返回新手攻略
|
||||||
|
*/
|
||||||
|
@RequestMapping("/QueryOperateIntroductionBySort")
|
||||||
|
public String queryOperateIntroductionBySort(@RequestParam("sort") Integer sort) {
|
||||||
|
String msg = "";
|
||||||
|
if (sort == null || sort <= 0) {
|
||||||
|
msg = "平台类别无效,填写正确的平台类别";
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data, msg);
|
||||||
|
}
|
||||||
|
List<NoviceIntroduction> noviceIntroductionList = noviceIntroductionService.getList();
|
||||||
|
if (noviceIntroductionList != null && noviceIntroductionList.size() > 0) {
|
||||||
|
Linq.of(noviceIntroductionList).forEach(p -> {
|
||||||
|
String content = p.getContent();
|
||||||
|
if (content != null && !content.isEmpty()) {
|
||||||
|
String decodedHtml = StringEscapeUtils.unescapeHtml4(content);
|
||||||
|
p.setContent(decodedHtml);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
NoviceIntroduction noviceIntroduction = Linq.of(noviceIntroductionList).firstOrDefault(p -> p.getSort() != null && p.getSort().equals(sort));
|
||||||
|
int x = 0;
|
||||||
|
if (noviceIntroduction != null) {
|
||||||
|
x = 1;
|
||||||
|
}
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = noviceIntroduction != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("noviceIntroduction", noviceIntroduction);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序/客户服务平台/APP操作说明导出
|
||||||
|
*
|
||||||
|
* @param sort :指南类别(1-小程序,2-客服平台,3-生产APP)
|
||||||
|
* @return APP操作说明导出结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/OperateIntroductionExportPDF")
|
||||||
|
public String OperateIntroductionExportPDF(@RequestParam("sort") Integer sort, HttpServletResponse fileResponse) {
|
||||||
|
String msg = "";
|
||||||
|
if (sort == null || sort <= 0) {
|
||||||
|
msg = "平台类别无效,填写正确的平台类别";
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data, msg);
|
||||||
|
}
|
||||||
|
NoviceIntroduction noviceIntroduction = noviceIntroductionAdminService.getNoviceIntroductionBySort(sort);
|
||||||
|
String htmlDom = (noviceIntroduction != null
|
||||||
|
&& noviceIntroduction.getContent() != null
|
||||||
|
&& !noviceIntroduction.getContent().isEmpty()) ? StringEscapeUtils.unescapeHtml4(noviceIntroduction.getContent()) : null;
|
||||||
|
|
||||||
|
String sortName = "生产APP操作说明";
|
||||||
|
if (sort == 1) {
|
||||||
|
sortName = "小程序操作说明";
|
||||||
|
}
|
||||||
|
if (sort == 2) {
|
||||||
|
sortName = "客户服务平台操作说明";
|
||||||
|
}
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HHmmss");
|
||||||
|
Date date = new Date();
|
||||||
|
//生成导出文件的名称
|
||||||
|
String pdfName = sortName + "_" + sdf.format(date) + ".pdf";
|
||||||
|
//导出为PDF
|
||||||
|
// toPdfService.htmlToPdf(htmlDom, pdfName);
|
||||||
|
String filepath = toPdfService.htmlToPdfReturnFilePath(htmlDom, pdfName);
|
||||||
|
|
||||||
|
InputStream inputStream = FileDownloadUtil.fileToInputStream(filepath);
|
||||||
|
//将文件流返回客户端
|
||||||
|
FileDownloadUtil.writeFile(fileResponse, inputStream);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = noviceIntroduction != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("result", (bl) ? "正在导出..." : null);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,318 @@
|
||||||
|
package com.haitongauto.rtosam.api.admin;
|
||||||
|
|
||||||
|
import com.bestvike.linq.Linq;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.haitongauto.mapper.base.PortAreasMapper;
|
||||||
|
import com.haitongauto.models.dto.PunchClockQueryExl;
|
||||||
|
import com.haitongauto.models.pojo.PortArea;
|
||||||
|
import com.haitongauto.models.pojo.PunchClock;
|
||||||
|
import com.haitongauto.rtosam.service.admin.PunchClockAdminService;
|
||||||
|
import com.haitongauto.models.dto.Pages;
|
||||||
|
import com.haitongauto.models.dto.PunchClockQuery;
|
||||||
|
import com.haitongauto.rtosam.service.admin.ResponseService;
|
||||||
|
import com.haitongauto.utils.FileDownloadUtil;
|
||||||
|
import com.haitongauto.utils.FormatDateTime;
|
||||||
|
import com.haitongauto.utils.HttpClientHelper;
|
||||||
|
import com.haitongauto.utils.excel.ExcelGenerateHelper;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 后台管理接口:打卡记录与设置
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/admin")
|
||||||
|
public class PunchClockAdminController {
|
||||||
|
private static final Logger logger = LogManager.getLogger(PunchClockAdminController.class);
|
||||||
|
@Autowired
|
||||||
|
ResponseService response;
|
||||||
|
@Autowired
|
||||||
|
PunchClockAdminService punchClockAdminService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打卡记录:通过港区、业务类型、关键词、签到日期、签到状态(缺卡/正常)、打卡完成状态(缺卡/正常)单独或组合查询
|
||||||
|
*
|
||||||
|
* @param port_area_id:港区id
|
||||||
|
* @param biz_type:业务类型
|
||||||
|
* @param keywords:关键字(姓名、手机号、板车号)
|
||||||
|
* @param approach_date:进港日期字符串(这个参数有两个值,用'|' 分隔 开始日期和结束日期)
|
||||||
|
* @param sign_in_state:签到状态(0-缺卡,1-正常)
|
||||||
|
* @param punch_state:完工打卡状态(0-缺卡,1-完工)
|
||||||
|
* @param pages:分页参数(pagesNum:当前页码,pagesSize:每页记录条数)
|
||||||
|
* @return 返回打卡记录
|
||||||
|
*/
|
||||||
|
@RequestMapping("/PunchClockListForCondition")
|
||||||
|
public String punchClockListForCondition(String users_id,
|
||||||
|
String port_area_id,
|
||||||
|
String biz_type,
|
||||||
|
String keywords,
|
||||||
|
String approach_date,
|
||||||
|
Integer sign_in_state,
|
||||||
|
Integer punch_state,
|
||||||
|
Pages pages)
|
||||||
|
{
|
||||||
|
//解析分页参数
|
||||||
|
Integer pageNum = (pages != null && pages.getPageNum() != null && pages.getPageNum() > 0) ? pages.getPageNum() : 1;
|
||||||
|
Integer pageSize = (pages != null && pages.getPageSize() != null && pages.getPageSize() > 0) ? pages.getPageSize() : 10;
|
||||||
|
System.out.print("预约进场日期:" + approach_date);
|
||||||
|
logger.info("预约进场日期:" + approach_date);
|
||||||
|
String approach_date_start = "";
|
||||||
|
String approach_date_end = "";
|
||||||
|
if (approach_date != null && !approach_date.isEmpty()) {
|
||||||
|
List<String> list = new ArrayList<>();
|
||||||
|
list = Linq.of(approach_date.split("\\|")).toList();
|
||||||
|
if (list != null && list.size() != 0) {
|
||||||
|
if (list.size() >= 1) {
|
||||||
|
approach_date_start = Linq.of(list).first();
|
||||||
|
approach_date_end = Linq.of(list).last();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
logger.info("预约进场日期开始:" + approach_date_start);
|
||||||
|
logger.info("预约进场日期结束:" + approach_date_end);
|
||||||
|
//调用Service分页方法,获取分页数据对象 PageInfo
|
||||||
|
PageInfo<PunchClock> pageInfo = punchClockAdminService.PunchClockListForCondition(users_id, port_area_id, biz_type, keywords, approach_date_start, approach_date_end, sign_in_state, punch_state, pageNum, pageSize);
|
||||||
|
|
||||||
|
//读取分页结果
|
||||||
|
Integer pageCount = pageInfo.getPages(); //总页数
|
||||||
|
long recordTotal = pageInfo.getTotal(); //记录总数
|
||||||
|
List<PunchClock> myList = pageInfo.getList(); //当前页的列表数据
|
||||||
|
//转换为PunchClockQuery视图数据
|
||||||
|
List<PunchClockQuery> punchClockQueryList = new ArrayList<>();
|
||||||
|
|
||||||
|
if (pageNum <= pageCount) {
|
||||||
|
//转换为列表显示数据
|
||||||
|
punchClockQueryList = punchClockAdminService.PunchClockListConvert(myList);
|
||||||
|
}
|
||||||
|
//分页数据添加到pages
|
||||||
|
assert pages != null;
|
||||||
|
pages.setPageCount(pageCount);
|
||||||
|
pages.setRecordTotal(recordTotal);
|
||||||
|
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = myList != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("PunchClockQueryList", punchClockQueryList);
|
||||||
|
data.put("Pages", pages);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 打卡记录导出[通过港区、业务类型、关键词、签到日期、签到状态(缺卡/正常)、打卡完成状态(缺卡/正常)单独或组合查询]
|
||||||
|
// *
|
||||||
|
// * @param port_area_id:港区id
|
||||||
|
// * @param biz_type:业务类型
|
||||||
|
// * @param keywords:关键字(姓名、手机号、板车号)
|
||||||
|
// * @param approach_date:进港日期字符串
|
||||||
|
// * @param sign_in_state:签到状态(0-缺卡,1-正常)
|
||||||
|
// * @param punch_state:完工打卡状态(0-缺卡,1-完工)
|
||||||
|
// * @return 返回打卡记录导出结果
|
||||||
|
// */
|
||||||
|
// @RequestMapping("/PunchClockListExport")
|
||||||
|
// public String punchClockListExport(String users_id, String port_area_id, Integer biz_type, String keywords, String approach_date, Integer sign_in_state, Integer punch_state, HttpServletResponse myresponse) {
|
||||||
|
// //调用Service分页方法,获取分页数据对象 PageInfo
|
||||||
|
// List<PunchClock> myList = punchClockAdminService.PunchClockListExport(users_id, port_area_id, biz_type, keywords, approach_date, sign_in_state, punch_state);
|
||||||
|
//
|
||||||
|
// if (myList != null && myList.size() > 0) {
|
||||||
|
// //转换为PunchClockQuery视图数据
|
||||||
|
// List<PunchClockQuery> punchClockQueryList = punchClockAdminService.PunchClockListConvert(myList);
|
||||||
|
// String filePath = "wx-applet-admin/src/main/resources/static/doc/exl/"; //D:\fileTemp\
|
||||||
|
//
|
||||||
|
// //昨天日期文件夹
|
||||||
|
// String yesTodayStr = FormatDateTime.getYesTodayStr();
|
||||||
|
// String yesTodayFilePath = "wx-applet-admin/src/main/resources/static/doc/exl/" + yesTodayStr + "/";
|
||||||
|
// File yesTodayFolders = new File(yesTodayFilePath);
|
||||||
|
// //如果存在,则删除昨天日期文件夹
|
||||||
|
// if (yesTodayFolders.exists()) {
|
||||||
|
// boolean b = yesTodayFolders.delete();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// //今日日期文件夹
|
||||||
|
// String todayStrStr = FormatDateTime.getTodayStr();
|
||||||
|
// String todayFilePath = "wx-applet-admin/src/main/resources/static/doc/exl/" + todayStrStr + "/";
|
||||||
|
// File todayFolders = new File(todayFilePath);
|
||||||
|
// //如果不存在,创建日期文件夹
|
||||||
|
// if (!todayFolders.exists()) {
|
||||||
|
// boolean b = todayFolders.mkdirs();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// //调用导出方法
|
||||||
|
// String fileName = ExcelGenerateHelper.outPutExcelReturnFileName(punchClockQueryList, PunchClockQuery.class, todayFilePath);
|
||||||
|
//
|
||||||
|
// InputStream inputStream = FileDownloadUtil.fileToInputStream(fileName);
|
||||||
|
//
|
||||||
|
// File file = new File(fileName);
|
||||||
|
// if (file.exists()) {
|
||||||
|
// boolean r = file.delete();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// //将文件流返回客户端
|
||||||
|
// FileDownloadUtil.writeFile(myresponse, inputStream);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// //判断请求是否成功
|
||||||
|
// Boolean bl = myList != null;
|
||||||
|
// //创建返回数据data
|
||||||
|
// Map<String, Object> data = new HashMap<>();
|
||||||
|
// data.put("mes", "请求成功,开始导出...");
|
||||||
|
// //添加到返回对象
|
||||||
|
// //返回
|
||||||
|
// return response.getResponseDataJavaJson(bl, data);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ids 打卡记录ids
|
||||||
|
* @param myresponse myresponse
|
||||||
|
* @return return
|
||||||
|
*/
|
||||||
|
//@PostMapping("/PunchClockListExport")后期改为Post请求
|
||||||
|
@GetMapping("/PunchClockListExport")
|
||||||
|
public String punchClockListExport(String ids, HttpServletResponse myresponse) {
|
||||||
|
//调用Service分页方法,获取分页数据对象 PageInfo
|
||||||
|
List<String> idlist = null;
|
||||||
|
if (ids != null && !ids.isEmpty()) {
|
||||||
|
idlist = Linq.of(ids.split(",")).toList();
|
||||||
|
}
|
||||||
|
List<PunchClock> myList = punchClockAdminService.getPunchClockListExportByIds(idlist);
|
||||||
|
if (myList != null && myList.size() > 0) {
|
||||||
|
//转换为PunchClockQuery视图数据
|
||||||
|
List<PunchClockQueryExl> punchClockQueryList = punchClockAdminService.PunchClockListConvert1(myList);
|
||||||
|
String filePath = "wx-applet-admin/src/main/resources/static/doc/exl/";
|
||||||
|
|
||||||
|
//昨天日期文件夹
|
||||||
|
String yesTodayStr = FormatDateTime.getYesTodayStr();
|
||||||
|
String yesTodayFilePath = "wx-applet-admin/src/main/resources/static/doc/exl/" + yesTodayStr + "/";
|
||||||
|
File yesTodayFolders = new File(yesTodayFilePath);
|
||||||
|
//如果存在,则删除昨天日期文件夹
|
||||||
|
if (yesTodayFolders.exists()) {
|
||||||
|
boolean b = yesTodayFolders.delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
//今日日期文件夹
|
||||||
|
String todayStrStr = FormatDateTime.getTodayStr();
|
||||||
|
String todayFilePath = "wx-applet-admin/src/main/resources/static/doc/exl/" + todayStrStr + "/";
|
||||||
|
File todayFolders = new File(todayFilePath);
|
||||||
|
//如果不存在,创建日期文件夹
|
||||||
|
if (!todayFolders.exists()) {
|
||||||
|
boolean b = todayFolders.mkdirs();
|
||||||
|
}
|
||||||
|
|
||||||
|
//调用导出方法
|
||||||
|
String fileName = ExcelGenerateHelper.outPutExcelReturnFileName(punchClockQueryList, PunchClockQueryExl.class, todayFilePath);
|
||||||
|
|
||||||
|
InputStream inputStream = FileDownloadUtil.fileToInputStream(fileName);
|
||||||
|
|
||||||
|
File file = new File(fileName);
|
||||||
|
if (file.exists()) {
|
||||||
|
boolean r = file.delete();
|
||||||
|
}
|
||||||
|
//将文件流返回客户端
|
||||||
|
FileDownloadUtil.writeFile(myresponse, inputStream);
|
||||||
|
|
||||||
|
}
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = myList != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("mes", "请求成功,开始导出...");
|
||||||
|
//添加到返回对象
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有的打卡港区
|
||||||
|
*
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 返回港区列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getPunchClockPortAreaList")
|
||||||
|
public String getPunchClockPortAreaList(@RequestParam("port_area_id") String port_area_id) {
|
||||||
|
List<PortArea> portAreaList = punchClockAdminService.getPunchClockPortAreaList(port_area_id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = portAreaList != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("punchClockPortAreaList", portAreaList);
|
||||||
|
//添加到返回对象
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据港区id获取所有的打卡港区
|
||||||
|
*
|
||||||
|
* @param id 港区id
|
||||||
|
* @return 返回港区
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getPunchClockPortAreaById")
|
||||||
|
public String getPunchClockPortAreaById(@RequestParam("id") String id) {
|
||||||
|
String msg = "";
|
||||||
|
if (id == null || id.isEmpty()) {
|
||||||
|
msg = "港区id不能为空";
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data, msg);
|
||||||
|
}
|
||||||
|
PortArea portArea = punchClockAdminService.getPunchClockPortAreaById(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = portArea != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("punchClockPortArea", portArea);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 港区打卡设置
|
||||||
|
*
|
||||||
|
* @param portArea 港区
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/punchClockPortAreaSetting")
|
||||||
|
public String punchClockPortAreaSetting(PortArea portArea) {
|
||||||
|
String msg = "";
|
||||||
|
if (portArea.getId() == null || portArea.getId().isEmpty()) {
|
||||||
|
msg = "港区id不能为空";
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data, msg);
|
||||||
|
}
|
||||||
|
Integer res = punchClockAdminService.punchClockPortAreaSetting(portArea);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = res != null && res > 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("result", res);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,87 @@
|
||||||
|
package com.haitongauto.rtosam.api.admin;
|
||||||
|
|
||||||
|
import com.haitongauto.models.pojo.TableHead;
|
||||||
|
import com.haitongauto.rtosam.service.admin.Impl.TbHeadStatic;
|
||||||
|
import com.haitongauto.rtosam.service.admin.ResponseService;
|
||||||
|
import com.haitongauto.rtosam.service.admin.TableHeadService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动态表头
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/admin")
|
||||||
|
public class TbHeadController {
|
||||||
|
@Autowired
|
||||||
|
ResponseService response;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
TableHeadService tbHeadService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动态表头信息插入
|
||||||
|
* @param tbHead 表头信息
|
||||||
|
* @return 返回插入或修改结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/insertOrUpdateTbHead")
|
||||||
|
public String insertOrUpdateTbHead(TableHead tbHead) {
|
||||||
|
List<String> Codes = TbHeadStatic.getTableCodeList();
|
||||||
|
String msg = "";
|
||||||
|
if (!Codes.contains(tbHead.getTable_code())) {
|
||||||
|
msg = "表编码不在枚举范围内";
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, String> data = TbHeadStatic.getTableMap();
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data, msg);
|
||||||
|
|
||||||
|
}
|
||||||
|
Integer x = tbHeadService.insertOrUpdate(tbHead);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("result", x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据表编码,查询动态表头信息
|
||||||
|
* @param table_code 表编码
|
||||||
|
* @return 返回动态表头信息
|
||||||
|
*/
|
||||||
|
@RequestMapping("/queryTbHeadByCode")
|
||||||
|
public String queryTbHeadByCode(@RequestParam("table_code") String table_code) {
|
||||||
|
String msg = "";
|
||||||
|
if (table_code == null || table_code.isEmpty()) {
|
||||||
|
msg = "表编码不能为空";
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data, msg);
|
||||||
|
}
|
||||||
|
TableHead tbHead = tbHeadService.queryByCode(table_code);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = tbHead != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("tbHead", tbHead);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,232 @@
|
||||||
|
package com.haitongauto.rtosam.api.admin;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.haitongauto.models.dto.PunchClockQuery;
|
||||||
|
import com.haitongauto.models.pojo.LoginLog;
|
||||||
|
import com.haitongauto.models.pojo.PunchClock;
|
||||||
|
import com.haitongauto.models.pojo.Users;
|
||||||
|
import com.haitongauto.rtosam.service.admin.ResponseService;
|
||||||
|
import com.haitongauto.rtosam.service.admin.UsersAdminService;
|
||||||
|
import com.haitongauto.rtosam.service.base.LoginLogService;
|
||||||
|
import com.haitongauto.rtosam.service.base.UsersService;
|
||||||
|
import com.haitongauto.models.dto.Pages;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 后台管理接口:用户管理
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/admin")
|
||||||
|
public class UsersAdminController {
|
||||||
|
@Autowired
|
||||||
|
ResponseService response;
|
||||||
|
@Autowired
|
||||||
|
UsersAdminService usersAdminService;
|
||||||
|
@Autowired
|
||||||
|
UsersService usersService;
|
||||||
|
@Autowired
|
||||||
|
LoginLogService loginLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID、手机号、昵称、注册时间和用户状态查询小程序注册用户信息
|
||||||
|
*
|
||||||
|
* @param keywords : 查询关键字(用户ID、手机号、昵称)
|
||||||
|
* @param usersState:用户状态
|
||||||
|
* @param pages:分页类
|
||||||
|
* @return 返回条件查询用户信息
|
||||||
|
*/
|
||||||
|
@RequestMapping("/UsersListForCondition")
|
||||||
|
public String usersListForCondition(String keywords, String registerDateStart,String registerDateEnd, Integer usersState, Pages pages) {
|
||||||
|
//解析分页参数
|
||||||
|
Integer pageNum = (pages != null && pages.getPageNum() != null && pages.getPageNum() > 0) ? pages.getPageNum() : 1;
|
||||||
|
Integer pageSize = (pages != null && pages.getPageSize() != null && pages.getPageSize() > 0) ? pages.getPageSize() : 10;
|
||||||
|
PageInfo<Users> pageInfo = usersAdminService.usersListForCondition(keywords, registerDateStart,registerDateEnd, usersState, pageNum, pageSize);
|
||||||
|
|
||||||
|
//读取分页结果
|
||||||
|
Integer pageCount = pageInfo.getPages();//总页数
|
||||||
|
long recordTotal = pageInfo.getTotal();//记录总数
|
||||||
|
List<Users> myList = new ArrayList<>();//当前页的列表数据
|
||||||
|
|
||||||
|
if (pageNum <= pageCount) {
|
||||||
|
//转换为列表显示数据
|
||||||
|
myList = pageInfo.getList();
|
||||||
|
}
|
||||||
|
|
||||||
|
//分页数据添加到pages
|
||||||
|
assert pages != null;
|
||||||
|
pages.setPageCount(pageCount);
|
||||||
|
pages.setRecordTotal(recordTotal);
|
||||||
|
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = myList != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("UsersList", myList);
|
||||||
|
data.put("Pages", pages);
|
||||||
|
//添加到返回对象
|
||||||
|
return response.getResponseData(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册用户基本信息(用户详情)
|
||||||
|
*
|
||||||
|
* @param users_id 用户id(司机id)
|
||||||
|
* @return 返回户基本信息
|
||||||
|
*/
|
||||||
|
@RequestMapping("/UsersInfo")
|
||||||
|
public String usersInfo(@RequestParam("users_id") String users_id) {
|
||||||
|
String msg = "";
|
||||||
|
if (users_id == null || users_id.isEmpty()) {
|
||||||
|
msg = "用户id不能为空";
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data, msg);
|
||||||
|
}
|
||||||
|
Users users = usersService.getById(users_id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = users != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("Users", users);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序账号启用或禁用(用户状态修改)
|
||||||
|
*
|
||||||
|
* @param usersState:设定状态(0-正常,1-禁用)
|
||||||
|
* @param users_id:用户id
|
||||||
|
* @return 用户状态修改结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/SetUsersState")
|
||||||
|
public String setUsersState(@RequestParam("users_id") String users_id, @RequestParam("usersState") Integer usersState) {
|
||||||
|
String msg = "";
|
||||||
|
if (users_id == null || users_id.isEmpty()) {
|
||||||
|
msg = "用户id不能为空";
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data, msg);
|
||||||
|
}
|
||||||
|
if (usersState == null) {
|
||||||
|
msg = "用户id不能为空";
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data, msg);
|
||||||
|
}
|
||||||
|
Users users = usersService.getById(users_id);
|
||||||
|
Integer x = 0;
|
||||||
|
if (users != null) {
|
||||||
|
users.setUsers_state(usersState);
|
||||||
|
x = usersService.update(users);
|
||||||
|
}
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("result", x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户ID信息修改
|
||||||
|
*
|
||||||
|
* @param users_id 用户id
|
||||||
|
* @param id_code 身份证号
|
||||||
|
* @return 返回修改结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/IdCodeModify")
|
||||||
|
public String idCodeModify(@RequestParam("users_id") String users_id, @RequestParam("id_code") String id_code) {
|
||||||
|
String msg = "";
|
||||||
|
if (users_id == null || users_id.isEmpty()) {
|
||||||
|
msg = "用户id不能为空";
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data, msg);
|
||||||
|
}
|
||||||
|
if (id_code == null || id_code.isEmpty()) {
|
||||||
|
msg = "身份号码不能为空";
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data, msg);
|
||||||
|
}
|
||||||
|
//读取用户原始数据
|
||||||
|
Users users = usersService.getById(users_id);
|
||||||
|
Integer x = null;
|
||||||
|
if (users != null && id_code.length() == 18) {
|
||||||
|
users.setId_code(id_code);
|
||||||
|
x = usersService.update(users);
|
||||||
|
}
|
||||||
|
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("result", x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户登录日志查询
|
||||||
|
*
|
||||||
|
* @return 返回日志记录列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/usersLoginLog")
|
||||||
|
public String usersLoginLog(Pages pages) {
|
||||||
|
//List<LoginLog> myList = loginLogService.getList();
|
||||||
|
//解析分页参数
|
||||||
|
Integer pageNum = (pages != null && pages.getPageNum() != null && pages.getPageNum() > 0) ? pages.getPageNum() : 1;
|
||||||
|
Integer pageSize = (pages != null && pages.getPageSize() != null && pages.getPageSize() > 0) ? pages.getPageSize() : 10;
|
||||||
|
|
||||||
|
//调用Service分页方法,获取分页数据对象 PageInfo
|
||||||
|
PageInfo<LoginLog> pageInfo = loginLogService.loginLogListForCondition(pageNum, pageSize);
|
||||||
|
|
||||||
|
//读取分页结果
|
||||||
|
Integer pageCount = pageInfo.getPages(); //总页数
|
||||||
|
long recordTotal = pageInfo.getTotal(); //记录总数
|
||||||
|
List<LoginLog> myList = pageInfo.getList(); //当前页的列表数据
|
||||||
|
|
||||||
|
//分页数据添加到pages
|
||||||
|
assert pages != null;
|
||||||
|
pages.setPageCount(pageCount);
|
||||||
|
pages.setRecordTotal(recordTotal);
|
||||||
|
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = true;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("Pages", pages);
|
||||||
|
data.put("LoginLogList", myList);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,694 @@
|
||||||
|
package com.haitongauto.rtosam.api.admin;
|
||||||
|
|
||||||
|
import com.haitongauto.interfaces.DepartureVehicleInterface;
|
||||||
|
import com.haitongauto.interfaces.OrderApi;
|
||||||
|
import com.haitongauto.interfaces.ReceivingVehicleInterface;
|
||||||
|
import com.haitongauto.models.dto.Pages;
|
||||||
|
import com.haitongauto.models.dto.RecAndDepExcelDto;
|
||||||
|
import com.haitongauto.models.ido.CommonRes;
|
||||||
|
import com.haitongauto.models.ido.departure.DepartureDetailIdo;
|
||||||
|
import com.haitongauto.models.ido.departure.DepartureDetailIdo_DTO;
|
||||||
|
import com.haitongauto.models.ido.departure.DepartureVehicleIdo;
|
||||||
|
import com.haitongauto.models.ido.departure.DepartureVehicleIdo_DTO;
|
||||||
|
import com.haitongauto.models.ido.departure.pc.DepartureVehicleIdoPar_pc;
|
||||||
|
import com.haitongauto.models.ido.departure.pc.DepartureVehicleIdo_pc;
|
||||||
|
import com.haitongauto.models.ido.receiving.*;
|
||||||
|
import com.haitongauto.models.ido.receiving.pc.ReceivingVehicleIdoPar_pc;
|
||||||
|
import com.haitongauto.models.ido.receiving.pc.ReceivingVehicleIdo_pc;
|
||||||
|
import com.haitongauto.rtosam.service.admin.ResponseService;
|
||||||
|
import com.haitongauto.utils.FileDownloadUtil;
|
||||||
|
import com.haitongauto.utils.FormatDateTime;
|
||||||
|
import com.haitongauto.utils.excel.ExcelGenerateHelper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 后台管理接口:收发车凭证
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/admin")
|
||||||
|
public class VehicleAdminController {
|
||||||
|
@Autowired
|
||||||
|
ResponseService response;
|
||||||
|
@Autowired
|
||||||
|
ReceivingVehicleInterface receivingVehicleInterface;
|
||||||
|
@Autowired
|
||||||
|
DepartureVehicleInterface departureVehicleInterface;
|
||||||
|
@Resource
|
||||||
|
OrderApi orderApi;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取收车凭证的分页数据
|
||||||
|
*
|
||||||
|
* @param current 当前页码
|
||||||
|
* @param size 数据条数(非必填)
|
||||||
|
* @return 返回收车凭证的分页数据
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getReceivingVehicleList")
|
||||||
|
public String getReceivingVehicleList(@RequestParam("users_id") String users_id, @RequestParam("printTicketTime") String printTicketTime, @RequestParam("query") String query, @RequestParam("current") Integer current, @RequestParam("size") Integer size) {
|
||||||
|
//public String getReceivingVehicleList( Integer current, Integer size) {
|
||||||
|
String msg = "";
|
||||||
|
|
||||||
|
Integer pageNum = (current != null && current > 0) ? current : 1;
|
||||||
|
Integer pageSize = (size != null && size > 0) ? size : 10;
|
||||||
|
List<ReceivingVehicleIdo> myList = null;
|
||||||
|
|
||||||
|
//通过RTOS接口读取收车凭证分页数据
|
||||||
|
//外部接口获取数据
|
||||||
|
ReceivingVehicleIdo_DTO receivingVehicleIdo_dto = receivingVehicleInterface.getReceivingVehicleList(printTicketTime, query, pageNum, pageSize);
|
||||||
|
String status = receivingVehicleIdo_dto.getStatus();
|
||||||
|
//用户权限过期
|
||||||
|
if (status.equals("401")) {
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//封装数据
|
||||||
|
//返回
|
||||||
|
return response.getRtosResponseData(bl, data, "401");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (status.equals("200")) {
|
||||||
|
myList = receivingVehicleIdo_dto.getReceivingVehicleIdoList();
|
||||||
|
}
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = myList != null;
|
||||||
|
//创建返回数据对象
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("pageNum", pageNum);
|
||||||
|
data.put("pageSize", pageSize);
|
||||||
|
data.put("ReceivingVehicleIdoList", myList);
|
||||||
|
//封装数据
|
||||||
|
//返回
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取一条收车明细
|
||||||
|
*
|
||||||
|
* @param id:收车凭证id
|
||||||
|
* @return 返回一条收车明细
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getReceivingDetailForId")
|
||||||
|
public String getReceivingDetailForId(@RequestParam("id") String id) {
|
||||||
|
String msg = "";
|
||||||
|
|
||||||
|
if (id == null || id.isEmpty()) {
|
||||||
|
msg = "收车凭证id不能为空";
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
//外部接口获取凭证数据
|
||||||
|
ReceivingDetailIdo receivingDetailIdo = null;
|
||||||
|
ReceivingDetailIdo_DTO receivingDetailIdo_dto = receivingVehicleInterface.getReceivingDetailForId(id);
|
||||||
|
|
||||||
|
String status = receivingDetailIdo_dto.getStatus();
|
||||||
|
//用户权限过期
|
||||||
|
if (status.equals("401")) {
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//封装数据
|
||||||
|
//返回
|
||||||
|
return response.getRtosResponseData(bl, data, "401");
|
||||||
|
}
|
||||||
|
if (status.equals("200")) {
|
||||||
|
receivingDetailIdo = receivingDetailIdo_dto.getReceivingDetailIdo();
|
||||||
|
}
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = receivingDetailIdo != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("receivingDetailIdo", receivingDetailIdo);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成收车核验
|
||||||
|
*
|
||||||
|
* @param id:收车凭证id
|
||||||
|
* @return 返回核验结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("checkReceivingVehicle")
|
||||||
|
public String checkReceivingVehicle(@RequestParam("id") String id) {
|
||||||
|
String msg = "";
|
||||||
|
if (id == null || id.isEmpty()) {
|
||||||
|
msg = "收车凭证id不能为空";
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data, msg);
|
||||||
|
}
|
||||||
|
//外部接口获取数据
|
||||||
|
boolean res = receivingVehicleInterface.checkReceivingVehicle(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = res;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("data", res);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取提车凭证的分页数据
|
||||||
|
*
|
||||||
|
* @param current 当前页码
|
||||||
|
* @param size 数据条数(非必填
|
||||||
|
* @return 返回提车凭证的分页数据
|
||||||
|
*/
|
||||||
|
@RequestMapping("getDepartureVehicleList")
|
||||||
|
public String getDepartureVehicleList(@RequestParam("users_id") String users_id, @RequestParam("printTicketTime") String printTicketTime, @RequestParam("query") String query, @RequestParam("current") Integer current, @RequestParam("size") Integer size) {
|
||||||
|
String msg = "";
|
||||||
|
//解析分页参数
|
||||||
|
Integer pageNum = (current != null && current > 0) ? current : 1;
|
||||||
|
Integer pageSize = (size != null && size > 0) ? size : 10;
|
||||||
|
//通过RTOS接口读取提车凭证分页数据
|
||||||
|
List<DepartureVehicleIdo> myList = null;
|
||||||
|
|
||||||
|
//外部接口获取数据
|
||||||
|
//通过RTOS接口读取收车凭证分页数据
|
||||||
|
DepartureVehicleIdo_DTO departureVehicleIdo_dto = departureVehicleInterface.getDepartureVehicleList(printTicketTime, query, pageNum, pageSize);
|
||||||
|
|
||||||
|
String status = departureVehicleIdo_dto.getStatus();
|
||||||
|
//用户权限过期
|
||||||
|
if (status.equals("401")) {
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//封装数据
|
||||||
|
//返回
|
||||||
|
return response.getRtosResponseData(bl, data, "401");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (status.equals("200")) {
|
||||||
|
myList = departureVehicleIdo_dto.getDepartureVehicleIdoList();
|
||||||
|
}
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = myList != null;
|
||||||
|
//创建返回数据对象
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("pageNum", pageNum);
|
||||||
|
data.put("pageSize", pageSize);
|
||||||
|
data.put("departureVehicleIdoList", myList);
|
||||||
|
//封装数据
|
||||||
|
//返回
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取一条提车明细
|
||||||
|
*
|
||||||
|
* @param id:提车凭证id
|
||||||
|
* @return 返回一条提车明细
|
||||||
|
*/
|
||||||
|
@RequestMapping("getDepartureDetailForId")
|
||||||
|
public String getDepartureDetailForId(@RequestParam("id") String id) {
|
||||||
|
String msg = "";
|
||||||
|
if (id == null || id.isEmpty()) {
|
||||||
|
msg = "提车凭证id不能为空";
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data, msg);
|
||||||
|
}
|
||||||
|
//外部接口获取数据
|
||||||
|
DepartureDetailIdo departureDetailIdo = null;
|
||||||
|
//获取指定发车信息
|
||||||
|
DepartureDetailIdo_DTO departureDetailIdo_dto = departureVehicleInterface.getDepartureDetailForId(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
String status = departureDetailIdo_dto.getStatus();
|
||||||
|
//用户权限过期
|
||||||
|
if (status.equals("401")) {
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//封装数据
|
||||||
|
//返回
|
||||||
|
return response.getRtosResponseData(bl, data, "401");
|
||||||
|
}
|
||||||
|
if (status.equals("200")) {
|
||||||
|
departureDetailIdo = departureDetailIdo_dto.getDepartureDetailIdo();
|
||||||
|
}
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = departureDetailIdo != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("departureDetailIdo", departureDetailIdo);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成提车核验
|
||||||
|
*
|
||||||
|
* @param id:提车凭证id
|
||||||
|
* @return 完成提车核验结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("checkDepartureVehicle")
|
||||||
|
public String checkDepartureVehicle(@RequestParam("id") String id) {
|
||||||
|
String msg = "";
|
||||||
|
|
||||||
|
if (id == null || id.isEmpty()) {
|
||||||
|
msg = "提车凭证id不能为空";
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data, msg);
|
||||||
|
}
|
||||||
|
//外部接口获取数据
|
||||||
|
boolean res = departureVehicleInterface.checkDepartureVehicle(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = res;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("data", res);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件查询所有的收车凭证列表分页数据(海通后台使用)
|
||||||
|
* @param spmId 船名
|
||||||
|
* @param bvmId 货物类型
|
||||||
|
* @param query 关键字(手机号、板车号、编号)
|
||||||
|
* @return 返回 收车凭证列表
|
||||||
|
*/
|
||||||
|
@GetMapping("getReceiveListByCondition")
|
||||||
|
public String getReceiveListByCondition(@RequestParam("spmId") String spmId, @RequestParam("bvmId") String bvmId, @RequestParam("query") String query, @RequestParam("current") Integer current, @RequestParam("size") Integer size) {
|
||||||
|
current = (current != null) ? current : 1;
|
||||||
|
size = (size != null) ? size : 10;
|
||||||
|
CommonRes<ReceivingVehicleIdoPar_pc> res = orderApi.getReceiveListByCondition(spmId, bvmId, query, current, size);
|
||||||
|
List<ReceivingVehicleIdo_pc> receivingList = null;
|
||||||
|
Pages pages = new Pages();
|
||||||
|
if (res != null) {
|
||||||
|
if (res.getData() != null) {
|
||||||
|
receivingList = res.getData().getRecords();
|
||||||
|
}
|
||||||
|
pages.setPageNum(current);
|
||||||
|
pages.setPageSize(size);
|
||||||
|
pages.setPageCount(res.getPages());
|
||||||
|
pages.setRecordTotal(res.getTotal());
|
||||||
|
}
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = true;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("receivingList", receivingList);
|
||||||
|
data.put("pages", pages);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件查询所有的发车凭证列表分页数据(海通后台使用)
|
||||||
|
* @param spmId 船名
|
||||||
|
* @param bvmId 货物类型
|
||||||
|
* @param query 关键字(手机号、板车号、编号)
|
||||||
|
* @return 返回 收车凭证列表
|
||||||
|
*/
|
||||||
|
@GetMapping("getDepartureListByCondition")
|
||||||
|
public String getDepartureListByCondition(@RequestParam("spmId") String spmId, @RequestParam("bvmId") String bvmId, @RequestParam("query") String query, @RequestParam("current") Integer current, @RequestParam("size") Integer size){
|
||||||
|
current = (current != null) ? current : 1;
|
||||||
|
size = (size != null) ? size : 10;
|
||||||
|
CommonRes<DepartureVehicleIdoPar_pc> res = orderApi.getDepartureListByCondition(spmId, bvmId, query, current, size);
|
||||||
|
List<DepartureVehicleIdo_pc> departureList = null;
|
||||||
|
Pages pages = new Pages();
|
||||||
|
if (res != null) {
|
||||||
|
if (res.getData() != null) {
|
||||||
|
departureList = res.getData().getRecords();
|
||||||
|
}
|
||||||
|
pages.setPageNum(current);
|
||||||
|
pages.setPageSize(size);
|
||||||
|
pages.setPageCount(res.getPages());
|
||||||
|
pages.setRecordTotal(res.getTotal());
|
||||||
|
}
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = true;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("departureList", departureList);
|
||||||
|
data.put("pages", pages);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseDataJavaJson(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单个收车凭证excel导出
|
||||||
|
*
|
||||||
|
* @param vehicle_receiving_id:收车凭证id
|
||||||
|
* @return 返回单个收车凭证excel导出结构
|
||||||
|
*/
|
||||||
|
@RequestMapping("/vehicleReceivingOneExport")
|
||||||
|
public String vehicleReceivingOneExport(@RequestParam("vehicle_receiving_id") String vehicle_receiving_id, HttpServletResponse myresponse) {
|
||||||
|
String msg = "";
|
||||||
|
|
||||||
|
if (vehicle_receiving_id == null || vehicle_receiving_id.isEmpty()) {
|
||||||
|
msg = "收车凭证id不能为空";
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data, msg);
|
||||||
|
}
|
||||||
|
ReceivingDetailIdo_DTO receivingDetailIdo_dto = receivingVehicleInterface.getReceivingDetailForId(vehicle_receiving_id);
|
||||||
|
String status = receivingDetailIdo_dto.getStatus();
|
||||||
|
//用户权限过期
|
||||||
|
if (status.equals("401")) {
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//封装数据
|
||||||
|
//返回
|
||||||
|
return response.getRtosResponseData(bl, data, "401");
|
||||||
|
}
|
||||||
|
|
||||||
|
ReceivingDetailIdo receivingDetailIdo = receivingDetailIdo_dto.getReceivingDetailIdo();
|
||||||
|
if (receivingDetailIdo == null) {
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据对象
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("单个收车凭证excel导出", "失败");
|
||||||
|
//封装数据
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<RecAndDepExcelDto> recAndDepExcelDtoList = new ArrayList<>();
|
||||||
|
RecAndDepExcelDto recAndDepExcelDto = new RecAndDepExcelDto();
|
||||||
|
recAndDepExcelDto.setText1("上海海通国际汽车码头有限公司货物出门证");
|
||||||
|
recAndDepExcelDto.setText2("");
|
||||||
|
recAndDepExcelDto.setText3("");
|
||||||
|
recAndDepExcelDto.setText4("");
|
||||||
|
recAndDepExcelDtoList.add(recAndDepExcelDto);
|
||||||
|
|
||||||
|
List<RecAndDepExcelDto> myrecAndDepExcelDtoList = ReceivingDetailIdoCorverToRecAndDepExcelDtoList(receivingDetailIdo);
|
||||||
|
if (myrecAndDepExcelDtoList.size() > 0) {
|
||||||
|
recAndDepExcelDtoList.addAll(myrecAndDepExcelDtoList);
|
||||||
|
}
|
||||||
|
|
||||||
|
//昨天日期文件夹
|
||||||
|
String yesTodayStr = FormatDateTime.getYesTodayStr();
|
||||||
|
String yesTodayFilePath = "wx-applet-admin/src/main/resources/static/doc/exl/" + yesTodayStr + "/";
|
||||||
|
File yesTodayFolders = new File(yesTodayFilePath);
|
||||||
|
//如果存在,则删除昨天日期文件夹
|
||||||
|
if (yesTodayFolders.exists()) {
|
||||||
|
boolean b = yesTodayFolders.delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
//今日日期文件夹
|
||||||
|
String todayStrStr = FormatDateTime.getTodayStr();
|
||||||
|
String todayFilePath = "wx-applet-admin/src/main/resources/static/doc/exl/" + todayStrStr + "/";
|
||||||
|
File todayFolders = new File(todayFilePath);
|
||||||
|
//如果不存在,创建日期文件夹
|
||||||
|
if (!todayFolders.exists()) {
|
||||||
|
boolean b = todayFolders.mkdirs();
|
||||||
|
}
|
||||||
|
|
||||||
|
//String filePath = "wx-applet-admin/src/main/resources/static/doc/exl/";
|
||||||
|
String fileName = "";
|
||||||
|
fileName = ExcelGenerateHelper.outPutExcelUnHearReturnFileName(recAndDepExcelDtoList, RecAndDepExcelDto.class, todayFilePath);
|
||||||
|
InputStream inputStream = FileDownloadUtil.fileToInputStream(fileName);
|
||||||
|
|
||||||
|
//将文件流返回客户端
|
||||||
|
FileDownloadUtil.writeFile(myresponse, inputStream);
|
||||||
|
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = recAndDepExcelDtoList.size() > 0;
|
||||||
|
//创建返回数据对象
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("单个收车凭证excel导出", "成功");
|
||||||
|
data.put("导出文件路径", "path");
|
||||||
|
//封装数据
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多个收车凭证excel导出
|
||||||
|
*
|
||||||
|
* @return 返回导出结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/vehicleReceivingListExport")
|
||||||
|
public String vehicleReceivingListExport(@RequestParam("vehicleReceivingIdList") List<String> vehicleReceivingIdList, HttpServletResponse myresponse) {
|
||||||
|
String msg = "";
|
||||||
|
|
||||||
|
if (vehicleReceivingIdList == null || vehicleReceivingIdList.size() == 0) {
|
||||||
|
msg = "收车凭证id不能为空";
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data, msg);
|
||||||
|
}
|
||||||
|
List<ReceivingDetailIdo> receivingDetailIdoList = new ArrayList<>();//Rtos缺少所有收车凭证接口 --- 这个备注是错误的!
|
||||||
|
|
||||||
|
for (String id : vehicleReceivingIdList) {
|
||||||
|
//从哪吒获取某一条收车凭证
|
||||||
|
ReceivingDetailIdo receivingDetailIdo = null;
|
||||||
|
ReceivingDetailIdo_DTO receivingDetailIdo_dto = receivingVehicleInterface.getReceivingDetailForId(id);
|
||||||
|
String status = receivingDetailIdo_dto.getStatus();
|
||||||
|
//用户权限过期
|
||||||
|
if (status.equals("401")) {
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
//封装数据
|
||||||
|
//返回
|
||||||
|
return response.getRtosResponseData(bl, data, "401");
|
||||||
|
}
|
||||||
|
|
||||||
|
receivingDetailIdo = receivingDetailIdo_dto.getReceivingDetailIdo();
|
||||||
|
if (receivingDetailIdo == null) {
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = false;
|
||||||
|
//创建返回数据对象
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("单个收车凭证excel导出", "失败");
|
||||||
|
//封装数据
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
receivingDetailIdoList.add(receivingDetailIdo);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<RecAndDepExcelDto> recAndDepExcelDtoList = new ArrayList<>();
|
||||||
|
RecAndDepExcelDto recAndDepExcelDto = new RecAndDepExcelDto();
|
||||||
|
recAndDepExcelDto.setText1("上海海通国际汽车码头有限公司货物出门证");
|
||||||
|
recAndDepExcelDto.setText2("");
|
||||||
|
recAndDepExcelDto.setText3("");
|
||||||
|
recAndDepExcelDto.setText4("");
|
||||||
|
recAndDepExcelDtoList.add(recAndDepExcelDto);
|
||||||
|
|
||||||
|
for (ReceivingDetailIdo receivingDetailIdo : receivingDetailIdoList) {
|
||||||
|
List<RecAndDepExcelDto> myrecAndDepExcelDtoList = ReceivingDetailIdoCorverToRecAndDepExcelDtoList(receivingDetailIdo);
|
||||||
|
if (myrecAndDepExcelDtoList.size() > 0) {
|
||||||
|
recAndDepExcelDtoList.addAll(myrecAndDepExcelDtoList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//昨天日期文件夹
|
||||||
|
String yesTodayStr = FormatDateTime.getYesTodayStr();
|
||||||
|
String yesTodayFilePath = "wx-applet-admin/src/main/resources/static/doc/exl/" + yesTodayStr + "/";
|
||||||
|
File yesTodayFolders = new File(yesTodayFilePath);
|
||||||
|
//如果存在,则删除昨天日期文件夹
|
||||||
|
if (yesTodayFolders.exists()) {
|
||||||
|
boolean b = yesTodayFolders.delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
//今日日期文件夹
|
||||||
|
String todayStrStr = FormatDateTime.getTodayStr();
|
||||||
|
String todayFilePath = "wx-applet-admin/src/main/resources/static/doc/exl/" + todayStrStr + "/";
|
||||||
|
File todayFolders = new File(todayFilePath);
|
||||||
|
//如果不存在,创建日期文件夹
|
||||||
|
if (!todayFolders.exists()) {
|
||||||
|
boolean b = todayFolders.mkdirs();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//String filePathName = "wx-applet-admin/src/main/resources/static/doc/exl/";
|
||||||
|
String fileName = "";
|
||||||
|
if (recAndDepExcelDtoList.size() > 0) {
|
||||||
|
fileName = ExcelGenerateHelper.outPutExcelUnHearReturnFileName(recAndDepExcelDtoList, RecAndDepExcelDto.class, todayFilePath);
|
||||||
|
}
|
||||||
|
//将文件转化为流
|
||||||
|
InputStream inputStream = FileDownloadUtil.fileToInputStream(fileName);
|
||||||
|
|
||||||
|
//将文件流返回客户端
|
||||||
|
FileDownloadUtil.writeFile(myresponse, inputStream);
|
||||||
|
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = recAndDepExcelDtoList.size() > 0;
|
||||||
|
//创建返回数据对象
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("单个收车凭证excel导出", "成功");
|
||||||
|
data.put("导出文件路径", "path");
|
||||||
|
//封装数据
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<RecAndDepExcelDto> ReceivingDetailIdoCorverToRecAndDepExcelDtoList(ReceivingDetailIdo receivingDetailIdo) {
|
||||||
|
List<RecAndDepExcelDto> list = new ArrayList<>();
|
||||||
|
if (receivingDetailIdo == null) {
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
//前面基础信息
|
||||||
|
for (int i = 0; i < 9; i++) {
|
||||||
|
RecAndDepExcelDto recAndDepExcelDto = new RecAndDepExcelDto();
|
||||||
|
switch (i) {
|
||||||
|
case 1:
|
||||||
|
recAndDepExcelDto.setText1("基本信息");
|
||||||
|
recAndDepExcelDto.setText2("");
|
||||||
|
recAndDepExcelDto.setText3("");
|
||||||
|
recAndDepExcelDto.setText4("");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
recAndDepExcelDto.setText1("编号:");
|
||||||
|
recAndDepExcelDto.setText2(receivingDetailIdo.getNumber());
|
||||||
|
recAndDepExcelDto.setText3("收车时间:");
|
||||||
|
recAndDepExcelDto.setText4(receivingDetailIdo.getPrintTicketTime());
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
recAndDepExcelDto.setText1("作业人员:");
|
||||||
|
recAndDepExcelDto.setText2(receivingDetailIdo.getCollectUser());
|
||||||
|
recAndDepExcelDto.setText3("联系电话:");
|
||||||
|
recAndDepExcelDto.setText4(receivingDetailIdo.getCollectUserMobile());
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
recAndDepExcelDto.setText1("司机名称:");
|
||||||
|
recAndDepExcelDto.setText2(receivingDetailIdo.getDriverName());
|
||||||
|
recAndDepExcelDto.setText3("联系电话:");
|
||||||
|
recAndDepExcelDto.setText4(receivingDetailIdo.getPhoneNumber());
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
recAndDepExcelDto.setText1("板车号:");
|
||||||
|
recAndDepExcelDto.setText2(receivingDetailIdo.getTrailerNo());
|
||||||
|
recAndDepExcelDto.setText3("贸易类型:");
|
||||||
|
recAndDepExcelDto.setText4(receivingDetailIdo.getTradeType());
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
recAndDepExcelDto.setText1("备注:");
|
||||||
|
recAndDepExcelDto.setText2(receivingDetailIdo.getRemark());
|
||||||
|
recAndDepExcelDto.setText3("");
|
||||||
|
recAndDepExcelDto.setText4("");
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
recAndDepExcelDto.setText1("");
|
||||||
|
recAndDepExcelDto.setText2("");
|
||||||
|
recAndDepExcelDto.setText3("");
|
||||||
|
recAndDepExcelDto.setText4("");
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
recAndDepExcelDto.setText1("收车明细");
|
||||||
|
recAndDepExcelDto.setText2("");
|
||||||
|
recAndDepExcelDto.setText3("");
|
||||||
|
recAndDepExcelDto.setText4("");
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
list.add(recAndDepExcelDto);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (RecDetailIdo recDetailIdo : receivingDetailIdo.getDetailList()) {
|
||||||
|
|
||||||
|
RecAndDepExcelDto recAndDepExcelDto = new RecAndDepExcelDto();
|
||||||
|
for (int j = 0; j < 4; j++) {
|
||||||
|
switch (j) {
|
||||||
|
case 0:
|
||||||
|
recAndDepExcelDto.setText1("");
|
||||||
|
recAndDepExcelDto.setText2("");
|
||||||
|
recAndDepExcelDto.setText3("");
|
||||||
|
recAndDepExcelDto.setText4("");
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
recAndDepExcelDto.setText1("船名:");
|
||||||
|
recAndDepExcelDto.setText2(recDetailIdo.getVslCnname());
|
||||||
|
recAndDepExcelDto.setText3("品牌:");
|
||||||
|
recAndDepExcelDto.setText4(recDetailIdo.getBrdNname());
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
recAndDepExcelDto.setText1("港口:");
|
||||||
|
recAndDepExcelDto.setText2(recDetailIdo.getPotCnname());
|
||||||
|
recAndDepExcelDto.setText3("");
|
||||||
|
recAndDepExcelDto.setText4("");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
recAndDepExcelDto.setText1(" ");
|
||||||
|
recAndDepExcelDto.setText2("");
|
||||||
|
recAndDepExcelDto.setText3("");
|
||||||
|
recAndDepExcelDto.setText4("");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
list.add(recAndDepExcelDto);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<RecVinIdo> recVinIdoList = recDetailIdo.getVinList();
|
||||||
|
|
||||||
|
if (recVinIdoList.size() > 0) {
|
||||||
|
RecAndDepExcelDto recAndDepExcelDto0 = new RecAndDepExcelDto();
|
||||||
|
recAndDepExcelDto0.setText1("序号:");
|
||||||
|
recAndDepExcelDto0.setText2("车架号");
|
||||||
|
recAndDepExcelDto0.setText3("");
|
||||||
|
recAndDepExcelDto0.setText4("");
|
||||||
|
list.add(recAndDepExcelDto0);
|
||||||
|
|
||||||
|
for (int k = 0; k < recVinIdoList.size(); k++) {
|
||||||
|
RecAndDepExcelDto recAndDepExcelDto1 = new RecAndDepExcelDto();
|
||||||
|
String xh = "0" + k;
|
||||||
|
String vin = recVinIdoList.get(k).getVinCode();
|
||||||
|
recAndDepExcelDto1.setText1(xh);
|
||||||
|
recAndDepExcelDto1.setText2(vin);
|
||||||
|
recAndDepExcelDto1.setText3("");
|
||||||
|
recAndDepExcelDto1.setText4("");
|
||||||
|
list.add(recAndDepExcelDto1);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,132 @@
|
||||||
|
package com.haitongauto.rtosam.api.base;
|
||||||
|
|
||||||
|
import com.haitongauto.models.pojo.Announcement;
|
||||||
|
import com.haitongauto.rtosam.service.admin.ResponseService;
|
||||||
|
import com.haitongauto.rtosam.service.base.AnnouncementService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/announcement")
|
||||||
|
public class AnnouncementsController{
|
||||||
|
@Autowired
|
||||||
|
AnnouncementService announcementService;
|
||||||
|
@Autowired
|
||||||
|
ResponseService response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param announcement 公告数据实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/insert")
|
||||||
|
public String insert(Announcement announcement){
|
||||||
|
//添加到数据库
|
||||||
|
String x = announcementService.insert(announcement);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x.length() > 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 公告id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/logicDel")
|
||||||
|
public String logicDel(String id){
|
||||||
|
Integer x = announcementService.logicDel(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 公告id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/delete")
|
||||||
|
public String delete(String id){
|
||||||
|
Integer x = announcementService.delete(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param announcement 公告数据实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/update")
|
||||||
|
public String update(Announcement announcement){
|
||||||
|
Integer x = announcementService.update(announcement);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 公告id
|
||||||
|
* @return 返回指定Id的记录
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getById")
|
||||||
|
public String getById(String id){
|
||||||
|
Announcement announcements = announcementService.getById(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = announcements != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("Announcement",announcements);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseDataJavaJson(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询公告列表
|
||||||
|
* @return 返回公告列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getList")
|
||||||
|
public String getList(){
|
||||||
|
List<Announcement> mylist = announcementService.getList();
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = mylist != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("AnnouncementsList",mylist);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseDataJavaJson(bl,data);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,134 @@
|
||||||
|
package com.haitongauto.rtosam.api.base;
|
||||||
|
|
||||||
|
import com.haitongauto.models.pojo.Appointment;
|
||||||
|
import com.haitongauto.rtosam.service.admin.ResponseService;
|
||||||
|
import com.haitongauto.rtosam.service.base.AppointmentService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/appointment")
|
||||||
|
public class AppointmentController{
|
||||||
|
@Autowired
|
||||||
|
AppointmentService appointmentService;
|
||||||
|
@Autowired
|
||||||
|
ResponseService response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param appointment 预约数据实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/insert")
|
||||||
|
public String insert(Appointment appointment){
|
||||||
|
//添加到数据库
|
||||||
|
String x = appointmentService.insert(appointment);
|
||||||
|
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x.length() > 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 预约id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/logicDel")
|
||||||
|
public String logicDel(String id){
|
||||||
|
Integer x = appointmentService.logicDel(id);
|
||||||
|
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 预约id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/delete")
|
||||||
|
public String delete(String id){
|
||||||
|
Integer x = appointmentService.delete(id);
|
||||||
|
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param appointment 预约数据实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/update")
|
||||||
|
public String update(Appointment appointment){
|
||||||
|
Integer x = appointmentService.update(appointment);
|
||||||
|
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 预约id
|
||||||
|
* @return 返回预约信息
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getById")
|
||||||
|
public String getById(String id){
|
||||||
|
Appointment appointment = appointmentService.getById(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = appointment != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("Appointment",appointment);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseDataJavaJson(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询预约信息列表
|
||||||
|
* @return 返回预约信息列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getList")
|
||||||
|
public String getList() {
|
||||||
|
List<Appointment> mylist = appointmentService.getList();
|
||||||
|
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = mylist != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("AppointmentList",mylist);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseDataJavaJson(bl,data);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,121 @@
|
||||||
|
package com.haitongauto.rtosam.api.base;
|
||||||
|
|
||||||
|
import com.haitongauto.models.pojo.Feedback;
|
||||||
|
import com.haitongauto.rtosam.service.admin.ResponseService;
|
||||||
|
import com.haitongauto.rtosam.service.base.FeedbackService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/feedback")
|
||||||
|
public class FeedbackControllerl{
|
||||||
|
@Autowired
|
||||||
|
FeedbackService feedbackService;
|
||||||
|
@Autowired
|
||||||
|
ResponseService response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param feedback 意见反馈实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/insert")
|
||||||
|
public String insert(Feedback feedback){
|
||||||
|
//添加到数据库
|
||||||
|
String x = feedbackService.insert(feedback);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x.length() > 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 意见反馈id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/logicDel")
|
||||||
|
public String logicDel(String id){
|
||||||
|
Integer x = feedbackService.logicDel(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 意见反馈id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/delete")
|
||||||
|
public String delete(String id){
|
||||||
|
Integer x = feedbackService.delete(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param feedback 意见反馈实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/update")
|
||||||
|
public String update(Feedback feedback){
|
||||||
|
Integer x = feedbackService.update(feedback);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
//查询指定Id的记录
|
||||||
|
@RequestMapping("/getById")
|
||||||
|
public String getById(String id){
|
||||||
|
Feedback feedback = feedbackService.getById(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = feedback != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("Feedback",feedback);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
//列表
|
||||||
|
@RequestMapping("/getList")
|
||||||
|
public String getList(){
|
||||||
|
List<Feedback> mylist = feedbackService.getList();
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = (mylist!=null) ? true : false;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("FeedbackList",mylist);
|
||||||
|
//添加到返回对象
|
||||||
|
String dataJson = response.getResponseData(bl,data);
|
||||||
|
//返回
|
||||||
|
return dataJson;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,129 @@
|
||||||
|
package com.haitongauto.rtosam.api.base;
|
||||||
|
|
||||||
|
import com.haitongauto.models.pojo.NoviceIntroduction;
|
||||||
|
import com.haitongauto.rtosam.service.admin.ResponseService;
|
||||||
|
import com.haitongauto.rtosam.service.base.NoviceIntroductionService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/noviceIntroduction")
|
||||||
|
public class NoviceIntroductionController{
|
||||||
|
@Autowired
|
||||||
|
NoviceIntroductionService noviceIntroductionService;
|
||||||
|
@Autowired
|
||||||
|
ResponseService response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param noviceIntroduction 新手攻略实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/insert")
|
||||||
|
public String insert(NoviceIntroduction noviceIntroduction){
|
||||||
|
//添加到数据库
|
||||||
|
String x = noviceIntroductionService.insert(noviceIntroduction);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x.length() > 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 新手攻略id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/logicDel")
|
||||||
|
public String logicDel(String id){
|
||||||
|
Integer x = noviceIntroductionService.logicDel(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 新手攻略id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/delete")
|
||||||
|
public String delete(String id){
|
||||||
|
Integer x = noviceIntroductionService.delete(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param noviceIntroduction 新手攻略实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/update")
|
||||||
|
public String update(NoviceIntroduction noviceIntroduction){
|
||||||
|
Integer x = noviceIntroductionService.update(noviceIntroduction);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 新手攻略id
|
||||||
|
* @return 返回新手攻略信息
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getById")
|
||||||
|
public String getById(String id){
|
||||||
|
NoviceIntroduction noviceIntroduction = noviceIntroductionService.getById(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = noviceIntroduction != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("NoviceIntroduction",noviceIntroduction);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询新手攻略信息列表
|
||||||
|
* @return 返回新手攻略信息列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getList")
|
||||||
|
public String getList(){
|
||||||
|
List<NoviceIntroduction> mylist = noviceIntroductionService.getList();
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = mylist != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("NoviceIntroductionList",mylist);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,129 @@
|
||||||
|
package com.haitongauto.rtosam.api.base;
|
||||||
|
|
||||||
|
import com.haitongauto.models.pojo.PortArea;
|
||||||
|
import com.haitongauto.rtosam.service.admin.ResponseService;
|
||||||
|
import com.haitongauto.rtosam.service.base.PortAreasService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/portAreas")
|
||||||
|
public class PortAreasController {
|
||||||
|
@Autowired
|
||||||
|
PortAreasService portAreasService;
|
||||||
|
@Autowired
|
||||||
|
ResponseService response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param portArea 港区实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/insert")
|
||||||
|
public String insert(PortArea portArea){
|
||||||
|
//添加到数据库
|
||||||
|
String x = portAreasService.insert(portArea);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x.length() > 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 港区id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/logicDel")
|
||||||
|
public String logicDel(String id){
|
||||||
|
Integer x = portAreasService.logicDel(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 港区id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/delete")
|
||||||
|
public String delete(String id){
|
||||||
|
Integer x = portAreasService.delete(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param portArea 港区实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/update")
|
||||||
|
public String update(PortArea portArea){
|
||||||
|
Integer x =portAreasService.update(portArea);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 港区id
|
||||||
|
* @return 返回指定Id的港区
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getById")
|
||||||
|
public String getById(String id){
|
||||||
|
PortArea portArea = portAreasService.getById(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = portArea != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("PortArea",portArea);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询港区列表
|
||||||
|
* @return 返回港区列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getList")
|
||||||
|
public String getList(){
|
||||||
|
List<PortArea> mylist = portAreasService.getList();
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = mylist != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("PortAreasList",mylist);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,129 @@
|
||||||
|
package com.haitongauto.rtosam.api.base;
|
||||||
|
|
||||||
|
import com.haitongauto.models.pojo.PunchClock;
|
||||||
|
import com.haitongauto.rtosam.service.admin.ResponseService;
|
||||||
|
import com.haitongauto.rtosam.service.base.PunchClockService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/punchClock")
|
||||||
|
public class PunchClockController {
|
||||||
|
@Autowired
|
||||||
|
PunchClockService punchClockService;
|
||||||
|
@Autowired
|
||||||
|
ResponseService response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加数据,并返回Id
|
||||||
|
* @param punchClock 打卡实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/insert")
|
||||||
|
public String insert(PunchClock punchClock){
|
||||||
|
//添加到数据库
|
||||||
|
String x = punchClockService.insert(punchClock);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x.length() > 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 打卡id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/logicDel")
|
||||||
|
public String logicDel(String id){
|
||||||
|
Integer x = punchClockService.logicDel(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 打卡id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/delete")
|
||||||
|
public String delete(String id){
|
||||||
|
Integer x = punchClockService.delete(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param punchClock 打卡实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/update")
|
||||||
|
public String update(PunchClock punchClock){
|
||||||
|
Integer x = punchClockService.update(punchClock);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 打卡id
|
||||||
|
* @return 返回打卡信息
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getById")
|
||||||
|
public String getById(String id){
|
||||||
|
PunchClock punchClock = punchClockService.getById(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = punchClock != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("PunchClock",punchClock);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询打卡列表
|
||||||
|
* @return 返回打卡信息列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getList")
|
||||||
|
public String getList(){
|
||||||
|
List<PunchClock> mylist = punchClockService.getList();
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = mylist != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("PunchClockList",mylist);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,129 @@
|
||||||
|
package com.haitongauto.rtosam.api.base;
|
||||||
|
|
||||||
|
import com.haitongauto.models.pojo.ServiceConfig;
|
||||||
|
import com.haitongauto.rtosam.service.admin.ResponseService;
|
||||||
|
import com.haitongauto.rtosam.service.base.ServiceConfigService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/serviceConfig")
|
||||||
|
public class ServiceConfigController {
|
||||||
|
@Autowired
|
||||||
|
ServiceConfigService serviceConfigService;
|
||||||
|
@Autowired
|
||||||
|
ResponseService response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param serviceConfig 服务配置实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/insert")
|
||||||
|
public String insert(ServiceConfig serviceConfig){
|
||||||
|
//添加到数据库
|
||||||
|
String x = serviceConfigService.insert(serviceConfig);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x.length() > 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 服务配置id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/logicDel")
|
||||||
|
public String logicDel(String id){
|
||||||
|
Integer x = serviceConfigService.logicDel(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 服务配置id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/delete")
|
||||||
|
public String delete(String id){
|
||||||
|
Integer x = serviceConfigService.delete(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param serviceConfig 服务配置实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/update")
|
||||||
|
public String update(ServiceConfig serviceConfig){
|
||||||
|
Integer x = serviceConfigService.update(serviceConfig);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 服务配置id
|
||||||
|
* @return 返回服务配置信息
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getById")
|
||||||
|
public String getById(String id){
|
||||||
|
ServiceConfig serviceConfig = serviceConfigService.getById(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = serviceConfig != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("ServiceConfig",serviceConfig);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询服务配置信息列表
|
||||||
|
* @return 返回服务配置信息列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getList")
|
||||||
|
public String getList(){
|
||||||
|
List<ServiceConfig> mylist = serviceConfigService.getList();
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = mylist != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("ServiceConfigList",mylist);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,129 @@
|
||||||
|
package com.haitongauto.rtosam.api.base;
|
||||||
|
|
||||||
|
import com.haitongauto.models.pojo.Truck;
|
||||||
|
import com.haitongauto.rtosam.service.admin.ResponseService;
|
||||||
|
import com.haitongauto.rtosam.service.base.TruckService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/truck")
|
||||||
|
public class TruckController {
|
||||||
|
@Autowired
|
||||||
|
TruckService truckService;
|
||||||
|
@Autowired
|
||||||
|
ResponseService response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param palletTruck 板车实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/insert")
|
||||||
|
public String insert(Truck palletTruck){
|
||||||
|
//添加到数据库
|
||||||
|
String x = truckService.insert(palletTruck);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x.length() > 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 板车id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/logicDel")
|
||||||
|
public String logicDel(String id){
|
||||||
|
Integer x = truckService.logicDel(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 板车id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/delete")
|
||||||
|
public String delete(String id){
|
||||||
|
Integer x = truckService.delete(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param palletTruck 板车实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/update")
|
||||||
|
public String update(Truck palletTruck){
|
||||||
|
Integer x = truckService.update(palletTruck);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 板车id
|
||||||
|
* @return 返回指定的Id板车
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getById")
|
||||||
|
public String getById(String id){
|
||||||
|
Truck palletTruck = truckService.getById(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = palletTruck != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("PalletTruck",palletTruck);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询板车列表
|
||||||
|
* @return 返回板车列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getList")
|
||||||
|
public String getList(){
|
||||||
|
List<Truck> mylist = truckService.getList();
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = mylist != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("PalletTruckList",mylist);
|
||||||
|
//封装到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,128 @@
|
||||||
|
package com.haitongauto.rtosam.api.base;
|
||||||
|
|
||||||
|
import com.haitongauto.models.pojo.TruckManagement;
|
||||||
|
import com.haitongauto.rtosam.service.admin.ResponseService;
|
||||||
|
import com.haitongauto.rtosam.service.base.TruckManagementService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/truckManagement")
|
||||||
|
public class TruckManagementController {
|
||||||
|
@Autowired
|
||||||
|
TruckManagementService truckManagementService;
|
||||||
|
@Autowired
|
||||||
|
ResponseService response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param truckManagement 板车管理实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/insert")
|
||||||
|
public String insert(TruckManagement truckManagement){
|
||||||
|
//添加到数据库
|
||||||
|
String x = truckManagementService.insert(truckManagement);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x.length() > 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 板车管理id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/logicDel")
|
||||||
|
public String logicDel(String id){
|
||||||
|
Integer x = truckManagementService.logicDel(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 板车管理id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/delete")
|
||||||
|
public String delete(String id){
|
||||||
|
Integer x = truckManagementService.delete(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param truckManagement 板车管理实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/update")
|
||||||
|
public String update(TruckManagement truckManagement){
|
||||||
|
Integer x = truckManagementService.update(truckManagement);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 板车管理id
|
||||||
|
* @return 返回指定Id的记录
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getById")
|
||||||
|
public String getById(String id){
|
||||||
|
TruckManagement truckManagement = truckManagementService.getById(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = truckManagement != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("TruckManagement",truckManagement);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询板车管理列表
|
||||||
|
* @return 返回板车管理列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getList")
|
||||||
|
public String getList(){
|
||||||
|
List<TruckManagement> mylist = truckManagementService.getList();
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = mylist != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("TruckManagementList",mylist);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,128 @@
|
||||||
|
package com.haitongauto.rtosam.api.base;
|
||||||
|
|
||||||
|
import com.haitongauto.models.pojo.Users;
|
||||||
|
import com.haitongauto.rtosam.service.admin.ResponseService;
|
||||||
|
import com.haitongauto.rtosam.service.base.UsersService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/users")
|
||||||
|
public class UsersController {
|
||||||
|
@Autowired
|
||||||
|
UsersService usersService;
|
||||||
|
@Autowired
|
||||||
|
ResponseService response;
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param users 用户实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/insert")
|
||||||
|
public String insert(Users users){
|
||||||
|
//添加到数据库
|
||||||
|
String x = usersService.insert(users);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x.length() > 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 用户id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/logicDel")
|
||||||
|
public String logicDel(String id){
|
||||||
|
Integer x = usersService.logicDel(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 用户id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/delete")
|
||||||
|
public String delete(String id){
|
||||||
|
Integer x = usersService.delete(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param users 用户实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/update")
|
||||||
|
public String update(Users users){
|
||||||
|
Integer x = usersService.update(users);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = x != null && x != 0;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("result",x);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 用户id
|
||||||
|
* @return 返回指定Id的用户
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getById")
|
||||||
|
public String getById(String id){
|
||||||
|
Users users = usersService.getById(id);
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = users != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("Users",users);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户列表表
|
||||||
|
* @return 返回用户列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getList")
|
||||||
|
public String getList(){
|
||||||
|
List<Users> mylist = usersService.getList();
|
||||||
|
//判断请求是否成功
|
||||||
|
Boolean bl = mylist != null;
|
||||||
|
//创建返回数据data
|
||||||
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
data.put("UsersList",mylist);
|
||||||
|
//添加到返回对象
|
||||||
|
//返回
|
||||||
|
return response.getResponseData(bl,data);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,67 @@
|
||||||
|
package com.haitongauto.rtosam.job;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
public class FileDeleteJob {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定时器
|
||||||
|
*/
|
||||||
|
TimerTask timerTask = new TimerTask() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
fileDel();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定时删除导出文件缓存
|
||||||
|
*/
|
||||||
|
public void doFileDeleteJob() {
|
||||||
|
Timer timer = new Timer();
|
||||||
|
timer.schedule(timerTask, new Date(), 60 * 60 * 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除导出文件缓存
|
||||||
|
*/
|
||||||
|
private void fileDel() {
|
||||||
|
List<File> fielNameList = new ArrayList<>();
|
||||||
|
File pdffile = new File("wx-applet-admin/src/main/resources/static/doc/pdf/");
|
||||||
|
File exlfile = new File("wx-applet-admin/src/main/resources/static/doc/exl/");
|
||||||
|
List<File> pdffileList = this.getAllFiles(pdffile);
|
||||||
|
List<File> exlfileList = this.getAllFiles(exlfile);
|
||||||
|
if (pdffileList.size() > 0) {
|
||||||
|
fielNameList.addAll(pdffileList);
|
||||||
|
}
|
||||||
|
if (exlfileList.size() > 0) {
|
||||||
|
fielNameList.addAll(exlfileList);
|
||||||
|
}
|
||||||
|
if (fielNameList.size() > 0) {
|
||||||
|
for (File myFile : fielNameList) {
|
||||||
|
boolean res = myFile.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param dir 文件或文件夹
|
||||||
|
* @return 返回文件集合
|
||||||
|
*/
|
||||||
|
private List<File> getAllFiles(File dir) {
|
||||||
|
List<File> fileList = new ArrayList<>();
|
||||||
|
if (dir.isDirectory()) {
|
||||||
|
File[] subFiles = dir.listFiles();
|
||||||
|
if (subFiles != null) {
|
||||||
|
for (File subFile : subFiles) {
|
||||||
|
fileList.addAll(getAllFiles(subFile));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
fileList.add(dir);
|
||||||
|
}
|
||||||
|
return fileList;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.haitongauto.rtosam.service.admin;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.haitongauto.models.dto.AnnouncementsDto;
|
||||||
|
import com.haitongauto.models.pojo.Announcement;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface AnnouncementAdminService {
|
||||||
|
/**
|
||||||
|
* 获取发布人员(作者)去重列表
|
||||||
|
* @return 返回发布人员(作者)列表
|
||||||
|
*/
|
||||||
|
List<String> getAuthorList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据特定条件查询历史公告
|
||||||
|
* @param tilKeywords:标题关键字
|
||||||
|
* @param dateStart:日期范围之起始发布日期
|
||||||
|
* @param dateEnd:日期范围之截止发布日期
|
||||||
|
* @param sort:类别(1-小程序,2-客服平台)
|
||||||
|
* @param authors:作者/发布人/操作员
|
||||||
|
* @param pageNum:当前页码
|
||||||
|
* @param pageSize:每页激流条数
|
||||||
|
* @return 返回根据特定条件查询历史公告
|
||||||
|
*/
|
||||||
|
PageInfo<Announcement> AnnouncementListForCondition(String tilKeywords, String dateStart, String dateEnd, Integer sort, String authors, Integer pageNum, Integer pageSize);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取一周的公告
|
||||||
|
*/
|
||||||
|
List<Announcement> AnnouncementListForWeek();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告信息转换Dto
|
||||||
|
* @param list 公告信息列表
|
||||||
|
* @return 返回公告信息列表
|
||||||
|
*/
|
||||||
|
List<AnnouncementsDto> AnnouncementListConvert(List<Announcement> list);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.haitongauto.rtosam.service.admin;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.haitongauto.models.dto.AppointmentQuery;
|
||||||
|
import com.haitongauto.models.dto.AppointmentQueryExl;
|
||||||
|
import com.haitongauto.models.pojo.Appointment;
|
||||||
|
import com.haitongauto.models.pojo.AppointmentDetail;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface AppointmentAdminService {
|
||||||
|
/**
|
||||||
|
* 车辆预约:通过港区、司机关键字、预约时间范围、进港类型、状态(1-已预约,0-已取消)、运输方式(0-自开/1-板车运输)单独或组合查询
|
||||||
|
*
|
||||||
|
* @param port_area_id:港区id
|
||||||
|
* @param keywords:关键字(姓名、手机号、板车号)
|
||||||
|
* @param start_date:时间范围开始
|
||||||
|
* @param end_date:时间范围结束
|
||||||
|
* @param enter_type:进港类型(1-外贸出口,2-外贸进口,2-整车物流,3-特保区出口,4-特保区进口,5-内贸出口,6-内贸进口)
|
||||||
|
* @param appointment_state:预约状态(0-已取消,1-已预约)
|
||||||
|
* @param transport_type:运输方式(0-自开/1-板车运)
|
||||||
|
* @param pageNum:当前页码
|
||||||
|
* @param pageSize:每页激流条数
|
||||||
|
* @return 返回车辆预约
|
||||||
|
*/
|
||||||
|
PageInfo<Appointment> AppointmentListForCondition(String users_id,String port_area_id, String keywords, String start_date, String end_date, String enter_type, Integer appointment_state, String transport_type, Integer pageNum, Integer pageSize);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆预约导出
|
||||||
|
*
|
||||||
|
* @param pam_id:港区id
|
||||||
|
* @param keywords:关键字(姓名、手机号、板车号)
|
||||||
|
* @param start_date:时间范围开始
|
||||||
|
* @param end_date:时间范围结束
|
||||||
|
* @param enter_type:进港类型(1-外贸出口,2-外贸进口,2-整车物流,3-特保区出口,4-特保区进口,5-内贸出口,6-内贸进口)
|
||||||
|
* @param appointment_state:预约状态(0-已取消,1-已预约)
|
||||||
|
* @param transport_type:运输方式(2-自开/1-板车运)
|
||||||
|
* @return 返回车辆预约列表
|
||||||
|
*/
|
||||||
|
List<Appointment> AppointmentListExporty(String users_id, String pam_id, String keywords, String start_date, String end_date, String enter_type, Integer appointment_state, String transport_type);
|
||||||
|
|
||||||
|
List<Appointment> AppointmentListExportyByIds(List<String>ids);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取指定预约的货物明细
|
||||||
|
*
|
||||||
|
* @param appointment_id 预约id
|
||||||
|
* @return 预约详情列表
|
||||||
|
*/
|
||||||
|
List<AppointmentDetail> appointmentGoodsDetail(String appointment_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List<Appointment>转List<AppointmentQuery>
|
||||||
|
*
|
||||||
|
* @param myList: List<Appointment>预约查询列表数据
|
||||||
|
* @return 返回预约查询列表数据
|
||||||
|
*/
|
||||||
|
List<AppointmentQuery> AppointmentListConvert(List<Appointment> myList);
|
||||||
|
|
||||||
|
public List<AppointmentQueryExl> AppointmentListConvert1(List<Appointment> myList);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.haitongauto.rtosam.service.admin;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.haitongauto.models.pojo.Feedback;
|
||||||
|
|
||||||
|
public interface FeedbackAdminService {
|
||||||
|
/**
|
||||||
|
* 根据联系方式、用户名称查询意见反馈分页数据
|
||||||
|
* @param linkTel 联系方式
|
||||||
|
* @param nikeName 名称
|
||||||
|
* @param pageNum 页码
|
||||||
|
* @param pageSize 数据条数
|
||||||
|
* @return 返回意见反馈分页数据
|
||||||
|
*/
|
||||||
|
PageInfo<Feedback> feedbackListForCondition(String users_id, String linkTel, String nikeName, Integer pageNum, Integer pageSize);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,151 @@
|
||||||
|
package com.haitongauto.rtosam.service.admin.Impl;
|
||||||
|
|
||||||
|
import com.bestvike.linq.Linq;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.haitongauto.models.dto.AnnouncementsDto;
|
||||||
|
import com.haitongauto.models.pojo.Announcement;
|
||||||
|
import com.haitongauto.rtosam.service.admin.AnnouncementAdminService;
|
||||||
|
import com.haitongauto.mapper.admin.AnnouncementAdminMapper;
|
||||||
|
import com.haitongauto.utils.StringHelper;
|
||||||
|
import org.apache.commons.lang3.StringEscapeUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class AnnouncementAdminServiceImpl implements AnnouncementAdminService {
|
||||||
|
@Autowired
|
||||||
|
AnnouncementAdminMapper announcementAdminMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取发布人员(作者)去重列表
|
||||||
|
*
|
||||||
|
* @return 返回发布人员(作者)列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<String> getAuthorList() {
|
||||||
|
return announcementAdminMapper.getAuthorList();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据特定条件查询历史公告
|
||||||
|
* @param tilKeywords:标题关键字
|
||||||
|
* @param dateStart:日期范围之起始发布日期
|
||||||
|
* @param dateEnd:日期范围之截止发布日期
|
||||||
|
* @param sort:类别(1-小程序,2-客服平台)
|
||||||
|
* @param authors:作者/发布人/操作员
|
||||||
|
* @param pageNum:当前页码
|
||||||
|
* @param pageSize:每页激流条数
|
||||||
|
* @return 返回根据特定条件查询历史公告
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PageInfo<Announcement> AnnouncementListForCondition(String tilKeywords, String dateStart, String dateEnd, Integer sort, String authors, Integer pageNum, Integer pageSize) {
|
||||||
|
List<String> authorslist = null;
|
||||||
|
if (authors != null && !authors.isEmpty()) {
|
||||||
|
authorslist = Linq.of(authors.split(",")).toList();
|
||||||
|
}
|
||||||
|
//初始化PageHelper
|
||||||
|
PageHelper.startPage(pageNum, pageSize,true,false,false);
|
||||||
|
//查询数据库
|
||||||
|
List<Announcement> mylist = announcementAdminMapper.AnnouncementListForCondition(tilKeywords, dateStart, dateEnd, sort, authorslist);
|
||||||
|
if (mylist != null && mylist.size() > 0) {
|
||||||
|
for (Announcement item : mylist) {
|
||||||
|
String announcement = item.getAnnouncement();
|
||||||
|
if (announcement != null && !announcement.isEmpty()) {
|
||||||
|
String decodedHtml = StringEscapeUtils.unescapeHtml4(announcement);
|
||||||
|
item.setAnnouncement(decodedHtml);
|
||||||
|
|
||||||
|
String announcement_text = "";
|
||||||
|
if (decodedHtml != null && !decodedHtml.isEmpty()) {
|
||||||
|
announcement_text = StringHelper.getTxtByHtml(decodedHtml);
|
||||||
|
}
|
||||||
|
item.setAnnouncement_text(announcement_text);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//封装分页数据
|
||||||
|
PageInfo<Announcement> pageInfo = new PageInfo<Announcement>(mylist);
|
||||||
|
//返回
|
||||||
|
return pageInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Announcement> AnnouncementListForWeek() {
|
||||||
|
List<Announcement> announcementList = null;
|
||||||
|
announcementList = announcementAdminMapper.AnnouncementListForWeek();
|
||||||
|
if (announcementList != null && announcementList.size() > 0) {
|
||||||
|
for (Announcement item : announcementList) {
|
||||||
|
String announcement = item.getAnnouncement();
|
||||||
|
if (announcement != null && !announcement.isEmpty()) {
|
||||||
|
String decodedHtml = StringEscapeUtils.unescapeHtml4(announcement);
|
||||||
|
item.setAnnouncement(decodedHtml);
|
||||||
|
}
|
||||||
|
String announcement_text = "";
|
||||||
|
if (announcement != null && !announcement.isEmpty()) {
|
||||||
|
announcement_text = StringHelper.getTxtByHtml(announcement);
|
||||||
|
}
|
||||||
|
item.setAnnouncement_text(announcement_text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告信息转换Dto
|
||||||
|
*
|
||||||
|
* @param list 公告信息列表
|
||||||
|
* @return 返回公告信息列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<AnnouncementsDto> AnnouncementListConvert(List<Announcement> list) {
|
||||||
|
List<AnnouncementsDto> announcementsDtoList = new ArrayList<>();
|
||||||
|
if (list != null && list.size() > 0) {
|
||||||
|
for (Announcement item : list) {
|
||||||
|
AnnouncementsDto announcementsDto = new AnnouncementsDto();
|
||||||
|
announcementsDto.setId(item.getId());
|
||||||
|
announcementsDto.setTitle(item.getTitle());
|
||||||
|
announcementsDto.setSort(item.getSort());
|
||||||
|
if (item.getSort() != null) {
|
||||||
|
switch (item.getSort()) {
|
||||||
|
case 1:
|
||||||
|
announcementsDto.setSort_name("小程序");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
announcementsDto.setSort_name("客服平台");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
announcementsDto.setAbstracts(item.getAbstracts());
|
||||||
|
announcementsDto.setAnnouncement(item.getAnnouncement());
|
||||||
|
announcementsDto.setAuthor(item.getAuthor());
|
||||||
|
announcementsDto.setReading_volume(item.getReading_volume());
|
||||||
|
if (item.getCreate_time() != null) {
|
||||||
|
announcementsDto.setCreate_time(item.getCreate_time());
|
||||||
|
}
|
||||||
|
if (item.getUpdate_time() != null) {
|
||||||
|
announcementsDto.setUpdate_time(item.getUpdate_time());
|
||||||
|
}
|
||||||
|
announcementsDto.setIs_del(item.getIs_del());
|
||||||
|
|
||||||
|
|
||||||
|
String announcement = item.getAnnouncement();
|
||||||
|
String announcement_text = "";
|
||||||
|
if (announcement != null && !announcement.isEmpty()) {
|
||||||
|
announcement_text = StringHelper.getTxtByHtml(announcement);
|
||||||
|
}
|
||||||
|
item.setAnnouncement_text(announcement_text);
|
||||||
|
announcementsDto.setAnnouncement_text(announcement_text);
|
||||||
|
announcementsDtoList.add(announcementsDto);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return announcementsDtoList;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,333 @@
|
||||||
|
package com.haitongauto.rtosam.service.admin.Impl;
|
||||||
|
|
||||||
|
import com.bestvike.linq.Linq;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.haitongauto.interfaces.DicInterface;
|
||||||
|
import com.haitongauto.interfaces.PortAreaInterface;
|
||||||
|
import com.haitongauto.mapper.base.*;
|
||||||
|
import com.haitongauto.models.dto.AppointmentQueryExl;
|
||||||
|
import com.haitongauto.models.dto.DicDto;
|
||||||
|
import com.haitongauto.models.pojo.*;
|
||||||
|
import com.haitongauto.models.pojo.AppointmentDetail;
|
||||||
|
import com.haitongauto.rtosam.service.admin.AppointmentAdminService;
|
||||||
|
import com.haitongauto.mapper.admin.AppointmentAdminMapper;
|
||||||
|
import com.haitongauto.models.dto.AppointmentQuery;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class AppointmentAdminServiceImpl implements AppointmentAdminService {
|
||||||
|
@Autowired
|
||||||
|
AppointmentAdminMapper appointmentAdminMapper;
|
||||||
|
@Autowired
|
||||||
|
UsersMapper usersMapper;
|
||||||
|
@Autowired
|
||||||
|
PortAreaInterface portAreaInterface;
|
||||||
|
@Autowired
|
||||||
|
DicInterface dicInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆预约:通过港区、司机关键字、预约时间范围、进港类型、状态(1-已预约,0-已取消)、运输方式(0-自开/1-板车运输)单独或组合查询
|
||||||
|
*
|
||||||
|
* @param port_area_id:港区id
|
||||||
|
* @param keywords:关键字(姓名、手机号、板车号)
|
||||||
|
* @param start_date:时间范围开始
|
||||||
|
* @param end_date:时间范围结束
|
||||||
|
* @param enter_type:进港类型(1-外贸出口,2-外贸进口,2-整车物流,3-特保区出口,4-特保区进口,5-内贸出口,6-内贸进口)
|
||||||
|
* @param appointment_state:预约状态(0-已取消,1-已预约)
|
||||||
|
* @param transport_type:运输方式(0-自开/1-板车运)
|
||||||
|
* @param pageNum:当前页码
|
||||||
|
* @param pageSize:每页激流条数
|
||||||
|
* @return 返回车辆预约
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PageInfo<Appointment> AppointmentListForCondition(String users_id, String port_area_id, String keywords, String start_date, String end_date, String enter_type, Integer appointment_state, String transport_type, Integer pageNum, Integer pageSize) {
|
||||||
|
//初始化PageHelper
|
||||||
|
PageHelper.startPage(pageNum, pageSize, true, false, false);
|
||||||
|
//PageHelper.startPage(pageNum, pageSize);
|
||||||
|
//读取数据
|
||||||
|
List<Appointment> myList = appointmentAdminMapper.AppointmentListForCondition(users_id, port_area_id, keywords, start_date, end_date, enter_type, appointment_state, transport_type);
|
||||||
|
//封装分页数据
|
||||||
|
//返回
|
||||||
|
return new PageInfo<Appointment>(myList, pageNum);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆预约导出
|
||||||
|
*
|
||||||
|
* @param pam_id:港区id
|
||||||
|
* @param keywords:关键字(姓名、手机号、板车号)
|
||||||
|
* @param start_date:时间范围开始
|
||||||
|
* @param end_date:时间范围结束
|
||||||
|
* @param enter_type:进港类型(1-外贸出口,2-外贸进口,2-整车物流,3-特保区出口,4-特保区进口,5-内贸出口,6-内贸进口)
|
||||||
|
* @param appointment_state:预约状态(0-已取消,1-已预约)
|
||||||
|
* @param transport_type:运输方式(2-自开/1-板车运)
|
||||||
|
* @return 返回车辆预约列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Appointment> AppointmentListExporty(String users_id, String pam_id, String keywords, String start_date, String end_date, String enter_type, Integer appointment_state, String transport_type) {
|
||||||
|
//读取数据
|
||||||
|
List<Appointment> myList = appointmentAdminMapper.AppointmentListForCondition(users_id, pam_id, keywords, start_date, end_date, enter_type, appointment_state, transport_type);
|
||||||
|
//返回
|
||||||
|
return myList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Appointment> AppointmentListExportyByIds(List<String> ids) {
|
||||||
|
return appointmentAdminMapper.AppointmentListExportyByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取指定预约的货物明细
|
||||||
|
*
|
||||||
|
* @param appointment_id 预约id
|
||||||
|
* @return 预约详情列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<AppointmentDetail> appointmentGoodsDetail(String appointment_id) {
|
||||||
|
return appointmentAdminMapper.appointmentGoodsDetail(appointment_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List<Appointment>转List<AppointmentQuery>
|
||||||
|
*
|
||||||
|
* @param myList: List<Appointment>预约查询列表数据
|
||||||
|
* @return 返回预约查询列表数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<AppointmentQuery> AppointmentListConvert(List<Appointment> myList) {
|
||||||
|
List<AppointmentQuery> appointmentList = new ArrayList<>();
|
||||||
|
//初始化日期时间格式
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
//初始化进场预约类型(1-全部,2-码头业务,3-整车物流,4-特保区预约)貌似已经取消
|
||||||
|
|
||||||
|
//初始化进港类型
|
||||||
|
List<DicDto> enterPortTypeList = dicInterface.getDicList("ENTER_PORT_TYPE");
|
||||||
|
|
||||||
|
//初始化运输方式(1-板车运输,2-自开)
|
||||||
|
List<DicDto> transportTypeList = dicInterface.getDicList("TRANSPORT_TYPE");
|
||||||
|
|
||||||
|
//初始化货物类型(商品车/设备/其他...)
|
||||||
|
List<DicDto> cargoTypeList = dicInterface.getDicList("APP_CARGO_TYPE");
|
||||||
|
|
||||||
|
//初始化预约状态
|
||||||
|
Map<Integer, String> appointmentStateMap = new HashMap<>();
|
||||||
|
appointmentStateMap.put(1, "已预约");
|
||||||
|
appointmentStateMap.put(2, "已签到");
|
||||||
|
appointmentStateMap.put(3, "已进港");
|
||||||
|
appointmentStateMap.put(4, "已取消");
|
||||||
|
appointmentStateMap.put(5, "作业中");
|
||||||
|
appointmentStateMap.put(6, "已完成");
|
||||||
|
appointmentStateMap.put(7, "已离港");
|
||||||
|
appointmentStateMap.put(9, "异常");
|
||||||
|
//港区信息改用从哪吒接口取数据
|
||||||
|
List<PortArea> portAreaList = null;
|
||||||
|
//注释后期需要解开,从哪吒接口取数据
|
||||||
|
try {
|
||||||
|
portAreaList = portAreaInterface.getPortArea();
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Appointment appointment : myList) {
|
||||||
|
//获取用户和港区信息
|
||||||
|
Users users = usersMapper.getById(appointment.getUsers_id());
|
||||||
|
//港区信息改用从哪吒接口取数据
|
||||||
|
//PortArea portAreas = portAreasMapper.getById(appointment.getPort_area_id());
|
||||||
|
PortArea portArea = null;
|
||||||
|
if (portAreaList != null) {
|
||||||
|
portArea = Linq.of(portAreaList).firstOrDefault(p -> p.getId().equals(appointment.getPort_area_id()));
|
||||||
|
}
|
||||||
|
//创建预约查询实例
|
||||||
|
AppointmentQuery appointmentQuery = new AppointmentQuery();
|
||||||
|
appointmentQuery.setAppointment_id(appointment.getId()); //-'预约id';
|
||||||
|
appointmentQuery.setTel_number(appointment.getTel_number()); //-'手机号';
|
||||||
|
appointmentQuery.setTruck_number(appointment.getTruck_number()); //-'板车号'
|
||||||
|
appointmentQuery.setHead_frame_number(appointment.getTruck_vin()); //-'车头车架号'
|
||||||
|
appointmentQuery.setVehicle_weight(appointment.getVehicle_weight()); //-'板车自重'
|
||||||
|
appointmentQuery.setVehicle_frame_weight(appointment.getVehicle_frame_weight()); //-'车架重'
|
||||||
|
appointmentQuery.setDriving_license_id(appointment.getDriving_license()); //-'行驶证ID'
|
||||||
|
appointmentQuery.setApproach_date(appointment.getApproach_date()); //-'进场日期'
|
||||||
|
appointmentQuery.setApproach_time(appointment.getCreate_time()); //-'预约时间'
|
||||||
|
appointmentQuery.setGoods_Quantity(appointment.getGoods_quantity()); //-'货物数量(件数)'
|
||||||
|
appointmentQuery.setOperator("从哪里找"); //-' 操作人'
|
||||||
|
//1预约类型
|
||||||
|
Integer appointment_type = appointment.getAppointment_type();
|
||||||
|
if (appointment_type.equals(1)) {
|
||||||
|
appointmentQuery.setAppointment_type_content("海通码头预约");
|
||||||
|
} else if (appointment_type.equals(2)) {
|
||||||
|
appointmentQuery.setAppointment_type_content("特保区预约");
|
||||||
|
}
|
||||||
|
|
||||||
|
//进港类型
|
||||||
|
if (appointment.getEnter_type() != null) {
|
||||||
|
String enter_type_name = "";
|
||||||
|
if (enterPortTypeList != null) {
|
||||||
|
DicDto enterPortType = Linq.of(enterPortTypeList).firstOrDefault(p -> p.getId().equals(appointment.getEnter_type()));
|
||||||
|
if (enterPortType != null) {
|
||||||
|
enter_type_name = enterPortType.getText();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
appointmentQuery.setEnter_type_name(enter_type_name);
|
||||||
|
}
|
||||||
|
//运输方式
|
||||||
|
if (appointment.getTransport_type() != null) {
|
||||||
|
String transport_type_name = "";
|
||||||
|
if (transportTypeList != null) {
|
||||||
|
DicDto transportType = Linq.of(transportTypeList).firstOrDefault(p -> p.getId().equals(appointment.getTransport_type()));
|
||||||
|
if (transportType != null) {
|
||||||
|
transport_type_name = transportType.getText();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
appointmentQuery.setTransport_type_name(transport_type_name);
|
||||||
|
}
|
||||||
|
//-'货物类型(商品车/设备...)'
|
||||||
|
if (appointment.getGoods_type() != null) {
|
||||||
|
String goods_type_name = "";
|
||||||
|
if (cargoTypeList != null) {
|
||||||
|
DicDto cargoType = Linq.of(cargoTypeList).firstOrDefault(p -> p.getId().equals(appointment.getGoods_type()));
|
||||||
|
if (cargoType != null) {
|
||||||
|
goods_type_name = cargoType.getText();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
appointmentQuery.setGoods_type_name(goods_type_name);
|
||||||
|
}
|
||||||
|
//-预约状态()
|
||||||
|
if (appointment.getAppointment_state() != null) {
|
||||||
|
appointmentQuery.setAppointment_state_content(appointmentStateMap.get(appointment.getAppointment_state()));//-预约状态()
|
||||||
|
appointmentQuery.setAppointment_state(appointment.getAppointment_state());
|
||||||
|
}
|
||||||
|
if (users != null) {
|
||||||
|
appointmentQuery.setUsers_name(users.getUsers_name()); //司机名称
|
||||||
|
appointmentQuery.setId_code(users.getId_code()); //身份证号码
|
||||||
|
//appointmentQuery.setOperator(users.getUsers_name());
|
||||||
|
}
|
||||||
|
if (portArea != null) {
|
||||||
|
appointmentQuery.setPort_area_name(portArea.getPort_area_name()); //-'进港港区'
|
||||||
|
}
|
||||||
|
appointmentList.add(appointmentQuery);
|
||||||
|
}
|
||||||
|
return appointmentList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AppointmentQueryExl> AppointmentListConvert1(List<Appointment> myList) {
|
||||||
|
List<AppointmentQueryExl> appointmentList = new ArrayList<>();
|
||||||
|
//初始化日期时间格式
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
//初始化进场预约类型(1-全部,2-码头业务,3-整车物流,4-特保区预约)貌似已经取消
|
||||||
|
|
||||||
|
//初始化进港类型
|
||||||
|
List<DicDto> enterPortTypeList = dicInterface.getDicList("ENTER_PORT_TYPE");
|
||||||
|
|
||||||
|
//初始化运输方式(1-板车运输,2-自开)
|
||||||
|
List<DicDto> transportTypeList = dicInterface.getDicList("TRANSPORT_TYPE");
|
||||||
|
|
||||||
|
//初始化货物类型(商品车/设备/其他...)
|
||||||
|
List<DicDto> cargoTypeList = dicInterface.getDicList("APP_CARGO_TYPE");
|
||||||
|
|
||||||
|
//初始化预约状态
|
||||||
|
Map<Integer, String> appointmentStateMap = new HashMap<>();
|
||||||
|
appointmentStateMap.put(1, "已预约");
|
||||||
|
appointmentStateMap.put(2, "已签到");
|
||||||
|
appointmentStateMap.put(3, "已进港");
|
||||||
|
appointmentStateMap.put(4, "已取消");
|
||||||
|
appointmentStateMap.put(5, "作业中");
|
||||||
|
appointmentStateMap.put(6, "已完成");
|
||||||
|
appointmentStateMap.put(7, "已离港");
|
||||||
|
appointmentStateMap.put(9, "异常");
|
||||||
|
//港区信息改用从哪吒接口取数据
|
||||||
|
List<PortArea> portAreaList = null;
|
||||||
|
//注释后期需要解开,从哪吒接口取数据
|
||||||
|
try {
|
||||||
|
portAreaList = portAreaInterface.getPortArea();
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Appointment appointment : myList) {
|
||||||
|
//获取用户和港区信息
|
||||||
|
Users users = usersMapper.getById(appointment.getUsers_id());
|
||||||
|
//港区信息改用从哪吒接口取数据
|
||||||
|
//PortArea portAreas = portAreasMapper.getById(appointment.getPort_area_id());
|
||||||
|
PortArea portArea = null;
|
||||||
|
if (portAreaList != null) {
|
||||||
|
portArea = Linq.of(portAreaList).firstOrDefault(p -> p.getId().equals(appointment.getPort_area_id()));
|
||||||
|
}
|
||||||
|
//创建预约查询实例
|
||||||
|
AppointmentQueryExl appointmentQuery = new AppointmentQueryExl();
|
||||||
|
//1预约类型
|
||||||
|
Integer appointment_type = appointment.getAppointment_type();
|
||||||
|
if (appointment_type.equals(1)) {
|
||||||
|
appointmentQuery.setAppointment_type_content("海通码头预约");
|
||||||
|
} else if (appointment_type.equals(2)) {
|
||||||
|
appointmentQuery.setAppointment_type_content("特保区预约");
|
||||||
|
}
|
||||||
|
appointmentQuery.setTel_number(appointment.getTel_number()); //-'手机号';
|
||||||
|
appointmentQuery.setTruck_number(appointment.getTruck_number()); //-'板车号'
|
||||||
|
appointmentQuery.setTruck_vin(appointment.getTruck_vin()); //-'车头车架号'
|
||||||
|
appointmentQuery.setVehicle_weight(appointment.getVehicle_weight()); //-'板车自重'
|
||||||
|
appointmentQuery.setVehicle_frame_weight(appointment.getVehicle_frame_weight()); //-'车架重'
|
||||||
|
appointmentQuery.setDriving_license(appointment.getDriving_license()); //-'行驶证ID'
|
||||||
|
appointmentQuery.setApproach_date(appointment.getApproach_date()); //-'进场日期'
|
||||||
|
appointmentQuery.setApproach_time(appointment.getCreate_time()); //-'预约时间'
|
||||||
|
appointmentQuery.setGoods_quantity(appointment.getGoods_quantity()); //-'货物数量(件数)'
|
||||||
|
appointmentQuery.setOperator("从哪里找"); //-' 操作人'
|
||||||
|
//进港类型
|
||||||
|
if (appointment.getEnter_type() != null) {
|
||||||
|
String enter_type_name = "";
|
||||||
|
if (enterPortTypeList != null) {
|
||||||
|
DicDto enterPortType = Linq.of(enterPortTypeList).firstOrDefault(p -> p.getId().equals(appointment.getEnter_type()));
|
||||||
|
if (enterPortType != null) {
|
||||||
|
enter_type_name = enterPortType.getText();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
appointmentQuery.setEnter_type_name(enter_type_name);
|
||||||
|
}
|
||||||
|
//运输方式
|
||||||
|
if (appointment.getTransport_type() != null) {
|
||||||
|
String transport_type_name = "";
|
||||||
|
if (transportTypeList != null) {
|
||||||
|
DicDto transportType = Linq.of(transportTypeList).firstOrDefault(p -> p.getId().equals(appointment.getTransport_type()));
|
||||||
|
if (transportType != null) {
|
||||||
|
transport_type_name = transportType.getText();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
appointmentQuery.setTransport_type_name(transport_type_name);
|
||||||
|
}
|
||||||
|
//-'货物类型(商品车/设备...)'
|
||||||
|
if (appointment.getGoods_type() != null) {
|
||||||
|
String goods_type_name = "";
|
||||||
|
if (cargoTypeList != null) {
|
||||||
|
DicDto cargoType = Linq.of(cargoTypeList).firstOrDefault(p -> p.getId().equals(appointment.getGoods_type()));
|
||||||
|
if (cargoType != null) {
|
||||||
|
goods_type_name = cargoType.getText();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
appointmentQuery.setGoods_type_name(goods_type_name);
|
||||||
|
}
|
||||||
|
//-预约状态()
|
||||||
|
if (appointment.getAppointment_state() != null) {
|
||||||
|
appointmentQuery.setAppointment_state_content(appointmentStateMap.get(appointment.getAppointment_state()));//-预约状态()
|
||||||
|
}
|
||||||
|
if (users != null) {
|
||||||
|
appointmentQuery.setUsers_name(users.getUsers_name()); //司机名称
|
||||||
|
appointmentQuery.setId_code(users.getId_code()); //身份证号码
|
||||||
|
appointmentQuery.setOperator(users.getUsers_name());
|
||||||
|
}
|
||||||
|
if (portArea != null) {
|
||||||
|
appointmentQuery.setPort_area_name(portArea.getPort_area_name()); //-'进港港区'
|
||||||
|
}
|
||||||
|
appointmentList.add(appointmentQuery);
|
||||||
|
}
|
||||||
|
return appointmentList;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.haitongauto.rtosam.service.admin.Impl;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.haitongauto.models.pojo.Feedback;
|
||||||
|
import com.haitongauto.rtosam.service.admin.FeedbackAdminService;
|
||||||
|
import com.haitongauto.mapper.admin.FeedbackAdminMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 意见反馈
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class FeedbackAdminServiceImpl implements FeedbackAdminService {
|
||||||
|
@Autowired
|
||||||
|
FeedbackAdminMapper feedbackAdminMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据联系方式、用户名称查询意见反馈分页数据
|
||||||
|
* @param linkTel 联系方式
|
||||||
|
* @param nikeName 名称
|
||||||
|
* @param pageNum 页码
|
||||||
|
* @param pageSize 数据条数
|
||||||
|
* @return 返回意见反馈分页数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PageInfo<Feedback> feedbackListForCondition(String users_id, String linkTel, String nikeName, Integer pageNum, Integer pageSize) {
|
||||||
|
//检查分页参数
|
||||||
|
pageNum = (pageNum != null && pageNum > 0) ? pageNum : 1; //当前页码
|
||||||
|
pageSize = (pageSize != null && pageSize > 0) ? pageSize : 10; //每页记录条数
|
||||||
|
//初始化PageHelper
|
||||||
|
PageHelper.startPage(pageNum, pageSize,true,false,false);
|
||||||
|
//查询数据库
|
||||||
|
List<Feedback> myList = feedbackAdminMapper.feedbackListForCondition(users_id, linkTel, nikeName);
|
||||||
|
//封装分页数据
|
||||||
|
return new PageInfo<Feedback>(myList);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.haitongauto.rtosam.service.admin.Impl;
|
||||||
|
import com.haitongauto.models.pojo.NoviceIntroduction;
|
||||||
|
import com.haitongauto.mapper.admin.NoviceIntroductionAdminMapper;
|
||||||
|
import com.haitongauto.rtosam.service.admin.NoviceIntroductionAdminService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class NoviceIntroductionAdminServiceImpl implements NoviceIntroductionAdminService {
|
||||||
|
@Autowired
|
||||||
|
NoviceIntroductionAdminMapper noviceIntroductionAdminMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据分类sort获取操作说明
|
||||||
|
* @param sort:(1-小程序,2-客服平台,3-App)
|
||||||
|
* @return 返回操作说明
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public NoviceIntroduction getNoviceIntroductionBySort(Integer sort){
|
||||||
|
return noviceIntroductionAdminMapper.getNoviceIntroductionBySort(sort);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,853 @@
|
||||||
|
package com.haitongauto.rtosam.service.admin.Impl;
|
||||||
|
|
||||||
|
import com.bestvike.IComparison;
|
||||||
|
import com.bestvike.linq.Linq;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.haitongauto.interfaces.DicInterface;
|
||||||
|
import com.haitongauto.interfaces.PortAreaInterface;
|
||||||
|
import com.haitongauto.mapper.admin.StatisticsAdminMapper;
|
||||||
|
import com.haitongauto.mapper.base.*;
|
||||||
|
import com.haitongauto.mapper.client.AppointmentExtendMapper;
|
||||||
|
import com.haitongauto.models.dto.DicDto;
|
||||||
|
import com.haitongauto.models.dto.Pages;
|
||||||
|
import com.haitongauto.models.dto.open.TruckUser;
|
||||||
|
import com.haitongauto.models.open.AppointmentCmd;
|
||||||
|
import com.haitongauto.models.open.AppointmentDetailSort;
|
||||||
|
import com.haitongauto.models.open.QueryCondition;
|
||||||
|
import com.haitongauto.models.pojo.*;
|
||||||
|
import com.haitongauto.rtosam.service.admin.OpenApiService;
|
||||||
|
import com.haitongauto.utils.FormatDateTime;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class OpenApiServiceImpl implements OpenApiService {
|
||||||
|
@Autowired
|
||||||
|
AppointmentExtendMapper appointmentExtendMapper;
|
||||||
|
@Autowired
|
||||||
|
AppointmentMapper appointmentMapper;
|
||||||
|
@Autowired
|
||||||
|
AppointmentDetailMapper appointmentDetailMapper;
|
||||||
|
@Autowired
|
||||||
|
PunchClockMapper punchClockMapper;
|
||||||
|
@Autowired
|
||||||
|
TruckMapper truckMapper;
|
||||||
|
@Autowired
|
||||||
|
UsersMapper usersMapper;
|
||||||
|
@Autowired
|
||||||
|
StatisticsAdminMapper statisticsAdminMapper;
|
||||||
|
@Autowired
|
||||||
|
DicMapper dicMapper;
|
||||||
|
@Autowired
|
||||||
|
PortAreaInterface portAreaInterface;
|
||||||
|
@Autowired
|
||||||
|
DicInterface dicInterface;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
PortAreasMapper portAreasMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过板车号或者省份证号,获得活跃(有效)预约信息
|
||||||
|
*
|
||||||
|
* @param truck_number
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Appointment getActiveAppointmentByTruckNumber(String truck_number) {
|
||||||
|
return appointmentExtendMapper.getActiveAppointmentByTruckNumber(truck_number);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过dicId查询 获得字典信息
|
||||||
|
*
|
||||||
|
* @param id 字典id
|
||||||
|
* @return 字典
|
||||||
|
*/
|
||||||
|
public Dic getDicById(String id) {
|
||||||
|
return dicMapper.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过板车号查询 最新的一条预约信息
|
||||||
|
*
|
||||||
|
* @param truck_number 拖车号
|
||||||
|
* @return 预约信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Appointment getAppointmentByTruckName(String truck_number) {
|
||||||
|
Appointment appointment = null;
|
||||||
|
appointment = appointmentMapper.getAppointmentByTruckName(truck_number);
|
||||||
|
return appointment;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过板车号查询 最新的一条预约信息
|
||||||
|
*
|
||||||
|
* @param vin 拖车车架
|
||||||
|
* @return 预约信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Appointment getAppointmentByVin(String vin) {
|
||||||
|
Appointment appointment = null;
|
||||||
|
List<Appointment> appointmentList = appointmentList = appointmentMapper.getAppointmentByVin(vin);
|
||||||
|
if (appointmentList != null && appointmentList.size() > 0) {
|
||||||
|
appointment = Linq.of(appointmentList).firstOrDefault();
|
||||||
|
}
|
||||||
|
return appointment;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过板车号查询
|
||||||
|
*
|
||||||
|
* @param id 拖车预约id
|
||||||
|
* @return 预约信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Appointment getAppointmentById(String id) {
|
||||||
|
Appointment appointment = null;
|
||||||
|
appointment = appointmentMapper.getById(id);
|
||||||
|
return appointment;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AppointmentDetail getAppointmentDetailByGoodVin(String vin) {
|
||||||
|
return appointmentDetailMapper.getAppointmentDetailByGoodVin(vin);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getAppointmentDetailListByGoodVinList(List<String> vinlist) {
|
||||||
|
List<String> vinList = appointmentDetailMapper.getAppointmentDetailListByGoodVinList(vinlist);
|
||||||
|
return vinList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过预约id获得预约详情
|
||||||
|
*
|
||||||
|
* @param appointment_id 预约id
|
||||||
|
* @return 预约详情
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<AppointmentDetail> getAppointmentDetailListByAppointmentId(String appointment_id) {
|
||||||
|
return appointmentDetailMapper.getAppointmentDetailListByAppointmentId(appointment_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过预约id获得打卡信息
|
||||||
|
*
|
||||||
|
* @param appointment_id 预约id
|
||||||
|
* @return 预约详情
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PunchClock getPunchClockByAppointmentId(String appointment_id) {
|
||||||
|
return punchClockMapper.getPunchClockByAppointmentId(appointment_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过板车号获得板车信息
|
||||||
|
*
|
||||||
|
* @param truck_number 车牌号
|
||||||
|
* @return 返回板车信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Truck getTruckByTruckNumber(String truck_number) {
|
||||||
|
List<Truck> truckList = truckMapper.getList();
|
||||||
|
Truck truck = null;
|
||||||
|
if (truckList != null && truckList.size() > 0) {
|
||||||
|
truck = Linq.of(truckList).firstOrDefault(p -> p.getTruck_number() != null && p.getTruck_number().equals(truck_number));
|
||||||
|
}
|
||||||
|
return truck;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Users getUsersByIdCode(String id_code) {
|
||||||
|
Users users = usersMapper.getByIdCode(id_code);
|
||||||
|
return users;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Users getUsersById(String id) {
|
||||||
|
Users users = usersMapper.getById(id);
|
||||||
|
return users;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已预约车辆数
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 返回已预约车辆数
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer getAppointmentedCount(String start_time, String end_time, String port_area_id) {
|
||||||
|
return statisticsAdminMapper.getAppointmentedCount(start_time, end_time, port_area_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消预约车辆数
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 返回取消预约车辆数
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer getAppointmentCancelCount(String start_time, String end_time, String port_area_id) {
|
||||||
|
return statisticsAdminMapper.getAppointmentCancelCount(start_time, end_time, port_area_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约已签到车辆数
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 返回预约已签到车辆数
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer getAppointmentSignInCount(String start_time, String end_time, String port_area_id) {
|
||||||
|
return statisticsAdminMapper.getAppointmentSignInCount(start_time, end_time, port_area_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成打卡车辆数
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 返回完成打卡车辆数
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer getPunchClockOverCount(String start_time, String end_time, String port_area_id) {
|
||||||
|
return statisticsAdminMapper.getPunchClockOverCount(start_time, end_time, port_area_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指令已发送车辆数
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 指令已发送车辆数
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer getInstructHavaSendCount(String start_time, String end_time, String port_area_id) {
|
||||||
|
return statisticsAdminMapper.getInstructHavaSendCount(start_time, end_time, port_area_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外贸出口卡车辆数
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 返回外贸出口卡车辆数
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer getForeignTradeExportsCount(String start_time, String end_time, String port_area_id) {
|
||||||
|
return statisticsAdminMapper.getForeignTradeExportsCount(start_time, end_time, port_area_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外贸进口卡车辆数
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 返回外贸进口卡车辆数
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer getForeignTradeImportsCount(String start_time, String end_time, String port_area_id) {
|
||||||
|
return statisticsAdminMapper.getForeignTradeImportsCount(start_time, end_time, port_area_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内贸出口卡车辆数
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 返回内贸出口卡车辆数
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer getDomesticTradeExportCount(String start_time, String end_time, String port_area_id) {
|
||||||
|
return statisticsAdminMapper.getDomesticTradeExportCount(start_time, end_time, port_area_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内贸进口卡车辆数
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 返回内贸进口卡车辆数
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer getDomesticImportsExportCount(String start_time, String end_time, String port_area_id) {
|
||||||
|
return statisticsAdminMapper.getDomesticImportsExportCount(start_time, end_time, port_area_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 某进道口的辆数
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @param gate_canal_in 道口号(进)
|
||||||
|
* @return 某进道口的辆数
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer getInGateCanalCodeCount(String start_time, String end_time, String port_area_id, String gate_canal_in) {
|
||||||
|
return statisticsAdminMapper.getInGateCanalCodeCount(start_time, end_time, port_area_id, gate_canal_in);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 某出道口的辆数
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @param gate_canal_out 道口号(进)
|
||||||
|
* @return 某出道口的辆数
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer getOutGateCanalCodeCount(String start_time, String end_time, String port_area_id, String gate_canal_out) {
|
||||||
|
return statisticsAdminMapper.getOutGateCanalCodeCount(start_time, end_time, port_area_id, gate_canal_out);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自动进闸口板车数
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 自动进闸口板车数
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer getConventionalityInGateCount(String start_time, String end_time, String port_area_id) {
|
||||||
|
return statisticsAdminMapper.getConventionalityInGateCount(start_time, end_time, port_area_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人工抬杆进闸口板车数
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 人工抬杆进闸口板车数
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer getUnConventionalityInGateCount(String start_time, String end_time, String port_area_id) {
|
||||||
|
return statisticsAdminMapper.getUnConventionalityInGateCount(start_time, end_time, port_area_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 待进港通行板车数 (已签到未进港的)
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 待进港通行板车数 (已签到未进港的)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer getWellInGateCount(String start_time, String end_time, String port_area_id) {
|
||||||
|
return statisticsAdminMapper.getWellInGateCount(start_time, end_time, port_area_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已进港板车数 (已进港但未完成-离港的)
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 已进港板车数 (已进港但未完成-离港的)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer getHaveInGateCount(String start_time, String end_time, String port_area_id) {
|
||||||
|
return statisticsAdminMapper.getHaveInGateCount(start_time, end_time, port_area_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已离港板车数 (已进港但未完成-离港的)
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 已离港板车数 (已进港但未完成-离港的)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer getHavaOutGateCount(String start_time, String end_time, String port_area_id) {
|
||||||
|
return statisticsAdminMapper.getHavaOutGateCount(start_time, end_time, port_area_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<Appointment> getAppointmentListByCondition(QueryCondition queryCondition, Pages pages) {
|
||||||
|
int pageNum = (pages != null && pages.getPageNum() != null && pages.getPageNum() > 0) ? pages.getPageNum() : 1;
|
||||||
|
int pageSize = (pages != null && pages.getPageSize() != null && pages.getPageSize() > 0) ? pages.getPageSize() : 10;
|
||||||
|
String truckNumber = queryCondition.getTruckNum();
|
||||||
|
String shipId = queryCondition.getShipId();
|
||||||
|
Integer instructState = queryCondition.getInstructState();
|
||||||
|
String brandName = queryCondition.getBrandId();
|
||||||
|
//初始化PageHelper
|
||||||
|
PageHelper.startPage(pageNum, pageSize, true, false, false);
|
||||||
|
//查询数据库
|
||||||
|
List<Appointment> mylist = appointmentMapper.getAppointmentListByCondition(truckNumber, shipId, instructState, brandName);
|
||||||
|
//封装分页数据
|
||||||
|
PageInfo<Appointment> pageInfo = new PageInfo<Appointment>(mylist);
|
||||||
|
//返回
|
||||||
|
return pageInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* rtos指令发送
|
||||||
|
*
|
||||||
|
* @param appointmentCmd 指令
|
||||||
|
* @return 修改预约指令状态
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateAppointmentInstructState(AppointmentCmd appointmentCmd) {
|
||||||
|
if (appointmentCmd == null || appointmentCmd.getAppointmentId() == null || appointmentCmd.getAppointmentId().isEmpty()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
Appointment appointment = new Appointment();
|
||||||
|
appointment.setId(appointmentCmd.getAppointmentId());
|
||||||
|
appointment.setYard(appointmentCmd.getYardId());
|
||||||
|
appointment.setGate_canal_in(appointmentCmd.getGateCanal());
|
||||||
|
appointment.setInstruct_state(1);
|
||||||
|
return appointmentMapper.update(appointment);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* rtos指令批量发送
|
||||||
|
*
|
||||||
|
* @param appointmentCmdList 指令
|
||||||
|
* @return 修改预约指令状态
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int batchUpdateAppointmentInstructState(List<AppointmentCmd> appointmentCmdList) {
|
||||||
|
List<Appointment> appointmentList = new ArrayList<>();
|
||||||
|
if (appointmentCmdList == null || appointmentCmdList.size() == 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
for (AppointmentCmd appointmentCmd : appointmentCmdList) {
|
||||||
|
Appointment appointment = new Appointment();
|
||||||
|
appointment.setId(appointmentCmd.getAppointmentId());
|
||||||
|
appointment.setSender(appointmentCmd.getSender());
|
||||||
|
appointment.setYard(appointmentCmd.getYardId());
|
||||||
|
appointment.setYard_name(appointmentCmd.getYardName());
|
||||||
|
appointment.setGate_canal_in(appointmentCmd.getGateCanal());
|
||||||
|
appointment.setInstruct_state(1);
|
||||||
|
appointmentList.add(appointment);
|
||||||
|
}
|
||||||
|
return appointmentMapper.batchUpdateAppointmentInstructState(appointmentList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据预约id,车架号 查询明细
|
||||||
|
*
|
||||||
|
* @param appointmentId 预约id
|
||||||
|
* @param vin 车架号
|
||||||
|
* @return 返回该明细
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AppointmentDetail getAppointmentDetailByAppointmentIdAndGoodVin(String appointmentId, String vin) {
|
||||||
|
List<AppointmentDetail> appointmentDetailList = new ArrayList<>();
|
||||||
|
if (appointmentId != null && !appointmentId.isEmpty()) {
|
||||||
|
appointmentDetailList = appointmentDetailMapper.getAppointmentDetailListByAppointmentId(appointmentId);
|
||||||
|
}
|
||||||
|
AppointmentDetail appointmentDetail = null;
|
||||||
|
if (appointmentDetailList != null && appointmentDetailList.size() > 0) {
|
||||||
|
appointmentDetail = Linq.of(appointmentDetailList).firstOrDefault(p -> p.getVin().equals(vin));
|
||||||
|
}
|
||||||
|
return appointmentDetail;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据预约ids
|
||||||
|
*
|
||||||
|
* @param ids 预约ids
|
||||||
|
* @return 返回预约列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Appointment> getAppointmentByIds(List<String> ids) {
|
||||||
|
return appointmentMapper.getAppointmentByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param appointmentIdList 预约ids
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<AppointmentDetail> getAppointmentDetailByAppointmentIdList(List<String> appointmentIdList) {
|
||||||
|
return appointmentDetailMapper.getAppointmentDetailByAppointmentIdList(appointmentIdList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 板车监控分类列表
|
||||||
|
* 结合预约明细信息,条件查询预约信息
|
||||||
|
*
|
||||||
|
* @param queryCondition 查询条件
|
||||||
|
* @param pages 页码
|
||||||
|
* @return 返回分页数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<AppointmentDetailSort> getAppointmentListByConditionf(QueryCondition queryCondition, Pages pages) {
|
||||||
|
//根据查询条件(queryCondition)获取预约查询列表
|
||||||
|
List<Appointment> appointmentList = new ArrayList<>();
|
||||||
|
LocalDateTime startDate = queryCondition.getStartDate();
|
||||||
|
LocalDateTime endDate = queryCondition.getEndDate();
|
||||||
|
String portAreaId = queryCondition.getPortAreaId();
|
||||||
|
String truckNumber = queryCondition.getTruckNum();
|
||||||
|
String myShipId = queryCondition.getShipId();
|
||||||
|
|
||||||
|
Integer instructState = null;
|
||||||
|
if (queryCondition.getInstructState() != null) {
|
||||||
|
instructState = queryCondition.getInstructState();
|
||||||
|
}
|
||||||
|
|
||||||
|
String myBrandId = queryCondition.getBrandId();
|
||||||
|
appointmentList = appointmentMapper.getAppointmentListByConditionf(startDate, endDate, portAreaId, truckNumber, myShipId, instructState, myBrandId);
|
||||||
|
if (appointmentList == null || appointmentList.size() == 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
List<String> appIds = Linq.of(appointmentList).select(Appointment::getId).distinct().toList();
|
||||||
|
List<AppointmentDetail> allAppointmentDetailList = null;
|
||||||
|
List<PunchClock> punchClockList = null;
|
||||||
|
if (appIds != null && appIds.size() > 0) {
|
||||||
|
allAppointmentDetailList = appointmentDetailMapper.getAppointmentDetailByAppointmentIdList(appIds);
|
||||||
|
punchClockList = punchClockMapper.getPunchClockByAppointmentIdList(appIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<DicDto> goodsTypeList = null;
|
||||||
|
goodsTypeList = dicInterface.getDicList("APP_CARGO_TYPE");
|
||||||
|
//List<PortArea> portAreaList1 = portAreaInterface.getPortArea();
|
||||||
|
List<PortArea> portAreaList = portAreasMapper.getList();
|
||||||
|
//定义返回数据列表
|
||||||
|
List<AppointmentDetailSort> appointmentDetailSortlList = new ArrayList<>();
|
||||||
|
//遍历预约列表
|
||||||
|
for (Appointment appointment : appointmentList) {
|
||||||
|
//定义一个查询对象实例
|
||||||
|
AppointmentDetailSort appointmentDetailSort = new AppointmentDetailSort();
|
||||||
|
//从预约对象取值,赋值到实例对象
|
||||||
|
appointmentDetailSort.setAppointment_id(appointment.getId());
|
||||||
|
appointmentDetailSort.setUsers_id(appointment.getUsers_id());
|
||||||
|
appointmentDetailSort.setTransport_type(appointment.getTransport_type());
|
||||||
|
appointmentDetailSort.setTruck_number(appointment.getTruck_number());
|
||||||
|
appointmentDetailSort.setTel_number(appointment.getTel_number());
|
||||||
|
appointmentDetailSort.setApproach_date(appointment.getApproach_date());
|
||||||
|
appointmentDetailSort.setPort_area_id(appointment.getPort_area_id());
|
||||||
|
//添加排队号
|
||||||
|
PunchClock punchClock = null;
|
||||||
|
if (punchClockList != null && punchClockList.size() > 0) {
|
||||||
|
punchClock = Linq.of(punchClockList).firstOrDefault(p -> p.getAppointment_id().equals(appointment.getId()));
|
||||||
|
if (punchClock != null) {
|
||||||
|
appointmentDetailSort.setQueue_number(punchClock.getQueue_number());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//添加港区
|
||||||
|
PortArea portArea = null;
|
||||||
|
if (portAreaList != null && portAreaList.size() > 0) {
|
||||||
|
portArea = Linq.of(portAreaList).firstOrDefault(p -> p.getId().equals(appointment.getPort_area_id()));
|
||||||
|
if (portArea != null) {
|
||||||
|
appointmentDetailSort.setPort_area_name(portArea.getPort_area_name());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//添加货物类型
|
||||||
|
appointmentDetailSort.setGoods_type(appointment.getGoods_type());
|
||||||
|
DicDto goodsType = null;
|
||||||
|
if (goodsTypeList != null && goodsTypeList.size() > 0) {
|
||||||
|
goodsType = Linq.of(goodsTypeList).firstOrDefault(p -> p.getId().equals(appointment.getGoods_type()));
|
||||||
|
if(goodsType!=null){
|
||||||
|
appointmentDetailSort.setGoods_type_name(goodsType.getText());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
appointmentDetailSort.setAppointment_type(appointment.getAppointment_type());
|
||||||
|
appointmentDetailSort.setEnter_type(appointment.getEnter_type());
|
||||||
|
appointmentDetailSort.setGoods_quantity(appointment.getGoods_quantity());
|
||||||
|
appointmentDetailSort.setAppointment_state(appointment.getAppointment_state());
|
||||||
|
appointmentDetailSort.setYard(appointment.getYard());
|
||||||
|
appointmentDetailSort.setGate_canal_in(appointment.getGate_canal_in());
|
||||||
|
appointmentDetailSort.setGate_canal_out(appointment.getGate_canal_out());
|
||||||
|
appointmentDetailSort.setGate_canal_in_time(appointment.getGate_canal_in_time());
|
||||||
|
appointmentDetailSort.setInstruct_state(appointment.getInstruct_state());
|
||||||
|
appointmentDetailSort.setSend_time(appointment.getSend_time());
|
||||||
|
appointmentDetailSort.setSender(appointment.getSender());
|
||||||
|
appointmentDetailSort.setCheck_in_time(appointment.getCheck_in_time());
|
||||||
|
appointmentDetailSort.setCheck_over_time(appointment.getCheck_over_time());
|
||||||
|
appointmentDetailSort.setCreate_time(appointment.getCreate_time());
|
||||||
|
appointmentDetailSort.setUpdate_time(appointment.getUpdate_time());
|
||||||
|
appointmentDetailSort.setIs_del(appointment.getIs_del());
|
||||||
|
appointmentDetailSort.setShip_name("");
|
||||||
|
appointmentDetailSort.setBrand_id("");
|
||||||
|
appointmentDetailSort.setBrand_name("");
|
||||||
|
//检查该预约记录是否有明细数据
|
||||||
|
String appointment_id = appointment.getId();
|
||||||
|
List<AppointmentDetail> appointmentDetailList = null;
|
||||||
|
if (allAppointmentDetailList != null && allAppointmentDetailList.size() > 0) {
|
||||||
|
//appointmentDetailList = appointmentDetailMapper.getAppointmentDetailListByAppointmentId(appointment_id);
|
||||||
|
appointmentDetailList = Linq.of(allAppointmentDetailList).where(p -> p.getAppointment_id().equals(appointment_id)).toList();
|
||||||
|
}
|
||||||
|
//检查该预约是否有明细数据
|
||||||
|
if (appointmentDetailList == null || appointmentDetailList.size() == 0) {
|
||||||
|
appointmentDetailSortlList.add(appointmentDetailSort);
|
||||||
|
} else {
|
||||||
|
//筛选船名并去重
|
||||||
|
List<String> shipIdList = appointmentDetailList.stream().filter(a -> a.getShip_id() != null).map(AppointmentDetail::getShip_id).distinct().collect(Collectors.toList());
|
||||||
|
if (shipIdList.size() > 0) {
|
||||||
|
for (String shipId : shipIdList) {
|
||||||
|
//获取一条船上所有的品牌(brand_id)的明细列表
|
||||||
|
List<AppointmentDetail> myAppointmentDetailList = appointmentDetailList.stream().filter(a -> a.getShip_id().equals(shipId)).collect(Collectors.toList());
|
||||||
|
//获取一条船上 所有品牌名称(品牌id)
|
||||||
|
List<String> brandIdList = Linq.of(myAppointmentDetailList).select(AppointmentDetail::getBrand_id).distinct().toList();
|
||||||
|
//遍历一条船上所有品牌进行分组
|
||||||
|
if (brandIdList != null && brandIdList.size() > 0) {
|
||||||
|
for (String brandId : brandIdList) {
|
||||||
|
//获取一条船上某一品牌(brand_id)的明细列表
|
||||||
|
List<AppointmentDetail> myAppointmentDetailList111 = Linq.of(myAppointmentDetailList).where(p -> p.getBrand_id().equals(brandId)).toList();
|
||||||
|
if (myAppointmentDetailList111 != null && myAppointmentDetailList111.size() > 0) {
|
||||||
|
//重新定义一个查询对象实例,共性数据直接复制过来
|
||||||
|
AppointmentDetailSort myAppointmentDetailSort = new AppointmentDetailSort();
|
||||||
|
//共性赋值
|
||||||
|
myAppointmentDetailSort.setAppointment_id(appointmentDetailSort.getAppointment_id());
|
||||||
|
myAppointmentDetailSort.setUsers_id(appointmentDetailSort.getUsers_id());
|
||||||
|
myAppointmentDetailSort.setTransport_type(appointmentDetailSort.getTransport_type());
|
||||||
|
myAppointmentDetailSort.setTruck_number(appointmentDetailSort.getTruck_number());
|
||||||
|
myAppointmentDetailSort.setTel_number(appointmentDetailSort.getTel_number());
|
||||||
|
myAppointmentDetailSort.setApproach_date(appointmentDetailSort.getApproach_date());
|
||||||
|
myAppointmentDetailSort.setPort_area_id(appointmentDetailSort.getPort_area_id());
|
||||||
|
myAppointmentDetailSort.setQueue_number(appointmentDetailSort.getQueue_number());
|
||||||
|
myAppointmentDetailSort.setPort_area_name(appointmentDetailSort.getPort_area_name());
|
||||||
|
myAppointmentDetailSort.setGoods_type(appointmentDetailSort.getGoods_type());
|
||||||
|
myAppointmentDetailSort.setGoods_type_name(appointmentDetailSort.getGoods_type_name());
|
||||||
|
myAppointmentDetailSort.setAppointment_type(appointmentDetailSort.getAppointment_type());
|
||||||
|
myAppointmentDetailSort.setEnter_type(appointmentDetailSort.getEnter_type());
|
||||||
|
myAppointmentDetailSort.setGoods_quantity(appointmentDetailSort.getGoods_quantity());
|
||||||
|
myAppointmentDetailSort.setAppointment_state(appointmentDetailSort.getAppointment_state());
|
||||||
|
myAppointmentDetailSort.setYard(appointmentDetailSort.getYard());
|
||||||
|
myAppointmentDetailSort.setGate_canal_in(appointmentDetailSort.getGate_canal_in());
|
||||||
|
myAppointmentDetailSort.setGate_canal_out(appointmentDetailSort.getGate_canal_out());
|
||||||
|
myAppointmentDetailSort.setGate_canal_in_time(appointmentDetailSort.getGate_canal_in_time());
|
||||||
|
myAppointmentDetailSort.setInstruct_state(appointmentDetailSort.getInstruct_state());
|
||||||
|
myAppointmentDetailSort.setSend_time(appointmentDetailSort.getSend_time());
|
||||||
|
myAppointmentDetailSort.setSender(appointmentDetailSort.getSender());
|
||||||
|
myAppointmentDetailSort.setCheck_in_time(appointmentDetailSort.getCheck_in_time());
|
||||||
|
myAppointmentDetailSort.setCheck_over_time(appointmentDetailSort.getCheck_over_time());
|
||||||
|
myAppointmentDetailSort.setCreate_time(appointmentDetailSort.getCreate_time());
|
||||||
|
myAppointmentDetailSort.setUpdate_time(appointmentDetailSort.getUpdate_time());
|
||||||
|
myAppointmentDetailSort.setIs_del(appointmentDetailSort.getIs_del());
|
||||||
|
//赋值
|
||||||
|
myAppointmentDetailSort.setBrand_id(myAppointmentDetailList111.get(0).getBrand_id());
|
||||||
|
myAppointmentDetailSort.setBrand_name(myAppointmentDetailList111.get(0).getBrand_name());
|
||||||
|
myAppointmentDetailSort.setShip_name(myAppointmentDetailList111.get(0).getShip_name());
|
||||||
|
myAppointmentDetailSort.setShip_id(myAppointmentDetailList111.get(0).getShip_id());
|
||||||
|
myAppointmentDetailSort.setGoods_quantity(myAppointmentDetailList111.size());
|
||||||
|
//添加到列表
|
||||||
|
appointmentDetailSortlList.add(myAppointmentDetailSort);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//对查询列表做分页处理
|
||||||
|
appointmentDetailSortlList = Linq.of(appointmentDetailSortlList).orderByDescending(AppointmentDetailSort::getAppointment_id).toList();
|
||||||
|
|
||||||
|
//解析分页参数
|
||||||
|
int pageNum = (pages != null && pages.getPageNum() != null && pages.getPageNum() > 0) ? pages.getPageNum() : 1;
|
||||||
|
int pageSize = (pages != null && pages.getPageSize() != null && pages.getPageSize() > 0) ? pages.getPageSize() : 10;
|
||||||
|
|
||||||
|
//分页数据添加到pages
|
||||||
|
if (appointmentDetailSortlList != null && appointmentDetailSortlList.size() > 0) {
|
||||||
|
long recordTotal = appointmentDetailSortlList.size();
|
||||||
|
long pageCount = 0;
|
||||||
|
if (recordTotal % pageSize > 0) {
|
||||||
|
pageCount = recordTotal / pageSize + 1;
|
||||||
|
} else {
|
||||||
|
pageCount = recordTotal / pageSize;
|
||||||
|
}
|
||||||
|
//记录总数
|
||||||
|
assert pages != null;
|
||||||
|
pages.setRecordTotal(recordTotal);
|
||||||
|
pages.setPageCount((int) pageCount);
|
||||||
|
//总页数
|
||||||
|
}
|
||||||
|
//取分页数据
|
||||||
|
List<AppointmentDetailSort> myappointmentDetailSortlList = null;
|
||||||
|
myappointmentDetailSortlList = Linq.of(appointmentDetailSortlList).skip((pageNum - 1) * pageSize).take(pageSize).toList();
|
||||||
|
//返回当前分页结果
|
||||||
|
return myappointmentDetailSortlList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 板车监控明细
|
||||||
|
*
|
||||||
|
* @param appointmentId 预约id
|
||||||
|
* @param shipId 船舶id
|
||||||
|
* @param brandId 品牌id
|
||||||
|
* @return 返回板车明细
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PageInfo<AppointmentDetail> getAppointmentDetailsByConditionf(String appointmentId, String shipId, String brandId, Pages pages) {
|
||||||
|
//根据查询条件(queryCondition)获取预约查询列表
|
||||||
|
List<AppointmentDetail> appointmentList = null;
|
||||||
|
//参数处理
|
||||||
|
int pageNum = 1;
|
||||||
|
int pageSize = 10;
|
||||||
|
if (pages != null) {
|
||||||
|
Integer myPageNum = pages.getPageNum();
|
||||||
|
Integer myPageSize = pages.getPageSize();
|
||||||
|
if (myPageNum != null && myPageNum > 0) {
|
||||||
|
pageNum = myPageNum;
|
||||||
|
}
|
||||||
|
if (myPageSize != null && myPageSize > 0) {
|
||||||
|
pageSize = myPageSize;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
pages = new Pages();
|
||||||
|
pages.setPageNum(pageNum);
|
||||||
|
pages.setPageSize(pageSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
//初始化PageHelper
|
||||||
|
PageHelper.startPage(pageNum, pageSize, true, false, false);
|
||||||
|
appointmentList = appointmentDetailMapper.getAppointmentDetailsByConditionf(appointmentId, shipId, brandId);
|
||||||
|
|
||||||
|
PageInfo<AppointmentDetail> pageInfo = null;
|
||||||
|
pageInfo = new PageInfo<>(appointmentList);
|
||||||
|
|
||||||
|
//设置分页信息
|
||||||
|
Integer pageCount = pageInfo.getPages(); //总页数
|
||||||
|
long recordTotal = pageInfo.getTotal();//总数据记录条数
|
||||||
|
pages.setPageCount(pageCount);
|
||||||
|
pages.setRecordTotal(recordTotal);
|
||||||
|
|
||||||
|
|
||||||
|
return pageInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Truck getPalletTruckByTruckNo(String truckNum) {
|
||||||
|
Truck truck = null;
|
||||||
|
truck = truckMapper.getPalletTruckByTruckNo(truckNum);
|
||||||
|
return truck;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Truck getPalletTruckByByUsersId(String usersId) {
|
||||||
|
return truckMapper.getTruckByUsersId(usersId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交预约信息
|
||||||
|
*
|
||||||
|
* @param appointment 预约数据实体
|
||||||
|
* @return 返回提交结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer postAppointment(Appointment appointment) {
|
||||||
|
Integer res = 0;
|
||||||
|
String id = appointment.getId();
|
||||||
|
if (id == null || id.isEmpty()) {
|
||||||
|
//插入
|
||||||
|
String uuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
|
||||||
|
appointment.setId(uuid);
|
||||||
|
//数据补全
|
||||||
|
String myDate = FormatDateTime.dateTimeToStr(new Date());
|
||||||
|
appointment.setAppointment_state(1);
|
||||||
|
appointment.setCreate_time(myDate);
|
||||||
|
appointment.setUpdate_time(myDate);
|
||||||
|
appointment.setIs_del(0);
|
||||||
|
//写入
|
||||||
|
String myId = appointmentMapper.insert(appointment);
|
||||||
|
res = (myId != null && myId.length() > 0) ? 1 : null;
|
||||||
|
//插入打卡记录
|
||||||
|
if (res != null) {
|
||||||
|
PunchClock punchClock = new PunchClock();
|
||||||
|
punchClock.setId(UUID.randomUUID().toString().replace("-", "").toLowerCase());
|
||||||
|
punchClock.setPunch_clock_type(0);
|
||||||
|
punchClock.setPort_area_id(appointment.getPort_area_id());
|
||||||
|
punchClock.setAppointment_id(appointment.getId());
|
||||||
|
punchClock.setBiz_type(appointment.getBiz_type());
|
||||||
|
punchClock.setUsers_id(appointment.getUsers_id());
|
||||||
|
punchClock.setCreate_time(myDate);
|
||||||
|
punchClock.setUpdate_time(myDate);
|
||||||
|
punchClock.setIs_del(0);
|
||||||
|
String punchClockId = punchClockMapper.insert(punchClock);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
//修改
|
||||||
|
res = appointmentMapper.update(appointment);
|
||||||
|
if (res != null) {
|
||||||
|
PunchClock myPunchClock = punchClockMapper.getPunchClockByAppointmentId(appointment.getId());
|
||||||
|
if (myPunchClock != null) {
|
||||||
|
myPunchClock.setPort_area_id(appointment.getPort_area_id());
|
||||||
|
myPunchClock.setAppointment_id(appointment.getId());
|
||||||
|
myPunchClock.setBiz_type(appointment.getBiz_type());
|
||||||
|
myPunchClock.setUsers_id(appointment.getUsers_id());
|
||||||
|
myPunchClock.setIs_del(0);
|
||||||
|
Integer x = punchClockMapper.update(myPunchClock);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
//返回
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TruckUser> getTruckByTruckNos(List<String> TruckNoList) {
|
||||||
|
List<Truck> list = truckMapper.getList();
|
||||||
|
List<Users> usersList = usersMapper.getList();
|
||||||
|
List<Truck> res = null;
|
||||||
|
List<TruckUser> truckUserList = new ArrayList<>();
|
||||||
|
if (TruckNoList != null && TruckNoList.size() > 0) {
|
||||||
|
res = Linq.of(list).where(p -> TruckNoList.contains(p.getTruck_number())).toList();
|
||||||
|
}
|
||||||
|
if (res != null && res.size() > 0) {
|
||||||
|
for (Truck truck : res) {
|
||||||
|
TruckUser truckUser = new TruckUser();
|
||||||
|
Users users = Linq.of(usersList).firstOrDefault(p -> p.getId().equals(truck.getUsers_id()));
|
||||||
|
truckUser.setId(truck.getId());
|
||||||
|
truckUser.setWx_openid(truck.getWx_openid());
|
||||||
|
truckUser.setTruck_number(truck.getTruck_number());
|
||||||
|
truckUser.setUsers_id(truck.getUsers_id());
|
||||||
|
truckUser.setDriving_license_id(truck.getDriving_license_id());
|
||||||
|
truckUser.setDriving_license(truck.getDriving_license());
|
||||||
|
truckUser.setTel_number(truck.getTel_number());
|
||||||
|
truckUser.setHead_frame_number(truck.getHead_frame_number());
|
||||||
|
truckUser.setVehicle_weight(truck.getVehicle_weight());
|
||||||
|
truckUser.setVehicle_frame_weight(truck.getVehicle_frame_weight());
|
||||||
|
truckUser.setTruck_state(truck.getTruck_state());
|
||||||
|
truckUser.setCreate_time(truck.getCreate_time());
|
||||||
|
truckUser.setUpdate_time(truck.getUpdate_time());
|
||||||
|
truckUser.setIs_del(truck.getIs_del());
|
||||||
|
if (users != null) {
|
||||||
|
truckUser.setUsers_name(users.getUsers_name());
|
||||||
|
truckUser.setId_code(users.getId_code());
|
||||||
|
}
|
||||||
|
truckUserList.add(truckUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return truckUserList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,336 @@
|
||||||
|
package com.haitongauto.rtosam.service.admin.Impl;
|
||||||
|
|
||||||
|
import com.bestvike.linq.Linq;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.haitongauto.interfaces.DicInterface;
|
||||||
|
import com.haitongauto.interfaces.EnterPortTypeInterface;
|
||||||
|
import com.haitongauto.interfaces.PortAreaInterface;
|
||||||
|
import com.haitongauto.mapper.admin.PunchClockAdminMapper;
|
||||||
|
import com.haitongauto.mapper.base.AppointmentMapper;
|
||||||
|
import com.haitongauto.mapper.base.PortAreasMapper;
|
||||||
|
import com.haitongauto.mapper.base.PunchClockMapper;
|
||||||
|
import com.haitongauto.mapper.base.UsersMapper;
|
||||||
|
import com.haitongauto.mapper.client.PunchClockExtendMapper;
|
||||||
|
import com.haitongauto.models.dto.DicDto;
|
||||||
|
import com.haitongauto.models.dto.EnterPortTypeDtol;
|
||||||
|
import com.haitongauto.models.dto.PunchClockQuery;
|
||||||
|
import com.haitongauto.models.dto.PunchClockQueryExl;
|
||||||
|
import com.haitongauto.models.pojo.*;
|
||||||
|
import com.haitongauto.rtosam.service.admin.PunchClockAdminService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class PunchClockAdminServiceImpl implements PunchClockAdminService {
|
||||||
|
@Autowired
|
||||||
|
PunchClockAdminMapper punchClockAdminMapper;
|
||||||
|
@Autowired
|
||||||
|
PunchClockExtendMapper punchClockExtendMapper;
|
||||||
|
@Autowired
|
||||||
|
UsersMapper usersMapper;
|
||||||
|
@Autowired
|
||||||
|
PortAreasMapper portAreasMapper;
|
||||||
|
@Autowired
|
||||||
|
AppointmentMapper appointmentMapper;
|
||||||
|
@Autowired
|
||||||
|
PortAreaInterface portAreaInterface;
|
||||||
|
@Autowired
|
||||||
|
EnterPortTypeInterface enterPortTypeInterface;
|
||||||
|
@Autowired
|
||||||
|
DicInterface dicInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过港区、业务类型、关键词、签到日期、签到状态(缺卡/正常)、打卡完成状态(缺卡/正常)单独或组合查询
|
||||||
|
*
|
||||||
|
* @param port_area_id:港区id
|
||||||
|
* @param biz_type:业务类型
|
||||||
|
* @param keywords:关键字(姓名、手机号、板车号)
|
||||||
|
* @param sign_in_state:签到状态(0-缺卡,1-正常)
|
||||||
|
* @param punch_state:完工打卡状态(0-缺卡,1-完工)
|
||||||
|
* @param pageNum:当前页码
|
||||||
|
* @param pageSize:每页激流条数 String approach_date_end
|
||||||
|
* @return 返回打卡分页数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PageInfo<PunchClock> PunchClockListForCondition(String users_id, String port_area_id, String biz_type, String keywords, String approach_date_start, String approach_date_ent, Integer sign_in_state, Integer punch_state, Integer pageNum, Integer pageSize) {
|
||||||
|
//初始化PageHelper
|
||||||
|
PageHelper.startPage(pageNum, pageSize, true, false, false);
|
||||||
|
List<PunchClock> myList = punchClockAdminMapper.PunchClockListForCondition(users_id, port_area_id, biz_type, keywords, approach_date_start, approach_date_ent, sign_in_state, punch_state);
|
||||||
|
//封装分页数据
|
||||||
|
//返回
|
||||||
|
return new PageInfo<PunchClock>(myList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约打卡导出(条件查询)
|
||||||
|
*
|
||||||
|
* @param port_area_id:港区id
|
||||||
|
* @param biz_type:业务类型
|
||||||
|
* @param keywords:关键字(姓名、手机号、板车号)
|
||||||
|
* @param sign_in_state:签到状态(0-缺卡,1-正常)
|
||||||
|
* @param punch_state:完工打卡状态(0-缺卡,1-完工)
|
||||||
|
* @return 返回打卡记录列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<PunchClock> PunchClockListExport(String users_id, String port_area_id, String biz_type, String keywords, String approach_date_start, String approach_date_end, Integer sign_in_state, Integer punch_state) {
|
||||||
|
//返回
|
||||||
|
return punchClockAdminMapper.PunchClockListForCondition(users_id, port_area_id, biz_type, keywords, approach_date_start, approach_date_end, sign_in_state, punch_state);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PunchClock> getPunchClockListExportByIds(List<String> ids) {
|
||||||
|
return punchClockAdminMapper.getPunchClockListExportByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List<PunchClock>转换为List<PunchClockQuery>
|
||||||
|
*
|
||||||
|
* @param myList 打卡记录列表
|
||||||
|
* @return 返回List<PunchClockQuery>
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<PunchClockQuery> PunchClockListConvert(List<PunchClock> myList) {
|
||||||
|
List<PunchClockQuery> punchClockQueryList = new ArrayList<>();
|
||||||
|
//初始化日期时间格式
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
SimpleDateFormat sdfTime = new SimpleDateFormat("HH:mm:ss");
|
||||||
|
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
//初始化进场预约类型(1-全部,2-码头业务,3-整车物流,4-特保区预约)//貌似已经取消
|
||||||
|
|
||||||
|
//初始化进港类型
|
||||||
|
//List<DicDto> enterPortTypeList = dicInterface.getDicList("ENTER_PORT_TYPE");
|
||||||
|
List<EnterPortTypeDtol> enterPortTypeList = enterPortTypeInterface.getEnterPortTypeList();
|
||||||
|
//港区信息改用从哪吒接口取数据
|
||||||
|
List<PortArea> portAreasList = null;
|
||||||
|
try {
|
||||||
|
//港区信息改用从哪吒接口取数据(打卡改为从数据库设置拿信息)
|
||||||
|
portAreasList = portAreasMapper.getList();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
}
|
||||||
|
for (PunchClock punchClock : myList) {
|
||||||
|
//获取预约信息
|
||||||
|
Appointment appointment = appointmentMapper.getById(punchClock.getAppointment_id());
|
||||||
|
//获取用户和港区信息
|
||||||
|
Users users = usersMapper.getById(punchClock.getUsers_id());
|
||||||
|
//港区信息改用从哪吒接口取数据
|
||||||
|
//PortArea portAreas = portAreasMapper.getById(appointment.getPort_area_id());
|
||||||
|
PortArea portAreas = null;
|
||||||
|
if (portAreasList != null && portAreasList.size() > 0) {
|
||||||
|
portAreas = Linq.of(portAreasList).firstOrDefault(p -> p.getId().equals(punchClock.getPort_area_id()));
|
||||||
|
}
|
||||||
|
//创建预约查询实例
|
||||||
|
PunchClockQuery punchClockQuery = new PunchClockQuery();
|
||||||
|
punchClockQuery.setPunch_clock_id(punchClock.getId()); //-'打卡id';
|
||||||
|
punchClockQuery.setPunch_start_time(punchClock.getStart_time()); //-'签到打卡时间(HH:mm:ss)'
|
||||||
|
punchClockQuery.setPunch_over_time(punchClock.getOver_time()); //-'完成打卡时间(HH:mm:ss)'
|
||||||
|
punchClockQuery.setPunch_address(punchClock.getPunch_address()); //-签到打卡地点
|
||||||
|
punchClockQuery.setOver_address(punchClock.getOver_address()); //-完成打卡地点
|
||||||
|
if (punchClockQuery.getOver_address() == null || punchClockQuery.getOver_address().isEmpty()) {
|
||||||
|
assert portAreas != null;
|
||||||
|
String over_time = punchClock.getOver_time();
|
||||||
|
if (over_time != null && !over_time.isEmpty()) {
|
||||||
|
punchClockQuery.setOver_address(portAreas.getPort_area_address());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
punchClockQuery.setQueue_number(punchClock.getQueue_number()); //-排队编号
|
||||||
|
if (punchClock.getPunch_clock_type() > 1) {
|
||||||
|
punchClockQuery.setBefor_num(0); //- 前面车辆数
|
||||||
|
} else {
|
||||||
|
int before = punchClockExtendMapper.getNumberBeforeMe(appointment.getApproach_date(), punchClock.getPort_area_id(), punchClock.getQueue_number());
|
||||||
|
punchClockQuery.setBefor_num(before);
|
||||||
|
}
|
||||||
|
if (appointment != null) {
|
||||||
|
punchClockQuery.setApproach_date(appointment.getApproach_date());//-'预约日期'
|
||||||
|
punchClockQuery.setTruck_number(appointment.getTruck_number()); //-'板车号'
|
||||||
|
punchClockQuery.setApproach_time(appointment.getCreate_time()); //-'预约创建时间'
|
||||||
|
//进港类型
|
||||||
|
if (appointment.getEnter_type() != null) {
|
||||||
|
String enter_type_name = "";
|
||||||
|
String biz_type_name = "";
|
||||||
|
if (enterPortTypeList != null) {
|
||||||
|
EnterPortTypeDtol enterPortType = Linq.of(enterPortTypeList).firstOrDefault(p -> p.getId().equals(appointment.getEnter_type()));
|
||||||
|
if (enterPortType != null) {
|
||||||
|
enter_type_name = enterPortType.getText();
|
||||||
|
biz_type_name = enterPortType.getEteBusinesstpDesc();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
punchClockQuery.setEnter_type_name(enter_type_name);
|
||||||
|
punchClockQuery.setBiz_type_name(biz_type_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//港区信息
|
||||||
|
if (portAreas != null) {
|
||||||
|
punchClockQuery.setPort_area_name(portAreas.getPort_area_name());
|
||||||
|
}
|
||||||
|
//用户信息
|
||||||
|
if (users != null) {
|
||||||
|
punchClockQuery.setUsers_name(users.getUsers_name()); //司机名称
|
||||||
|
punchClockQuery.setTel_number(users.getTel_number()); //-'手机号';
|
||||||
|
}
|
||||||
|
//打卡记录信息
|
||||||
|
if (punchClock.getPunch_clock_type() != null) {
|
||||||
|
String start_time = punchClock.getStart_time();
|
||||||
|
punchClockQuery.setIs_start(punchClock.getPunch_clock_type() > 0 && (start_time != null && !start_time.isEmpty()) ? "正常" : "缺卡");//-签到状态(正常/缺卡)
|
||||||
|
} else {
|
||||||
|
punchClockQuery.setIs_start("缺卡");
|
||||||
|
}
|
||||||
|
if (punchClock.getPunch_clock_type() != null) {
|
||||||
|
String over_time = punchClock.getOver_time();
|
||||||
|
punchClockQuery.setIs_over((punchClock.getPunch_clock_type() >= 4) && (over_time != null && !over_time.isEmpty()) ? "正常" : "缺卡"); //-完卡状态(正常/缺卡)
|
||||||
|
} else {
|
||||||
|
punchClockQuery.setIs_over("缺卡"); //-完卡状态(正常/缺卡)
|
||||||
|
}
|
||||||
|
punchClockQueryList.add(punchClockQuery);
|
||||||
|
}
|
||||||
|
return punchClockQueryList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PunchClockQueryExl> PunchClockListConvert1(List<PunchClock> myList) {
|
||||||
|
List<PunchClockQueryExl> punchClockQueryList = new ArrayList<>();
|
||||||
|
//初始化日期时间格式
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
SimpleDateFormat sdfTime = new SimpleDateFormat("HH:mm:ss");
|
||||||
|
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
//初始化进场预约类型(1-全部,2-码头业务,3-整车物流,4-特保区预约)//貌似已经取消
|
||||||
|
|
||||||
|
//初始化进港类型
|
||||||
|
//List<DicDto> enterPortTypeList = dicInterface.getDicList("ENTER_PORT_TYPE");
|
||||||
|
List<EnterPortTypeDtol> enterPortTypeList = enterPortTypeInterface.getEnterPortTypeList();
|
||||||
|
//港区信息改用从哪吒接口取数据
|
||||||
|
List<PortArea> portAreasList = null;
|
||||||
|
try {
|
||||||
|
//港区信息改用从哪吒接口取数据(打卡改为从数据库设置拿信息)
|
||||||
|
portAreasList = portAreasMapper.getList();
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
for (PunchClock punchClock : myList) {
|
||||||
|
//获取预约信息
|
||||||
|
Appointment appointment = appointmentMapper.getById(punchClock.getAppointment_id());
|
||||||
|
//获取用户和港区信息
|
||||||
|
Users users = usersMapper.getById(punchClock.getUsers_id());
|
||||||
|
//港区信息改用从哪吒接口取数据
|
||||||
|
//PortArea portAreas = portAreasMapper.getById(appointment.getPort_area_id());
|
||||||
|
PortArea portAreas = null;
|
||||||
|
if (portAreasList != null && portAreasList.size() > 0) {
|
||||||
|
portAreas = Linq.of(portAreasList).firstOrDefault(p -> p.getId().equals(punchClock.getPort_area_id()));
|
||||||
|
}
|
||||||
|
//创建预约查询实例
|
||||||
|
PunchClockQueryExl punchClockQueryExl = new PunchClockQueryExl();
|
||||||
|
punchClockQueryExl.setPunch_start_time(punchClock.getStart_time()); //-'签到打卡时间(HH:mm:ss)'
|
||||||
|
punchClockQueryExl.setPunch_over_time(punchClock.getOver_time()); //-'完成打卡时间(HH:mm:ss)'
|
||||||
|
punchClockQueryExl.setPunch_address(punchClock.getPunch_address()); //-签到打卡地点
|
||||||
|
punchClockQueryExl.setOver_address(punchClock.getOver_address()); //-完成打卡地点
|
||||||
|
if (punchClockQueryExl.getOver_address() == null || punchClockQueryExl.getOver_address().isEmpty()) {
|
||||||
|
assert portAreas != null;
|
||||||
|
String over_time = punchClock.getOver_time();
|
||||||
|
if (over_time != null && !over_time.isEmpty()) {
|
||||||
|
punchClockQueryExl.setOver_address(portAreas.getPort_area_address());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
punchClockQueryExl.setQueue_number(punchClock.getQueue_number()); //-排队编号
|
||||||
|
if (punchClock.getPunch_clock_type() > 1) {
|
||||||
|
punchClockQueryExl.setBefor_num(0); //- 前面车辆数
|
||||||
|
} else {
|
||||||
|
int before = punchClockExtendMapper.getNumberBeforeMe(appointment.getApproach_date(), punchClock.getPort_area_id(), punchClock.getQueue_number());
|
||||||
|
punchClockQueryExl.setBefor_num(before);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (appointment != null) {
|
||||||
|
punchClockQueryExl.setTruck_number(appointment.getTruck_number()); //-'板车号'
|
||||||
|
punchClockQueryExl.setApproach_time(appointment.getCreate_time()); //-'预约时间'
|
||||||
|
//进港类型
|
||||||
|
if (appointment.getEnter_type() != null) {
|
||||||
|
String enter_type_name = "";
|
||||||
|
String biz_type_name = "";
|
||||||
|
if (enterPortTypeList != null) {
|
||||||
|
EnterPortTypeDtol enterPortType = Linq.of(enterPortTypeList).firstOrDefault(p -> p.getId().equals(appointment.getEnter_type()));
|
||||||
|
if (enterPortType != null) {
|
||||||
|
enter_type_name = enterPortType.getText();
|
||||||
|
biz_type_name = enterPortType.getEteBusinesstpDesc();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
punchClockQueryExl.setEnter_type_name(enter_type_name);
|
||||||
|
punchClockQueryExl.setBiz_type_name(biz_type_name);
|
||||||
|
}
|
||||||
|
punchClockQueryExl.setApproach_date(appointment.getApproach_date());
|
||||||
|
}
|
||||||
|
//港区信息
|
||||||
|
if (portAreas != null) {
|
||||||
|
punchClockQueryExl.setPort_area_name(portAreas.getPort_area_name());
|
||||||
|
}
|
||||||
|
//用户信息
|
||||||
|
if (users != null) {
|
||||||
|
punchClockQueryExl.setUsers_name(users.getUsers_name()); //司机名称
|
||||||
|
punchClockQueryExl.setTel_number(users.getTel_number()); //-'手机号';
|
||||||
|
}
|
||||||
|
//打卡记录信息
|
||||||
|
if (punchClock.getPunch_clock_type() != null) {
|
||||||
|
String start_time = punchClock.getStart_time();
|
||||||
|
punchClockQueryExl.setIs_start(punchClock.getPunch_clock_type() > 0 && (start_time != null && !start_time.isEmpty()) ? "正常" : "缺卡");//-签到状态(正常/缺卡)
|
||||||
|
} else {
|
||||||
|
punchClockQueryExl.setIs_start("缺卡");
|
||||||
|
}
|
||||||
|
if (punchClock.getPunch_clock_type() != null) {
|
||||||
|
String over_time = punchClock.getOver_time();
|
||||||
|
punchClockQueryExl.setIs_over((punchClock.getPunch_clock_type() >= 4) && (over_time != null && !over_time.isEmpty()) ? "正常" : "缺卡"); //-完卡状态(正常/缺卡)
|
||||||
|
} else {
|
||||||
|
punchClockQueryExl.setIs_over("缺卡"); //-完卡状态(正常/缺卡)
|
||||||
|
}
|
||||||
|
punchClockQueryList.add(punchClockQueryExl);
|
||||||
|
}
|
||||||
|
if (punchClockQueryList.size() > 0) {
|
||||||
|
punchClockQueryList = Linq.of(punchClockQueryList).orderByDescending(p -> p.getApproach_time()).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
return punchClockQueryList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有的打卡港区
|
||||||
|
*
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 返回港区列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<PortArea> getPunchClockPortAreaList(String port_area_id) {
|
||||||
|
List<PortArea> portAreaList = portAreasMapper.getList();
|
||||||
|
//List<PortArea> portAreaList = portAreaInterface.getPortArea();
|
||||||
|
if (portAreaList != null && port_area_id != null && !port_area_id.isEmpty()) {
|
||||||
|
portAreaList = Linq.of(portAreaList).where(p -> p.getId() != null && p.getId().equals(port_area_id)).toList();
|
||||||
|
}
|
||||||
|
return portAreaList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据港区id获取所有的打卡港区(打卡港区)
|
||||||
|
*
|
||||||
|
* @param id 港区id
|
||||||
|
* @return 返回港区
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PortArea getPunchClockPortAreaById(String id) {
|
||||||
|
return portAreasMapper.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 港区打卡设置
|
||||||
|
*
|
||||||
|
* @param portArea 港区
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer punchClockPortAreaSetting(PortArea portArea) {
|
||||||
|
return portAreasMapper.update(portArea);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,108 @@
|
||||||
|
package com.haitongauto.rtosam.service.admin.Impl;
|
||||||
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.haitongauto.models.dto.Responser;
|
||||||
|
import com.haitongauto.rtosam.service.admin.ResponseService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class ResponseServiceImpl implements ResponseService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 封装为返回Json对象
|
||||||
|
* @param bl:请求是否成功
|
||||||
|
* @param data:返回数据
|
||||||
|
* @return 返回Json对象
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getResponseData(Boolean bl,Object data){
|
||||||
|
//创建返回数据
|
||||||
|
Integer code = (bl) ? 200 : 404;
|
||||||
|
String message = (bl) ? "request success" : "request fail";
|
||||||
|
//添加到返回对象
|
||||||
|
Responser responser = new Responser();
|
||||||
|
responser.setCode(code);
|
||||||
|
responser.setMessage(message);
|
||||||
|
responser.setData(data);
|
||||||
|
//解析为Json字符串
|
||||||
|
//返回
|
||||||
|
return JSON.toJSONString(responser,SerializerFeature.WriteMapNullValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 封装为返回Json对象
|
||||||
|
*
|
||||||
|
* @param bl:请求是否成功
|
||||||
|
* @param data:返回数据
|
||||||
|
* @return 返回Json对象
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getResponseData(Boolean bl, Object data, String msg) {
|
||||||
|
//创建返回数据
|
||||||
|
Integer code = (bl) ? 200 : 404;
|
||||||
|
String message;
|
||||||
|
if (msg != null && !msg.isEmpty()) {
|
||||||
|
message = msg;
|
||||||
|
} else {
|
||||||
|
message = (bl) ? "request success" : "request fail";
|
||||||
|
}
|
||||||
|
//添加到返回对象
|
||||||
|
Responser responser = new Responser();
|
||||||
|
responser.setCode(code);
|
||||||
|
responser.setMessage(message);
|
||||||
|
responser.setData(data);
|
||||||
|
//解析为Json字符串
|
||||||
|
//返回
|
||||||
|
return JSON.toJSONString(responser, SerializerFeature.WriteMapNullValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getResponseDataJavaJson(Boolean bl,Object data){
|
||||||
|
//创建返回数据
|
||||||
|
Integer code = (bl) ? 200 : 404;
|
||||||
|
String message = (bl) ? "request success" : "request fail";
|
||||||
|
//添加到返回对象
|
||||||
|
Responser responser = new Responser();
|
||||||
|
responser.setCode(code);
|
||||||
|
responser.setMessage(message);
|
||||||
|
responser.setData(data);
|
||||||
|
//解析为Json字符串
|
||||||
|
// 将对象转换为 JSON 字符串
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
//String json = objectMapper.writeValueAsString(data);
|
||||||
|
String json = null;
|
||||||
|
try {
|
||||||
|
json = objectMapper.writeValueAsString(responser);
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
//返回
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRtosResponseData(Boolean bl, Object data, String errorCode) {
|
||||||
|
//创建返回数据
|
||||||
|
Integer code = (bl) ? 200 : 404;
|
||||||
|
String message="";
|
||||||
|
if (errorCode != null && !errorCode.isEmpty()) {
|
||||||
|
code = Integer.parseInt(errorCode);
|
||||||
|
}
|
||||||
|
if (code.equals(401)){
|
||||||
|
message="用户权限过期,请重新登录";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
message = (bl) ? "request success" : "request fail";
|
||||||
|
}
|
||||||
|
//添加到返回对象
|
||||||
|
Responser responser = new Responser();
|
||||||
|
responser.setCode(code);
|
||||||
|
responser.setMessage(message);
|
||||||
|
responser.setData(data);
|
||||||
|
//解析为Json字符串
|
||||||
|
return JSON.toJSONString(responser,SerializerFeature.WriteMapNullValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,80 @@
|
||||||
|
package com.haitongauto.rtosam.service.admin.Impl;
|
||||||
|
import com.haitongauto.mapper.base.TableHeadMapper;
|
||||||
|
import com.haitongauto.models.pojo.TableHead;
|
||||||
|
import com.haitongauto.rtosam.service.admin.TableHeadService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class TableHeadServiceImpl implements TableHeadService {
|
||||||
|
@Autowired
|
||||||
|
TableHeadMapper tbHeadMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动态表头信息插入
|
||||||
|
* @param tableHead 动态表头信实体
|
||||||
|
* @return 返回操作结构
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer insertOrUpdate(TableHead tableHead) {
|
||||||
|
String table_code=tableHead.getTable_code();
|
||||||
|
switch(table_code) {
|
||||||
|
case TbHeadStatic.applet_announcement:
|
||||||
|
tableHead.setTable_name("applet_announcements");
|
||||||
|
break;
|
||||||
|
case TbHeadStatic.applet_appointment:
|
||||||
|
tableHead.setTable_name("applet_appointment");
|
||||||
|
break;
|
||||||
|
case TbHeadStatic.applet_feedback:
|
||||||
|
tableHead.setTable_name("applet_feedback");
|
||||||
|
break;
|
||||||
|
case TbHeadStatic.applet_punch_clock:
|
||||||
|
tableHead.setTable_name("applet_punch_clock");
|
||||||
|
break;
|
||||||
|
case TbHeadStatic.applet_users:
|
||||||
|
tableHead.setTable_name("applet_users");
|
||||||
|
break;
|
||||||
|
case TbHeadStatic.applet_port_areas:
|
||||||
|
tableHead.setTable_name("applet_port_areas");
|
||||||
|
break;
|
||||||
|
case TbHeadStatic.vehicle_receiving_departure:
|
||||||
|
tableHead.setTable_name("vehicle_receiving_departure");
|
||||||
|
break;
|
||||||
|
case TbHeadStatic.nuzar_userTable_101:
|
||||||
|
tableHead.setTable_name("nuzar_userTable_101");
|
||||||
|
break;
|
||||||
|
case TbHeadStatic.vehicle_receiving:
|
||||||
|
tableHead.setTable_name("vehicle_receiving");
|
||||||
|
break;
|
||||||
|
case TbHeadStatic.vehicle_departure:
|
||||||
|
tableHead.setTable_name("vehicle_departure");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
|
||||||
|
Integer res = -1;
|
||||||
|
TableHead mytbHead = tbHeadMapper.queryByCode(tableHead.getTable_code());
|
||||||
|
if (mytbHead != null) {
|
||||||
|
tableHead.setId(mytbHead.getId());
|
||||||
|
res = tbHeadMapper.update(tableHead);
|
||||||
|
} else {
|
||||||
|
tableHead.setId(UUID.randomUUID().toString().replace("-","").toLowerCase());
|
||||||
|
tableHead.setIs_del(0);
|
||||||
|
String id = tbHeadMapper.insert(tableHead);
|
||||||
|
res=(id!=null && id.length()>0)?1:null;
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据表编码,查询动态表头信息
|
||||||
|
* @param table_code 表编码
|
||||||
|
* @return 返回查询动态表头信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableHead queryByCode(String table_code) {
|
||||||
|
return tbHeadMapper.queryByCode(table_code);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
package com.haitongauto.rtosam.service.admin.Impl;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class TbHeadStatic {
|
||||||
|
public static final String applet_announcement = "10";
|
||||||
|
public static final String applet_appointment = "20";
|
||||||
|
public static final String applet_feedback = "30";
|
||||||
|
public static final String applet_punch_clock = "40";
|
||||||
|
public static final String applet_users = "50";
|
||||||
|
public static final String applet_port_areas= "60";
|
||||||
|
public static final String vehicle_receiving_departure= "70";
|
||||||
|
public static final String nuzar_userTable_101= "101";
|
||||||
|
|
||||||
|
public static final String vehicle_receiving= "111";
|
||||||
|
public static final String vehicle_departure= "112";
|
||||||
|
|
||||||
|
public static List<String> getTableCodeList() {
|
||||||
|
List<String> codes = new ArrayList<>();
|
||||||
|
codes.add(applet_announcement);
|
||||||
|
codes.add(applet_appointment);
|
||||||
|
codes.add(applet_feedback);
|
||||||
|
codes.add(applet_punch_clock);
|
||||||
|
codes.add(applet_users);
|
||||||
|
codes.add(applet_port_areas);
|
||||||
|
codes.add(vehicle_receiving_departure);
|
||||||
|
codes.add(nuzar_userTable_101);
|
||||||
|
codes.add(vehicle_receiving);
|
||||||
|
codes.add(vehicle_departure);
|
||||||
|
return codes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Map<String, String> getTableMap() {
|
||||||
|
Map<String, String> map = new HashMap<>();
|
||||||
|
map.put(applet_announcement, "applet_announcement");
|
||||||
|
map.put(applet_appointment, "applet_appointment");
|
||||||
|
map.put(applet_feedback, "applet_feedback");
|
||||||
|
map.put(applet_punch_clock, "applet_punch_clock");
|
||||||
|
map.put(applet_port_areas, "applet_port_areas");
|
||||||
|
map.put(applet_users, "applet_users");
|
||||||
|
map.put(vehicle_receiving_departure, "vehicle_receiving_departure");
|
||||||
|
map.put(nuzar_userTable_101, "nuzar_userTable_101");
|
||||||
|
map.put(vehicle_receiving, "vehicle_receiving");
|
||||||
|
map.put(vehicle_departure, "vehicle_departure");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,93 @@
|
||||||
|
package com.haitongauto.rtosam.service.admin.Impl;
|
||||||
|
import com.haitongauto.rtosam.service.admin.ToPdfService;
|
||||||
|
import com.haitongauto.utils.FormatDateTime;
|
||||||
|
import com.haitongauto.utils.HtmlToPdfUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import java.io.*;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class ToPdfServiceImpl implements ToPdfService {
|
||||||
|
/**
|
||||||
|
* Html文档内容导出为PDF
|
||||||
|
*
|
||||||
|
* @param htmlDom:Html文档内容
|
||||||
|
* @param pdfName:设置PDF目标文件名
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void htmlToPdf(String htmlDom, String pdfName) {
|
||||||
|
long startTime = System.currentTimeMillis();
|
||||||
|
//html文件所在相对路径
|
||||||
|
String htmlFile = "wx-applet-admin/src/main/resources/static/doc/pdf/x.html";
|
||||||
|
//pdf文件存储相对路径
|
||||||
|
String pdfFile = "wx-applet-admin/src/main/resources/static/doc/pdf/" + pdfName + ".pdf";
|
||||||
|
//定义输入流
|
||||||
|
// InputStream inputStream = null;
|
||||||
|
// try {
|
||||||
|
// inputStream = new FileInputStream(htmlFile); //从文件导入
|
||||||
|
// } catch (FileNotFoundException e) {
|
||||||
|
// throw new RuntimeException(e);
|
||||||
|
// }
|
||||||
|
InputStream inputStream = HtmlToPdfUtils.getStringStream(htmlDom); //直接从HTML文本导入
|
||||||
|
//定义输出流
|
||||||
|
OutputStream outputStream = null;
|
||||||
|
try {
|
||||||
|
outputStream = new FileOutputStream(pdfFile);
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
//定义水印
|
||||||
|
String waterMarkText = "HaiTongAuto RTOS";
|
||||||
|
|
||||||
|
//简体宋体在windows系统里的位置如下,linux系统直接拷贝该文件放在linux目录下即可
|
||||||
|
String fontPath = "src/main/resources/static/font/simsun.ttc,0";
|
||||||
|
HtmlToPdfUtils.convertToPdf(inputStream, waterMarkText, fontPath, outputStream);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* html生成pdf文件
|
||||||
|
* @param htmlDom:Html文档内容
|
||||||
|
* @param pdfName:设置PDF目标文件名
|
||||||
|
* @return 返回文件路径
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String htmlToPdfReturnFilePath(String htmlDom, String pdfName) {
|
||||||
|
long startTime = System.currentTimeMillis();
|
||||||
|
//昨天日期文件夹
|
||||||
|
String yesTodayStr = FormatDateTime.getYesTodayStr();
|
||||||
|
String yesTodayFilePath = "wx-applet-admin/src/main/resources/static/doc/pdf/" + yesTodayStr + "/";
|
||||||
|
File yesTodayFolders = new File(yesTodayFilePath);
|
||||||
|
//如果存在,则删除昨天日期文件夹
|
||||||
|
if (yesTodayFolders.exists()) {
|
||||||
|
boolean b = yesTodayFolders.delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
//今日日期文件夹
|
||||||
|
String todayStrStr = FormatDateTime.getTodayStr();
|
||||||
|
String todayFilePath = "wx-applet-admin/src/main/resources/static/doc/pdf/" + todayStrStr + "/";
|
||||||
|
File todayFolders = new File(todayFilePath);
|
||||||
|
//如果不存在,创建日期文件夹
|
||||||
|
if (!todayFolders.exists()) {
|
||||||
|
boolean b = todayFolders.mkdirs();
|
||||||
|
}
|
||||||
|
//pdf文件存储相对路径
|
||||||
|
String pdfFile = todayFilePath + pdfName + ".pdf";
|
||||||
|
InputStream inputStream = HtmlToPdfUtils.getStringStream(htmlDom); //直接从HTML文本导入
|
||||||
|
//定义输出流
|
||||||
|
OutputStream outputStream = null;
|
||||||
|
try {
|
||||||
|
outputStream = new FileOutputStream(pdfFile);
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
//定义水印
|
||||||
|
String waterMarkText = "HaiTongAuto RTOS";
|
||||||
|
|
||||||
|
//简体宋体在windows系统里的位置如下,linux系统直接拷贝该文件放在linux目录下即可
|
||||||
|
String fontPath = "src/main/resources/static/font/simsun.ttc,0";
|
||||||
|
HtmlToPdfUtils.convertToPdf(inputStream, waterMarkText, fontPath, outputStream);
|
||||||
|
|
||||||
|
return pdfFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.haitongauto.rtosam.service.admin.Impl;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.haitongauto.models.pojo.Users;
|
||||||
|
import com.haitongauto.rtosam.service.admin.UsersAdminService;
|
||||||
|
import com.haitongauto.mapper.admin.UsersAdminMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class UsersAdminServiceImpl implements UsersAdminService {
|
||||||
|
@Autowired
|
||||||
|
UsersAdminMapper usersAdminMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID、手机号、昵称、注册时间和用户状态查询小程序注册用户信息
|
||||||
|
* @param keywords : 查询关键字(用户ID、手机号、昵称)
|
||||||
|
* @param registerDateStart :注册日期
|
||||||
|
* @param registerDateEnd :注册日期
|
||||||
|
* @param usersState:用户状态
|
||||||
|
* @return 返回注册用户信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PageInfo<Users> usersListForCondition(String keywords, String registerDateStart,String registerDateEnd, Integer usersState, Integer pageNum, Integer pageSize) {
|
||||||
|
//初始化PageHelper
|
||||||
|
PageHelper.startPage(pageNum,pageSize,true,false,false);
|
||||||
|
//PageHelper.startPage(pageNum,pageSize);
|
||||||
|
//读取数据库
|
||||||
|
List<Users> myList = usersAdminMapper.usersListForCondition(keywords,registerDateStart,registerDateEnd,usersState);
|
||||||
|
//封装分页数据
|
||||||
|
return new PageInfo<Users>(myList);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.haitongauto.rtosam.service.admin;
|
||||||
|
import com.haitongauto.models.pojo.NoviceIntroduction;
|
||||||
|
public interface NoviceIntroductionAdminService {
|
||||||
|
/**
|
||||||
|
* 根据分类sort获取操作说明
|
||||||
|
* @param sort:(1-小程序,2-客服平台,3-App)
|
||||||
|
* @return 返回操作说明
|
||||||
|
*/
|
||||||
|
NoviceIntroduction getNoviceIntroductionBySort(Integer sort);
|
||||||
|
}
|
|
@ -0,0 +1,289 @@
|
||||||
|
package com.haitongauto.rtosam.service.admin;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.haitongauto.models.dto.Pages;
|
||||||
|
import com.haitongauto.models.dto.open.TruckUser;
|
||||||
|
import com.haitongauto.models.open.AppointmentCmd;
|
||||||
|
import com.haitongauto.models.open.AppointmentDetailSort;
|
||||||
|
import com.haitongauto.models.open.QueryCondition;
|
||||||
|
import com.haitongauto.models.pojo.*;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface OpenApiService {
|
||||||
|
/**
|
||||||
|
* 通过板车号或者省份证号,获得活跃(有效)预约信息
|
||||||
|
*
|
||||||
|
* @param truck_number
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Appointment getActiveAppointmentByTruckNumber(String truck_number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过板车号查询 最新的一条预约信息
|
||||||
|
*
|
||||||
|
* @param truck_number 拖车号
|
||||||
|
* @return 预约信息
|
||||||
|
*/
|
||||||
|
Appointment getAppointmentByTruckName(String truck_number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过板车号查询 最新的一条预约信息
|
||||||
|
*
|
||||||
|
* @param vin 拖车车架
|
||||||
|
* @return 预约信息
|
||||||
|
*/
|
||||||
|
public Appointment getAppointmentByVin(String vin);
|
||||||
|
|
||||||
|
List<String> getAppointmentDetailListByGoodVinList(List<String> vinlist);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过板车号查询
|
||||||
|
*
|
||||||
|
* @param id 拖车预约id
|
||||||
|
* @return 预约信息
|
||||||
|
*/
|
||||||
|
public Appointment getAppointmentById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据货物vin获得预约详情
|
||||||
|
*
|
||||||
|
* @param vin 货物vin
|
||||||
|
* @return 预约详情
|
||||||
|
*/
|
||||||
|
public AppointmentDetail getAppointmentDetailByGoodVin(String vin);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过预约id获得预约详情
|
||||||
|
*
|
||||||
|
* @param appointment_id 预约id
|
||||||
|
* @return 预约详情
|
||||||
|
*/
|
||||||
|
List<AppointmentDetail> getAppointmentDetailListByAppointmentId(String appointment_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过预约id获得打卡信息
|
||||||
|
*
|
||||||
|
* @param appointment_id 预约id
|
||||||
|
* @return 预约详情
|
||||||
|
*/
|
||||||
|
PunchClock getPunchClockByAppointmentId(String appointment_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过板车号获得板车信息
|
||||||
|
*
|
||||||
|
* @param truck_number 板车号
|
||||||
|
* @return 预约详情
|
||||||
|
*/
|
||||||
|
Truck getTruckByTruckNumber(String truck_number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过身份证号获得用户信息
|
||||||
|
*
|
||||||
|
* @param id_code 身份证号
|
||||||
|
* @return 预约详情
|
||||||
|
*/
|
||||||
|
Users getUsersByIdCode(String id_code);
|
||||||
|
|
||||||
|
Users getUsersById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已预约车辆数
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 返回已预约车辆数
|
||||||
|
*/
|
||||||
|
Integer getAppointmentedCount(String start_time, String end_time, String port_area_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消预约车辆数
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 返回取消预约车辆数
|
||||||
|
*/
|
||||||
|
Integer getAppointmentCancelCount(String start_time, String end_time, String port_area_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约已签到车辆数
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 返回预约已签到车辆数
|
||||||
|
*/
|
||||||
|
Integer getAppointmentSignInCount(String start_time, String end_time, String port_area_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成打卡车辆数
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 返回完成打卡车辆数
|
||||||
|
*/
|
||||||
|
Integer getPunchClockOverCount(String start_time, String end_time, String port_area_id);
|
||||||
|
|
||||||
|
|
||||||
|
Integer getInstructHavaSendCount(String start_time, String end_time, String port_area_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外贸出口卡车辆数
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 返回外贸出口卡车辆数
|
||||||
|
*/
|
||||||
|
Integer getForeignTradeExportsCount(String start_time, String end_time, String port_area_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外贸进口卡车辆数
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 返回外贸进口卡车辆数
|
||||||
|
*/
|
||||||
|
Integer getForeignTradeImportsCount(String start_time, String end_time, String port_area_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内贸出口卡车辆数
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 返回内贸出口卡车辆数
|
||||||
|
*/
|
||||||
|
Integer getDomesticTradeExportCount(String start_time, String end_time, String port_area_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内贸进口卡车辆数
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 返回内贸进口卡车辆数
|
||||||
|
*/
|
||||||
|
Integer getDomesticImportsExportCount(String start_time, String end_time, String port_area_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 某进道口的辆数
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @param gate_canal_in 道口号(进)
|
||||||
|
* @return 某进道口的辆数
|
||||||
|
*/
|
||||||
|
Integer getInGateCanalCodeCount(String start_time, String end_time, String port_area_id, String gate_canal_in);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 某出道口的辆数
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @param gate_canal_out 道口号(进)
|
||||||
|
* @return 某出道口的辆数
|
||||||
|
*/
|
||||||
|
Integer getOutGateCanalCodeCount(String start_time, String end_time, String port_area_id, String gate_canal_out);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自动进闸口板车数
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 自动进闸口板车数
|
||||||
|
*/
|
||||||
|
Integer getConventionalityInGateCount(String start_time, String end_time, String port_area_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人工抬杆进闸口板车数
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 人工抬杆进闸口板车数
|
||||||
|
*/
|
||||||
|
Integer getUnConventionalityInGateCount(String start_time, String end_time, String port_area_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 待进港通行板车数 (已签到未进港的)
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 待进港通行板车数 (已签到未进港的)
|
||||||
|
*/
|
||||||
|
Integer getWellInGateCount(String start_time, String end_time, String port_area_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已进港板车数 (已进港但未完成-离港的)
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 已进港板车数 (已进港但未完成-离港的)
|
||||||
|
*/
|
||||||
|
Integer getHaveInGateCount(String start_time, String end_time, String port_area_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已离港板车数
|
||||||
|
*
|
||||||
|
* @param start_time 开始时间
|
||||||
|
* @param end_time 结束时间
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 已离港板车数
|
||||||
|
*/
|
||||||
|
Integer getHavaOutGateCount(String start_time, String end_time, String port_area_id);
|
||||||
|
|
||||||
|
|
||||||
|
PageInfo<Appointment> getAppointmentListByCondition(QueryCondition queryCondition, Pages pages);
|
||||||
|
|
||||||
|
int updateAppointmentInstructState(AppointmentCmd appointmentCmd);
|
||||||
|
|
||||||
|
int batchUpdateAppointmentInstructState(List<AppointmentCmd> appointmentCmdList);
|
||||||
|
|
||||||
|
AppointmentDetail getAppointmentDetailByAppointmentIdAndGoodVin(String truckNumber, String vin);
|
||||||
|
|
||||||
|
List<Appointment> getAppointmentByIds(List<String> ids);
|
||||||
|
|
||||||
|
List<AppointmentDetail> getAppointmentDetailByAppointmentIdList(List<String> appointmentIdList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 板车监控分类列表
|
||||||
|
*
|
||||||
|
* @param queryCondition 查询条件
|
||||||
|
* @param pages 页码
|
||||||
|
* @return 分页数据
|
||||||
|
*/
|
||||||
|
List<AppointmentDetailSort> getAppointmentListByConditionf(QueryCondition queryCondition, Pages pages);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 板车监控明细
|
||||||
|
*
|
||||||
|
* @param appointmentId 预约id
|
||||||
|
* @param shipId 船id
|
||||||
|
* @param brandId 品牌
|
||||||
|
* @return 板车监控明细
|
||||||
|
*/
|
||||||
|
PageInfo<AppointmentDetail> getAppointmentDetailsByConditionf(String appointmentId, String shipId, String brandId, Pages pages);
|
||||||
|
|
||||||
|
|
||||||
|
Truck getPalletTruckByTruckNo(String truckNum);
|
||||||
|
|
||||||
|
Truck getPalletTruckByByUsersId(String usersId);
|
||||||
|
|
||||||
|
Integer postAppointment(Appointment appointment);
|
||||||
|
|
||||||
|
|
||||||
|
List<TruckUser> getTruckByTruckNos(List<String> list);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,83 @@
|
||||||
|
package com.haitongauto.rtosam.service.admin;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.haitongauto.models.dto.PunchClockQuery;
|
||||||
|
import com.haitongauto.models.dto.PunchClockQueryExl;
|
||||||
|
import com.haitongauto.models.pojo.PortArea;
|
||||||
|
import com.haitongauto.models.pojo.PunchClock;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface PunchClockAdminService {
|
||||||
|
/**
|
||||||
|
* 通过港区、业务类型、关键词、签到日期、签到状态(缺卡/正常)、打卡完成状态(缺卡/正常)单独或组合查询
|
||||||
|
*
|
||||||
|
* @param port_area_id:港区id
|
||||||
|
* @param biz_type:业务类型
|
||||||
|
* @param keywords:关键字(姓名、手机号、板车号)
|
||||||
|
* @param sign_in_state:签到状态(0-缺卡,1-正常) String approach_date_start = "";
|
||||||
|
* String approach_date_end = "";
|
||||||
|
* @param punch_state:完工打卡状态(0-缺卡,1-完工)
|
||||||
|
* @param pageNum:当前页码
|
||||||
|
* @param pageSize:每页激流条数
|
||||||
|
* @return 返回打卡分页数据
|
||||||
|
*/
|
||||||
|
PageInfo<PunchClock> PunchClockListForCondition(String users_id, String port_area_id, String biz_type, String keywords, String approach_date_start, String approach_date_end, Integer sign_in_state, Integer punch_state, Integer pageNum, Integer pageSize);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约打卡导出(条件查询)
|
||||||
|
*
|
||||||
|
* @param port_area_id:港区id
|
||||||
|
* @param biz_type:业务类型
|
||||||
|
* @param keywords:关键字(姓名、手机号、板车号)
|
||||||
|
* @param sign_in_state:签到状态(0-缺卡,1-正常)
|
||||||
|
* @param punch_state:完工打卡状态(0-缺卡,1-完工)
|
||||||
|
* @return 返回打卡记录列表
|
||||||
|
*/
|
||||||
|
|
||||||
|
List<PunchClock> PunchClockListExport(String users_id, String port_area_id, String biz_type, String keywords, String approach_date_start, String approach_date_end, Integer sign_in_state, Integer punch_state);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约打卡导出
|
||||||
|
*
|
||||||
|
* @param ids 打卡记录id
|
||||||
|
* @return 返回记录
|
||||||
|
*/
|
||||||
|
List<PunchClock> getPunchClockListExportByIds(List<String> ids);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List<PunchClock>转换为List<PunchClockQuery>
|
||||||
|
*
|
||||||
|
* @param myList 打卡记录列表
|
||||||
|
* @return 返回List<PunchClockQuery>
|
||||||
|
*/
|
||||||
|
List<PunchClockQuery> PunchClockListConvert(List<PunchClock> myList);
|
||||||
|
|
||||||
|
public List<PunchClockQueryExl> PunchClockListConvert1(List<PunchClock> myList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有的打卡港区
|
||||||
|
*
|
||||||
|
* @param port_area_id 港区id
|
||||||
|
* @return 返回港区列表
|
||||||
|
*/
|
||||||
|
public List<PortArea> getPunchClockPortAreaList(String port_area_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据港区id获取所有的打卡港区
|
||||||
|
*
|
||||||
|
* @param id 港区id
|
||||||
|
* @return 返回港区
|
||||||
|
*/
|
||||||
|
PortArea getPunchClockPortAreaById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 港区打卡设置
|
||||||
|
*
|
||||||
|
* @param portArea 港区
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer punchClockPortAreaSetting(PortArea portArea);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.haitongauto.rtosam.service.admin;
|
||||||
|
|
||||||
|
public interface ResponseService {
|
||||||
|
/**
|
||||||
|
* 封装为返回Json对象
|
||||||
|
* @param bl:请求是否成功
|
||||||
|
* @param data:返回数据
|
||||||
|
* @return 返回Json对象
|
||||||
|
*/
|
||||||
|
String getResponseData(Boolean bl,Object data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 封装为返回Json对象
|
||||||
|
* @param bl:请求是否成功
|
||||||
|
* @param data:返回数据
|
||||||
|
* @return 返回Json对象
|
||||||
|
*/
|
||||||
|
String getResponseData(Boolean bl, Object data, String msg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 封装为返回Json对象(带null)
|
||||||
|
* @param bl:请求是否成功
|
||||||
|
* @param data:返回数据
|
||||||
|
* @return 返回Json对象
|
||||||
|
*/
|
||||||
|
String getResponseDataJavaJson(Boolean bl,Object data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 封装为返回Json对象(带null)
|
||||||
|
* @param bl:请求是否成功
|
||||||
|
* @param data:返回数据
|
||||||
|
* @return 返回Json对象
|
||||||
|
*/
|
||||||
|
String getRtosResponseData(Boolean bl,Object data,String errorCode);
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.haitongauto.rtosam.service.admin;
|
||||||
|
import com.haitongauto.models.pojo.TableHead;
|
||||||
|
|
||||||
|
public interface TableHeadService {
|
||||||
|
/**
|
||||||
|
* 动态表头信息插入
|
||||||
|
* @param tableHead 动态表头信实体
|
||||||
|
* @return 返回操作结构
|
||||||
|
*/
|
||||||
|
Integer insertOrUpdate(TableHead tableHead);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据表编码,查询动态表头信息
|
||||||
|
* @param table_code 表编码
|
||||||
|
* @return 返回查询动态表头信息
|
||||||
|
*/
|
||||||
|
TableHead queryByCode(String table_code);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.haitongauto.rtosam.service.admin;
|
||||||
|
|
||||||
|
public interface ToPdfService {
|
||||||
|
/**
|
||||||
|
* 导出PDF
|
||||||
|
*/
|
||||||
|
void htmlToPdf(String htmlDom, String pdfName);
|
||||||
|
|
||||||
|
String htmlToPdfReturnFilePath(String htmlDom, String pdfName);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.haitongauto.rtosam.service.admin;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.haitongauto.models.pojo.Users;
|
||||||
|
|
||||||
|
public interface UsersAdminService {
|
||||||
|
/**
|
||||||
|
* 根据用户ID、手机号、昵称、注册时间和用户状态查询小程序注册用户信息
|
||||||
|
* @param keywords : 查询关键字(用户ID、手机号、昵称)
|
||||||
|
* @param registerDateStart :注册日期
|
||||||
|
* @param registerDateEnd :注册日期
|
||||||
|
* @param usersState:用户状态
|
||||||
|
* @return 返回注册用户信息
|
||||||
|
*/
|
||||||
|
PageInfo<Users> usersListForCondition(String keywords,String registerDateStart,String registerDateEnd, Integer usersState, Integer pageNum, Integer pageSize);
|
||||||
|
}
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.haitongauto.rtosam.service.base;
|
||||||
|
import com.haitongauto.models.pojo.Announcement;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface AnnouncementService {
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param announcement 公告数据实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
String insert(Announcement announcement);
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 公告id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer logicDel(String id);
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 公告id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer delete(String id);
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param announcement 公告数据实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer update(Announcement announcement);
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 公告id
|
||||||
|
* @return 返回指定Id的记录
|
||||||
|
*/
|
||||||
|
Announcement getById(String id);
|
||||||
|
/**
|
||||||
|
* 查询公告列表
|
||||||
|
* @return 返回公告列表
|
||||||
|
*/
|
||||||
|
List<Announcement> getList();
|
||||||
|
}
|
|
@ -0,0 +1,46 @@
|
||||||
|
package com.haitongauto.rtosam.service.base;
|
||||||
|
import com.haitongauto.models.pojo.AppointmentDetail;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface AppointmentDetailService {
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param appointmentDetail 预约详情实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
String insert(AppointmentDetail appointmentDetail);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 预约详情id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer logicDel(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 预约详情id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer delete(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param appointmentDetail 预约详情实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer update(AppointmentDetail appointmentDetail);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 预约详情id
|
||||||
|
* @return 返回指定Id的预约详情
|
||||||
|
*/
|
||||||
|
AppointmentDetail getById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询预约详情列表
|
||||||
|
* @return 查询预约详情列表
|
||||||
|
*/
|
||||||
|
List<AppointmentDetail> getList();
|
||||||
|
}
|
|
@ -0,0 +1,45 @@
|
||||||
|
package com.haitongauto.rtosam.service.base;
|
||||||
|
import com.haitongauto.models.pojo.Appointment;
|
||||||
|
import java.util.List;
|
||||||
|
public interface AppointmentService {
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param appointment 预约实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
String insert(Appointment appointment);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 预约id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer logicDel(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 预约id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer delete(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param appointment 预约实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer update(Appointment appointment);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 预约id
|
||||||
|
* @return 返回指定Id的预约信息
|
||||||
|
*/
|
||||||
|
Appointment getById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询预约信息列表
|
||||||
|
* @return 返回指定Id的预约信息
|
||||||
|
*/
|
||||||
|
List<Appointment> getList();
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package com.haitongauto.rtosam.service.base;
|
||||||
|
|
||||||
|
import com.haitongauto.models.pojo.Dic;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface DicService {
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param dic 通用数据字典实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
String insert(Dic dic);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 通用数据字典id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer logicDel(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 通用数据字典id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer delete(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param dic 通用数据字典实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer update(Dic dic);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 通用数据字典id
|
||||||
|
* @return 返回指定Id的通用数据字典
|
||||||
|
*/
|
||||||
|
Dic getById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询通用数据字典列表
|
||||||
|
* @return 返回通用数据字典列表
|
||||||
|
*/
|
||||||
|
List<Dic> getList();
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
package com.haitongauto.rtosam.service.base;
|
||||||
|
|
||||||
|
import com.haitongauto.models.pojo.Feedback;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface FeedbackService {
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param feedback 意见反馈实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
String insert(Feedback feedback);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 意见反馈id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer logicDel(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 意见反馈id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer delete(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param feedback 意见反馈实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer update(Feedback feedback);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 意见反馈id
|
||||||
|
* @return 指定Id的意见反馈
|
||||||
|
*/
|
||||||
|
Feedback getById(String id);
|
||||||
|
/**
|
||||||
|
* 查询意见反馈列表
|
||||||
|
* @return 返回意见反馈列表
|
||||||
|
*/
|
||||||
|
List<Feedback> getList();
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.haitongauto.rtosam.service.base;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.haitongauto.models.pojo.LoginLog;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface LoginLogService {
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param loginLog 登录日志实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
String insert(LoginLog loginLog);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录日志列表
|
||||||
|
* @return 返回登录日志列表
|
||||||
|
*/
|
||||||
|
List<LoginLog> getList();
|
||||||
|
|
||||||
|
|
||||||
|
PageInfo<LoginLog> loginLogListForCondition(Integer pageNum,Integer pageSize);
|
||||||
|
}
|
|
@ -0,0 +1,50 @@
|
||||||
|
package com.haitongauto.rtosam.service.base;
|
||||||
|
|
||||||
|
import com.haitongauto.models.pojo.NoviceIntroduction;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新手攻略
|
||||||
|
*/
|
||||||
|
public interface NoviceIntroductionService {
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param noviceIntroduction 新手攻略实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
String insert(NoviceIntroduction noviceIntroduction);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 新手攻略id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer logicDel(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 新手攻略id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer delete(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改 新手攻略id
|
||||||
|
* @param noviceIntroduction 新手攻略实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer update(NoviceIntroduction noviceIntroduction);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 新手攻略id
|
||||||
|
* @return 返回查询指定Id的新手攻略
|
||||||
|
*/
|
||||||
|
NoviceIntroduction getById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询新手攻略列表
|
||||||
|
* @return 返回新手攻略列表
|
||||||
|
*/
|
||||||
|
List<NoviceIntroduction> getList();
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
package com.haitongauto.rtosam.service.base;
|
||||||
|
|
||||||
|
import com.haitongauto.models.pojo.PortArea;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface PortAreasService {
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param portArea 港区实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
String insert(PortArea portArea);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 港区id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer logicDel(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 港区id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer delete(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param portArea 港区实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer update(PortArea portArea);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 港区id
|
||||||
|
* @return 返回查询指定Id的港区
|
||||||
|
*/
|
||||||
|
PortArea getById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询港区列表列表
|
||||||
|
* @return 返回港区列表
|
||||||
|
*/
|
||||||
|
List<PortArea> getList();
|
||||||
|
}
|
|
@ -0,0 +1,49 @@
|
||||||
|
package com.haitongauto.rtosam.service.base;
|
||||||
|
|
||||||
|
|
||||||
|
import com.haitongauto.models.pojo.PunchClock;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface PunchClockService {
|
||||||
|
/**
|
||||||
|
* 添加数据,并返回Id
|
||||||
|
* @param punchClock 打卡实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
String insert(PunchClock punchClock);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 打卡id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer logicDel(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 打卡id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer delete(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param punchClock 打卡实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer update(PunchClock punchClock);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 打卡id
|
||||||
|
* @return 返回指定Id的打卡记录
|
||||||
|
*/
|
||||||
|
PunchClock getById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询打卡记录列表
|
||||||
|
* @return 返回打卡记录列表
|
||||||
|
*/
|
||||||
|
List<PunchClock> getList();
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package com.haitongauto.rtosam.service.base;
|
||||||
|
|
||||||
|
import com.haitongauto.models.pojo.ReceivingDetail;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ReceivingDetailService {
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param receivingDetail 收车详情实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
String insert(ReceivingDetail receivingDetail);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 收车详情id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer logicDel(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 收车详情id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer delete(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param receivingDetail 收车详情实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer update(ReceivingDetail receivingDetail);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 收车详情id
|
||||||
|
* @return 返回指定Id的收车详情
|
||||||
|
*/
|
||||||
|
ReceivingDetail getById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询收车详情列表
|
||||||
|
* @return 返回查询收车详情列表
|
||||||
|
*/
|
||||||
|
List<ReceivingDetail> getList();
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.haitongauto.rtosam.service.base;
|
||||||
|
|
||||||
|
import com.haitongauto.models.pojo.ReceivingVehicle;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ReceivingVehicleService {
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param receivingVehicle 收车信息实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
String insert(ReceivingVehicle receivingVehicle);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 收车信息id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer logicDel(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 收车信息id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer delete(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param receivingVehicle 收车信息实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer update(ReceivingVehicle receivingVehicle);
|
||||||
|
|
||||||
|
//查询指定Id的记录
|
||||||
|
ReceivingVehicle getById(String id);
|
||||||
|
|
||||||
|
//列表
|
||||||
|
List<ReceivingVehicle> getList();
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package com.haitongauto.rtosam.service.base;
|
||||||
|
|
||||||
|
import com.haitongauto.models.pojo.ServiceConfig;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ServiceConfigService {
|
||||||
|
/**
|
||||||
|
* 添加数据,并返回Id
|
||||||
|
* @param serviceConfig 服务配置实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
String insert(ServiceConfig serviceConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 服务配置id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer logicDel(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 服务配置id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer delete(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param serviceConfig 服务配置实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer update(ServiceConfig serviceConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的服务配置
|
||||||
|
* @param id 服务配置id
|
||||||
|
* @return 返回指定Id的服务配置
|
||||||
|
*/
|
||||||
|
ServiceConfig getById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询服务配置列表
|
||||||
|
* @return 返回服务配置列表
|
||||||
|
*/
|
||||||
|
List<ServiceConfig> getList();
|
||||||
|
}
|
|
@ -0,0 +1,49 @@
|
||||||
|
package com.haitongauto.rtosam.service.base;
|
||||||
|
|
||||||
|
|
||||||
|
import com.haitongauto.models.pojo.TruckManagement;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface TruckManagementService {
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param truckManagement 板车管理实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
String insert(TruckManagement truckManagement);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 板车管理id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer logicDel(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 板车管理id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer delete(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param truckManagement 板车管理实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer update(TruckManagement truckManagement);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 板车管理id
|
||||||
|
* @return 返回指定Id的板车管理
|
||||||
|
*/
|
||||||
|
TruckManagement getById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询板车管理列表
|
||||||
|
* @return 返回板车管理列表
|
||||||
|
*/
|
||||||
|
List<TruckManagement> getList();
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package com.haitongauto.rtosam.service.base;
|
||||||
|
|
||||||
|
import com.haitongauto.models.pojo.Truck;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface TruckService {
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param truck 板车实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
String insert(Truck truck);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 板车id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer logicDel(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 板车id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer delete(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param truck 板车实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer update(Truck truck);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 板车 id
|
||||||
|
* @return 返回指定Id的记录
|
||||||
|
*/
|
||||||
|
Truck getById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询板车列表
|
||||||
|
* @return 返回板车列表
|
||||||
|
*/
|
||||||
|
List<Truck> getList();
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
package com.haitongauto.rtosam.service.base;
|
||||||
|
import com.haitongauto.models.pojo.Users;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface UsersService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param users 用户实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
String insert(Users users);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 用户id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer logicDel(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 用户id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer delete(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param users 用户实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
Integer update(Users users);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 用户id
|
||||||
|
* @return 返回指定Id的用户
|
||||||
|
*/
|
||||||
|
Users getById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户列表
|
||||||
|
* @return 返回用户列表
|
||||||
|
*/
|
||||||
|
List<Users> getList();
|
||||||
|
}
|
|
@ -0,0 +1,73 @@
|
||||||
|
package com.haitongauto.rtosam.service.base.impl;
|
||||||
|
|
||||||
|
import com.haitongauto.models.pojo.Announcement;
|
||||||
|
import com.haitongauto.rtosam.service.base.AnnouncementService;
|
||||||
|
import com.haitongauto.mapper.base.AnnouncementMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class AnnouncementServiceImpl implements AnnouncementService {
|
||||||
|
@Autowired
|
||||||
|
AnnouncementMapper announcementMapper;
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param announcement 公告数据实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String insert(Announcement announcement){
|
||||||
|
//生成并添加UUID
|
||||||
|
String uuid = UUID.randomUUID().toString().replace("-","").toLowerCase();
|
||||||
|
announcement.setId(uuid);
|
||||||
|
return announcementMapper.insert(announcement);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 公告id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer logicDel(String id){
|
||||||
|
return announcementMapper.logicDel(id);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 公告id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer delete(String id){
|
||||||
|
return announcementMapper.delete(id);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param announcement 公告数据实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer update(Announcement announcement){
|
||||||
|
return announcementMapper.update(announcement);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 公告id
|
||||||
|
* @return 返回指定Id的记录
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Announcement getById(String id){
|
||||||
|
return announcementMapper.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询公告列表
|
||||||
|
* @return 返回公告列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Announcement> getList(){
|
||||||
|
return announcementMapper.getList();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,78 @@
|
||||||
|
package com.haitongauto.rtosam.service.base.impl;
|
||||||
|
|
||||||
|
import com.haitongauto.mapper.base.AppointmentDetailMapper;
|
||||||
|
import com.haitongauto.models.pojo.AppointmentDetail;
|
||||||
|
import com.haitongauto.rtosam.service.base.AppointmentDetailService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class AppointmentDetailServiceImpl implements AppointmentDetailService {
|
||||||
|
@Autowired
|
||||||
|
AppointmentDetailMapper apointmentDetailMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param appointmentDetail 预约详情实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String insert(AppointmentDetail appointmentDetail){
|
||||||
|
//生成并添加UUID
|
||||||
|
String uuid = UUID.randomUUID().toString().replace("-","").toLowerCase();
|
||||||
|
appointmentDetail.setId(uuid);
|
||||||
|
return apointmentDetailMapper.insert(appointmentDetail);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 预约详情id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer logicDel(String id){
|
||||||
|
return apointmentDetailMapper.logicDel(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 预约详情id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer delete(String id){
|
||||||
|
return apointmentDetailMapper.delete(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param appointmentDetail 预约详情实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer update(AppointmentDetail appointmentDetail){
|
||||||
|
return apointmentDetailMapper.update(appointmentDetail);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 预约详情id
|
||||||
|
* @return 返回指定Id的预约详情
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AppointmentDetail getById(String id){
|
||||||
|
return apointmentDetailMapper.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询预约详情列表
|
||||||
|
* @return 查询预约详情列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<AppointmentDetail> getList(){
|
||||||
|
return apointmentDetailMapper.getList();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,75 @@
|
||||||
|
package com.haitongauto.rtosam.service.base.impl;
|
||||||
|
import com.haitongauto.rtosam.service.base.AppointmentService;
|
||||||
|
import com.haitongauto.models.pojo.Appointment;
|
||||||
|
import com.haitongauto.mapper.base.AppointmentMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
@Service
|
||||||
|
public class AppointmentServiceImpl implements AppointmentService {
|
||||||
|
@Autowired
|
||||||
|
AppointmentMapper appointmentMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param appointment 预约实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String insert(Appointment appointment){
|
||||||
|
//生成并添加UUID
|
||||||
|
String uuid = UUID.randomUUID().toString().replace("-","").toLowerCase();
|
||||||
|
appointment.setId(uuid);
|
||||||
|
return appointmentMapper.insert(appointment);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 预约id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer logicDel(String id){
|
||||||
|
return appointmentMapper.logicDel(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 预约id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer delete(String id){
|
||||||
|
return appointmentMapper.delete(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param appointment 预约实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer update(Appointment appointment){
|
||||||
|
return appointmentMapper.update(appointment);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 预约id
|
||||||
|
* @return 返回指定Id的预约信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Appointment getById(String id){
|
||||||
|
return appointmentMapper.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询预约信息列表
|
||||||
|
* @return 返回指定Id的预约信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Appointment> getList(){
|
||||||
|
return appointmentMapper.getList();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,77 @@
|
||||||
|
package com.haitongauto.rtosam.service.base.impl;
|
||||||
|
|
||||||
|
import com.haitongauto.mapper.base.DicMapper;
|
||||||
|
import com.haitongauto.models.pojo.Dic;
|
||||||
|
import com.haitongauto.rtosam.service.base.DicService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class DicServiceImpl implements DicService {
|
||||||
|
@Autowired
|
||||||
|
DicMapper dicMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param dic 通用数据字典实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String insert(Dic dic){
|
||||||
|
////生成并添加UUID,备注:该数据目前为外部接口传入数据,id数据已存在,此处不再重复生成
|
||||||
|
//String uuid = UUID.randomUUID().toString();
|
||||||
|
//dic.setId(uuid);
|
||||||
|
return dicMapper.insert(dic);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 通用数据字典id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer logicDel(String id){
|
||||||
|
return dicMapper.logicDel(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 通用数据字典id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer delete(String id){
|
||||||
|
return dicMapper.delete(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param dic 通用数据字典实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer update(Dic dic){
|
||||||
|
return dicMapper.update(dic);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 通用数据字典id
|
||||||
|
* @return 返回指定Id的通用数据字典
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Dic getById(String id){
|
||||||
|
return dicMapper.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询通用数据字典列表
|
||||||
|
* @return 返回通用数据字典列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Dic> getList(){
|
||||||
|
return dicMapper.getList();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,80 @@
|
||||||
|
package com.haitongauto.rtosam.service.base.impl;
|
||||||
|
|
||||||
|
import com.haitongauto.rtosam.service.base.FeedbackService;
|
||||||
|
import com.haitongauto.models.pojo.Feedback;
|
||||||
|
import com.haitongauto.mapper.base.FeedbackMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class FeedbackServiceImpl implements FeedbackService {
|
||||||
|
@Autowired
|
||||||
|
FeedbackMapper feedbackMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param feedback 意见反馈实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String insert(Feedback feedback){
|
||||||
|
//生成并添加UUID
|
||||||
|
String uuid = UUID.randomUUID().toString().replace("-","").toLowerCase();
|
||||||
|
feedback.setId(uuid);
|
||||||
|
feedback.setIs_del(0);
|
||||||
|
return feedbackMapper.insert(feedback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 意见反馈id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer logicDel(String id){
|
||||||
|
return feedbackMapper.logicDel(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 意见反馈id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer delete(String id){
|
||||||
|
return feedbackMapper.delete(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param feedback 意见反馈实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer update(Feedback feedback){
|
||||||
|
return feedbackMapper.update(feedback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 意见反馈id
|
||||||
|
* @return 指定Id的意见反馈
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Feedback getById(String id){
|
||||||
|
return (Feedback) feedbackMapper.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询意见反馈列表
|
||||||
|
* @return 返回意见反馈列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Feedback> getList(){
|
||||||
|
return feedbackMapper.getList();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,52 @@
|
||||||
|
package com.haitongauto.rtosam.service.base.impl;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.haitongauto.models.pojo.LoginLog;
|
||||||
|
import com.haitongauto.models.pojo.PunchClock;
|
||||||
|
import com.haitongauto.rtosam.service.base.LoginLogService;
|
||||||
|
import com.haitongauto.mapper.base.LoginLogMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class LoginLogServiceImpl implements LoginLogService {
|
||||||
|
@Autowired
|
||||||
|
LoginLogMapper loginLogMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param loginLog 登录日志实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String insert(LoginLog loginLog) {
|
||||||
|
//生成并添加UUID
|
||||||
|
String uuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
|
||||||
|
loginLog.setId(uuid);
|
||||||
|
return loginLogMapper.insert(loginLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录日志列表
|
||||||
|
*
|
||||||
|
* @return 返回登录日志列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<LoginLog> getList() {
|
||||||
|
return loginLogMapper.getList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<LoginLog> loginLogListForCondition(Integer pageNum, Integer pageSize) {
|
||||||
|
//初始化PageHelper
|
||||||
|
PageHelper.startPage(pageNum, pageSize, true, false, false);
|
||||||
|
List<LoginLog> myList = loginLogMapper.getList();
|
||||||
|
//封装分页数据
|
||||||
|
return new PageInfo<LoginLog>(myList);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,80 @@
|
||||||
|
package com.haitongauto.rtosam.service.base.impl;
|
||||||
|
|
||||||
|
import com.haitongauto.rtosam.service.base.NoviceIntroductionService;
|
||||||
|
import com.haitongauto.models.pojo.NoviceIntroduction;
|
||||||
|
import com.haitongauto.mapper.base.NoviceIntroductionMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class NoviceIntroductionServiceImpl implements NoviceIntroductionService {
|
||||||
|
@Autowired
|
||||||
|
NoviceIntroductionMapper noviceIntroductionMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param noviceIntroduction 新手攻略实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String insert(NoviceIntroduction noviceIntroduction){
|
||||||
|
//生成并添加UUID
|
||||||
|
String uuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
|
||||||
|
noviceIntroduction.setId(uuid);
|
||||||
|
noviceIntroduction.setIs_del(0);
|
||||||
|
return noviceIntroductionMapper.insert(noviceIntroduction);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 新手攻略id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer logicDel(String id){
|
||||||
|
return noviceIntroductionMapper.logicDel(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 新手攻略id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer delete(String id){
|
||||||
|
return noviceIntroductionMapper.delete(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改 新手攻略id
|
||||||
|
* @param noviceIntroduction 新手攻略实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer update(NoviceIntroduction noviceIntroduction){
|
||||||
|
return noviceIntroductionMapper.update(noviceIntroduction);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 新手攻略id
|
||||||
|
* @return 返回查询指定Id的新手攻略
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public NoviceIntroduction getById(String id){
|
||||||
|
return noviceIntroductionMapper.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询新手攻略列表
|
||||||
|
* @return 返回新手攻略列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<NoviceIntroduction> getList(){
|
||||||
|
List<NoviceIntroduction> mylist = noviceIntroductionMapper.getList();
|
||||||
|
return mylist;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,82 @@
|
||||||
|
package com.haitongauto.rtosam.service.base.impl;
|
||||||
|
|
||||||
|
import com.haitongauto.rtosam.service.base.PortAreasService;
|
||||||
|
import com.haitongauto.models.pojo.PortArea;
|
||||||
|
import com.haitongauto.mapper.base.PortAreasMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class PortAreasServiceImpl implements PortAreasService {
|
||||||
|
@Autowired
|
||||||
|
PortAreasMapper portAreasMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param portArea 港区实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String insert(PortArea portArea){
|
||||||
|
////生成并添加UUID,备注:该数据目前为外部接口传入数据,id数据已存在,此处不再重复生成
|
||||||
|
//String uuid = UUID.randomUUID().toString();
|
||||||
|
//portArea.setId(uuid);
|
||||||
|
portArea.setIs_del(0);
|
||||||
|
return portAreasMapper.insert(portArea);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 港区id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer logicDel(String id){
|
||||||
|
Integer x = portAreasMapper.logicDel(id);
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 港区id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer delete(String id){
|
||||||
|
Integer x = portAreasMapper.delete(id);
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param portArea 港区实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer update(PortArea portArea){
|
||||||
|
return portAreasMapper.update(portArea);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 港区id
|
||||||
|
* @return 返回查询指定Id的港区
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PortArea getById(String id){
|
||||||
|
PortArea portAreas = portAreasMapper.getById(id);
|
||||||
|
return portAreas;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询港区列表列表
|
||||||
|
* @return 返回港区列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<PortArea> getList(){
|
||||||
|
List<PortArea> mylist = portAreasMapper.getList();
|
||||||
|
return mylist;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,78 @@
|
||||||
|
package com.haitongauto.rtosam.service.base.impl;
|
||||||
|
|
||||||
|
import com.haitongauto.models.pojo.PunchClock;
|
||||||
|
import com.haitongauto.rtosam.service.base.PunchClockService;
|
||||||
|
import com.haitongauto.mapper.base.PunchClockMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class PunchClockServiceImpl implements PunchClockService {
|
||||||
|
@Autowired
|
||||||
|
PunchClockMapper punchClockMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加数据,并返回Id
|
||||||
|
* @param punchClock 打卡实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String insert(PunchClock punchClock){
|
||||||
|
//生成并添加UUID
|
||||||
|
String uuid = UUID.randomUUID().toString().replace("-","").toLowerCase();
|
||||||
|
punchClock.setId(uuid);
|
||||||
|
return punchClockMapper.insert(punchClock);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 打卡id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer logicDel(String id){
|
||||||
|
return punchClockMapper.logicDel(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 打卡id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer delete(String id){
|
||||||
|
return punchClockMapper.delete(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param punchClock 打卡实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer update(PunchClock punchClock){
|
||||||
|
return punchClockMapper.update(punchClock);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 打卡id
|
||||||
|
* @return 返回指定Id的打卡记录
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PunchClock getById(String id){
|
||||||
|
return punchClockMapper.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询打卡记录列表
|
||||||
|
* @return 返回打卡记录列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<PunchClock> getList(){
|
||||||
|
return punchClockMapper.getList();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,78 @@
|
||||||
|
package com.haitongauto.rtosam.service.base.impl;
|
||||||
|
|
||||||
|
import com.haitongauto.mapper.base.ReceivingDetailMapper;
|
||||||
|
import com.haitongauto.models.pojo.ReceivingDetail;
|
||||||
|
import com.haitongauto.rtosam.service.base.ReceivingDetailService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class ReceivingDetailServiceImpl implements ReceivingDetailService {
|
||||||
|
@Autowired
|
||||||
|
ReceivingDetailMapper receivingDetailMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param receivingDetail 收车详情实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String insert(ReceivingDetail receivingDetail){
|
||||||
|
//生成并添加UUID
|
||||||
|
String uuid = UUID.randomUUID().toString().replace("-","").toLowerCase();
|
||||||
|
receivingDetail.setId(uuid);
|
||||||
|
return receivingDetailMapper.insert(receivingDetail);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 收车详情id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer logicDel(String id){
|
||||||
|
return receivingDetailMapper.logicDel(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 收车详情id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer delete(String id){
|
||||||
|
return receivingDetailMapper.delete(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param receivingDetail 收车详情实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer update(ReceivingDetail receivingDetail){
|
||||||
|
return receivingDetailMapper.update(receivingDetail);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 收车详情id
|
||||||
|
* @return 返回指定Id的收车详情
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ReceivingDetail getById(String id){
|
||||||
|
return receivingDetailMapper.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询收车详情列表
|
||||||
|
* @return 返回查询收车详情列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<ReceivingDetail> getList(){
|
||||||
|
return receivingDetailMapper.getList();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,71 @@
|
||||||
|
package com.haitongauto.rtosam.service.base.impl;
|
||||||
|
|
||||||
|
import com.haitongauto.mapper.base.ReceivingVehicleMapper;
|
||||||
|
import com.haitongauto.models.pojo.ReceivingVehicle;
|
||||||
|
import com.haitongauto.rtosam.service.base.ReceivingVehicleService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class ReceivingVehicleServiceImpl implements ReceivingVehicleService {
|
||||||
|
@Autowired
|
||||||
|
ReceivingVehicleMapper departureDetailMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param receivingVehicle 收车信息实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String insert(ReceivingVehicle receivingVehicle){
|
||||||
|
//生成并添加UUID
|
||||||
|
String uuid = UUID.randomUUID().toString().replace("-","").toLowerCase();
|
||||||
|
receivingVehicle.setId(uuid);
|
||||||
|
return departureDetailMapper.insert(receivingVehicle);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 收车信息id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer logicDel(String id){
|
||||||
|
return departureDetailMapper.logicDel(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 收车信息id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer delete(String id){
|
||||||
|
return departureDetailMapper.delete(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param receivingVehicle 收车信息实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer update(ReceivingVehicle receivingVehicle){
|
||||||
|
return departureDetailMapper.update(receivingVehicle);
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询指定Id的记录
|
||||||
|
@Override
|
||||||
|
public ReceivingVehicle getById(String id){
|
||||||
|
return departureDetailMapper.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
//列表
|
||||||
|
@Override
|
||||||
|
public List<ReceivingVehicle> getList(){
|
||||||
|
return departureDetailMapper.getList();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,77 @@
|
||||||
|
package com.haitongauto.rtosam.service.base.impl;
|
||||||
|
|
||||||
|
import com.haitongauto.models.pojo.ServiceConfig;
|
||||||
|
import com.haitongauto.rtosam.service.base.ServiceConfigService;
|
||||||
|
import com.haitongauto.mapper.base.ServiceConfigMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class ServiceConfigServiceImpl implements ServiceConfigService {
|
||||||
|
@Autowired
|
||||||
|
ServiceConfigMapper serviceConfigMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加数据,并返回Id
|
||||||
|
* @param serviceConfig 服务配置实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String insert(ServiceConfig serviceConfig){
|
||||||
|
//生成并添加UUID
|
||||||
|
String uuid = UUID.randomUUID().toString().replace("-","").toLowerCase();
|
||||||
|
serviceConfig.setId(uuid);
|
||||||
|
return serviceConfigMapper.insert(serviceConfig);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 服务配置id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer logicDel(String id){
|
||||||
|
return serviceConfigMapper.logicDel(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 服务配置id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer delete(String id){
|
||||||
|
return serviceConfigMapper.delete(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加数据,修改
|
||||||
|
* @param serviceConfig 服务配置实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer update(ServiceConfig serviceConfig){
|
||||||
|
return serviceConfigMapper.update(serviceConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的服务配置
|
||||||
|
* @param id 服务配置id
|
||||||
|
* @return 返回指定Id的服务配置
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ServiceConfig getById(String id){
|
||||||
|
return serviceConfigMapper.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询服务配置列表
|
||||||
|
* @return 返回服务配置列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<ServiceConfig> getList(){
|
||||||
|
return serviceConfigMapper.getList();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,77 @@
|
||||||
|
package com.haitongauto.rtosam.service.base.impl;
|
||||||
|
|
||||||
|
import com.haitongauto.models.pojo.TruckManagement;
|
||||||
|
import com.haitongauto.rtosam.service.base.TruckManagementService;
|
||||||
|
import com.haitongauto.mapper.base.TruckManagementMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class TruckManagementServiceImpl implements TruckManagementService {
|
||||||
|
@Autowired
|
||||||
|
TruckManagementMapper truckManagementMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param truckManagement 板车管理实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String insert(TruckManagement truckManagement){
|
||||||
|
//生成并添加UUID
|
||||||
|
String uuid = UUID.randomUUID().toString().replace("-","").toLowerCase();
|
||||||
|
truckManagement.setId(uuid);
|
||||||
|
return truckManagementMapper.insert(truckManagement);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 板车管理id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer logicDel(String id){
|
||||||
|
return truckManagementMapper.logicDel(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 板车管理id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer delete(String id){
|
||||||
|
return truckManagementMapper.delete(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改 * @param truckManagement 板车管理实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer update(TruckManagement truckManagement){
|
||||||
|
return truckManagementMapper.update(truckManagement);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 板车管理id
|
||||||
|
* @return 返回指定Id的板车管理
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TruckManagement getById(String id){
|
||||||
|
return truckManagementMapper.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询板车管理列表
|
||||||
|
* @return 返回板车管理列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<TruckManagement> getList(){
|
||||||
|
return truckManagementMapper.getList();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,80 @@
|
||||||
|
package com.haitongauto.rtosam.service.base.impl;
|
||||||
|
|
||||||
|
import com.haitongauto.mapper.base.TruckMapper;
|
||||||
|
import com.haitongauto.models.pojo.Truck;
|
||||||
|
import com.haitongauto.rtosam.service.base.TruckService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class TruckServiceImpl implements TruckService {
|
||||||
|
@Autowired
|
||||||
|
TruckMapper palletTruckMapper;
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param truck 板车实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String insert(Truck truck){
|
||||||
|
//生成并添加UUID
|
||||||
|
String uuid = UUID.randomUUID().toString();
|
||||||
|
truck.setId(uuid);
|
||||||
|
return palletTruckMapper.insert(truck);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 板车id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer logicDel(String id){
|
||||||
|
return palletTruckMapper.logicDel(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 板车id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer delete(String id){
|
||||||
|
return palletTruckMapper.delete(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param truck 板车实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer update(Truck truck){
|
||||||
|
Integer x = palletTruckMapper.update(truck);
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 板车 id
|
||||||
|
* @return 返回指定Id的记录
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Truck getById(String id){
|
||||||
|
Truck palletTruck = palletTruckMapper.getById(id);
|
||||||
|
return palletTruck;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询板车列表
|
||||||
|
* @return 返回板车列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Truck> getList(){
|
||||||
|
List<Truck> mylist = palletTruckMapper.getList();
|
||||||
|
return mylist;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,76 @@
|
||||||
|
package com.haitongauto.rtosam.service.base.impl;
|
||||||
|
import com.haitongauto.rtosam.service.base.UsersService;
|
||||||
|
import com.haitongauto.models.pojo.Users;
|
||||||
|
import com.haitongauto.mapper.base.UsersMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class UsersServiceImpl implements UsersService {
|
||||||
|
@Autowired
|
||||||
|
UsersMapper usersMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param users 用户实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String insert(Users users){
|
||||||
|
////生成并添加UUID,备注:该数据目前为外部接口传入数据,id数据已存在,此处不再重复生成
|
||||||
|
//String uuid = UUID.randomUUID().toString();
|
||||||
|
//users.setId(uuid);
|
||||||
|
return usersMapper.insert(users);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除
|
||||||
|
* @param id 用户id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer logicDel(String id){
|
||||||
|
return usersMapper.logicDel(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id 用户id
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer delete(String id){
|
||||||
|
return usersMapper.delete(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param users 用户实体
|
||||||
|
* @return 返回执行结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer update(Users users){
|
||||||
|
return usersMapper.update(users);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定Id的记录
|
||||||
|
* @param id 用户id
|
||||||
|
* @return 返回指定Id的用户
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Users getById(String id){
|
||||||
|
return usersMapper.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户列表
|
||||||
|
* @return 返回用户列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Users> getList(){
|
||||||
|
return usersMapper.getList();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
server-addr: 192.168.61.130:8848
|
||||||
|
discovery:
|
||||||
|
enabled: true
|
||||||
|
server-addr: 192.168.61.130:8848
|
||||||
|
namespace: 4f38d093-5ff8-46f0-974f-08453b0980f4
|
||||||
|
file-extension: yaml
|
||||||
|
group: DEFAULT_GROUP
|
||||||
|
config:
|
||||||
|
enabled: true
|
||||||
|
server-addr: 192.168.61.130:8848
|
||||||
|
namespace: 4f38d093-5ff8-46f0-974f-08453b0980f4
|
||||||
|
file-extension: yaml
|
||||||
|
group: DEFAULT_GROUP
|
||||||
|
prefix: ${spring.application.name}
|
||||||
|
shared-configs:
|
||||||
|
- data-id: rtops-pre.yaml
|
||||||
|
username: nacos
|
||||||
|
password: Nuzar123456_#QWE
|
|
@ -0,0 +1,22 @@
|
||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
server-addr: nacos1:8848,nacos2:8848,nacos3:8848
|
||||||
|
discovery:
|
||||||
|
enabled: true
|
||||||
|
server-addr: nacos1:8848,nacos2:8848,nacos3:8848
|
||||||
|
namespace: 80f92d8d-5c3e-41bd-a0c0-cb5c63652340
|
||||||
|
file-extension: yaml
|
||||||
|
group: DEFAULT_GROUP
|
||||||
|
config:
|
||||||
|
enabled: true
|
||||||
|
server-addr: nacos1:8848,nacos2:8848,nacos3:8848
|
||||||
|
namespace: 80f92d8d-5c3e-41bd-a0c0-cb5c63652340
|
||||||
|
file-extension: yaml
|
||||||
|
group: DEFAULT_GROUP
|
||||||
|
prefix: ${spring.application.name}
|
||||||
|
shared-configs:
|
||||||
|
- data-id: rtops-prod.yaml
|
||||||
|
username: nacos
|
||||||
|
password: Nuzar123456_@HTGJ1
|
||||||
|
|
|
@ -0,0 +1,69 @@
|
||||||
|
# 微信小程序服务配置
|
||||||
|
server:
|
||||||
|
port: 8892
|
||||||
|
shutdown: graceful
|
||||||
|
|
||||||
|
|
||||||
|
# postgresql数据源配置
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: rtos-mini-admin
|
||||||
|
profiles:
|
||||||
|
active: pre
|
||||||
|
|
||||||
|
# datasource:
|
||||||
|
# driver-class-name: org.postgresql.Driver
|
||||||
|
# url: jdbc:postgresql://localhost:5432/rtos_wx_applet?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8
|
||||||
|
# username: postgres
|
||||||
|
# password: wsnet_906 #Fineidc@2023 #wsnet_906
|
||||||
|
|
||||||
|
# # 丰网服务器环境:IP:61.184.202.72; port:5432; db:rtos_applet_v2; user: postgres password: Fineidc@2023
|
||||||
|
# datasource:
|
||||||
|
# driver-class-name: org.postgresql.Driver
|
||||||
|
# url: jdbc:postgresql://61.184.202.72:5432/rtos_applet_v2?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8
|
||||||
|
# username: postgres
|
||||||
|
# password: Fineidc@2023 #Fineidc@2023 #wsnet_906
|
||||||
|
|
||||||
|
# 海通测试环境:IP:192.168.61.114; port:5432; db:rtos_wh; user: rtops_wh password: wh#2023
|
||||||
|
# datasource:
|
||||||
|
# driver-class-name: org.postgresql.Driver
|
||||||
|
# url: jdbc:postgresql://192.168.61.114:5432/rtos_wh?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8
|
||||||
|
# username: rtops_wh
|
||||||
|
# password: wh#2023
|
||||||
|
|
||||||
|
|
||||||
|
# 开发库本地(公司):IP:192.168.0.16; port:5432; db:rtops_wh; user: rtos_wh password: wh#2023
|
||||||
|
# datasource:
|
||||||
|
# driver-class-name: org.postgresql.Driver
|
||||||
|
# url: jdbc:postgresql://192.168.0.16:5432/rtos_wh?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8
|
||||||
|
# username: rtops_wh
|
||||||
|
# password: wh#2023
|
||||||
|
|
||||||
|
# # 开发库本地:IP:localhost; port:5432; db:rtos_wh; user: postgres password: wsnet906
|
||||||
|
# datasource:
|
||||||
|
# driver-class-name: org.postgresql.Driver
|
||||||
|
# url: jdbc:postgresql://localhost:5432/rtos_wh?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8
|
||||||
|
# username: postgres
|
||||||
|
# password: wsnet906
|
||||||
|
|
||||||
|
# 华为云测试环境:IP:116.205.142.169; port:5432; db:rtos_wh; user: rtops_wh password: wh#2023
|
||||||
|
# datasource:
|
||||||
|
# driver-class-name: org.postgresql.Driver
|
||||||
|
# url: jdbc:postgresql://116.205.142.169:5432/rtos_wh?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8
|
||||||
|
# username: rtops_wh
|
||||||
|
# password: wh#2023
|
||||||
|
|
||||||
|
# mybatis配置
|
||||||
|
#mybatis:
|
||||||
|
# mapper-locations: classpath:mappers/*/*.xml
|
||||||
|
#
|
||||||
|
## pagehelper 分页插件
|
||||||
|
#pagehelper:
|
||||||
|
# helperDialect: postgresql
|
||||||
|
# reasonable: true
|
||||||
|
# supportMethodsArguments: true
|
||||||
|
# rowBoundsWithCount: true
|
||||||
|
|
||||||
|
|
||||||
|
#params: count=countSql
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 574 KiB |
Binary file not shown.
After Width: | Height: | Size: 574 KiB |
|
@ -0,0 +1,66 @@
|
||||||
|
# 微信小程序服务配置
|
||||||
|
server:
|
||||||
|
port: 8892
|
||||||
|
|
||||||
|
|
||||||
|
# postgresql数据源配置
|
||||||
|
spring:
|
||||||
|
# profiles:
|
||||||
|
# active: pre
|
||||||
|
|
||||||
|
# datasource:
|
||||||
|
# driver-class-name: org.postgresql.Driver
|
||||||
|
# url: jdbc:postgresql://localhost:5432/rtos_wx_applet?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8
|
||||||
|
# username: postgres
|
||||||
|
# password: wsnet_906 #Fineidc@2023 #wsnet_906
|
||||||
|
|
||||||
|
# # 丰网服务器环境:IP:61.184.202.72; port:5432; db:rtos_applet_v2; user: postgres password: Fineidc@2023
|
||||||
|
# datasource:
|
||||||
|
# driver-class-name: org.postgresql.Driver
|
||||||
|
# url: jdbc:postgresql://61.184.202.72:5432/rtos_applet_v2?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8
|
||||||
|
# username: postgres
|
||||||
|
# password: Fineidc@2023 #Fineidc@2023 #wsnet_906
|
||||||
|
|
||||||
|
# 海通测试环境:IP:192.168.61.114; port:5432; db:rtos_wh; user: rtops_wh password: wh#2023
|
||||||
|
datasource:
|
||||||
|
driver-class-name: org.postgresql.Driver
|
||||||
|
url: jdbc:postgresql://192.168.61.114:5432/rtos_wh?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8
|
||||||
|
username: rtops_wh
|
||||||
|
password: wh#2023
|
||||||
|
|
||||||
|
|
||||||
|
# 开发库本地(公司):IP:192.168.0.16; port:5432; db:rtops_wh; user: rtos_wh password: wh#2023
|
||||||
|
# datasource:
|
||||||
|
# driver-class-name: org.postgresql.Driver
|
||||||
|
# url: jdbc:postgresql://192.168.0.16:5432/rtos_wh?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8
|
||||||
|
# username: rtops_wh
|
||||||
|
# password: wh#2023
|
||||||
|
|
||||||
|
# # 开发库本地:IP:localhost; port:5432; db:rtos_wh; user: postgres password: wsnet906
|
||||||
|
# datasource:
|
||||||
|
# driver-class-name: org.postgresql.Driver
|
||||||
|
# url: jdbc:postgresql://localhost:5432/rtos_wh?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8
|
||||||
|
# username: postgres
|
||||||
|
# password: wsnet906
|
||||||
|
|
||||||
|
# 华为云测试环境:IP:116.205.142.169; port:5432; db:rtos_wh; user: rtops_wh password: wh#2023
|
||||||
|
# datasource:
|
||||||
|
# driver-class-name: org.postgresql.Driver
|
||||||
|
# url: jdbc:postgresql://116.205.142.169:5432/rtos_wh?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8
|
||||||
|
# username: rtops_wh
|
||||||
|
# password: wh#2023
|
||||||
|
|
||||||
|
# mybatis配置
|
||||||
|
mybatis:
|
||||||
|
mapper-locations: classpath:mappers/*/*.xml
|
||||||
|
|
||||||
|
# pagehelper 分页插件
|
||||||
|
pagehelper:
|
||||||
|
helperDialect: postgresql
|
||||||
|
reasonable: true
|
||||||
|
supportMethodsArguments: true
|
||||||
|
rowBoundsWithCount: true
|
||||||
|
|
||||||
|
|
||||||
|
#params: count=countSql
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
# 微信小程序服务配置
|
||||||
|
server:
|
||||||
|
port: 8892
|
||||||
|
|
||||||
|
|
||||||
|
# postgresql数据源配置
|
||||||
|
spring:
|
||||||
|
profiles:
|
||||||
|
active: pre
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module version="4">
|
||||||
|
<component name="SonarLintModuleSettings">
|
||||||
|
<option name="uniqueId" value="6a2fe037-23e0-4184-b489-ba0f3db0cd3a" />
|
||||||
|
</component>
|
||||||
|
</module>
|
Loading…
Reference in New Issue