diff --git a/wx-applet-admin/Dockerfile b/wx-applet-admin/Dockerfile new file mode 100644 index 0000000..c68d646 --- /dev/null +++ b/wx-applet-admin/Dockerfile @@ -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" ] \ No newline at end of file diff --git a/wx-applet-admin/Dockerfile.back b/wx-applet-admin/Dockerfile.back new file mode 100644 index 0000000..e4bf506 --- /dev/null +++ b/wx-applet-admin/Dockerfile.back @@ -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"] \ No newline at end of file diff --git a/wx-applet-admin/pom.xml b/wx-applet-admin/pom.xml new file mode 100644 index 0000000..42707f1 --- /dev/null +++ b/wx-applet-admin/pom.xml @@ -0,0 +1,247 @@ + + + + rtos-wh + org.example + 1.0-SNAPSHOT + + 4.0.0 + + wx-applet-admin + + + 1.8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-web + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + 2.2.2 + + + + + org.postgresql + postgresql + 42.2.2 + + + org.projectlombok + lombok + 1.18.20 + + + com.alibaba + fastjson + 1.2.7 + + + com.lowagie + itext + 2.0.8 + + + org.apache.pdfbox + pdfbox + 2.0.19 + + + + org.springframework.boot + spring-boot-maven-plugin + 2.6.6 + + + + + com.github.pagehelper + pagehelper-spring-boot-starter + 1.4.2 + + + com.github.pagehelper + pagehelper + 5.3.0 + + + + com.bestvike + linq + 3.1.0 + + + + org.example + models + 1.0-SNAPSHOT + + + org.example + utils + 1.0-SNAPSHOT + + + org.example + mapper + 1.0-SNAPSHOT + + + org.example + interfaces + 1.0-SNAPSHOT + + + + com.nuzar + nuzar-security + 2.6.14.10-SNAPSHOT + + + + + + com.nuzar + rtops-openapi-client + 1.0-SNAPSHOT + + + + com.nuzar + nuzar-security + 2.6.14.10-SNAPSHOT + + + + org.springframework.security + spring-security-web + 5.6.9 + + + + org.springframework.security + spring-security-config + 5.6.9 + + + + + org.springframework.boot + spring-boot-starter-oauth2-resource-server + 2.6.14 + + + + org.springframework.boot + spring-boot-starter-oauth2-client + 2.6.14 + + + + org.springframework.security + spring-security-oauth2-resource-server + 5.6.9 + + + org.springframework.security + spring-security-oauth2-client + 5.6.9 + + + + org.springframework.security + spring-security-core + 5.6.9 + + + org.springframework.cloud + spring-cloud-starter-bootstrap + + + + org.springframework.cloud + spring-cloud-starter-loadbalancer + + + + top.jfunc.json + Json-Gson + 1.0 + + + top.jfunc.json + Json-Gson + 1.0 + + + top.jfunc.json + Json-Gson + 1.0 + + + org.owasp.encoder + encoder + 1.2.3 + + + org.apache.commons + commons-text + 1.9 + + + + + com.haitongauto.rtosam + + + src/main/resources + + + + + + org.springframework.boot + spring-boot-maven-plugin + 2.2.2.RELEASE + + + + repackage + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.1 + + + + + org.springframework.boot + spring-boot-configuration-processor + + + + + + + + \ No newline at end of file diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/ApplicationAppletAdmin.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/ApplicationAppletAdmin.java new file mode 100644 index 0000000..a83bff3 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/ApplicationAppletAdmin.java @@ -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(); + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/InterceptorConfiguration.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/InterceptorConfiguration.java new file mode 100644 index 0000000..e005720 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/InterceptorConfiguration.java @@ -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()); + } +} \ No newline at end of file diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/PermInterceptor.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/PermInterceptor.java new file mode 100644 index 0000000..48b7e43 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/PermInterceptor.java @@ -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 + */ +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/HeathCheckController.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/HeathCheckController.java new file mode 100644 index 0000000..64729ed --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/HeathCheckController.java @@ -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"; + } + +} \ No newline at end of file diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/AnnouncementAdminController.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/AnnouncementAdminController.java new file mode 100644 index 0000000..02b39d6 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/AnnouncementAdminController.java @@ -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 authorList = announcementAdminService.getAuthorList(); + //判断请求是否成功 + Boolean bl = authorList != null; + //创建返回数据data + Map 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 pagesInfo = announcementAdminService.AnnouncementListForCondition(tilKeywords, dateStart, dateEnd, sort, authors, pageNum, pageSize); + + //读取分页结果 + Integer pageCount = pagesInfo.getPages(); //总页数 + long recordTotal = pagesInfo.getTotal(); //记录总数 + List myList = pagesInfo.getList(); //当前页的列表数据 + + List 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 data = new HashMap<>(); + data.put("AnnouncementsList", announcementsDtoList); + data.put("Pages", pages); + //添加到返回对象 + //返回 + return response.getResponseDataJavaJson(bl, data); + } + + /** + * 根据特定条件查询历史公告 + * return 返回历史公告列表数据 + */ + @RequestMapping("/AnnouncementListForWeek") + public String AnnouncementListForWeek() { + List myList = announcementAdminService.AnnouncementListForWeek(); + //判断请求是否成功 + Boolean bl = true; + //创建返回数据data + Map 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 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 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 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 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 data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + Integer x = announcementService.logicDel(announcement_id); + + //判断请求是否成功 + Boolean bl = x != null; + //创建返回数据data + Map data = new HashMap<>(); + data.put("result", x); + //添加到返回对象 + //返回 + return response.getResponseData(bl, data); + } + + +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/AppointmentAdminController.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/AppointmentAdminController.java new file mode 100644 index 0000000..53cb16f --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/AppointmentAdminController.java @@ -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 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 myList = pageInfo.getList(); //当前页的列表数据 + List 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 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 data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + Appointment appointment = appointmentService.getById(appointment_id); + //1-司机信息 + Map 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 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 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 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 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 appointmentDetails = appointmentAdminService.appointmentGoodsDetail(appointment_id); + //判断请求是否成功 + Boolean bl = appointmentDetails != null; + //创建返回数据data + Map 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 myList = null; + if (ids != null && !ids.isEmpty()) { + List idlist = Linq.of(ids.split(",")).toList(); + myList = appointmentAdminService.AppointmentListExportyByIds(idlist); + } + //转换为列表显示数据 + List 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 data = new HashMap<>(); +// data.put("mes", "请求成功,开始导出..."); +// //添加到返回对象 +// String dataJson = response.getResponseDataJavaJson(bl, data); +// //返回 +// return dataJson; + } + + +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/FeedbackAdminController.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/FeedbackAdminController.java new file mode 100644 index 0000000..b9a9ea5 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/FeedbackAdminController.java @@ -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 pagesInfo = feedbackAdminService.feedbackListForCondition(users_id, linkTel, nikeName, pageNum, pageSize); + //读取分页结果 + Integer pageCount = pagesInfo.getPages(); //总页数 + long recordTotal = pagesInfo.getTotal(); //记录总数 + List 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 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 data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + Feedback feedback = feedbackService.getById(feedback_id); + //判断请求是否成功 + Boolean bl = feedback != null; + //创建返回数据data + Map 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 data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + Integer x = feedbackService.logicDel(feedback_id); + //判断请求是否成功 + Boolean bl = x != null; + //创建返回数据data + Map data = new HashMap<>(); + data.put("result", x); + //添加到返回对象 + return response.getResponseDataJavaJson(bl, data); + } + +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/HomeController.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/HomeController.java new file mode 100644 index 0000000..e6e7a50 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/HomeController.java @@ -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 portAreaList = portAreasService.getList(); + //List portAreaList = ; + //判断请求是否成功 + Boolean bl = portAreaList != null; + //创建返回数据 + Map data = new HashMap<>(); + data.put("PortAreaList", portAreaList); + //封装返回数据 + return response.getResponseDataJavaJson(bl, data); + } + + /** + * 进港类型 + * + * @return 返回进港类型 + */ + @RequestMapping("/getEnterPortTypesList") + public String getEnterPortTypesList() { + List enterPortTypesList = enterPortTypeInterface.getEnterPortTypeList(); + //判断请求是否成功 + Boolean bl = true; + //创建返回数据 + Map data = new HashMap<>(); + data.put("EnterPortTypesList", enterPortTypesList); + //封装返回数据 + //返回 + return response.getResponseData(bl, data); + } + + /** + * 运输方式 TRANSPORT_TYPE + * + * @return 返回运输方式 + */ + @RequestMapping("/getTransportTypeList") + public String getTransportTypeList() { + //通过外部接口获取 + List myList = dicInterface.getDicList("TRANSPORT_TYPE"); + //判断请求是否成功 + Boolean bl = myList != null; + //创建返回数据 + Map data = new HashMap<>(); + data.put("TransportTypesList", myList); + //封装数据 + //返回 + return response.getResponseDataJavaJson(bl, data); + } + + /** + * 货物类型 CARGO_TYPE + * + * @return 返回货物类型 + */ + @RequestMapping("/getGoodsTypesList") + public String getGoodsTypesList() { + //通过外部接口获取 + List myList = dicInterface.getDicList("APP_CARGO_TYPE"); + //判断请求是否成功 + Boolean bl = myList != null; + //创建返回数据 + Map 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 dataList = new ArrayList<>(); + switch (code) { + case "NE": { + //内贸出口 + CustomerRes> data = cusOrderApi.getNEOutPlanShipList(""); + List 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> 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> data = cusOrderApi.getInPlanShipVoyList(""); + //dataList = data.getData(); + } + break; + case "BC": { + break; + } + + } + //判断请求是否成功 + Boolean bl = true; + //创建返回数据 + Map 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 data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + //取船名的中文名 + shipName = shipName.split("/")[0]; + + List dataList = null; + switch (code) { + case "NE"://内贸出口 + { + CustomerRes> 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> 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> data = cusOrderApi.getInPlanBrandsList("", shipName, voyage); + dataList = data.getData(); + } + break; + case "BC": { + break; + } + } + //判断请求是否成功 + Boolean bl = dataList != null; + //创建返回数据 + Map 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 data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + List dataList = null; + switch (code) { + case "NE"://内贸出口 + { + CustomerRes> 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> 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> data = cusOrderApi.getInPlanPortsList(""); + dataList = data.getData(); + } + break; + case "BC": { + break; + } + } + //判断请求是否成功 + Boolean bl = dataList != null; + //创建返回数据 + Map data = new HashMap<>(); + data.put("PortsList", dataList); + //封装数据 + //返回 + return response.getResponseDataJavaJson(bl, data); + } + + +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/OpenApiController.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/OpenApiController.java new file mode 100644 index 0000000..5985a16 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/OpenApiController.java @@ -0,0 +1,1327 @@ +package com.haitongauto.rtosam.api.admin; + +import com.bestvike.linq.Linq; +import com.github.pagehelper.PageInfo; +import com.haitongauto.interfaces.CustomerServiceInterface; +import com.haitongauto.interfaces.DicInterface; +import com.haitongauto.interfaces.PortAreaInterface; +import com.haitongauto.models.dto.Pages; +import com.haitongauto.models.dto.app.CarOperationCountRespDTO; +import com.haitongauto.models.dto.app.CarPalletTrafficInfoRespDTO; +import com.haitongauto.models.dto.app.GateCarNumberRespDTO; +import com.haitongauto.models.dto.open.TruckUser; +import com.haitongauto.models.open.*; +import com.haitongauto.models.ido.BasicDataIdo; +import com.haitongauto.models.pojo.*; +import com.haitongauto.models.res.Response; +import com.haitongauto.rtosam.service.admin.OpenApiService; +import com.haitongauto.rtosam.service.admin.ResponseService; +import com.haitongauto.rtosam.service.base.UsersService; +import com.haitongauto.utils.FormatDateTime; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 开放接口(对哪吒) + */ +@RestController +@RequestMapping("/openApi") +public class OpenApiController { + @Autowired + OpenApiService openApiService; + @Autowired + DicInterface dicInterface;//字典 + @Autowired + PortAreaInterface portAreaInterface;//港区 + @Autowired + CustomerServiceInterface customerServiceInterface;//客户平台接口 + @Autowired + ResponseService response; + @Autowired + UsersService usersService; + + /** + * 根据货物vin获得预约详情 + * + * @param vin 货物vin + * @return 返回货物 + */ + @RequestMapping("/getGoodInfoByGoodVin") + public String getGoodInfoByGoodVin(@RequestParam("vin") String vin) { + String msg = ""; + if (vin == null || vin.isEmpty()) { + msg = "板车编号不能为空"; + //判断请求是否成功 + Boolean bl = false; + //创建返回数据 + Map data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + AppointmentDetail appointmentDetail = new AppointmentDetail(); + appointmentDetail = openApiService.getAppointmentDetailByGoodVin(vin); + Map data = new HashMap<>(); + //判断请求是否成功 + Boolean bl = appointmentDetail != null; + if (bl) { + AppointmentDetail_Ido appointmentDetail_ido = new AppointmentDetail_Ido(); + appointmentDetail_ido.setTrdId(appointmentDetail.getId()); + appointmentDetail_ido.setTtiId(appointmentDetail.getAppointment_id()); + appointmentDetail_ido.setPotId(appointmentDetail.getDestination_port_id()); + appointmentDetail_ido.setSpmId(appointmentDetail.getShip_id()); + appointmentDetail_ido.setBrdId(appointmentDetail.getBrand_id()); + appointmentDetail_ido.setVinCode(appointmentDetail.getVin()); + data.put("goodInfo", appointmentDetail_ido); + } else { + data.put("goodInfo", appointmentDetail); + } + //封装返回数据 + return response.getResponseDataJavaJson(bl, data); + + } + + /** + * 查询板车运输信息 (收车作业/直装作业 同一个接口) 对哪吒 + * + * @param trailerNo 板车号 + * @return 返回查询板车运输信息 + */ + @RequestMapping("/getTruckTransportInfoByTruckNumber") + public String getTruckTransportInfoByTruckNumber(@RequestParam("trailerNo") String trailerNo) { + String msg = ""; + if (trailerNo == null || trailerNo.isEmpty()) { + msg = "板车编号不能为空"; + //判断请求是否成功 + Boolean bl = false; + //创建返回数据 + Map data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + //创建返回数据 + List records = new ArrayList<>(); + try { + Appointment appointment = openApiService.getAppointmentByTruckName(trailerNo); + if (appointment != null) { + //Truck truck = openApiService.getTruckByTruckNumber(trailerNo);//板车 + List appointmentDetailList = openApiService.getAppointmentDetailListByAppointmentId(appointment.getId()); + if (appointmentDetailList != null && appointmentDetailList.size() > 0) { + for (AppointmentDetail appointmentDetail : appointmentDetailList) { + if (appointmentDetail != null) { + AppointmentDetail_Ido appointmentDetail_ido = new AppointmentDetail_Ido(); + appointmentDetail_ido.setTrdId(appointmentDetail.getId()); + appointmentDetail_ido.setTtiId(appointmentDetail.getAppointment_id()); + appointmentDetail_ido.setPotId(appointmentDetail.getDestination_port_id()); + appointmentDetail_ido.setSpmId(appointmentDetail.getShip_id()); + appointmentDetail_ido.setBrdId(appointmentDetail.getBrand_id()); + appointmentDetail_ido.setVinCode(appointmentDetail.getVin()); + records.add(appointmentDetail_ido); + } + } + } + + } + } catch (Exception ex) { + msg = ex.getMessage(); + //判断请求是否成功 + Boolean bl = false; + //创建返回数据 + Map data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + + Map data = new HashMap<>(); + data.put("records", records); + //判断请求是否成功 + Boolean bl = true; + + //data.put("PortAreaList", portAreaList); + //封装返回数据 + //返回 + return response.getResponseDataJavaJson(bl, data); + } + + /** + * 作业监控/闸口监控 |板车监控|板车监控| 板车监控统计 + * + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param portAreaId 港区 + * @return 返回监控信息 + */ + @RequestMapping("/getTruckAppointmentAndPunchClockMonitor") + public String getTruckAppointmentAndPunchClockMonitor(@RequestParam("startTime") String startTime, + @RequestParam("endTime") String endTime, + @RequestParam("portAreaId") String portAreaId) { + //取Id + String port_area_id = null; + port_area_id = portAreaId; +//---------------------------------板车通行信息统计------------------------------------------------------------------------------------- + //自动进闸口板车数 + int countww1 = openApiService.getConventionalityInGateCount(startTime, endTime, port_area_id); + //人工抬杆进闸口板车数 + int countww2 = openApiService.getUnConventionalityInGateCount(startTime, endTime, port_area_id); + //待进港通行板车数 (已签到未进港的) + int countww3 = openApiService.getWellInGateCount(startTime, endTime, port_area_id); + //已进港板车数 + int countww4 = openApiService.getHaveInGateCount(startTime, endTime, port_area_id); + //已离港板车数 + int countww5 = openApiService.getHavaOutGateCount(startTime, endTime, port_area_id); + //Map data0 = new HashMap<>(); + //data0.put("自动进闸口板车数", countww1); + //data0.put("人工抬杆进闸口板车数", countww2); + //data0.put("待进港通行板车数", countww3); + //data0.put("已进港板车数", countww4); + //data0.put("已离港板车数", countww5); + CarPalletTrafficInfoRespDTO carPalletTrafficInfoRespDTO = new CarPalletTrafficInfoRespDTO(); + carPalletTrafficInfoRespDTO.setGateCarEntryWarnNumber(0); + carPalletTrafficInfoRespDTO.setInPortCarNumber(countww4); + carPalletTrafficInfoRespDTO.setAutoEntryVehicleCarNumber(countww1); + carPalletTrafficInfoRespDTO.setPoleRodCarNumber(countww2); + carPalletTrafficInfoRespDTO.setUnPortCarNumber(countww3); + carPalletTrafficInfoRespDTO.setLeavePortCarNumber(countww5); + +//---------------------------------板车作业统计------------------------------------------------------------------------------------- + //已预约板车数 + int count1 = openApiService.getAppointmentedCount(startTime, endTime, port_area_id); + //取消预约板车数 + int count2 = openApiService.getAppointmentCancelCount(startTime, endTime, port_area_id); + //签到打卡板车数 + int count3 = openApiService.getAppointmentSignInCount(startTime, endTime, port_area_id); + //完工打卡板车数 + int count4 = openApiService.getPunchClockOverCount(startTime, endTime, port_area_id); + //发送指令板车数 + int count5 = openApiService.getInstructHavaSendCount(startTime, endTime, port_area_id); + //外贸出口板车数 + int count6 = openApiService.getForeignTradeExportsCount(startTime, endTime, port_area_id); + //外贸进口板车数 + int count7 = openApiService.getForeignTradeImportsCount(startTime, endTime, port_area_id); + //内贸出口板车数 + int count8 = openApiService.getDomesticTradeExportCount(startTime, endTime, port_area_id); + //内贸进口板车数 + int count9 = openApiService.getDomesticImportsExportCount(startTime, endTime, port_area_id); + //板车作业统计 + //Map data1 = new HashMap<>(); + //data1.put("已预约板车数", count1); + //data1.put("取消预约板车数", count2); + //data1.put("签到打卡板车数", count3); + //data1.put("完工打卡板车数", count4); + //data1.put("发送指令板车数", count5); + //data1.put("外贸出口板车数", count6); + //data1.put("外贸进口板车数", count7); + //data1.put("内贸出口板车数", count8); + //data1.put("内贸进口板车数", count9); + CarOperationCountRespDTO carOperationCountRespDTO = new CarOperationCountRespDTO(); + carOperationCountRespDTO.setReserveCarNumber(count1); + carOperationCountRespDTO.setCancelReserveCarNumber(count2); + carOperationCountRespDTO.setStartSignCarNumber(count3); + carOperationCountRespDTO.setFinishSignCarNumber(count4); + carOperationCountRespDTO.setSendInstructCarNumber(count5); + carOperationCountRespDTO.setWexportCarNumber(count6); + carOperationCountRespDTO.setWimportCarNumber(count7); + carOperationCountRespDTO.setNexportCarNumber(count8); + carOperationCountRespDTO.setNimportCarNumber(count9); + +//---------------------------------道口通行板车统计------------------------------------------------------------------------------------- + //道口号板车数-21(进) + int countA = openApiService.getInGateCanalCodeCount(startTime, endTime, port_area_id, "21"); + //道口号板车数-22(出) + int countB = openApiService.getOutGateCanalCodeCount(startTime, endTime, port_area_id, "22"); + //道口号板车数-11(进) + int countC = openApiService.getInGateCanalCodeCount(startTime, endTime, port_area_id, "11"); + //Map data2 = new HashMap<>(); + //data2.put("道口号板车数-21(进)", countA); + //data2.put("道口号板车数-22(出)", countB); + //data2.put("道口号板车数-11(进)", countC); + GateCarNumberRespDTO gateCarNumberRespDTO21 = new GateCarNumberRespDTO(); + gateCarNumberRespDTO21.setGateNo("21"); + gateCarNumberRespDTO21.setGateCarNumber(countA); + + GateCarNumberRespDTO gateCarNumberRespDTO22 = new GateCarNumberRespDTO(); + gateCarNumberRespDTO22.setGateNo("22"); + gateCarNumberRespDTO22.setGateCarNumber(countB); + + GateCarNumberRespDTO gateCarNumberRespDTO11 = new GateCarNumberRespDTO(); + gateCarNumberRespDTO11.setGateNo("11"); + gateCarNumberRespDTO11.setGateCarNumber(countC); + + List gateCarNumberRespDTOList = new ArrayList<>(); + gateCarNumberRespDTOList.add(gateCarNumberRespDTO21); + gateCarNumberRespDTOList.add(gateCarNumberRespDTO22); + gateCarNumberRespDTOList.add(gateCarNumberRespDTO11); + +//---------------------------------all------------------------------------------------------------------------------------- + //判断请求是否成功 + Map dataAll = new HashMap<>(); + dataAll.put("carPalletTrafficInfoRespDTO", carPalletTrafficInfoRespDTO); + dataAll.put("carOperationCountRespDTO", carOperationCountRespDTO); + dataAll.put("gateCarNumberRespDTOList", gateCarNumberRespDTOList); + Boolean bl = true; + return response.getResponseData(bl, dataAll); + } + + /** + * APP/收车作业 |出口板车扫描|外贸出口板车号扫描|查询板车预约信息 + * 海通码头,App海通码头预约收车, + * + * @param trailerNo 板车编号/或者身份证 + * @return 返回指定板车的预约信息 + */ + @RequestMapping("/getTruckAppointmentByTruckNumber")//作废 + public String getTruckAppointmentByTruckNumber(@RequestParam("trailerNo") String trailerNo) { + com.haitongauto.models.res.Response response1 = new com.haitongauto.models.res.Response<>(); + String msg = "success"; + if (trailerNo == null || trailerNo.isEmpty()) { + msg = "板车编号不能为空"; + response1.setCode(-200); + response1.setMsg(msg); + return response1.toJSONString(); + } + Appointment appointment = openApiService.getActiveAppointmentByTruckNumber(trailerNo); + AppointmentDetail appointmentDetail = new AppointmentDetail(); + PunchClock punchClock = new PunchClock(); + PortArea portArea = new PortArea();//港区 + BasicDataIdo port = new BasicDataIdo();//1009 + //创建返回数据 + Map data = new HashMap<>(); + if (appointment != null) { + Integer appointment_type = appointment.getAppointment_type(); + if (appointment_type.equals(1)) { + //获取该预约的明细记录 + List delist = openApiService.getAppointmentDetailListByAppointmentId(appointment.getId()); + if (delist != null && delist.size() > 0) { + appointmentDetail = Linq.of(delist).firstOrDefault(); + } + //获取该预约的打卡记录 + punchClock = openApiService.getPunchClockByAppointmentId(appointment.getId()); + data.put("ttiId", appointment.getId());//主键ID + data.put("trailerNo", trailerNo);//板车号 + data.put("phoneNumber", appointment.getTel_number());//手机号 + data.put("arrivePortTime", appointment.getApproach_date());//进场时间 + data.put("pamId", appointment.getPort_area_id());//进港港区ID + data.put("arrivalType", appointment.getEnter_type());//进港类型 + data.put("bvmId", appointment.getGoods_type());//车型ID(货物类型) + data.put("goodsAmount", appointment.getGoods_quantity());//货物数量 + data.put("transType", appointment.getTransport_type());//运输方式 + data.put("enterPortType", appointment.getEnter_type());//进港类型 + data.put("goodsType", appointment.getGoods_type());//货物类型goods_type + data.put("finishSignTime", (punchClock != null) ? punchClock.getOver_time() : null);//完工打卡时间 + data.put("startSignTime", (punchClock != null) ? punchClock.getStart_time() : null);//签到时间 + data.put("printTicketTime", (punchClock != null) ? punchClock.getOver_time() : null);//打印小票时间 + data.put("printStatus", appointment.getAppointment_state() > 5 ? "Y" : "N");//打印小票状态 + if (appointmentDetail != null) { + data.put("potId", appointmentDetail.getDestination_port_id());//目的港口ID + } + } else { + msg = trailerNo + " 已存在特保区预约,请先完成特保区预约"; + response1.setCode(404); + response1.setMsg(msg); + return response1.toJSONString(); + } + } else { + msg = trailerNo + " 不存在海通码头预约"; + response1.setCode(404); + response1.setMsg(msg); + return response1.toJSONString(); + } + //封装返回数据 + response1.setData(data); + return response1.toJSONString(); + + } + + + /** + * APP/收车作业|出口板车扫描|外贸出口板车号扫描|根据车架号获取车辆运输预约信息| + * + * @param ttiId 板车预约信息主键ID(预约id) + * @return 返回指定预约id 车架号获取车辆运输预约信息 + */ + @RequestMapping("/getTruckAppointmentByAppointmentById") + public String getTruckTransportInfoByAppointmentById(@RequestParam("ttiId") String ttiId) { + String msg = ""; + if (ttiId == null || ttiId.isEmpty()) { + msg = "预约id不能为空"; + //判断请求是否成功 + Boolean bl = true; + //创建返回数据 + Map data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + Appointment appointment = openApiService.getAppointmentById(ttiId); + List records = new ArrayList<>(); + Map data = new HashMap<>(); + if (appointment != null) { + List appointmentDetailList = openApiService.getAppointmentDetailListByAppointmentId(appointment.getId()); + if (appointmentDetailList != null && appointmentDetailList.size() > 0) { + for (AppointmentDetail appointmentDetail : appointmentDetailList) { + AppointmentDetail_Ido appointmentDetail_ido = new AppointmentDetail_Ido(); + appointmentDetail_ido.setTrdId(appointmentDetail.getId()); + appointmentDetail_ido.setTtiId(appointmentDetail.getAppointment_id()); + appointmentDetail_ido.setPotId(appointmentDetail.getDestination_port_id()); + appointmentDetail_ido.setSpmId(appointmentDetail.getShip_id()); + appointmentDetail_ido.setBrdId(appointmentDetail.getBrand_id()); + appointmentDetail_ido.setVinCode(appointmentDetail.getVin()); + records.add(appointmentDetail_ido); + } + } + + } + data.put("records", records); + //判断请求是否成功 + Boolean bl = true; + //data.put("PortAreaList", portAreaList); + //封装返回数据 + //返回 + return response.getResponseDataJavaJson(bl, data); + } + + /** + * rtos根据条件分页查询预约记录 + * + * @return rtos根据条件分页查询预约记录 + */ + @RequestMapping("/getAppointmentListByCondition") + public String getAppointmentListByCondition(QueryCondition queryCondition, Pages pages) { + String msg = ""; + PageInfo pageInfo = openApiService.getAppointmentListByCondition(queryCondition, pages); + List appointmentList = pageInfo.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; + //读取分页结果 + Integer pageCount = pageInfo.getPages(); //总页数 + long recordTotal = pageInfo.getTotal(); //记录总数 + List myList = pageInfo.getList(); //当前页的列表数据 + List appointmentIdoList = new ArrayList<>(); + if (pageNum <= pageCount) { + //转换为列表显示数据 + if (appointmentList != null && appointmentList.size() > 0) { + for (Appointment item : appointmentList) { + Appointment_Ido appointmentIdo = new Appointment_Ido(); + appointmentIdo.setId(item.getId()); + appointmentIdo.setTransportType(item.getTransport_type()); + appointmentIdo.setTruckNumber(item.getTruck_number()); + appointmentIdo.setTelNumber(item.getTel_number()); + appointmentIdo.setTruckVin(item.getTruck_vin()); + appointmentIdo.setIdCode(item.getId_code()); + appointmentIdo.setVehicleWeight(item.getVehicle_weight()); + appointmentIdo.setVehicleFrameWeight(item.getVehicle_frame_weight()); + appointmentIdo.setDrivingLicense(item.getDriving_license()); + appointmentIdo.setApproachDate(item.getApproach_date()); + appointmentIdo.setPortAreaId(item.getPort_area_id()); + appointmentIdo.setAppointmentType(item.getAppointment_type()); + appointmentIdo.setEnterPortType(item.getEnter_type()); + appointmentIdo.setCargoType(item.getGoods_type()); + appointmentIdo.setGoodsQuantity(item.getGoods_quantity()); + appointmentIdo.setAppointmentState(item.getAppointment_state()); + appointmentIdo.setCancelTime(item.getCancel_time()); + appointmentIdo.setCreateTime(item.getCreate_time()); + appointmentIdo.setUpdateTime(item.getUpdate_time()); + appointmentIdo.setYard(item.getYard()); + appointmentIdo.setGateCanalIn(item.getGate_canal_in()); + appointmentIdo.setInstructState(item.getInstruct_state()); + appointmentIdo.setSendTime(item.getSend_time()); + appointmentIdo.setSender(item.getSender()); + appointmentIdo.setCheckInTime(item.getCheck_in_time()); + appointmentIdo.setCheckOverTime(item.getCheck_over_time()); + appointmentIdo.setPlateScanTime(item.getPlate_scan_time()); + appointmentIdo.setGateCanalInTime(item.getGate_canal_in_time()); + appointmentIdo.setGateCanalOutTime(item.getGate_canal_out_time()); + List appointmentDetailList = openApiService.getAppointmentDetailListByAppointmentId(appointmentIdo.getId()); + List listWithDuplicates = null; + if (appointmentDetailList != null && appointmentDetailList.size() > 0) { + listWithDuplicates = Linq.of(appointmentDetailList).select(AppointmentDetail::getBrand_name).toList(); + Set setWithoutDuplicates = new HashSet<>(listWithDuplicates); + List listWithoutDuplicates = new ArrayList<>(setWithoutDuplicates); + String result = String.join(",", listWithoutDuplicates); + appointmentIdo.setBrands(result); + } + AppointmentDetail appointmentDetail = null; + if (appointmentDetailList != null && appointmentDetailList.size() > 0) { + appointmentDetail = Linq.of(appointmentDetailList).firstOrDefault(); + } + if (appointmentDetail != null) { + appointmentIdo.setShipName(appointmentDetail.getShip_name()); + } + PunchClock punchClock = openApiService.getPunchClockByAppointmentId(appointmentIdo.getId()); + if (punchClock != null) { + appointmentIdo.setQueueNumber(punchClock.getQueue_number()); + } + Users users = null; + if (item.getUsers_id() != null && !item.getUsers_id().isEmpty()) { + appointmentIdo.setUserId(item.getUsers_id()); + users = usersService.getById(item.getUsers_id()); + } + if (users != null && users.getUsers_name() != null) { + appointmentIdo.setUserName(users.getUsers_name()); + } + appointmentIdoList.add(appointmentIdo); + } + } + } + + //分页数据添加到pages + assert pages != null; + pages.setPageCount(pageCount); + pages.setRecordTotal(recordTotal); + //创建返回数据data + Map data = new HashMap<>(); + data.put("records", appointmentIdoList); + data.put("pages", pages); + //判断请求是否成功 + Boolean bl = true; + //data.put("PortAreaList", portAreaList); + //封装返回数据 + //返回 + return response.getResponseDataJavaJson(bl, data); + } + + /** + * rtos根据条件分页查询预约记录 + * 结合预约明细信息,条件查询预约信息 + * + * @return rtos根据条件分页查询预约记录 + */ + @PostMapping("/getAppointmentListByConditionf") + public String getAppointmentListByConditionf(@RequestBody QueryCondition queryCondition) { + String msg = ""; + if (queryCondition.getStartDate() == null) { + msg = "开始时间不能为空"; + //判断请求是否成功 + Boolean bl = false; + //创建返回数据 + Map data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + if (queryCondition.getEndDate() == null) { + msg = "结束时间不能为空"; + //判断请求是否成功 + Boolean bl = false; + //创建返回数据 + Map data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + if (queryCondition.getPortAreaId() == null || queryCondition.getPortAreaId().isEmpty()) { + msg = "港区不能为空"; + //判断请求是否成功 + Boolean bl = false; + //创建返回数据 + Map data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + + LocalTime midnight = LocalTime.MIN; + //如果开始时间是凌晨零点, 且开始时间等于结束时间 + if (queryCondition.getStartDate().toLocalTime().equals(midnight) && queryCondition.getStartDate().equals(queryCondition.getEndDate())) { + LocalDateTime dateTime = queryCondition.getEndDate().plusDays(1); + queryCondition.setEndDate(dateTime); + } + + Pages pages = new Pages(); + pages.setPageNum(1); + pages.setPageSize(10); + if (queryCondition.getPageNum() != null && queryCondition.getPageNum() > 0) { + pages.setPageNum(queryCondition.getPageNum()); + } + if (queryCondition.getPageSize() != null && queryCondition.getPageSize() > 0) { + pages.setPageSize(queryCondition.getPageSize()); + } + //定义返回数据列表 + List appointmentDetailList = new ArrayList<>(); + try { + appointmentDetailList = openApiService.getAppointmentListByConditionf(queryCondition, pages); + }catch (Exception ex){ + msg = "异常信息:"+ex; + //判断请求是否成功 + Boolean bl = false; + //创建返回数据 + Map data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + + + //读取分页结果 + //创建返回数据data + Map data = new HashMap<>(); + data.put("records", appointmentDetailList); + data.put("pages", pages); + //判断请求是否成功 + Boolean bl = true; + + //返回 + return response.getResponseDataJavaJson(bl, data); + } + + /** + * 根据条件查询预约明细 + * + * @param appointmentId 预约id + * @param shipId shipId 船舶id + * @param brandId brandId 品牌id + * @return 返回预约明细 + */ + @PostMapping("/getAppointmentDetailsByConditionf") + public String getAppointmentDetailsByConditionf(@RequestParam("appointmentId") String appointmentId, + @RequestParam("shipId") String shipId, + @RequestParam("brandId") String brandId, + @RequestParam("pageNum") Integer pageNum, + @RequestParam("pageSize") Integer pageSize) { + String msg = ""; + if (appointmentId == null || appointmentId.isEmpty()) { + msg = "预约id不能为空"; + //判断请求是否成功 + Boolean bl = false; + //创建返回数据 + Map data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + if (shipId == null || shipId.isEmpty()) { + msg = "船id不能为空"; + //判断请求是否成功 + Boolean bl = false; + //创建返回数据 + Map data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + if (brandId == null || brandId.isEmpty()) { + msg = "品牌不能为空"; + //判断请求是否成功 + Boolean bl = false; + //创建返回数据 + Map data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + Pages pages = new Pages(); + pages.setPageNum(pageNum); + pages.setPageSize(pageSize); + PageInfo pageInfo = openApiService.getAppointmentDetailsByConditionf(appointmentId, shipId, brandId, pages); + List appointmentDetailList = pageInfo.getList(); + Boolean bl = true; + //创建返回数据data + Map data = new HashMap<>(); + data.put("records", appointmentDetailList); + data.put("pages", pages); + //判断请求是否成功 + //返回 + return response.getResponseDataJavaJson(bl, data); + } + + /** + * APP/收车作业 |出口板车扫描|外贸出口板车号扫描|查询板车预约信息 + * 海通码头,App海通码头预约收车, + * + * @param truckNumber 板车编号/或者身份证 + * @return 返回指定板车的预约信息 + */ + //getAppointmentByTruckNumber + @RequestMapping("/getAppointmentByTruckNumber") + public String getAppointmentByTruckNumber(@RequestParam("truckNumber") String truckNumber) { + String msg = ""; + if (truckNumber == null || truckNumber.isEmpty()) { + msg = "板车号不能为空"; + //判断请求是否成功 + Boolean bl = true; + //创建返回数据 + Map data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + //Appointment appointment = openApiService.getAppointmentByTruckName(truckNumber); + Appointment appointment = openApiService.getActiveAppointmentByTruckNumber(truckNumber); + Appointment_Ido appointmentIdo = null; + if (appointment != null) { + Integer appointment_type = appointment.getAppointment_type(); + //海通码头预约 + if (appointment_type.equals(1)) { + appointmentIdo = new Appointment_Ido(); + appointmentIdo.setId(appointment.getId()); + appointmentIdo.setTransportType(appointment.getTransport_type()); + appointmentIdo.setTruckNumber(appointment.getTruck_number()); + appointmentIdo.setTelNumber(appointment.getTel_number()); + appointmentIdo.setTruckVin(appointment.getTruck_vin()); + appointmentIdo.setIdCode(appointment.getId_code()); + appointmentIdo.setVehicleWeight(appointment.getVehicle_weight()); + appointmentIdo.setVehicleFrameWeight(appointment.getVehicle_frame_weight()); + appointmentIdo.setDrivingLicense(appointment.getDriving_license()); + appointmentIdo.setApproachDate(appointment.getApproach_date()); + appointmentIdo.setPortAreaId(appointment.getPort_area_id()); + appointmentIdo.setAppointmentType(appointment.getAppointment_type()); + appointmentIdo.setEnterPortType(appointment.getEnter_type()); + appointmentIdo.setCargoType(appointment.getGoods_type()); + appointmentIdo.setGoodsQuantity(appointment.getGoods_quantity()); + appointmentIdo.setAppointmentState(appointment.getAppointment_state()); + appointmentIdo.setCancelTime(appointment.getCancel_time()); + appointmentIdo.setCreateTime(appointment.getCreate_time()); + appointmentIdo.setUpdateTime(appointment.getUpdate_time()); + appointmentIdo.setYard(appointment.getYard()); + appointmentIdo.setGateCanalIn(appointment.getGate_canal_in()); + appointmentIdo.setInstructState(appointment.getInstruct_state()); + appointmentIdo.setSendTime(appointment.getSend_time()); + appointmentIdo.setSender(appointment.getSender()); + appointmentIdo.setCheckInTime(appointment.getCheck_in_time()); + appointmentIdo.setCheckOverTime(appointment.getCheck_over_time()); + appointmentIdo.setPlateScanTime(appointment.getPlate_scan_time()); + appointmentIdo.setGateCanalInTime(appointment.getGate_canal_in_time()); + appointmentIdo.setGateCanalOutTime(appointment.getGate_canal_out_time()); + List appointmentDetailList = openApiService.getAppointmentDetailListByAppointmentId(appointmentIdo.getId()); + List brandnameList = null;//品牌名 + List brandidList = null;//品牌id + if (appointmentDetailList != null && appointmentDetailList.size() > 0) { + brandidList = Linq.of(appointmentDetailList).select(AppointmentDetail::getBrand_id).distinct().toList(); + String result1 = String.join(",", brandidList); + appointmentIdo.setBrandIds(result1); + brandnameList = Linq.of(appointmentDetailList).select(AppointmentDetail::getBrand_name).distinct().toList(); + String result2 = String.join(",", brandnameList); + appointmentIdo.setBrands(result2); + } + AppointmentDetail appointmentDetail = null; + if (appointmentDetailList != null && appointmentDetailList.size() > 0) { + appointmentDetail = Linq.of(appointmentDetailList).firstOrDefault(); + } + if (appointmentDetail != null) { + appointmentIdo.setShipId(appointmentDetail.getShip_id()); + appointmentIdo.setShipName(appointmentDetail.getShip_name()); + } + PunchClock punchClock = openApiService.getPunchClockByAppointmentId(appointmentIdo.getId()); + if (punchClock != null) { + appointmentIdo.setQueueNumber(punchClock.getQueue_number()); + } + Users users = null; + if (appointment.getUsers_id() != null && !appointment.getUsers_id().isEmpty()) { + appointmentIdo.setUserId(appointment.getUsers_id()); + users = usersService.getById(appointment.getUsers_id()); + } + if (users != null && users.getUsers_name() != null) { + appointmentIdo.setUserName(users.getUsers_name()); + } + + } else { + msg = truckNumber + " 存在特保区预约,请先完成特保区的预约"; + Map data = new HashMap<>(); + data.put("appointment", null); + Boolean bl = true; + return response.getResponseData(bl, data, msg); + } + } + //判断请求是否成功 + Boolean bl = true; + //创建返回数据data + Map data = new HashMap<>(); + data.put("appointment", appointmentIdo); + //返回 + return response.getResponseDataJavaJson(bl, data); + } + + /** + * APP/收车作业 |出口板车扫描|外贸出口板车号扫描|查询板车预约信息 + * 海通码头,App海通码头预约收车, + * + * @param truckNumber 板车编号/或者身份证 + * @return 返回指定板车的预约信息 + */ + @RequestMapping("/getAppointmentByTruckNumberTBQ") + public String getAppointmentByTruckNumberTBQ(@RequestParam("truckNumber") String truckNumber) { + String msg = ""; + if (truckNumber == null || truckNumber.isEmpty()) { + msg = "板车号不能为空"; + //判断请求是否成功 + Boolean bl = true; + //创建返回数据 + Map data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + // Appointment appointment = openApiService.getAppointmentByTruckName(truckNumber); + Appointment appointment = openApiService.getActiveAppointmentByTruckNumber(truckNumber); + Appointment_Ido appointmentIdo = null; + if (appointment != null) { + Integer appointment_type = appointment.getAppointment_type(); + //海通码头预约 + if (appointment_type.equals(2)) { + appointmentIdo = new Appointment_Ido(); + appointmentIdo.setId(appointment.getId()); + appointmentIdo.setTransportType(appointment.getTransport_type()); + appointmentIdo.setTruckNumber(appointment.getTruck_number()); + appointmentIdo.setTelNumber(appointment.getTel_number()); + appointmentIdo.setTruckVin(appointment.getTruck_vin()); + appointmentIdo.setIdCode(appointment.getId_code()); + appointmentIdo.setVehicleWeight(appointment.getVehicle_weight()); + appointmentIdo.setVehicleFrameWeight(appointment.getVehicle_frame_weight()); + appointmentIdo.setDrivingLicense(appointment.getDriving_license()); + appointmentIdo.setApproachDate(appointment.getApproach_date()); + appointmentIdo.setPortAreaId(appointment.getPort_area_id()); + appointmentIdo.setAppointmentType(appointment.getAppointment_type()); + appointmentIdo.setEnterPortType(appointment.getEnter_type()); + appointmentIdo.setCargoType(appointment.getGoods_type()); + appointmentIdo.setGoodsQuantity(appointment.getGoods_quantity()); + appointmentIdo.setAppointmentState(appointment.getAppointment_state()); + appointmentIdo.setCancelTime(appointment.getCancel_time()); + appointmentIdo.setCreateTime(appointment.getCreate_time()); + appointmentIdo.setUpdateTime(appointment.getUpdate_time()); + appointmentIdo.setYard(appointment.getYard()); + appointmentIdo.setGateCanalIn(appointment.getGate_canal_in()); + appointmentIdo.setInstructState(appointment.getInstruct_state()); + appointmentIdo.setSendTime(appointment.getSend_time()); + appointmentIdo.setSender(appointment.getSender()); + appointmentIdo.setCheckInTime(appointment.getCheck_in_time()); + appointmentIdo.setCheckOverTime(appointment.getCheck_over_time()); + appointmentIdo.setPlateScanTime(appointment.getPlate_scan_time()); + appointmentIdo.setGateCanalInTime(appointment.getGate_canal_in_time()); + appointmentIdo.setGateCanalOutTime(appointment.getGate_canal_out_time()); + List appointmentDetailList = openApiService.getAppointmentDetailListByAppointmentId(appointmentIdo.getId()); + + List brandnameList = null;//品牌名 + List brandidList = null;//品牌id + if (appointmentDetailList != null && appointmentDetailList.size() > 0) { + brandidList = Linq.of(appointmentDetailList).select(AppointmentDetail::getBrand_id).distinct().toList(); + String result1 = String.join(",", brandidList); + appointmentIdo.setBrandIds(result1); + brandnameList = Linq.of(appointmentDetailList).select(AppointmentDetail::getBrand_name).distinct().toList(); + String result2 = String.join(",", brandnameList); + appointmentIdo.setBrands(result2); + } + + AppointmentDetail appointmentDetail = null; + if (appointmentDetailList != null && appointmentDetailList.size() > 0) { + appointmentDetail = Linq.of(appointmentDetailList).firstOrDefault(); + } + if (appointmentDetail != null) { + appointmentIdo.setShipId(appointmentDetail.getShip_id()); + appointmentIdo.setShipName(appointmentDetail.getShip_name()); + } + PunchClock punchClock = openApiService.getPunchClockByAppointmentId(appointmentIdo.getId()); + if (punchClock != null) { + appointmentIdo.setQueueNumber(punchClock.getQueue_number()); + } + Users users = null; + if (appointment.getUsers_id() != null && !appointment.getUsers_id().isEmpty()) { + appointmentIdo.setUserId(appointment.getUsers_id()); + users = usersService.getById(appointment.getUsers_id()); + } + if (users != null && users.getUsers_name() != null) { + appointmentIdo.setUserName(users.getUsers_name()); + } + } else { + msg = truckNumber + " 存在海通码头预约,请先完成海通码头的预约"; + Map data = new HashMap<>(); + data.put("appointment", null); + Boolean bl = true; + return response.getResponseData(bl, data, msg); + } + } + //判断请求是否成功 + Boolean bl = true; + //创建返回数据data + Map data = new HashMap<>(); + data.put("appointment", appointmentIdo); + //返回 + return response.getResponseDataJavaJson(bl, data); + } + + /** + * rtos根据板车号查询预约记录(带验证的) + * + * @return rtos根据条件分页查询预约记录(带验证的) + */ + @RequestMapping("/getAppointmentByTruckNumberCheck") + public String getAppointmentByTruckNumberCheck(@RequestParam("truckNumber") String truckNumber) { + String msg = ""; + if (truckNumber == null || truckNumber.isEmpty()) { + msg = "板车号不能为空"; + //判断请求是否成功 + Boolean bl = true; + //创建返回数据 + Map data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + Appointment appointment = openApiService.getAppointmentByTruckName(truckNumber); + Appointment_Ido appointmentIdo = null; + if (appointment != null) { + appointmentIdo = new Appointment_Ido(); + appointmentIdo.setId(appointment.getId()); + appointmentIdo.setTransportType(appointment.getTransport_type()); + appointmentIdo.setTruckNumber(appointment.getTruck_number()); + appointmentIdo.setIdCode(appointment.getId_code()); + appointmentIdo.setTelNumber(appointment.getTel_number()); + appointmentIdo.setTruckVin(appointment.getTruck_vin()); + appointmentIdo.setVehicleWeight(appointment.getVehicle_weight()); + appointmentIdo.setVehicleFrameWeight(appointment.getVehicle_frame_weight()); + appointmentIdo.setDrivingLicense(appointment.getDriving_license()); + appointmentIdo.setApproachDate(appointment.getApproach_date()); + appointmentIdo.setPortAreaId(appointment.getPort_area_id()); + appointmentIdo.setAppointmentType(appointment.getAppointment_type()); + appointmentIdo.setEnterPortType(appointment.getEnter_type()); + appointmentIdo.setCargoType(appointment.getGoods_type()); + appointmentIdo.setGoodsQuantity(appointment.getGoods_quantity()); + appointmentIdo.setAppointmentState(appointment.getAppointment_state()); + appointmentIdo.setCancelTime(appointment.getCancel_time()); + appointmentIdo.setCreateTime(appointment.getCreate_time()); + appointmentIdo.setUpdateTime(appointment.getUpdate_time()); + appointmentIdo.setYard(appointment.getYard()); + appointmentIdo.setGateCanalIn(appointment.getGate_canal_in()); + appointmentIdo.setInstructState(appointment.getInstruct_state()); + appointmentIdo.setSendTime(appointment.getSend_time()); + appointmentIdo.setSender(appointment.getSender()); + appointmentIdo.setCheckInTime(appointment.getCheck_in_time()); + appointmentIdo.setCheckOverTime(appointment.getCheck_over_time()); + appointmentIdo.setPlateScanTime(appointment.getPlate_scan_time()); + appointmentIdo.setGateCanalInTime(appointment.getGate_canal_in_time()); + appointmentIdo.setGateCanalOutTime(appointment.getGate_canal_out_time()); + List appointmentDetailList = openApiService.getAppointmentDetailListByAppointmentId(appointmentIdo.getId()); + List brandnameList = null;//品牌名 + List brandidList = null;//品牌id + if (appointmentDetailList != null && appointmentDetailList.size() > 0) { + brandidList = Linq.of(appointmentDetailList).select(AppointmentDetail::getBrand_id).distinct().toList(); + String result1 = String.join(",", brandidList); + appointmentIdo.setBrandIds(result1); + brandnameList = Linq.of(appointmentDetailList).select(AppointmentDetail::getBrand_name).distinct().toList(); + String result2 = String.join(",", brandnameList); + appointmentIdo.setBrands(result2); + } + + AppointmentDetail appointmentDetail = null; + if (appointmentDetailList != null && appointmentDetailList.size() > 0) { + appointmentDetail = Linq.of(appointmentDetailList).firstOrDefault(); + } + if (appointmentDetail != null) { + appointmentIdo.setShipName(appointmentDetail.getShip_name()); + appointmentIdo.setShipId(appointmentDetail.getShip_id()); + } + PunchClock punchClock = openApiService.getPunchClockByAppointmentId(appointmentIdo.getId()); + if (punchClock != null) { + appointmentIdo.setQueueNumber(punchClock.getQueue_number()); + } + + Users users = null; + if (appointment.getUsers_id() != null && !appointment.getUsers_id().isEmpty()) { + appointmentIdo.setUserId(appointment.getUsers_id()); + users = usersService.getById(appointment.getUsers_id()); + } + if (users != null && users.getUsers_name() != null) { + appointmentIdo.setUserName(users.getUsers_name()); + } + } + + //判断请求是否成功 + Boolean bl = true; + //创建返回数据data + Map data = new HashMap<>(); + data.put("appointment", appointmentIdo); + + + //封装返回数据 + //返回 + return response.getResponseDataJavaJson(bl, data); + } + + /** + * 指令发送 修改预约信息的 预约id 指令状态、堆场、道口号 + * + * @return 指令发送 修改预约信息的 预约id 指令状态、堆场、道口号 + */ + @PostMapping("/updateAppointmentInstructState") + public String updateAppointmentInstructState(@RequestBody List appointmentCmdList) { + String msg = ""; + if (appointmentCmdList == null || appointmentCmdList.size() == 0) { + msg = "预约发送指令不能为空"; + //判断请求是否成功 + Boolean bl = true; + //创建返回数据 + Map data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + int x = openApiService.batchUpdateAppointmentInstructState(appointmentCmdList); + //判断请求是否成功 + Boolean bl = x > 0; + //创建返回数据data + Map data = new HashMap<>(); + data.put("result", bl); + String message = (bl) ? "request success" : "request fail"; + data.put("message", message); + if (bl) { + data.put("code", "200"); + } + + //封装返回数据 + return response.getResponseDataJavaJson(bl, data); + } + + /** + * Rtos根据 预约id, 车架号(货物车架号)获取预约明细信息 + * + * @return 根据 预约id, 车架号(货物车架号)获取预约明细信息 + */ + @RequestMapping("/getAppointmentDetailByAppointmentIdAndGoodVin") + public String getAppointmentDetailByAppointmentIdAndGoodVin(@RequestParam("appointmentId") String appointmentId, + @RequestParam("vin") String vin) { + String msg = ""; + if ((appointmentId == null || appointmentId.isEmpty()) && (vin == null || vin.isEmpty())) { + //创建返回数据data + Map data = new HashMap<>(); + Boolean bl = true; + //data.put("PortAreaList", portAreaList); + //封装返回数据 + //返回 + return response.getResponseDataJavaJson(bl, data); + } + AppointmentDetail appointment = openApiService.getAppointmentDetailByAppointmentIdAndGoodVin(appointmentId, vin); + //判断请求是否成功 + Boolean bl = appointment != null; + //创建返回数据data + Map data = new HashMap<>(); + //封装返回数据 + //返回 + return response.getResponseDataJavaJson(bl, appointment); + } + + /** + * @param ids 预约ids + * @return 返回预约列表 + */ + @PostMapping("/getAppointmentByIds") + //public String getAppointmentByIds(@RequestParam("ids") String ids) { + public String getAppointmentByIds(@RequestBody List ids) { + String msg = ""; + if (ids == null || ids.size() == 0) { + msg = "预约id不能为空"; + //判断请求是否成功 + Boolean bl = true; + //创建返回数据 + Map data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + //List myIds = Linq.of(ids.split(",")).toList(); + List myIds = ids; + List appointments = openApiService.getAppointmentByIds(myIds); + List appointmentIdoList = new ArrayList<>(); + if (appointments != null && appointments.size() > 0) { + for (Appointment item : appointments) { + Appointment_Ido appointmentIdo = new Appointment_Ido(); + appointmentIdo.setId(item.getId()); + appointmentIdo.setTransportType(item.getTransport_type()); + appointmentIdo.setTruckNumber(item.getTruck_number()); + appointmentIdo.setIdCode(item.getId_code()); + appointmentIdo.setTelNumber(item.getTel_number()); + appointmentIdo.setTruckVin(item.getTruck_vin()); + appointmentIdo.setVehicleWeight(item.getVehicle_weight()); + appointmentIdo.setVehicleFrameWeight(item.getVehicle_frame_weight()); + appointmentIdo.setDrivingLicense(item.getDriving_license()); + appointmentIdo.setApproachDate(item.getApproach_date()); + appointmentIdo.setPortAreaId(item.getPort_area_id()); + appointmentIdo.setAppointmentType(item.getAppointment_type()); + appointmentIdo.setEnterPortType(item.getEnter_type()); + appointmentIdo.setCargoType(item.getGoods_type()); + appointmentIdo.setGoodsQuantity(item.getGoods_quantity()); + appointmentIdo.setAppointmentState(item.getAppointment_state()); + appointmentIdo.setCreateTime(item.getCreate_time()); + appointmentIdo.setUpdateTime(item.getUpdate_time()); + appointmentIdo.setYard(item.getYard()); + appointmentIdo.setGateCanalIn(item.getGate_canal_in()); + appointmentIdo.setInstructState(item.getInstruct_state()); + appointmentIdo.setSendTime(item.getSend_time()); + appointmentIdo.setSender(item.getSender()); + appointmentIdo.setCheckInTime(item.getCheck_in_time()); + appointmentIdo.setCheckOverTime(item.getCheck_over_time()); + appointmentIdo.setPlateScanTime(item.getPlate_scan_time()); + appointmentIdo.setGateCanalInTime(item.getGate_canal_in_time()); + appointmentIdo.setGateCanalOutTime(item.getGate_canal_out_time()); + List appointmentDetailList = openApiService.getAppointmentDetailListByAppointmentId(appointmentIdo.getId()); + List brandnameList = null;//品牌名 + List brandidList = null;//品牌名 + if (appointmentDetailList != null && appointmentDetailList.size() > 0) { + List myDetail = Linq.of(appointmentDetailList).where(p -> p.getBrand_id() != null && !p.getBrand_id().isEmpty()).toList(); + if (myDetail != null && myDetail.size() > 0) { + brandidList = Linq.of(myDetail).select(AppointmentDetail::getBrand_id).distinct().toList(); + } + if (brandidList != null && brandidList.size() > 0) { + String result1 = String.join(",", brandidList); + appointmentIdo.setBrandIds(result1); + brandnameList = Linq.of(appointmentDetailList).select(AppointmentDetail::getBrand_name).distinct().toList(); + String result2 = String.join(",", brandnameList); + appointmentIdo.setBrands(result2); + } + + } + + AppointmentDetail appointmentDetail = null; + if (appointmentDetailList != null && appointmentDetailList.size() > 0) { + List shipIdList = Linq.of(appointmentDetailList).select(AppointmentDetail::getShip_id).distinct().toList(); + List shipNameList = Linq.of(appointmentDetailList).select(AppointmentDetail::getShip_name).distinct().toList(); + if (shipIdList != null && shipIdList.size() > 0) { + appointmentIdo.setShipId(String.join(",", brandidList)); + + } + if (shipNameList != null && shipNameList.size() > 0) { + appointmentIdo.setShipName(String.join(",", shipNameList)); + } + } + + PunchClock punchClock = openApiService.getPunchClockByAppointmentId(appointmentIdo.getId()); + if (punchClock != null) { + appointmentIdo.setQueueNumber(punchClock.getQueue_number()); + } + + Users users = null; + if (item.getUsers_id() != null && !item.getUsers_id().isEmpty()) { + appointmentIdo.setUserId(item.getUsers_id()); + users = usersService.getById(item.getUsers_id()); + } + if (users != null && users.getUsers_name() != null) { + appointmentIdo.setUserName(users.getUsers_name()); + } + appointmentIdoList.add(appointmentIdo); + } + } + //判断请求是否成功 + Boolean bl = appointments != null; + + //创建返回数据data + Map data = new HashMap<>(); + + //封装返回数据 + //返回 + return response.getResponseDataJavaJson(bl, appointmentIdoList); + } + + @RequestMapping("/getAppointmentDetailByAppointmentIdList") + public String getAppointmentDetailByAppointmentIdList(@RequestParam("appointmentIdList") String appointmentIdList) { + String msg = ""; + if (appointmentIdList == null || appointmentIdList.isEmpty()) { + msg = "预约id不能为空"; + //判断请求是否成功 + Boolean bl = true; + //创建返回数据 + Map data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + List myIds = Linq.of(appointmentIdList.split(",")).toList(); + List appointmentDetailList = openApiService.getAppointmentDetailByAppointmentIdList(myIds); + //判断请求是否成功 + Boolean bl = appointmentDetailList != null; + //创建返回数据data + Map data = new HashMap<>(); + //封装返回数据 + return response.getResponseDataJavaJson(bl, appointmentDetailList); + } + + /** + * Rtos根据预约id查询预约运输信息 + * + * @param id 预约id + * @return 返回预约信息 + */ + @RequestMapping("/getAppointmentById") + public String getAppointmentById(@RequestParam("id") String id) { + String msg = ""; + if (id == null || id.isEmpty()) { + msg = "预约id不能为空"; + //判断请求是否成功 + Boolean bl = true; + //创建返回数据 + Map data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + Appointment appointment = openApiService.getAppointmentById(id); + Appointment_Ido appointmentIdo = null; + if (appointment != null) { + appointmentIdo = new Appointment_Ido(); + appointmentIdo.setId(appointment.getId()); + appointmentIdo.setTransportType(appointment.getTransport_type()); + appointmentIdo.setTruckNumber(appointment.getTruck_number()); + appointmentIdo.setTelNumber(appointment.getTel_number()); + appointmentIdo.setIdCode(appointment.getId_code()); + appointmentIdo.setTruckVin(appointment.getTruck_vin()); + appointmentIdo.setVehicleWeight(appointment.getVehicle_weight()); + appointmentIdo.setVehicleFrameWeight(appointment.getVehicle_frame_weight()); + appointmentIdo.setDrivingLicense(appointment.getDriving_license()); + appointmentIdo.setApproachDate(appointment.getApproach_date()); + appointmentIdo.setPortAreaId(appointment.getPort_area_id()); + appointmentIdo.setAppointmentType(appointment.getAppointment_type()); + appointmentIdo.setEnterPortType(appointment.getEnter_type()); + appointmentIdo.setCargoType(appointment.getGoods_type()); + appointmentIdo.setGoodsQuantity(appointment.getGoods_quantity()); + appointmentIdo.setAppointmentState(appointment.getAppointment_state()); + appointmentIdo.setCancelTime(appointment.getCancel_time()); + appointmentIdo.setCreateTime(appointment.getCreate_time()); + appointmentIdo.setUpdateTime(appointment.getUpdate_time()); + appointmentIdo.setYard(appointment.getYard()); + appointmentIdo.setGateCanalIn(appointment.getGate_canal_in()); + appointmentIdo.setInstructState(appointment.getInstruct_state()); + appointmentIdo.setSendTime(appointment.getSend_time()); + appointmentIdo.setSender(appointment.getSender()); + appointmentIdo.setCheckInTime(appointment.getCheck_in_time()); + appointmentIdo.setCheckOverTime(appointment.getCheck_over_time()); + appointmentIdo.setPlateScanTime(appointment.getPlate_scan_time()); + appointmentIdo.setGateCanalInTime(appointment.getGate_canal_in_time()); + appointmentIdo.setGateCanalOutTime(appointment.getGate_canal_out_time()); + List appointmentDetailList = openApiService.getAppointmentDetailListByAppointmentId(appointmentIdo.getId()); + List brandnameList = null;//品牌名 + List brandidList = null;//品牌id + if (appointmentDetailList != null && appointmentDetailList.size() > 0) { + brandidList = Linq.of(appointmentDetailList).select(AppointmentDetail::getBrand_id).distinct().toList(); + String result1 = String.join(",", brandidList); + appointmentIdo.setBrandIds(result1); + brandnameList = Linq.of(appointmentDetailList).select(AppointmentDetail::getBrand_name).distinct().toList(); + String result2 = String.join(",", brandnameList); + appointmentIdo.setBrands(result2); + } + + AppointmentDetail appointmentDetail = null; + if (appointmentDetailList != null && appointmentDetailList.size() > 0) { + appointmentDetail = Linq.of(appointmentDetailList).firstOrDefault(); + } + if (appointmentDetail != null) { + appointmentIdo.setShipName(appointmentDetail.getShip_name()); + appointmentIdo.setShipId(appointmentDetail.getShip_id()); + } + PunchClock punchClock = openApiService.getPunchClockByAppointmentId(appointmentIdo.getId()); + if (punchClock != null) { + appointmentIdo.setQueueNumber(punchClock.getQueue_number()); + } + + Users users = null; + if (appointment.getUsers_id() != null && !appointment.getUsers_id().isEmpty()) { + appointmentIdo.setUserId(appointment.getUsers_id()); + users = usersService.getById(appointment.getUsers_id()); + } + if (users != null && users.getUsers_name() != null) { + appointmentIdo.setUserName(users.getUsers_name()); + } + + } + //判断请求是否成功 + Boolean bl = true; + //创建返回数据data + Map data = new HashMap<>(); + //封装返回数据 + return response.getResponseDataJavaJson(bl, appointmentIdo); + } + + /** + * Rtos根据预约id查询预约预约明细 + */ + @RequestMapping("/getAppointmentDetailByAppointmentId") + public String getAppointmentDetailByAppointmentId(@RequestParam("appointmentId") String appointmentId) { + String msg = ""; + if (appointmentId == null || appointmentId.isEmpty()) { + msg = "预约id不能为空"; + //判断请求是否成功 + Boolean bl = true; + //创建返回数据 + Map data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + List appointmentDetailList = openApiService.getAppointmentDetailListByAppointmentId(appointmentId); + //判断请求是否成功 + Boolean bl = appointmentDetailList != null; + //创建返回数据data + Map data = new HashMap<>(); + //封装返回数据 + //返回 + return response.getResponseDataJavaJson(bl, appointmentDetailList); + } + + /** + * custom根据根据货物vin,该货物查询预约是否存在; + */ + @PostMapping("/getAppointmentByVin") + public List getAppointmentByVin(@RequestBody List vinList) { + String msg = ""; + if (vinList == null || vinList.size() == 0) { + msg = "预约vin不能为空"; + //判断请求是否成功 + Boolean bl = true; + //创建返回数据 + Map data = new HashMap<>(); + //返回 + return null; + } + List appointmentVinList = openApiService.getAppointmentDetailListByGoodVinList(vinList); + return appointmentVinList; + } + + /** + * 查询板车信息 + * + * @param truckNum + * @return + */ + @GetMapping("/getPalletTruckByTruckNo") + public String getPalletTruckByTruckNo(@RequestParam("truckNum") String truckNum) { + Response myResponse = new Response(); + String msg = ""; + if (truckNum == null || truckNum.isEmpty()) { + msg = "车牌号不能为空"; + myResponse.setCode(-200); + myResponse.setMsg("车牌号不能为空"); + //判断请求是否成功 + Boolean bl = false; + //创建返回数据 + Map data = new HashMap<>(); + myResponse.toJSONString(); + } + try { + Truck myPalletTruck = openApiService.getPalletTruckByTruckNo(truckNum); + myResponse.setCode(200); + myResponse.setData(myPalletTruck); + } catch (Exception ex) { + myResponse.setCode(500); + myResponse.setMsg(ex.getMessage()); + } + return myResponse.toJSONString(); + } + + /** + * 查询板车信息 + * + * @param truckNumList + * @return + */ + @PostMapping("/getTruckByTruckNos") + public String getTruckByTruckNos(@RequestBody List truckNumList) { + Response myResponse = new Response(); + String msg = ""; + if (truckNumList == null || truckNumList.isEmpty()) { + msg = "车牌号不能为空"; + myResponse.setCode(-200); + myResponse.setMsg("车牌号不能为空"); + //判断请求是否成功 + Boolean bl = false; + //创建返回数据 + Map data = new HashMap<>(); + myResponse.toJSONString(); + } + try { + List list = openApiService.getTruckByTruckNos(truckNumList); + myResponse.setCode(200); + myResponse.setData(list); + } catch (Exception ex) { + myResponse.setCode(500); + myResponse.setMsg(ex.getMessage()); + } + return myResponse.toJSONString(); + } + + +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/OperateIntroductionAdminController.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/OperateIntroductionAdminController.java new file mode 100644 index 0000000..fd857eb --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/OperateIntroductionAdminController.java @@ -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 data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + if (noviceIntroduction.getSort() == null || noviceIntroduction.getSort() <= 0) { + msg = "平台类别无效,请填写正确的平台类别"; + //判断请求是否成功 + Boolean bl = false; + //创建返回数据 + Map 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 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 data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + List 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 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 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 data = new HashMap<>(); + data.put("result", (bl) ? "正在导出..." : null); + //添加到返回对象 + //返回 + return response.getResponseDataJavaJson(bl, data); + } + +} \ No newline at end of file diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/PunchClockAdminController.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/PunchClockAdminController.java new file mode 100644 index 0000000..79396b3 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/PunchClockAdminController.java @@ -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 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 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 myList = pageInfo.getList(); //当前页的列表数据 + //转换为PunchClockQuery视图数据 + List 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 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 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 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 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 idlist = null; + if (ids != null && !ids.isEmpty()) { + idlist = Linq.of(ids.split(",")).toList(); + } + List myList = punchClockAdminService.getPunchClockListExportByIds(idlist); + if (myList != null && myList.size() > 0) { + //转换为PunchClockQuery视图数据 + List 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 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 portAreaList = punchClockAdminService.getPunchClockPortAreaList(port_area_id); + //判断请求是否成功 + Boolean bl = portAreaList != null; + //创建返回数据data + Map 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 data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + PortArea portArea = punchClockAdminService.getPunchClockPortAreaById(id); + //判断请求是否成功 + Boolean bl = portArea != null; + //创建返回数据data + Map 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 data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + Integer res = punchClockAdminService.punchClockPortAreaSetting(portArea); + //判断请求是否成功 + Boolean bl = res != null && res > 0; + //创建返回数据data + Map data = new HashMap<>(); + data.put("result", res); + //添加到返回对象 + //返回 + return response.getResponseDataJavaJson(bl, data); + + } + + +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/TbHeadController.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/TbHeadController.java new file mode 100644 index 0000000..81ec3bb --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/TbHeadController.java @@ -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 Codes = TbHeadStatic.getTableCodeList(); + String msg = ""; + if (!Codes.contains(tbHead.getTable_code())) { + msg = "表编码不在枚举范围内"; + //判断请求是否成功 + Boolean bl = false; + //创建返回数据 + Map data = TbHeadStatic.getTableMap(); + //返回 + return response.getResponseData(bl, data, msg); + + } + Integer x = tbHeadService.insertOrUpdate(tbHead); + //判断请求是否成功 + Boolean bl = x != null && x != 0; + //创建返回数据data + Map 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 data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + TableHead tbHead = tbHeadService.queryByCode(table_code); + //判断请求是否成功 + Boolean bl = tbHead != null; + //创建返回数据data + Map data = new HashMap<>(); + data.put("tbHead", tbHead); + //添加到返回对象 + //返回 + return response.getResponseDataJavaJson(bl, data); + } + +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/UsersAdminController.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/UsersAdminController.java new file mode 100644 index 0000000..7b2055a --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/UsersAdminController.java @@ -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 pageInfo = usersAdminService.usersListForCondition(keywords, registerDateStart,registerDateEnd, usersState, pageNum, pageSize); + + //读取分页结果 + Integer pageCount = pageInfo.getPages();//总页数 + long recordTotal = pageInfo.getTotal();//记录总数 + List 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 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 data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + Users users = usersService.getById(users_id); + //判断请求是否成功 + Boolean bl = users != null; + //创建返回数据data + Map 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 data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + if (usersState == null) { + msg = "用户id不能为空"; + //判断请求是否成功 + Boolean bl = false; + //创建返回数据 + Map 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 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 data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + if (id_code == null || id_code.isEmpty()) { + msg = "身份号码不能为空"; + //判断请求是否成功 + Boolean bl = false; + //创建返回数据 + Map 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 data = new HashMap<>(); + data.put("result", x); + //添加到返回对象 + //返回 + return response.getResponseData(bl, data); + } + + /** + * 用户登录日志查询 + * + * @return 返回日志记录列表 + */ + @RequestMapping("/usersLoginLog") + public String usersLoginLog(Pages pages) { + //List 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 pageInfo = loginLogService.loginLogListForCondition(pageNum, pageSize); + + //读取分页结果 + Integer pageCount = pageInfo.getPages(); //总页数 + long recordTotal = pageInfo.getTotal(); //记录总数 + List myList = pageInfo.getList(); //当前页的列表数据 + + //分页数据添加到pages + assert pages != null; + pages.setPageCount(pageCount); + pages.setRecordTotal(recordTotal); + + //判断请求是否成功 + Boolean bl = true; + //创建返回数据data + Map data = new HashMap<>(); + data.put("Pages", pages); + data.put("LoginLogList", myList); + //添加到返回对象 + //返回 + return response.getResponseData(bl, data); + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/VehicleAdminController.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/VehicleAdminController.java new file mode 100644 index 0000000..ad97cd8 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/admin/VehicleAdminController.java @@ -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 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 data = new HashMap<>(); + //封装数据 + //返回 + return response.getRtosResponseData(bl, data, "401"); + } + + if (status.equals("200")) { + myList = receivingVehicleIdo_dto.getReceivingVehicleIdoList(); + } + //判断请求是否成功 + Boolean bl = myList != null; + //创建返回数据对象 + Map 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 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 data = new HashMap<>(); + //封装数据 + //返回 + return response.getRtosResponseData(bl, data, "401"); + } + if (status.equals("200")) { + receivingDetailIdo = receivingDetailIdo_dto.getReceivingDetailIdo(); + } + //判断请求是否成功 + Boolean bl = receivingDetailIdo != null; + //创建返回数据data + Map 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 data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + //外部接口获取数据 + boolean res = receivingVehicleInterface.checkReceivingVehicle(id); + //判断请求是否成功 + Boolean bl = res; + //创建返回数据data + Map 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 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 data = new HashMap<>(); + //封装数据 + //返回 + return response.getRtosResponseData(bl, data, "401"); + } + + if (status.equals("200")) { + myList = departureVehicleIdo_dto.getDepartureVehicleIdoList(); + } + //判断请求是否成功 + Boolean bl = myList != null; + //创建返回数据对象 + Map 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 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 data = new HashMap<>(); + //封装数据 + //返回 + return response.getRtosResponseData(bl, data, "401"); + } + if (status.equals("200")) { + departureDetailIdo = departureDetailIdo_dto.getDepartureDetailIdo(); + } + //判断请求是否成功 + Boolean bl = departureDetailIdo != null; + //创建返回数据data + Map 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 data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + //外部接口获取数据 + boolean res = departureVehicleInterface.checkDepartureVehicle(id); + //判断请求是否成功 + Boolean bl = res; + //创建返回数据data + Map 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 res = orderApi.getReceiveListByCondition(spmId, bvmId, query, current, size); + List 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 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 res = orderApi.getDepartureListByCondition(spmId, bvmId, query, current, size); + List 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 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 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 data = new HashMap<>(); + //封装数据 + //返回 + return response.getRtosResponseData(bl, data, "401"); + } + + ReceivingDetailIdo receivingDetailIdo = receivingDetailIdo_dto.getReceivingDetailIdo(); + if (receivingDetailIdo == null) { + //判断请求是否成功 + Boolean bl = false; + //创建返回数据对象 + Map data = new HashMap<>(); + data.put("单个收车凭证excel导出", "失败"); + //封装数据 + //返回 + return response.getResponseData(bl, data); + } + + List recAndDepExcelDtoList = new ArrayList<>(); + RecAndDepExcelDto recAndDepExcelDto = new RecAndDepExcelDto(); + recAndDepExcelDto.setText1("上海海通国际汽车码头有限公司货物出门证"); + recAndDepExcelDto.setText2(""); + recAndDepExcelDto.setText3(""); + recAndDepExcelDto.setText4(""); + recAndDepExcelDtoList.add(recAndDepExcelDto); + + List 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 data = new HashMap<>(); + data.put("单个收车凭证excel导出", "成功"); + data.put("导出文件路径", "path"); + //封装数据 + //返回 + return response.getResponseData(bl, data); + } + + /** + * 多个收车凭证excel导出 + * + * @return 返回导出结果 + */ + @RequestMapping("/vehicleReceivingListExport") + public String vehicleReceivingListExport(@RequestParam("vehicleReceivingIdList") List vehicleReceivingIdList, HttpServletResponse myresponse) { + String msg = ""; + + if (vehicleReceivingIdList == null || vehicleReceivingIdList.size() == 0) { + msg = "收车凭证id不能为空"; + //判断请求是否成功 + Boolean bl = false; + //创建返回数据 + Map data = new HashMap<>(); + //返回 + return response.getResponseData(bl, data, msg); + } + List 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 data = new HashMap<>(); + //封装数据 + //返回 + return response.getRtosResponseData(bl, data, "401"); + } + + receivingDetailIdo = receivingDetailIdo_dto.getReceivingDetailIdo(); + if (receivingDetailIdo == null) { + //判断请求是否成功 + Boolean bl = false; + //创建返回数据对象 + Map data = new HashMap<>(); + data.put("单个收车凭证excel导出", "失败"); + //封装数据 + //返回 + return response.getResponseData(bl, data); + } + + receivingDetailIdoList.add(receivingDetailIdo); + } + + List recAndDepExcelDtoList = new ArrayList<>(); + RecAndDepExcelDto recAndDepExcelDto = new RecAndDepExcelDto(); + recAndDepExcelDto.setText1("上海海通国际汽车码头有限公司货物出门证"); + recAndDepExcelDto.setText2(""); + recAndDepExcelDto.setText3(""); + recAndDepExcelDto.setText4(""); + recAndDepExcelDtoList.add(recAndDepExcelDto); + + for (ReceivingDetailIdo receivingDetailIdo : receivingDetailIdoList) { + List 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 data = new HashMap<>(); + data.put("单个收车凭证excel导出", "成功"); + data.put("导出文件路径", "path"); + //封装数据 + //返回 + return response.getResponseData(bl, data); + } + + private List ReceivingDetailIdoCorverToRecAndDepExcelDtoList(ReceivingDetailIdo receivingDetailIdo) { + List 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 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; + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/AnnouncementsController.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/AnnouncementsController.java new file mode 100644 index 0000000..dbadcae --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/AnnouncementsController.java @@ -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 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 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 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 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 data = new HashMap<>(); + data.put("Announcement",announcements); + //添加到返回对象 + //返回 + return response.getResponseDataJavaJson(bl,data); + } + + /** + * 查询公告列表 + * @return 返回公告列表 + */ + @RequestMapping("/getList") + public String getList(){ + List mylist = announcementService.getList(); + //判断请求是否成功 + Boolean bl = mylist != null; + //创建返回数据data + Map data = new HashMap<>(); + data.put("AnnouncementsList",mylist); + //添加到返回对象 + //返回 + return response.getResponseDataJavaJson(bl,data); + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/AppointmentController.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/AppointmentController.java new file mode 100644 index 0000000..d9989dc --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/AppointmentController.java @@ -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 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 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 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 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 data = new HashMap<>(); + data.put("Appointment",appointment); + //添加到返回对象 + //返回 + return response.getResponseDataJavaJson(bl,data); + } + + /** + * 查询预约信息列表 + * @return 返回预约信息列表 + */ + @RequestMapping("/getList") + public String getList() { + List mylist = appointmentService.getList(); + + //判断请求是否成功 + Boolean bl = mylist != null; + //创建返回数据data + Map data = new HashMap<>(); + data.put("AppointmentList",mylist); + //添加到返回对象 + //返回 + return response.getResponseDataJavaJson(bl,data); + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/FeedbackControllerl.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/FeedbackControllerl.java new file mode 100644 index 0000000..6c0f634 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/FeedbackControllerl.java @@ -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 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 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 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 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 data = new HashMap<>(); + data.put("Feedback",feedback); + //添加到返回对象 + //返回 + return response.getResponseData(bl,data); + } + //列表 + @RequestMapping("/getList") + public String getList(){ + List mylist = feedbackService.getList(); + //判断请求是否成功 + Boolean bl = (mylist!=null) ? true : false; + //创建返回数据data + Map data = new HashMap<>(); + data.put("FeedbackList",mylist); + //添加到返回对象 + String dataJson = response.getResponseData(bl,data); + //返回 + return dataJson; + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/NoviceIntroductionController.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/NoviceIntroductionController.java new file mode 100644 index 0000000..a33a9c0 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/NoviceIntroductionController.java @@ -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 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 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 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 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 data = new HashMap<>(); + data.put("NoviceIntroduction",noviceIntroduction); + //添加到返回对象 + //返回 + return response.getResponseData(bl,data); + } + + /** + * 查询新手攻略信息列表 + * @return 返回新手攻略信息列表 + */ + @RequestMapping("/getList") + public String getList(){ + List mylist = noviceIntroductionService.getList(); + //判断请求是否成功 + Boolean bl = mylist != null; + //创建返回数据data + Map data = new HashMap<>(); + data.put("NoviceIntroductionList",mylist); + //添加到返回对象 + //返回 + return response.getResponseData(bl,data); + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/PortAreasController.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/PortAreasController.java new file mode 100644 index 0000000..175dde7 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/PortAreasController.java @@ -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 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 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 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 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 data = new HashMap<>(); + data.put("PortArea",portArea); + //添加到返回对象 + //返回 + return response.getResponseData(bl,data); + } + + /** + * 查询港区列表 + * @return 返回港区列表 + */ + @RequestMapping("/getList") + public String getList(){ + List mylist = portAreasService.getList(); + //判断请求是否成功 + Boolean bl = mylist != null; + //创建返回数据data + Map data = new HashMap<>(); + data.put("PortAreasList",mylist); + //添加到返回对象 + //返回 + return response.getResponseData(bl,data); + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/PunchClockController.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/PunchClockController.java new file mode 100644 index 0000000..5783a1b --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/PunchClockController.java @@ -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 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 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 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 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 data = new HashMap<>(); + data.put("PunchClock",punchClock); + //添加到返回对象 + //返回 + return response.getResponseData(bl,data); + } + + /** + * 查询打卡列表 + * @return 返回打卡信息列表 + */ + @RequestMapping("/getList") + public String getList(){ + List mylist = punchClockService.getList(); + //判断请求是否成功 + Boolean bl = mylist != null; + //创建返回数据data + Map data = new HashMap<>(); + data.put("PunchClockList",mylist); + //添加到返回对象 + //返回 + return response.getResponseData(bl,data); + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/ServiceConfigController.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/ServiceConfigController.java new file mode 100644 index 0000000..bf5d3b5 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/ServiceConfigController.java @@ -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 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 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 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 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 data = new HashMap<>(); + data.put("ServiceConfig",serviceConfig); + //添加到返回对象 + //返回 + return response.getResponseData(bl,data); + } + + /** + * 查询服务配置信息列表 + * @return 返回服务配置信息列表 + */ + @RequestMapping("/getList") + public String getList(){ + List mylist = serviceConfigService.getList(); + //判断请求是否成功 + Boolean bl = mylist != null; + //创建返回数据data + Map data = new HashMap<>(); + data.put("ServiceConfigList",mylist); + //添加到返回对象 + //返回 + return response.getResponseData(bl,data); + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/TruckController.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/TruckController.java new file mode 100644 index 0000000..e111e77 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/TruckController.java @@ -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 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 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 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 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 data = new HashMap<>(); + data.put("PalletTruck",palletTruck); + //添加到返回对象 + //返回 + return response.getResponseData(bl,data); + } + + /** + * 查询板车列表 + * @return 返回板车列表 + */ + @RequestMapping("/getList") + public String getList(){ + List mylist = truckService.getList(); + //判断请求是否成功 + Boolean bl = mylist != null; + //创建返回数据data + Map data = new HashMap<>(); + data.put("PalletTruckList",mylist); + //封装到返回对象 + //返回 + return response.getResponseData(bl,data); + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/TruckManagementController.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/TruckManagementController.java new file mode 100644 index 0000000..05983bc --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/TruckManagementController.java @@ -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 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 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 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 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 data = new HashMap<>(); + data.put("TruckManagement",truckManagement); + //添加到返回对象 + //返回 + return response.getResponseData(bl,data); + } + + /** + * 查询板车管理列表 + * @return 返回板车管理列表 + */ + @RequestMapping("/getList") + public String getList(){ + List mylist = truckManagementService.getList(); + //判断请求是否成功 + Boolean bl = mylist != null; + //创建返回数据data + Map data = new HashMap<>(); + data.put("TruckManagementList",mylist); + //添加到返回对象 + //返回 + return response.getResponseData(bl,data); + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/UsersController.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/UsersController.java new file mode 100644 index 0000000..56a6385 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/api/base/UsersController.java @@ -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 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 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 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 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 data = new HashMap<>(); + data.put("Users",users); + //添加到返回对象 + //返回 + return response.getResponseData(bl,data); + } + + /** + * 查询用户列表表 + * @return 返回用户列表 + */ + @RequestMapping("/getList") + public String getList(){ + List mylist = usersService.getList(); + //判断请求是否成功 + Boolean bl = mylist != null; + //创建返回数据data + Map data = new HashMap<>(); + data.put("UsersList",mylist); + //添加到返回对象 + //返回 + return response.getResponseData(bl,data); + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/job/FileDeleteJob.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/job/FileDeleteJob.java new file mode 100644 index 0000000..7dd35cc --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/job/FileDeleteJob.java @@ -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 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 pdffileList = this.getAllFiles(pdffile); + List 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 getAllFiles(File dir) { + List 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; + } + +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/AnnouncementAdminService.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/AnnouncementAdminService.java new file mode 100644 index 0000000..91deca6 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/AnnouncementAdminService.java @@ -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 getAuthorList(); + + /** + * 根据特定条件查询历史公告 + * @param tilKeywords:标题关键字 + * @param dateStart:日期范围之起始发布日期 + * @param dateEnd:日期范围之截止发布日期 + * @param sort:类别(1-小程序,2-客服平台) + * @param authors:作者/发布人/操作员 + * @param pageNum:当前页码 + * @param pageSize:每页激流条数 + * @return 返回根据特定条件查询历史公告 + */ + PageInfo AnnouncementListForCondition(String tilKeywords, String dateStart, String dateEnd, Integer sort, String authors, Integer pageNum, Integer pageSize); + + /** + * 获取一周的公告 + */ + List AnnouncementListForWeek(); + + + + /** + * 公告信息转换Dto + * @param list 公告信息列表 + * @return 返回公告信息列表 + */ + List AnnouncementListConvert(List list); + +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/AppointmentAdminService.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/AppointmentAdminService.java new file mode 100644 index 0000000..e8f221c --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/AppointmentAdminService.java @@ -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 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 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 AppointmentListExportyByIds(Listids); + + + /** + * 获取指定预约的货物明细 + * + * @param appointment_id 预约id + * @return 预约详情列表 + */ + List appointmentGoodsDetail(String appointment_id); + + /** + * List转List + * + * @param myList: List预约查询列表数据 + * @return 返回预约查询列表数据 + */ + List AppointmentListConvert(List myList); + + public List AppointmentListConvert1(List myList); + +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/FeedbackAdminService.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/FeedbackAdminService.java new file mode 100644 index 0000000..7952631 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/FeedbackAdminService.java @@ -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 feedbackListForCondition(String users_id, String linkTel, String nikeName, Integer pageNum, Integer pageSize); + +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/AnnouncementAdminServiceImpl.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/AnnouncementAdminServiceImpl.java new file mode 100644 index 0000000..3afe2f9 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/AnnouncementAdminServiceImpl.java @@ -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 getAuthorList() { + return announcementAdminMapper.getAuthorList(); + } + + /** + * 根据特定条件查询历史公告 + * @param tilKeywords:标题关键字 + * @param dateStart:日期范围之起始发布日期 + * @param dateEnd:日期范围之截止发布日期 + * @param sort:类别(1-小程序,2-客服平台) + * @param authors:作者/发布人/操作员 + * @param pageNum:当前页码 + * @param pageSize:每页激流条数 + * @return 返回根据特定条件查询历史公告 + */ + @Override + public PageInfo AnnouncementListForCondition(String tilKeywords, String dateStart, String dateEnd, Integer sort, String authors, Integer pageNum, Integer pageSize) { + List authorslist = null; + if (authors != null && !authors.isEmpty()) { + authorslist = Linq.of(authors.split(",")).toList(); + } + //初始化PageHelper + PageHelper.startPage(pageNum, pageSize,true,false,false); + //查询数据库 + List 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 pageInfo = new PageInfo(mylist); + //返回 + return pageInfo; + } + + @Override + public List AnnouncementListForWeek() { + List 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 AnnouncementListConvert(List list) { + List 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; + } + +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/AppointmentAdminServiceImpl.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/AppointmentAdminServiceImpl.java new file mode 100644 index 0000000..ba9010a --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/AppointmentAdminServiceImpl.java @@ -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 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 myList = appointmentAdminMapper.AppointmentListForCondition(users_id, port_area_id, keywords, start_date, end_date, enter_type, appointment_state, transport_type); + //封装分页数据 + //返回 + return new PageInfo(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 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 myList = appointmentAdminMapper.AppointmentListForCondition(users_id, pam_id, keywords, start_date, end_date, enter_type, appointment_state, transport_type); + //返回 + return myList; + } + + @Override + public List AppointmentListExportyByIds(List ids) { + return appointmentAdminMapper.AppointmentListExportyByIds(ids); + } + + /** + * 获取指定预约的货物明细 + * + * @param appointment_id 预约id + * @return 预约详情列表 + */ + @Override + public List appointmentGoodsDetail(String appointment_id) { + return appointmentAdminMapper.appointmentGoodsDetail(appointment_id); + } + + /** + * List转List + * + * @param myList: List预约查询列表数据 + * @return 返回预约查询列表数据 + */ + @Override + public List AppointmentListConvert(List myList) { + List 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 enterPortTypeList = dicInterface.getDicList("ENTER_PORT_TYPE"); + + //初始化运输方式(1-板车运输,2-自开) + List transportTypeList = dicInterface.getDicList("TRANSPORT_TYPE"); + + //初始化货物类型(商品车/设备/其他...) + List cargoTypeList = dicInterface.getDicList("APP_CARGO_TYPE"); + + //初始化预约状态 + Map 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 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 AppointmentListConvert1(List myList) { + List 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 enterPortTypeList = dicInterface.getDicList("ENTER_PORT_TYPE"); + + //初始化运输方式(1-板车运输,2-自开) + List transportTypeList = dicInterface.getDicList("TRANSPORT_TYPE"); + + //初始化货物类型(商品车/设备/其他...) + List cargoTypeList = dicInterface.getDicList("APP_CARGO_TYPE"); + + //初始化预约状态 + Map 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 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; + } + +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/FeedbackAdminServiceImpl.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/FeedbackAdminServiceImpl.java new file mode 100644 index 0000000..64b101e --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/FeedbackAdminServiceImpl.java @@ -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 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 myList = feedbackAdminMapper.feedbackListForCondition(users_id, linkTel, nikeName); + //封装分页数据 + return new PageInfo(myList); + } + +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/NoviceIntroductionAdminServiceImpl.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/NoviceIntroductionAdminServiceImpl.java new file mode 100644 index 0000000..a765797 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/NoviceIntroductionAdminServiceImpl.java @@ -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); + } + + + + +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/OpenApiServiceImpl.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/OpenApiServiceImpl.java new file mode 100644 index 0000000..a2a0918 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/OpenApiServiceImpl.java @@ -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 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 getAppointmentDetailListByGoodVinList(List vinlist) { + List vinList = appointmentDetailMapper.getAppointmentDetailListByGoodVinList(vinlist); + return vinList; + } + + /** + * 通过预约id获得预约详情 + * + * @param appointment_id 预约id + * @return 预约详情 + */ + @Override + public List 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 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 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 mylist = appointmentMapper.getAppointmentListByCondition(truckNumber, shipId, instructState, brandName); + //封装分页数据 + PageInfo pageInfo = new PageInfo(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 appointmentCmdList) { + List 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 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 getAppointmentByIds(List ids) { + return appointmentMapper.getAppointmentByIds(ids); + } + + /** + * @param appointmentIdList 预约ids + * @return 结果 + */ + @Override + public List getAppointmentDetailByAppointmentIdList(List appointmentIdList) { + return appointmentDetailMapper.getAppointmentDetailByAppointmentIdList(appointmentIdList); + } + + /** + * 板车监控分类列表 + * 结合预约明细信息,条件查询预约信息 + * + * @param queryCondition 查询条件 + * @param pages 页码 + * @return 返回分页数据 + */ + @Override + public List getAppointmentListByConditionf(QueryCondition queryCondition, Pages pages) { + //根据查询条件(queryCondition)获取预约查询列表 + List 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 appIds = Linq.of(appointmentList).select(Appointment::getId).distinct().toList(); + List allAppointmentDetailList = null; + List punchClockList = null; + if (appIds != null && appIds.size() > 0) { + allAppointmentDetailList = appointmentDetailMapper.getAppointmentDetailByAppointmentIdList(appIds); + punchClockList = punchClockMapper.getPunchClockByAppointmentIdList(appIds); + } + + List goodsTypeList = null; + goodsTypeList = dicInterface.getDicList("APP_CARGO_TYPE"); + //List portAreaList1 = portAreaInterface.getPortArea(); + List portAreaList = portAreasMapper.getList(); + //定义返回数据列表 + List 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 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 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 myAppointmentDetailList = appointmentDetailList.stream().filter(a -> a.getShip_id().equals(shipId)).collect(Collectors.toList()); + //获取一条船上 所有品牌名称(品牌id) + List brandIdList = Linq.of(myAppointmentDetailList).select(AppointmentDetail::getBrand_id).distinct().toList(); + //遍历一条船上所有品牌进行分组 + if (brandIdList != null && brandIdList.size() > 0) { + for (String brandId : brandIdList) { + //获取一条船上某一品牌(brand_id)的明细列表 + List 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 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 getAppointmentDetailsByConditionf(String appointmentId, String shipId, String brandId, Pages pages) { + //根据查询条件(queryCondition)获取预约查询列表 + List 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 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 getTruckByTruckNos(List TruckNoList) { + List list = truckMapper.getList(); + List usersList = usersMapper.getList(); + List res = null; + List 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; + } + + +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/PunchClockAdminServiceImpl.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/PunchClockAdminServiceImpl.java new file mode 100644 index 0000000..0f7d775 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/PunchClockAdminServiceImpl.java @@ -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 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 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(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 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 getPunchClockListExportByIds(List ids) { + return punchClockAdminMapper.getPunchClockListExportByIds(ids); + } + + /** + * List转换为List + * + * @param myList 打卡记录列表 + * @return 返回List + */ + @Override + public List PunchClockListConvert(List myList) { + List 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 enterPortTypeList = dicInterface.getDicList("ENTER_PORT_TYPE"); + List enterPortTypeList = enterPortTypeInterface.getEnterPortTypeList(); + //港区信息改用从哪吒接口取数据 + List 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 PunchClockListConvert1(List myList) { + List 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 enterPortTypeList = dicInterface.getDicList("ENTER_PORT_TYPE"); + List enterPortTypeList = enterPortTypeInterface.getEnterPortTypeList(); + //港区信息改用从哪吒接口取数据 + List 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 getPunchClockPortAreaList(String port_area_id) { + List portAreaList = portAreasMapper.getList(); + //List 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); + } + +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/ResponseServiceImpl.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/ResponseServiceImpl.java new file mode 100644 index 0000000..81ac53b --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/ResponseServiceImpl.java @@ -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); + } + +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/TableHeadServiceImpl.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/TableHeadServiceImpl.java new file mode 100644 index 0000000..0bc3d57 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/TableHeadServiceImpl.java @@ -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); + } +} + diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/TbHeadStatic.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/TbHeadStatic.java new file mode 100644 index 0000000..8bd9976 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/TbHeadStatic.java @@ -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 getTableCodeList() { + List 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 getTableMap() { + Map 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; + } + +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/ToPdfServiceImpl.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/ToPdfServiceImpl.java new file mode 100644 index 0000000..2e4f350 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/ToPdfServiceImpl.java @@ -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; + } + +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/UsersAdminServiceImpl.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/UsersAdminServiceImpl.java new file mode 100644 index 0000000..6974187 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/Impl/UsersAdminServiceImpl.java @@ -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 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 myList = usersAdminMapper.usersListForCondition(keywords,registerDateStart,registerDateEnd,usersState); + //封装分页数据 + return new PageInfo(myList); + } + +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/NoviceIntroductionAdminService.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/NoviceIntroductionAdminService.java new file mode 100644 index 0000000..4eff707 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/NoviceIntroductionAdminService.java @@ -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); +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/OpenApiService.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/OpenApiService.java new file mode 100644 index 0000000..59e1e5f --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/OpenApiService.java @@ -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 getAppointmentDetailListByGoodVinList(List 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 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 getAppointmentListByCondition(QueryCondition queryCondition, Pages pages); + + int updateAppointmentInstructState(AppointmentCmd appointmentCmd); + + int batchUpdateAppointmentInstructState(List appointmentCmdList); + + AppointmentDetail getAppointmentDetailByAppointmentIdAndGoodVin(String truckNumber, String vin); + + List getAppointmentByIds(List ids); + + List getAppointmentDetailByAppointmentIdList(List appointmentIdList); + + /** + * 板车监控分类列表 + * + * @param queryCondition 查询条件 + * @param pages 页码 + * @return 分页数据 + */ + List getAppointmentListByConditionf(QueryCondition queryCondition, Pages pages); + + /** + * 板车监控明细 + * + * @param appointmentId 预约id + * @param shipId 船id + * @param brandId 品牌 + * @return 板车监控明细 + */ + PageInfo getAppointmentDetailsByConditionf(String appointmentId, String shipId, String brandId, Pages pages); + + + Truck getPalletTruckByTruckNo(String truckNum); + + Truck getPalletTruckByByUsersId(String usersId); + + Integer postAppointment(Appointment appointment); + + + List getTruckByTruckNos(List list); + + +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/PunchClockAdminService.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/PunchClockAdminService.java new file mode 100644 index 0000000..f281205 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/PunchClockAdminService.java @@ -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 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 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 getPunchClockListExportByIds(List ids); + + + /** + * List转换为List + * + * @param myList 打卡记录列表 + * @return 返回List + */ + List PunchClockListConvert(List myList); + + public List PunchClockListConvert1(List myList); + + /** + * 获取所有的打卡港区 + * + * @param port_area_id 港区id + * @return 返回港区列表 + */ + public List getPunchClockPortAreaList(String port_area_id); + + /** + * 根据港区id获取所有的打卡港区 + * + * @param id 港区id + * @return 返回港区 + */ + PortArea getPunchClockPortAreaById(String id); + + /** + * 港区打卡设置 + * + * @param portArea 港区 + * @return 返回执行结果 + */ + Integer punchClockPortAreaSetting(PortArea portArea); + +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/ResponseService.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/ResponseService.java new file mode 100644 index 0000000..a84ac61 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/ResponseService.java @@ -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); +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/TableHeadService.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/TableHeadService.java new file mode 100644 index 0000000..13d9259 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/TableHeadService.java @@ -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); + +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/ToPdfService.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/ToPdfService.java new file mode 100644 index 0000000..c072d38 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/ToPdfService.java @@ -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); + +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/UsersAdminService.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/UsersAdminService.java new file mode 100644 index 0000000..c165880 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/admin/UsersAdminService.java @@ -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 usersListForCondition(String keywords,String registerDateStart,String registerDateEnd, Integer usersState, Integer pageNum, Integer pageSize); +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/AnnouncementService.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/AnnouncementService.java new file mode 100644 index 0000000..f3a973a --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/AnnouncementService.java @@ -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 getList(); +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/AppointmentDetailService.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/AppointmentDetailService.java new file mode 100644 index 0000000..5474fed --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/AppointmentDetailService.java @@ -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 getList(); +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/AppointmentService.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/AppointmentService.java new file mode 100644 index 0000000..f66521a --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/AppointmentService.java @@ -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 getList(); +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/DicService.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/DicService.java new file mode 100644 index 0000000..ff6d50b --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/DicService.java @@ -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 getList(); +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/FeedbackService.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/FeedbackService.java new file mode 100644 index 0000000..4611c31 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/FeedbackService.java @@ -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 getList(); +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/LoginLogService.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/LoginLogService.java new file mode 100644 index 0000000..755d7a1 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/LoginLogService.java @@ -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 getList(); + + + PageInfo loginLogListForCondition(Integer pageNum,Integer pageSize); +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/NoviceIntroductionService.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/NoviceIntroductionService.java new file mode 100644 index 0000000..5ed4b76 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/NoviceIntroductionService.java @@ -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 getList(); +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/PortAreasService.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/PortAreasService.java new file mode 100644 index 0000000..e40749d --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/PortAreasService.java @@ -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 getList(); +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/PunchClockService.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/PunchClockService.java new file mode 100644 index 0000000..db6e05c --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/PunchClockService.java @@ -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 getList(); +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/ReceivingDetailService.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/ReceivingDetailService.java new file mode 100644 index 0000000..8cf24d4 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/ReceivingDetailService.java @@ -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 getList(); +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/ReceivingVehicleService.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/ReceivingVehicleService.java new file mode 100644 index 0000000..6cc3caa --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/ReceivingVehicleService.java @@ -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 getList(); +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/ServiceConfigService.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/ServiceConfigService.java new file mode 100644 index 0000000..60c59ba --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/ServiceConfigService.java @@ -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 getList(); +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/TruckManagementService.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/TruckManagementService.java new file mode 100644 index 0000000..1310d0d --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/TruckManagementService.java @@ -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 getList(); +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/TruckService.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/TruckService.java new file mode 100644 index 0000000..2360e99 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/TruckService.java @@ -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 getList(); +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/UsersService.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/UsersService.java new file mode 100644 index 0000000..89d9ba9 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/UsersService.java @@ -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 getList(); +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/AnnouncementServiceImpl.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/AnnouncementServiceImpl.java new file mode 100644 index 0000000..d99706d --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/AnnouncementServiceImpl.java @@ -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 getList(){ + return announcementMapper.getList(); + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/AppointmentDetailServiceImpl.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/AppointmentDetailServiceImpl.java new file mode 100644 index 0000000..1fbfa71 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/AppointmentDetailServiceImpl.java @@ -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 getList(){ + return apointmentDetailMapper.getList(); + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/AppointmentServiceImpl.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/AppointmentServiceImpl.java new file mode 100644 index 0000000..31d72b2 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/AppointmentServiceImpl.java @@ -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 getList(){ + return appointmentMapper.getList(); + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/DicServiceImpl.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/DicServiceImpl.java new file mode 100644 index 0000000..812df28 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/DicServiceImpl.java @@ -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 getList(){ + return dicMapper.getList(); + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/FeedbackServiceImpl.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/FeedbackServiceImpl.java new file mode 100644 index 0000000..2caac71 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/FeedbackServiceImpl.java @@ -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 getList(){ + return feedbackMapper.getList(); + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/LoginLogServiceImpl.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/LoginLogServiceImpl.java new file mode 100644 index 0000000..258f928 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/LoginLogServiceImpl.java @@ -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 getList() { + return loginLogMapper.getList(); + } + + @Override + public PageInfo loginLogListForCondition(Integer pageNum, Integer pageSize) { + //初始化PageHelper + PageHelper.startPage(pageNum, pageSize, true, false, false); + List myList = loginLogMapper.getList(); + //封装分页数据 + return new PageInfo(myList); + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/NoviceIntroductionServiceImpl.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/NoviceIntroductionServiceImpl.java new file mode 100644 index 0000000..4b4cb2d --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/NoviceIntroductionServiceImpl.java @@ -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 getList(){ + List mylist = noviceIntroductionMapper.getList(); + return mylist; + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/PortAreasServiceImpl.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/PortAreasServiceImpl.java new file mode 100644 index 0000000..4f31408 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/PortAreasServiceImpl.java @@ -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 getList(){ + List mylist = portAreasMapper.getList(); + return mylist; + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/PunchClockServiceImpl.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/PunchClockServiceImpl.java new file mode 100644 index 0000000..8d5c9d4 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/PunchClockServiceImpl.java @@ -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 getList(){ + return punchClockMapper.getList(); + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/ReceivingDetailServiceImpl.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/ReceivingDetailServiceImpl.java new file mode 100644 index 0000000..5f7d7ca --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/ReceivingDetailServiceImpl.java @@ -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 getList(){ + return receivingDetailMapper.getList(); + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/ReceivingVehicleServiceImpl.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/ReceivingVehicleServiceImpl.java new file mode 100644 index 0000000..8007217 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/ReceivingVehicleServiceImpl.java @@ -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 getList(){ + return departureDetailMapper.getList(); + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/ServiceConfigServiceImpl.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/ServiceConfigServiceImpl.java new file mode 100644 index 0000000..c5e16da --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/ServiceConfigServiceImpl.java @@ -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 getList(){ + return serviceConfigMapper.getList(); + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/TruckManagementServiceImpl.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/TruckManagementServiceImpl.java new file mode 100644 index 0000000..d396ecd --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/TruckManagementServiceImpl.java @@ -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 getList(){ + return truckManagementMapper.getList(); + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/TruckServiceImpl.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/TruckServiceImpl.java new file mode 100644 index 0000000..9ab02f0 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/TruckServiceImpl.java @@ -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 getList(){ + List mylist = palletTruckMapper.getList(); + return mylist; + } +} diff --git a/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/UsersServiceImpl.java b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/UsersServiceImpl.java new file mode 100644 index 0000000..7c500d8 --- /dev/null +++ b/wx-applet-admin/src/main/java/com/haitongauto/rtosam/service/base/impl/UsersServiceImpl.java @@ -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 getList(){ + return usersMapper.getList(); + } +} diff --git a/wx-applet-admin/src/main/resources/bootstrap-pre.yml b/wx-applet-admin/src/main/resources/bootstrap-pre.yml new file mode 100644 index 0000000..5188053 --- /dev/null +++ b/wx-applet-admin/src/main/resources/bootstrap-pre.yml @@ -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 \ No newline at end of file diff --git a/wx-applet-admin/src/main/resources/bootstrap-prod.yml b/wx-applet-admin/src/main/resources/bootstrap-prod.yml new file mode 100644 index 0000000..f842f84 --- /dev/null +++ b/wx-applet-admin/src/main/resources/bootstrap-prod.yml @@ -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 + diff --git a/wx-applet-admin/src/main/resources/bootstrap.yml b/wx-applet-admin/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..06776a4 --- /dev/null +++ b/wx-applet-admin/src/main/resources/bootstrap.yml @@ -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 + diff --git a/wx-applet-admin/src/main/resources/static/font/msyh.ttc b/wx-applet-admin/src/main/resources/static/font/msyh.ttc new file mode 100644 index 0000000..37c28de Binary files /dev/null and b/wx-applet-admin/src/main/resources/static/font/msyh.ttc differ diff --git a/wx-applet-admin/src/main/resources/static/font/msyhbd.ttc b/wx-applet-admin/src/main/resources/static/font/msyhbd.ttc new file mode 100644 index 0000000..7949a5f Binary files /dev/null and b/wx-applet-admin/src/main/resources/static/font/msyhbd.ttc differ diff --git a/wx-applet-admin/src/main/resources/static/font/msyhl.ttc b/wx-applet-admin/src/main/resources/static/font/msyhl.ttc new file mode 100644 index 0000000..448e2ed Binary files /dev/null and b/wx-applet-admin/src/main/resources/static/font/msyhl.ttc differ diff --git a/wx-applet-admin/src/main/resources/static/font/simsun.ttc b/wx-applet-admin/src/main/resources/static/font/simsun.ttc new file mode 100644 index 0000000..e360db7 Binary files /dev/null and b/wx-applet-admin/src/main/resources/static/font/simsun.ttc differ diff --git a/wx-applet-admin/src/main/resources/static/image/20230427b40efe1e-462f-42df-8c3d-a56e4b3c34ce.jpg b/wx-applet-admin/src/main/resources/static/image/20230427b40efe1e-462f-42df-8c3d-a56e4b3c34ce.jpg new file mode 100644 index 0000000..527e65a Binary files /dev/null and b/wx-applet-admin/src/main/resources/static/image/20230427b40efe1e-462f-42df-8c3d-a56e4b3c34ce.jpg differ diff --git a/wx-applet-admin/src/main/resources/static/image/20230508f463bc91-85c6-46df-a1a3-67af8b0d3525.jpg b/wx-applet-admin/src/main/resources/static/image/20230508f463bc91-85c6-46df-a1a3-67af8b0d3525.jpg new file mode 100644 index 0000000..527e65a Binary files /dev/null and b/wx-applet-admin/src/main/resources/static/image/20230508f463bc91-85c6-46df-a1a3-67af8b0d3525.jpg differ diff --git a/wx-applet-admin/src/main/resources/本地.yml b/wx-applet-admin/src/main/resources/本地.yml new file mode 100644 index 0000000..70f1314 --- /dev/null +++ b/wx-applet-admin/src/main/resources/本地.yml @@ -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 + diff --git a/wx-applet-admin/src/main/resources/远程.yml b/wx-applet-admin/src/main/resources/远程.yml new file mode 100644 index 0000000..aab2321 --- /dev/null +++ b/wx-applet-admin/src/main/resources/远程.yml @@ -0,0 +1,11 @@ +# 微信小程序服务配置 +server: + port: 8892 + + +# postgresql数据源配置 +spring: + profiles: + active: pre + + diff --git a/wx-applet-admin/wx-applet-admin.iml b/wx-applet-admin/wx-applet-admin.iml new file mode 100644 index 0000000..60113a8 --- /dev/null +++ b/wx-applet-admin/wx-applet-admin.iml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file