From 4c66984ffd856f6c591bc6d28508d0750590bd18 Mon Sep 17 00:00:00 2001 From: "DESKTOP-G8BCEP0\\HP" <2037158277@qq.com> Date: Tue, 24 Aug 2021 15:01:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=AD=E5=BB=BA=E5=B7=A5=E6=97=B63.0?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E7=9A=84=E6=A1=86=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 33 ++ .mvn/wrapper/MavenWrapperDownloader.java | 118 +++++ .mvn/wrapper/maven-wrapper.jar | Bin 0 -> 50710 bytes .mvn/wrapper/maven-wrapper.properties | 2 + mvnw | 310 +++++++++++++ mvnw.cmd | 182 ++++++++ pom.xml | 184 ++++++++ .../java/com/xkrs/XkrsWorkApplication.java | 13 + .../common/account/AccountCredentials.java | 36 ++ .../account/CustomAuthenticationProvider.java | 113 +++++ .../common/account/GrantedAuthorityImpl.java | 25 + .../account/JwtAuthenticationFilter.java | 28 ++ .../xkrs/common/account/JwtLoginFilter.java | 132 ++++++ .../account/TokenAuthenticationService.java | 129 ++++++ .../com/xkrs/common/config/CorsConfig.java | 23 + .../xkrs/common/config/CorsInterceptor.java | 29 ++ .../com/xkrs/common/config/MvcConfig.java | 37 ++ .../xkrs/common/config/WebSecurityConfig.java | 65 +++ .../encapsulation/EncapsulationObejct.java | 59 +++ .../encapsulation/OutputEncapsulation.java | 96 ++++ .../encapsulation/PromptMessageEnum.java | 64 +++ .../com/xkrs/common/tool/CompareVersion.java | 33 ++ .../java/com/xkrs/common/tool/EntityUtil.java | 98 ++++ .../java/com/xkrs/common/tool/TokenUtil.java | 51 ++ .../controller/MemberProjectController.java | 131 ++++++ .../controller/ProjectOverviewController.java | 166 +++++++ .../ResponsibleProjectController.java | 180 ++++++++ .../xkrs/controller/SysManageController.java | 57 +++ .../xkrs/controller/SysUserController.java | 243 ++++++++++ .../controller/WorkHourRecordController.java | 226 +++++++++ .../java/com/xkrs/dao/MemberProjectDao.java | 94 ++++ .../java/com/xkrs/dao/ProjectOverviewDao.java | 45 ++ .../com/xkrs/dao/RelRoleAuthorityDao.java | 22 + .../java/com/xkrs/dao/RelUserRoleDao.java | 10 + .../com/xkrs/dao/ResponsibleProjectDao.java | 80 ++++ .../java/com/xkrs/dao/SysAuthorityDao.java | 32 ++ src/main/java/com/xkrs/dao/SysRoleDao.java | 60 +++ src/main/java/com/xkrs/dao/SysUserDao.java | 130 ++++++ .../java/com/xkrs/dao/WorkHourRecordDao.java | 141 ++++++ .../com/xkrs/model/entity/MemberProject.java | 121 +++++ .../xkrs/model/entity/ProjectOverview.java | 185 ++++++++ .../model/entity/RelRoleAuthorityEntity.java | 71 +++ .../xkrs/model/entity/RelUserRoleEntity.java | 60 +++ .../xkrs/model/entity/ResponsibleProject.java | 121 +++++ .../xkrs/model/entity/SysAuthorityEntity.java | 72 +++ .../com/xkrs/model/entity/SysRoleEntity.java | 72 +++ .../com/xkrs/model/entity/SysUserEntity.java | 205 +++++++++ .../com/xkrs/model/entity/WorkHourRecord.java | 126 +++++ .../java/com/xkrs/model/qo/ProjectQo.java | 140 ++++++ .../com/xkrs/model/qo/ProjectUpdateQo.java | 168 +++++++ .../java/com/xkrs/model/qo/SysUserQo.java | 138 ++++++ .../java/com/xkrs/model/qo/WorkRecordQo.java | 65 +++ .../validation/PictureFirePointQoInsert.java | 9 + .../model/validation/SysUserQoInsert.java | 8 + .../model/validation/SysUserQoUpdate.java | 8 + .../model/validation/WorkRecordQoInsert.java | 7 + .../model/validation/WorkRecordQoUpdate.java | 7 + .../xkrs/model/vo/ApplicationProjectVo.java | 82 ++++ .../xkrs/model/vo/ManagementProjectVo.java | 93 ++++ .../xkrs/model/vo/MemberApplicationVo.java | 69 +++ .../java/com/xkrs/model/vo/MemberJoinVo.java | 57 +++ .../com/xkrs/model/vo/MemberWorkRecordVo.java | 81 ++++ .../java/com/xkrs/model/vo/OutExcelVo.java | 69 +++ .../java/com/xkrs/model/vo/OutMemberVo.java | 57 +++ .../java/com/xkrs/model/vo/SysUserVo.java | 92 ++++ .../xkrs/service/MemberProjectService.java | 70 +++ .../xkrs/service/ProjectOverviewService.java | 55 +++ .../service/ResponsibleProjectService.java | 87 ++++ .../com/xkrs/service/SysAuthorityService.java | 23 + .../java/com/xkrs/service/SysRoleService.java | 19 + .../java/com/xkrs/service/SysUserService.java | 106 +++++ .../xkrs/service/WorkHourRecordService.java | 68 +++ .../impl/MemberProjectServiceImpl.java | 192 ++++++++ .../impl/ProjectOverviewServiceImpl.java | 158 +++++++ .../impl/ResponsibleProjectServiceImpl.java | 214 +++++++++ .../service/impl/SysAuthorityServiceImpl.java | 43 ++ .../xkrs/service/impl/SysRoleServiceImpl.java | 29 ++ .../xkrs/service/impl/SysUserServiceImpl.java | 241 ++++++++++ .../impl/WorkHourRecordServiceImpl.java | 435 ++++++++++++++++++ .../java/com/xkrs/utils/AddressUtils.java | 211 +++++++++ src/main/java/com/xkrs/utils/BeanUtils.java | 73 +++ .../java/com/xkrs/utils/CommonConstant.java | 177 +++++++ .../com/xkrs/utils/CopyPropertiesUtil.java | 54 +++ .../com/xkrs/utils/CustomizeResultCode.java | 14 + .../java/com/xkrs/utils/DateTimeUtil.java | 205 +++++++++ .../com/xkrs/utils/EncryptDecryptUtil.java | 66 +++ .../com/xkrs/utils/EntityManagerUtil.java | 36 ++ .../java/com/xkrs/utils/ExcelImportUtil.java | 193 ++++++++ src/main/java/com/xkrs/utils/FileUtil.java | 127 +++++ src/main/java/com/xkrs/utils/HashUtil.java | 40 ++ src/main/java/com/xkrs/utils/IpUtil.java | 42 ++ src/main/java/com/xkrs/utils/JdbcUtils.java | 35 ++ src/main/java/com/xkrs/utils/NumberUtil.java | 21 + .../com/xkrs/utils/ObjectToBeanUtils.java | 152 ++++++ src/main/java/com/xkrs/utils/OpenGeoUtil.java | 37 ++ src/main/java/com/xkrs/utils/PhotoUtil.java | 188 ++++++++ src/main/java/com/xkrs/utils/Query.java | 50 ++ src/main/java/com/xkrs/utils/RandomUtil.java | 62 +++ src/main/java/com/xkrs/utils/Result.java | 153 ++++++ .../java/com/xkrs/utils/SnowFlakeUtil.java | 124 +++++ src/main/resources/application.properties | 79 ++++ src/main/resources/i18n/messages.properties | 162 +++++++ .../resources/i18n/messages_en_US.properties | 162 +++++++ .../resources/i18n/messages_zh_CN.properties | 162 +++++++ .../com/xkrs/XkrsWorkApplicationTests.java | 13 + 105 files changed, 10038 insertions(+) create mode 100644 .gitignore create mode 100644 .mvn/wrapper/MavenWrapperDownloader.java create mode 100644 .mvn/wrapper/maven-wrapper.jar create mode 100644 .mvn/wrapper/maven-wrapper.properties create mode 100644 mvnw create mode 100644 mvnw.cmd create mode 100644 pom.xml create mode 100644 src/main/java/com/xkrs/XkrsWorkApplication.java create mode 100644 src/main/java/com/xkrs/common/account/AccountCredentials.java create mode 100644 src/main/java/com/xkrs/common/account/CustomAuthenticationProvider.java create mode 100644 src/main/java/com/xkrs/common/account/GrantedAuthorityImpl.java create mode 100644 src/main/java/com/xkrs/common/account/JwtAuthenticationFilter.java create mode 100644 src/main/java/com/xkrs/common/account/JwtLoginFilter.java create mode 100644 src/main/java/com/xkrs/common/account/TokenAuthenticationService.java create mode 100644 src/main/java/com/xkrs/common/config/CorsConfig.java create mode 100644 src/main/java/com/xkrs/common/config/CorsInterceptor.java create mode 100644 src/main/java/com/xkrs/common/config/MvcConfig.java create mode 100644 src/main/java/com/xkrs/common/config/WebSecurityConfig.java create mode 100644 src/main/java/com/xkrs/common/encapsulation/EncapsulationObejct.java create mode 100644 src/main/java/com/xkrs/common/encapsulation/OutputEncapsulation.java create mode 100644 src/main/java/com/xkrs/common/encapsulation/PromptMessageEnum.java create mode 100644 src/main/java/com/xkrs/common/tool/CompareVersion.java create mode 100644 src/main/java/com/xkrs/common/tool/EntityUtil.java create mode 100644 src/main/java/com/xkrs/common/tool/TokenUtil.java create mode 100644 src/main/java/com/xkrs/controller/MemberProjectController.java create mode 100644 src/main/java/com/xkrs/controller/ProjectOverviewController.java create mode 100644 src/main/java/com/xkrs/controller/ResponsibleProjectController.java create mode 100644 src/main/java/com/xkrs/controller/SysManageController.java create mode 100644 src/main/java/com/xkrs/controller/SysUserController.java create mode 100644 src/main/java/com/xkrs/controller/WorkHourRecordController.java create mode 100644 src/main/java/com/xkrs/dao/MemberProjectDao.java create mode 100644 src/main/java/com/xkrs/dao/ProjectOverviewDao.java create mode 100644 src/main/java/com/xkrs/dao/RelRoleAuthorityDao.java create mode 100644 src/main/java/com/xkrs/dao/RelUserRoleDao.java create mode 100644 src/main/java/com/xkrs/dao/ResponsibleProjectDao.java create mode 100644 src/main/java/com/xkrs/dao/SysAuthorityDao.java create mode 100644 src/main/java/com/xkrs/dao/SysRoleDao.java create mode 100644 src/main/java/com/xkrs/dao/SysUserDao.java create mode 100644 src/main/java/com/xkrs/dao/WorkHourRecordDao.java create mode 100644 src/main/java/com/xkrs/model/entity/MemberProject.java create mode 100644 src/main/java/com/xkrs/model/entity/ProjectOverview.java create mode 100644 src/main/java/com/xkrs/model/entity/RelRoleAuthorityEntity.java create mode 100644 src/main/java/com/xkrs/model/entity/RelUserRoleEntity.java create mode 100644 src/main/java/com/xkrs/model/entity/ResponsibleProject.java create mode 100644 src/main/java/com/xkrs/model/entity/SysAuthorityEntity.java create mode 100644 src/main/java/com/xkrs/model/entity/SysRoleEntity.java create mode 100644 src/main/java/com/xkrs/model/entity/SysUserEntity.java create mode 100644 src/main/java/com/xkrs/model/entity/WorkHourRecord.java create mode 100644 src/main/java/com/xkrs/model/qo/ProjectQo.java create mode 100644 src/main/java/com/xkrs/model/qo/ProjectUpdateQo.java create mode 100644 src/main/java/com/xkrs/model/qo/SysUserQo.java create mode 100644 src/main/java/com/xkrs/model/qo/WorkRecordQo.java create mode 100644 src/main/java/com/xkrs/model/validation/PictureFirePointQoInsert.java create mode 100644 src/main/java/com/xkrs/model/validation/SysUserQoInsert.java create mode 100644 src/main/java/com/xkrs/model/validation/SysUserQoUpdate.java create mode 100644 src/main/java/com/xkrs/model/validation/WorkRecordQoInsert.java create mode 100644 src/main/java/com/xkrs/model/validation/WorkRecordQoUpdate.java create mode 100644 src/main/java/com/xkrs/model/vo/ApplicationProjectVo.java create mode 100644 src/main/java/com/xkrs/model/vo/ManagementProjectVo.java create mode 100644 src/main/java/com/xkrs/model/vo/MemberApplicationVo.java create mode 100644 src/main/java/com/xkrs/model/vo/MemberJoinVo.java create mode 100644 src/main/java/com/xkrs/model/vo/MemberWorkRecordVo.java create mode 100644 src/main/java/com/xkrs/model/vo/OutExcelVo.java create mode 100644 src/main/java/com/xkrs/model/vo/OutMemberVo.java create mode 100644 src/main/java/com/xkrs/model/vo/SysUserVo.java create mode 100644 src/main/java/com/xkrs/service/MemberProjectService.java create mode 100644 src/main/java/com/xkrs/service/ProjectOverviewService.java create mode 100644 src/main/java/com/xkrs/service/ResponsibleProjectService.java create mode 100644 src/main/java/com/xkrs/service/SysAuthorityService.java create mode 100644 src/main/java/com/xkrs/service/SysRoleService.java create mode 100644 src/main/java/com/xkrs/service/SysUserService.java create mode 100644 src/main/java/com/xkrs/service/WorkHourRecordService.java create mode 100644 src/main/java/com/xkrs/service/impl/MemberProjectServiceImpl.java create mode 100644 src/main/java/com/xkrs/service/impl/ProjectOverviewServiceImpl.java create mode 100644 src/main/java/com/xkrs/service/impl/ResponsibleProjectServiceImpl.java create mode 100644 src/main/java/com/xkrs/service/impl/SysAuthorityServiceImpl.java create mode 100644 src/main/java/com/xkrs/service/impl/SysRoleServiceImpl.java create mode 100644 src/main/java/com/xkrs/service/impl/SysUserServiceImpl.java create mode 100644 src/main/java/com/xkrs/service/impl/WorkHourRecordServiceImpl.java create mode 100644 src/main/java/com/xkrs/utils/AddressUtils.java create mode 100644 src/main/java/com/xkrs/utils/BeanUtils.java create mode 100644 src/main/java/com/xkrs/utils/CommonConstant.java create mode 100644 src/main/java/com/xkrs/utils/CopyPropertiesUtil.java create mode 100644 src/main/java/com/xkrs/utils/CustomizeResultCode.java create mode 100644 src/main/java/com/xkrs/utils/DateTimeUtil.java create mode 100644 src/main/java/com/xkrs/utils/EncryptDecryptUtil.java create mode 100644 src/main/java/com/xkrs/utils/EntityManagerUtil.java create mode 100644 src/main/java/com/xkrs/utils/ExcelImportUtil.java create mode 100644 src/main/java/com/xkrs/utils/FileUtil.java create mode 100644 src/main/java/com/xkrs/utils/HashUtil.java create mode 100644 src/main/java/com/xkrs/utils/IpUtil.java create mode 100644 src/main/java/com/xkrs/utils/JdbcUtils.java create mode 100644 src/main/java/com/xkrs/utils/NumberUtil.java create mode 100644 src/main/java/com/xkrs/utils/ObjectToBeanUtils.java create mode 100644 src/main/java/com/xkrs/utils/OpenGeoUtil.java create mode 100644 src/main/java/com/xkrs/utils/PhotoUtil.java create mode 100644 src/main/java/com/xkrs/utils/Query.java create mode 100644 src/main/java/com/xkrs/utils/RandomUtil.java create mode 100644 src/main/java/com/xkrs/utils/Result.java create mode 100644 src/main/java/com/xkrs/utils/SnowFlakeUtil.java create mode 100644 src/main/resources/application.properties create mode 100644 src/main/resources/i18n/messages.properties create mode 100644 src/main/resources/i18n/messages_en_US.properties create mode 100644 src/main/resources/i18n/messages_zh_CN.properties create mode 100644 src/test/java/com/xkrs/XkrsWorkApplicationTests.java diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..549e00a --- /dev/null +++ b/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/.mvn/wrapper/MavenWrapperDownloader.java b/.mvn/wrapper/MavenWrapperDownloader.java new file mode 100644 index 0000000..a45eb6b --- /dev/null +++ b/.mvn/wrapper/MavenWrapperDownloader.java @@ -0,0 +1,118 @@ +/* + * Copyright 2007-present the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.net.*; +import java.io.*; +import java.nio.channels.*; +import java.util.Properties; + +public class MavenWrapperDownloader { + + private static final String WRAPPER_VERSION = "0.5.6"; + /** + * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. + */ + private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" + + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; + + /** + * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to + * use instead of the default one. + */ + private static final String MAVEN_WRAPPER_PROPERTIES_PATH = + ".mvn/wrapper/maven-wrapper.properties"; + + /** + * Path where the maven-wrapper.jar will be saved to. + */ + private static final String MAVEN_WRAPPER_JAR_PATH = + ".mvn/wrapper/maven-wrapper.jar"; + + /** + * Name of the property which should be used to override the default download url for the wrapper. + */ + private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; + + public static void main(String args[]) { + System.out.println("- Downloader started"); + File baseDirectory = new File(args[0]); + System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); + + // If the maven-wrapper.properties exists, read it and check if it contains a custom + // wrapperUrl parameter. + File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); + String url = DEFAULT_DOWNLOAD_URL; + if (mavenWrapperPropertyFile.exists()) { + FileInputStream mavenWrapperPropertyFileInputStream = null; + try { + mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); + Properties mavenWrapperProperties = new Properties(); + mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); + url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); + } catch (IOException e) { + System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); + } finally { + try { + if (mavenWrapperPropertyFileInputStream != null) { + mavenWrapperPropertyFileInputStream.close(); + } + } catch (IOException e) { + // Ignore ... + } + } + } + System.out.println("- Downloading from: " + url); + + File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); + if (!outputFile.getParentFile().exists()) { + if (!outputFile.getParentFile().mkdirs()) { + System.out.println( + "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); + } + } + System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); + try { + downloadFileFromURL(url, outputFile); + System.out.println("Done"); + System.exit(0); + } catch (Throwable e) { + System.out.println("- Error downloading"); + e.printStackTrace(); + System.exit(1); + } + } + + private static void downloadFileFromURL(String urlString, File destination) throws Exception { + if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { + String username = System.getenv("MVNW_USERNAME"); + char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); + Authenticator.setDefault(new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(username, password); + } + }); + } + URL website = new URL(urlString); + ReadableByteChannel rbc; + rbc = Channels.newChannel(website.openStream()); + FileOutputStream fos = new FileOutputStream(destination); + fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); + fos.close(); + rbc.close(); + } + +} diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..2cc7d4a55c0cd0092912bf49ae38b3a9e3fd0054 GIT binary patch literal 50710 zcmbTd1CVCTmM+|7+wQV$+qP}n>auOywyU~q+qUhh+uxis_~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Ez{rXQa89`YIF;EN&gN)cigu6mNh>?Cm zAO&Im2flv6D{jwm+y<%WsPe4!89n~KN|7}Cb{Z;XweER73r}Qp2 zz}WP4j}U0&(uD&9yGy6`!+_v-S(yG*iytsTR#x_Rc>=6u^vnRDnf1gP{#2>`ffrAC% zTZ5WQ@hAK;P;>kX{D)mIXe4%a5p=LO1xXH@8T?mz7Q@d)$3pL{{B!2{-v70L*o1AO+|n5beiw~ zk@(>m?T3{2k2c;NWc^`4@P&Z?BjxXJ@;x1qhn)9Mn*IFdt_J-dIqx5#d`NfyfX~m( zIS~5)MfZ2Uy?_4W`47i}u0ZgPh<{D|w_d#;D}Q&U$Q-G}xM1A@1f{#%A$jh6Qp&0hQ<0bPOM z-{1Wm&p%%#eb_?x7i;bol EfAhh=DF6Tf literal 0 HcmV?d00001 diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000..ffdc10e --- /dev/null +++ b/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,2 @@ +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar diff --git a/mvnw b/mvnw new file mode 100644 index 0000000..a16b543 --- /dev/null +++ b/mvnw @@ -0,0 +1,310 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100644 index 0000000..c8d4337 --- /dev/null +++ b/mvnw.cmd @@ -0,0 +1,182 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + +FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..db86383 --- /dev/null +++ b/pom.xml @@ -0,0 +1,184 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.4.1 + + + com.xkrs + xkrs_work + 0.0.1-SNAPSHOT + xkrs_work + Demo project for Spring Boot + + 5.19 + 0.11.2 + 4.5.12 + 6.1.5.Final + 5.4.20.Final + UTF-8 + UTF-8 + 11 + 11 + 11 + 1.2.76 + 2.10.5 + 2.10.5 + 5.0.0 + 5.0.0 + + + + org.springframework.boot + spring-boot-starter-aop + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-devtools + true + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-webflux + + + org.springframework.boot + spring-boot-starter-test + test + + + org.apache.commons + commons-pool2 + + + org.postgresql + postgresql + + + mysql + mysql-connector-java + + + io.jsonwebtoken + jjwt-api + ${jjwt.version} + + + io.jsonwebtoken + jjwt-impl + ${jjwt.version} + runtime + + + io.jsonwebtoken + jjwt-jackson + ${jjwt.version} + runtime + + + nl.basjes.parse.useragent + yauaa + ${yauaa.version} + + + org.apache.httpcomponents + httpmime + ${httpmime.version} + + + org.hibernate.validator + hibernate-validator + ${hibernate-validator.version} + + + org.hibernate + hibernate-spatial + ${hibernate-spatial.version} + + + com.alibaba + fastjson + ${fastjson.version} + + + + + io.springfox + springfox-swagger-ui + ${springfox-swagger-ui.version} + + + + io.springfox + springfox-swagger2 + ${springfox-swagger2.version} + + + + + org.apache.poi + poi + ${poi.version} + + + + org.apache.poi + poi-ooxml + ${poi-ooxml.version} + + + + + + + src/main/java + + **/*.properties + **/*.xml + + false + + + src/main/resources + + **/*.properties + **/*.xml + **/*.txt + + false + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/src/main/java/com/xkrs/XkrsWorkApplication.java b/src/main/java/com/xkrs/XkrsWorkApplication.java new file mode 100644 index 0000000..6d8d4f5 --- /dev/null +++ b/src/main/java/com/xkrs/XkrsWorkApplication.java @@ -0,0 +1,13 @@ +package com.xkrs; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class XkrsWorkApplication { + + public static void main(String[] args) { + SpringApplication.run(XkrsWorkApplication.class, args); + } + +} diff --git a/src/main/java/com/xkrs/common/account/AccountCredentials.java b/src/main/java/com/xkrs/common/account/AccountCredentials.java new file mode 100644 index 0000000..8513b0f --- /dev/null +++ b/src/main/java/com/xkrs/common/account/AccountCredentials.java @@ -0,0 +1,36 @@ +package com.xkrs.common.account; + +/** + * 账户实体 + * @author tajochen + */ +public class AccountCredentials { + + private String userName; + private String password; + private boolean remember; + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public boolean isRemember() { + return remember; + } + + public void setRemember(boolean remember) { + this.remember = remember; + } +} diff --git a/src/main/java/com/xkrs/common/account/CustomAuthenticationProvider.java b/src/main/java/com/xkrs/common/account/CustomAuthenticationProvider.java new file mode 100644 index 0000000..05eef93 --- /dev/null +++ b/src/main/java/com/xkrs/common/account/CustomAuthenticationProvider.java @@ -0,0 +1,113 @@ +package com.xkrs.common.account; + +import com.xkrs.model.entity.SysAuthorityEntity; +import com.xkrs.model.entity.SysUserEntity; +import com.xkrs.service.SysAuthorityService; +import com.xkrs.service.SysRoleService; +import com.xkrs.service.SysUserService; +import org.springframework.security.authentication.AuthenticationProvider; +import org.springframework.security.authentication.BadCredentialsException; +import org.springframework.security.authentication.DisabledException; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.AuthenticationException; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; + +import static com.xkrs.utils.EncryptDecryptUtil.encry256; + +/** + * 自定义认证Provider + * @author tajochen + */ +@Component +public class CustomAuthenticationProvider implements AuthenticationProvider { + + @Resource + private SysUserService sysUserService; + + @Resource + private SysRoleService sysRoleService; + + @Resource + private SysAuthorityService sysAuthorityService; + + /** + * 初使化时将已静态化的Service实例化 + */ + protected static CustomAuthenticationProvider customAuthenticationProvider; + + /** + * 通过@PostConstruct实现初始化bean之前进行的操作 + */ + @PostConstruct + public void init() { + customAuthenticationProvider = this; + customAuthenticationProvider.sysUserService = this.sysUserService; + customAuthenticationProvider.sysRoleService = this.sysRoleService; + customAuthenticationProvider.sysAuthorityService = this.sysAuthorityService; + } + + /** + * 用户认证授权 + * @param authentication + * @return + * @throws AuthenticationException + */ + @Override + public Authentication authenticate(Authentication authentication) throws AuthenticationException { + // 获取认证的用户名 & 密码 + String userName = authentication.getName(); + String password = authentication.getCredentials().toString(); + + SysUserEntity userEntity = customAuthenticationProvider.sysUserService.getSysUserByUserName(userName); + + // 检查用户是否存在 + if(userEntity == null){ + throw new BadCredentialsException("账号不存在或错误,请您确认注册"); + } + + // 检查用户是否激活 + if(userEntity.getActiveFlag().intValue() != 0){ + throw new DisabledException("该账号还未激活,请联系管理员"); + } + + //检查用户状态是否正常 + if(userEntity.getStatusCode() != 0){ + throw new DisabledException("用户状态不正常,请联系管理员"); + } + + // 认证逻辑 + String encryptPassword = encry256(password + userEntity.getSalt()); + if (encryptPassword.equals(userEntity.getPassword())) { + // 设置权限列表 + ArrayList permissions = new ArrayList<>(); + List integers = customAuthenticationProvider.sysAuthorityService.selectAuthorityByUserId(userEntity.getId()); + List permissionList = customAuthenticationProvider.sysAuthorityService.findAllByIdIn(integers); + for(SysAuthorityEntity sysAuthorityEntity : permissionList) { + permissions.add(new GrantedAuthorityImpl(sysAuthorityEntity.getAuthorityName())); + } + // 生成令牌 + Authentication authToken = new UsernamePasswordAuthenticationToken(userName, encryptPassword, permissions); + return authToken; + } + else { + throw new BadCredentialsException("用户密码错误,请重新输入"); + } + } + + /** + * 是否可以提供输入类型的认证服务 + * @param authentication + * @return + */ + @Override + public boolean supports(Class authentication) { + return authentication.equals(UsernamePasswordAuthenticationToken.class); + } +} diff --git a/src/main/java/com/xkrs/common/account/GrantedAuthorityImpl.java b/src/main/java/com/xkrs/common/account/GrantedAuthorityImpl.java new file mode 100644 index 0000000..318a217 --- /dev/null +++ b/src/main/java/com/xkrs/common/account/GrantedAuthorityImpl.java @@ -0,0 +1,25 @@ +package com.xkrs.common.account; + +import org.springframework.security.core.GrantedAuthority; + +/** + * 权限认证服务 + * @author tajochen + */ +public class GrantedAuthorityImpl implements GrantedAuthority { + + private String authority; + + public GrantedAuthorityImpl(String authority) { + this.authority = authority; + } + + public void setAuthority(String authority) { + this.authority = authority; + } + + @Override + public String getAuthority() { + return this.authority; + } +} diff --git a/src/main/java/com/xkrs/common/account/JwtAuthenticationFilter.java b/src/main/java/com/xkrs/common/account/JwtAuthenticationFilter.java new file mode 100644 index 0000000..da3a512 --- /dev/null +++ b/src/main/java/com/xkrs/common/account/JwtAuthenticationFilter.java @@ -0,0 +1,28 @@ +package com.xkrs.common.account; + +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.web.filter.GenericFilterBean; + +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; + +/** + * 拦截所有需要JWT的请求,然后调用TokenAuthenticationService类的静态方法去做JWT验证 + * @author tajochen + */ +public class JwtAuthenticationFilter extends GenericFilterBean { + + @Override + public void doFilter(ServletRequest request, + ServletResponse response, + FilterChain filterChain) throws IOException, ServletException { + Authentication authentication = TokenAuthenticationService.getAuthentication((HttpServletRequest)request); + SecurityContextHolder.getContext().setAuthentication(authentication); + filterChain.doFilter(request,response); + } +} diff --git a/src/main/java/com/xkrs/common/account/JwtLoginFilter.java b/src/main/java/com/xkrs/common/account/JwtLoginFilter.java new file mode 100644 index 0000000..e9a9e5c --- /dev/null +++ b/src/main/java/com/xkrs/common/account/JwtLoginFilter.java @@ -0,0 +1,132 @@ +package com.xkrs.common.account; + +import com.xkrs.common.encapsulation.OutputEncapsulation; +import com.xkrs.common.encapsulation.PromptMessageEnum; +import com.xkrs.model.vo.SysUserVo; +import com.xkrs.service.SysUserService; +import com.xkrs.utils.IpUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.i18n.LocaleContextHolder; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.authentication.BadCredentialsException; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.AuthenticationException; +import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter; +import org.springframework.security.web.util.matcher.AntPathRequestMatcher; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; + +import javax.annotation.Resource; +import javax.servlet.FilterChain; +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.UnsupportedEncodingException; +import java.util.Locale; + +/** + * jwt登录过滤器 + * @author tajochen + */ +public class JwtLoginFilter extends AbstractAuthenticationProcessingFilter { + + private static final Logger logger = LoggerFactory.getLogger(JwtLoginFilter.class); + + + @Resource + private SysUserService sysUserService; + + public JwtLoginFilter(String url, AuthenticationManager authManager) { + super(new AntPathRequestMatcher(url)); + setAuthenticationManager(authManager); + } + + /** + * 登录时验证 + * @param req + * @param res + * @return + */ + @Override + public Authentication attemptAuthentication(HttpServletRequest req, HttpServletResponse res) throws UnsupportedEncodingException { + req.setCharacterEncoding("UTF-8"); + res.setHeader("Access-Control-Allow-Origin","*"); + res.setHeader("Access-Control-Allow-Credentials", "false"); + AccountCredentials creds = new AccountCredentials(); + //获取表单数据 + String userName = req.getParameter("userName"); + String password = req.getParameter("password"); + String rememberMe = req.getParameter("remember"); + //如果用户名密码为空 + if(userName == null||password == null|| userName.trim().isEmpty()||password.trim().isEmpty()){ + throw new BadCredentialsException("user or password is null"); + } + if(rememberMe == null||rememberMe.isEmpty()){ + rememberMe = "false"; + } + creds.setUserName(userName.trim()); + creds.setPassword(password.trim()); + creds.setRemember(Boolean.parseBoolean(rememberMe)); + // 返回一个验证令牌 + return getAuthenticationManager().authenticate( + new UsernamePasswordAuthenticationToken( + creds.getUserName(), + creds.getPassword() + ) + ); + } + + /** + * 验证成功后调用 + * @param req + * @param response + * @param chain + * @param auth + * @throws IOException + * @throws ServletException + */ + @Override + protected void successfulAuthentication( + HttpServletRequest req, HttpServletResponse response, FilterChain chain, Authentication auth) { + if(sysUserService==null){ + ServletContext servletContext = req.getServletContext(); + WebApplicationContext webApplicationContext = WebApplicationContextUtils.getWebApplicationContext(servletContext); + sysUserService = webApplicationContext.getBean(SysUserService.class); + } + //更新用户登录信息 + sysUserService.updateSysUserLogin(auth.getName(), IpUtil.getIpAddr(req)); + SysUserVo userByUserName = sysUserService.getUserByUserName(auth.getName()); + response.setHeader("Access-Control-Allow-Origin", "*"); + response.setHeader("Access-Control-Allow-Credentials", "false"); + response.setContentType("application/json"); + response.setCharacterEncoding("UTF-8"); + TokenAuthenticationService.addAuthentication(response, auth.getName(),auth.getAuthorities(),userByUserName); + } + + /** + * 验证失败后调用 + * @param request + * @param response + * @param failed + * @throws IOException + */ + @Override + protected void unsuccessfulAuthentication(HttpServletRequest request, + HttpServletResponse response, + AuthenticationException failed) throws IOException { + Locale locale = LocaleContextHolder.getLocale(); + response.setHeader("Access-Control-Allow-Origin", "*"); + response.setHeader("Access-Control-Allow-Credentials", "false"); + response.setContentType("application/json"); + response.setCharacterEncoding("UTF-8"); + // 将 JWT 写入 body + PrintWriter out = response.getWriter(); + out.append(OutputEncapsulation.outputEncapsulationObject(PromptMessageEnum.DATA_WRONG, failed.getLocalizedMessage(), locale)); + response.setStatus(HttpServletResponse.SC_OK); + } +} diff --git a/src/main/java/com/xkrs/common/account/TokenAuthenticationService.java b/src/main/java/com/xkrs/common/account/TokenAuthenticationService.java new file mode 100644 index 0000000..54a20fe --- /dev/null +++ b/src/main/java/com/xkrs/common/account/TokenAuthenticationService.java @@ -0,0 +1,129 @@ +package com.xkrs.common.account; + +import com.xkrs.common.encapsulation.OutputEncapsulation; +import com.xkrs.common.encapsulation.PromptMessageEnum; +import com.xkrs.model.vo.SysUserVo; +import io.jsonwebtoken.Claims; +import io.jsonwebtoken.Jwts; +import io.jsonwebtoken.security.Keys; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.authority.AuthorityUtils; + +import javax.crypto.SecretKey; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.*; + +/** + * token认证服务 + * @author tajochen + */ +public class TokenAuthenticationService { + + private static final Logger logger = LoggerFactory.getLogger(TokenAuthenticationService.class); + /** + * 过期时间6小时 + */ + static public final long EXPIRATIONTIME = 21_600_000; + /** + * 加密密钥 + */ + static public final String SECRET_KEY = "0Y9H364Q9Y908262F25LMXGIKIN5N858XM3674GWL2DD8X1DS4W6I722IRY8PS4XPNB6U303" + + "45HBVCUL94STG8C3Z53T7A09JJ100I56YE9894CI11PX9J71HIZ8L5Y2O504C4E2K8276425UA8734833F45K36878FXAG799QV9LXU" + + "JOI3XA2046UPG8TB2OT84R5T6ZB127N9ZPJ7AJMC41JVHB2WK2B6H8NL45LZNAZ666KHZH3QUT65UX6F8"; + /** + * Token前缀 + */ + static public final String TOKEN_PREFIX = "Bearer"; + + /** + * 存放Token的Header Key + */ + static final String HEADER_STRING = "Authorization"; + static SecretKey key = Keys.hmacShaKeyFor(SECRET_KEY.getBytes()); + + /** + * JWT生成方法 + * @param response + * @param userName + * @param authorities + */ + static void addAuthentication(HttpServletResponse response, String userName, + Collection authorities, SysUserVo sysUserEntity) { + + Locale locale = new Locale("zh", "CN"); + Map map = new HashMap(3); + StringBuffer auths = new StringBuffer(); + String authsList = ""; + for(GrantedAuthority r : authorities) { + auths.append("," + r.getAuthority()); + } + authsList = auths.toString(); + if(authsList.length()>1){ + authsList=authsList.substring(1,authsList.length()); + }else{ + logger.warn(userName +" has no permission!"); + } + // 生成JWT + String jwt = Jwts.builder() + .setSubject(userName) + .setIssuer("https://www.microservice.com") + .setAudience(userName) + // 保存权限 + .claim("auths", authsList) + // 有效期设置 + .setExpiration(new Date(System.currentTimeMillis() + EXPIRATIONTIME)) + // 签名设置 + .signWith(key) + .compact(); + map.put("token",jwt); + map.put("role",authsList); + map.put("user",sysUserEntity); + // 将 JWT 写入 body + PrintWriter out = null; + try { + out = response.getWriter(); + } + catch (IOException e) { + e.printStackTrace(); + } + response.setStatus(HttpServletResponse.SC_OK); + out.append(OutputEncapsulation.outputEncapsulationObject(PromptMessageEnum.SUCCESS, map, locale)); + } + + /** + * JWT验证方法 + * @param request + * @return + */ + static Authentication getAuthentication(HttpServletRequest request) { + // 从Header中拿到token + String token = request.getHeader(HEADER_STRING); + if (token != null) { + try { + // 解析 Token + Claims claims = Jwts.parserBuilder() + .setSigningKey(key).build() + // 去掉 Bearer + .parseClaimsJws(token.replace(TOKEN_PREFIX, "")) + .getBody(); + // 获取用户名 + String userName = claims.getSubject(); + // 获取权限 + List authorities = AuthorityUtils.commaSeparatedStringToAuthorityList((String) claims.get("auths")); + return new UsernamePasswordAuthenticationToken(userName, null, authorities); + } catch(Exception e) { + // the sub field was missing or did not have a value + return null; + } + } else { + return null; + } + } +} diff --git a/src/main/java/com/xkrs/common/config/CorsConfig.java b/src/main/java/com/xkrs/common/config/CorsConfig.java new file mode 100644 index 0000000..7f8c32f --- /dev/null +++ b/src/main/java/com/xkrs/common/config/CorsConfig.java @@ -0,0 +1,23 @@ +package com.xkrs.common.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +import javax.annotation.Resource; + +/** + * 系统跨域配置 + * @author tajochen + */ +@Configuration +public class CorsConfig implements WebMvcConfigurer { + + @Resource + private CorsInterceptor corsInterceptor; + + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(corsInterceptor); + } +} diff --git a/src/main/java/com/xkrs/common/config/CorsInterceptor.java b/src/main/java/com/xkrs/common/config/CorsInterceptor.java new file mode 100644 index 0000000..e2103c5 --- /dev/null +++ b/src/main/java/com/xkrs/common/config/CorsInterceptor.java @@ -0,0 +1,29 @@ +package com.xkrs.common.config; + +import org.springframework.stereotype.Component; +import org.springframework.web.servlet.HandlerInterceptor; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * 跨域处理 + * @author tajochen + */ +@Component +public class CorsInterceptor implements HandlerInterceptor { + + @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { + + //添加跨域CORS + response.setHeader("Access-Control-Allow-Origin", "*"); + response.setHeader("Access-Control-Allow-Credentials", "false"); + response.setHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS"); + response.setHeader("Access-Control-Allow-Headers", "Content-Type , Authorization," + + "Accept,Origin,X-Requested-With"); + response.setHeader("Access-Control-Max-Age", "216000"); + response.setHeader("Content-Type","application/json;charset=UTF-8"); + return true; + } +} + diff --git a/src/main/java/com/xkrs/common/config/MvcConfig.java b/src/main/java/com/xkrs/common/config/MvcConfig.java new file mode 100644 index 0000000..edce463 --- /dev/null +++ b/src/main/java/com/xkrs/common/config/MvcConfig.java @@ -0,0 +1,37 @@ +package com.xkrs.common.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.TaskScheduler; +import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +/** + * WebMVC配置 + * @author Tajochen + */ +@Configuration +public class MvcConfig implements WebMvcConfigurer { + + /** + * 放行跨域请求 + */ + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") + .allowedOrigins("*") + .allowedMethods("*") + .allowedHeaders("*"); + } + + /** + * 定时任务线程池更改,防止多个任务并行 + */ + @Bean + public TaskScheduler taskScheduler() { + final ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler(); + scheduler.setPoolSize(5); + return scheduler; + } +} diff --git a/src/main/java/com/xkrs/common/config/WebSecurityConfig.java b/src/main/java/com/xkrs/common/config/WebSecurityConfig.java new file mode 100644 index 0000000..8a8f40e --- /dev/null +++ b/src/main/java/com/xkrs/common/config/WebSecurityConfig.java @@ -0,0 +1,65 @@ +package com.xkrs.common.config; + +import com.xkrs.common.account.CustomAuthenticationProvider; +import com.xkrs.common.account.JwtAuthenticationFilter; +import com.xkrs.common.account.JwtLoginFilter; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.HttpMethod; +import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; +import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; + +@Configuration +@EnableWebSecurity +@EnableGlobalMethodSecurity(prePostEnabled=true) +class WebSecurityConfig extends WebSecurityConfigurerAdapter { + + /** + * 设置 HTTP 验证规则 + * @param http + * @throws Exception + */ + @Override + protected void configure(HttpSecurity http) throws Exception { + // 关闭csrf验证 + http.csrf().disable() + // 对请求进行认证 + .authorizeRequests() + // 所有 / 的所有请求 都放行 + //.antMatchers("/").permitAll() + // 所有OPTIONS请求都放行 + .antMatchers(HttpMethod.OPTIONS).permitAll() + // 所有 /user/add 用户注册 的POST请求 都放行 + .antMatchers(HttpMethod.POST, "/api/user/add").permitAll() + // 所有 /user/check/duplicate 检查用户名是否重复 的POST请求 都放行 + .antMatchers(HttpMethod.POST, "/api/user/check/duplicate").permitAll() + // 所有 /login 用户登录 的POST请求 都放行 + .antMatchers(HttpMethod.POST, "/api/login").permitAll() + // 所有 app 用户注册 的POST请求 都放行 + .antMatchers(HttpMethod.POST, "/api/person-investigator/add").permitAll() + .antMatchers(HttpMethod.GET,"/api/user/booleanUserName").permitAll() + .antMatchers(HttpMethod.POST,"/importRsProjectExcel").permitAll() + .antMatchers(HttpMethod.POST,"/importCvProjectExcel").permitAll() + .antMatchers(HttpMethod.GET,"/excelOutWork").permitAll() + .antMatchers(HttpMethod.GET,"/selectMemberAndWorkHour").permitAll() + // 所有其它请求需要身份认证 + .anyRequest().authenticated() + .and() + // 添加一个过滤器 所有访问 /login 的请求交给 JWTLoginFilter 来处理 这个类处理所有的JWT相关内容 + .addFilterBefore(new JwtLoginFilter("/api/login", authenticationManager()), + UsernamePasswordAuthenticationFilter.class) + // 添加一个过滤器验证其他请求的Token是否合法 + .addFilterBefore(new JwtAuthenticationFilter(), + UsernamePasswordAuthenticationFilter.class); + ;} + + @Override + protected void configure(AuthenticationManagerBuilder auth) throws Exception { + // 使用自定义身份验证组件 + auth.authenticationProvider(new CustomAuthenticationProvider()); + } +} + diff --git a/src/main/java/com/xkrs/common/encapsulation/EncapsulationObejct.java b/src/main/java/com/xkrs/common/encapsulation/EncapsulationObejct.java new file mode 100644 index 0000000..e11fea7 --- /dev/null +++ b/src/main/java/com/xkrs/common/encapsulation/EncapsulationObejct.java @@ -0,0 +1,59 @@ +package com.xkrs.common.encapsulation; + +import java.io.Serializable; + +/** + * 输出信息对象 + * @author tajochen + * @param + */ +public class EncapsulationObejct implements Serializable { + + /** + * 状态码 + */ + int status; + + /** + * 提示信息 + */ + String msg; + + /** + * 数据 + */ + T data; + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public T getData() { + return data; + } + + public void setData(T data) { + this.data = data; + } + + @Override + public String toString() { + return "EncapsulationObejct{" + + "status=" + status + + ", msg='" + msg + '\'' + + ", data=" + data + + '}'; + } +} diff --git a/src/main/java/com/xkrs/common/encapsulation/OutputEncapsulation.java b/src/main/java/com/xkrs/common/encapsulation/OutputEncapsulation.java new file mode 100644 index 0000000..9bee083 --- /dev/null +++ b/src/main/java/com/xkrs/common/encapsulation/OutputEncapsulation.java @@ -0,0 +1,96 @@ +package com.xkrs.common.encapsulation; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.MessageSource; +import org.springframework.context.support.ResourceBundleMessageSource; +import org.springframework.stereotype.Component; +import org.springframework.validation.FieldError; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; +import java.util.Properties; + +/** + * 输出信息封装 + * @author tajochen + */ +@Component +public class OutputEncapsulation { + + private static final Logger logger = LoggerFactory.getLogger(OutputEncapsulation.class); + + /** + * 读取多国语言文件 + * @return + */ + public static MessageSource messageSource() { + Properties properties = new Properties(); + // 使用ClassLoader加载properties配置文件生成对应的输入流 + InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream("application.properties"); + // 使用properties对象加载输入流 + try { + properties.load(in); + } catch (IOException e) { + e.printStackTrace(); + } + ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); + messageSource.setBasename("i18n/messages"); + messageSource.setDefaultEncoding("UTF-8"); + return messageSource; + } + + /** + * 封装输出数据 + * @param promptMessageEnum + * @param obj + * @return + */ + public static String outputEncapsulationObject(PromptMessageEnum promptMessageEnum, Object obj, Locale locale) { + + EncapsulationObejct encapsulationObejct = new EncapsulationObejct(); + encapsulationObejct.setStatus(promptMessageEnum.getCode()); + encapsulationObejct.setMsg(messageSource().getMessage(promptMessageEnum.getText(),null,locale)); + encapsulationObejct.setData(obj); + + ObjectMapper objectMapper = new ObjectMapper(); + // 忽略无法转换的对象 + objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS,false); + // 忽略json字符串中不识别的属性 + objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + // 解决jackson无法反序列化LocalDateTime的问题,引入jsr310标准 + JavaTimeModule javaTimeModule = new JavaTimeModule(); + objectMapper.registerModule(javaTimeModule); + objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + String strByEo = ""; + try { + strByEo = objectMapper.writeValueAsString(encapsulationObejct); + } catch (JsonProcessingException e) { + e.printStackTrace(); + logger.warn(e.toString()); + } + return strByEo; + } + + /** + * 输出请求值检验错误信息 + * @param fieldErrors + * @return + */ + public static String outputEncapsulationErrorList(List fieldErrors, Locale locale){ + List errorMsg = new ArrayList<>(); + for (FieldError fieldError : fieldErrors) { + String errMessage = fieldError.getDefaultMessage().subSequence(1,fieldError.getDefaultMessage().length()-1).toString(); + errorMsg.add(messageSource().getMessage(errMessage,null,locale)); + } + return outputEncapsulationObject(PromptMessageEnum.PARAM_ILLEGAL,errorMsg,locale); + } +} diff --git a/src/main/java/com/xkrs/common/encapsulation/PromptMessageEnum.java b/src/main/java/com/xkrs/common/encapsulation/PromptMessageEnum.java new file mode 100644 index 0000000..8af04a8 --- /dev/null +++ b/src/main/java/com/xkrs/common/encapsulation/PromptMessageEnum.java @@ -0,0 +1,64 @@ +package com.xkrs.common.encapsulation; + +/** + * 提示信息枚举 + * @author tajochen + */ +public enum PromptMessageEnum{ + + // 执行成功 + SUCCESS(0, "sys.message.success"), + + + // 用户权限错误或非法操作: 1001-1999 + USER_NOT_LOGGED(1001, "sys.message.user.not_logged_in"), + USER_LOGIN_ERROR(1002, "sys.message.user.login_error"), + USER_ACCOUNT_FORBIDDEN(1003, "sys.message.user.account_forbidden"), + USER_ACCOUNT_NOT_ACTIVATED(1004, "sys.message.user.account_not_activated"), + USER_HAS_OVERTIME(1005, "sys.message.user.overtime"), + USER_NO_PERMISSION(1006,"sys.message.user.no_permission"), + USER_ALREADY_LOGGED(1007, "sys.message.user.already_logged"), + + // 请求参数错误或非法:2001-2999 + PARAM_NULL(2001, "sys.message.param.null"), + PARAM_ILLEGAL(2002, "sys.message.param.illegal"), + + // 数据返回错误:3001-3999 + DATA_NONE(3001, "sys.message.data.none"), + DATA_WRONG(3002, "sys.message.data.wrong"), + DATA_EXIT(3003,"sys.message.exit"), + + // 操作失败:4001-4999 + PROCESS_FAIL(4001,"sys.message.process.fail"), + PROCESS_OVERTIME(4002,"sys.message.process.overtime"), + FILE_EXISTS(4003,"sys.message.file.exists"), + FILE_WRITE_ERROR(4004,"sys.message.file.write.error"), + FILE_READ_ERROR(4005,"sys.message.file.read.error"), + + // 系统内部错误或异常:5001-5999 + SYSTEM_INNER_ERROR(5001,"sys.message.system.inner_error"), + SYSTEM_ABNORMAL(5002,"sys.message.system.abnormal"), + SYSTEM_BUSY(5003,"sys.message.system.busy"), + SYSTEM_MAINTAIN(5004,"sys.message.system.maintain"), + + // 数据库错误:6001-6999 + DATABASE_ERROR(6001,"sys.message.database.error"); + + private int code; + + private String text; + + private PromptMessageEnum(int code,String text) { + this.code = code; + this.text = text; + } + + public String getText() { + return this.text; + } + + public int getCode() { + return this.code; + } + +} diff --git a/src/main/java/com/xkrs/common/tool/CompareVersion.java b/src/main/java/com/xkrs/common/tool/CompareVersion.java new file mode 100644 index 0000000..7d2d6e7 --- /dev/null +++ b/src/main/java/com/xkrs/common/tool/CompareVersion.java @@ -0,0 +1,33 @@ +package com.xkrs.common.tool; + +/** + * CompareVersion 比较版本号 + * @author tajochen + */ +public class CompareVersion { + + /** + * 比较三位版本号 ,若 版本1>版本2 返回 1,若版本1<版本2 返回 -1,否则返回0 + * @param version1 版本1 + * @param version2 版本2 + * @return + */ + public static int compareVersion(String version1, String version2) { + String[] v1 = version1.split("\\."); + String[] v2 = version2.split("\\."); + int n = Math.max(v1.length, v2.length); + for (int i = 0; i < n; i++) { + int v1Int = i < v1.length ? Integer.parseInt(v1[i]) : 0; + int v2Int = i < v2.length ? Integer.parseInt(v2[i]) : 0; + if (v1Int == v2Int) { + continue; + } + if (v1Int > v2Int){ + return 1; + } else { + return -1; + } + } + return 0; + } +} diff --git a/src/main/java/com/xkrs/common/tool/EntityUtil.java b/src/main/java/com/xkrs/common/tool/EntityUtil.java new file mode 100644 index 0000000..70c54b6 --- /dev/null +++ b/src/main/java/com/xkrs/common/tool/EntityUtil.java @@ -0,0 +1,98 @@ +package com.xkrs.common.tool; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * dao接口类处理工具 + * @author tajochen + */ +public class EntityUtil { + private static final Logger logger = LoggerFactory.getLogger(EntityUtil.class); + + /** + * 将数组数据转换为实体类 + * 此处数组元素的顺序必须与实体类构造函数中的属性顺序一致 + * @param list 数组对象集合 + * @param clazz 实体类 + * @param 实体类 + * @param model 实例化的实体类 + * @return 实体类集合 + */ + public static List castEntity(List list, Class clazz, Object model) { + List returnList = new ArrayList(); + if (list.isEmpty()) { + return returnList; + } + //获取每个数组集合的元素个数 + Object[] co = list.get(0); + + //获取当前实体类的属性名、属性值、属性类别 + List attributeInfoList = getFiledsInfo(model); + //创建属性类别数组 + Class[] c2 = new Class[attributeInfoList.size()]; + //如果数组集合元素个数与实体类属性个数不一致则发生错误 + if (attributeInfoList.size() != co.length) { + return returnList; + } + //确定构造方法 + for (int i = 0; i < attributeInfoList.size(); i++) { + c2[i] = (Class) attributeInfoList.get(i).get("type"); + } + try { + for (Object[] o : list) { + Constructor constructor = clazz.getConstructor(c2); + returnList.add(constructor.newInstance(o)); + } + } catch (Exception ex) { + logger.error("实体数据转化为实体类发生异常:异常信息:{}", ex.getMessage()); + return returnList; + } + return returnList; + } + + /** + * 根据属性名获取属性值 + * @param fieldName 属性名 + * @param modle 实体类 + * @return 属性值 + */ + private static Object getFieldValueByName(String fieldName, Object modle) { + try { + String firstLetter = fieldName.substring(0, 1).toUpperCase(); + String getter = "get" + firstLetter + fieldName.substring(1); + Method method = modle.getClass().getMethod(getter, new Class[]{}); + Object value = method.invoke(modle, new Object[]{}); + return value; + } catch (Exception e) { + return null; + } + } + + /** + * 获取属性类型(type),属性名(name),属性值(value)的map组成的list + * @param model 实体类 + * @return list集合 + */ + private static List getFiledsInfo(Object model) { + Field[] fields = model.getClass().getDeclaredFields(); + List list = new ArrayList(fields.length); + Map infoMap = null; + for (int i = 0; i < fields.length; i++) { + infoMap = new HashMap(3); + infoMap.put("type", fields[i].getType()); + infoMap.put("name", fields[i].getName()); + infoMap.put("value", getFieldValueByName(fields[i].getName(), model)); + list.add(infoMap); + } + return list; + } +} diff --git a/src/main/java/com/xkrs/common/tool/TokenUtil.java b/src/main/java/com/xkrs/common/tool/TokenUtil.java new file mode 100644 index 0000000..0c4a642 --- /dev/null +++ b/src/main/java/com/xkrs/common/tool/TokenUtil.java @@ -0,0 +1,51 @@ +package com.xkrs.common.tool; + +import io.jsonwebtoken.Claims; +import io.jsonwebtoken.Jwts; +import io.jsonwebtoken.security.Keys; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.authority.AuthorityUtils; + +import javax.crypto.SecretKey; +import java.util.List; + +/** + * token工具 + * @author tajochen + */ +public class TokenUtil { + /** + * Token前缀 + */ + static public final String TOKEN_PREFIX = "Bearer"; + + static public final String SECRETKEY = "0Y9H364Q9Y908262F25LMXGIKIN5N858XM3674GWL2DD8X1DS4W6I722IRY8PS4XPNB6U30345" + + "HBVCUL94STG8C3Z53T7A09JJ100I56YE9894CI11PX9J71HIZ8L5Y2O504C4E2K8276425UA8734833F45K36878FXAG799QV9LXUJ" + + "OI3XA2046UPG8TB2OT84R5T6ZB127N9ZPJ7AJMC41JVHB2WK2B6H8NL45LZNAZ666KHZH3QUT65UX6F8"; + + static SecretKey key = Keys.hmacShaKeyFor(SECRETKEY.getBytes()); + + public static String getTokenUserName(String token) { + String userName = ""; + if (token != null) { + try { + // 解析 Token + Claims claims = Jwts.parserBuilder() + .setSigningKey(key).build() + // 去掉 Bearer + .parseClaimsJws(token.replace(TOKEN_PREFIX, "")) + .getBody(); + // 获取用户名 + userName = claims.getSubject(); + // 获取权限 + List authorities = AuthorityUtils.commaSeparatedStringToAuthorityList((String) claims.get("auths")); + } catch(Exception e) { + // the sub field was missing or did not have a 'jsmith' value + return null; + } + } else { + return null; + } + return userName; + } +} diff --git a/src/main/java/com/xkrs/controller/MemberProjectController.java b/src/main/java/com/xkrs/controller/MemberProjectController.java new file mode 100644 index 0000000..e775a47 --- /dev/null +++ b/src/main/java/com/xkrs/controller/MemberProjectController.java @@ -0,0 +1,131 @@ +package com.xkrs.controller; + +import com.xkrs.common.encapsulation.PromptMessageEnum; +import com.xkrs.common.tool.TokenUtil; +import com.xkrs.model.entity.SysUserEntity; +import com.xkrs.model.vo.MemberApplicationVo; +import com.xkrs.model.vo.MemberJoinVo; +import com.xkrs.service.MemberProjectService; +import com.xkrs.service.SysUserService; +import org.springframework.context.i18n.LocaleContextHolder; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject; + +/** + * @author XinYi Song + */ +@RestController +public class MemberProjectController { + + @Resource + private MemberProjectService memberProjectService; + + @Resource + private SysUserService sysUserService; + + + /** + * 成员进行加入和退出的操作 + * @param map + * @param token + * @return + */ + @PostMapping("/memberOperate") + @PreAuthorize("hasAnyAuthority('auth_administor','auth_general_user')") + public String memberOperate(@RequestBody Map map,@RequestHeader(value="Authorization") String token){ + String projectNumber = (String) map.get("projectNumber"); + String keepType = (String) map.get("keepType"); + if("1".equals(keepType)){ + String s = memberProjectService.memberJoin(projectNumber, token); + return s; + }else { + return memberProjectService.memberDropOut(projectNumber,token); + } + } + + /** + * 负责人对成员进行允许和拒绝的操作 + * @param map + * @param token + * @return + */ + @PostMapping("/memberOperateByPrincipal") + @PreAuthorize("hasAnyAuthority('auth_administor','auth_general_user')") + public String memberOperateByPrincipal(@RequestBody Map map,@RequestHeader(value="Authorization") String token){ + String projectNumber = (String) map.get("projectNumber"); + String keepType = (String) map.get("keepType"); + Integer userId = (Integer) map.get("userId"); + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 验证token + String tokenUserName = TokenUtil.getTokenUserName(token); + SysUserEntity sysUserByUserName = sysUserService.getSysUserByUserName(tokenUserName); + if(sysUserByUserName == null){ + return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); + } + if("1".equals(keepType)){ + memberProjectService.memberByAllow(projectNumber,userId); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"已允许加入",locale); + }else { + memberProjectService.memberByRefuse(projectNumber,userId); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"已拒绝加入",locale); + } + } + + /** + * 查询成员的加入申请 + * @param projectNumber + * @param token + * @return + */ + @GetMapping("/selectMemberApplication") + @PreAuthorize("hasAnyAuthority('auth_administor','auth_general_user')") + public String selectMemberApplication(@RequestParam("projectNumber") String projectNumber,@RequestHeader(value="Authorization") String token){ + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 验证token + String tokenUserName = TokenUtil.getTokenUserName(token); + SysUserEntity sysUserByUserName = sysUserService.getSysUserByUserName(tokenUserName); + if(sysUserByUserName == null){ + return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); + } + List memberApplicationVos = memberProjectService.selectMemberApplication(projectNumber); + if(memberApplicationVos == null || memberApplicationVos.size() == 0){ + return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没有任何加入的申请",locale); + } + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,memberApplicationVos,locale); + } + + /** + * 查询该项目加入的成员的信息 + * @param projectNumber + * @param token + * @return + */ + @GetMapping("/selectMemberJoin") + @PreAuthorize("hasAnyAuthority('auth_administor','auth_general_user')") + public String selectMemberJoin(@RequestParam("projectNumber") String projectNumber,@RequestHeader(value="Authorization") String token){ + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 验证token + String tokenUserName = TokenUtil.getTokenUserName(token); + SysUserEntity sysUserByUserName = sysUserService.getSysUserByUserName(tokenUserName); + if(sysUserByUserName == null){ + return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); + } + List memberJoinVos = memberProjectService.selectMemberJoin(projectNumber); + if(memberJoinVos == null || memberJoinVos.size() == 0){ + return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没有任何成员的信息",locale); + } + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,memberJoinVos,locale); + } + + +} diff --git a/src/main/java/com/xkrs/controller/ProjectOverviewController.java b/src/main/java/com/xkrs/controller/ProjectOverviewController.java new file mode 100644 index 0000000..4ce8cc1 --- /dev/null +++ b/src/main/java/com/xkrs/controller/ProjectOverviewController.java @@ -0,0 +1,166 @@ +package com.xkrs.controller; + +import com.xkrs.common.encapsulation.PromptMessageEnum; +import com.xkrs.common.tool.TokenUtil; +import com.xkrs.dao.ProjectOverviewDao; +import com.xkrs.model.entity.ProjectOverview; +import com.xkrs.model.entity.SysUserEntity; +import com.xkrs.model.qo.ProjectQo; +import com.xkrs.model.qo.ProjectUpdateQo; +import com.xkrs.service.ProjectOverviewService; +import com.xkrs.service.SysUserService; +import org.springframework.context.i18n.LocaleContextHolder; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject; + +/** + * @author XinYi Song + */ +@RestController +public class ProjectOverviewController { + + @Resource + private ProjectOverviewService projectOverviewService; + + @Resource + private SysUserService sysUserService; + + @Resource + private ProjectOverviewDao projectOverviewDao; + + /** + * 导入遥感的excel表 + * @param file + * @return + * @throws Exception + */ + @PostMapping("/importRsProjectExcel") + public String importRsProjectExcel(MultipartFile file) throws Exception { + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + projectOverviewService.importRsProjectExcel(file); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"导入成功",locale); + } + + /** + * 导入视觉的excel表 + * @param file + * @return + * @throws Exception + */ + @PostMapping("/importCvProjectExcel") + public String importCvProjectExcel(MultipartFile file) throws Exception { + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + projectOverviewService.importCvProjectExcel(file); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"导入成功",locale); + } + + /** + * 动态多条件查询项目的信息 + * @param projectNumber + * @param projectName + * @return + */ + @GetMapping("/selectProjectByDynamic") + @PreAuthorize("hasAnyAuthority('auth_administor','auth_general_user')") + public String selectProjectByDynamic(@RequestParam("projectNumber") String projectNumber,@RequestParam("projectName") String projectName,@RequestHeader(value="Authorization") String token){ + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 验证token + String tokenUserName = TokenUtil.getTokenUserName(token); + SysUserEntity sysUserByUserName = sysUserService.getSysUserByUserName(tokenUserName); + if(sysUserByUserName == null){ + return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); + } + List projectOverviews = projectOverviewService.selectProjectByDynamic(projectNumber, projectName); + if(projectOverviews == null || projectOverviews.size() == 0){ + return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没有项目信息",locale); + }else { + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,projectOverviews,locale); + } + } + + /** + * 新增项目 + * @param projectQo + * @param token + * @return + */ + @PostMapping("/insertProjectOverview") + @PreAuthorize("hasAnyAuthority('auth_administor')") + public String insertProjectOverview(@RequestBody ProjectQo projectQo,@RequestHeader(value="Authorization") String token){ + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 验证token + String tokenUserName = TokenUtil.getTokenUserName(token); + SysUserEntity sysUserByUserName = sysUserService.getSysUserByUserName(tokenUserName); + if(sysUserByUserName == null){ + return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); + } + ProjectOverview byProjectName = projectOverviewDao.findByProjectName(projectQo.getProjectName()); + if(byProjectName != null){ + return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"该项目已存在",locale); + } + ProjectOverview byProjectNumber = projectOverviewDao.findByProjectNumber(projectQo.getProjectNumber()); + if(byProjectNumber != null){ + return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"项目编号重复",locale); + } + ProjectOverview projectOverview = projectOverviewService.insertProjectOverview(projectQo); + if(projectOverview != null){ + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"添加成功",locale); + }else { + return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"添加失败",locale); + } + } + + /** + * 更改项目信息 + * @param projectUpdateQo + * @param token + */ + @PostMapping("/updateProjectOverview") + @PreAuthorize("hasAnyAuthority('auth_administor')") + public String updateProjectOverview(@RequestBody ProjectUpdateQo projectUpdateQo,@RequestHeader(value="Authorization") String token){ + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 验证token + String tokenUserName = TokenUtil.getTokenUserName(token); + SysUserEntity sysUserByUserName = sysUserService.getSysUserByUserName(tokenUserName); + if(sysUserByUserName == null){ + return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); + } + projectOverviewService.updateProjectOverview(projectUpdateQo); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"修改成功",locale); + } + + /** + * 根据项目编号删除项目 + * @param map + * @param token + * @return + */ + @PostMapping("/deleteByProjectNumber") + @PreAuthorize("hasAnyAuthority('auth_administor','auth_general_user')") + public String deleteByProjectNumber(@RequestBody Map map,@RequestHeader(value="Authorization") String token){ + String projectNumber = (String) map.get("projectNumber"); + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 验证token + String tokenUserName = TokenUtil.getTokenUserName(token); + SysUserEntity sysUserByUserName = sysUserService.getSysUserByUserName(tokenUserName); + if(sysUserByUserName == null){ + return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); + } + projectOverviewService.deleteByProjectNumber(projectNumber); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"删除成功",locale); + } +} diff --git a/src/main/java/com/xkrs/controller/ResponsibleProjectController.java b/src/main/java/com/xkrs/controller/ResponsibleProjectController.java new file mode 100644 index 0000000..12b1983 --- /dev/null +++ b/src/main/java/com/xkrs/controller/ResponsibleProjectController.java @@ -0,0 +1,180 @@ +package com.xkrs.controller; + +import com.xkrs.common.encapsulation.PromptMessageEnum; +import com.xkrs.common.tool.TokenUtil; +import com.xkrs.dao.ResponsibleProjectDao; +import com.xkrs.model.entity.ResponsibleProject; +import com.xkrs.model.entity.SysUserEntity; +import com.xkrs.model.vo.ApplicationProjectVo; +import com.xkrs.service.MemberProjectService; +import com.xkrs.service.ResponsibleProjectService; +import com.xkrs.service.SysUserService; +import org.springframework.context.i18n.LocaleContextHolder; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject; + +/** + * @author XinYi Song + */ +@RestController +public class ResponsibleProjectController { + + @Resource + private ResponsibleProjectService responsibleProjectService; + + @Resource + private SysUserService sysUserService; + + @Resource + private ResponsibleProjectDao responsibleProjectDao; + + @Resource + private MemberProjectService memberProjectService; + + /** + * 负责人对项目进行开始,重新开始,结束的操作 + * @param map + * @param token + * @return + */ + @PostMapping("/operateResponsible") + @PreAuthorize("hasAnyAuthority('auth_administor','auth_general_user')") + public String operateResponsible(@RequestBody Map map,@RequestHeader(value="Authorization") String token){ + String projectNumber = (String) map.get("projectNumber"); + String keepType = (String) map.get("keepType"); + if("1".equals(keepType)){ + return responsibleProjectService.operateResponsible(projectNumber,token); + }else if("2".equals(keepType)){ + return responsibleProjectService.operateReStart(projectNumber,token); + }else { + return responsibleProjectService.operateOver(projectNumber,token); + } + } + + /** + * 查看负责人申请该项目的信息 + * @param projectNumber + * @param token + * @return + */ + @PreAuthorize("hasAnyAuthority('auth_administor')") + @GetMapping("/selectApplicationInformation") + public String selectApplicationInformation(@RequestParam("projectNumber") String projectNumber,@RequestHeader(value="Authorization") String token){ + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 验证token + String tokenUserName = TokenUtil.getTokenUserName(token); + SysUserEntity sysUserByUserName = sysUserService.getSysUserByUserName(tokenUserName); + if(sysUserByUserName == null){ + return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); + } + ApplicationProjectVo applicationProjectVo = responsibleProjectService.selectApplicationInformation(projectNumber); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,applicationProjectVo,locale); + } + + /** + * 管理员对负责人的申请进行允许和拒绝的操作 + * @param map + * @param token + * @return + */ + @PreAuthorize("hasAnyAuthority('auth_administor')") + @PostMapping("/operateResponsibleApplication") + public String operateResponsibleApplication(@RequestBody Map map,@RequestHeader(value="Authorization") String token){ + String projectNumber = (String) map.get("projectNumber"); + String keepType = (String) map.get("keepType"); + Integer userId = (Integer) map.get("userId"); + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 验证token + String tokenUserName = TokenUtil.getTokenUserName(token); + SysUserEntity sysUserByUserName = sysUserService.getSysUserByUserName(tokenUserName); + if(sysUserByUserName == null){ + return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); + } + ResponsibleProject byResponsibleProjectNumber = responsibleProjectDao.findByResponsibleProjectNumber(projectNumber); + if("1".equals(keepType)){ + if("1".equals(byResponsibleProjectNumber.getAuditType())){ + return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"已经执行过该操作,请勿重复工作",locale); + } + responsibleProjectService.adminAllow(projectNumber,userId); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"已允许该申请通过",locale); + }else { + if("2".equals(byResponsibleProjectNumber.getAuditType())){ + return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"已经执行过该操作,请勿重复工作",locale); + } + responsibleProjectService.adminRefuse(projectNumber,userId); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"已拒绝该申请",locale); + } + } + + /** + * 负责人移除成员和移交权限的操作 + * @param map + * @param token + * @return + */ + @PostMapping("/removeOrTransferMember") + @PreAuthorize("hasAnyAuthority('auth_administor','auth_general_user')") + public String removeOrTransferMember(@RequestBody Map map,@RequestHeader(value="Authorization") String token){ + Integer memberId = (Integer) map.get("memberId"); + String projectNumber = (String) map.get("projectNumber"); + String keepType = (String) map.get("keepType"); + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 验证token + String tokenUserName = TokenUtil.getTokenUserName(token); + SysUserEntity sysUserByUserName = sysUserService.getSysUserByUserName(tokenUserName); + if(sysUserByUserName == null){ + return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); + } + ResponsibleProject projectNumber1 = responsibleProjectDao.findByPrincipalIdAndResponsibleProjectNumber(sysUserByUserName.getId(), projectNumber); + if(projectNumber1 == null){ + return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"您不是负责人,不能执行该操作",locale); + } + if("1".equals(keepType)){ + responsibleProjectService.removeMember(memberId,projectNumber); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"移除成功",locale); + }else { + responsibleProjectService.transferPermissions(memberId,projectNumber,sysUserByUserName.getId()); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"移交成功",locale); + } + } + + /** + * 查询当前用户管理,提交审核,参与的项目的编号 + * @param token + * @return + */ + @GetMapping("/selectManaAndParNumber") + @PreAuthorize("hasAnyAuthority('auth_administor','auth_general_user')") + public String selectManaAndParNumber(@RequestHeader(value="Authorization") String token){ + Map map = new HashMap(3); + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 验证token + String tokenUserName = TokenUtil.getTokenUserName(token); + SysUserEntity sysUserByUserName = sysUserService.getSysUserByUserName(tokenUserName); + if(sysUserByUserName == null){ + return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); + } + // 查询管理的项目的编号 + List strings = responsibleProjectService.selectProjectNumberByPrincipalId(sysUserByUserName.getId()); + map.put("manage",strings); + // 查询正在审核的项目的编号 + List strings1 = memberProjectService.selectProjectNumberByMemberIds(sysUserByUserName.getId()); + map.put("audit",strings1); + // 查询参与的项目的编号 + List strings2 = memberProjectService.selectProjectNumberByMemberId(sysUserByUserName.getId()); + map.put("participate",strings2); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,map,locale); + } +} diff --git a/src/main/java/com/xkrs/controller/SysManageController.java b/src/main/java/com/xkrs/controller/SysManageController.java new file mode 100644 index 0000000..08c1164 --- /dev/null +++ b/src/main/java/com/xkrs/controller/SysManageController.java @@ -0,0 +1,57 @@ +package com.xkrs.controller; + +import com.xkrs.common.encapsulation.PromptMessageEnum; +import nl.basjes.parse.useragent.UserAgent; +import nl.basjes.parse.useragent.UserAgentAnalyzer; +import org.springframework.context.i18n.LocaleContextHolder; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import java.util.Locale; + +import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject; + +/** + * 系统管理测试服务 + * @author tajochen + */ +@RestController +@RequestMapping(value = "/api") +public class SysManageController { + + @RequestMapping(value="/hello/role",method = RequestMethod.GET) + @PreAuthorize("hasAnyRole('role_administor','role_system_manager')") + public String hello() { + //获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"hello vip",locale); + } + + @RequestMapping(value="/hello/auth",method = RequestMethod.GET) + @PreAuthorize("hasAnyAuthority('auth_system_manager','auth_general_user')") + public String world() { + //获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"world",locale); + } + + @RequestMapping(value="/greeting",method = RequestMethod.GET) + public String greeting(@RequestParam(required=false, defaultValue="World") String name, + @RequestHeader(value="User-Agent") String userAgent) { + //获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + System.out.println("==== in greeting ===="); + System.out.println(userAgent); + UserAgentAnalyzer uaa = UserAgentAnalyzer + .newBuilder() + .hideMatcherLoadStats() + .withCache(10000) + .build(); + + UserAgent agent = uaa.parse(userAgent); + for (String fieldName: agent.getAvailableFieldNamesSorted()) { + System.out.println(fieldName + " = " + agent.getValue(fieldName)); + } + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,name,locale); + } +} diff --git a/src/main/java/com/xkrs/controller/SysUserController.java b/src/main/java/com/xkrs/controller/SysUserController.java new file mode 100644 index 0000000..ba8c094 --- /dev/null +++ b/src/main/java/com/xkrs/controller/SysUserController.java @@ -0,0 +1,243 @@ +package com.xkrs.controller; + +import com.xkrs.common.encapsulation.PromptMessageEnum; +import com.xkrs.common.tool.TokenUtil; +import com.xkrs.dao.SysUserDao; +import com.xkrs.model.entity.SysUserEntity; +import com.xkrs.model.qo.SysUserQo; +import com.xkrs.model.validation.SysUserQoInsert; +import com.xkrs.model.validation.SysUserQoUpdate; +import com.xkrs.model.vo.SysUserVo; +import com.xkrs.service.SysUserService; +import org.springframework.context.i18n.LocaleContextHolder; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.BindingResult; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationErrorList; +import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject; + +/** + * 系统用户Controller + * @author tajocehn + */ +@RestController +@RequestMapping(value = "/api/user") +public class SysUserController { + + @Resource + private SysUserService sysUserService; + + @Resource + private SysUserDao sysUserDao; + + /** + * 登录用户Token验证 + * @return + */ + @RequestMapping(value = "/logged/check",method = RequestMethod.POST) + public String loginUserTokenCheck(){ + Locale locale = LocaleContextHolder.getLocale(); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"",locale); + } + + @RequestMapping(value = "/check/duplicate", method = RequestMethod.POST) + public String checkDuplicate(@RequestParam(value="userName", required=false) String userName){ + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 验证用户名是否重复 + if(!sysUserService.checkUserName(userName)){ + return outputEncapsulationObject(PromptMessageEnum.PARAM_ILLEGAL,"",locale); + } + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"OK",locale); + } + + + @RequestMapping(value = "/add", method = RequestMethod.POST) + public String addUser(@Validated({SysUserQoInsert.class}) @RequestBody SysUserQo userQo, + BindingResult bindingResult){ + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 验证数据合法性 + if(bindingResult.hasErrors()){ + return outputEncapsulationErrorList(bindingResult.getFieldErrors(),locale); + } + // 验证用户名是否重复 + if(!sysUserService.checkUserName(userQo.getUserName())){ + return outputEncapsulationObject(PromptMessageEnum.PARAM_ILLEGAL,"该账号已经注册,请勿重复注册",locale); + } + // 添加新用户 + sysUserService.addUser(userQo); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"OK",locale); + } + + + /*@RequestMapping(value="/get/all", method = RequestMethod.GET) + @PreAuthorize("hasAnyAuthority('auth_system_manager','auth_administor')") + public String getAllSysUser(){ + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + Iterable sysUserDtoList = sysUserService.getAllSysUser(); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,sysUserDtoList,locale); + }*/ + + /** + * 软删除指定id的普通用户 + * @param id + * @return + */ + @RequestMapping(value = "/general/delete", method = RequestMethod.DELETE) + @PreAuthorize("hasAnyAuthority('auth_system_manager','auth_general_user')") + public String deleteCustomUser(@RequestParam(value="userId", required=false) int id){ + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 验证数据合法性 + int res = sysUserService.softDeleteGeneralUser(id); + if(res==1){ + return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"",locale); + } else { + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"",locale); + } + } + + @RequestMapping(value = "/update", method = RequestMethod.POST) + @PreAuthorize("hasAnyAuthority('auth_system_manager','auth_administor')") + public String updateUser(@Validated({SysUserQoUpdate.class}) @RequestBody SysUserQo userQo, + BindingResult bindingResult){ + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 验证数据合法性 + if(bindingResult.hasErrors()){ + return outputEncapsulationErrorList(bindingResult.getFieldErrors(),locale); + } + // 修改用户 + sysUserService.updateSysUser(userQo); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"OK",locale); + } + + /** + * 判断用户名是否存在 + * @param userName + * @return + */ + @GetMapping("/booleanUserName") + public String booleanUserName(@RequestParam("userName") String userName){ + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + Map map = new HashMap(3); + SysUserEntity sysUserEntity = sysUserDao.selectByUserName(userName); + if(sysUserEntity == null){ + map.put("status",0); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,map,locale); + }else { + map.put("status",1); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,map,locale); + } + } + + /** + * 查看用户信息 + * @return + */ + @GetMapping("/selectAllUser") + @PreAuthorize("hasAnyAuthority('auth_administor')") + public String selectAllUser(@RequestHeader(value="Authorization") String token){ + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 验证token + String tokenUserName = TokenUtil.getTokenUserName(token); + SysUserEntity sysUserEntity = sysUserDao.selectByUserName(tokenUserName); + if(sysUserEntity == null){ + return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); + } + List sysUserVos = sysUserService.selectAllUser(); + if(sysUserVos == null || sysUserVos.size() == 0){ + return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没有任何用户数据",locale); + } + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,sysUserVos,locale); + } + + /** + * 管理员进行启用禁用的操作 + * @param map + * @param token + * @return + */ + @PostMapping("/operateActiveFlag") + @PreAuthorize("hasAnyAuthority('auth_administor')") + public String operateActiveFlag(@RequestBody Map map,@RequestHeader(value="Authorization") String token){ + Integer userId = (Integer) map.get("userId"); + String keepType = (String) map.get("keepType"); + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 验证token + String tokenUserName = TokenUtil.getTokenUserName(token); + SysUserEntity sysUserEntity = sysUserDao.selectByUserName(tokenUserName); + if(sysUserEntity == null){ + return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); + } + // 如果keepType等于1进行启用操作 + if("1".equals(keepType)){ + sysUserService.updateEnable(userId); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"启用成功",locale); + }else { + sysUserService.updateDisable(userId); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"禁用成功",locale); + } + } + + /** + * 用户修改密码 + * @param map + * @param token + * @return + */ + @PostMapping("/updatePassword") + @PreAuthorize("hasAnyAuthority('auth_administor','auth_general_user')") + public String updatePassword(@RequestBody Map map,@RequestHeader(value="Authorization") String token){ + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + String oldPassword = (String) map.get("oldPassword"); + String newPassword = (String) map.get("newPassword"); + String confirmPassword = (String) map.get("confirmPassword"); + // 验证token + String tokenUserName = TokenUtil.getTokenUserName(token); + SysUserEntity sysUserEntity = sysUserDao.selectByUserName(tokenUserName); + if(sysUserEntity == null){ + return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); + } + return sysUserService.updatePassword(oldPassword,newPassword,confirmPassword,sysUserEntity); + } + + /** + * 管理员修改用户的密码 + * @param map + * @param token + * @return + */ + @PostMapping("/adminUpdatePassword") + @PreAuthorize("hasAnyAuthority('auth_administor')") + public String adminUpdatePassword(@RequestBody Map map,@RequestHeader(value="Authorization") String token){ + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 要修改的用户的id + Integer userId = (Integer) map.get("userId"); + String newPassword = (String) map.get("newPassword"); + String confirmPassword = (String) map.get("confirmPassword"); + // 验证token + String tokenUserName = TokenUtil.getTokenUserName(token); + SysUserEntity sysUserEntity = sysUserDao.selectByUserName(tokenUserName); + if(sysUserEntity == null){ + return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); + } + return sysUserService.adminUpdatePassword(userId,newPassword,confirmPassword); + } + +} diff --git a/src/main/java/com/xkrs/controller/WorkHourRecordController.java b/src/main/java/com/xkrs/controller/WorkHourRecordController.java new file mode 100644 index 0000000..9581391 --- /dev/null +++ b/src/main/java/com/xkrs/controller/WorkHourRecordController.java @@ -0,0 +1,226 @@ +package com.xkrs.controller; + +import com.xkrs.common.encapsulation.PromptMessageEnum; +import com.xkrs.common.tool.TokenUtil; +import com.xkrs.dao.SysUserDao; +import com.xkrs.dao.WorkHourRecordDao; +import com.xkrs.model.entity.SysUserEntity; +import com.xkrs.model.entity.WorkHourRecord; +import com.xkrs.model.qo.WorkRecordQo; +import com.xkrs.model.vo.MemberWorkRecordVo; +import com.xkrs.model.vo.OutMemberVo; +import com.xkrs.service.WorkHourRecordService; +import org.springframework.context.i18n.LocaleContextHolder; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject; + +/** + * @author XinYi Song + */ +@RestController +public class WorkHourRecordController { + + @Resource + private WorkHourRecordService workHourRecordService; + + @Resource + private SysUserDao sysUserDao; + + @Resource + private WorkHourRecordDao workHourRecordDao; + + /** + * 提交工作记录 + * @param workRecordQo + * @param token + * @return + */ + @PostMapping("/submitWorkContent") + @PreAuthorize("hasAnyAuthority('auth_administor','auth_general_user')") + public String submitWorkContent(@RequestBody WorkRecordQo workRecordQo, @RequestHeader(value="Authorization") String token){ + return workHourRecordService.submitWorkContent(workRecordQo, token); + } + + /** + * 查询我参与的 + * @param token + * @return + */ + @GetMapping("/selectMemberWorkRecord") + @PreAuthorize("hasAnyAuthority('auth_administor','auth_general_user')") + public String selectMemberWorkRecord(@RequestHeader(value="Authorization") String token){ + List list = new ArrayList(); + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 验证token + String tokenUserName = TokenUtil.getTokenUserName(token); + SysUserEntity sysUserEntity = sysUserDao.selectByUserName(tokenUserName); + if(sysUserEntity == null){ + return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); + } + List memberWorkRecordVos = workHourRecordService.selectMemberWorkRecord(sysUserEntity.getId()); + + list.add(memberWorkRecordVos); + List memberWorkRecordVos1 = workHourRecordService.selectMemberAndParWorkRecord(sysUserEntity.getId()); + list.add(memberWorkRecordVos1); + if(list.size() == 0){ + return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没有任何数据",locale); + } + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,list,locale); + } + + /** + * 查询我管理的项目 + * @param token + * @return + */ + @GetMapping("/selectManagementProject") + @PreAuthorize("hasAnyAuthority('auth_administor','auth_general_user')") + public String selectManagementProject(@RequestHeader(value="Authorization") String token) throws Exception { + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 验证token + String tokenUserName = TokenUtil.getTokenUserName(token); + SysUserEntity sysUserEntity = sysUserDao.selectByUserName(tokenUserName); + if(sysUserEntity == null){ + return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); + } + List managementProjectVos = workHourRecordService.selectManagementProject(sysUserEntity.getId()); + if(managementProjectVos == null || managementProjectVos.size() == 0){ + return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没有任何数据",locale); + } + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,managementProjectVos,locale); + } + + /** + * 查询我参与的当前项目的提交的工时记录 + * @param projectNumber + * @param token + * @return + */ + @GetMapping("/findRecord") + @PreAuthorize("hasAnyAuthority('auth_administor','auth_general_user')") + public String findRecord(@RequestParam("projectNumber") String projectNumber,@RequestHeader(value="Authorization") String token){ + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 验证token + String tokenUserName = TokenUtil.getTokenUserName(token); + SysUserEntity sysUserEntity = sysUserDao.selectByUserName(tokenUserName); + List workHourRecords = workHourRecordService.findRecord(projectNumber, sysUserEntity.getId()); + if(workHourRecords == null || workHourRecords.size() == 0){ + return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没有该项目的工时记录",locale); + } + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,workHourRecords,locale); + } + + /** + * 修改工时记录 + * @param map + * @return + */ + @PostMapping("/updateRecord") + @PreAuthorize("hasAnyAuthority('auth_administor','auth_general_user')") + public String updateRecord(@RequestBody Map map,@RequestHeader(value="Authorization") String token){ + String workContent = (String) map.get("workContent"); + Integer id = (Integer) map.get("id"); + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + String tokenUserName = TokenUtil.getTokenUserName(token); + SysUserEntity sysUserEntity = sysUserDao.selectByUserName(tokenUserName); + if(sysUserEntity == null){ + return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); + } + workHourRecordService.updateRecord(workContent,id); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"修改成功",locale); + } + + /** + * 删除记录 + * @param map + * @return + */ + @PostMapping("/deleteRecord") + @PreAuthorize("hasAnyAuthority('auth_administor','auth_general_user')") + public String deleteRecord(@RequestBody Map map,@RequestHeader(value="Authorization") String token){ + Integer id = (Integer) map.get("id"); + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + String tokenUserName = TokenUtil.getTokenUserName(token); + SysUserEntity sysUserEntity = sysUserDao.selectByUserName(tokenUserName); + if(sysUserEntity == null){ + return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); + } + workHourRecordService.deleteById(id); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"删除成功",locale); + } + + /** + * 导出excel表 + * @param projectNumber + * @param response + * @throws IOException + */ + @GetMapping("/excelOutWork") + public void selectWork(@RequestParam("projectNumber") String projectNumber, HttpServletResponse response) throws IOException{ + workHourRecordService.selectWork(projectNumber,response); + } + + /** + * 查询该项目的成员和工时 + * @return + */ + @GetMapping("/selectMemberAndWorkHour") + public String selectMemberAndWorkHour(@RequestParam("projectNumber") String projectNumber){ + Locale locale = LocaleContextHolder.getLocale(); + List outMemberVos = workHourRecordDao.selectMember(projectNumber); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,outMemberVos,locale); + } + + /** + * 管理员查看成员的项目信息和工时 + * @param userId + * @param token + * @return + */ + @GetMapping("/selectProjectNameAndHour") + @PreAuthorize("hasAnyAuthority('auth_administor')") + public String selectProjectNameAndHour(@RequestParam("userId") Integer userId,@RequestHeader(value="Authorization") String token){ + Locale locale = LocaleContextHolder.getLocale(); + List> maps = workHourRecordDao.selectProjectNameAndHour(userId); + if(maps == null || maps.size() == 0){ + return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时没有该成员的项目信息",locale); + } + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,maps,locale); + } + + /** + * 查询负责人和成员的项目起止时间,时长用于甘特图 + * @param projectNumber + * @param token + * @return + */ + @GetMapping("/selectProjectByGanttChart") + @PreAuthorize("hasAnyAuthority('auth_administor','auth_general_user')") + public String selectProjectByGanttChart(@RequestParam("projectNumber") String projectNumber,@RequestHeader(value="Authorization") String token){ + Locale locale = LocaleContextHolder.getLocale(); + List list = new ArrayList(); + List> maps = workHourRecordDao.selectWorkHourPar(projectNumber); + list.add(maps); + List> maps1 = workHourRecordDao.selectWorkHourMember(projectNumber); + list.add(maps1); + if(list.size() == 0){ + return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没有任何数据",locale); + } + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,list,locale); + } +} diff --git a/src/main/java/com/xkrs/dao/MemberProjectDao.java b/src/main/java/com/xkrs/dao/MemberProjectDao.java new file mode 100644 index 0000000..967318a --- /dev/null +++ b/src/main/java/com/xkrs/dao/MemberProjectDao.java @@ -0,0 +1,94 @@ +package com.xkrs.dao; + +import com.xkrs.model.entity.MemberProject; +import com.xkrs.model.vo.MemberApplicationVo; +import com.xkrs.model.vo.MemberJoinVo; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @author XinYi Song + */ +@Component +public interface MemberProjectDao extends JpaRepository, JpaSpecificationExecutor { + + /** + * 修改成员加入该项目的时间 + * @param joinTime + * @param projectNumber + */ + @Query(value = "update member_project set join_time = ?1 where member_project_number = ?2",nativeQuery = true) + @Modifying(clearAutomatically=true) + void updateJoinTime(String joinTime,String projectNumber); + + /** + * 修改成员的申请状态 + * @param applicationType + * @param projectNumber + */ + @Query(value = "update member_project set application_type = ?1 where member_project_number = ?2",nativeQuery = true) + @Modifying(clearAutomatically=true) + void updateApplicationType(String applicationType,String projectNumber); + + /** + * 根据用户id和项目编号查询信息 + * @param userId + * @param projectNumber + * @param applicationType + * @return + */ + MemberProject findByMemberIdAndMemberProjectNumberAndApplicationType(Integer userId,String projectNumber,String applicationType); + + /** + * 根据用户id和项目编号删除该条信息 + * @param userId + * @param projectNumber + */ + @Modifying(clearAutomatically=true) + void deleteByMemberIdAndMemberProjectNumber(Integer userId,String projectNumber); + + /** + * 查询成员的加入申请 + * @param projectNumber + * @return + */ + @Query(value = "select new com.xkrs.model.vo.MemberApplicationVo (mp.memberId,su.reallyName,mp.applicationTime,mp.applicationType) " + + "from SysUserEntity su,MemberProject mp where mp.memberId = su.id and mp.memberProjectNumber = :projectNumber") + List selectMemberApplication(@Param("projectNumber") String projectNumber); + + /** + * 查询加入的成员的信息 + * @param projectNumber + * @return + */ + @Query(value = "select new com.xkrs.model.vo.MemberJoinVo (mp.memberId,su.reallyName,mp.joinTime) " + + "from SysUserEntity su,MemberProject mp where mp.memberId = su.id and mp.applicationType = '1' " + + "and mp.memberProjectNumber = :projectNumber") + List selectMemberJoin(@Param("projectNumber") String projectNumber); + + /** + * 根据项目id修改用户id + * @param userId + * @param projectNumber + * @param memberId + */ + @Query(value = "update member_project set member_id = ?1 where member_project_number = ?2 and member_id = ?3",nativeQuery = true) + @Modifying(clearAutomatically=true) + void updateMemberIdByProjectNumber(Integer userId,String projectNumber,Integer memberId); + + /** + * 查询参与的项目的编号 + * @param userId + * @param applicationType + * @return + */ + @Query(value = "select member_project_number from member_project where member_id = ?1 and application_type = ?2",nativeQuery = true) + List selectProjectNumberByMemberId(Integer userId,String applicationType); + +} diff --git a/src/main/java/com/xkrs/dao/ProjectOverviewDao.java b/src/main/java/com/xkrs/dao/ProjectOverviewDao.java new file mode 100644 index 0000000..7d51ee3 --- /dev/null +++ b/src/main/java/com/xkrs/dao/ProjectOverviewDao.java @@ -0,0 +1,45 @@ +package com.xkrs.dao; + +import com.xkrs.model.entity.ProjectOverview; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Component; + +/** + * @author XinYi Song + */ +@Component +public interface ProjectOverviewDao extends JpaRepository, JpaSpecificationExecutor { + + /** + * 修改项目的状态 + * @param projectStatus + * @param projectNumber + */ + @Query(value = "update project_overview set project_status = ?1 where project_number = ?2",nativeQuery = true) + @Modifying(clearAutomatically=true) + void updateProjectStatus(String projectStatus,String projectNumber); + + /** + * 根据项目编号查询项目的信息 + * @param projectNumber + * @return + */ + ProjectOverview findByProjectNumber(String projectNumber); + + /** + * 根据项目名称查询项目信息 + * @param projectName + * @return + */ + ProjectOverview findByProjectName(String projectName); + + /** + * 根据项目编号删除项目 + * @param projectNumber + */ + @Modifying(clearAutomatically=true) + void deleteByProjectNumber(String projectNumber); +} diff --git a/src/main/java/com/xkrs/dao/RelRoleAuthorityDao.java b/src/main/java/com/xkrs/dao/RelRoleAuthorityDao.java new file mode 100644 index 0000000..087c926 --- /dev/null +++ b/src/main/java/com/xkrs/dao/RelRoleAuthorityDao.java @@ -0,0 +1,22 @@ +package com.xkrs.dao; + +import com.xkrs.model.entity.RelRoleAuthorityEntity; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; + +import java.util.List; + +/** + * @author XinYi Song + */ +public interface RelRoleAuthorityDao extends JpaRepository { + + /** + * 根据userId查询出权限的id + * @param userId + * @return + */ + @Query(value = "select authority_id from rel_role_authority where user_id = ?",nativeQuery = true) + List selectAuthorityByUserId(@Param("userId") Integer userId); +} diff --git a/src/main/java/com/xkrs/dao/RelUserRoleDao.java b/src/main/java/com/xkrs/dao/RelUserRoleDao.java new file mode 100644 index 0000000..ebd8e96 --- /dev/null +++ b/src/main/java/com/xkrs/dao/RelUserRoleDao.java @@ -0,0 +1,10 @@ +package com.xkrs.dao; + +import com.xkrs.model.entity.RelUserRoleEntity; +import org.springframework.data.jpa.repository.JpaRepository; + +/** + * @author XinYi Song + */ +public interface RelUserRoleDao extends JpaRepository { +} diff --git a/src/main/java/com/xkrs/dao/ResponsibleProjectDao.java b/src/main/java/com/xkrs/dao/ResponsibleProjectDao.java new file mode 100644 index 0000000..5f593be --- /dev/null +++ b/src/main/java/com/xkrs/dao/ResponsibleProjectDao.java @@ -0,0 +1,80 @@ +package com.xkrs.dao; + +import com.xkrs.model.entity.ResponsibleProject; +import com.xkrs.model.vo.ApplicationProjectVo; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @author XinYi Song + */ +@Component +public interface ResponsibleProjectDao extends JpaRepository, JpaSpecificationExecutor { + + /** + * 修改审核状态 + * @param auditType + * @param projectNumber + */ + @Query(value = "update responsible_project set audit_type = ?1 where responsible_project_number = ?2",nativeQuery = true) + @Modifying(clearAutomatically=true) + void updateAuditType(String auditType,String projectNumber); + + /** + * 修改项目的开始时间 + * @param startTime + * @param projectNumber + */ + @Query(value = "update responsible_project set start_time = ?1 where responsible_project_number = ?2",nativeQuery = true) + @Modifying(clearAutomatically=true) + void updateStartTime(String startTime,String projectNumber); + + /** + * 修改项目负责人的id + * @param userId + * @param projectNumber + */ + @Query(value = "update responsible_project set principal_id = ?1 where responsible_project_number = ?2",nativeQuery = true) + @Modifying(clearAutomatically=true) + void updatePrincipalIdByProjectNumber(Integer userId,String projectNumber); + + /** + * 根据用户id和项目编号查询改天信息 + * @param userId + * @param projectNumber + * @return + */ + ResponsibleProject findByPrincipalIdAndResponsibleProjectNumber(Integer userId,String projectNumber); + + /** + * 根据项目编号查询项目 + * @param responsibleProjectNumber + * @return + */ + ResponsibleProject findByResponsibleProjectNumber(String responsibleProjectNumber); + + /** + * 查询负责人申请时的相关信息 + * @param projectNumber + * @return + */ + @Query(value = "select new com.xkrs.model.vo.ApplicationProjectVo (po.projectNumber,po.projectName,su.reallyName,rp.applicationTime,rp.principalId) " + + "from SysUserEntity su,ResponsibleProject rp,ProjectOverview po where rp.responsibleProjectNumber = po.projectNumber " + + "and rp.principalId = su.id and rp.responsibleProjectNumber = :projectNumber") + ApplicationProjectVo selectApplicationInformation(@Param("projectNumber") String projectNumber); + + /** + * 查询管理的项目的编号 + * @param userId + * @param auditType + * @return + */ + @Query(value = "select responsible_project_number from responsible_project where principal_id = ?1 and audit_type = ?2",nativeQuery = true) + List selectProjectNumberByPrincipalId(Integer userId,String auditType); +} diff --git a/src/main/java/com/xkrs/dao/SysAuthorityDao.java b/src/main/java/com/xkrs/dao/SysAuthorityDao.java new file mode 100644 index 0000000..34bcc6d --- /dev/null +++ b/src/main/java/com/xkrs/dao/SysAuthorityDao.java @@ -0,0 +1,32 @@ +package com.xkrs.dao; + +import com.xkrs.model.entity.SysAuthorityEntity; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; + +import java.util.List; + +/** + * SysAuthorityDao + * @author tajochen + */ +public interface SysAuthorityDao extends JpaRepository { + /** + * 查询权限实体列表根据用户名 Object[] + * @param userName 用户名 + * @return 用户实体 + */ + @Query(value = "SELECT a.id, a.authority_name, a.authority_name_zh, a.authority_desc " + + "FROM sys_authority a,rel_role_authority ra,sys_role r WHERE r.id = ra.role_id AND ra.authority_id = a.id AND r.id " + + "IN (SELECT r.id FROM sys_user u,sys_role r,rel_user_role ur " + + " WHERE u.user_name = :userName AND u.id = ur.user_id AND ur.role_id = r.id)", nativeQuery = true) + List selectByUserName(@Param("userName") String userName); + + /** + * 根据id批量查询权限信息 + * @param id + * @return + */ + List findAllByIdIn(List id); +} diff --git a/src/main/java/com/xkrs/dao/SysRoleDao.java b/src/main/java/com/xkrs/dao/SysRoleDao.java new file mode 100644 index 0000000..04e704d --- /dev/null +++ b/src/main/java/com/xkrs/dao/SysRoleDao.java @@ -0,0 +1,60 @@ +package com.xkrs.dao; + +import com.xkrs.model.entity.SysRoleEntity; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; + +import java.util.List; + +/** + * SysRoleDao + * @author tajochen + */ +public interface SysRoleDao extends JpaRepository { + + /** + * 查询用户角色列表根据用户id + * @param id + * @return + */ + @Query(value = "SELECT sys_role.id,sys_role.role_name,sys_role.role_name_zh,sys_role.role_desc " + + "FROM sys_role,rel_user_role " + + "WHERE sys_role.id = rel_user_role.role_id " + + "AND rel_user_role.user_id = :id ", nativeQuery = true) + List selectByUserId(@Param("id") Integer id); + + /** + * 查询用户角色列表根据用户名 + * @param userName + * @return + */ + @Query(value = "SELECT sys_role.id,sys_role.role_name,sys_role.role_name_zh,sys_role.role_desc " + + "FROM sys_role.ID = rel_user_role.role_id " + + "WHERE rel_user_role.user_id = sys_user.id " + + "AND rel_user_role.user_id = sys_user.id " + + "AND sys_user.user_name = :userName ", nativeQuery = true) + List selectByUserName(@Param("userName") String userName); + + +// /** +// * 根据用户名修改用户角色 +// */ +// @Modifying +// @Query(value = "UPDATE sys_user SET last_entry_time = now(), last_entry_ip = :ipAddress " + +// "WHERE user_name = :userName ;", nativeQuery = true) +// int updateUserRoleByUserName(@Param("userName") String userName); + + /** + * 添加用户角色根据用户名和角色名 + * @param userName + * @param roleName + * @return + */ + @Modifying + @Query(value = "INSERT INTO rel_user_role (id,role_id, user_id) " + + "SELECT nextval('rel_user_role_seq'),sys_role.ID,sys_user.ID FROM sys_role,sys_user " + + "WHERE sys_role.role_name = :roleName AND sys_user.user_name = :userName ", nativeQuery = true) + int insertRelUserRole(@Param("userName") String userName, @Param("roleName") String roleName); +} diff --git a/src/main/java/com/xkrs/dao/SysUserDao.java b/src/main/java/com/xkrs/dao/SysUserDao.java new file mode 100644 index 0000000..8f91591 --- /dev/null +++ b/src/main/java/com/xkrs/dao/SysUserDao.java @@ -0,0 +1,130 @@ +package com.xkrs.dao; + +import com.xkrs.model.entity.SysUserEntity; +import com.xkrs.model.vo.SysUserVo; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; + +import java.util.List; + +/** + * SysUserDao + * @author tajochen + */ +public interface SysUserDao extends JpaRepository { + + /** + * 检查系统用户名是否存在 + * @param userName + * @return + */ + @Query(value = "SELECT COUNT(*) FROM sys_user WHERE user_name = :userName", nativeQuery = true) + int checkUserName(@Param("userName") String userName); + + /** + * 查找用户实体根据用户名 + * @param userName + * @return + */ + @Query(value = "SELECT * FROM sys_user WHERE user_name = :userName", nativeQuery = true) + SysUserEntity selectByUserName(@Param("userName") String userName); + + /** + * 根据用户名查询用户信息 + * @param userName + * @return + */ + SysUserEntity findByUserName(String userName); + + /** + * 更新用户登录信息 + * @param userName + * @param ipAddress + * @return + */ + @Modifying + @Query(value = "UPDATE sys_user SET last_entry_time = now(), last_entry_ip = :ipAddress " + + "WHERE user_name = :userName ;", nativeQuery = true) + int updateSysUserLogin(@Param("userName") String userName, @Param("ipAddress") String ipAddress); + + /** + * 软删除系统用户根据用户名 + * @param userName + * @return + */ + @Modifying + @Query(value = "UPDATE sys_user SET delete_flag = 1 " + + "WHERE user_name = :userName ;", nativeQuery = true) + int softDeleteSysUserByUserName(@Param("userName") String userName); + + /** + * 软删除系统用户根据id + * @param id + * @return + */ + @Modifying + @Query(value = "UPDATE sys_user SET delete_flag = 1 " + + "WHERE id = :id ;", nativeQuery = true) + int softDeleteGeneralUserById(@Param("id") Integer id); + + /** + * 删除系统用户(危险操作!) + * @param userName + * @return + */ + @Modifying + @Query(value = "DELETE FROM sys_user WHERE user_name = :userName ;", nativeQuery = true) + int deleteSysUser(@Param("userName") String userName); + + /** + * 查询用户信息 + * @return + */ + @Query(value = "select new com.xkrs.model.vo.SysUserVo (id,reallyName,telephone,userDepartment,activeFlag,addTime) " + + "from SysUserEntity") + List selectAll(); + + /** + * 根据用户名查询实体信息 + * @param userName + * @return + */ + @Query(value = "select new com.xkrs.model.vo.SysUserVo (id,reallyName,telephone,userDepartment,activeFlag,addTime) " + + "from SysUserEntity where userName = :userName") + SysUserVo selectUserByUserName(String userName); + + /** + * 启用 + * @param userId + */ + @Query(value = "update sys_user set active_flag = 0 where id = ?",nativeQuery = true) + @Modifying(clearAutomatically=true) + void updateEnable(Integer userId); + + /** + * 禁用 + * @param userId + */ + @Query(value = "update sys_user set active_flag = 1 where id = ?",nativeQuery = true) + @Modifying(clearAutomatically=true) + void updateDisable(Integer userId); + + /** + * 用户修改密码 + * @param userId + * @param newPassword + */ + @Query(value = "update sys_user set password = ?2 where id = ?1",nativeQuery = true) + @Modifying(clearAutomatically=true) + void updatePassword(Integer userId,String newPassword); + + /** + * 根据id查询用户的信息 + * @param userId + * @return + */ + @Query(value = "select * from sys_user where id = ?",nativeQuery = true) + SysUserEntity selectByUserId(Integer userId); +} diff --git a/src/main/java/com/xkrs/dao/WorkHourRecordDao.java b/src/main/java/com/xkrs/dao/WorkHourRecordDao.java new file mode 100644 index 0000000..7d4df83 --- /dev/null +++ b/src/main/java/com/xkrs/dao/WorkHourRecordDao.java @@ -0,0 +1,141 @@ +package com.xkrs.dao; + +import com.xkrs.model.entity.WorkHourRecord; +import com.xkrs.model.vo.MemberWorkRecordVo; +import com.xkrs.model.vo.OutExcelVo; +import com.xkrs.model.vo.OutMemberVo; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Map; + +/** + * @author XinYi Song + */ +@Component +public interface WorkHourRecordDao extends JpaRepository { + + /** + * 查询我参与的 + * @param userId + * @return + */ + @Query(value = "select new com.xkrs.model.vo.MemberWorkRecordVo " + + "(po.projectNumber,po.projectName,po.projectStage,po.projectStatus,sum(whr.workHour)) " + + "from WorkHourRecord whr,ProjectOverview po,MemberProject mp " + + "where po.projectNumber = mp.memberProjectNumber and whr.projectNumber = mp.memberProjectNumber " + + "and whr.userId = mp.memberId and mp.applicationType = '1' and mp.memberId = :userId " + + "group by po.projectNumber,po.projectName,po.projectStage,po.projectStatus") + List selectMemberWorkRecord(@Param("userId") Integer userId); + + /** + * 负责人管理的项目(参与的) + * @param userId + * @return + */ + @Query(value = "select new com.xkrs.model.vo.MemberWorkRecordVo " + + "(po.projectNumber,po.projectName,po.projectStage,po.projectStatus,sum(whr.workHour)) " + + "from WorkHourRecord whr,ProjectOverview po,ResponsibleProject rp " + + "where po.projectNumber = rp.responsibleProjectNumber and whr.projectNumber = rp.responsibleProjectNumber " + + "and whr.userId = rp.principalId and rp.auditType = '1' and rp.principalId = :userId " + + "group by po.projectNumber,po.projectName,po.projectStage,po.projectStatus") + List selectMemberAndParWorkRecord(@Param("userId") Integer userId); + + + /** + * 查询我管理的项目 + * @param userId + * @return + */ + @Query(value = "select po.project_number projectNumber,po.project_name projectName,po.project_stage projectStage,po.project_status projectStatus,(select count(mp.*)+1 from member_project mp where mp.member_project_number = po.project_number and mp.application_type = '1') as peopleNum,sum(whr.work_hour) as workHour " + + "from work_hour_record whr,project_overview po,responsible_project rp " + + "where po.project_number = rp.responsible_project_number " + + "and whr.project_number = rp.responsible_project_number " + + "and rp.audit_type = '1' " + + "and rp.principal_id = :userId " + + "group by po.project_number,po.project_name,po.project_stage,po.project_status",nativeQuery = true) + List selectManagementProject(@Param("userId") Integer userId); + + /** + * 查询我参与的当前项目的提交的工时记录 + * @param projectNumber + * @param userId + * @return + */ + @Query(value = "select * from work_hour_record where project_number = :projectNumber and user_id = :userId and color != '1'",nativeQuery = true) + List findRecord(@Param("projectNumber") String projectNumber,@Param("userId") Integer userId); + + /** + * 修改工时记录 + * @param workContent + * @param submitTime + * @param id + */ + @Query(value = "update work_hour_record set work_content = ?1,submit_time = ?2 where id = ?3",nativeQuery = true) + @Modifying(clearAutomatically=true) + void updateRecord(String workContent,String submitTime,Integer id); + + /** + * 删除记录 + * @param id + */ + @Modifying(clearAutomatically=true) + void deleteById(Integer id); + + /** + * 用于导出excel表格 + * @param projectNumber + * @return + */ + @Query(value = "select new com.xkrs.model.vo.OutExcelVo (po.projectNumber,po.projectName,po.projectStage,sum(whr.workHour)) " + + "from WorkHourRecord whr,ProjectOverview po where whr.projectNumber = po.projectNumber " + + "and po.projectNumber = :projectNumber group by po.projectNumber,po.projectName,po.projectStage") + OutExcelVo selectWork(@Param("projectNumber") String projectNumber); + + /** + * 查询人员 + * @param projectNumber + * @return + */ + @Query(value = "select new com.xkrs.model.vo.OutMemberVo (su.reallyName,su.userDepartment,sum(whr.workHour)) from WorkHourRecord whr,SysUserEntity su where su.id = whr.userId and whr.projectNumber = :projectNumber group by su.reallyName,su.userDepartment") + List selectMember(@Param("projectNumber") String projectNumber); + + /** + * 查询个人参加的项目和工时 + * @param userId + * @return + */ + @Query(value = "select po.project_name projectname,po.project_number projectnumber,sum(whr.work_hour) as workhour " + + "from project_overview po,work_hour_record whr " + + "where po.project_number = whr.project_number and whr.user_id = :userId " + + "GROUP BY po.project_name,po.project_number",nativeQuery = true) + List> selectProjectNameAndHour(@Param("userId") Integer userId); + + /** + * 查询每个负责人在该项目中的时长,起止时间用于甘特图 + * @param projectNumber + * @return + */ + @Query(value = "select su.really_name reallyname,rp.start_time starttime,sum(whr.work_hour) as workhour," + + "(select submit_time from work_hour_record where user_id = rp.principal_id " + + "ORDER BY submit_time DESC limit 1) as lasttime from sys_user su,responsible_project rp,work_hour_record whr " + + "where whr.project_number = rp.responsible_project_number AND whr.user_id = rp.principal_id " + + "and su.id = rp.principal_id AND rp.audit_type = '1' AND rp.responsible_project_number = :projectNumber " + + "GROUP BY su.really_name,rp.start_time,lasttime",nativeQuery = true) + List> selectWorkHourPar(@Param("projectNumber") String projectNumber); + + /** + * 查询每个成员在该项目中的时长和起止时间用于甘特图 + * @param projectNumber + * @return + */ + @Query(value = "select su.really_name reallyname,mp.join_time starttime,sum(whr.work_hour) as workhour," + + "(select submit_time from work_hour_record where user_id = mp.member_id " + + "ORDER BY submit_time DESC limit 1) as lasttime from sys_user su,member_project mp,work_hour_record whr " + + "where whr.project_number = mp.member_project_number AND whr.user_id = mp.member_id AND su.id = mp.member_id AND mp.application_type = '1' AND mp.member_project_number = :projectNumber GROUP BY su.really_name,mp.join_time,lasttime",nativeQuery = true) + List> selectWorkHourMember(@Param("projectNumber") String projectNumber); +} diff --git a/src/main/java/com/xkrs/model/entity/MemberProject.java b/src/main/java/com/xkrs/model/entity/MemberProject.java new file mode 100644 index 0000000..50dbf25 --- /dev/null +++ b/src/main/java/com/xkrs/model/entity/MemberProject.java @@ -0,0 +1,121 @@ +package com.xkrs.model.entity; + +import javax.persistence.*; +import java.io.Serializable; + +/** + * @author XinYi Song + * 成员和项目的中间表 + */ +@Entity +@Table(name="member_project") +public class MemberProject implements Serializable { + /** + * 指定主键,建立自增序列,主键值取自序列 + */ + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "member_project_seq_gen") + @SequenceGenerator(name = "member_project_seq_gen", sequenceName = "member_project_id_seq",allocationSize = 1) + private Integer id; + + /** + * 成员的id + */ + private Integer memberId; + + /** + * 项目编号 + */ + @Column(length = 32,columnDefinition = "varchar(32)") + private String memberProjectNumber; + + /** + * 申请时间 + */ + @Column(length = 65,columnDefinition = "varchar(65)") + private String applicationTime; + + /** + * 加入时间 + */ + @Column(length = 65,columnDefinition = "varchar(65)") + private String joinTime; + + /** + * 申请的状态 + */ + @Column(length = 32,columnDefinition = "varchar(32)") + private String applicationType; + + public MemberProject() { + } + + public MemberProject(Integer id, Integer memberId, String memberProjectNumber, String applicationTime, String joinTime, String applicationType) { + this.id = id; + this.memberId = memberId; + this.memberProjectNumber = memberProjectNumber; + this.applicationTime = applicationTime; + this.joinTime = joinTime; + this.applicationType = applicationType; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getMemberId() { + return memberId; + } + + public void setMemberId(Integer memberId) { + this.memberId = memberId; + } + + public String getMemberProjectNumber() { + return memberProjectNumber; + } + + public void setMemberProjectNumber(String memberProjectNumber) { + this.memberProjectNumber = memberProjectNumber; + } + + public String getApplicationTime() { + return applicationTime; + } + + public void setApplicationTime(String applicationTime) { + this.applicationTime = applicationTime; + } + + public String getJoinTime() { + return joinTime; + } + + public void setJoinTime(String joinTime) { + this.joinTime = joinTime; + } + + public String getApplicationType() { + return applicationType; + } + + public void setApplicationType(String applicationType) { + this.applicationType = applicationType; + } + + @Override + public String toString() { + return "MemberProject{" + + "id=" + id + + ", memberId=" + memberId + + ", memberProjectNumber='" + memberProjectNumber + '\'' + + ", applicationTime='" + applicationTime + '\'' + + ", joinTime='" + joinTime + '\'' + + ", applicationType='" + applicationType + '\'' + + '}'; + } +} diff --git a/src/main/java/com/xkrs/model/entity/ProjectOverview.java b/src/main/java/com/xkrs/model/entity/ProjectOverview.java new file mode 100644 index 0000000..9de9613 --- /dev/null +++ b/src/main/java/com/xkrs/model/entity/ProjectOverview.java @@ -0,0 +1,185 @@ +package com.xkrs.model.entity; + +import javax.persistence.*; +import java.io.Serializable; + +/** + * @author XinYi Song + * 项目总览 + */ +@Entity +@Table(name="project_overview") +public class ProjectOverview implements Serializable { + /** + * 指定主键,建立自增序列,主键值取自序列 + */ + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "project_overview_seq_gen") + @SequenceGenerator(name = "project_overview_seq_gen", sequenceName = "project_overview_id_seq",allocationSize = 1) + private Integer id; + + /** + * 项目编号 + */ + @Column(length = 32,columnDefinition = "varchar(32)") + private String projectNumber; + + /** + * 项目名称 + */ + private String projectName; + + /** + * 项目类型(遥感 视觉) + */ + @Column(length = 32,columnDefinition = "varchar(32)") + private String projectType; + + /** + * 项目阶段(A-前期交流;B-实施中;C-已完结;D-未赢取) + */ + @Column(length = 32,columnDefinition = "varchar(32)") + private String projectStage; + + /** + * 甲方 + */ + @Column(length = 85, columnDefinition = "varchar(85)") + private String party; + + /** + * 市场 + */ + @Column(length = 32,columnDefinition = "varchar(32)") + private String projectMarket; + + /** + * 售前 + */ + @Column(length = 32,columnDefinition = "varchar(32)") + private String projectSale; + + /** + * 项目经理 + */ + @Column(length = 32,columnDefinition = "varchar(32)") + private String projectManager; + + /** + * 项目填报状态 0 未开始 1 填报中 2已结束 3正在审核 + */ + @Column(length = 32,columnDefinition = "varchar(32)") + private String projectStatus; + + public ProjectOverview() { + } + + public ProjectOverview(Integer id, String projectNumber, String projectName, String projectType, String projectStage, String party, String projectMarket, String projectSale, String projectManager, String projectStatus) { + this.id = id; + this.projectNumber = projectNumber; + this.projectName = projectName; + this.projectType = projectType; + this.projectStage = projectStage; + this.party = party; + this.projectMarket = projectMarket; + this.projectSale = projectSale; + this.projectManager = projectManager; + this.projectStatus = projectStatus; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getProjectNumber() { + return projectNumber; + } + + public void setProjectNumber(String projectNumber) { + this.projectNumber = projectNumber; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + public String getProjectType() { + return projectType; + } + + public void setProjectType(String projectType) { + this.projectType = projectType; + } + + public String getProjectStage() { + return projectStage; + } + + public void setProjectStage(String projectStage) { + this.projectStage = projectStage; + } + + public String getParty() { + return party; + } + + public void setParty(String party) { + this.party = party; + } + + public String getProjectMarket() { + return projectMarket; + } + + public void setProjectMarket(String projectMarket) { + this.projectMarket = projectMarket; + } + + public String getProjectSale() { + return projectSale; + } + + public void setProjectSale(String projectSale) { + this.projectSale = projectSale; + } + + public String getProjectManager() { + return projectManager; + } + + public void setProjectManager(String projectManager) { + this.projectManager = projectManager; + } + + public String getProjectStatus() { + return projectStatus; + } + + public void setProjectStatus(String projectStatus) { + this.projectStatus = projectStatus; + } + + @Override + public String toString() { + return "ProjectOverview{" + + "id=" + id + + ", projectNumber='" + projectNumber + '\'' + + ", projectName='" + projectName + '\'' + + ", projectType='" + projectType + '\'' + + ", projectStage='" + projectStage + '\'' + + ", party='" + party + '\'' + + ", projectMarket='" + projectMarket + '\'' + + ", projectSale='" + projectSale + '\'' + + ", projectManager='" + projectManager + '\'' + + ", projectStatus='" + projectStatus + '\'' + + '}'; + } +} diff --git a/src/main/java/com/xkrs/model/entity/RelRoleAuthorityEntity.java b/src/main/java/com/xkrs/model/entity/RelRoleAuthorityEntity.java new file mode 100644 index 0000000..24121c1 --- /dev/null +++ b/src/main/java/com/xkrs/model/entity/RelRoleAuthorityEntity.java @@ -0,0 +1,71 @@ +package com.xkrs.model.entity; + +import javax.persistence.*; +import java.io.Serializable; + +/** + * RelRoleAuthority 表实体类 + * @author tajochen + */ +@Entity +@Table(name="rel_role_authority") +public class RelRoleAuthorityEntity implements Serializable { + + /** + * 指定主键,建立自增序列,主键值取自序列 + */ + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "rel_role_authority_seq_gen") + @SequenceGenerator(name = "rel_role_authority_seq_gen", sequenceName = "rel_role_authority_id_seq",allocationSize = 1) + private Integer id; + + @Column(nullable = false) + private Integer roleId; + + @Column(nullable = false) + private Integer authorityId; + + private Integer userId; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getRoleId() { + return roleId; + } + + public void setRoleId(Integer roleId) { + this.roleId = roleId; + } + + public Integer getAuthorityId() { + return authorityId; + } + + public void setAuthorityId(Integer authorityId) { + this.authorityId = authorityId; + } + + public Integer getUserId() { + return userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + + @Override + public String toString() { + return "RelRoleAuthorityEntity{" + + "id=" + id + + ", roleId=" + roleId + + ", authorityId=" + authorityId + + ", userId=" + userId + + '}'; + } +} diff --git a/src/main/java/com/xkrs/model/entity/RelUserRoleEntity.java b/src/main/java/com/xkrs/model/entity/RelUserRoleEntity.java new file mode 100644 index 0000000..2f77c81 --- /dev/null +++ b/src/main/java/com/xkrs/model/entity/RelUserRoleEntity.java @@ -0,0 +1,60 @@ +package com.xkrs.model.entity; + +import javax.persistence.*; +import java.io.Serializable; + +/** + * RelUserRole 表实体类 + * @author tajochen + */ +@Entity +@Table(name="rel_user_role") +public class RelUserRoleEntity implements Serializable { + + /** + * 指定主键,建立自增序列,主键值取自序列 + */ + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "rel_user_role_seq_gen") + @SequenceGenerator(name = "rel_user_role_seq_gen", sequenceName = "rel_user_role_id_seq",allocationSize = 1) + private Integer id; + + @Column(nullable = false) + private Long userId; + + @Column(nullable = false) + private Integer roleId; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Integer getRoleId() { + return roleId; + } + + public void setRoleId(Integer roleId) { + this.roleId = roleId; + } + + @Override + public String toString() { + return "RelUserRoleEntity{" + + "id=" + id + + ", userId=" + userId + + ", roleId=" + roleId + + '}'; + } +} diff --git a/src/main/java/com/xkrs/model/entity/ResponsibleProject.java b/src/main/java/com/xkrs/model/entity/ResponsibleProject.java new file mode 100644 index 0000000..e808afa --- /dev/null +++ b/src/main/java/com/xkrs/model/entity/ResponsibleProject.java @@ -0,0 +1,121 @@ +package com.xkrs.model.entity; + +import javax.persistence.*; +import java.io.Serializable; + +/** + * @author XinYi Song + *项目和负责人的中间表 + */ +@Entity +@Table(name="responsible_project") +public class ResponsibleProject implements Serializable { + /** + * 指定主键,建立自增序列,主键值取自序列 + */ + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "responsible_project_seq_gen") + @SequenceGenerator(name = "responsible_project_seq_gen", sequenceName = "responsible_project_id_seq",allocationSize = 1) + private Integer id; + + /** + * 负责人的id + */ + private Integer principalId; + + /** + * 项目编号 + */ + @Column(length = 32,columnDefinition = "varchar(32)") + private String responsibleProjectNumber; + + /** + * 项目申请的时间 + */ + @Column(length = 65,columnDefinition = "varchar(65)") + private String applicationTime; + + /** + * 项目开始的时间 + */ + @Column(length = 65,columnDefinition = "varchar(65)") + private String startTime; + + /** + * 审核状态 + */ + @Column(length = 32,columnDefinition = "varchar(32)") + private String auditType; + + public ResponsibleProject() { + } + + public ResponsibleProject(Integer id, Integer principalId, String responsibleProjectNumber, String applicationTime, String startTime, String auditType) { + this.id = id; + this.principalId = principalId; + this.responsibleProjectNumber = responsibleProjectNumber; + this.applicationTime = applicationTime; + this.startTime = startTime; + this.auditType = auditType; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getPrincipalId() { + return principalId; + } + + public void setPrincipalId(Integer principalId) { + this.principalId = principalId; + } + + public String getResponsibleProjectNumber() { + return responsibleProjectNumber; + } + + public void setResponsibleProjectNumber(String responsibleProjectNumber) { + this.responsibleProjectNumber = responsibleProjectNumber; + } + + public String getApplicationTime() { + return applicationTime; + } + + public void setApplicationTime(String applicationTime) { + this.applicationTime = applicationTime; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getAuditType() { + return auditType; + } + + public void setAuditType(String auditType) { + this.auditType = auditType; + } + + @Override + public String toString() { + return "ResponsibleProject{" + + "id=" + id + + ", principalId=" + principalId + + ", responsibleProjectNumber='" + responsibleProjectNumber + '\'' + + ", applicationTime='" + applicationTime + '\'' + + ", startTime='" + startTime + '\'' + + ", auditType='" + auditType + '\'' + + '}'; + } +} diff --git a/src/main/java/com/xkrs/model/entity/SysAuthorityEntity.java b/src/main/java/com/xkrs/model/entity/SysAuthorityEntity.java new file mode 100644 index 0000000..080d0f6 --- /dev/null +++ b/src/main/java/com/xkrs/model/entity/SysAuthorityEntity.java @@ -0,0 +1,72 @@ +package com.xkrs.model.entity; + +import javax.persistence.*; +import java.io.Serializable; + +/** + * SysAuthority 表实体类 + * @author tajochen + */ +@Entity +@Table(name="sys_authority") +public class SysAuthorityEntity implements Serializable { + + /** + * 指定主键,建立自增序列,主键值取自序列 + */ + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sys_authority_seq_gen") + @SequenceGenerator(name = "sys_authority_seq_gen", sequenceName = "sys_authority_id_seq",allocationSize = 1) + private Integer id; + + @Column(length = 64, nullable = false, unique = true,columnDefinition = "varchar(64)") + private String authorityName; + + @Column(length = 64, columnDefinition = "varchar(64)") + private String authorityNameZh; + + @Column(length = 128, columnDefinition = "varchar(128)") + private String authorityDesc; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getAuthorityName() { + return authorityName; + } + + public void setAuthorityName(String authorityName) { + this.authorityName = authorityName == null ? null : authorityName.trim(); + } + + public String getAuthorityNameZh() { + return authorityNameZh; + } + + public void setAuthorityNameZh(String authorityNameZh) { + this.authorityNameZh = authorityNameZh == null ? null : authorityNameZh.trim(); + } + + public String getAuthorityDesc() { + return authorityDesc; + } + + public void setAuthorityDesc(String authorityDesc) { + this.authorityDesc = authorityDesc == null ? null : authorityDesc.trim(); + } + + @Override + public String toString() { + return "SysAuthorityEntity{" + + "id=" + id + + ", authorityName='" + authorityName + '\'' + + ", authorityDesc='" + authorityDesc + '\'' + + ", authorityNameZh='" + authorityNameZh + '\'' + + '}'; + } +} diff --git a/src/main/java/com/xkrs/model/entity/SysRoleEntity.java b/src/main/java/com/xkrs/model/entity/SysRoleEntity.java new file mode 100644 index 0000000..32bd4c5 --- /dev/null +++ b/src/main/java/com/xkrs/model/entity/SysRoleEntity.java @@ -0,0 +1,72 @@ +package com.xkrs.model.entity; + +import javax.persistence.*; +import java.io.Serializable; + +/** + * SysRole 表实体类 + * @author tajochen + */ +@Entity +@Table(name="sys_role") +public class SysRoleEntity implements Serializable { + + /** + * 指定主键,建立自增序列,主键值取自序列 + */ + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sys_role_seq_gen") + @SequenceGenerator(name = "sys_role_seq_gen", sequenceName = "sys_role_id_seq",allocationSize = 1) + private Integer id; + + @Column(length = 32, nullable = false, unique = true,columnDefinition = "varchar(32)") + private String roleName; + + @Column(length = 32, columnDefinition = "varchar(32)") + private String roleNameZh; + + @Column(length = 64, columnDefinition = "varchar(64)") + private String roleDesc; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getRoleName() { + return roleName; + } + + public void setRoleName(String roleName) { + this.roleName = roleName == null ? null : roleName.trim(); + } + + public String getRoleDesc() { + return roleDesc; + } + + public void setRoleDesc(String roleDesc) { + this.roleDesc = roleDesc == null ? null : roleDesc.trim(); + } + + public String getRoleNameZh() { + return roleNameZh; + } + + public void setRoleNameZh(String roleNameZh) { + this.roleNameZh = roleNameZh == null ? null : roleNameZh.trim(); + } + + @Override + public String toString() { + return "SysRoleEntity{" + + "id=" + id + + ", roleName='" + roleName + '\'' + + ", roleNameZh='" + roleNameZh + '\'' + + ", roleDesc='" + roleDesc + '\'' + + '}'; + } +} diff --git a/src/main/java/com/xkrs/model/entity/SysUserEntity.java b/src/main/java/com/xkrs/model/entity/SysUserEntity.java new file mode 100644 index 0000000..fd02d3c --- /dev/null +++ b/src/main/java/com/xkrs/model/entity/SysUserEntity.java @@ -0,0 +1,205 @@ +package com.xkrs.model.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; + + +/** + * SysUser 表实体类 + * @author tajochen + */ +@Entity +@Table(name="sys_user") +public class SysUserEntity implements Serializable { + + /** + * 指定主键,建立自增序列,主键值取自序列 + */ + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sys_user_seq_gen") + @SequenceGenerator(name = "sys_user_seq_gen", sequenceName = "sys_user_id_seq",allocationSize = 1) + private Integer id; + + /** + * 用户名 + */ + @Column(length = 16, nullable = false, unique = true, columnDefinition = "varchar(16)") + private String userName; + + /** + * 用户真实姓名 + */ + @Column(length = 32, columnDefinition = "varchar(32)") + private String reallyName; + + /** + * 密码 + */ + @Column(length = 64, nullable = false, columnDefinition = "varchar(64)") + private String password; + + @Column(length = 32, nullable = false, columnDefinition = "varchar(32)") + private String salt; + + @Column(length = 16, unique = true, columnDefinition = "varchar(16)") + private String telephone; + + /** + * 所在部门 + */ + @Column(length = 32, columnDefinition = "varchar(32)") + private String userDepartment; + + @Column(columnDefinition = "varchar(192)") + private String signature; + + @Column(nullable = false) + private Integer activeFlag; + + @Column(nullable = false,columnDefinition = "smallint") + private Integer statusCode; + + @Column(nullable = false) + private LocalDateTime addTime; + + private LocalDateTime lastEntryTime; + + @Column(nullable = false) + private Integer deleteFlag; + + @Column(columnDefinition = "varchar(64)") + private String lastEntryIp; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getReallyName() { + return reallyName; + } + + public void setReallyName(String reallyName) { + this.reallyName = reallyName; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getSalt() { + return salt; + } + + public void setSalt(String salt) { + this.salt = salt; + } + + public String getTelephone() { + return telephone; + } + + public void setTelephone(String telephone) { + this.telephone = telephone; + } + + public String getUserDepartment() { + return userDepartment; + } + + public void setUserDepartment(String userDepartment) { + this.userDepartment = userDepartment; + } + + public String getSignature() { + return signature; + } + + public void setSignature(String signature) { + this.signature = signature; + } + + public Integer getActiveFlag() { + return activeFlag; + } + + public void setActiveFlag(Integer activeFlag) { + this.activeFlag = activeFlag; + } + + public Integer getStatusCode() { + return statusCode; + } + + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public LocalDateTime getAddTime() { + return addTime; + } + + public void setAddTime(LocalDateTime addTime) { + this.addTime = addTime; + } + + public LocalDateTime getLastEntryTime() { + return lastEntryTime; + } + + public void setLastEntryTime(LocalDateTime lastEntryTime) { + this.lastEntryTime = lastEntryTime; + } + + public Integer getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(Integer deleteFlag) { + this.deleteFlag = deleteFlag; + } + + public String getLastEntryIp() { + return lastEntryIp; + } + + public void setLastEntryIp(String lastEntryIp) { + this.lastEntryIp = lastEntryIp; + } + + @Override + public String toString() { + return "SysUserEntity{" + + "id=" + id + + ", userName='" + userName + '\'' + + ", reallyName='" + reallyName + '\'' + + ", password='" + password + '\'' + + ", salt='" + salt + '\'' + + ", telephone='" + telephone + '\'' + + ", userDepartment='" + userDepartment + '\'' + + ", signature='" + signature + '\'' + + ", activeFlag=" + activeFlag + + ", statusCode=" + statusCode + + ", addTime=" + addTime + + ", lastEntryTime=" + lastEntryTime + + ", deleteFlag=" + deleteFlag + + ", lastEntryIp='" + lastEntryIp + '\'' + + '}'; + } +} diff --git a/src/main/java/com/xkrs/model/entity/WorkHourRecord.java b/src/main/java/com/xkrs/model/entity/WorkHourRecord.java new file mode 100644 index 0000000..2c45df3 --- /dev/null +++ b/src/main/java/com/xkrs/model/entity/WorkHourRecord.java @@ -0,0 +1,126 @@ +package com.xkrs.model.entity; + +import javax.persistence.*; +import java.io.Serializable; + +/** + * @author XinYi Song + * 工时记录 + */ +@Entity +@Table(name="work_hour_record") +public class WorkHourRecord implements Serializable { + /** + * 指定主键,建立自增序列,主键值取自序列 + */ + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "work_hour_record_seq_gen") + @SequenceGenerator(name = "work_hour_record_seq_gen", sequenceName = "work_hour_record_id_seq",allocationSize = 1) + private Integer id; + + /** + * 工作内容 + */ + @Column(length = 500,columnDefinition = "varchar(500)") + private String workContent; + + /** + * 工作时长 + */ + private Integer workHour; + + /** + * 颜色 + */ + @Column(length = 85,columnDefinition = "varchar(85)") + private String color; + + /** + * 用户id + */ + private Integer userId; + + /** + * 项目编号 + */ + @Column(length = 32,columnDefinition = "varchar(32)") + private String projectNumber; + + /** + * 提交的时间 + */ + @Column(length = 65,columnDefinition = "varchar(65)") + private String submitTime; + + public WorkHourRecord() { + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getWorkContent() { + return workContent; + } + + public void setWorkContent(String workContent) { + this.workContent = workContent; + } + + public Integer getWorkHour() { + return workHour; + } + + public void setWorkHour(Integer workHour) { + this.workHour = workHour; + } + + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + public Integer getUserId() { + return userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + + public String getProjectNumber() { + return projectNumber; + } + + public void setProjectNumber(String projectNumber) { + this.projectNumber = projectNumber; + } + + public String getSubmitTime() { + return submitTime; + } + + public void setSubmitTime(String submitTime) { + this.submitTime = submitTime; + } + + @Override + public String toString() { + return "WorkHourRecord{" + + "id=" + id + + ", workContent='" + workContent + '\'' + + ", workHour=" + workHour + + ", color='" + color + '\'' + + ", userId=" + userId + + ", projectNumber='" + projectNumber + '\'' + + ", submitTime='" + submitTime + '\'' + + '}'; + } +} diff --git a/src/main/java/com/xkrs/model/qo/ProjectQo.java b/src/main/java/com/xkrs/model/qo/ProjectQo.java new file mode 100644 index 0000000..9868198 --- /dev/null +++ b/src/main/java/com/xkrs/model/qo/ProjectQo.java @@ -0,0 +1,140 @@ +package com.xkrs.model.qo; + +import java.io.Serializable; + +/** + * @author XinYi Song + */ +public class ProjectQo implements Serializable { + /** + * 项目编号 + */ + private String projectNumber; + + /** + * 项目名称 + */ + private String projectName; + + /** + * 项目类型(遥感 视觉) + */ + private String projectType; + + /** + * 项目阶段(A-前期交流;B-实施中;C-已完结;D-未赢取) + */ + private String projectStage; + + /** + * 甲方 + */ + private String party; + + /** + * 市场 + */ + private String projectMarket; + + /** + * 售前 + */ + private String projectSale; + + /** + * 项目经理 + */ + private String projectManager; + + public ProjectQo() { + } + + public ProjectQo(String projectNumber, String projectName, String projectType, String projectStage, String party, String projectMarket, String projectSale, String projectManager) { + this.projectNumber = projectNumber; + this.projectName = projectName; + this.projectType = projectType; + this.projectStage = projectStage; + this.party = party; + this.projectMarket = projectMarket; + this.projectSale = projectSale; + this.projectManager = projectManager; + } + + public String getProjectNumber() { + return projectNumber; + } + + public void setProjectNumber(String projectNumber) { + this.projectNumber = projectNumber; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + public String getProjectType() { + return projectType; + } + + public void setProjectType(String projectType) { + this.projectType = projectType; + } + + public String getProjectStage() { + return projectStage; + } + + public void setProjectStage(String projectStage) { + this.projectStage = projectStage; + } + + public String getParty() { + return party; + } + + public void setParty(String party) { + this.party = party; + } + + public String getProjectMarket() { + return projectMarket; + } + + public void setProjectMarket(String projectMarket) { + this.projectMarket = projectMarket; + } + + public String getProjectSale() { + return projectSale; + } + + public void setProjectSale(String projectSale) { + this.projectSale = projectSale; + } + + public String getProjectManager() { + return projectManager; + } + + public void setProjectManager(String projectManager) { + this.projectManager = projectManager; + } + + @Override + public String toString() { + return "ProjectQo{" + + "projectNumber='" + projectNumber + '\'' + + ", projectName='" + projectName + '\'' + + ", projectType='" + projectType + '\'' + + ", projectStage='" + projectStage + '\'' + + ", party='" + party + '\'' + + ", projectMarket='" + projectMarket + '\'' + + ", projectSale='" + projectSale + '\'' + + ", projectManager='" + projectManager + '\'' + + '}'; + } +} diff --git a/src/main/java/com/xkrs/model/qo/ProjectUpdateQo.java b/src/main/java/com/xkrs/model/qo/ProjectUpdateQo.java new file mode 100644 index 0000000..12a7337 --- /dev/null +++ b/src/main/java/com/xkrs/model/qo/ProjectUpdateQo.java @@ -0,0 +1,168 @@ +package com.xkrs.model.qo; + +import java.io.Serializable; + +/** + * @author XinYi Song + */ +public class ProjectUpdateQo implements Serializable { + + private Integer id; + + /** + * 项目编号 + */ + private String projectNumber; + + /** + * 项目名称 + */ + private String projectName; + + /** + * 甲方 + */ + private String party; + + /** + * 项目类型(遥感 视觉) + */ + private String projectType; + + /** + * 项目阶段(A-前期交流;B-实施中;C-已完结;D-未赢取) + */ + private String projectStage; + + /** + * 市场 + */ + private String projectMarket; + + /** + * 售前 + */ + private String projectSale; + + /** + * 项目经理 + */ + private String projectManager; + + /** + * 项目填报状态 + */ + private String projectStatus; + + public ProjectUpdateQo() { + } + + public ProjectUpdateQo(Integer id, String projectNumber, String projectName, String party, String projectType, String projectStage, String projectMarket, String projectSale, String projectManager, String projectStatus) { + this.id = id; + this.projectNumber = projectNumber; + this.projectName = projectName; + this.party = party; + this.projectType = projectType; + this.projectStage = projectStage; + this.projectMarket = projectMarket; + this.projectSale = projectSale; + this.projectManager = projectManager; + this.projectStatus = projectStatus; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getProjectNumber() { + return projectNumber; + } + + public void setProjectNumber(String projectNumber) { + this.projectNumber = projectNumber; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + public String getParty() { + return party; + } + + public void setParty(String party) { + this.party = party; + } + + public String getProjectType() { + return projectType; + } + + public void setProjectType(String projectType) { + this.projectType = projectType; + } + + public String getProjectStage() { + return projectStage; + } + + public void setProjectStage(String projectStage) { + this.projectStage = projectStage; + } + + public String getProjectMarket() { + return projectMarket; + } + + public void setProjectMarket(String projectMarket) { + this.projectMarket = projectMarket; + } + + public String getProjectSale() { + return projectSale; + } + + public void setProjectSale(String projectSale) { + this.projectSale = projectSale; + } + + public String getProjectManager() { + return projectManager; + } + + public void setProjectManager(String projectManager) { + this.projectManager = projectManager; + } + + public String getProjectStatus() { + return projectStatus; + } + + public void setProjectStatus(String projectStatus) { + this.projectStatus = projectStatus; + } + + @Override + public String toString() { + return "ProjectUpdateQo{" + + "id=" + id + + ", projectNumber='" + projectNumber + '\'' + + ", projectName='" + projectName + '\'' + + ", party='" + party + '\'' + + ", projectType='" + projectType + '\'' + + ", projectStage='" + projectStage + '\'' + + ", projectMarket='" + projectMarket + '\'' + + ", projectSale='" + projectSale + '\'' + + ", projectManager='" + projectManager + '\'' + + ", projectStatus='" + projectStatus + '\'' + + '}'; + } +} diff --git a/src/main/java/com/xkrs/model/qo/SysUserQo.java b/src/main/java/com/xkrs/model/qo/SysUserQo.java new file mode 100644 index 0000000..9d16aea --- /dev/null +++ b/src/main/java/com/xkrs/model/qo/SysUserQo.java @@ -0,0 +1,138 @@ +package com.xkrs.model.qo; + +import com.xkrs.model.validation.SysUserQoInsert; +import com.xkrs.model.validation.SysUserQoUpdate; +import org.hibernate.validator.constraints.Range; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; +import javax.validation.constraints.Size; + +/** + * SysUserQo + * @author tajochen + */ +public class SysUserQo { + + @NotNull( message = "{SysUser.id.blank}",groups={SysUserQoUpdate.class}) + private Integer id; + + @NotBlank(message = "{SysUser.userName.blank}",groups={SysUserQoInsert.class}) + @Size(min = 4,max = 16, message = "{SysUser.userName.length.illegal}",groups = {SysUserQoInsert.class, + SysUserQoUpdate.class}) + /** + * regexp = "^([A-Za-z0-9_]+)$" + */ + @Pattern(regexp = "^(13[0-9]|14[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9])\\d{8}$",message = "{SysUser.userName.format.illegal}",groups = {SysUserQoInsert.class, + SysUserQoUpdate.class}) + private String userName; + + @Size(max = 32, message = "{SysUser.nickName.length.illegal}",groups = {SysUserQoInsert.class, + SysUserQoUpdate.class}) + private String reallyName; + + @NotBlank(message = "{SysUser.password.blank}",groups = {SysUserQoInsert.class}) + @Size(min = 6,max = 16, message = "{SysUser.password.length.illegal}",groups = {SysUserQoInsert.class, + SysUserQoUpdate.class}) + @Pattern(regexp = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$",message = "{SysUser.password.format.illegal}", + groups = {SysUserQoInsert.class,SysUserQoUpdate.class}) + private String password; + + @Pattern(regexp = "^(13[0-9]|14[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9])\\d{8}$", + message = "{SysUser.telephone.format.illegal}",groups = {SysUserQoInsert.class,SysUserQoUpdate.class}) + private String telephone; + + @NotNull(message = "{SysUser.statusCode.illegal}",groups={SysUserQoUpdate.class}) + @Range(min=0,max=2,message = "{SysUser.statusCode.illegal}",groups = {SysUserQoInsert.class, SysUserQoUpdate.class}) + private Integer statusCode; + + private String userDepartment; + + @NotNull(message = "{SysUser.deleteFlag.null}",groups={SysUserQoUpdate.class}) + private Integer deleteFlag; + + private Integer roleId; + + private Integer authorityId; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getReallyName() { + return reallyName; + } + + public void setReallyName(String reallyName) { + this.reallyName = reallyName; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getTelephone() { + return telephone; + } + + public void setTelephone(String telephone) { + this.telephone = telephone; + } + + public Integer getStatusCode() { + return statusCode; + } + + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getUserDepartment() { + return userDepartment; + } + + public void setUserDepartment(String userDepartment) { + this.userDepartment = userDepartment; + } + + public Integer getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(Integer deleteFlag) { + this.deleteFlag = deleteFlag; + } + + public Integer getRoleId() { + return roleId; + } + + public void setRoleId(Integer roleId) { + this.roleId = roleId; + } + + public Integer getAuthorityId() { + return authorityId; + } + + public void setAuthorityId(Integer authorityId) { + this.authorityId = authorityId; + } +} diff --git a/src/main/java/com/xkrs/model/qo/WorkRecordQo.java b/src/main/java/com/xkrs/model/qo/WorkRecordQo.java new file mode 100644 index 0000000..f2e493f --- /dev/null +++ b/src/main/java/com/xkrs/model/qo/WorkRecordQo.java @@ -0,0 +1,65 @@ +package com.xkrs.model.qo; + +import com.xkrs.model.validation.WorkRecordQoInsert; +import com.xkrs.model.validation.WorkRecordQoUpdate; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; + +/** + * @author XinYi Song + */ +public class WorkRecordQo { + + @NotBlank(message = "{WorkHourRecord.workContent.null}",groups = {WorkRecordQoInsert.class, WorkRecordQoUpdate.class}) + @Size(max = 128, message = "{WorkHourRecord.workContent.length.illegal}",groups = {WorkRecordQoInsert.class, WorkRecordQoUpdate.class}) + private String workContent; + + @NotBlank(message = "{WorkHourRecord.workHour.null}",groups = {WorkRecordQoInsert.class, WorkRecordQoUpdate.class}) + private Integer workHour; + + @NotBlank(message = "{WorkHourRecord.color.null}",groups = {WorkRecordQoInsert.class, WorkRecordQoUpdate.class}) + private String color; + + @NotBlank(message = "{WorkHourRecord.projectNumber.null}",groups = {WorkRecordQoInsert.class, WorkRecordQoUpdate.class}) + private String projectNumber; + + public WorkRecordQo(String workContent, Integer workHour, String color, String projectNumber) { + this.workContent = workContent; + this.workHour = workHour; + this.color = color; + this.projectNumber = projectNumber; + } + + public String getWorkContent() { + return workContent; + } + + public void setWorkContent(String workContent) { + this.workContent = workContent; + } + + public Integer getWorkHour() { + return workHour; + } + + public void setWorkHour(Integer workHour) { + this.workHour = workHour; + } + + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + public String getProjectNumber() { + return projectNumber; + } + + public void setProjectNumber(String projectNumber) { + this.projectNumber = projectNumber; + } +} diff --git a/src/main/java/com/xkrs/model/validation/PictureFirePointQoInsert.java b/src/main/java/com/xkrs/model/validation/PictureFirePointQoInsert.java new file mode 100644 index 0000000..e458fdc --- /dev/null +++ b/src/main/java/com/xkrs/model/validation/PictureFirePointQoInsert.java @@ -0,0 +1,9 @@ +package com.xkrs.model.validation; + +/** + * PictureFirePointQoInsert + * @author tajochen + */ +public interface PictureFirePointQoInsert { + +} diff --git a/src/main/java/com/xkrs/model/validation/SysUserQoInsert.java b/src/main/java/com/xkrs/model/validation/SysUserQoInsert.java new file mode 100644 index 0000000..b7ce804 --- /dev/null +++ b/src/main/java/com/xkrs/model/validation/SysUserQoInsert.java @@ -0,0 +1,8 @@ +package com.xkrs.model.validation; + +/** + * SysUserQoInsert + * @author tajochen + */ +public interface SysUserQoInsert { +} diff --git a/src/main/java/com/xkrs/model/validation/SysUserQoUpdate.java b/src/main/java/com/xkrs/model/validation/SysUserQoUpdate.java new file mode 100644 index 0000000..2c1d87d --- /dev/null +++ b/src/main/java/com/xkrs/model/validation/SysUserQoUpdate.java @@ -0,0 +1,8 @@ +package com.xkrs.model.validation; + +/** + * SysUserQoUpdate + * @author tajochen + */ +public interface SysUserQoUpdate { +} diff --git a/src/main/java/com/xkrs/model/validation/WorkRecordQoInsert.java b/src/main/java/com/xkrs/model/validation/WorkRecordQoInsert.java new file mode 100644 index 0000000..786495f --- /dev/null +++ b/src/main/java/com/xkrs/model/validation/WorkRecordQoInsert.java @@ -0,0 +1,7 @@ +package com.xkrs.model.validation; + +/** + * @author XinYi Song + */ +public interface WorkRecordQoInsert { +} diff --git a/src/main/java/com/xkrs/model/validation/WorkRecordQoUpdate.java b/src/main/java/com/xkrs/model/validation/WorkRecordQoUpdate.java new file mode 100644 index 0000000..5e6f1fa --- /dev/null +++ b/src/main/java/com/xkrs/model/validation/WorkRecordQoUpdate.java @@ -0,0 +1,7 @@ +package com.xkrs.model.validation; + +/** + * @author XinYI Song + */ +public interface WorkRecordQoUpdate { +} diff --git a/src/main/java/com/xkrs/model/vo/ApplicationProjectVo.java b/src/main/java/com/xkrs/model/vo/ApplicationProjectVo.java new file mode 100644 index 0000000..b83e890 --- /dev/null +++ b/src/main/java/com/xkrs/model/vo/ApplicationProjectVo.java @@ -0,0 +1,82 @@ +package com.xkrs.model.vo; + +import java.io.Serializable; + +/** + * @author XinYi Song + * 负责人申请项目vo类 + */ +public class ApplicationProjectVo implements Serializable { + + private String projectNumber; + + private String projectName; + + private String reallyName; + + private String applicationTime; + + private Integer userId; + + public ApplicationProjectVo() { + } + + public ApplicationProjectVo(String projectNumber, String projectName, String reallyName, String applicationTime, Integer userId) { + this.projectNumber = projectNumber; + this.projectName = projectName; + this.reallyName = reallyName; + this.applicationTime = applicationTime; + this.userId = userId; + } + + public String getProjectNumber() { + return projectNumber; + } + + public void setProjectNumber(String projectNumber) { + this.projectNumber = projectNumber; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + public String getReallyName() { + return reallyName; + } + + public void setReallyName(String reallyName) { + this.reallyName = reallyName; + } + + public String getApplicationTime() { + return applicationTime; + } + + public void setApplicationTime(String applicationTime) { + this.applicationTime = applicationTime; + } + + public Integer getUserId() { + return userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + + @Override + public String toString() { + return "ApplicationProjectVo{" + + "projectNumber='" + projectNumber + '\'' + + ", projectName='" + projectName + '\'' + + ", reallyName='" + reallyName + '\'' + + ", applicationTime='" + applicationTime + '\'' + + ", userId=" + userId + + '}'; + } +} diff --git a/src/main/java/com/xkrs/model/vo/ManagementProjectVo.java b/src/main/java/com/xkrs/model/vo/ManagementProjectVo.java new file mode 100644 index 0000000..f9defc2 --- /dev/null +++ b/src/main/java/com/xkrs/model/vo/ManagementProjectVo.java @@ -0,0 +1,93 @@ +package com.xkrs.model.vo; + +import java.io.Serializable; + +/** + * @author XinYi Song + */ +public class ManagementProjectVo implements Serializable { + + private String projectNumber; + + private String projectName; + + private String projectStage; + + private String projectStatus; + + private Long peopleNum; + + private Long workHour; + + public ManagementProjectVo() { + } + + public ManagementProjectVo(String projectNumber, String projectName, String projectStage, String projectStatus, Long peopleNum, Long workHour) { + this.projectNumber = projectNumber; + this.projectName = projectName; + this.projectStage = projectStage; + this.projectStatus = projectStatus; + this.peopleNum = peopleNum; + this.workHour = workHour; + } + + public String getProjectNumber() { + return projectNumber; + } + + public void setProjectNumber(String projectNumber) { + this.projectNumber = projectNumber; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + public String getProjectStage() { + return projectStage; + } + + public void setProjectStage(String projectStage) { + this.projectStage = projectStage; + } + + public String getProjectStatus() { + return projectStatus; + } + + public void setProjectStatus(String projectStatus) { + this.projectStatus = projectStatus; + } + + public Long getPeopleNum() { + return peopleNum; + } + + public void setPeopleNum(Long peopleNum) { + this.peopleNum = peopleNum; + } + + public Long getWorkHour() { + return workHour; + } + + public void setWorkHour(Long workHour) { + this.workHour = workHour; + } + + @Override + public String toString() { + return "ManagementProjectVo{" + + "projectNumber='" + projectNumber + '\'' + + ", projectName='" + projectName + '\'' + + ", projectStage='" + projectStage + '\'' + + ", projectStatus='" + projectStatus + '\'' + + ", peopleNum=" + peopleNum + + ", workHour=" + workHour + + '}'; + } +} diff --git a/src/main/java/com/xkrs/model/vo/MemberApplicationVo.java b/src/main/java/com/xkrs/model/vo/MemberApplicationVo.java new file mode 100644 index 0000000..f2c1a3f --- /dev/null +++ b/src/main/java/com/xkrs/model/vo/MemberApplicationVo.java @@ -0,0 +1,69 @@ +package com.xkrs.model.vo; + +import java.io.Serializable; + +/** + * @author XinYi Song + */ +public class MemberApplicationVo implements Serializable { + + private Integer memberId; + + private String reallyName; + + private String applicationTime; + + private String applicationType; + + public MemberApplicationVo() { + } + + public MemberApplicationVo(Integer memberId, String reallyName, String applicationTime, String applicationType) { + this.memberId = memberId; + this.reallyName = reallyName; + this.applicationTime = applicationTime; + this.applicationType = applicationType; + } + + public Integer getMemberId() { + return memberId; + } + + public void setMemberId(Integer memberId) { + this.memberId = memberId; + } + + public String getReallyName() { + return reallyName; + } + + public void setReallyName(String reallyName) { + this.reallyName = reallyName; + } + + public String getApplicationTime() { + return applicationTime; + } + + public void setApplicationTime(String applicationTime) { + this.applicationTime = applicationTime; + } + + public String getApplicationType() { + return applicationType; + } + + public void setApplicationType(String applicationType) { + this.applicationType = applicationType; + } + + @Override + public String toString() { + return "MemberApplicationVo{" + + "memberId=" + memberId + + ", reallyName='" + reallyName + '\'' + + ", applicationTime='" + applicationTime + '\'' + + ", applicationType='" + applicationType + '\'' + + '}'; + } +} diff --git a/src/main/java/com/xkrs/model/vo/MemberJoinVo.java b/src/main/java/com/xkrs/model/vo/MemberJoinVo.java new file mode 100644 index 0000000..92897ac --- /dev/null +++ b/src/main/java/com/xkrs/model/vo/MemberJoinVo.java @@ -0,0 +1,57 @@ +package com.xkrs.model.vo; + +import java.io.Serializable; + +/** + * @author XinYi Song + */ +public class MemberJoinVo implements Serializable { + + private Integer memberId; + + private String reallyName; + + private String joinTime; + + public MemberJoinVo() { + } + + public MemberJoinVo(Integer memberId, String reallyName, String joinTime) { + this.memberId = memberId; + this.reallyName = reallyName; + this.joinTime = joinTime; + } + + public Integer getMemberId() { + return memberId; + } + + public void setMemberId(Integer memberId) { + this.memberId = memberId; + } + + public String getReallyName() { + return reallyName; + } + + public void setReallyName(String reallyName) { + this.reallyName = reallyName; + } + + public String getJoinTime() { + return joinTime; + } + + public void setJoinTime(String joinTime) { + this.joinTime = joinTime; + } + + @Override + public String toString() { + return "MemberJoinVo{" + + "memberId=" + memberId + + ", reallyName='" + reallyName + '\'' + + ", joinTime='" + joinTime + '\'' + + '}'; + } +} diff --git a/src/main/java/com/xkrs/model/vo/MemberWorkRecordVo.java b/src/main/java/com/xkrs/model/vo/MemberWorkRecordVo.java new file mode 100644 index 0000000..78591d1 --- /dev/null +++ b/src/main/java/com/xkrs/model/vo/MemberWorkRecordVo.java @@ -0,0 +1,81 @@ +package com.xkrs.model.vo; + +import java.io.Serializable; + +/** + * @author XinYi Song + */ +public class MemberWorkRecordVo implements Serializable { + + private String projectNumber; + + private String projectName; + + private String projectStage; + + private String projectStatus; + + private Long workHour; + + public MemberWorkRecordVo() { + } + + public MemberWorkRecordVo(String projectNumber, String projectName, String projectStage, String projectStatus, Long workHour) { + this.projectNumber = projectNumber; + this.projectName = projectName; + this.projectStage = projectStage; + this.projectStatus = projectStatus; + this.workHour = workHour; + } + + public String getProjectNumber() { + return projectNumber; + } + + public void setProjectNumber(String projectNumber) { + this.projectNumber = projectNumber; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + public String getProjectStage() { + return projectStage; + } + + public void setProjectStage(String projectStage) { + this.projectStage = projectStage; + } + + public String getProjectStatus() { + return projectStatus; + } + + public void setProjectStatus(String projectStatus) { + this.projectStatus = projectStatus; + } + + public Long getWorkHour() { + return workHour; + } + + public void setWorkHour(Long workHour) { + this.workHour = workHour; + } + + @Override + public String toString() { + return "MemberWorkRecordVo{" + + "projectNumber='" + projectNumber + '\'' + + ", projectName='" + projectName + '\'' + + ", projectStage='" + projectStage + '\'' + + ", projectStatus='" + projectStatus + '\'' + + ", workHour=" + workHour + + '}'; + } +} diff --git a/src/main/java/com/xkrs/model/vo/OutExcelVo.java b/src/main/java/com/xkrs/model/vo/OutExcelVo.java new file mode 100644 index 0000000..14499e9 --- /dev/null +++ b/src/main/java/com/xkrs/model/vo/OutExcelVo.java @@ -0,0 +1,69 @@ +package com.xkrs.model.vo; + +import java.io.Serializable; + +/** + * @author XinYi Song + */ +public class OutExcelVo implements Serializable { + + private String projectNumber; + + private String projectName; + + private String projectStage; + + private Long workHour; + + public OutExcelVo() { + } + + public OutExcelVo(String projectNumber, String projectName, String projectStage, Long workHour) { + this.projectNumber = projectNumber; + this.projectName = projectName; + this.projectStage = projectStage; + this.workHour = workHour; + } + + public String getProjectNumber() { + return projectNumber; + } + + public void setProjectNumber(String projectNumber) { + this.projectNumber = projectNumber; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + public String getProjectStage() { + return projectStage; + } + + public void setProjectStage(String projectStage) { + this.projectStage = projectStage; + } + + public Long getWorkHour() { + return workHour; + } + + public void setWorkHour(Long workHour) { + this.workHour = workHour; + } + + @Override + public String toString() { + return "OutExcelVo{" + + "projectNumber='" + projectNumber + '\'' + + ", projectName='" + projectName + '\'' + + ", projectStage='" + projectStage + '\'' + + ", workHour=" + workHour + + '}'; + } +} diff --git a/src/main/java/com/xkrs/model/vo/OutMemberVo.java b/src/main/java/com/xkrs/model/vo/OutMemberVo.java new file mode 100644 index 0000000..d840abc --- /dev/null +++ b/src/main/java/com/xkrs/model/vo/OutMemberVo.java @@ -0,0 +1,57 @@ +package com.xkrs.model.vo; + +import java.io.Serializable; + +/** + * @author XinYi Song + */ +public class OutMemberVo implements Serializable { + + private String reallyName; + + private String userDepartment; + + private Long workHour; + + public OutMemberVo() { + } + + public OutMemberVo(String reallyName, String userDepartment, Long workHour) { + this.reallyName = reallyName; + this.userDepartment = userDepartment; + this.workHour = workHour; + } + + public String getReallyName() { + return reallyName; + } + + public void setReallyName(String reallyName) { + this.reallyName = reallyName; + } + + public String getUserDepartment() { + return userDepartment; + } + + public void setUserDepartment(String userDepartment) { + this.userDepartment = userDepartment; + } + + public Long getWorkHour() { + return workHour; + } + + public void setWorkHour(Long workHour) { + this.workHour = workHour; + } + + @Override + public String toString() { + return "OutMemberVo{" + + "reallyName='" + reallyName + '\'' + + ", userDepartment='" + userDepartment + '\'' + + ", workHour=" + workHour + + '}'; + } +} diff --git a/src/main/java/com/xkrs/model/vo/SysUserVo.java b/src/main/java/com/xkrs/model/vo/SysUserVo.java new file mode 100644 index 0000000..d677eb3 --- /dev/null +++ b/src/main/java/com/xkrs/model/vo/SysUserVo.java @@ -0,0 +1,92 @@ +package com.xkrs.model.vo; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * SysUserVo + * @Author tajochen + */ +public class SysUserVo implements Serializable { + private Integer id; + + private String reallyName; + + private String telephone; + + private String userDepartment; + + private Integer activeFlag; + + private LocalDateTime addTime; + + public SysUserVo(Integer id, String reallyName, String telephone, String userDepartment, Integer activeFlag, LocalDateTime addTime) { + this.id = id; + this.reallyName = reallyName; + this.telephone = telephone; + this.userDepartment = userDepartment; + this.activeFlag = activeFlag; + this.addTime = addTime; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getReallyName() { + return reallyName; + } + + public void setReallyName(String reallyName) { + this.reallyName = reallyName; + } + + public String getTelephone() { + return telephone; + } + + public void setTelephone(String telephone) { + this.telephone = telephone; + } + + public String getUserDepartment() { + return userDepartment; + } + + public void setUserDepartment(String userDepartment) { + this.userDepartment = userDepartment; + } + + public Integer getActiveFlag() { + return activeFlag; + } + + public void setActiveFlag(Integer activeFlag) { + this.activeFlag = activeFlag; + } + + public LocalDateTime getAddTime() { + return addTime; + } + + public void setAddTime(LocalDateTime addTime) { + this.addTime = addTime; + } + + @Override + public String toString() { + return "SysUserVo{" + + "id=" + id + + ", reallyName='" + reallyName + '\'' + + ", telephone='" + telephone + '\'' + + ", userDepartment='" + userDepartment + '\'' + + ", activeFlag=" + activeFlag + + ", addTime=" + addTime + + '}'; + } +} + diff --git a/src/main/java/com/xkrs/service/MemberProjectService.java b/src/main/java/com/xkrs/service/MemberProjectService.java new file mode 100644 index 0000000..c79a005 --- /dev/null +++ b/src/main/java/com/xkrs/service/MemberProjectService.java @@ -0,0 +1,70 @@ +package com.xkrs.service; + +import com.xkrs.model.vo.MemberApplicationVo; +import com.xkrs.model.vo.MemberJoinVo; + +import java.util.List; + +/** + * @author XinYi Song + */ +public interface MemberProjectService { + + /** + * 成员加入项目 + * @param projectNumber + * @param token + * @return + */ + String memberJoin(String projectNumber,String token); + + /** + * 成员退出项目 + * @param projectNumber + * @param token + * @return + */ + String memberDropOut(String projectNumber,String token); + + /** + * 成员被允许加入 + * @param projectNumber + * @param userId + */ + void memberByAllow(String projectNumber,Integer userId); + + /** + * 成员被拒绝加入 + * @param projectNumber + * @param userId + */ + void memberByRefuse(String projectNumber,Integer userId); + + /** + * 查询成员的加入申请 + * @param projectNumber + * @return + */ + List selectMemberApplication(String projectNumber); + + /** + * 查询加入的成员的信息 + * @param projectNumber + * @return + */ + List selectMemberJoin(String projectNumber); + + /** + * 查询参与的项目的编号 + * @param userId + * @return + */ + List selectProjectNumberByMemberId(Integer userId); + + /** + * 查询待审核的项目的编号 + * @param userId + * @return + */ + List selectProjectNumberByMemberIds(Integer userId); +} diff --git a/src/main/java/com/xkrs/service/ProjectOverviewService.java b/src/main/java/com/xkrs/service/ProjectOverviewService.java new file mode 100644 index 0000000..02fbd0e --- /dev/null +++ b/src/main/java/com/xkrs/service/ProjectOverviewService.java @@ -0,0 +1,55 @@ +package com.xkrs.service; + +import com.xkrs.model.entity.ProjectOverview; +import com.xkrs.model.qo.ProjectQo; +import com.xkrs.model.qo.ProjectUpdateQo; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +/** + * @author XinYi Song + */ +public interface ProjectOverviewService { + + /** + * 导入遥感项目excel表 + * @param file + * @throws Exception + */ + void importRsProjectExcel(MultipartFile file) throws Exception; + + /** + * 导入视觉项目excel表 + * @param file + * @throws Exception + */ + void importCvProjectExcel(MultipartFile file) throws Exception; + + /** + * 动态多条件查询项目信息 + * @param projectNumber + * @param projectName + * @return + */ + List selectProjectByDynamic(String projectNumber, String projectName); + + /** + * 新增项目 + * @param projectQo + * @return + */ + ProjectOverview insertProjectOverview(ProjectQo projectQo); + + /** + * 修改项目信息 + * @param projectUpdateQo + */ + void updateProjectOverview(ProjectUpdateQo projectUpdateQo); + + /** + * 根据项目编号删除项目 + * @param projectNumber + */ + void deleteByProjectNumber(String projectNumber); +} diff --git a/src/main/java/com/xkrs/service/ResponsibleProjectService.java b/src/main/java/com/xkrs/service/ResponsibleProjectService.java new file mode 100644 index 0000000..951c572 --- /dev/null +++ b/src/main/java/com/xkrs/service/ResponsibleProjectService.java @@ -0,0 +1,87 @@ +package com.xkrs.service; + +import com.xkrs.model.vo.ApplicationProjectVo; + +import java.util.List; + +/** + * @author XinYi Song + */ +public interface ResponsibleProjectService { + + /** + * 负责人对项目的操作 + * @param responsibleProjectNumber + * @param token + * @return + */ + String operateResponsible(String responsibleProjectNumber,String token); + + /** + * 负责人对项目进行重新开始的操作 + * @param ProjectNumber + * @param token + * @return + */ + String operateReStart(String ProjectNumber,String token); + + /** + * 负责人对项目进行结束的操作 + * @param ProjectNumber + * @param token + * @return + */ + String operateOver(String ProjectNumber,String token); + + /** + * 查询负责人申请的信息 + * @param projectNumber + * @return + */ + ApplicationProjectVo selectApplicationInformation(String projectNumber); + + /** + * 管理员对负责人进行允许的操作 + * @param projectNumber + * @param userId + * @return + */ + void adminAllow(String projectNumber,Integer userId); + + /** + * 管理员对负责人进行拒绝的操作 + * @param projectNumber + * @param userId + */ + void adminRefuse(String projectNumber,Integer userId); + + /** + * 负责人移除成员 + * @param memberId + * @param projectNumber + */ + void removeMember(Integer memberId,String projectNumber); + + /** + * 负责人移交权限 + * @param memberId + * @param projectNumber + * @param userId + * + */ + void transferPermissions(Integer memberId,String projectNumber,Integer userId); + + /** + * 查询管理项目的编号 + * @param userId + * @return + */ + List selectProjectNumberByPrincipalId(Integer userId); + + /** + * 查询正在审核的项目的编号 + * @param userId + * @return + */ + List selectProjectNumberByPrincipalIds(Integer userId); +} diff --git a/src/main/java/com/xkrs/service/SysAuthorityService.java b/src/main/java/com/xkrs/service/SysAuthorityService.java new file mode 100644 index 0000000..643abbf --- /dev/null +++ b/src/main/java/com/xkrs/service/SysAuthorityService.java @@ -0,0 +1,23 @@ +package com.xkrs.service; + +import com.xkrs.model.entity.SysAuthorityEntity; + +import java.util.List; + +/** + * 系统权限服务接口 + * @author tajochen + */ +public interface SysAuthorityService { + + /** + * 获取权限实体列表根据用户名 + * @param userName + * @return + */ + List getSysAuthorityListByUserName(String userName); + + List findAllByIdIn(List id); + + List selectAuthorityByUserId(Integer userId); +} diff --git a/src/main/java/com/xkrs/service/SysRoleService.java b/src/main/java/com/xkrs/service/SysRoleService.java new file mode 100644 index 0000000..b3149eb --- /dev/null +++ b/src/main/java/com/xkrs/service/SysRoleService.java @@ -0,0 +1,19 @@ +package com.xkrs.service; + +import com.xkrs.model.entity.SysRoleEntity; + +import java.util.List; + +/** + * 系统角色服务接口 + * @author tajochen + */ +public interface SysRoleService { + + /** + * 获取角色实体列表根据用户名 + * @param userName + * @return + */ + List getSysRoleListByUserName(String userName); +} diff --git a/src/main/java/com/xkrs/service/SysUserService.java b/src/main/java/com/xkrs/service/SysUserService.java new file mode 100644 index 0000000..c88d920 --- /dev/null +++ b/src/main/java/com/xkrs/service/SysUserService.java @@ -0,0 +1,106 @@ +package com.xkrs.service; + +import com.xkrs.model.entity.SysUserEntity; +import com.xkrs.model.qo.SysUserQo; +import com.xkrs.model.vo.SysUserVo; + +import java.util.List; + +/** + * 系统用户服务接口 + * @author tajochen + */ +public interface SysUserService { + + /** + * 检查用户名 + * @param userName + * @return + */ + boolean checkUserName(String userName); + + /** + * 获取所有用户 + * @return + */ + //Iterable getAllSysUser(); + + /** + * 保存用户 + * @param sysUserQo + */ + void addUser(SysUserQo sysUserQo); + + /** + * 获取系统用户实体根据用户名 + * @param userName + * @return + */ + SysUserEntity getSysUserByUserName(String userName); + + /** + * 用户登录更新 + * @param userName + * @param ipAddress + * @return + */ + int updateSysUserLogin(String userName, String ipAddress); + + /** + * 系统用户更新 + * @param sysUserQo + * @return + */ + int updateSysUser(SysUserQo sysUserQo); + + /** + * 软删除系统用户 + * @param id + * @return + */ + int softDeleteGeneralUser(Integer id); + + /** + * 查询用户的信息 + * @return + */ + List selectAllUser(); + + /** + * 启用 + * @param userId + */ + void updateEnable(Integer userId); + + /** + * 禁用 + * @param userId + */ + void updateDisable(Integer userId); + + /** + * 用户修改密码 + * @param oldPassword + * @param newPassword + * @param confirmPassword + * @param sysUserEntity + * @return + */ + String updatePassword(String oldPassword,String newPassword,String confirmPassword,SysUserEntity sysUserEntity); + + /** + * 管理员修改用户的密码 + * @param userId + * @param newPassword + * @param confirmPassword + * @return + */ + String adminUpdatePassword(Integer userId,String newPassword,String confirmPassword); + + /** + * 获取系统用户实体根据用户名 + * @param userName + * @return + */ + SysUserVo getUserByUserName(String userName); +} diff --git a/src/main/java/com/xkrs/service/WorkHourRecordService.java b/src/main/java/com/xkrs/service/WorkHourRecordService.java new file mode 100644 index 0000000..3119987 --- /dev/null +++ b/src/main/java/com/xkrs/service/WorkHourRecordService.java @@ -0,0 +1,68 @@ +package com.xkrs.service; + +import com.xkrs.model.entity.WorkHourRecord; +import com.xkrs.model.qo.WorkRecordQo; +import com.xkrs.model.vo.MemberWorkRecordVo; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * @author XinYi Song + */ +public interface WorkHourRecordService { + + /** + * 提交工时记录 + * @param workRecordQo + * @param token + * @return + */ + String submitWorkContent(WorkRecordQo workRecordQo,String token); + + /** + * 查询我参与的 + * @param userId + * @return + */ + List selectMemberWorkRecord(Integer userId); + + /** + * 查询 + * @param userId + * @return + */ + List selectMemberAndParWorkRecord(Integer userId); + + /** + * 查询我管理的项目 + * @param userId + * @return + */ + List selectManagementProject(Integer userId); + + /** + * 查询我参与的当前项目的提交的工时记录 + * @param projectNumber + * @param userId + * @return + */ + List findRecord(String projectNumber,Integer userId); + + /** + * 修改工时记录 + * @param workContent + * @param id + */ + void updateRecord(String workContent,Integer id); + + /** + * 删除记录 + * @param id + */ + void deleteById(Integer id); + + void selectWork(String projectNumber, HttpServletResponse response) throws IOException; +} diff --git a/src/main/java/com/xkrs/service/impl/MemberProjectServiceImpl.java b/src/main/java/com/xkrs/service/impl/MemberProjectServiceImpl.java new file mode 100644 index 0000000..e82b618 --- /dev/null +++ b/src/main/java/com/xkrs/service/impl/MemberProjectServiceImpl.java @@ -0,0 +1,192 @@ +package com.xkrs.service.impl; + +import com.xkrs.common.encapsulation.PromptMessageEnum; +import com.xkrs.common.tool.TokenUtil; +import com.xkrs.dao.*; +import com.xkrs.model.entity.*; +import com.xkrs.model.vo.MemberApplicationVo; +import com.xkrs.model.vo.MemberJoinVo; +import com.xkrs.service.MemberProjectService; +import com.xkrs.utils.DateTimeUtil; +import org.springframework.context.i18n.LocaleContextHolder; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.transaction.Transactional; +import java.time.LocalDateTime; +import java.util.List; +import java.util.Locale; + +import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject; + +/** + * @author XinYi Song + */ +@Service +public class MemberProjectServiceImpl implements MemberProjectService { + + @Resource + private MemberProjectDao memberProjectDao; + + @Resource + private SysUserDao sysUserDao; + + @Resource + private ResponsibleProjectDao responsibleProjectDao; + + @Resource + private ProjectOverviewDao projectOverviewDao; + + @Resource + private WorkHourRecordDao workHourRecordDao; + + /** + * 成员点击进入 + * @param projectNumber + * @param token + * @return + */ + @Override + public String memberJoin(String projectNumber, String token) { + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 验证token + String tokenUserName = TokenUtil.getTokenUserName(token); + SysUserEntity sysUserEntity = sysUserDao.selectByUserName(tokenUserName); + if(sysUserEntity == null){ + return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); + } + ProjectOverview byProjectNumber = projectOverviewDao.findByProjectNumber(projectNumber); + if("3".equals(byProjectNumber.getProjectStatus())){ + return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"该项目正在审核,您还不能加入",locale); + } + MemberProject memberProjectNumber = memberProjectDao.findByMemberIdAndMemberProjectNumberAndApplicationType(sysUserEntity.getId(), projectNumber, "1"); + if(memberProjectNumber != null){ + return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"您已经加入该项目",locale); + }else { + // 成员点击加入项目 + MemberProject memberProject = new MemberProject(); + memberProject.setMemberProjectNumber(projectNumber); + memberProject.setMemberId(sysUserEntity.getId()); + memberProject.setApplicationTime(DateTimeUtil.dateTimeToString(LocalDateTime.now())); + if("QT".equals(projectNumber.substring(0,2))){ + memberProject.setApplicationType("1"); + memberProjectDao.save(memberProject); + WorkHourRecord workHourRecord = new WorkHourRecord(); + workHourRecord.setWorkContent("优化"); + workHourRecord.setWorkHour(0); + workHourRecord.setUserId(sysUserEntity.getId()); + workHourRecord.setProjectNumber(projectNumber); + workHourRecord.setColor("1"); + workHourRecord.setSubmitTime(DateTimeUtil.dateTimeToString(LocalDateTime.now())); + workHourRecordDao.save(workHourRecord); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"加入成功",locale); + } + memberProject.setApplicationType("0"); + memberProjectDao.save(memberProject); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"提交加入申请成功",locale); + } + } + + /** + * 成员退出项目 + * @param projectNumber + * @param token + * @return + */ + @Transactional(rollbackOn = Exception.class) + @Override + public String memberDropOut(String projectNumber, String token) { + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 验证token + String tokenUserName = TokenUtil.getTokenUserName(token); + SysUserEntity sysUserEntity = sysUserDao.selectByUserName(tokenUserName); + if(sysUserEntity == null){ + return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); + } + MemberProject memberProjectNumber = memberProjectDao.findByMemberIdAndMemberProjectNumberAndApplicationType(sysUserEntity.getId(), projectNumber, "1"); + if(memberProjectNumber == null){ + return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"您已经进行该操作,请勿重复操作",locale); + } + ResponsibleProject projectNumber1 = responsibleProjectDao.findByPrincipalIdAndResponsibleProjectNumber(sysUserEntity.getId(), projectNumber); + if(projectNumber1 != null){ + return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"您已是负责人,请先移交权限再退出",locale); + } + memberProjectDao.deleteByMemberIdAndMemberProjectNumber(sysUserEntity.getId(),projectNumber); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"退出成功",locale); + } + + /** + * 成员被允许加入 + * @param projectNumber + * @param userId + */ + @Transactional(rollbackOn = Exception.class) + @Override + public void memberByAllow(String projectNumber,Integer userId) { + WorkHourRecord workHourRecord = new WorkHourRecord(); + workHourRecord.setWorkContent("优化"); + workHourRecord.setWorkHour(0); + workHourRecord.setUserId(userId); + workHourRecord.setProjectNumber(projectNumber); + workHourRecord.setColor("1"); + workHourRecord.setSubmitTime(DateTimeUtil.dateTimeToString(LocalDateTime.now())); + workHourRecordDao.save(workHourRecord); + memberProjectDao.updateApplicationType("1",projectNumber); + memberProjectDao.updateJoinTime(DateTimeUtil.dateTimeToString(LocalDateTime.now()),projectNumber); + } + + /** + * 成员被拒绝加入 + * @param projectNumber + * @param userId + */ + @Transactional(rollbackOn = Exception.class) + @Override + public void memberByRefuse(String projectNumber,Integer userId) { + memberProjectDao.updateApplicationType("2",projectNumber); + } + + /** + * 查询成员的加入申请 + * @param projectNumber + * @return + */ + @Override + public List selectMemberApplication(String projectNumber) { + return memberProjectDao.selectMemberApplication(projectNumber); + } + + /** + * 查询加入的成员的信息 + * @param projectNumber + * @return + */ + @Override + public List selectMemberJoin(String projectNumber) { + return memberProjectDao.selectMemberJoin(projectNumber); + } + + /** + * 查询参与的项目的编号 + * @param userId + * @return + */ + @Override + public List selectProjectNumberByMemberId(Integer userId) { + return memberProjectDao.selectProjectNumberByMemberId(userId,"1"); + } + + /** + * 查询待审核项目的编号 + * @param userId + * @return + */ + @Override + public List selectProjectNumberByMemberIds(Integer userId) { + return memberProjectDao.selectProjectNumberByMemberId(userId,"0"); + } + + +} diff --git a/src/main/java/com/xkrs/service/impl/ProjectOverviewServiceImpl.java b/src/main/java/com/xkrs/service/impl/ProjectOverviewServiceImpl.java new file mode 100644 index 0000000..3730098 --- /dev/null +++ b/src/main/java/com/xkrs/service/impl/ProjectOverviewServiceImpl.java @@ -0,0 +1,158 @@ +package com.xkrs.service.impl; + +import com.xkrs.dao.ProjectOverviewDao; +import com.xkrs.model.entity.ProjectOverview; +import com.xkrs.model.qo.ProjectQo; +import com.xkrs.model.qo.ProjectUpdateQo; +import com.xkrs.service.ProjectOverviewService; +import com.xkrs.utils.ExcelImportUtil; +import com.xkrs.utils.Query; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.transaction.Transactional; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * @author XinYi Song + */ +@Service +public class ProjectOverviewServiceImpl implements ProjectOverviewService { + + @Resource + private ProjectOverviewDao projectOverviewDao; + + @Resource + private Query query; + + /** + * 导入遥感项目excel表 + * @param file + * @throws Exception + */ + @Transactional(rollbackOn = Exception.class) + @Override + public void importRsProjectExcel(MultipartFile file) throws Exception { + //调用封装好的工具 + ExcelImportUtil importUtil = new ExcelImportUtil(file); + //调用导入的方法,获取sheet表的内容 + List> maps = importUtil.readExcelContent(); + //导入订单详情表 + List orderDetails = maps.stream().filter(Objects::nonNull).map(map -> { + ProjectOverview projectOverview = new ProjectOverview(); + projectOverview.setProjectNumber(map.get("项目编号").substring(0,10)); + projectOverview.setProjectName(map.get("RS-项目名称")); + projectOverview.setProjectType("遥感"); + projectOverview.setProjectStage(map.get("阶段")); + projectOverview.setParty(map.get("甲方")); + projectOverview.setProjectMarket(map.get("市场人员")); + projectOverview.setProjectSale(map.get("售前")); + projectOverview.setProjectManager(map.get("项目经理")); + projectOverview.setProjectStatus("0"); + return projectOverview; + }).collect(Collectors.toList()); + //批量添加到订单详情 + projectOverviewDao.saveAll(orderDetails); + } + + /** + * 导入视觉项目的excel表 + * @param file + * @throws Exception + */ + @Transactional(rollbackOn = Exception.class) + @Override + public void importCvProjectExcel(MultipartFile file) throws Exception { + //调用封装好的工具 + ExcelImportUtil importUtil = new ExcelImportUtil(file); + //调用导入的方法,获取sheet表的内容 + List> maps = importUtil.readExcelContent(); + //导入订单详情表 + List orderDetails = maps.stream().filter(Objects::nonNull).map(map -> { + ProjectOverview projectOverview = new ProjectOverview(); + projectOverview.setProjectNumber(map.get("CV-项目编号").substring(0,10)); + projectOverview.setProjectName(map.get("CV-项目名称")); + projectOverview.setProjectType("视觉"); + projectOverview.setParty(map.get("甲方")); + projectOverview.setProjectStage(map.get("阶段")); + projectOverview.setProjectMarket(map.get("市场人员")); + projectOverview.setProjectSale(map.get("售前")); + projectOverview.setProjectManager(map.get("项目经理")); + projectOverview.setProjectStatus("0"); + return projectOverview; + }).collect(Collectors.toList()); + //批量添加到订单详情 + projectOverviewDao.saveAll(orderDetails); + } + + /** + * 动态多条件查询项目信息 + * @param projectNumber + * @param projectName + * @return + */ + @Override + public List selectProjectByDynamic(String projectNumber, String projectName) { + List projectOverviews = query.selectProjectByDynamic(projectNumber, projectName); + return projectOverviews; + } + + /** + * 新增项目 + * @param projectQo + * @return + */ + @Override + public ProjectOverview insertProjectOverview(ProjectQo projectQo) { + ProjectOverview projectOverview = new ProjectOverview(); + projectOverview.setProjectNumber(projectQo.getProjectNumber()); + projectOverview.setProjectName(projectQo.getProjectName()); + projectOverview.setProjectType(projectQo.getProjectType()); + projectOverview.setParty(projectQo.getParty()); + projectOverview.setProjectStage(projectQo.getProjectStage()); + projectOverview.setProjectMarket(projectQo.getProjectMarket()); + projectOverview.setProjectSale(projectQo.getProjectSale()); + projectOverview.setProjectManager(projectQo.getProjectManager()); + if("QT".equals(projectQo.getProjectNumber().substring(0,2))){ + projectOverview.setProjectStatus("1"); + return projectOverviewDao.save(projectOverview); + } + projectOverview.setProjectStatus("0"); + return projectOverviewDao.save(projectOverview); + } + + /** + * 修改项目 + * @param projectUpdateQo + */ + @Override + public void updateProjectOverview(ProjectUpdateQo projectUpdateQo) { + ProjectOverview projectOverview = new ProjectOverview(); + projectOverview.setId(projectUpdateQo.getId()); + projectOverview.setProjectNumber(projectUpdateQo.getProjectNumber()); + projectOverview.setProjectName(projectUpdateQo.getProjectName()); + projectOverview.setProjectType(projectUpdateQo.getProjectType()); + projectOverview.setParty(projectUpdateQo.getParty()); + projectOverview.setProjectStage(projectUpdateQo.getProjectStage()); + projectOverview.setProjectMarket(projectUpdateQo.getProjectMarket()); + projectOverview.setProjectSale(projectUpdateQo.getProjectSale()); + projectOverview.setProjectManager(projectUpdateQo.getProjectManager()); + projectOverview.setProjectStatus(projectUpdateQo.getProjectStatus()); + projectOverviewDao.save(projectOverview); + + } + + /** + * 根据项目编号删除项目 + * @param projectNumber + */ + @Transactional(rollbackOn = Exception.class) + @Override + public void deleteByProjectNumber(String projectNumber) { + projectOverviewDao.deleteByProjectNumber(projectNumber); + } +} diff --git a/src/main/java/com/xkrs/service/impl/ResponsibleProjectServiceImpl.java b/src/main/java/com/xkrs/service/impl/ResponsibleProjectServiceImpl.java new file mode 100644 index 0000000..ce16981 --- /dev/null +++ b/src/main/java/com/xkrs/service/impl/ResponsibleProjectServiceImpl.java @@ -0,0 +1,214 @@ +package com.xkrs.service.impl; + +import com.xkrs.common.encapsulation.PromptMessageEnum; +import com.xkrs.common.tool.TokenUtil; +import com.xkrs.dao.*; +import com.xkrs.model.entity.ProjectOverview; +import com.xkrs.model.entity.ResponsibleProject; +import com.xkrs.model.entity.SysUserEntity; +import com.xkrs.model.entity.WorkHourRecord; +import com.xkrs.model.vo.ApplicationProjectVo; +import com.xkrs.service.ResponsibleProjectService; +import com.xkrs.utils.DateTimeUtil; +import org.springframework.context.i18n.LocaleContextHolder; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.transaction.Transactional; +import java.time.LocalDateTime; +import java.util.List; +import java.util.Locale; + +import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject; + +/** + * @author XinYi Song + */ +@Service +public class ResponsibleProjectServiceImpl implements ResponsibleProjectService { + + @Resource + private ResponsibleProjectDao responsibleProjectDao; + + @Resource + private SysUserDao sysUserDao; + + @Resource + private ProjectOverviewDao projectOverviewDao; + + @Resource + private MemberProjectDao memberProjectDao; + + @Resource + private WorkHourRecordDao workHourRecordDao; + /** + * 负责人点击开始 + * @param responsibleProjectNumber + * @param token + * @return + */ + @Transactional(rollbackOn = Exception.class) + @Override + public String operateResponsible(String responsibleProjectNumber, String token) { + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 验证token + String tokenUserName = TokenUtil.getTokenUserName(token); + SysUserEntity sysUserEntity = sysUserDao.selectByUserName(tokenUserName); + if(sysUserEntity == null){ + return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); + } + ProjectOverview byProjectNumber = projectOverviewDao.findByProjectNumber(responsibleProjectNumber); + if("3".equals(byProjectNumber.getProjectStatus())){ + return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"该项目正在审核",locale); + } + if(!"0".equals(byProjectNumber.getProjectStatus())){ + return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"该项目正在执行中",locale); + } + // 负责人点击开始,项目提交申请 + ResponsibleProject responsibleProject1 = new ResponsibleProject(); + responsibleProject1.setPrincipalId(sysUserEntity.getId()); + responsibleProject1.setResponsibleProjectNumber(responsibleProjectNumber); + responsibleProject1.setApplicationTime(DateTimeUtil.dateTimeToString(LocalDateTime.now())); + responsibleProject1.setAuditType("0"); + projectOverviewDao.updateProjectStatus("3",responsibleProjectNumber); + responsibleProjectDao.save(responsibleProject1); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"操作成功",locale); + } + + /** + * 负责人对项目进行重新开始的操作 + * @param ProjectNumber + * @param token + * @return + */ + @Transactional(rollbackOn = Exception.class) + @Override + public String operateReStart(String ProjectNumber, String token) { + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 验证token + String tokenUserName = TokenUtil.getTokenUserName(token); + SysUserEntity sysUserEntity = sysUserDao.selectByUserName(tokenUserName); + if(sysUserEntity == null){ + return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); + } + projectOverviewDao.updateProjectStatus("1",ProjectNumber); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"操作成功",locale); + } + + /** + * 负责人对项目进行结束的操作 + * @param ProjectNumber + * @param token + * @return + */ + @Transactional(rollbackOn = Exception.class) + @Override + public String operateOver(String ProjectNumber, String token) { + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 验证token + String tokenUserName = TokenUtil.getTokenUserName(token); + SysUserEntity sysUserEntity = sysUserDao.selectByUserName(tokenUserName); + if(sysUserEntity == null){ + return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); + } + projectOverviewDao.updateProjectStatus("2",ProjectNumber); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"操作成功",locale); + } + + /** + * 查询负责人申请的相关信息 + * @param projectNumber + * @return + */ + @Override + public ApplicationProjectVo selectApplicationInformation(String projectNumber) { + ApplicationProjectVo applicationProjectVo = responsibleProjectDao.selectApplicationInformation(projectNumber); + return applicationProjectVo; + } + + /** + * 管理员允许负责人申请通过 + * @param projectNumber + * @param userId + * @return + */ + @Transactional(rollbackOn = Exception.class) + @Override + public void adminAllow(String projectNumber,Integer userId) { + WorkHourRecord workHourRecord = new WorkHourRecord(); + workHourRecord.setWorkContent("优化"); + workHourRecord.setWorkHour(0); + workHourRecord.setUserId(userId); + workHourRecord.setProjectNumber(projectNumber); + workHourRecord.setColor("1"); + workHourRecord.setSubmitTime(DateTimeUtil.dateTimeToString(LocalDateTime.now())); + workHourRecordDao.save(workHourRecord); + // 修改中间表的申请状态为1(表示审核通过) + responsibleProjectDao.updateAuditType("1",projectNumber); + responsibleProjectDao.updateStartTime(DateTimeUtil.dateTimeToString(LocalDateTime.now()),projectNumber); + // 修改项目表中的项目状态为1(表示填报中) + projectOverviewDao.updateProjectStatus("1",projectNumber); + } + + /** + * 管理员拒绝负责人的申请 + * @param projectNumber + * @param userId + */ + @Transactional(rollbackOn = Exception.class) + @Override + public void adminRefuse(String projectNumber,Integer userId) { + // 修改中间表的申请状态为2(表示负责人提交的申请被拒绝) + responsibleProjectDao.updateAuditType("2",projectNumber); + // 修改项目表中的状态为0(表示负责人提交的申请被拒绝,项目变成未开始状态) + projectOverviewDao.updateProjectStatus("0",projectNumber); + } + + /** + * 负责人移除成员 + * @param memberId + * @param projectNumber + */ + @Transactional(rollbackOn = Exception.class) + @Override + public void removeMember(Integer memberId, String projectNumber) { + memberProjectDao.deleteByMemberIdAndMemberProjectNumber(memberId,projectNumber); + } + + /** + * 负责人移交权限 + * @param memberId + * @param projectNumber + * @param userId + */ + @Transactional(rollbackOn = Exception.class) + @Override + public void transferPermissions(Integer memberId, String projectNumber, Integer userId) { + // userId负责人的id memberId成员的id + memberProjectDao.updateMemberIdByProjectNumber(userId,projectNumber,memberId); + responsibleProjectDao.updatePrincipalIdByProjectNumber(memberId,projectNumber); + } + + /** + * 查询管理的项目的编号 + * @param userId + * @return + */ + @Override + public List selectProjectNumberByPrincipalId(Integer userId) { + return responsibleProjectDao.selectProjectNumberByPrincipalId(userId,"1"); + } + + /** + * 查询正在审核的项目的编号 + * @param userId + * @return + */ + @Override + public List selectProjectNumberByPrincipalIds(Integer userId) { + return responsibleProjectDao.selectProjectNumberByPrincipalId(userId,"0"); + } +} diff --git a/src/main/java/com/xkrs/service/impl/SysAuthorityServiceImpl.java b/src/main/java/com/xkrs/service/impl/SysAuthorityServiceImpl.java new file mode 100644 index 0000000..c8d845a --- /dev/null +++ b/src/main/java/com/xkrs/service/impl/SysAuthorityServiceImpl.java @@ -0,0 +1,43 @@ +package com.xkrs.service.impl; + +import com.xkrs.dao.RelRoleAuthorityDao; +import com.xkrs.dao.SysAuthorityDao; +import com.xkrs.model.entity.SysAuthorityEntity; +import com.xkrs.service.SysAuthorityService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 系统权限服务实现 + * @author tajochen + */ +@Service +public class SysAuthorityServiceImpl implements SysAuthorityService { + + Logger logger = LoggerFactory.getLogger(SysAuthorityServiceImpl.class); + + @Resource + private SysAuthorityDao sysAuthorityDao; + + @Resource + private RelRoleAuthorityDao relRoleAuthorityDao; + + @Override + public List getSysAuthorityListByUserName(String userName) { + return sysAuthorityDao.selectByUserName(userName); + } + + @Override + public List findAllByIdIn(List id) { + return sysAuthorityDao.findAllByIdIn(id); + } + + @Override + public List selectAuthorityByUserId(Integer userId) { + return relRoleAuthorityDao.selectAuthorityByUserId(userId); + } +} diff --git a/src/main/java/com/xkrs/service/impl/SysRoleServiceImpl.java b/src/main/java/com/xkrs/service/impl/SysRoleServiceImpl.java new file mode 100644 index 0000000..4cb3bd2 --- /dev/null +++ b/src/main/java/com/xkrs/service/impl/SysRoleServiceImpl.java @@ -0,0 +1,29 @@ +package com.xkrs.service.impl; + +import com.xkrs.dao.SysRoleDao; +import com.xkrs.model.entity.SysRoleEntity; +import com.xkrs.service.SysRoleService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 系统角色服务实现 + * @author tajochen + */ +@Service +public class SysRoleServiceImpl implements SysRoleService { + + Logger logger = LoggerFactory.getLogger(SysRoleServiceImpl.class); + + @Resource + private SysRoleDao sysRoleDao; + + @Override + public List getSysRoleListByUserName(String userName) { + return sysRoleDao.selectByUserName(userName); + } +} diff --git a/src/main/java/com/xkrs/service/impl/SysUserServiceImpl.java b/src/main/java/com/xkrs/service/impl/SysUserServiceImpl.java new file mode 100644 index 0000000..780da16 --- /dev/null +++ b/src/main/java/com/xkrs/service/impl/SysUserServiceImpl.java @@ -0,0 +1,241 @@ +package com.xkrs.service.impl; + +import com.xkrs.common.encapsulation.PromptMessageEnum; +import com.xkrs.dao.RelRoleAuthorityDao; +import com.xkrs.dao.RelUserRoleDao; +import com.xkrs.dao.SysRoleDao; +import com.xkrs.dao.SysUserDao; +import com.xkrs.model.entity.RelRoleAuthorityEntity; +import com.xkrs.model.entity.RelUserRoleEntity; +import com.xkrs.model.entity.SysRoleEntity; +import com.xkrs.model.entity.SysUserEntity; +import com.xkrs.model.qo.SysUserQo; +import com.xkrs.model.vo.SysUserVo; +import com.xkrs.service.SysUserService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.i18n.LocaleContextHolder; +import org.springframework.security.crypto.keygen.KeyGenerators; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Locale; + +import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject; +import static com.xkrs.utils.DateTimeUtil.getNowTime; +import static com.xkrs.utils.EncryptDecryptUtil.encry256; + +/** + * 系统用户服务实现 + * @author tajochen + */ +@Service +public class SysUserServiceImpl implements SysUserService { + + Logger logger = LoggerFactory.getLogger(SysUserServiceImpl.class); + + @Resource + private SysUserDao sysUserDao; + + @Resource + private SysRoleDao sysRoleDao; + + @Resource + private RelUserRoleDao relUserRoleDao; + + @Resource + private RelRoleAuthorityDao relRoleAuthorityDao; + + /** + * 检查用户名是否存在 + * @param userName + * @return + */ + @Override + public boolean checkUserName(String userName) { + int num = sysUserDao.checkUserName(userName); + return (num == 0); + }; + + /** + * 新增用户 + * @param sysUserQo + */ + @Transactional(rollbackFor=Exception.class) + @Override + public void addUser(SysUserQo sysUserQo) { + String salt = KeyGenerators.string().generateKey(); + SysUserEntity sysUserEntity = new SysUserEntity(); + sysUserEntity.setUserName(sysUserQo.getUserName()); + sysUserEntity.setReallyName(sysUserQo.getReallyName()); + sysUserEntity.setSalt(salt); + sysUserEntity.setPassword(encry256(sysUserQo.getPassword() + salt)); + sysUserEntity.setTelephone(sysUserQo.getUserName()); + sysUserEntity.setUserDepartment(sysUserQo.getUserDepartment()); + sysUserEntity.setActiveFlag(1); + sysUserEntity.setStatusCode(0); + sysUserEntity.setAddTime(getNowTime()); + sysUserEntity.setDeleteFlag(0); + + sysUserDao.save(sysUserEntity); + + RelUserRoleEntity relUserRoleEntity = new RelUserRoleEntity(); + relUserRoleEntity.setUserId(sysUserEntity.getId().longValue()); + relUserRoleEntity.setRoleId(2); + + RelRoleAuthorityEntity relRoleAuthorityEntity = new RelRoleAuthorityEntity(); + relRoleAuthorityEntity.setRoleId(2); + relRoleAuthorityEntity.setAuthorityId(2); + relRoleAuthorityEntity.setUserId(sysUserEntity.getId()); + relUserRoleDao.save(relUserRoleEntity); + + relRoleAuthorityDao.save(relRoleAuthorityEntity); + + //sysRoleDao.insertRelUserRole(sysUserEntity.getUserName(),"role_general_user"); + } + + /** + * 查询所有用户Vo + * @return + */ + /*@Transactional(rollbackFor=Exception.class) + @Override + public Iterable getAllSysUser() { + Iterable ls = sysUserDao.selectAllSysUser(); + return ls; + }*/ + + @Transactional(rollbackFor=Exception.class) + @Override + public SysUserEntity getSysUserByUserName(String userName) { + return sysUserDao.selectByUserName(userName); + } + + @Transactional(rollbackFor=Exception.class) + @Override + public int updateSysUserLogin(String userName,String ipAddress) { + return sysUserDao.updateSysUserLogin(userName,ipAddress); + } + + /** + * 更新用户 + * @param sysUserQo + * @return + */ + @Transactional(rollbackFor=Exception.class) + @Override + public int updateSysUser(SysUserQo sysUserQo) { + SysUserEntity sysUserEntity = new SysUserEntity(); + sysUserEntity.setReallyName(sysUserQo.getReallyName()); + sysUserDao.save(sysUserEntity); + return 1; + } + + /** + * 软删除普通用户 + * @param id + * @return + */ + @Transactional(rollbackFor=Exception.class) + @Override + public int softDeleteGeneralUser(Integer id) { + String adminRole = "role_administor"; + String sysRole ="role_system_manager"; + + List list = sysRoleDao.selectByUserId(id); + if(list.size()>0){ + SysRoleEntity sysRoleEntity = list.get(1); + if(sysRole.equals(sysRoleEntity.getRoleName())||adminRole.equals(sysRoleEntity.getRoleName())){ + sysUserDao.softDeleteGeneralUserById(id); + return 0; + } + } + return 1; + } + + /** + * 查询用户的信息 + * @return + */ + @Override + public List selectAllUser() { + return sysUserDao.selectAll(); + } + + /** + * 启用 + * @param userId + */ + @Transactional(rollbackFor=Exception.class) + @Override + public void updateEnable(Integer userId) { + sysUserDao.updateEnable(userId); + } + + /** + * 禁用 + * @param userId + */ + @Transactional(rollbackFor=Exception.class) + @Override + public void updateDisable(Integer userId) { + sysUserDao.updateDisable(userId); + } + + /** + * 用户修改密码 + * @param oldPassword + * @param newPassword + * @param confirmPassword + * @param sysUserEntity + * @return + */ + @Transactional(rollbackFor=Exception.class) + @Override + public String updatePassword(String oldPassword, String newPassword, String confirmPassword, SysUserEntity sysUserEntity) { + Locale locale = LocaleContextHolder.getLocale(); + String oldFrontPassword = encry256(oldPassword + sysUserEntity.getSalt()); + if(!oldFrontPassword.equals(sysUserEntity.getPassword())){ + return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"旧密码输入错误",locale); + } + if(!newPassword.equals(confirmPassword)){ + return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"两次密码输入不一致",locale); + } + String newAfterPassword = encry256(newPassword + sysUserEntity.getSalt()); + sysUserDao.updatePassword(sysUserEntity.getId(),newAfterPassword); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"密码修改成功",locale); + } + + /** + * 管理员修改用户的密码 + * @param userId + * @param newPassword + * @param confirmPassword + * @return + */ + @Transactional(rollbackFor=Exception.class) + @Override + public String adminUpdatePassword(Integer userId, String newPassword, String confirmPassword) { + Locale locale = LocaleContextHolder.getLocale(); + if(!newPassword.equals(confirmPassword)){ + return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"两次密码输入不一致",locale); + } + SysUserEntity sysUserEntity = sysUserDao.selectByUserId(userId); + String newAfterPassword = encry256(newPassword + sysUserEntity.getSalt()); + sysUserDao.updatePassword(userId,newAfterPassword); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"密码修改成功",locale); + } + + /** + * 查询用户实体信息 + * @param userName + * @return + */ + @Override + public SysUserVo getUserByUserName(String userName) { + return sysUserDao.selectUserByUserName(userName); + } + +} diff --git a/src/main/java/com/xkrs/service/impl/WorkHourRecordServiceImpl.java b/src/main/java/com/xkrs/service/impl/WorkHourRecordServiceImpl.java new file mode 100644 index 0000000..5d81f74 --- /dev/null +++ b/src/main/java/com/xkrs/service/impl/WorkHourRecordServiceImpl.java @@ -0,0 +1,435 @@ +package com.xkrs.service.impl; + +import com.xkrs.common.encapsulation.PromptMessageEnum; +import com.xkrs.common.tool.TokenUtil; +import com.xkrs.dao.SysUserDao; +import com.xkrs.dao.WorkHourRecordDao; +import com.xkrs.model.entity.SysUserEntity; +import com.xkrs.model.entity.WorkHourRecord; +import com.xkrs.model.qo.WorkRecordQo; +import com.xkrs.model.vo.MemberWorkRecordVo; +import com.xkrs.model.vo.OutExcelVo; +import com.xkrs.model.vo.OutMemberVo; +import com.xkrs.service.WorkHourRecordService; +import com.xkrs.utils.DateTimeUtil; +import org.apache.poi.hssf.usermodel.*; +import org.apache.poi.ss.usermodel.*; +import org.springframework.context.i18n.LocaleContextHolder; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.transaction.Transactional; +import java.io.IOException; +import java.time.LocalDateTime; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject; + +/** + * @author XinYi Song + */ +@Service +public class WorkHourRecordServiceImpl implements WorkHourRecordService { + + @Resource + private WorkHourRecordDao workHourRecordDao; + + @Resource + private SysUserDao sysUserDao; + + /** + * 提交工时记录 + * @param workRecordQo + * @param token + * @return + */ + @Override + public String submitWorkContent(WorkRecordQo workRecordQo, String token) { + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 验证token + String tokenUserName = TokenUtil.getTokenUserName(token); + SysUserEntity sysUserEntity = sysUserDao.selectByUserName(tokenUserName); + if(sysUserEntity == null){ + return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); + } + WorkHourRecord workHourRecord = new WorkHourRecord(); + workHourRecord.setWorkContent(workRecordQo.getWorkContent()); + workHourRecord.setWorkHour(workRecordQo.getWorkHour()); + workHourRecord.setColor(workRecordQo.getColor()); + workHourRecord.setUserId(sysUserEntity.getId()); + workHourRecord.setProjectNumber(workRecordQo.getProjectNumber()); + workHourRecord.setSubmitTime(DateTimeUtil.dateTimeToString(LocalDateTime.now())); + WorkHourRecord save = workHourRecordDao.save(workHourRecord); + if(save != null){ + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"提交成功",locale); + }else { + return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"提交失败",locale); + } + } + + /** + * 查询我参与的 + * @param userId + * @return + */ + @Override + public List selectMemberWorkRecord(Integer userId) { + return workHourRecordDao.selectMemberWorkRecord(userId); + } + + /** + * 查询 + * @param userId + * @return + */ + @Override + public List selectMemberAndParWorkRecord(Integer userId) { + return workHourRecordDao.selectMemberAndParWorkRecord(userId); + } + + /** + * 查询我管理的项目 + * @param userId + * @return + */ + @Override + public List selectManagementProject(Integer userId) { + return workHourRecordDao.selectManagementProject(userId); + } + + /** + * 查询我参与的当前项目的提交的工时记录 + * @param projectNumber + * @param userId + * @return + */ + @Override + public List findRecord(String projectNumber, Integer userId) { + return workHourRecordDao.findRecord(projectNumber,userId); + } + + /** + * 修改工时记录 + * @param workContent + * @param id + */ + @Transactional(rollbackOn = Exception.class) + @Override + public void updateRecord(String workContent, Integer id) { + String time = DateTimeUtil.dateTimeToString(LocalDateTime.now()); + workHourRecordDao.updateRecord(workContent,time,id); + } + + /** + * 删除记录 + * @param id + */ + @Transactional(rollbackOn = Exception.class) + @Override + public void deleteById(Integer id) { + workHourRecordDao.deleteById(id); + } + + @Override + public void selectWork(String projectNumber, HttpServletResponse response) throws IOException { + OutExcelVo outExcelVo = workHourRecordDao.selectWork(projectNumber); + //声明一个工作簿 + HSSFWorkbook workbook = new HSSFWorkbook(); + + //生成一个表格,设置表格名称为"学生表" + HSSFSheet sheet = workbook.createSheet("工时管理"); + //字号 + HSSFFont f = workbook.createFont(); + f.setFontHeightInPoints((short) 16); + + // 设置列宽 + sheet.setColumnWidth(0,256*14+184); + sheet.setColumnWidth(1,256*17+184); + sheet.setColumnWidth(2,256*14+184); + sheet.setColumnWidth(3,256*50+184); + + //创建第一行表头 + HSSFRow headrow = sheet.createRow(0); + // 设置行高 + headrow.setHeight((short) (256*1+184)); + + //创建一个单元格 + HSSFCell cell = headrow.createCell(0); + CellStyle style=workbook.createCellStyle(); + style.setFont(f); + //左右居中 + style.setAlignment(HorizontalAlignment.CENTER); + //创建一个内容对象 + HSSFRichTextString text = new HSSFRichTextString("项目编号"); + //将内容对象的文字内容写入到单元格中 + cell.setCellValue(text); + cell.setCellStyle(style); + style.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); + style.setFillPattern(FillPatternType.SOLID_FOREGROUND); + //底边框加黑 + style.setBorderBottom(BorderStyle.THIN); + //左边框加黑 + style.setBorderLeft(BorderStyle.THIN); + // 有边框加黑 + style.setBorderRight(BorderStyle.THIN); + //上边框加黑 + style.setBorderTop(BorderStyle.THIN); + cell.setCellStyle(style); + + HSSFCell cell1 = headrow.createCell(1); + CellStyle style1=workbook.createCellStyle(); + style1.setFont(f); + //左右居中 + style1.setAlignment(HorizontalAlignment.CENTER); + //创建一个内容对象 + HSSFRichTextString text1 = new HSSFRichTextString(outExcelVo.getProjectNumber()); + //将内容对象的文字内容写入到单元格中 + cell1.setCellValue(text1); + style1.setBorderBottom(BorderStyle.THIN); + //左边框加黑 + style1.setBorderLeft(BorderStyle.THIN); + // 有边框加黑 + style1.setBorderRight(BorderStyle.THIN); + //上边框加黑 + style1.setBorderTop(BorderStyle.THIN); + cell1.setCellStyle(style1); + + HSSFCell cell2 = headrow.createCell(2); + CellStyle style2=workbook.createCellStyle(); + style2.setFont(f); + //左右居中 + style2.setAlignment(HorizontalAlignment.CENTER); + //创建一个内容对象 + HSSFRichTextString text2 = new HSSFRichTextString("项目名称"); + //将内容对象的文字内容写入到单元格中 + cell2.setCellValue(text2); + style2.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); + style2.setFillPattern(FillPatternType.SOLID_FOREGROUND); + style2.setBorderBottom(BorderStyle.THIN); + //左边框加黑 + style2.setBorderLeft(BorderStyle.THIN); + // 有边框加黑 + style2.setBorderRight(BorderStyle.THIN); + //上边框加黑 + style2.setBorderTop(BorderStyle.THIN); + cell2.setCellStyle(style2); + + HSSFCell cell3 = headrow.createCell(3); + CellStyle style3=workbook.createCellStyle(); + style3.setFont(f); + //左右居中 + style3.setAlignment(HorizontalAlignment.CENTER); + //创建一个内容对象 + HSSFRichTextString text3 = new HSSFRichTextString(outExcelVo.getProjectName()); + //将内容对象的文字内容写入到单元格中 + cell3.setCellValue(text3); + style3.setBorderBottom(BorderStyle.THIN); + //左边框加黑 + style3.setBorderLeft(BorderStyle.THIN); + // 有边框加黑 + style3.setBorderRight(BorderStyle.THIN); + //上边框加黑 + style3.setBorderTop(BorderStyle.THIN); + cell3.setCellStyle(style3); + + //创建第二行表头 + HSSFRow headrow1 = sheet.createRow(1); + headrow1.setHeight((short) (256*1+184)); + //创建一个单元格 + HSSFCell cell11 = headrow1.createCell(0); + CellStyle style4=workbook.createCellStyle(); + style4.setFont(f); + //左右居中 + style4.setAlignment(HorizontalAlignment.CENTER); + //创建一个内容对象 + HSSFRichTextString text11 = new HSSFRichTextString("总工时"); + //将内容对象的文字内容写入到单元格中 + cell11.setCellValue(text11); + style4.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); + style4.setFillPattern(FillPatternType.SOLID_FOREGROUND); + style4.setBorderBottom(BorderStyle.THIN); + //左边框加黑 + style4.setBorderLeft(BorderStyle.THIN); + // 有边框加黑 + style4.setBorderRight(BorderStyle.THIN); + //上边框加黑 + style4.setBorderTop(BorderStyle.THIN); + cell11.setCellStyle(style4); + + HSSFCell cell12 = headrow1.createCell(1); + CellStyle style5=workbook.createCellStyle(); + style5.setFont(f); + //左右居中 + style5.setAlignment(HorizontalAlignment.CENTER); + //创建一个内容对象 + HSSFRichTextString text12 = new HSSFRichTextString(String.valueOf(outExcelVo.getWorkHour())); + //将内容对象的文字内容写入到单元格中 + cell12.setCellValue(text12); + style5.setBorderBottom(BorderStyle.THIN); + //左边框加黑 + style5.setBorderLeft(BorderStyle.THIN); + // 有边框加黑 + style5.setBorderRight(BorderStyle.THIN); + //上边框加黑 + style5.setBorderTop(BorderStyle.THIN); + cell12.setCellStyle(style5); + + HSSFCell cell22 = headrow1.createCell(2); + CellStyle style6=workbook.createCellStyle(); + style6.setFont(f); + //左右居中 + style6.setAlignment(HorizontalAlignment.CENTER); + //创建一个内容对象 + HSSFRichTextString text22 = new HSSFRichTextString("阶段"); + //将内容对象的文字内容写入到单元格中 + cell22.setCellValue(text22); + style6.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); + style6.setFillPattern(FillPatternType.SOLID_FOREGROUND); + style6.setBorderBottom(BorderStyle.THIN); + //左边框加黑 + style6.setBorderLeft(BorderStyle.THIN); + // 有边框加黑 + style6.setBorderRight(BorderStyle.THIN); + //上边框加黑 + style6.setBorderTop(BorderStyle.THIN); + cell22.setCellStyle(style6); + + HSSFCell cell33 = headrow1.createCell(3); + CellStyle style7=workbook.createCellStyle(); + style7.setFont(f); + //左右居中 + style7.setAlignment(HorizontalAlignment.CENTER); + // A-前期交流;B-实施中;C-已完结;D-未赢取 + if("A".equals(outExcelVo.getProjectStage())){ + //创建一个内容对象 + HSSFRichTextString text33 = new HSSFRichTextString("前期交流"); + //将内容对象的文字内容写入到单元格中 + cell33.setCellValue(text33); + }else if("B".equals(outExcelVo.getProjectStage())){ + HSSFRichTextString text33 = new HSSFRichTextString("实施中"); + cell33.setCellValue(text33); + }else if("C".equals(outExcelVo.getProjectStage())){ + HSSFRichTextString text33 = new HSSFRichTextString("已完结"); + cell33.setCellValue(text33); + }else { + HSSFRichTextString text33 = new HSSFRichTextString("未赢取"); + cell33.setCellValue(text33); + } + style7.setBorderBottom(BorderStyle.THIN); + //左边框加黑 + style7.setBorderLeft(BorderStyle.THIN); + // 有边框加黑 + style7.setBorderRight(BorderStyle.THIN); + //上边框加黑 + style7.setBorderTop(BorderStyle.THIN); + cell33.setCellStyle(style7); + + //创建第三行表头 + HSSFRow headrow2 = sheet.createRow(2); + headrow2.setHeight((short) (256*1+184)); + //创建一个单元格 + HSSFCell cell21 = headrow2.createCell(0); + CellStyle style8=workbook.createCellStyle(); + style8.setFont(f); + //左右居中 + style8.setAlignment(HorizontalAlignment.CENTER); + //创建一个内容对象 + HSSFRichTextString text21 = new HSSFRichTextString("人员"); + //将内容对象的文字内容写入到单元格中 + cell21.setCellValue(text21); + style8.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); + style8.setFillPattern(FillPatternType.SOLID_FOREGROUND); + style8.setBorderBottom(BorderStyle.THIN); + //左边框加黑 + style8.setBorderLeft(BorderStyle.THIN); + // 有边框加黑 + style8.setBorderRight(BorderStyle.THIN); + //上边框加黑 + style8.setBorderTop(BorderStyle.THIN); + cell21.setCellStyle(style8); + + + HSSFCell cell231 = headrow2.createCell(1); + CellStyle style91=workbook.createCellStyle(); + style91.setFont(f); + //左右居中 + style91.setAlignment(HorizontalAlignment.CENTER); + //创建一个内容对象 + HSSFRichTextString text231 = new HSSFRichTextString("组织"); + //将内容对象的文字内容写入到单元格中 + cell231.setCellValue(text231); + style91.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); + style91.setFillPattern(FillPatternType.SOLID_FOREGROUND); + style91.setBorderBottom(BorderStyle.THIN); + //左边框加黑 + style91.setBorderLeft(BorderStyle.THIN); + // 有边框加黑 + style91.setBorderRight(BorderStyle.THIN); + //上边框加黑 + style91.setBorderTop(BorderStyle.THIN); + cell231.setCellStyle(style91); + + + HSSFCell cell23 = headrow2.createCell(2); + CellStyle style9=workbook.createCellStyle(); + style9.setFont(f); + //左右居中 + style9.setAlignment(HorizontalAlignment.CENTER); + //创建一个内容对象 + HSSFRichTextString text23 = new HSSFRichTextString("工时"); + //将内容对象的文字内容写入到单元格中 + cell23.setCellValue(text23); + style9.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); + style9.setFillPattern(FillPatternType.SOLID_FOREGROUND); + style9.setBorderBottom(BorderStyle.THIN); + //左边框加黑 + style9.setBorderLeft(BorderStyle.THIN); + // 有边框加黑 + style9.setBorderRight(BorderStyle.THIN); + //上边框加黑 + style9.setBorderTop(BorderStyle.THIN); + cell23.setCellStyle(style9); + + List outMemberVos = workHourRecordDao.selectMember(projectNumber); + int rowIndex = 3; + for(int i = 0; i < outMemberVos.size(); i++){ + HSSFRow row1 = sheet.createRow(rowIndex++); + row1.setHeight((short) (256*1+184)); + HSSFCell cell35 = row1.createCell(0); + CellStyle style10=workbook.createCellStyle(); + style10.setFont(f); + //左右居中 + style10.setAlignment(HorizontalAlignment.CENTER); + HSSFRichTextString text35 = new HSSFRichTextString(outMemberVos.get(i).getReallyName()); + cell35.setCellValue(text35); + cell35.setCellStyle(style10); + + HSSFCell cell351 = row1.createCell(1); + HSSFRichTextString text351 = new HSSFRichTextString(outMemberVos.get(i).getUserDepartment()); + cell351.setCellValue(text351); + cell351.setCellStyle(style10); + + HSSFCell cell352 = row1.createCell(2); + HSSFRichTextString text352 = new HSSFRichTextString(outMemberVos.get(i).getWorkHour().toString()); + cell352.setCellValue(text352); + cell352.setCellStyle(style10); + } + + //准备将Excel的输出流通过response输出到页面下载 + //八进制输出流 + response.setContentType("application/octet-stream"); + + //这后面可以设置导出Excel的名称,此例中名为student.xls + response.setHeader("Content-disposition", "attachment;filename=work_management.xls"); + + //刷新缓冲 + response.flushBuffer(); + + //workbook将Excel写入到response的输出流中,供页面下载 + workbook.write(response.getOutputStream()); + } +} diff --git a/src/main/java/com/xkrs/utils/AddressUtils.java b/src/main/java/com/xkrs/utils/AddressUtils.java new file mode 100644 index 0000000..f434a97 --- /dev/null +++ b/src/main/java/com/xkrs/utils/AddressUtils.java @@ -0,0 +1,211 @@ +package com.xkrs.utils; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.http.HttpEntity; +import org.apache.http.HttpStatus; +import org.apache.http.client.ClientProtocolException; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.utils.URIBuilder; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Map; + +/** + * 根据经纬度获取地址:省 市 区 位置名称 + * @author XinYi Song + */ +public class AddressUtils { + + private static final Logger log = LoggerFactory.getLogger(AddressUtils.class); + private static final String USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) " + + "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36"; + + /** + * 获取指定经纬度的地理位置 + * @param latitude 纬度 + * @param longitude 经度 + * @return + */ + public static String getLocal(String latitude, String longitude) { + String ok = "ok"; + String msg = "msg"; + String info = getAdd(latitude, longitude); + ObjectMapper mapper = new ObjectMapper(); + JsonNode node = null; + try { + node = mapper.readTree(info); + } catch (JsonProcessingException e) { + e.printStackTrace(); + } + assert node != null; + String province = null; + String city = null; + String county = null; + String road = null; + String address = null; + if (ok.equals(node.path(msg).asText())) { + province = node.path("result").path("addressComponent").path("province").asText(); + city = node.path("result").path("addressComponent").path("city").asText(); + county = node.path("result").path("addressComponent").path("county").asText(); + road = node.path("result").path("addressComponent").path("road").asText(); + address = node.path("result").path("addressComponent").path("address").asText(); + } + String fireAddress = province + city + county + road + address; + return fireAddress; + } + /** + * 根据经纬度获取位置信息 + * @param latitude 纬度 + * @param longitude 经度 + * @return + */ + public static String getAdd(String latitude, String longitude) { + // 读取成功标志 + boolean isSuccess = false; + // 重复次数 + int count = 10; + ObjectMapper mapper = new ObjectMapper(); + Map paramMap = new HashMap<>(3); + paramMap.put("lon", longitude); + paramMap.put("lat", latitude); + paramMap.put("ver", "1"); + String paramStr = null; + try { + paramStr = mapper.writeValueAsString(paramMap); + } catch (JsonProcessingException e) { + log.error("转json失败,{}", (Object) e.getStackTrace()); + } + String url = String.format("http://api.tianditu.gov.cn/geocoder?type=geocode&tk=5a1d34815475f88e6d8802da6be832ae&postStr=%s", + paramStr); + // 创建http对象 + RequestConfig defaultRequestConfig = RequestConfig.custom() + .setSocketTimeout(60000).setConnectTimeout(60000) + .setConnectionRequestTimeout(60000) + .build(); + CloseableHttpClient client = HttpClients.custom() + .setDefaultRequestConfig(defaultRequestConfig).build(); + + // 创建并设置URI + URIBuilder uri = null; + // 创建Get请求 + HttpGet get = null; + + try { + URL url1 = new URL(url); + URI uri1 = new URI(url1.getProtocol(), url1.getHost(), url1.getPath(), url1.getQuery(), null); + uri = new URIBuilder(uri1); + get = new HttpGet(uri.build()); + // 设置请求头 + setGet(get); + } catch (URISyntaxException | MalformedURLException e) { + log.info("错误{}", (Object) e.getStackTrace()); + } + //发送请求 + HttpEntity entity = null; + InputStream is = null; + BufferedReader br = null; + // 创建响应对象 + CloseableHttpResponse response = null; + String line; + String sLine = null; + + String json = null; + while (!isSuccess && count > 0) { + try { + response = client.execute(get); + // 获取请求结果 + if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { + log.info("实时定位数据未请求成功"); + count--; + //close(is, br, response, client); + continue; + } + entity = response.getEntity(); + is = entity.getContent(); + br = new BufferedReader( + new InputStreamReader(is, StandardCharsets.UTF_8) + ); + StringBuilder sb = new StringBuilder(); + while ((line = br.readLine()) != null) { + sb.append(line); + } + sLine = sb.toString(); + sLine = sLine.substring(sLine.indexOf("{")); + //使用ObjectMapper对象对 User对象进行转换 + try { + json = mapper.writeValueAsString(sLine); + } catch (JsonProcessingException e) { + log.info("json字符串转化异常{}", (Object) e.getStackTrace()); + } + isSuccess = true; + + } catch (ClientProtocolException e) { + log.info("请求超时等问题:{}", (Object) e.getStackTrace()); + } catch (IOException e) { + log.info("I/O问题:{}", (Object) e.getStackTrace()); + } finally { + close(is, br, response, client); + } + } + return sLine; + } + + private static void close(InputStream is, BufferedReader br, CloseableHttpResponse response, CloseableHttpClient client){ + try { + if (null != is){ + is.close(); + } + if (null != br){ + br.close(); + } + if (null != response){ + response.close(); + } + if (null != client){ + client.close(); + } + } catch (IOException e) { + log.info("IO错误{}", (Object) e.getStackTrace()); + } + } + + private static HttpGet setGet(HttpGet get) { + get.setHeader("Accept" + , "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); + get.setHeader("Accept-Encoding" + , "gzip, deflate"); + get.setHeader("Accept-Language" + , "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,zh-TW;q=0.6"); + get.setHeader("Connection" + , "keep-alive"); + get.setHeader("Cache-Control" + , "no-cache"); + get.setHeader("Upgrade-Insecure-Requests" + , "1"); + get.setHeader("User-Agent", USER_AGENT); + return get; + } + + public static void main(String[] args) { + String map = getAdd("35.150684", "115.84691"); + String local = getLocal("36.90033", "117.752853"); + System.out.println(local); + } +} diff --git a/src/main/java/com/xkrs/utils/BeanUtils.java b/src/main/java/com/xkrs/utils/BeanUtils.java new file mode 100644 index 0000000..67c5ba2 --- /dev/null +++ b/src/main/java/com/xkrs/utils/BeanUtils.java @@ -0,0 +1,73 @@ +package com.xkrs.utils; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Supplier; + +/** + * @author xkrs + */ +public class BeanUtils { + + /** + * 缓存BeanCopier 对象 提升性能 + */ + private static final ConcurrentHashMap BEAN_COPIER_MAP = new ConcurrentHashMap<>(); + + + /** + * Bean属性复制工具方法。 + * @param sources 原始集合 + * @param supplier: 目标类::new(eg: UserVO::new) + */ + public static List cgLibCopyList(List sources, Supplier supplier) { + List list = new ArrayList<>(sources.size()); + org.springframework.cglib.beans.BeanCopier beanCopier = null; + for (S source : sources) { + T t = supplier.get(); + if (beanCopier == null) { + beanCopier = getBeanCopier(source.getClass(), t.getClass()); + } + beanCopier.copy(source, t, null); + list.add(t); + } + return list; + } + + /** + * Bean属性复制工具方法。 + * @param source 目标对象 + * @param supplier: 目标类::new(eg: UserVO::new) + */ + public static T cgLibCopyBean(Object source, Supplier supplier) { + T t = supplier.get(); + getBeanCopier(source.getClass(), t.getClass()).copy(source, t, null); + return t; + } + + + /** + * 获取BeanCopier对象 如果缓存中有从缓存中获取 如果没有则新创建对象并加入缓存 + * @param sourceClass + * @param targetClass + * @return + */ + private static org.springframework.cglib.beans.BeanCopier getBeanCopier(Class sourceClass, Class targetClass) { + String key = getKey(sourceClass.getName(), targetClass.getName()); + org.springframework.cglib.beans.BeanCopier beanCopier; + beanCopier = BEAN_COPIER_MAP.get(key); + if (beanCopier == null) { + beanCopier = org.springframework.cglib.beans.BeanCopier.create(sourceClass, targetClass, false); + BEAN_COPIER_MAP.put(key, beanCopier); + } + return beanCopier; + } + + /** + * 生成缓存key + */ + private static String getKey(String sourceClassName, String targetClassName) { + return sourceClassName + targetClassName; + } +} diff --git a/src/main/java/com/xkrs/utils/CommonConstant.java b/src/main/java/com/xkrs/utils/CommonConstant.java new file mode 100644 index 0000000..19933c7 --- /dev/null +++ b/src/main/java/com/xkrs/utils/CommonConstant.java @@ -0,0 +1,177 @@ +package com.xkrs.utils; + +/** + * @author XinYi Song + */ +public interface CommonConstant { + + /** + * 正常状态 + */ + public static final String STATUS_NORMAL = "0"; + + /** + * 禁用状态 + */ + public static final String STATUS_DISABLE = "1"; + + /** + * 删除标志 + */ + public static final String DEL_FLAG_1 = "1"; + + /** + * 未删除 + */ + public static final String DEL_FLAG_0 = "0"; + + /** + * 系统日志类型: 登录 + */ + public static final int LOG_TYPE_1 = 1; + + /** + * 系统日志类型: 操作 + */ + public static final int LOG_TYPE_2 = 2; + + /** + * 操作日志类型: 查询 + */ + public static final int OPERATE_TYPE_1 = 1; + + /** + * 操作日志类型: 添加 + */ + public static final int OPERATE_TYPE_2 = 2; + + /** + * 操作日志类型: 更新 + */ + public static final int OPERATE_TYPE_3 = 3; + + /** + * 操作日志类型: 删除 + */ + public static final int OPERATE_TYPE_4 = 4; + + /** + * 操作日志类型: 倒入 + */ + public static final int OPERATE_TYPE_5 = 5; + + /** + * 操作日志类型: 导出 + */ + public static final int OPERATE_TYPE_6 = 6; + + + /** {@code 500 Server Error} (HTTP/1.0 - RFC 1945) */ + public static final Integer SC_INTERNAL_SERVER_ERROR_500 = 500; + public static final Integer SC_INTERNAL_SERVER_ERROR_501 = 501; + public static final Integer SC_INTERNAL_SERVER_ERROR_502 = 502; + /** {@code 200 OK} (HTTP/1.0 - RFC 1945) */ + public static final Integer SC_OK_200 = 200; + public static final Integer SC_OK_201 = 201; + public static final Integer SC_OK_202 = 202; + + public static final Integer SC_OK_300 = 300; + public static final Integer SC_OK_301 = 301; + /**访问权限认证未通过 510*/ + public static final Integer SC_JEECG_NO_AUTHZ=510; + + /** 登录用户Shiro权限缓存KEY前缀 */ + public static String PREFIX_USER_SHIRO_CACHE = "shiro:cache:org.jeecg.modules.shiro.authc.ShiroRealm.authorizationCache:"; + /** 登录用户Token令牌缓存KEY前缀 */ + public static final String PREFIX_USER_TOKEN = "prefix_user_token_"; + /** Token缓存时间:3600秒即一小时 */ + public static final int TOKEN_EXPIRE_TIME = 3600; + + + /** + * 0:一级菜单 + */ + public static final Integer MENU_TYPE_0 = 0; + /** + * 1:子菜单 + */ + public static final Integer MENU_TYPE_1 = 1; + /** + * 2:按钮权限 + */ + public static final Integer MENU_TYPE_2 = 2; + + /**通告对象类型(USER:指定用户,ALL:全体用户)*/ + public static final String MSG_TYPE_UESR = "USER"; + public static final String MSG_TYPE_ALL = "ALL"; + + /**发布状态(0未发布,1已发布,2已撤销)*/ + public static final String NO_SEND = "0"; + public static final String HAS_SEND = "1"; + public static final String HAS_CANCLE = "2"; + + /**阅读状态(0未读,1已读)*/ + public static final String HAS_READ_FLAG = "1"; + public static final String NO_READ_FLAG = "0"; + + /**优先级(L低,M中,H高)*/ + public static final String PRIORITY_L = "L"; + public static final String PRIORITY_M = "M"; + public static final String PRIORITY_H = "H"; + + /** + * 短信模板方式 0 .登录模板、1.注册模板、2.忘记密码模板 + * 3 信息变更 + */ + public static final String SMS_TPL_TYPE_0 = "0"; + public static final String SMS_TPL_TYPE_1 = "1"; + public static final String SMS_TPL_TYPE_2 = "2"; + public static final String SMS_TPL_TYPE_3 = "3"; + /** + * 状态(0无效1有效) + */ + public static final String STATUS_0 = "0"; + public static final String STATUS_1 = "1"; + + /** + * 同步工作流引擎1同步0不同步 + */ + public static final Integer ACT_SYNC_1 = 1; + public static final Integer ACT_SYNC_0 = 0; + + /** + * 消息类型1:通知公告2:系统消息 + */ + public static final String MSG_CATEGORY_1 = "1"; + public static final String MSG_CATEGORY_2 = "2"; + + /** + * 是否配置菜单的数据权限 1是0否 + */ + public static final Integer RULE_FLAG_0 = 0; + public static final Integer RULE_FLAG_1 = 1; + + /** + * 是否用户已被冻结 1正常(解冻) 2冻结 + */ + public static final String USER_UNFREEZE = "1"; + public static final String USER_FREEZE = "2"; + + /** + * 文件上传类型(本地:local,Minio:minio,阿里云:alioss) + */ + public static final String UPLOAD_TYPE_LOCAL = "local"; + public static final String UPLOAD_TYPE_MINIO = "minio"; + public static final String UPLOAD_TYPE_OSS = "alioss"; + + + /** + * 收入明细 (1:收入 2:支出) + */ + public static final Integer USER_IDENTITY_1 = 1; + public static final Integer USER_IDENTITY_2 = 2; + + + + +} diff --git a/src/main/java/com/xkrs/utils/CopyPropertiesUtil.java b/src/main/java/com/xkrs/utils/CopyPropertiesUtil.java new file mode 100644 index 0000000..03155f8 --- /dev/null +++ b/src/main/java/com/xkrs/utils/CopyPropertiesUtil.java @@ -0,0 +1,54 @@ +package com.xkrs.utils; + +import java.lang.reflect.Field; +import java.lang.reflect.Method; + +/** + * 复制源对象的属性值 + * @Author tajochen + */ +public class CopyPropertiesUtil { + + /** + * 复制源对象和目标对象的属性值 + * @param source 源对象 + * @param target 目标对象 + * @throws SecurityException + * @throws IllegalArgumentException + */ + public static void copy(Object source, Object target) { + //得到对象的Class + Class sourceClass = source.getClass(); + Class targetClass = target.getClass(); + //得到Class对象的所有属性 + Field[] sourceFields = sourceClass.getDeclaredFields(); + Field[] targetFields = targetClass.getDeclaredFields(); + + for(Field sourceField : sourceFields){ + //属性名 + String name = sourceField.getName(); + //属性类型 + Class type = sourceField.getType(); + String methodName = name.substring(0, 1).toUpperCase() + name.substring(1); + try{ + //得到属性对应get方法 + Method getMethod = sourceClass.getMethod("get" + methodName); + //执行源对象的get方法得到属性值 + Object value = getMethod.invoke(source); + //目标对象的属性名 + for(Field targetField : targetFields){ + String targetName = targetField.getName(); + if(targetName.equals(name)){ + //属性对应的set方法 + Method setMethod = targetClass.getMethod("set" + methodName, type); + //执行目标对象的set方法 + setMethod.invoke(target, value); + } + } + } + catch (Exception e){ + e.printStackTrace(); + } + } + } +} diff --git a/src/main/java/com/xkrs/utils/CustomizeResultCode.java b/src/main/java/com/xkrs/utils/CustomizeResultCode.java new file mode 100644 index 0000000..0d8756d --- /dev/null +++ b/src/main/java/com/xkrs/utils/CustomizeResultCode.java @@ -0,0 +1,14 @@ +package com.xkrs.utils; + +/** + * @author XinYi Song + * @Description 自定义错误信息接口 + */ +public interface CustomizeResultCode { + + /** + * 获取错误状态码 + * @return 错误状态码 + */ + String getCode(); +} diff --git a/src/main/java/com/xkrs/utils/DateTimeUtil.java b/src/main/java/com/xkrs/utils/DateTimeUtil.java new file mode 100644 index 0000000..835b97c --- /dev/null +++ b/src/main/java/com/xkrs/utils/DateTimeUtil.java @@ -0,0 +1,205 @@ +package com.xkrs.utils; + +import java.time.Instant; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.ZoneOffset; +import java.time.format.DateTimeFormatter; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * 日期时间工具 + * @author tajochen + */ +public class DateTimeUtil { + + private final static String COMMON_PATTERN_DATETIME = "yyyy-MM-dd HH:mm:ss"; + private final static String COMMON_PATTERN_DATE = "yyyy-MM-dd"; + private final static DateTimeFormatter COMMON_FORMATTER_DATETIME = DateTimeFormatter.ofPattern(COMMON_PATTERN_DATETIME); + private final static DateTimeFormatter COMMON_FORMATTER_DATE = DateTimeFormatter.ofPattern(COMMON_PATTERN_DATE); + private final static ZoneOffset DEFAULT_ZONE_OFFSET = ZoneOffset.of("+8"); + + /** + * 字符串转LocalDate + * @param date + * @return + */ + public static LocalDate stringToDate(String date) { + assert date != null; + return LocalDate.parse(date, COMMON_FORMATTER_DATE); + } + + /** + * LocalDate转字符串 + * @param date + * @return + */ + public static String dateToString(LocalDate date) { + assert date != null; + return COMMON_FORMATTER_DATE.format(date); + } + + /** + * LocalDateTime转字符串 + * @param dateTime + * @return + */ + public static String dateTimeToString(LocalDateTime dateTime) { + assert dateTime != null; + return COMMON_FORMATTER_DATETIME.format(dateTime); + } + + /** + * 字符串转LocalDateTime + * @param dateStr + * @return + */ + public static LocalDateTime stringToDateTime(String dateStr) { + assert dateStr != null; + return LocalDateTime.parse(dateStr, COMMON_FORMATTER_DATETIME); + } + + /** + * 字符串转Instant时间戳 + * @param str + * @return + */ + public static Instant stringToInstant(String str) { + assert str != null; + return stringToDateTime(str).toInstant(DEFAULT_ZONE_OFFSET); + } + + /** + * LocalDateTime转字符串(格式化) + * @param dateTime + * @param formatter + * @return + */ + public static String dateToStringFormatter(LocalDateTime dateTime, DateTimeFormatter formatter) { + assert dateTime != null; + return formatter.format(dateTime); + } + + /** + * 字符串转LocalDateTime(格式化) + * @param dateStr + * @param formatter + * @return + */ + public static LocalDateTime stringToDateTimeFormatter(String dateStr, DateTimeFormatter formatter) { + assert dateStr != null; + return LocalDateTime.parse(dateStr, formatter); + } + + /** + * 字符串转 local date + * @param dateStr + * @return + */ + public static LocalDate stringToDateFormatter(String dateStr){ + LocalDate date = LocalDate.parse(dateStr, COMMON_FORMATTER_DATE); + return date; + } + + + /** + * 日期转时间戳 + * @param dateTime + * @return + */ + public static long dateToTimeMillis(LocalDateTime dateTime) { + assert dateTime != null; + return dateTime.toInstant(DEFAULT_ZONE_OFFSET).toEpochMilli(); + } + + /** + * 时间戳转日期 + * @param timeMillis + * @return + */ + public static LocalDateTime timeMillisToDate(long timeMillis) { + Instant instant = Instant.ofEpochMilli(timeMillis); + return LocalDateTime.ofInstant(instant, DEFAULT_ZONE_OFFSET); + } + + /** + * 时间戳转时间 + * @param timeMillis + * @return + */ + public static LocalDateTime timeMillisToTime(long timeMillis) { + LocalDateTime dateTime =LocalDateTime.ofEpochSecond(timeMillis,0, DEFAULT_ZONE_OFFSET); + return dateTime; + } + + /** + * 获取当前时间 hh:mm:ss:nnn + * @return + */ + public static LocalDateTime getNowTime() { + LocalDateTime now = LocalDateTime.now(); + return now; + } + + /** + * 获取当前日期 yyyy-MM-dd + * @return + */ + public static LocalDate getToday() { + LocalDate now = LocalDate.now(); + return now; + } + + /** + * 获取当前 Instant 时间戳 + * @return + */ + public static Instant getInstant() { + Instant timeStamp = Instant.now(); + return timeStamp; + } + + /** + * 判断日期格式是否合法 "yyyy-MM-dd" + * @param strDate + * @return + */ + public static boolean isValidDate(String strDate) { + final int minLen = 10; + if(strDate == null || strDate.length() < minLen) { + return false; + } + //正则表达式校验日期格式 yyyy-MM-dd + String eL = "(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-" + + "(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})" + + "(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29)(([0-9]{3}[1-9]|[0-9]{2}[1-9]" + + "[0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-" + + "(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|" + + "((0[48]|[2468][048]|[3579][26])00))-02-29)"; + Pattern pat = Pattern.compile(eL); + Matcher matcher = pat.matcher(strDate); + return matcher.matches(); + } + + /** + * 判断时间格式 格式必须为 "YYYY-MM-DD HH:mm:ss" + * @param sDateTime + * @return + */ + public static boolean isValidDateTime(String sDateTime) { + final int minLen = 19; + if ((sDateTime == null) || (sDateTime.length() < minLen)) { + return false; + } + String eL = "(((01[0-9]{2}|0[2-9][0-9]{2}|[1-9][0-9]{3})-(0?[13578]|1[02])-" + + "(0?[1-9]|[12]\\\\d|3[01]))|((01[0-9]{2}|0[2-9][0-9]{2}|[1-9][0-9]{3})-" + + "(0?[13456789]|1[012])-(0?[1-9]|[12]\\\\d|30))|((01[0-9]{2}|0[2-9][0-9]{2}|[1-9][0-9]{3})-0?2-" + + "(0?[1-9]|1\\\\d|2[0-8]))|(((1[6-9]|[2-9]\\\\d)(0[48]|[2468][048]|[13579][26])|((04|08|12|16|[2468][048]|" + + "[3579][26])00))-0?2-29)) (20|21|22|23|[0-1]?\\\\d):[0-5]?\\\\d:[0-5]?\\\\d"; + Pattern pat = Pattern.compile(eL); + Matcher matcher = pat.matcher(sDateTime); + return matcher.matches(); + } + +} diff --git a/src/main/java/com/xkrs/utils/EncryptDecryptUtil.java b/src/main/java/com/xkrs/utils/EncryptDecryptUtil.java new file mode 100644 index 0000000..7ef363e --- /dev/null +++ b/src/main/java/com/xkrs/utils/EncryptDecryptUtil.java @@ -0,0 +1,66 @@ +package com.xkrs.utils; + +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; + +/** + * SHA加密解密工具 + * @author tajochen + */ +public class EncryptDecryptUtil { + + /** + * SHA-256加密 + * @param strText + * @return + */ + public static String encry256(final String strText){ + return encrySha(strText,"SHA-256"); + } + + /** + * SHA-512加密 + * @param strText + * @return + */ + public static String encry512(final String strText){ + return encrySha(strText,"SHA-512"); + } + + /** + * 基础SHA加密 + * @param strText + * @param strType + * @return + */ + private static String encrySha(final String strText, final String strType){ + // 返回值 + String strResult=null; + // 是否是有效的字符串 + if (strText != null && strText.length()>0){ + // 加密开始,创建加密对象,并传入加密类型 + try { + MessageDigest messageDigest = MessageDigest.getInstance(strType); + // 传入加密的字符串 + messageDigest.update(strText.getBytes()); + // 得到bytes类型结果 + byte[] byteBuffer = messageDigest.digest(); + StringBuilder strHexString = new StringBuilder(); + for (byte b : byteBuffer) { + String hex = Integer.toHexString(0xff & b); + if (hex.length() == 1) { + strHexString.append('0'); + } + strHexString.append(hex); + } + // 得到返回的结果 + strResult = strHexString.toString(); + } + catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + } + } + return strResult; + } +} + diff --git a/src/main/java/com/xkrs/utils/EntityManagerUtil.java b/src/main/java/com/xkrs/utils/EntityManagerUtil.java new file mode 100644 index 0000000..ac1ede1 --- /dev/null +++ b/src/main/java/com/xkrs/utils/EntityManagerUtil.java @@ -0,0 +1,36 @@ +package com.xkrs.utils; + +import java.lang.reflect.Constructor; +import java.util.ArrayList; +import java.util.List; + +/** + * @author XinYi Song + */ +public class EntityManagerUtil { + /** + * 把List转换成List + */ + public static List objectToBean(List objList, Class clz) throws Exception{ + if (objList==null || objList.size()==0) { + return null; + } + + Class[] cz = null; + Constructor[] cons = clz.getConstructors(); + for (Constructor ct : cons) { + Class[] clazz = ct.getParameterTypes(); + if (objList.get(0).length == clazz.length) { + cz = clazz; + break; + } + } + + List list = new ArrayList(); + for (Object[] obj : objList) { + Constructor cr = clz.getConstructor(cz); + list.add(cr.newInstance(obj)); + } + return list; + } +} diff --git a/src/main/java/com/xkrs/utils/ExcelImportUtil.java b/src/main/java/com/xkrs/utils/ExcelImportUtil.java new file mode 100644 index 0000000..8788901 --- /dev/null +++ b/src/main/java/com/xkrs/utils/ExcelImportUtil.java @@ -0,0 +1,193 @@ +package com.xkrs.utils; + +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.*; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.springframework.web.multipart.MultipartFile; + +import java.io.InputStream; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.*; + +/** + * @author ZHY + * @date 2020/6/17 15:56 + */ +public class ExcelImportUtil { + private Workbook wb; + private Sheet sheet; + private Row row; + + String xls = ".xls"; + String xlsx = ".xlsx"; + + /** + * 读取Excel + * + * @author ZHY + */ + public ExcelImportUtil(MultipartFile file) throws Exception { + String filename = file.getOriginalFilename(); + String ext = filename.substring(filename.lastIndexOf(".")); + InputStream is = file.getInputStream(); + if (xls.equals(ext)) { + wb = new HSSFWorkbook(is); + } else if (xlsx.equals(ext)) { + wb = new XSSFWorkbook(is); + } else { + wb = null; + } + } + + /** + * 读取Excel表格表头的内容输出 + * + */ + public List> readExcelTitleOut() { + List> list = new ArrayList>(); + if (wb != null) { + sheet = wb.getSheetAt(0); + row = sheet.getRow(0); + // 标题总列数 + int colNum = row.getPhysicalNumberOfCells(); + + System.out.println("colNum:" + colNum); + + Map map = new LinkedHashMap(); + + for (int i = 0; i < colNum; i++) { + String stringCellValue = row.getCell(i).getStringCellValue(); + map.put(stringCellValue, null); + } + list.add(map); + return list; + } + return list; + } + + /** + * 读取Excel表格表头 + * + */ + public String[] readExcelTitle() { + String[] title = {}; + if (wb != null) { + sheet = wb.getSheetAt(0); + row = sheet.getRow(0); + // 标题总列数 + int colNum = row.getPhysicalNumberOfCells(); + + System.out.println("colNum:" + colNum); + + title = new String[colNum]; + + for (int i = 0; i < colNum; i++) { + Cell cell = row.getCell(i); + title[i] = cell.getStringCellValue().replaceAll("\\s+", ""); + } + } + return title; + } + + /** + * 读取Excel表格的某一个数值 + * @return + */ + public Map readExcelSomeTitle(){ + Map map = new LinkedHashMap<>(); + if (wb != null) { + sheet = wb.getSheetAt(0); + String title = parseExcel(sheet.getRow(2).getCell(1)); + String remark = parseExcel(sheet.getRow(3).getCell(1)); + map.put("date",title); + map.put("remark",remark); + } + return map; + } + + /** + * 读取Excel数据内容 + * + */ + public List> readExcelContent() { + List> list = new ArrayList<>(); + if (wb != null) { + //获取sheet表 + sheet = wb.getSheetAt(0); + // 得到总行数 + int rowNum = sheet.getLastRowNum(); + //获取表头的标题 + String[] readExcelTitle = readExcelTitle(); + // 正文内容应该从第二行开始,第一行为表头的标题 + for (int i = 1; i <= rowNum; i++) { + row = sheet.getRow(i); + if (row == null) { + continue; + } + Map map = new LinkedHashMap<>(); + for (int j = 0; j < readExcelTitle.length; j++) { + //获取每一列的数据值 + String str = parseExcel(row.getCell(j)); + //判断对应行的列值是否为空 + if (str != null || "".equals(str)) { + //表头的标题为键值,列值为值 + map.put(readExcelTitle[j], str); + } + } + //判段添加的对象是否为空 + if (!map.isEmpty()){ + list.add(map); + } + } + } + return list; + } + + /** + * + * 根据Cell类型设置数据 + * + */ + int ss = 20; + int xx = 58; + private String parseExcel(Cell cell) { + String result = ""; + if (cell != null) { + SimpleDateFormat sdf = null; + switch (cell.getCellType()) { + // 数字类型 + case NUMERIC: + // 处理日期格式、时间格式 + if (DateUtil.isCellDateFormatted(cell)) { + if (cell.getCellStyle().getDataFormat() == ss) { + sdf = new SimpleDateFormat("HH:mm"); + } else {// 日期 + sdf = new SimpleDateFormat("yyyy-MM-dd"); + } + String dateFormat = sdf.format(cell.getDateCellValue()); + result = dateFormat; + } else if (cell.getCellStyle().getDataFormat() == xx) { + // 处理自定义日期格式:m月d日(通过判断单元格的格式id解决,id的值是58) + sdf = new SimpleDateFormat("yyyy-MM-dd"); + double value = cell.getNumericCellValue(); + Date date = DateUtil.getJavaDate(value); + result = sdf.format(date); + } else { + double value = cell.getNumericCellValue(); + DecimalFormat format = new DecimalFormat("#.###########"); + String strVal = format.format(value); + result = strVal; + } + break; + // String类型 + case STRING: + result = cell.getRichStringCellValue().toString(); + break; + default: + break; + } + } + return result; + } +} diff --git a/src/main/java/com/xkrs/utils/FileUtil.java b/src/main/java/com/xkrs/utils/FileUtil.java new file mode 100644 index 0000000..02838c2 --- /dev/null +++ b/src/main/java/com/xkrs/utils/FileUtil.java @@ -0,0 +1,127 @@ +package com.xkrs.utils; + +import org.apache.commons.codec.binary.Base64; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.*; + +/** + * @author XinYi Song + */ +public class FileUtil { + /** + * 根据base64判断图片是否为tiff + * @param base64 + * @return + */ + public boolean checkImageBase64Format(String base64) { + byte[] b=java.util.Base64.getDecoder().decode(base64); + try { + // 判断是否为tiff格式 + if((b[0] & 0xFF) == 0x49 && (b[1] & 0xFF)==0x49 && (b[2] & 0xFF)==0x2A){ + return true; + }else { + return false; + } + }catch(Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 根据BASE64字符串生成图片文件,此方法生成tiff格式 + * @param base64 + * @param fileName + * @param dictionary + */ + public void base64ToFile(String base64,String fileName,String dictionary) { + File file =null; + File dir=new File(dictionary); + // 无目录的情况下创建一个目录,会受权限影响,最好是已存在的目录 + if(!dir.exists() && dir.isDirectory()) { + dir.mkdirs(); + } + FileOutputStream fos=null; + BufferedOutputStream bos=null; + + try { + byte [] bytes=java.util.Base64.getDecoder().decode(base64); + //目录+文件名作为输出文件的全路径 + file=new File(dictionary+fileName); + fos= new FileOutputStream(file); + bos=new BufferedOutputStream(fos); + bos.write(bytes); + }catch(Exception e) { + e.printStackTrace(); + }finally { + if(bos!=null) { + try { + bos.close(); + }catch(IOException e) { + e.printStackTrace(); + } + } + if(fos!=null) { + try { + fos.close(); + }catch(IOException e) { + e.printStackTrace(); + } + } + } + + + } + + + /** + * 将tiff图片转化为jpg,生成新的文件 + * @param oldPath 原图片的全路径 + * @param newPath 生成新的图片的全路径 + */ + public void tiffToJpg(String oldPath,String newPath) { + try { + BufferedImage bufferegImage= ImageIO.read(new File(oldPath)); + //可以是png等其它图片格式 + ImageIO.write(bufferegImage,"jpg",new File(newPath)); + + }catch(IOException e) { + e.printStackTrace(); + } + } + + /** + * 将任意图片文件转为base64,读字节是最快的方式 + * @param filePath 图片文件的全路径 + * @return + */ + public String imageToBase64(String filePath) { + byte [] data =null; + try { + InputStream in =new FileInputStream(filePath); + data=new byte[in.available()]; + in.read(data); + in.close(); + }catch(Exception e) { + e.printStackTrace(); + return null; + } + + return new String(Base64.encodeBase64(data)); + } + + public static void main(String[] args) { + String oldPath = "C:/Users/xkrs/Desktop/WF/分布/maize"; + String newPath = "E:/img"; + try { + BufferedImage bufferegImage=ImageIO.read(new File(oldPath)); + //可以是png等其它图片格式 + ImageIO.write(bufferegImage,"jpg",new File(newPath)); + + }catch(IOException e) { + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/xkrs/utils/HashUtil.java b/src/main/java/com/xkrs/utils/HashUtil.java new file mode 100644 index 0000000..2aa3a99 --- /dev/null +++ b/src/main/java/com/xkrs/utils/HashUtil.java @@ -0,0 +1,40 @@ +package com.xkrs.utils; + +import java.security.MessageDigest; + +/** + * md5加密解密工具 + * @author tajochen + */ +public class HashUtil { + + /** + * MD5加密 + * + * @param password + * @return + */ + public static String md5Encode(String password) { + MessageDigest md5 = null; + try { + md5 = MessageDigest.getInstance("MD5"); + } catch (Exception e) { + throw new RuntimeException(e); + } + char[] charArray = password.toCharArray(); + byte[] byteArray = new byte[charArray.length]; + for (int i = 0; i < charArray.length; i++){ + byteArray[i] = (byte) charArray[i]; + } + byte[] md5Bytes = md5.digest(byteArray); + StringBuilder hexValue = new StringBuilder(); + for (byte md5Byte : md5Bytes) { + int val = ((int) md5Byte) & 0xff; + if (val < 16) { + hexValue.append("0"); + } + hexValue.append(Integer.toHexString(val)); + } + return hexValue.toString(); + } +} diff --git a/src/main/java/com/xkrs/utils/IpUtil.java b/src/main/java/com/xkrs/utils/IpUtil.java new file mode 100644 index 0000000..ae88933 --- /dev/null +++ b/src/main/java/com/xkrs/utils/IpUtil.java @@ -0,0 +1,42 @@ +package com.xkrs.utils; + +import javax.servlet.http.HttpServletRequest; + +/** + * IP地址处理工具 + * @author tajochen + */ +public class IpUtil { + + public static String getIpAddr(HttpServletRequest request) { + String ip = request.getHeader("x-forwarded-for"); + final String unkonwMsg = "unknown"; + final char splitChar = ','; + if (ip != null && ip.length() != 0 && !unkonwMsg.equalsIgnoreCase(ip)) { + // 多次反向代理后会有多个ip值,第一个ip才是真实ip + if( ip.indexOf(splitChar)!=-1 ){ + ip = ip.split(",")[0]; + } + } + if (ip == null || ip.length() == 0 || unkonwMsg.equalsIgnoreCase(ip)) { + ip = request.getHeader("Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || unkonwMsg.equalsIgnoreCase(ip)) { + ip = request.getHeader("WL-Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || unkonwMsg.equalsIgnoreCase(ip)) { + ip = request.getHeader("HTTP_CLIENT_IP"); + } + if (ip == null || ip.length() == 0 || unkonwMsg.equalsIgnoreCase(ip)) { + ip = request.getHeader("HTTP_X_FORWARDED_FOR"); + } + if (ip == null || ip.length() == 0 || unkonwMsg.equalsIgnoreCase(ip)) { + ip = request.getHeader("X-Real-IP"); + } + if (ip == null || ip.length() == 0 || unkonwMsg.equalsIgnoreCase(ip)) { + ip = request.getRemoteAddr(); + } + System.out.println("获取客户端ip: " + ip); + return ip; + } +} diff --git a/src/main/java/com/xkrs/utils/JdbcUtils.java b/src/main/java/com/xkrs/utils/JdbcUtils.java new file mode 100644 index 0000000..a678d74 --- /dev/null +++ b/src/main/java/com/xkrs/utils/JdbcUtils.java @@ -0,0 +1,35 @@ +package com.xkrs.utils; + +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; + +/** + * @author XinYi Song + */ +@Component +public class JdbcUtils { + @Resource + private JdbcTemplate jdbcTemplate; + + /** + * jdbcTemplate,batchUpdate增加,需自己定义sql,需要配置 + * @param list + */ + /*public List batchWithJdbcTemplate(List list){ + String sql = "Insert into fire_task_photo(photo_fire_code,task_photo) values(?,?)"; + jdbcTemplate.batchUpdate(sql,new BatchPreparedStatementSetter() { + @Override + public void setValues(PreparedStatement ps, int i) throws SQLException { + ps.setString(1,list.get(i).getPhotoFireCode()); + ps.setString(2,list.get(i).getTaskPhoto()); + } + @Override + public int getBatchSize() { + return list.size(); + } + }); + return list; + }*/ +} diff --git a/src/main/java/com/xkrs/utils/NumberUtil.java b/src/main/java/com/xkrs/utils/NumberUtil.java new file mode 100644 index 0000000..2ead0c3 --- /dev/null +++ b/src/main/java/com/xkrs/utils/NumberUtil.java @@ -0,0 +1,21 @@ +package com.xkrs.utils; + +/** + * 数字工具 + * @author tajochen + */ +public class NumberUtil { + + public static boolean isStrNumeric(String str) { + if(str==null||str.length()==0){ + return false; + } + for (int i = 0; i < str.length(); i++) { + System.out.println(str.charAt(i)); + if (!Character.isDigit(str.charAt(i))) { + return false; + } + } + return true; + } +} diff --git a/src/main/java/com/xkrs/utils/ObjectToBeanUtils.java b/src/main/java/com/xkrs/utils/ObjectToBeanUtils.java new file mode 100644 index 0000000..1caf481 --- /dev/null +++ b/src/main/java/com/xkrs/utils/ObjectToBeanUtils.java @@ -0,0 +1,152 @@ +package com.xkrs.utils; + + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author XinYi Song + */ +public class ObjectToBeanUtils { + + public static Logger log = LoggerFactory.getLogger(ObjectToBeanUtils.class); + + /** + * 把List转换成List + */ + public static List objectToBean(List objList, Class clz) throws Exception{ + if (objList==null || objList.size()==0) { + return null; + } + + Class[] cz = null; + Constructor[] cons = clz.getConstructors(); + for (Constructor ct : cons) { + Class[] clazz = ct.getParameterTypes(); + if (objList.get(0).length == clazz.length) { + cz = clazz; + break; + } + } + + List list = new ArrayList(); + for (Object[] obj : objList) { + Constructor cr = clz.getConstructor(cz); + list.add(cr.newInstance(obj)); + } + return list; + } + + + + + + + public static List objectToBeans(List objList, Class clz) throws Exception{ + if (objList==null || objList.size()==0) { + return null; + } + + int length = objList.get(0).length; + log.info("*************>"+length); + + Class[] cz = null; + Constructor[] cons = clz.getConstructors(); + for (Constructor ct : cons) { + Class[] clazz = ct.getParameterTypes(); + if (objList.get(0).length == clazz.length) { + cz = clazz; + break; + } + } + + List list = new ArrayList(); + log.info("---------->"+objList.get(0)); + Constructor cr = clz.getConstructor(cz); + T newInstance = cr.newInstance((Object) objList.get(0)); + list.add(newInstance); + return list; + } + + + public static List castEntity(List list, Class clazz, Object model) { + List returnList = new ArrayList(); + if (list.isEmpty()) { + return returnList; + } + //获取每个数组集合的元素个数 + Object[] co = list.get(0); + + //获取当前实体类的属性名、属性值、属性类别 + List attributeInfoList = getFiledsInfo(model); + //创建属性类别数组 + Class[] c2 = new Class[attributeInfoList.size()]; + //如果数组集合元素个数与实体类属性个数不一致则发生错误 + if (attributeInfoList.size() != co.length) { + return returnList; + } + //确定构造方法 + for (int i = 0; i < attributeInfoList.size(); i++) { + c2[i] = (Class) attributeInfoList.get(i).get("type"); + } + try { + for (Object[] o : list) { + Constructor constructor = clazz.getConstructor(c2); + returnList.add(constructor.newInstance(o)); + } + } catch (Exception ex) { + log.info("实体数据转化为实体类发生异常:异常信息:{}", ex.getMessage()); + return returnList; + } + return returnList; + } + + /** + * 根据属性名获取属性值 + * + * @param fieldName 属性名 + * @param modle 实体类 + * @return 属性值 + */ + private static Object getFieldValueByName(String fieldName, Object modle) { + try { + String firstLetter = fieldName.substring(0, 1).toUpperCase(); + String getter = "get" + firstLetter + fieldName.substring(1); + Method method = modle.getClass().getMethod(getter, new Class[]{}); + Object value = method.invoke(modle, new Object[]{}); + return value; + } catch (Exception e) { + return null; + } + } + + /** + * 获取属性类型(type),属性名(name),属性值(value)的map组成的list + * + * @param model 实体类 + * @return list集合 + */ + private static List getFiledsInfo(Object model) { + Field[] fields = model.getClass().getDeclaredFields(); + List list = new ArrayList(fields.length); + Map infoMap = null; + for (int i = 0; i < fields.length; i++) { + infoMap = new HashMap(3); + infoMap.put("type", fields[i].getType()); + infoMap.put("name", fields[i].getName()); + infoMap.put("value", getFieldValueByName(fields[i].getName(), model)); + list.add(infoMap); + } + return list; + } + + +} diff --git a/src/main/java/com/xkrs/utils/OpenGeoUtil.java b/src/main/java/com/xkrs/utils/OpenGeoUtil.java new file mode 100644 index 0000000..cc1b03a --- /dev/null +++ b/src/main/java/com/xkrs/utils/OpenGeoUtil.java @@ -0,0 +1,37 @@ +package com.xkrs.utils; + +import org.geolatte.geom.Geometry; +import org.geolatte.geom.Point; +import org.geolatte.geom.codec.Wkt; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * 开源Gis工具集 + * @author tajochen + */ +public class OpenGeoUtil { + + Logger logger = LoggerFactory.getLogger(OpenGeoUtil.class); + + /** + * wkt文本转为点数据 + * @param wkt + * @return + */ + public static Point wktStrToPoint(String wkt) { + Point point = (Point) Wkt.fromWkt(wkt); + return point; + } + + /** + * wkt文本转geometry + * @param wkt + * @return + */ + public static Geometry wktStrToGeom(String wkt) { + Geometry geom = Wkt.fromWkt(wkt); + return geom; + } + +} diff --git a/src/main/java/com/xkrs/utils/PhotoUtil.java b/src/main/java/com/xkrs/utils/PhotoUtil.java new file mode 100644 index 0000000..574c6c9 --- /dev/null +++ b/src/main/java/com/xkrs/utils/PhotoUtil.java @@ -0,0 +1,188 @@ +package com.xkrs.utils; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.UUID; + +/** + * @author XinYi Song + */ +public class PhotoUtil { + + public static Logger log = LoggerFactory.getLogger(PhotoUtil.class); + + /** + * 上传单张图片 + * @param imgFile + * @return + * @throws IOException + */ + public static String memoryPhoto(MultipartFile imgFile,String distributedTime,String distributedType) throws IOException { + //String uploadPath = "http://139.199.98.175:2088/wfTaskImage/"; + String uploadPath = "http://192.168.2.172/"; + //获取原始文件名 + String originalFilename = imgFile.getOriginalFilename(); + if (originalFilename != null && !"".equals(originalFilename)) { + //找到 . 的位置 + int index = originalFilename.lastIndexOf("."); + //根据 . 的位置进行分割,拿到文件后缀名 + String suffix = originalFilename.substring(index); + //uuid生成新的文件名 + String newName = UUID.randomUUID().toString() + suffix; + + //将图片保存到本地/usr/etc/images/Folder + File file = new File("E:/img/"); + if (!file.exists()) { + file.mkdirs(); + } + String path = "E:/img/" + newName; + String uploadsImage = uploadPath + newName; + //实现上传 + imgFile.transferTo(new File(path)); + + + return "video/"+newName; + } + return null; + } + + /** + * 以文件形式,批量上传图片 + * @param files + * @return + * @throws IOException + */ + /*public static List uploadImage(MultipartFile[] files, String fireCode) throws IOException { + String uploadPath = "http://139.199.98.175:2099/wfTaskImage/"; + String newName = ""; + String oldName = ""; + List fireTaskPhotos = new ArrayList<>(); + for(MultipartFile file : files){ + //获取file图片名称 + oldName = file.getOriginalFilename(); + //找到 . 的位置 + int index = oldName.lastIndexOf("."); + //根据 . 的位置进行分割,拿到文件后缀名 + String suffix = oldName.substring(index); + //uuid生成新的文件名 + newName = UUID.randomUUID().toString() + suffix; + //将图片保存到本地/usr/etc/images/Folder + File file1 = new File("/home/web/wf-fire-service/wfTaskImage/"); + //File file1 = new File("E:/wfTaskImage/"); + if (!file1.exists()) { + file1.mkdirs(); + } + String path = "/home/web/wf-fire-service/wfTaskImage/" + newName; + //String path = "E:/wfTaskImage/" + newName; + String uploadPaths = uploadPath + newName; + //实现上传 + file.transferTo(new File(path)); + FireTaskPhoto fireTaskPhoto = new FireTaskPhoto(); + fireTaskPhoto.setPhotoFireCode(fireCode); + fireTaskPhoto.setTaskPhoto(uploadPaths); + + fireTaskPhotos.add(fireTaskPhoto); + } + return fireTaskPhotos; + }*/ + + + + /** + * 删除本地或服务器储存的图片 + * @param path + * @return + */ + public static String delFile(String path){ + String resultInfo = null; + int lastIndexOf = path.lastIndexOf("/"); + String imgPath = path.substring(lastIndexOf + 1,path.length()); + System.out.println(imgPath); + imgPath = "/usr/local/etc/images/" + imgPath; +// img_path = "/usr/etc/images/Folder/" + img_path; + File file = new File(imgPath); + if(file.exists()){ + if(file.delete()){ + resultInfo = "删除成功!"; + }else { + resultInfo = "删除失败!"; + } + }else { + resultInfo = "文件不存在"; + } + return resultInfo; + } + + /** + * 通过图片路径解析 ,上传保存 + * @param listImgSrc + * @return + */ + public static List downloadImage(List listImgSrc) { + try { + List list = new ArrayList(); + //开始时间 + Date beginDate = new Date(); + for (String url : listImgSrc) { + //开始时间 + Date beginDate2 = new Date(); + String imageName = url.substring(url.lastIndexOf("/") + 1, url.length()); + URL uri = new URL(url); + InputStream in = uri.openStream(); + //String pathUpload = "E:/img/" + imageName; + String pathUpload = "/home/web/wf-fire-service/wfimage/" + imageName; + FileOutputStream fo = new FileOutputStream(new File(pathUpload)); + byte[] buf = new byte[1024]; + int length = 0; + log.info("-------开始下载:" + url); + while ((length = in.read(buf, 0, buf.length)) != -1) { + fo.write(buf, 0, length); + } + in.close(); + fo.close(); + list.add(imageName); + log.info(imageName + "------下载完成"); + //结束时间 + Date overDate2 = new Date(); + double time = overDate2.getTime() - beginDate2.getTime(); + log.info("-----耗时:" + time / 1000 + "s"); + } + Date overDate = new Date(); + double time = overDate.getTime() - beginDate.getTime(); + log.info("======总耗时:" + time / 1000 + "s"); + return list; + } catch (Exception e) { + log.info("++++++下载失败"); + } + return null; + } + + /** + * 删除本地文件夹图片 + * @param url + */ + public static void deleteImage(String url){ + File file=new File(url); + //判断file是否是文件目录 若是返回TRUE + if (file.isDirectory()){ + //name存储file文件夹中的文件名 + String[] name =file.list(); + for (int i=0; i selectProjectByDynamic(String projectNumber, String projectName) { + Specification specification = new Specification() { + @Override + public Predicate toPredicate(Root root, CriteriaQuery criteriaQuery, CriteriaBuilder criteriaBuilder) { + List list = new ArrayList<>(); + if (projectNumber != null && !"".equals(projectNumber)) { + list.add(criteriaBuilder.equal(root.get("projectNumber").as(String.class), projectNumber)); + } + if (projectName != null && !"".equals(projectName)) { + list.add(criteriaBuilder.like(root.get("projectName").as(String.class), "%" + projectName + "%")); + } + Predicate[] predicates = new Predicate[list.size()]; + return criteriaBuilder.and(list.toArray(predicates)); + } + }; + return projectOverviewDao.findAll(specification); + } + + +} \ No newline at end of file diff --git a/src/main/java/com/xkrs/utils/RandomUtil.java b/src/main/java/com/xkrs/utils/RandomUtil.java new file mode 100644 index 0000000..5c34b2d --- /dev/null +++ b/src/main/java/com/xkrs/utils/RandomUtil.java @@ -0,0 +1,62 @@ +package com.xkrs.utils; + +import java.util.Random; +import java.util.UUID; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * 随机字符串产生工具 + * @author tajochen + */ +public class RandomUtil { + /** + * 获取随机字母数字组合 + * @param length + * 字符串长度 + * @return + */ + public static String getRandomCharAndNumr(Integer length) { + String str = ""; + StringBuilder strBuffer = new StringBuilder(); + Random random = new Random(); + for (int i = 0; i < length; i++) { + boolean b = random.nextBoolean(); + // 字符串 + if (b) { + //取得65大写字母还是97小写字母 + int choice = random.nextBoolean() ? 65 : 97; + strBuffer.append((char) (choice + random.nextInt(26))); + } else { + // 数字 + strBuffer.append(random.nextInt(10)); + } + } + str = strBuffer.toString(); + return str; + } + + /** + * 验证随机字母数字组合是否纯数字与纯字母 + * @param str + * @return true 是 , false 否 + */ + public static boolean isRandomUsable(String str) { + // String regExp = + // "^[A-Za-z]+(([0-9]+[A-Za-z0-9]+)|([A-Za-z0-9]+[0-9]+))|[0-9]+(([A-Za-z]+[A-Za-z0-9]+)|([A-Za-z0-9]+[A-Za-z]+))$"; + String regExp = "^([0-9]+)|([A-Za-z]+)$"; + Pattern pat = Pattern.compile(regExp); + Matcher mat = pat.matcher(str); + return mat.matches(); + } + + /** + * 生成UUID + * @return + */ + public static String getUuid32(){ + String uuid = UUID.randomUUID().toString().replace("-", "").toLowerCase(); + return uuid; +//  return UUID.randomUUID().toString().replace("-", "").toLowerCase(); + } +} diff --git a/src/main/java/com/xkrs/utils/Result.java b/src/main/java/com/xkrs/utils/Result.java new file mode 100644 index 0000000..8de9c49 --- /dev/null +++ b/src/main/java/com/xkrs/utils/Result.java @@ -0,0 +1,153 @@ +package com.xkrs.utils; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.io.Serializable; + +/** + * 接口返回数据格式 + * @author XinYi Song + * @email jeecgos@163.com + * @date 2019年1月19日 + */ +@ApiModel(value="接口返回对象", description="接口返回对象") +public class Result implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 成功标志 + */ + @ApiModelProperty(value = "成功标志") + private boolean success = true; + + /** + * 返回处理消息 + */ + @ApiModelProperty(value = "返回处理消息") + private String message = "操作成功!"; + + /** + * 返回代码 + */ + @ApiModelProperty(value = "返回代码") + private Integer code = 0; + + /** + * 返回数据对象 data + */ + @ApiModelProperty(value = "返回数据对象") + private T result; + + /** + * 时间戳 + */ + @ApiModelProperty(value = "时间戳") + private long timestamp = System.currentTimeMillis(); + + public Result() { + + } + + public static long getSerialVersionUid() { + return serialVersionUID; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public T getResult() { + return result; + } + + public void setResult(T result) { + this.result = result; + } + + public long getTimestamp() { + return timestamp; + } + + public void setTimestamp(long timestamp) { + this.timestamp = timestamp; + } + + public Result success(String message) { + this.message = message; + this.code = CommonConstant.SC_OK_200; + this.success = true; + return this; + } + + + public static Result ok() { + Result r = new Result(); + r.setSuccess(true); + r.setCode(CommonConstant.SC_OK_200); + r.setMessage("成功"); + return r; + } + + public static Result ok(String msg) { + Result r = new Result(); + r.setSuccess(true); + r.setCode(CommonConstant.SC_OK_200); + r.setMessage(msg); + return r; + } + + public static Result ok(Object data) { + Result r = new Result(); + r.setSuccess(true); + r.setCode(CommonConstant.SC_OK_200); + r.setResult(data); + return r; + } + + public static Result error(String msg) { + return error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, msg); + } + + public static Result error(int code, String msg) { + Result r = new Result(); + r.setCode(code); + r.setMessage(msg); + r.setSuccess(false); + return r; + } + + public Result error500(String message) { + this.message = message; + this.code = CommonConstant.SC_INTERNAL_SERVER_ERROR_500; + this.success = false; + return this; + } + /** + * 无权限访问返回结果 + */ + public static Result noauth(String msg) { + return error(CommonConstant.SC_JEECG_NO_AUTHZ, msg); + } +} \ No newline at end of file diff --git a/src/main/java/com/xkrs/utils/SnowFlakeUtil.java b/src/main/java/com/xkrs/utils/SnowFlakeUtil.java new file mode 100644 index 0000000..a5ba62d --- /dev/null +++ b/src/main/java/com/xkrs/utils/SnowFlakeUtil.java @@ -0,0 +1,124 @@ +package com.xkrs.utils; + +/** + * 基于Twitter开源的分布式ID生成算法snowflake + * @author tajochen + **/ +public class SnowFlakeUtil { + + /** + * 起始时间戳 + * 2018-01-01 00:00:00 + */ + private final static long START_STMP = 1514736000L; + /** + * 序列在id中占用的位数 + */ + private final static long SEQUENCE_BIT = 12L; + /** + * 机器标识占用的位数 + */ + private final static long MACHINE_BIT = 5L; + /** + * 数据中心占用的位数 + */ + private final static long DATACENTER_BIT = 5L; + /** + * 每一部分的最大值 + */ + private final static long MAX_DATACENTER_NUM = -1L ^ (-1L << DATACENTER_BIT); + private final static long MAX_MACHINE_NUM = -1L ^ (-1L << MACHINE_BIT); + private final static long MAX_SEQUENCE = -1L ^ (-1L << SEQUENCE_BIT); + + /** + * 每一部分向左的位移 + */ + private final static long MACHINE_LEFT = SEQUENCE_BIT; + private final static long DATACENTER_LEFT = SEQUENCE_BIT + MACHINE_BIT; + private final static long TIMESTMP_LEFT = DATACENTER_LEFT + DATACENTER_BIT; + + /** + * 数据中心 + */ + private long datacenterId; + /** + * 机器标识 + */ + private long machineId; + /** + * 序列号 + */ + private long sequence = 0L; + /** + * 上一次时间戳 + */ + private long lastStmp = -1L; + + public SnowFlakeUtil(long datacenterId, long machineId) { + if (datacenterId > MAX_DATACENTER_NUM || datacenterId < 0) { + throw new IllegalArgumentException("data center id can't be greater than MAX_DATACENTER_NUM or less than 0"); + } + if (machineId > MAX_MACHINE_NUM || machineId < 0) { + throw new IllegalArgumentException("machine id can't be greater than MAX_MACHINE_NUM or less than 0"); + } + this.datacenterId = datacenterId; + this.machineId = machineId; + } + + /** + * 产生下一个ID + * @return + */ + public synchronized long nextId() { + long currStmp = getNewstmp(); + if (currStmp < lastStmp) { + throw new RuntimeException("Clock moved backwards. Refusing to generate id"); + } + + if (currStmp == lastStmp) { + //相同毫秒内,序列号自增 + sequence = (sequence + 1) & MAX_SEQUENCE; + //同一毫秒的序列数已经达到最大 + if (sequence == 0L) { + currStmp = getNextMill(); + } + } else { + //不同毫秒内,序列号置为0 + sequence = 0L; + } + + lastStmp = currStmp; + //时间戳部分 + return (currStmp - START_STMP) << TIMESTMP_LEFT + //数据中心部分 + | datacenterId << DATACENTER_LEFT + //机器标识部分 + | machineId << MACHINE_LEFT + //序列号部分 + | sequence; + } + + private long getNextMill() { + long mill = getNewstmp(); + while (mill <= lastStmp) { + mill = getNewstmp(); + } + return mill; + } + + private long getNewstmp() { + return System.currentTimeMillis(); + } + + public static void main(String[] args) { + SnowFlakeUtil snowFlake = new SnowFlakeUtil(5, 5); + //测试次数 + int testTimes = 10000; + long start = System.currentTimeMillis(); + for (int i = 0; i < testTimes; i++) { + System.out.println(snowFlake.nextId()); + } + + System.out.println(System.currentTimeMillis() - start); + } +} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties new file mode 100644 index 0000000..d23403d --- /dev/null +++ b/src/main/resources/application.properties @@ -0,0 +1,79 @@ +server.port = 7600 + +## 数据源配置 +spring.datasource.url = jdbc:postgresql://118.24.27.47:5432/work_management +spring.datasource.userName = worker +spring.datasource.password = qwer0329 +spring.datasource.driverClassName = org.postgresql.Driver + +#spring.datasource.url = jdbc:postgresql://localhost:5432/work_management +#spring.datasource.userName = postgres +#spring.datasource.password = 123456 +#spring.datasource.driverClassName = org.postgresql.Driver + +server.tomcat.uri-encoding=UTF-8 + +# 关闭spring data 的redis仓库 +spring.data.redis.repositories.enabled = false + +# jackson 配置 +spring.jackson.serialization.write-date-keys-as-timestamps=false + +## Hikari连接池设置 +spring.datasource.hikari.auto-commit = true +spring.datasource.hikari.maximum-pool-size = 100 +spring.datasource.hikari.idle-timeout = 10000 +spring.datasource.hikari.minimum-idle = 5 +spring.datasource.hikari.validation-timeout = 3000 + +## Spring Data JPA 配置 +spring.jpa.database = POSTGRESQL +spring.jpa.database-platform = org.hibernate.dialect.PostgreSQLDialect +spring.jpa.show-sql = false +# 指定 ddl mode (none, validate, create, create-drop, update) +spring.jpa.hibernate.ddl-auto = update +# 命名策略 +spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy +#spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQL95Dialect +spring.jpa.properties.hibernate.dialect = org.hibernate.spatial.dialect.postgis.PostgisDialect +spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults = false + +## Redis配置 +#spring.cache.type = redis +#spring.redis.database = 9 +#spring.redis.host = localhost +#spring.redis.port = 6379 +#spring.redis.password = sdust2020 +#spring.redis.timeout = 10000 +#spring.redis.lettuce.pool.max-active = 100 +#spring.redis.lettuce.pool.max-wait = 10000 +#spring.redis.lettuce.pool.max-idle = 100 +#spring.redis.lettuce.pool.min-idle = 1 +#spring.redis.lettuce.shutdown-timeout = 0 + +## Devtools配置 +spring.devtools.livereload.enabled = true + +## 多国语言配置 +spring.messages.basename = i18n/messages +spring.messages.encoding = UTF-8 + +# 上传文件配置 +spring.servlet.multipart.enabled=true +# 最大文件大小 +spring.servlet.multipart.max-file-size = 64MB +# 最大请求大小 +spring.servlet.multipart.max-request-size = 70MB + +# Geoserver服务器地址 +my.GeoserverAdress = http://139.199.98.175:9080/geoserver/ + +# 文件服务器地址 +my.FileServerAdress = http://139.199.98.175:4096/ +my.FileServerAdminAdress = http://127.0.0.1:4096/ + +## 自定义用户最大登录错误尝试次数 +my.MaxLoginErrorCount = 5 + +## 自定义用户登录错误间隔时间(分钟) +my.LoginErrorIntervalTime = 60 diff --git a/src/main/resources/i18n/messages.properties b/src/main/resources/i18n/messages.properties new file mode 100644 index 0000000..8cfedc5 --- /dev/null +++ b/src/main/resources/i18n/messages.properties @@ -0,0 +1,162 @@ +sys.message.success = 成功 +sys.message.null = 暂时还没有数据 +sys.message.exit = 已存在相关内容,请勿重复操作 +sys.message.user.not_logged_in = 用户未登录 +sys.message.user.login_error = 用户登陆失败 +sys.message.user.account_forbidden = 用户已被禁止 +sys.message.user.account_not_activated = 用户未激活 +sys.message.user.overtime = 用户登录超时 +sys.message.user.no_permission = 用户权限不足 +sys.message.user.already_logged = 用户已经登录 +sys.message.param.null = 参数为空 +sys.message.param.illegal = 参数非法 +sys.message.data.none = 数据为空 +sys.message.data.wrong = 数据错误 +sys.message.process.fail = 处理失败 +sys.message.process.overtime = 处理超时 +sys.message.system.inner_error = 系统内部错误 +sys.message.system.abnormal = 系统异常 +sys.message.system.busy = 系统正忙,请稍后 +sys.message.system.maintain = 系统维护中 +sys.message.database.error = 数据库错误 +sys.message.file.exists = 文件已存在 +sys.message.file.write.error = 文件写入失败 +sys.message.file.read.error = 文件读取失败 + +SysUser.id.blank = 用户id不能为空 +SysUser.userName.blank = 用户名不能为空 +SysUser.userName.length.illegal = 用户名长度不合法 +SysUser.userName.format.illegal = 用户名格式不合法 +SysUser.nickName.length.illegal = 用户昵称长度不合法 +SysUser.userCode.length.illegal = 用户编码长度不合法 +SysUser.userCode.format.illegal = 用户编码含有非法字符 +SysUser.password.blank = 用户密码不能为空 +SysUser.password.length.illegal = 用户密码长度不合法 +SysUser.password.format.illegal = 用户密码格式不合法 +SysUser.sex.num.null = 用户性别数字不能为空 +SysUser.sex.num.illegal = 用户性别数字不合法 +SysUser.telephone.format.illegal = 用户手机号码不合法 +SysUser.email.length.illegal = 用户邮箱长度不合法 +SysUser.email.format.illegal = 用户邮箱格式不合法 +SysUser.admCode.illegal = 用户行政区划代码不合法 +SysUser.address.length.illegal = 用户详细地址长度不合法 +SysUser.birthday.format.illegal = 用户出生日期必须是 yyyy-MM-dd +SysUser.personalSignature.length.illegal = 用户个性签名长度非法 +SysUser.portraitId.illegal = 用户头像id非法 +SysUser.statusCode.null = 用户当前状态编码为空 +SysUser.statusCode.illegal = 用户当前状态编码非法 +SysUser.deleteFlag.null = 用户删除标记不能是空 + +TrajectoryRecord.id.null = id 不能为空 +TrajectoryRecord.startTimeTs.null = startTimeTs 不能为空 + +SatelliteFirePoint.id.null = id 不能为空 +SatelliteFirePoint.fireCode.null = fireCode 不能为空 +SatelliteFirePoint.fireCode.length.illegal = fireCode 长度过长 +SatelliteFirePoint.countyCode.null = countyCode 不能为空 +SatelliteFirePoint.countyCode.length.illegal = countyCode 长度过长 +SatelliteFirePoint.countyName.null = countyName 不能为空 +SatelliteFirePoint.countyName.length.illegal = countyName 长度过长 +SatelliteFirePoint.satelliteType.null = satelliteType 不能为空 +SatelliteFirePoint.fireStatus.null = fireStatus 不能为空 +SatelliteFirePoint.verifyStatus.null = verifyStatus 不能为空 +SatelliteFirePoint.satelliteTimeTs.null = satelliteTimeTs 不能为空 + +PictureFirePoint.id.null = id 不能为空 +PictureFirePoint.fireCode.null = fireCode 不能为空 +PictureFirePoint.fireCode.length.illegal = fireCode 长度过长 +PictureFirePoint.pictureName.length.illegal = pictureName 长度过长 +PictureFirePoint.picturePath.null = picturePath 不能为空 +PictureFirePoint.picturePath.length.illegal = picturePath 长度过长 +PictureFirePoint.memo.length.illegal = memo 长度过长 +PictureFirePoint.size.length.illegal = size 长度过长 +PictureFirePoint.md5.null = md5 不能为空 +PictureFirePoint.md5.length.illegal = md5 长度过长 +PictureFirePoint.shootTimeTs.null = shootTimeTs 不能为空 + +PersonInvestigator.id.null = id 不能为空 +PersonInvestigator.name.null = name 不能为空 +PersonInvestigator.name.length.illegal = name 长度过长 +PersonInvestigator.code.length.illegal = code 长度过长 +PersonInvestigator.telephone.null = telephone 不能为空 +PersonInvestigator.telephone.format.illegal = telephone 格式非法 +PersonInvestigator.sex.null = sex 不能为空 +PersonInvestigator.sex.format.illegal = sex 格式非法 +PersonInvestigator.idCard.length.illegal = idCard 长度过长 +PersonInvestigator.memo.length.illegal = memo 长度过长 +PersonInvestigator.linkUserName.null = linkUserName 不能为空 +PersonInvestigator.linkUserName.format.illegal = linkUserName 格式非法 +PersonInvestigator.password.null = password 不能为空 +PersonInvestigator.password.format.illegal = password 格式非法 +InvestigateFirePoint.verifyTimeTs.null = verifyTimeTs 不能为空 + +InvestigateFirePoint.id.null = id 不能为空 +InvestigateFirePoint.fireCode.null = fireCode 不能为空 +InvestigateFirePoint.fireCode.length.illegal = fireCode 长度过长 +InvestigateFirePoint.countyCode.null = countyCode 不能为空 +InvestigateFirePoint.countyCode.length.illegal = countyCode 长度过长 +InvestigateFirePoint.countyName.null = countyName 不能为空 +InvestigateFirePoint.countyName.length.illegal = countyName 长度过长 +InvestigateFirePoint.address.null = address 不能为空 +InvestigateFirePoint.fireArea.null = fireArea 不能为空 +InvestigateFirePoint.verifyType.null = verifyType 不能为空 +InvestigateFirePoint.satelliteType.null = satelliteType 不能为空 +InvestigateFirePoint.satelliteType.length.illegal = satelliteType 长度过长 + +FileDocument.id.null = id 不能为空 +FileDocument.name.null = name 不能为空 +FileDocument.name.length.illegal = name 长度过长 +FileDocument.category.length.illegal = category 长度过长 +FileDocument.filePath.null = filePath 不能为空 +FileDocument.filePath.length.illegal = filePath 长度过长 +FileDocument.size.length.illegal = size 长度过长 +FileDocument.md5.null = md5 不能为空 +FileDocument.md5.length.illegal = md5 长度过长 +FileDocument.memo.length.illegal = memo 长度过长 +FileDocument.checkingToken.length.illegal = checkingToken 长度过长 + +AppFile.id.null = id 不能为空 +AppFile.name.null = name 不能为空 +AppFile.name.length.illegal = name 长度过长 +AppFile.appPath.null = appPath 不能为空 +AppFile.appPath.length.illegal = appPath 长度过长 +AppFile.versionNumber.null = versionNumber 不能为空 +AppFile.versionNumber.length.illegal = versionNumber 长度过长 +AppFile.versionNumber.format.illegal = versionNumber 格式不合法 +AppFile.size.null = size 不能为空 +AppFile.size.length.illegal = size 长度过长 +AppFile.md5.null = md5 不能为空 +AppFile.md5.length.illegal = md5 长度过长 +AppFile.memo.length.illegal = memo 长度过长 + +RealFirePoint.id.null = id 不能为空 +RealFirePoint.fireCode.null = fireCode 不能为空 +RealFirePoint.fireCode.length.illegal = fireCode 不合法 +RealFirePoint.countyCode.null = countyCode 不能为空 +RealFirePoint.countyCode.length.illegal = countyCode 不合法 +RealFirePoint.countyName.null = countyName 不能为空 +RealFirePoint.countyName.length.illegal = countyName 不合法 +RealFirePoint.address.null = address 不能为空 +RealFirePoint.address.length.illegal = address 不合法 +RealFirePoint.fireArea.null = fireArea 不能为空 +RealFirePoint.verifyTimeTs.null = verifyTimeTs 不能为空 +RealFirePoint.verifyType.null = verifyType 不能为空 + +InvestigationTeam.id.null = id 不能为空 +InvestigationTeam.teamName.null = teamName 不能为空 +InvestigationTeam.teamName.length.illegal = teamName 长度过长 +InvestigationTeam.memo.length.illegal = memo 长度过长 +InvestigationTeam.userName.null = userName 不能为空 +InvestigationTeam.userName.length.illegal = userName 长度过长 +InvestigationTeam.userRealName.null = userRealName 不能为空 +InvestigationTeam.userRealName.length.illegal = userRealName 长度过长 + +RelTeamInvestigator.id.null = id 不能为空 +RelTeamInvestigator.teamCode.null = teamCode 不能为空 +RelTeamInvestigator.teamCode.length.illegal = teamCode 长度过长 +RelTeamInvestigator.userName.null = userName 不能为空 +RelTeamInvestigator.userName.length.illegal = userName 长度过长 +RelTeamInvestigator.teamDeputy.null = teamDeputy 不能为空 +RelTeamInvestigator.memo.length.illegal = memo 长度过长 +RelTeamInvestigator.userRealName.null = userRealName 不能为空 +RelTeamInvestigator.userRealName.length.illegal = userRealName 长度过长 diff --git a/src/main/resources/i18n/messages_en_US.properties b/src/main/resources/i18n/messages_en_US.properties new file mode 100644 index 0000000..9b23e85 --- /dev/null +++ b/src/main/resources/i18n/messages_en_US.properties @@ -0,0 +1,162 @@ +sys.message.success = success +sys.message.null = null +sys.message.exit = data already exists +sys.message.user.not_logged_in = user not logged in +sys.message.user.login_error = user login failed +sys.message.user.account_forbidden = this account is forbidden +sys.message.user.account_not_activated = this account not activated +sys.message.user.overtime = user login timeout +sys.message.user.no_permission = user permission denied +sys.message.user.already_logged = user already logged +sys.message.param.null = parameter is null +sys.message.param.illegal = parameter is illegal +sys.message.data.none = data is none +sys.message.data.wrong = data is wrong +sys.message.process.fail = process fail +sys.message.process.overtime = process overtime +sys.message.system.inner_error = system inner error +sys.message.system.abnormal = system abnormal +sys.message.system.busy = system is busy +sys.message.system.maintain = system maintenance +sys.message.database.error = database error +sys.message.file.exists = file exists +sys.message.file.write.error = file write error +sys.message.file.read.error = file read error + +SysUser.id.blank = user id can't be blank +SysUser.userName.blank = user name can't be blank +SysUser.userName.length.illegal = user name length illegal +SysUser.userName.format.illegal = user name format illegal +SysUser.nickName.length.illegal = user nickname length illegal +SysUser.userCode.length.illegal = user code length illegal +SysUser.userCode.format.illegal = user code cantains illegal character +SysUser.password.blank = user password can't be blank +SysUser.password.length.illegal = user password length illegal +SysUser.password.format.illegal = user password format illegal +SysUser.sex.num.null = user sex num can't be blank +SysUser.sex.num.illegal = user sex num illegal +SysUser.telephone.format.illegal = user telephone format illegal +SysUser.email.length.illegal = user email length illegal +SysUser.email.format.illegal = user email format illegal +SysUser.admCode.illegal = user administrative area code illegal +SysUser.address.length.illegal = user address length illegal +SysUser.birthday.format.illegal = user birthday must be yyyy-MM-dd +SysUser.personalSignature.length.illegal = user personal signature length illegal +SysUser.portraitId.illegal = user portrait id illegal +SysUser.statusCode.null = user current status code can't be blank +SysUser.statusCode.illegal = user current status code illegal +SysUser.deleteFlag.null = user delete flag can't be null + +TrajectoryRecord.id.null = id can't be null +TrajectoryRecord.startTimeTs.null = startTimeTs can't be null + +SatelliteFirePoint.id.null = id can't be blank +SatelliteFirePoint.fireCode.null = fireCode can't be blank +SatelliteFirePoint.fireCode.length.illegal = fireCode length illegal +SatelliteFirePoint.countyCode.null = countyCode can't be blank +SatelliteFirePoint.countyCode.length.illegal = countyCode length illegal +SatelliteFirePoint.countyName.null = countyName can't be blank +SatelliteFirePoint.countyName.length.illegal = countyName length illegal +SatelliteFirePoint.satelliteType.null = satelliteType can't be blank +SatelliteFirePoint.fireStatus.null = fireStatus can't be blank +SatelliteFirePoint.verifyStatus.null = verifyStatus can't be blank +SatelliteFirePoint.satelliteTimeTs.null = satelliteTimeTs can't be blank + +PictureFirePoint.id.null = id can't be blank +PictureFirePoint.fireCode.null = fireCode can't be blank +PictureFirePoint.fireCode.length.illegal = fireCode length illegal +PictureFirePoint.pictureName.length.illegal = pictureName length illegal +PictureFirePoint.picturePath.null = picturePath can't be blank +PictureFirePoint.picturePath.length.illegal = picturePath length illegal +PictureFirePoint.memo.length.illegal = memo length illegal +PictureFirePoint.size.length.illegal = size length illegal +PictureFirePoint.md5.null = md5 can't be blank +PictureFirePoint.md5.length.illegal = md5 length illegal +PictureFirePoint.shootTimeTs.null = shootTimeTs can't be blank + +PersonInvestigator.id.null = id can't be blank +PersonInvestigator.name.null = name can't be blank +PersonInvestigator.name.length.illegal = name length illegal +PersonInvestigator.code.length.illegal = code length illegal +PersonInvestigator.telephone.null = telephone can't be blank +PersonInvestigator.telephone.format.illegal = telephone format illegal +PersonInvestigator.sex.null = sex format can't be blank +PersonInvestigator.sex.format.illegal = sex format illegal +PersonInvestigator.idCard.length.illegal = idCard length illegal +PersonInvestigator.memo.length.illegal = memo length illegal +PersonInvestigator.linkUserName.null = linkUserName can't be blank +PersonInvestigator.linkUserName.format.illegal = linkUserName format illegal +PersonInvestigator.password.null = password can't be blank +PersonInvestigator.password.format.illegal = password format +InvestigateFirePoint.verifyTimeTs.null = verifyTimeTs can't be blank + +InvestigateFirePoint.id.null = id can't be blank +InvestigateFirePoint.fireCode.null = fireCode can't be blank +InvestigateFirePoint.fireCode.length.illegal = fireCode length illegal +InvestigateFirePoint.countyCode.null = countyCode can't be blank +InvestigateFirePoint.countyCode.length.illegal = countyCode length illegal +InvestigateFirePoint.countyName.null = countyName can't be blank +InvestigateFirePoint.countyName.length.illegal = countyName length illegal +InvestigateFirePoint.address.null = address can't be blank +InvestigateFirePoint.fireArea.null = fireArea can't be blank +InvestigateFirePoint.verifyType.null = verifyType can't be blank +InvestigateFirePoint.satelliteType.null = satelliteType can't be blank +InvestigateFirePoint.satelliteType.length.illegal = satelliteType length illegal + +FileDocument.id.null = id can't be blank +FileDocument.name.null = name can't be blank +FileDocument.name.length.illegal = name length illegal +FileDocument.category.length.illegal = category length illegal +FileDocument.filePath.null = filePath can't be blank +FileDocument.filePath.length.illegal = filePath length illegal +FileDocument.size.length.illegal = size length illegal +FileDocument.md5.null = md5 can't be blank +FileDocument.md5.length.illegal = md5 length illegal +FileDocument.memo.length.illegal = memo length illegal +FileDocument.checkingToken.length.illegal = checkingToken length illegal + +AppFile.id.null = id can't be blank +AppFile.name.null = name can't be blank +AppFile.name.length.illegal = name length illegal +AppFile.appPath.null = appPath can't be blank +AppFile.appPath.length.illegal = appPath length illegal +AppFile.versionNumber.null = versionNumber can't be blank +AppFile.versionNumber.length.illegal = versionNumber length illegal +AppFile.versionNumber.format.illegal = versionNumber illegal +AppFile.size.null = size can't be blank +AppFile.size.length.illegal = size length illegal +AppFile.md5.null = md5 can't be blank +AppFile.md5.length.illegal = md5 length illegal +AppFile.memo.length.illegal = memo length illegal + +RealFirePoint.id.null = id can't be blank +RealFirePoint.fireCode.null = fireCode can't be blank +RealFirePoint.fireCode.length.illegal = fireCode illegal +RealFirePoint.countyCode.null = countyCode can't be blank +RealFirePoint.countyCode.length.illegal = countyCode +RealFirePoint.countyName.null = countyName can't be blank +RealFirePoint.countyName.length.illegal = countyName illegal +RealFirePoint.address.null = address can't be blank +RealFirePoint.address.length.illegal = address illegal +RealFirePoint.fireArea.null = fireArea can't be blank +RealFirePoint.verifyTimeTs.null = verifyTimeTs can't be blank +RealFirePoint.verifyType.null = verifyType can't be blank + +InvestigationTeam.id.null = id can't be blank +InvestigationTeam.teamName.null = teamName can't be blank +InvestigationTeam.teamName.length.illegal = teamName length illegal +InvestigationTeam.memo.length.illegal = memo length illegal +InvestigationTeam.userName.null = userName can't be blank +InvestigationTeam.userName.length.illegal = userName length illegal +InvestigationTeam.userRealName.null = userRealName can't be blank +InvestigationTeam.userRealName.length.illegal = userRealName length illegal + +RelTeamInvestigator.id.null = id can't be blank +RelTeamInvestigator.teamCode.null = teamCode can't be blank +RelTeamInvestigator.teamCode.length.illegal = teamCode length illegal +RelTeamInvestigator.userName.null = userName can't be blank +RelTeamInvestigator.userName.length.illegal = userName length illegal +RelTeamInvestigator.teamDeputy.null = teamDeputy can't be blank +RelTeamInvestigator.memo.length.illegal = memo length illegal +RelTeamInvestigator.userRealName.null = userRealName can't be blank +RelTeamInvestigator.userRealName.length.illegal = userRealName length illegal diff --git a/src/main/resources/i18n/messages_zh_CN.properties b/src/main/resources/i18n/messages_zh_CN.properties new file mode 100644 index 0000000..8cfedc5 --- /dev/null +++ b/src/main/resources/i18n/messages_zh_CN.properties @@ -0,0 +1,162 @@ +sys.message.success = 成功 +sys.message.null = 暂时还没有数据 +sys.message.exit = 已存在相关内容,请勿重复操作 +sys.message.user.not_logged_in = 用户未登录 +sys.message.user.login_error = 用户登陆失败 +sys.message.user.account_forbidden = 用户已被禁止 +sys.message.user.account_not_activated = 用户未激活 +sys.message.user.overtime = 用户登录超时 +sys.message.user.no_permission = 用户权限不足 +sys.message.user.already_logged = 用户已经登录 +sys.message.param.null = 参数为空 +sys.message.param.illegal = 参数非法 +sys.message.data.none = 数据为空 +sys.message.data.wrong = 数据错误 +sys.message.process.fail = 处理失败 +sys.message.process.overtime = 处理超时 +sys.message.system.inner_error = 系统内部错误 +sys.message.system.abnormal = 系统异常 +sys.message.system.busy = 系统正忙,请稍后 +sys.message.system.maintain = 系统维护中 +sys.message.database.error = 数据库错误 +sys.message.file.exists = 文件已存在 +sys.message.file.write.error = 文件写入失败 +sys.message.file.read.error = 文件读取失败 + +SysUser.id.blank = 用户id不能为空 +SysUser.userName.blank = 用户名不能为空 +SysUser.userName.length.illegal = 用户名长度不合法 +SysUser.userName.format.illegal = 用户名格式不合法 +SysUser.nickName.length.illegal = 用户昵称长度不合法 +SysUser.userCode.length.illegal = 用户编码长度不合法 +SysUser.userCode.format.illegal = 用户编码含有非法字符 +SysUser.password.blank = 用户密码不能为空 +SysUser.password.length.illegal = 用户密码长度不合法 +SysUser.password.format.illegal = 用户密码格式不合法 +SysUser.sex.num.null = 用户性别数字不能为空 +SysUser.sex.num.illegal = 用户性别数字不合法 +SysUser.telephone.format.illegal = 用户手机号码不合法 +SysUser.email.length.illegal = 用户邮箱长度不合法 +SysUser.email.format.illegal = 用户邮箱格式不合法 +SysUser.admCode.illegal = 用户行政区划代码不合法 +SysUser.address.length.illegal = 用户详细地址长度不合法 +SysUser.birthday.format.illegal = 用户出生日期必须是 yyyy-MM-dd +SysUser.personalSignature.length.illegal = 用户个性签名长度非法 +SysUser.portraitId.illegal = 用户头像id非法 +SysUser.statusCode.null = 用户当前状态编码为空 +SysUser.statusCode.illegal = 用户当前状态编码非法 +SysUser.deleteFlag.null = 用户删除标记不能是空 + +TrajectoryRecord.id.null = id 不能为空 +TrajectoryRecord.startTimeTs.null = startTimeTs 不能为空 + +SatelliteFirePoint.id.null = id 不能为空 +SatelliteFirePoint.fireCode.null = fireCode 不能为空 +SatelliteFirePoint.fireCode.length.illegal = fireCode 长度过长 +SatelliteFirePoint.countyCode.null = countyCode 不能为空 +SatelliteFirePoint.countyCode.length.illegal = countyCode 长度过长 +SatelliteFirePoint.countyName.null = countyName 不能为空 +SatelliteFirePoint.countyName.length.illegal = countyName 长度过长 +SatelliteFirePoint.satelliteType.null = satelliteType 不能为空 +SatelliteFirePoint.fireStatus.null = fireStatus 不能为空 +SatelliteFirePoint.verifyStatus.null = verifyStatus 不能为空 +SatelliteFirePoint.satelliteTimeTs.null = satelliteTimeTs 不能为空 + +PictureFirePoint.id.null = id 不能为空 +PictureFirePoint.fireCode.null = fireCode 不能为空 +PictureFirePoint.fireCode.length.illegal = fireCode 长度过长 +PictureFirePoint.pictureName.length.illegal = pictureName 长度过长 +PictureFirePoint.picturePath.null = picturePath 不能为空 +PictureFirePoint.picturePath.length.illegal = picturePath 长度过长 +PictureFirePoint.memo.length.illegal = memo 长度过长 +PictureFirePoint.size.length.illegal = size 长度过长 +PictureFirePoint.md5.null = md5 不能为空 +PictureFirePoint.md5.length.illegal = md5 长度过长 +PictureFirePoint.shootTimeTs.null = shootTimeTs 不能为空 + +PersonInvestigator.id.null = id 不能为空 +PersonInvestigator.name.null = name 不能为空 +PersonInvestigator.name.length.illegal = name 长度过长 +PersonInvestigator.code.length.illegal = code 长度过长 +PersonInvestigator.telephone.null = telephone 不能为空 +PersonInvestigator.telephone.format.illegal = telephone 格式非法 +PersonInvestigator.sex.null = sex 不能为空 +PersonInvestigator.sex.format.illegal = sex 格式非法 +PersonInvestigator.idCard.length.illegal = idCard 长度过长 +PersonInvestigator.memo.length.illegal = memo 长度过长 +PersonInvestigator.linkUserName.null = linkUserName 不能为空 +PersonInvestigator.linkUserName.format.illegal = linkUserName 格式非法 +PersonInvestigator.password.null = password 不能为空 +PersonInvestigator.password.format.illegal = password 格式非法 +InvestigateFirePoint.verifyTimeTs.null = verifyTimeTs 不能为空 + +InvestigateFirePoint.id.null = id 不能为空 +InvestigateFirePoint.fireCode.null = fireCode 不能为空 +InvestigateFirePoint.fireCode.length.illegal = fireCode 长度过长 +InvestigateFirePoint.countyCode.null = countyCode 不能为空 +InvestigateFirePoint.countyCode.length.illegal = countyCode 长度过长 +InvestigateFirePoint.countyName.null = countyName 不能为空 +InvestigateFirePoint.countyName.length.illegal = countyName 长度过长 +InvestigateFirePoint.address.null = address 不能为空 +InvestigateFirePoint.fireArea.null = fireArea 不能为空 +InvestigateFirePoint.verifyType.null = verifyType 不能为空 +InvestigateFirePoint.satelliteType.null = satelliteType 不能为空 +InvestigateFirePoint.satelliteType.length.illegal = satelliteType 长度过长 + +FileDocument.id.null = id 不能为空 +FileDocument.name.null = name 不能为空 +FileDocument.name.length.illegal = name 长度过长 +FileDocument.category.length.illegal = category 长度过长 +FileDocument.filePath.null = filePath 不能为空 +FileDocument.filePath.length.illegal = filePath 长度过长 +FileDocument.size.length.illegal = size 长度过长 +FileDocument.md5.null = md5 不能为空 +FileDocument.md5.length.illegal = md5 长度过长 +FileDocument.memo.length.illegal = memo 长度过长 +FileDocument.checkingToken.length.illegal = checkingToken 长度过长 + +AppFile.id.null = id 不能为空 +AppFile.name.null = name 不能为空 +AppFile.name.length.illegal = name 长度过长 +AppFile.appPath.null = appPath 不能为空 +AppFile.appPath.length.illegal = appPath 长度过长 +AppFile.versionNumber.null = versionNumber 不能为空 +AppFile.versionNumber.length.illegal = versionNumber 长度过长 +AppFile.versionNumber.format.illegal = versionNumber 格式不合法 +AppFile.size.null = size 不能为空 +AppFile.size.length.illegal = size 长度过长 +AppFile.md5.null = md5 不能为空 +AppFile.md5.length.illegal = md5 长度过长 +AppFile.memo.length.illegal = memo 长度过长 + +RealFirePoint.id.null = id 不能为空 +RealFirePoint.fireCode.null = fireCode 不能为空 +RealFirePoint.fireCode.length.illegal = fireCode 不合法 +RealFirePoint.countyCode.null = countyCode 不能为空 +RealFirePoint.countyCode.length.illegal = countyCode 不合法 +RealFirePoint.countyName.null = countyName 不能为空 +RealFirePoint.countyName.length.illegal = countyName 不合法 +RealFirePoint.address.null = address 不能为空 +RealFirePoint.address.length.illegal = address 不合法 +RealFirePoint.fireArea.null = fireArea 不能为空 +RealFirePoint.verifyTimeTs.null = verifyTimeTs 不能为空 +RealFirePoint.verifyType.null = verifyType 不能为空 + +InvestigationTeam.id.null = id 不能为空 +InvestigationTeam.teamName.null = teamName 不能为空 +InvestigationTeam.teamName.length.illegal = teamName 长度过长 +InvestigationTeam.memo.length.illegal = memo 长度过长 +InvestigationTeam.userName.null = userName 不能为空 +InvestigationTeam.userName.length.illegal = userName 长度过长 +InvestigationTeam.userRealName.null = userRealName 不能为空 +InvestigationTeam.userRealName.length.illegal = userRealName 长度过长 + +RelTeamInvestigator.id.null = id 不能为空 +RelTeamInvestigator.teamCode.null = teamCode 不能为空 +RelTeamInvestigator.teamCode.length.illegal = teamCode 长度过长 +RelTeamInvestigator.userName.null = userName 不能为空 +RelTeamInvestigator.userName.length.illegal = userName 长度过长 +RelTeamInvestigator.teamDeputy.null = teamDeputy 不能为空 +RelTeamInvestigator.memo.length.illegal = memo 长度过长 +RelTeamInvestigator.userRealName.null = userRealName 不能为空 +RelTeamInvestigator.userRealName.length.illegal = userRealName 长度过长 diff --git a/src/test/java/com/xkrs/XkrsWorkApplicationTests.java b/src/test/java/com/xkrs/XkrsWorkApplicationTests.java new file mode 100644 index 0000000..f5f3e99 --- /dev/null +++ b/src/test/java/com/xkrs/XkrsWorkApplicationTests.java @@ -0,0 +1,13 @@ +package com.xkrs; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class XkrsWorkApplicationTests { + + @Test + void contextLoads() { + } + +}