Compare commits

...

No commits in common. 'main' and 'origin' have entirely different histories.
main ... origin

@ -1,254 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ArtifactsWorkspaceSettings">
<artifacts-to-build>
<artifact name="kuaidizhan:war exploded" />
</artifacts-to-build>
</component>
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="682fdd82-c05b-4cc6-af2f-4b67dd292c20" name="更改" comment="">
<change afterPath="$PROJECT_DIR$/src/main/java/com/controller/AntiLeechServlet.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/java/com/controller/ExpressItem.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/java/com/controller/ExpressIteml.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/java/com/controller/IgnoreAuth.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/java/com/controller/OverduePackageService.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/java/com/controller/PickupCodeService.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/java/com/controller/UserManagementService.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/java/com/model/enums/TypeEnum.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/controller/CommonController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/controller/CommonController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/controller/ZhandianController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/controller/ZhandianController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/main.iml" beforeDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Class" />
</list>
</option>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/src/main/java" />
<option name="ROOT_SYNC" value="DONT_SYNC" />
</component>
<component name="LogFilters">
<option name="FILTER_ERRORS" value="false" />
<option name="FILTER_WARNINGS" value="false" />
<option name="FILTER_INFO" value="true" />
<option name="FILTER_DEBUG" value="true" />
<option name="CUSTOM_FILTER" />
</component>
<component name="ProjectColorInfo">{
&quot;associatedIndex&quot;: 1
}</component>
<component name="ProjectId" id="2vX9hZLqUjsroXdgXf6kriQDRVP" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;ModuleVcsDetector.initialDetectionPerformed&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;Tomcat 服务器.Tomcat9.executor&quot;: &quot;Run&quot;,
&quot;git-widget-placeholder&quot;: &quot;main&quot;,
&quot;kotlin-language-version-configured&quot;: &quot;true&quot;,
&quot;last_opened_file_path&quot;: &quot;C:/Users/Administrator/Desktop/合肥师范学院/ssm076校园快递一站式服务系统+jsp/kuaidizhan/src/main/java/com&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
&quot;project.structure.last.edited&quot;: &quot;工件&quot;,
&quot;project.structure.proportion&quot;: &quot;0.15&quot;,
&quot;project.structure.side.proportion&quot;: &quot;0.2&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;configurable.group.tools&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
}
}</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="C:\Users\Administrator\Desktop\合肥师范学院\ssm076校园快递一站式服务系统+jsp\kuaidizhan\src\main\java\com" />
<recent name="C:\Users\Administrator\Desktop\合肥师范学院\ssm076校园快递一站式服务系统+jsp\kuaidizhan\src\main\webapp\WEB-INF" />
<recent name="C:\Users\Administrator\Desktop\合肥师范学院\ssm076校园快递一站式服务系统+jsp\kuaidizhan\src\main\java\com\controller" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="C:\Users\Administrator\Desktop\合肥师范学院\ssm076校园快递一站式服务系统+jsp\kuaidizhan\src\main\java" />
</key>
</component>
<component name="RunManager">
<configuration name="Tomcat9" type="#com.intellij.j2ee.web.tomcat.TomcatRunConfigurationFactory" factoryName="Local" APPLICATION_SERVER_NAME="Tomcat9" ALTERNATIVE_JRE_ENABLED="false" nameIsGenerated="true">
<option name="UPDATING_POLICY" value="restart-server" />
<deployment>
<artifact name="kuaidizhan:war exploded">
<settings>
<option name="CONTEXT_PATH" value="/kuaidizhan_war_exploded" />
</settings>
</artifact>
</deployment>
<server-settings>
<option name="BASE_DIRECTORY_NAME" value="057a3370-f903-49f3-ae0d-45680e48afb5" />
</server-settings>
<predefined_log_file enabled="true" id="Tomcat" />
<predefined_log_file enabled="true" id="Tomcat Catalina" />
<predefined_log_file id="Tomcat Manager" />
<predefined_log_file id="Tomcat Host Manager" />
<predefined_log_file id="Tomcat Localhost Access" />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="58199" />
</RunnerSettings>
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Cover">
<option name="USE_ENV_VARIABLES" value="true" />
<STARTUP>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</STARTUP>
<SHUTDOWN>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</SHUTDOWN>
</ConfigurationWrapper>
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Debug">
<option name="USE_ENV_VARIABLES" value="true" />
<STARTUP>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</STARTUP>
<SHUTDOWN>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</SHUTDOWN>
</ConfigurationWrapper>
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Profile">
<option name="USE_ENV_VARIABLES" value="true" />
<STARTUP>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</STARTUP>
<SHUTDOWN>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</SHUTDOWN>
</ConfigurationWrapper>
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Run">
<option name="USE_ENV_VARIABLES" value="true" />
<STARTUP>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</STARTUP>
<SHUTDOWN>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</SHUTDOWN>
</ConfigurationWrapper>
<method v="2">
<option name="Make" enabled="true" />
<option name="BuildArtifacts" enabled="true">
<artifact name="kuaidizhan:war exploded" />
</option>
</method>
</configuration>
</component>
<component name="SharedIndexes">
<attachedChunks>
<set>
<option value="bundled-jdk-9823dce3aa75-fbdcb00ec9e3-intellij.indexing.shared.core-IU-251.23774.435" />
<option value="bundled-js-predefined-d6986cc7102b-f27c65a3e318-JavaScript-IU-251.23774.435" />
</set>
</attachedChunks>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />
<component name="StructureViewState">
<option name="selectedTab" value="逻辑" />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="默认任务">
<changelist id="682fdd82-c05b-4cc6-af2f-4b67dd292c20" name="更改" comment="" />
<created>1744280671626</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1744280671626</updated>
<workItem from="1744280672775" duration="39000" />
<workItem from="1744280743010" duration="312000" />
<workItem from="1745840073782" duration="4327000" />
<workItem from="1745911770182" duration="11018000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="RECENT_FILTERS">
<map>
<entry key="User">
<value>
<list>
<RecentGroup>
<option name="FILTER_VALUES">
<option value="*" />
</option>
</RecentGroup>
</list>
</value>
</entry>
</map>
</option>
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State>
<option name="FILTERS">
<map>
<entry key="branch">
<value>
<list>
<option value="master" />
</list>
</value>
</entry>
<entry key="user">
<value>
<list>
<option value="*" />
</list>
</value>
</entry>
</map>
</option>
</State>
</value>
</entry>
</map>
</option>
</component>
<component name="XSLT-Support.FileAssociations.UIState">
<expand />
<select />
</component>
</project>

@ -1,8 +0,0 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="kuaidizhan" />
</profile>
</annotationProcessing>
</component>
</project>

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
</component>
</project>

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_19" default="true" project-jdk-name="corretto-19" project-jdk-type="JavaSDK" />
</project>

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

@ -1,49 +0,0 @@
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAACFwAAAAdzc2gtcn
NhAAAAAwEAAQAAAgEA8jOlt4r09PVkLEpjf/2P10I1M3vhiARIU0R0C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ESmUCG8a28wXlyLp29eZWTNS6JREfstNUe4bYW2WnaR/CZHlyLsqDwZZI5NrRcoSuM8qBvzYYOPd22/PyLYJsBWCnxnUCks45fUkn7SwwBTpZHAML36UFi2FQVA353CsTQS+JlFLmEa5QUnO0WQqw4/8ciWlp3RJVUVxIyFDFJfDNUpPDlp13w+RKj0yPALT8UuMjXQy1UR25FyLsF5f1pVAgHiYK+sehy9TKRV1EXyZFff9vTBwwEih+M0kQQVtNGj1jNSFLspLbTSV4NGKtVTbzVWmPHhfMbaKNHyFAwz5dtIgncW84tM+hPwaNJJpRg+EzqKpCqWjNFkLkMLyVZ8jka3Gkd8SvUPgwLCy+Lq6mAcdodTSu9NqCT3gUADIr0g8kD3NNDCCn4T0jn2X6Tx4B2XrWfY/Jwe6/1xDYQSJk7TZaveujqw+hXTdFj/kP/8nW3OYe5Cx4UGT+XwPE2cW3W/8JG9hF7LQgiPvBok8fwswNnPjPWxojDRhNrBMEEIw== 2548089586@qq.com

@ -1,296 +0,0 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.jlwl</groupId>
<artifactId>kuaidizhan</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.version>5.0.0.RELEASE</spring.version>
<junit.version>4.12</junit.version>
<druid.version>1.1.0</druid.version>
<fastjson.version>1.2.8</fastjson.version>
<mybaitsplus.version>2.3</mybaitsplus.version>
<mysql.version>5.1.38</mysql.version>
<log4j.version>1.2.17</log4j.version>
<slf4j.version>1.7.19</slf4j.version>
<aspectjweaver.version>1.8.8</aspectjweaver.version>
<fileupload.version>1.3.1</fileupload.version>
<jstl.version>1.2</jstl.version>
</properties>
<dependencies>
<!-- JUnit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- Spring MVC -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- AOP -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectjweaver.version}</version>
</dependency>
<!-- FileUpload -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${fileupload.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>${jstl.version}</version>
</dependency>
<!-- Mybatis-Plus -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus</artifactId>
<version>${mybaitsplus.version}</version>
</dependency>
<!-- Mysql -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
<!-- Druid -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>${druid.version}</version>
</dependency>
<!-- FastJson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- Log -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>4.0.12</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.tomcat.embed/tomcat-embed-core -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>9.0.29</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils -->
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.8.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet.jsp/jsp-api -->
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<!-- 百度人工智能 -->
<dependency>
<groupId>com.baidu.aip</groupId>
<artifactId>java-sdk</artifactId>
<version>4.4.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.tomcat.embed/tomcat-embed-jasper -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<version>9.0.27</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.2.4.Final</version>
</dependency>
<!-- 导入导出excel -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>3.11-beta2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.11-beta2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.11-beta2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-excelant</artifactId>
<version>3.11-beta2</version>
</dependency>
</dependencies>
<build>
<!-- 项目访问名称 -->
<finalName>kuaidizhan</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -1,10 +0,0 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# 依赖于环境的 Maven 主目录路径
/mavenHomeManager.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_23" default="true" project-jdk-name="23" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/main.iml" filepath="$PROJECT_DIR$/main.iml" />
</modules>
</component>
</project>

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../../.." vcs="Git" />
</component>
</project>

@ -1,60 +0,0 @@
package com.controller;
import java.io.*;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.*;
import jakarta.servlet.annotation.*;
@WebServlet("/download")
public class AntiLeechServlet extends HttpServlet {
// 允许访问的域名白名单(根据实际修改)
private static final String[] ALLOWED_DOMAINS = {
"http://your-domain.com",
"https://www.your-domain.com"
};
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
// 获取来源域名
String referer = request.getHeader("Referer");
// 防盗链检查
if (referer == null || !isAllowedDomain(referer)) {
response.sendError(HttpServletResponse.SC_FORBIDDEN, "禁止直接访问");
return;
}
// 文件路径配置(根据实际路径修改)
String filePath = getServletContext().getRealPath("/WEB-INF/resources/images/image.png");
File file = new File(filePath);
// 检查文件是否存在
if (!file.exists()) {
response.sendError(HttpServletResponse.SC_NOT_FOUND);
return;
}
// 设置响应头
response.setContentType("image/png");
response.setHeader("Content-Disposition", "attachment; filename=\"image.png\"");
response.setContentLength((int) file.length());
// 文件传输
try (InputStream in = new FileInputStream(file);
OutputStream out = response.getOutputStream()) {
byte[] buffer = new byte[4096];
int bytesRead;
while ((bytesRead = in.read(buffer)) != -1) {
out.write(buffer, 0, bytesRead);
}
}
}
// 域名白名单验证方法
private boolean isAllowedDomain(String referer) {
if (referer == null) return false;
for (String domain : ALLOWED_DOMAINS) {
if (referer.startsWith(domain)) {
return true;
}
}
return false;
}
}

@ -1,350 +0,0 @@
package com.controller;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.annotation.IgnoreAuth;
import com.baidu.aip.face.AipFace;
import com.baidu.aip.face.MatchRequest;
import com.baidu.aip.util.Base64Util;
import com.service.CommonService;
import com.service.ConfigService;
import com.utils.BaiduUtil;
import com.utils.FileUtil;
import com.utils.R;
/**
*
*
*
*
* - CommonService
* - ConfigService
*
*
* 1.
* 2.
* 3.
*/
@RestController
public class CommonController {
@Autowired
private CommonService commonService; // 通用业务逻辑服务
@Autowired
private ConfigService configService; // 配置管理服务
private static AipFace client = null; // 百度人脸识别客户端(单例模式)
private static String BAIDU_DITU_AK = null; // 百度地图AK从配置中心获取
/**
*
* API
*
* @param lng 116.404
* @param lat 39.915
* @return {"status":0,"result":{"city":"北京市"}}
*
* @throws baidu_ditu_ak
*/
@RequestMapping("/location")
public R location(String lng, String lat) {
// 懒加载配置(首次调用时从数据库加载配置)
if (BAIDU_DITU_AK == null) {
ConfigEntity config = configService.selectOne(
new EntityWrapper<ConfigEntity>().eq("name", "baidu_ditu_ak")
);
BAIDU_DITU_AK = config.getValue();
if (StringUtils.isEmpty(BAIDU_DITU_AK)) {
return R.error("请在配置管理中正确配置baidu_ditu_ak");
}
}
// 调用百度地图逆地理编码API
Map<String, String> map = BaiduUtil.getCityByLonLat(BAIDU_DITU_AK, lng, lat);
return R.ok().put("data", map);
}
/**
* 1:1
* 使AI
*
* @param face1 1upload
* @param face2 2
* @param request HTTP
* @return {"score":85.5}
*
* @throws APIKey/SecretKey
* @throws
*/
@RequestMapping("/matchFace")
public R matchFace(String face1, String face2, HttpServletRequest request) {
// 初始化百度AI客户端单例模式保证线程安全
if (client == null) {
String APIKey = configService.selectOne(
new EntityWrapper<ConfigEntity>().eq("name", "APIKey")
).getValue();
String SecretKey = configService.selectOne(
new EntityWrapper<ConfigEntity>().eq("name", "SecretKey")
).getValue();
String token = BaiduUtil.getAuth(APIKey, SecretKey);
if (token == null) {
return R.error("请在配置管理中正确配置APIKey和SecretKey");
}
client = new AipFace(null, APIKey, SecretKey);
client.setConnectionTimeoutInMillis(2000); // 连接超时2秒
client.setSocketTimeoutInMillis(60000); // 数据传输超时60秒
}
try {
// 构建服务器文件路径从web应用根目录获取
String uploadPath = request.getSession()
.getServletContext()
.getRealPath("/upload");
File file1 = new File(uploadPath, face1);
File file2 = new File(uploadPath, face2);
// 图片转Base64编码
String img1 = Base64Util.encode(FileUtil.FileToByte(file1));
String img2 = Base64Util.encode(FileUtil.FileToByte(file2));
// 构造比对请求参数
MatchRequest req1 = new MatchRequest(img1, "BASE64");
MatchRequest req2 = new MatchRequest(img2, "BASE64");
ArrayList<MatchRequest> requests = new ArrayList<>();
requests.add(req1);
requests.add(req2);
// 执行人脸比对
JSONObject res = client.match(requests);
return R.ok().put("data",
JSONObject.parse(res.get("result").toString())
);
} catch (FileNotFoundException e) {
return R.error("文件不存在:" + e.getMessage());
} catch (IOException e) {
return R.error("文件处理失败:" + e.getMessage());
}
}
/**
*
*
*
* @param tableName sys_area
* @param columnName parent_id ID
* @param level
* @param parent ID
* @return ["选项1","选项2"]
*
* @apiNote /option/sys_area/area_name?level=2&parent=110000
*/
@RequestMapping("/option/{tableName}/{columnName}")
@IgnoreAuth // 标注不需要登录验证
public R getOption(@PathVariable String tableName,
@PathVariable String columnName,
@RequestParam(required = false) String level,
@RequestParam(required = false) String parent) {
Map<String, Object> params = new HashMap<>();
params.put("table", tableName);
params.put("column", columnName);
// 添加可选参数
if (StringUtils.isNotBlank(level)) {
params.put("level", level);
}
if (StringUtils.isNotBlank(parent)) {
params.put("parent", parent);
}
List<String> data = commonService.getOption(params);
return R.ok().put("data", data);
}
}
/**
* tablecolumn
* @param table
* @param column
* @return
*/
/**
*
*
*
* @param tableName sys_user
* @param columnName dept_id ID
* @param columnValue 1001
* @return {"id":1,"name":"测试数据"}
*
* @apiNote /follow/sys_user/dept_id/1001
*/
@RequestMapping("/follow/{tableName}/{columnName}")
@IgnoreAuth
public R getFollowByOption(@PathVariable String tableName,
@PathVariable String columnName,
@RequestParam String columnValue) {
Map<String, Object> params = new HashMap<>();
params.put("table", tableName);
params.put("column", columnName);
params.put("columnValue", columnValue); // 关键查询条件
Map<String, Object> result = commonService.getFollowByOption(params);
return R.ok().put("data", result);
}
/**
*
* sh
*
* @param tableName news
* @param map id-ID, shzt-
* @return
*
* @apiNote
* POST /sh/news
* Body: {"id":123,"shzt":"1"}
*/
@RequestMapping("/sh/{tableName}")
public R sh(@PathVariable String tableName,
@RequestBody Map<String, Object> map) {
map.put("table", tableName); // 注入表名参数
commonService.sh(map); // 调用通用审核服务
return R.ok();
}
/**
*
*
*
* @param tableName order
* @param columnName create_time
* @param type 1: 2:
* @param map
* - remindstart:
* - remindend:
* @return {"count":5}
*
* @apiNote
* +remindstart +remindend
*/
@RequestMapping("/remind/{tableName}/{columnName}/{type}")
@IgnoreAuth
public R remindCount(@PathVariable String tableName,
@PathVariable String columnName,
@PathVariable String type,
@RequestParam Map<String, Object> map) {
map.put("table", tableName);
map.put("column", columnName);
map.put("type", type);
// 日期类型特殊处理
if ("2".equals(type)) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
// 处理开始日期偏移(支持负数表示过去天数)
if (map.get("remindstart") != null) {
int offset = Integer.parseInt(map.get("remindstart").toString());
c.add(Calendar.DAY_OF_MONTH, offset);
map.put("remindstart", sdf.format(c.getTime()));
}
// 处理结束日期偏移
if (map.get("remindend") != null) {
int offset = Integer.parseInt(map.get("remindend").toString());
c.add(Calendar.DAY_OF_MONTH, offset);
map.put("remindend", sdf.format(c.getTime()));
}
}
int count = commonService.remindCount(map);
return R.ok().put("count", count);
}
/**
*
*
*
* @param tableName finance
* @param columnName amount
* @return {"sum":1000.5}
*/
@RequestMapping("/cal/{tableName}/{columnName}")
@IgnoreAuth
public R cal(@PathVariable String tableName,
@PathVariable String columnName) {
Map<String, Object> params = new HashMap<>();
params.put("table", tableName);
params.put("column", columnName);
Map<String, Object> result = commonService.selectCal(params);
return R.ok().put("data", result);
}
/**
*
* GROUP BY
*
* @param tableName sales
* @param columnName product_type
* @return [{"group":"类型A","count":10},...]
*/
@RequestMapping("/group/{tableName}/{columnName}")
@IgnoreAuth
public R group(@PathVariable String tableName,
@PathVariable String columnName) {
Map<String, Object> params = new HashMap<>();
params.put("table", tableName);
params.put("column", columnName);
List<Map<String, Object>> result = commonService.selectGroup(params);
return R.ok().put("data", result);
}
/**
*
* X/Y
*
* @param tableName visit_log 访
* @param xColumnName Xdate
* @param yColumnName Ychannel
* @return [{"x":"2023-01-01","y":"SEO","count":15},...]
*/
@RequestMapping("/value/{tableName}/{xColumnName}/{yColumnName}")
@IgnoreAuth
public R value(@PathVariable String tableName,
@PathVariable String yColumnName,
@PathVariable String xColumnName) {
Map<String, Object> params = new HashMap<>();
params.put("table", tableName);
params.put("xColumn", xColumnName);
params.put("yColumn", yColumnName);
List<Map<String, Object>> result = commonService.selectValue(params);
return R.ok().put("data", result);
}

@ -1,110 +0,0 @@
package com.controller;
import java.util.Arrays;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.annotation.IgnoreAuth;
import com.service.ConfigService;
import com.utils.PageUtils;
import com.utils.R;
/**
*
*/
@RequestMapping("config")
@RestController
public class ConfigController{
@Autowired
private ConfigService configService;
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,ConfigEntity config){
EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
PageUtils page = configService.queryPage(params);
return R.ok().put("data", page);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,ConfigEntity config){
EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
PageUtils page = configService.queryPage(params);
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id){
ConfigEntity config = configService.selectById(id);
return R.ok().put("data", config);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") String id){
ConfigEntity config = configService.selectById(id);
return R.ok().put("data", config);
}
/**
* name
*/
@RequestMapping("/info")
public R infoByName(@RequestParam String name){
ConfigEntity config = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
return R.ok().put("data", config);
}
/**
*
*/
@PostMapping("/save")
public R save(@RequestBody ConfigEntity config){
// ValidatorUtils.validateEntity(config);
configService.insert(config);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody ConfigEntity config){
// ValidatorUtils.validateEntity(config);
configService.updateById(config);//全部更新
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
configService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}

@ -1,244 +0,0 @@
package com.controller;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import com.entity.JiedanEntity;
import com.service.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.utils.StringUtil;
import java.lang.reflect.InvocationTargetException;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.DaiquEntity;
import com.entity.view.DaiquView;
import com.entity.YonghuEntity;
import com.entity.ZhandianEntity;
import com.utils.PageUtils;
import com.utils.R;
/**
*
*
* @author
* @email
* @date 2021-03-11
*/
@RestController
@Controller
@RequestMapping("/daiqu")
public class DaiquController {
private static final Logger logger = LoggerFactory.getLogger(DaiquController.class);
@Autowired
private DaiquService daiquService;
@Autowired
private JiedanService jiedanService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表service
@Autowired
private YonghuService yonghuService;
@Autowired
private ZhandianService zhandianService;
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
if(StringUtil.isNotEmpty(role) && "用户".equals(role)){
params.put("yonghuId",request.getSession().getAttribute("userId"));
}
PageUtils page = daiquService.queryPage(params);
//字典表数据转换
List<DaiquView> list =(List<DaiquView>)page.getList();
for(DaiquView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c);
}
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
DaiquEntity daiqu = daiquService.selectById(id);
if(daiqu !=null){
//entity转view
DaiquView view = new DaiquView();
BeanUtils.copyProperties( daiqu , view );//把实体数据重构到view中
//级联表
YonghuEntity yonghu = yonghuService.selectById(daiqu.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
//级联表
ZhandianEntity zhandian = zhandianService.selectById(daiqu.getZhandianId());
if(zhandian != null){
BeanUtils.copyProperties( zhandian , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setZhandianId(zhandian.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody DaiquEntity daiqu, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,daiqu:{}",this.getClass().getName(),daiqu.toString());
daiqu.setKdztTypes(1);
daiqu.setTakecode(UUID.randomUUID().toString().toString().replace("-","").substring(0,6));
Wrapper<DaiquEntity> queryWrapper = new EntityWrapper<DaiquEntity>()
.eq("dqname", daiqu.getDqname())
.eq("zhandian_id", daiqu.getZhandianId())
.eq("yonghu_id", daiqu.getYonghuId())
.eq("takecode", daiqu.getTakecode())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
DaiquEntity daiquEntity = daiquService.selectOne(queryWrapper);
if(daiquEntity==null){
daiquService.insert(daiqu);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody DaiquEntity daiqu, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,daiqu:{}",this.getClass().getName(),daiqu.toString());
//根据字段查询是否有相同数据
Wrapper<DaiquEntity> queryWrapper = new EntityWrapper<DaiquEntity>()
.notIn("id",daiqu.getId())
.eq("dqname", daiqu.getDqname())
.eq("zhandian_id", daiqu.getZhandianId())
.eq("yonghu_id", daiqu.getYonghuId())
.eq("kddx_types", daiqu.getKddxTypes())
.eq("dqphone", daiqu.getDqphone())
.eq("takecode", daiqu.getTakecode())
.eq("kdzt_types", daiqu.getKdztTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
DaiquEntity daiquEntity = daiquService.selectOne(queryWrapper);
daiqu.setPickupTime(new Date());
if(daiquEntity==null){
daiquService.updateById(daiqu);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/replaceExpress")
public R replaceExpress(@RequestBody Integer ids){
DaiquEntity daiqu = daiquService.selectById(ids);
if(daiqu == null){
return R.error("数据不存在");
}
YonghuEntity yonghu = yonghuService.selectById(daiqu.getYonghuId());
if(yonghu == null){
return R.error("数据不存在");
}
JiedanEntity jiedan = new JiedanEntity();
jiedan.setInitiateTime(new Date());
jiedan.setJdyonghuId(daiqu.getYonghuId());
jiedan.setJdphone(daiqu.getDqphone());
jiedan.setAddresseename(yonghu.getName());
jiedan.setJdaddressee("住宿楼栋:"+yonghu.getDormitory()+" ,寝室号:"+yonghu.getDormitory());
jiedan.setJdtakecode(daiqu.getTakecode());
jiedan.setDaiqukuaidimc(daiqu.getDqname());
jiedan.setJdztTypes(1);//1未接
jiedan.setKdlxTypes(1);//1取件
jiedan.setOdd(String.valueOf(new Date().getTime()));
Wrapper<JiedanEntity> queryWrapper = new EntityWrapper<JiedanEntity>()
.eq("jdyonghu_id", jiedan.getJdyonghuId())
.eq("jdtakecode", jiedan.getJdtakecode())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
JiedanEntity jiedanEntity = jiedanService.selectOne(queryWrapper);
if(jiedanEntity==null){
daiqu.setKdztTypes(3);
daiquService.updateById(daiqu);
jiedanService.insert(jiedan);
return R.ok();
}else {
return R.error(511,"你已经发布过这件快递的代取订单了");
}
}
/**
*
*/
@RequestMapping("/pickUp")
public R pickUp(@RequestBody Integer ids){
DaiquEntity daiqu = daiquService.selectById(ids);
if(daiqu == null){
return R.error("数据不存在");
}
daiqu.setKdztTypes(2);
daiqu.setPickupTime(new Date());
daiquService.updateById(daiqu);
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
daiquService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}

@ -1,225 +0,0 @@
package com.controller;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import com.entity.DaiqurenEntity;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.StringUtil;
import java.lang.reflect.InvocationTargetException;
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.DaiqurenEntity;
import com.service.DaiqurenService;
import com.entity.view.DaiqurenView;
import com.utils.PageUtils;
import com.utils.R;
/**
*
*
* @author
* @email
* @date 2021-03-11
*/
@RestController
@Controller
@RequestMapping("/daiquren")
public class DaiqurenController {
private static final Logger logger = LoggerFactory.getLogger(DaiqurenController.class);
@Autowired
private DaiqurenService daiqurenService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表service
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
if(StringUtil.isNotEmpty(role) && "代取人".equals(role)){
params.put("yonghuId",request.getSession().getAttribute("userId"));
}
PageUtils page = daiqurenService.queryPage(params);
//字典表数据转换
List<DaiqurenView> list =(List<DaiqurenView>)page.getList();
for(DaiqurenView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c);
}
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
DaiqurenEntity daiquren = daiqurenService.selectById(id);
if(daiquren !=null){
//entity转view
DaiqurenView view = new DaiqurenView();
BeanUtils.copyProperties( daiquren , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody DaiqurenEntity daiquren, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,daiquren:{}",this.getClass().getName(),daiquren.toString());
Wrapper<DaiqurenEntity> queryWrapper = new EntityWrapper<DaiqurenEntity>()
.eq("name", daiquren.getName())
.eq("username", daiquren.getUsername())
.eq("password", daiquren.getPassword())
.eq("sex_types", daiquren.getSexTypes())
.eq("phone", daiquren.getPhone())
.eq("role", daiquren.getRole())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
DaiqurenEntity daiqurenEntity = daiqurenService.selectOne(queryWrapper);
if(daiqurenEntity==null){
daiquren.setRole("代取人");
daiqurenService.insert(daiquren);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody DaiqurenEntity daiquren, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,daiquren:{}",this.getClass().getName(),daiquren.toString());
//根据字段查询是否有相同数据
Wrapper<DaiqurenEntity> queryWrapper = new EntityWrapper<DaiqurenEntity>()
.notIn("id",daiquren.getId())
.eq("name", daiquren.getName())
.eq("username", daiquren.getUsername())
.eq("password", daiquren.getPassword())
.eq("sex_types", daiquren.getSexTypes())
.eq("phone", daiquren.getPhone())
.eq("role", daiquren.getRole())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
DaiqurenEntity daiqurenEntity = daiqurenService.selectOne(queryWrapper);
if("".equals(daiquren.getImgPhoto()) || "null".equals(daiquren.getImgPhoto())){
daiquren.setImgPhoto(null);
}
if(daiqurenEntity==null){
daiqurenService.updateById(daiquren);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
daiqurenService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
*
*/
@IgnoreAuth
@PostMapping(value = "/login")
public R login(String username, String password, String role, HttpServletRequest request) {
DaiqurenEntity yonghu = daiqurenService.selectOne(new EntityWrapper<DaiqurenEntity>().eq("username", username));
if(yonghu==null || !yonghu.getPassword().equals(password)) {
return R.error("账号或密码不正确");
}
if(!role.equals(yonghu.getRole())){
return R.error("权限不正确");
}
String token = tokenService.generateToken(yonghu.getId(),username, "yonghu", "代取人");
R r = R.ok();
r.put("token", token);
r.put("role","代取人");
r.put("userId",yonghu.getId());
return r;
}
/**
*
*/
@IgnoreAuth
@PostMapping(value = "/register")
public R register(@RequestBody DaiqurenEntity yonghu){
// ValidatorUtils.validateEntity(user);
if(daiqurenService.selectOne(new EntityWrapper<DaiqurenEntity>().eq("username", yonghu.getUsername()).orNew().eq("phone",yonghu.getPhone())) !=null) {
return R.error("代取人已存在或手机号身份证号已经被使用");
}
daiqurenService.insert(yonghu);
return R.ok();
}
/**
* session
*/
@RequestMapping("/session")
public R getCurrYonghu(HttpServletRequest request){
Integer id = (Integer)request.getSession().getAttribute("userId");
DaiqurenEntity yonghu = daiqurenService.selectById(id);
return R.ok().put("data", yonghu);
}
/**
* 退
*/
@GetMapping(value = "logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
}

@ -1,188 +0,0 @@
package com.controller;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.StringUtil;
import java.lang.reflect.InvocationTargetException;
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.DictionaryEntity;
import com.service.DictionaryService;
import com.entity.view.DictionaryView;
import com.utils.PageUtils;
import com.utils.R;
/**
*
*
* @author
* @email
* @date 2021-03-11
*/
@RestController
@Controller
@RequestMapping("/dictionary")
public class DictionaryController {
private static final Logger logger = LoggerFactory.getLogger(DictionaryController.class);
@Autowired
private DictionaryService dictionaryService;
@Autowired
private TokenService tokenService;
//级联表service
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
if(StringUtil.isNotEmpty(role) && "用户".equals(role)){
params.put("yonghuId",request.getSession().getAttribute("userId"));
}
PageUtils page = dictionaryService.queryPage(params);
//字典表数据转换
List<DictionaryView> list =(List<DictionaryView>)page.getList();
for(DictionaryView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c);
}
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
DictionaryEntity dictionary = dictionaryService.selectById(id);
if(dictionary !=null){
//entity转view
DictionaryView view = new DictionaryView();
BeanUtils.copyProperties( dictionary , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody DictionaryEntity dictionary, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,dictionary:{}",this.getClass().getName(),dictionary.toString());
Wrapper<DictionaryEntity> queryWrapper = new EntityWrapper<DictionaryEntity>()
.eq("dic_code", dictionary.getDicCode())
.eq("code_index", dictionary.getCodeIndex())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
DictionaryEntity dictionaryEntity = dictionaryService.selectOne(queryWrapper);
if(dictionaryEntity==null){
dictionary.setCreateTime(new Date());
// String role = String.valueOf(request.getSession().getAttribute("role"));
// if("".equals(role)){
// dictionary.set
// }
dictionaryService.insert(dictionary);
//如果字典表新增数据的话,把数据再重新查出,放入监听器中
List<DictionaryEntity> dictionaryEntities = dictionaryService.selectList(new EntityWrapper<DictionaryEntity>());
ServletContext servletContext = ContextLoader.getCurrentWebApplicationContext().getServletContext();
Map<String, Map<Integer,String>> map = new HashMap<>();
for(DictionaryEntity d :dictionaryEntities){
Map<Integer, String> m = map.get(d.getDicCode());
if(m ==null || m.isEmpty()){
m = new HashMap<>();
}
m.put(d.getCodeIndex(),d.getIndexName());
map.put(d.getDicCode(),m);
}
servletContext.setAttribute("dictionaryMap",map);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody DictionaryEntity dictionary, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,dictionary:{}",this.getClass().getName(),dictionary.toString());
//根据字段查询是否有相同数据
Wrapper<DictionaryEntity> queryWrapper = new EntityWrapper<DictionaryEntity>()
.notIn("id",dictionary.getId())
.eq("dic_code", dictionary.getDicCode())
.eq("code_index", dictionary.getCodeIndex())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
DictionaryEntity dictionaryEntity = dictionaryService.selectOne(queryWrapper);
if(dictionaryEntity==null){
// String role = String.valueOf(request.getSession().getAttribute("role"));
// if("".equals(role)){
// dictionary.set
// }
dictionaryService.updateById(dictionary);//根据id更新
//如果字典表修改数据的话,把数据再重新查出,放入监听器中
List<DictionaryEntity> dictionaryEntities = dictionaryService.selectList(new EntityWrapper<DictionaryEntity>());
ServletContext servletContext = ContextLoader.getCurrentWebApplicationContext().getServletContext();
Map<String, Map<Integer,String>> map = new HashMap<>();
for(DictionaryEntity d :dictionaryEntities){
Map<Integer, String> m = map.get(d.getDicCode());
if(m ==null || m.isEmpty()){
m = new HashMap<>();
}
m.put(d.getCodeIndex(),d.getIndexName());
map.put(d.getDicCode(),m);
}
servletContext.setAttribute("dictionaryMap",map);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
dictionaryService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}

@ -1,164 +0,0 @@
import java.util.*;
// 快递实体类POJO
class ExpressItem {
private String trackingNumber; // 运单号
private String recipient; // 收件人
private String phone; // 联系电话
private String status; // 包裹状态
private Date arrivalTime; // 到站时间
private String pickupCode; // 取件码
public ExpressItem(String trackingNumber, String recipient, String phone) {
this.trackingNumber = trackingNumber;
this.recipient = recipient;
this.phone = phone;
this.status = "待取件"; // 默认状态
this.arrivalTime = new Date();
this.pickupCode = generatePickupCode(); // 自动生成取件码
}
// 生成4位随机取件码0000-9999
private String generatePickupCode() {
Random random = new Random();
return String.format("%04d", random.nextInt(10000));
}
// Getter/Setter 区域省略其他getter/setter
public String getStatus() { return status; }
public String getPickupCode() { return pickupCode; }
// ...其他getter/setter保持原有结构
@Override
public String toString() {
return String.format("""
%s
%s
%s
%s
%tF %tT
""", trackingNumber, recipient, status, pickupCode, arrivalTime, arrivalTime);
}
}
// 快递业务逻辑类
class ExpressService {
private final Map<String, ExpressItem> database = new HashMap<>(); // 内存数据库
private int totalPackages = 0; // 总入库计数器
// 快递入库(返回是否成功)
public boolean addPackage(ExpressItem item) {
if (database.containsKey(item.getTrackingNumber())) return false; // 重复检查
database.put(item.getTrackingNumber(), item);
totalPackages++;
return true;
}
// 标记包裹为已取件
public boolean markAsPickedUp(String trackingNumber) {
ExpressItem item = database.get(trackingNumber);
if (item != null && "待取件".equals(item.getStatus())) { // 双重验证
item.setStatus("已取件");
return true;
}
return false;
}
// 统计方法
public int getTotalPackages() { return totalPackages; }
public int getPendingPackages() {
return (int) database.values().stream() // 使用流式计算
.filter(item -> "待取件".equals(item.getStatus()))
.count();
}
}
// 控制台交互层
public class ExpressManagementSystem {
private static final Scanner scanner = new Scanner(System.in);
private static final ExpressService service = new ExpressService();
public static void main(String[] args) {
while (true) {
printMenu();
int choice = getIntInput("请选择操作:");
switch (choice) {
case 1 -> addPackage();
case 2 -> pickupPackage();
case 3 -> searchPackage();
case 4 -> showStatistics();
case 5 -> System.exit(0);
default -> System.out.println("无效输入!");
}
}
}
private static void printMenu() {
System.out.println("""
===== =====
1.
2.
3.
4.
5. 退
""");
}
private static void addPackage() {
System.out.println("\n--- 快递入库 ---");
String trackingNumber = getNonEmptyInput("请输入运单号:");
String recipient = getNonEmptyInput("请输入收件人姓名:");
String phone = getValidPhone();
ExpressItem newItem = new ExpressItem(trackingNumber, recipient, phone);
System.out.println(service.addPackage(newItem)
? "入库成功!\n取件码" + newItem.getPickupCode()
: "该运单号已存在!");
}
private static void pickupPackage() {
System.out.println("\n--- 快递出库 ---");
String trackingNumber = getNonEmptyInput("请输入运单号:");
String inputCode = getNonEmptyInput("请输入取件码:");
ExpressItem item = service.getPackage(trackingNumber);
if (item == null) {
System.out.println("运单号不存在!");
return;
}
System.out.println(inputCode.equals(item.getPickupCode())
? service.markAsPickedUp(trackingNumber)
? "取件成功!"
: "该包裹已取件!"
: "取件码错误!");
}
// 辅助方法区域
private static String getNonEmptyInput(String prompt) {
while (true) {
String input = scanner.nextLine().trim();
if (!input.isEmpty()) return input;
System.out.print("输入不能为空,请重新输入:");
}
}
private static String getValidPhone() {
while (true) {
String phone = scanner.nextLine().trim();
if (phone.matches("1[3-9]\\d{9}")) return phone; // 中国手机号正则
System.out.print("手机号格式不正确,请重新输入:");
}
}
private static int getIntInput(String prompt) {
while (true) {
try {
return Integer.parseInt(scanner.nextLine().trim());
} catch (NumberFormatException e) {
System.out.print("请输入有效数字:");
}
}
}
}

@ -1,261 +0,0 @@
import java.io.*;
import java.util.*;
import java.util.stream.Collectors;
import com.google.gson.Gson; // 需要gson库支持添加依赖
/**
*
*
*/
class ExpressIteml {
// ... [原有属性保持不变]
private double weight; // 包裹重量(kg)
private Dimension dimension; // 包裹尺寸(cm)
private int storageDays; // 存放天数
public ExpressItem(String trackingNumber, String recipient, String phone,
double weight, int length, int width, int height) {
// ... [原有初始化代码]
this.weight = weight;
this.dimension = new Dimension(length, width, height);
this.storageDays = 0;
}
// 新增内部类:包裹尺寸
static class Dimension {
int length;
int width;
int height;
Dimension(int l, int w, int h) {
this.length = l;
this.width = w;
this.height = h;
}
@Override
public String toString() {
return String.format("%dx%dx%d cm", length, width, height);
}
}
// 新增业务方法:计算体积重量(航空件常用算法)
public double calculateVolumetricWeight() {
// 体积重量(kg) = 长(cm)*宽(cm)*高(cm)/6000
return (dimension.length * dimension.width * dimension.height) / 6000.0;
}
// Getter/Setter 区域(新增属性)
public double getWeight() { return weight; }
public Dimension getDimension() { return dimension; }
public int getStorageDays() { return storageDays; }
public void setStorageDays(int days) { this.storageDays = days; }
}
/**
*
*
*/
class ExpressService {
// ... [原有属性保持不变]
private final DataPersistence persistence = new DataPersistence();
private static final int MAX_STORAGE_DAYS = 7; // 最大免费存放天数
public ExpressService() {
// 启动时加载持久化数据
database = persistence.loadData();
// 更新所有包裹的存放天数(模拟每日自动更新)
updateStorageDays();
}
// 新增方法:更新所有包裹的存放天数
private void updateStorageDays() {
long today = new Date().getTime() / (24 * 3600 * 1000);
database.values().forEach(item -> {
long arrivalDay = item.getArrivalTime().getTime() / (24 * 3600 * 1000);
item.setStorageDays((int) (today - arrivalDay));
});
}
// 新增方法:获取超时包裹列表
public List<ExpressItem> getOverduePackages() {
return database.values().stream()
.filter(item -> item.getStorageDays() > MAX_STORAGE_DAYS)
.collect(Collectors.toList());
}
// 新增方法:按体积重量排序查询
public List<ExpressItem> searchByVolumetricWeight(double min, double max) {
return database.values().stream()
.filter(item -> {
double volWeight = item.calculateVolumetricWeight();
return volWeight >= min && volWeight <= max;
})
.sorted(Comparator.comparingDouble(ExpressItem::calculateVolumetricWeight).reversed())
.collect(Collectors.toList());
}
// 新增方法:批量标记为已取件
public int batchMarkAsPickedUp(List<String> trackingNumbers) {
return (int) trackingNumbers.stream()
.filter(tn -> {
ExpressItem item = database.get(tn);
return item != null && "待取件".equals(item.getStatus());
})
.peek(tn -> database.get(tn).setStatus("已取件"))
.count();
}
// 新增方法:获取仓库使用率统计
public Map<String, Double> getStorageUsage() {
Map<String, Double> usage = new HashMap<>();
long totalVolume = database.values().stream()
.mapToLong(item ->
item.getDimension().length *
item.getDimension().width *
item.getDimension().height
).sum();
usage.put("totalVolume", (double) totalVolume);
usage.put("averageVolume", totalVolume / (double) database.size());
return usage;
}
// 新增方法:数据持久化
public void saveData() {
persistence.saveData(database);
}
}
/**
*
* 使JSON
*/
class DataPersistence {
private static final String DATA_FILE = "express_data.json";
private final Gson gson = new Gson();
public Map<String, ExpressItem> loadData() {
try (Reader reader = new FileReader(DATA_FILE)) {
Type type = new com.google.gson.reflect.TypeToken<Map<String, ExpressItem>>() {}.getType();
return gson.fromJson(reader, type);
} catch (FileNotFoundException e) {
return new HashMap<>(); // 首次运行无数据文件
} catch (Exception e) {
System.err.println("数据加载错误: " + e.getMessage());
return new HashMap<>();
}
}
public void saveData(Map<String, ExpressItem> data) {
try (Writer writer = new FileWriter(DATA_FILE)) {
gson.toJson(data, writer);
} catch (Exception e) {
System.err.println("数据保存错误: " + e.getMessage());
}
}
}
/**
*
*
*/
public class ExpressManagementSystem {
// ... [原有属性保持不变]
private static final ExpressService service = new ExpressService();
private static void printAdvancedMenu() {
System.out.println("""
===== =====
6.
7.
8.
9. 使
10. 退
""");
}
private static void batchPickup() {
System.out.println("\n--- 批量取件 ---");
List<String> trackingNumbers = new ArrayList<>();
while (true) {
String tn = getNonEmptyInput("输入运单号输入0结束");
if ("0".equals(tn)) break;
trackingNumbers.add(tn);
}
int successCount = service.batchMarkAsPickedUp(trackingNumbers);
System.out.printf("成功取件%d个包裹\n", successCount);
}
private static void showOverduePackages() {
System.out.println("\n--- 超时包裹列表 ---");
List<ExpressItem> overdue = service.getOverduePackages();
if (overdue.isEmpty()) {
System.out.println("当前没有超时包裹");
return;
}
overdue.forEach(item ->
System.out.printf("运单号:%s 超时%d天\n",
item.getTrackingNumber(),
item.getStorageDays() - ExpressService.MAX_STORAGE_DAYS));
}
private static void volumetricSearch() {
System.out.println("\n--- 体积重量查询 ---");
double min = getDoubleInput("最小体积重量(kg)");
double max = getDoubleInput("最大体积重量(kg)");
List<ExpressItem> results = service.searchByVolumetricWeight(min, max);
if (results.isEmpty()) {
System.out.println("未找到匹配包裹");
return;
}
results.forEach(item ->
System.out.printf("运单号:%s 体积重量:%.2fkg\n",
item.getTrackingNumber(),
item.calculateVolumetricWeight()));
}
private static void showStorageStats() {
System.out.println("\n--- 仓库使用统计 ---");
Map<String, Double> stats = service.getStorageUsage();
System.out.printf("总占用体积:%,d cm³\n", stats.get("totalVolume").intValue());
System.out.printf("平均单件体积:%,.1f cm³\n", stats.get("averageVolume"));
}
public static void main(String[] args) {
while (true) {
printMenu();
int choice = getIntInput("请选择操作:");
switch (choice) {
case 1 -> addPackage();
case 2 -> pickupPackage();
case 3 -> searchPackage();
case 4 -> showStatistics();
case 5 -> printAdvancedMenu();
case 6 -> batchPickup();
case 7 -> showOverduePackages();
case 8 -> volumetricSearch();
case 9 -> showStorageStats();
case 10 -> {
service.saveData();
System.exit(0);
}
default -> System.out.println("无效输入!");
}
}
}
// 新增方法获取double类型输入
private static double getDoubleInput(String prompt) {
while (true) {
try {
return Double.parseDouble(scanner.nextLine().trim());
} catch (NumberFormatException e) {
System.out.print("请输入有效数字:");
}
}
}
}

@ -1,83 +0,0 @@
package com.controller;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.annotation.IgnoreAuth;
import com.entity.EIException;
import com.service.ConfigService;
import com.utils.R;
/**
*
*/
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController{
@Autowired
private ConfigService configService;
/**
*
*/
@RequestMapping("/upload")
public R upload(@RequestParam("file") MultipartFile file, String type,HttpServletRequest request) throws Exception {
if (file.isEmpty()) {
throw new EIException("上传文件不能为空");
}
String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
String fileName = new Date().getTime()+"."+fileExt;
File dest = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+fileName);
file.transferTo(dest);
if(StringUtils.isNotBlank(type) && type.equals("1")) {
ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
if(configEntity==null) {
configEntity = new ConfigEntity();
configEntity.setName("faceFile");
configEntity.setValue(fileName);
} else {
configEntity.setValue(fileName);
}
configService.insertOrUpdate(configEntity);
}
return R.ok().put("file", fileName);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/download")
public void download(@RequestParam String fileName, HttpServletRequest request, HttpServletResponse response) {
try {
File file = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+fileName);
if (file.exists()) {
response.reset();
response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName+"\"");
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Access-Control-Allow-Credentials", "true");
response.setContentType("application/octet-stream; charset=UTF-8");
IOUtils.write(FileUtils.readFileToByteArray(file), response.getOutputStream());
}
} catch (IOException e) {
e.printStackTrace();
}
}
}

@ -1,13 +0,0 @@
package com.controller;
import java.lang.annotation.*;
/**
* Token
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface IgnoreAuth {
}

@ -1,259 +0,0 @@
package com.controller;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import com.entity.DaiqurenEntity;
import com.entity.YijiedanEntity;
import com.entity.YonghuEntity;
import com.service.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.utils.StringUtil;
import java.lang.reflect.InvocationTargetException;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.JiedanEntity;
import com.entity.view.JiedanView;
import com.utils.PageUtils;
import com.utils.R;
/**
*
*
* @author
* @email
* @date 2021-03-11
*/
@RestController
@Controller
@RequestMapping("/jiedan")
public class JiedanController {
private static final Logger logger = LoggerFactory.getLogger(JiedanController.class);
@Autowired
private YijiedanService yijiedanService;
@Autowired
private JiedanService jiedanService;
@Autowired
private DaiqurenService daiqurenService;
@Autowired
private YonghuService yonghuService;
@Autowired
private DictionaryService dictionaryService;
//级联表service
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
PageUtils page = null;
if(StringUtil.isNotEmpty(role) && "用户".equals(role)){
params.put("yonghuId",request.getSession().getAttribute("userId"));
page = jiedanService.queryPage(params);
}
page = jiedanService.queryPage(params);
//字典表数据转换
List<JiedanView> list =(List<JiedanView>)page.getList();
for(JiedanView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c);
}
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
JiedanEntity jiedan = jiedanService.selectById(id);
if(jiedan !=null){
//entity转view
JiedanView view = new JiedanView();
BeanUtils.copyProperties( jiedan , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody JiedanEntity jiedan, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,jiedan:{}",this.getClass().getName(),jiedan.toString());
Wrapper<JiedanEntity> queryWrapper = new EntityWrapper<JiedanEntity>()
.eq("addresseename", jiedan.getAddresseename())
.eq("jdphone", jiedan.getJdphone())
.eq("jdaddressee", jiedan.getJdaddressee())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
JiedanEntity jiedanEntity = jiedanService.selectOne(queryWrapper);
if(jiedanEntity==null){
jiedanService.insert(jiedan);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody JiedanEntity jiedan, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,jiedan:{}",this.getClass().getName(),jiedan.toString());
//根据字段查询是否有相同数据
Wrapper<JiedanEntity> queryWrapper = new EntityWrapper<JiedanEntity>()
.notIn("id",jiedan.getId())
.eq("odd", jiedan.getOdd())
.eq("daiqukuaidimc", jiedan.getDaiqukuaidimc())
.eq("jdyonghu_id", jiedan.getJdyonghuId())
.eq("addresseename", jiedan.getAddresseename())
.eq("jdphone", jiedan.getJdphone())
.eq("jdaddressee", jiedan.getJdaddressee())
.eq("jdtakecode", jiedan.getJdtakecode())
.eq("jdzt_types", jiedan.getJdztTypes())
.eq("kdlx_types", jiedan.getKdlxTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
JiedanEntity jiedanEntity = jiedanService.selectOne(queryWrapper);
jiedan.setInitiateTime(new Date());
if(jiedanEntity==null){
jiedanService.updateById(jiedan);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/receiving")
public R receiving(@RequestBody Integer ids, HttpServletRequest request){
JiedanEntity jiedan = jiedanService.selectById(ids);
if(jiedan == null){
return R.error();
}
if(request.getSession().getAttribute("role").equals("代取人")){
DaiqurenEntity userId = daiqurenService.selectById((Integer) request.getSession().getAttribute("userId"));
jiedan.setJdztTypes(2);//以接
YijiedanEntity yijiedan = new YijiedanEntity();
yijiedan.setOdd(jiedan.getOdd());
yijiedan.setYonghuId(jiedan.getJdyonghuId());
yijiedan.setFbphone(jiedan.getJdphone());
yijiedan.setDaiqurenId(userId.getId());
yijiedan.setJdphone(userId.getPhone());
yijiedan.setInitiateTime(new Date());
yijiedan.setDdztTypes(1);//1正在路上
Wrapper<YijiedanEntity> queryWrapper = new EntityWrapper<YijiedanEntity>()
.eq("odd", yijiedan.getOdd())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
YijiedanEntity yijiedanEntity = yijiedanService.selectOne(queryWrapper);
if(yijiedanEntity==null){
jiedanService.updateById(jiedan);
yijiedanService.insert(yijiedan);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
return R.error("***");
}
/**
*
*/
@RequestMapping("/ship")
public R ship(String name, Integer yh, Integer dx, HttpServletRequest request){
if(name == null && name == "null" && name == ""){
return R.error("快递名称不能为空");
}
if(yh == null && yh == 0){
return R.error("收件人不能为空");
}
YonghuEntity yonghu = yonghuService.selectById(yh);
if(yonghu == null){
return R.error();
}
if(yonghu.getId() == (Integer)request.getSession().getAttribute("userId")){
return R.error("发件人和收件人不能相同");
}
JiedanEntity jiedan = new JiedanEntity();
jiedan.setOdd(String.valueOf(new Date().getTime()));
jiedan.setDaiqukuaidimc(name);
jiedan.setDx(dx);
jiedan.setJdyonghuId((Integer)request.getSession().getAttribute("userId"));
jiedan.setJdphone(yonghu.getPhone());
jiedan.setInitiateTime(new Date());
jiedan.setAddresseename(yonghu.getName());
jiedan.setJdaddressee("住宿楼栋:"+yonghu.getDormitory()+" ,寝室号:"+yonghu.getDormitory());
jiedan.setJdtakecode(UUID.randomUUID().toString().toString().replace("-","").substring(0,6));
jiedan.setJdztTypes(1);//1未接
jiedan.setKdlxTypes(2);//2寄件
Wrapper<JiedanEntity> queryWrapper = new EntityWrapper<JiedanEntity>()
.eq("addresseename", jiedan.getAddresseename())
.eq("jdphone", jiedan.getJdphone())
.eq("jdaddressee", jiedan.getJdaddressee())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
JiedanEntity jiedanEntity = jiedanService.selectOne(queryWrapper);
if(jiedanEntity==null){
jiedanService.insert(jiedan);
return R.ok();
}else {
return R.error(511,"已经有相同的数据了");
}
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
jiedanService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}

@ -1,235 +0,0 @@
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
*
*
*/
public class OverduePackageService {
// 配置参数(可通过配置文件加载)
private static final int MAX_FREE_DAYS = 7; // 最大免费存放天数
private static final double DAILY_STORAGE_FEE = 1.0; // 每日滞留费用(元)
private static final int NOTICE_INTERVAL = 3; // 提醒间隔天数
// 依赖服务注入
private final ExpressService expressService;
private final NotificationService notificationService;
// 内部状态管理
private final Map<String, OverdueRecord> overdueRecords = new HashMap<>();
private final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
/**
*
*/
public OverduePackageService(ExpressService expressService,
NotificationService notificationService) {
this.expressService = expressService;
this.notificationService = notificationService;
initializeOverdueMonitoring();
}
/**
* 线
*/
private void initializeOverdueMonitoring() {
// 创建定时任务每24小时执行一次检测
Timer timer = new Timer(true);
timer.scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
detectAndProcessOverduePackages();
}
}, 0, 24 * 60 * 60 * 1000);
}
/**
*
*/
public synchronized void detectAndProcessOverduePackages() {
// 1. 获取所有待取件包裹
List<ExpressItem> allPackages = expressService.getAllPackages()
.stream()
.filter(item -> "待取件".equals(item.getStatus()))
.collect(Collectors.toList());
// 2. 计算存放天数并识别滞留件
List<ExpressItem> overduePackages = new ArrayList<>();
for (ExpressItem item : allPackages) {
int storageDays = calculateStorageDays(item.getArrivalTime());
item.setStorageDays(storageDays);
if (storageDays > MAX_FREE_DAYS) {
overduePackages.add(item);
recordOverdueHistory(item, storageDays);
}
}
// 3. 执行滞留处理流程
overduePackages.forEach(this::processOverduePackage);
}
/**
*
*/
private int calculateStorageDays(Date arrivalTime) {
long now = System.currentTimeMillis();
long elapsed = now - arrivalTime.getTime();
return (int) (elapsed / (24 * 3600 * 1000));
}
/**
*
*/
private void recordOverdueHistory(ExpressItem item, int currentDays) {
String trackingNumber = item.getTrackingNumber();
overdueRecords.putIfAbsent(trackingNumber, new OverdueRecord());
OverdueRecord record = overdueRecords.get(trackingNumber);
if (record.getLastNoticeDay() == 0 ||
(currentDays - record.getLastNoticeDay()) >= NOTICE_INTERVAL) {
record.setLastNoticeDay(currentDays);
record.incrementNoticeCount();
}
}
/**
*
*/
private void processOverduePackage(ExpressItem item) {
// 1. 费用计算
double overdueFee = calculateOverdueFee(item.getStorageDays());
// 2. 生成通知内容
String noticeContent = buildNoticeContent(item, overdueFee);
// 3. 发送通知(支持多通道)
sendMultiChannelNotice(item.getPhone(), noticeContent);
// 4. 标记为滞留状态(可选扩展)
if (item.getStorageDays() > MAX_FREE_DAYS * 2) {
expressService.markAsOverdue(item.getTrackingNumber());
}
}
/**
* 线
*/
private double calculateOverdueFee(int storageDays) {
int overdueDays = storageDays - MAX_FREE_DAYS;
return overdueDays > 0 ? overdueDays * DAILY_STORAGE_FEE : 0;
}
/**
*
*/
private String buildNoticeContent(ExpressItem item, double fee) {
return String.format("""
%s
%s
%d
%.2f
""",
item.getTrackingNumber(),
item.getRecipient(),
item.getStorageDays(),
fee);
}
/**
* ++
*/
private void sendMultiChannelNotice(String phone, String content) {
// 短信通知
notificationService.sendSMS(phone, content);
// 邮件通知(需实现邮件服务)
// notificationService.sendEmail(recipientEmail, "快递滞留提醒", content);
// 系统内消息(需集成消息中心)
// messageCenter.pushSystemNotice(userId, content);
}
/**
*
*/
public String generateOverdueReport() {
Map<Integer, Long> dailyCount = overdueRecords.values().stream()
.collect(Collectors.groupingBy(
OverdueRecord::getNoticeCount,
Collectors.counting()
));
StringBuilder report = new StringBuilder();
report.append("===== 滞留件统计报表 =====\n");
report.append("统计时间:").append(dateFormat.format(new Date())).append("\n");
report.append("-------------------------\n");
report.append("总滞留包裹数:").append(overdueRecords.size()).append("\n");
dailyCount.forEach((times, count) ->
report.append(String.format("被提醒%d次包裹数%d\n", times, count)));
return report.toString();
}
/**
*
*/
private static class OverdueRecord {
private int lastNoticeDay; // 最后一次通知时的存放天数
private int noticeCount; // 通知发送次数
// Getter/Setter
public int getLastNoticeDay() { return lastNoticeDay; }
public void setLastNoticeDay(int day) { this.lastNoticeDay = day; }
public int getNoticeCount() { return noticeCount; }
public void incrementNoticeCount() { this.noticeCount++; }
}
/**
*
*/
public interface NotificationService {
void sendSMS(String phone, String message);
// void sendEmail(String to, String subject, String content);
}
/**
*
*/
public List<ExpressItem> queryOverduePackages(int minDays, int maxDays) {
return expressService.getAllPackages().stream()
.filter(item -> {
int days = item.getStorageDays();
return days >= minDays && days <= maxDays;
})
.sorted(Comparator.comparingInt(ExpressItem::getStorageDays).reversed())
.collect(Collectors.toList());
}
/**
* 退
*/
public int batchReturnOverduePackages(int maxDays) {
List<ExpressItem> toReturn = queryOverduePackages(maxDays, Integer.MAX_VALUE);
toReturn.forEach(item -> expressService.markAsReturned(item.getTrackingNumber()));
return toReturn.size();
}
/**
*
*/
public Map<String, Double> getOverdueFees(String trackingNumber) {
OverdueRecord record = overdueRecords.get(trackingNumber);
if (record == null) return Collections.emptyMap();
Map<String, Double> feeDetail = new HashMap<>();
feeDetail.put("baseFee", (double) (record.getNoticeCount() * NOTICE_INTERVAL));
feeDetail.put("totalFee", calculateOverdueFee(record.getNoticeCount() * NOTICE_INTERVAL));
return feeDetail;
}
}

@ -1,301 +0,0 @@
import java.security.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.stream.Collectors;
/**
*
* //
*/
public class PickupCodeService {
// 配置参数(建议通过配置中心动态加载)
private static final int CODE_LENGTH = 6; // 取件码长度
private static final int MAX_ATTEMPTS = 3; // 最大尝试次数
private static final long EXPIRATION_TIME = 24 * 3600; // 有效期(秒)
private static final int CLEANUP_INTERVAL = 60 * 60; // 清理线程间隔(秒)
// 依赖服务注入
private final ExpressService expressService;
private final SecureRandom secureRandom;
private final ScheduledExecutorService cleanupScheduler;
// 核心数据存储内存数据库实际应使用Redis等持久化存储
private final Map<String, PickupCodeRecord> codeDatabase = new ConcurrentHashMap<>();
private final Map<String, Integer> attemptCounter = new ConcurrentHashMap<>();
/**
*
*/
public PickupCodeService(ExpressService expressService) {
this.expressService = expressService;
this.secureRandom = new SecureRandom();
this.cleanupScheduler = Executors.newSingleThreadScheduledExecutor();
initializeCleanupTask();
}
/**
*
*/
private void initializeCleanupTask() {
cleanupScheduler.scheduleAtFixedRate(() -> {
long now = System.currentTimeMillis();
codeDatabase.entrySet().removeIf(entry ->
entry.getValue().getExpirationTime() < now);
}, CLEANUP_INTERVAL, CLEANUP_INTERVAL, TimeUnit.SECONDS);
}
/**
*
* @param trackingNumber
* @return
* @throws CodeGenerationException
*/
public PickupCode generatePickupCode(String trackingNumber)
throws CodeGenerationException {
// 1. 参数验证
if (!expressService.packageExists(trackingNumber)) {
throw new CodeGenerationException("包裹不存在");
}
// 2. 生成唯一码(时间戳+随机数+包裹哈希)
String baseCode = String.format("%d%06d",
System.currentTimeMillis() % 1000000,
secureRandom.nextInt(999999));
String hashedCode = hashCode(baseCode + trackingNumber);
String formattedCode = String.format("%s-%s",
hashedCode.substring(0, 3),
hashedCode.substring(3, 6));
// 3. 创建记录对象
PickupCodeRecord record = new PickupCodeRecord(
formattedCode,
trackingNumber,
System.currentTimeMillis() + EXPIRATION_TIME * 1000
);
// 4. 防重存储CAS操作保证原子性
codeDatabase.putIfAbsent(formattedCode, record);
return new PickupCode(formattedCode, record.getExpirationTime());
}
/**
*
* @param inputCode
* @param phone
* @return
*/
public ValidationResult validatePickupCode(String inputCode, String phone)
throws InvalidCodeException {
// 1. 格式预校验
if (!inputCode.matches("\\d{3}-\\d{3}")) {
throw new InvalidCodeException("格式错误");
}
// 2. 防暴力破解计数器
attemptCounter.merge(phone, 1, Integer::sum);
if (attemptCounter.get(phone) > MAX_ATTEMPTS) {
throw new InvalidCodeException("尝试次数过多请1小时后重试");
}
// 3. 核心验证逻辑
PickupCodeRecord record = codeDatabase.get(inputCode);
if (record == null) {
throw new InvalidCodeException("无效取件码");
}
if (record.isExpired()) {
throw new InvalidCodeException("取件码已过期");
}
if (!record.getTrackingNumber().equals(
expressService.getPackageByPhone(phone).getTrackingNumber())) {
throw new InvalidCodeException("取件码与包裹不匹配");
}
// 4. 验证成功后清理计数器
attemptCounter.remove(phone);
return new ValidationResult(true, record.getTrackingNumber());
}
/**
*
*/
private String hashCode(String input) {
try {
MessageDigest md = MessageDigest.getInstance("SHA-256");
byte[] hashBytes = md.digest(input.getBytes());
return bytesToHex(hashBytes).substring(0, CODE_LENGTH);
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException("哈希算法不可用", e);
}
}
/**
*
*/
private String bytesToHex(byte[] bytes) {
StringBuilder hexString = new StringBuilder();
for (byte b : bytes) {
String hex = Integer.toHexString(0xff & b);
if (hex.length() == 1) {
hexString.append('0');
}
hexString.append(hex);
}
return hexString.toString();
}
/**
*
*/
public Optional<PickupCodeInfo> queryCodeInfo(String code) {
PickupCodeRecord record = codeDatabase.get(code);
if (record == null) return Optional.empty();
ExpressItem item = expressService.getPackage(record.getTrackingNumber());
return Optional.of(new PickupCodeInfo(
code,
item.getRecipient(),
item.getPhone(),
new Date(record.getExpirationTime()),
record.isUsed()
));
}
/**
* 使
*/
public void markCodeAsUsed(String code) {
PickupCodeRecord record = codeDatabase.get(code);
if (record != null) {
record.setUsed(true);
}
}
/**
*
*/
public List<PickupCode> batchGenerateCodes(int quantity)
throws CodeGenerationException {
return IntStream.range(0, quantity)
.mapToObj(i -> {
try {
return generatePickupCode(generateTrackingNumber());
} catch (CodeGenerationException e) {
throw new RuntimeException(e);
}
})
.collect(Collectors.toList());
}
/**
*
*/
private String generateTrackingNumber() {
return "TEST" + System.currentTimeMillis() % 1000000;
}
/**
*
*/
public static class PickupCode {
private final String code;
private final long expirationTime;
PickupCode(String code, long expirationTime) {
this.code = code;
this.expirationTime = expirationTime;
}
// Getter方法
public String getCode() { return code; }
public long getExpirationTime() { return expirationTime; }
}
/**
*
*/
public static class ValidationResult {
private final boolean valid;
private final String trackingNumber;
ValidationResult(boolean valid, String trackingNumber) {
this.valid = valid;
this.trackingNumber = trackingNumber;
}
// Getter方法
public boolean isValid() { return valid; }
public String getTrackingNumber() { return trackingNumber; }
}
/**
*
*/
public static class PickupCodeInfo {
private final String code;
private final String recipient;
private final String phone;
private final Date expiration;
private final boolean used;
PickupCodeInfo(String code, String recipient, String phone,
Date expiration, boolean used) {
this.code = code;
this.recipient = recipient;
this.phone = phone;
this.expiration = expiration;
this.used = used;
}
// Getter方法
public String getCode() { return code; }
public String getRecipient() { return recipient; }
public String getPhone() { return phone; }
public Date getExpiration() { return expiration; }
public boolean isUsed() { return used; }
}
/**
*
*/
public static class CodeGenerationException extends Exception {
public CodeGenerationException(String message) {
super(message);
}
}
public static class InvalidCodeException extends Exception {
public InvalidCodeException(String message) {
super(message);
}
}
/**
*
*/
private static class PickupCodeRecord {
private final String code;
private final String trackingNumber;
private final long expirationTime;
private boolean used = false;
PickupCodeRecord(String code, String trackingNumber, long expirationTime) {
this.code = code;
this.trackingNumber = trackingNumber;
this.expirationTime = expirationTime;
}
// Getter/Setter
public String getCode() { return code; }
public String getTrackingNumber() { return trackingNumber; }
public long getExpirationTime() { return expirationTime; }
public boolean isExpired() {
return System.currentTimeMillis() > expirationTime;
}
public boolean isUsed() { return used; }
public void setUsed(boolean used) { this.used = used; }
}
}

@ -1,178 +0,0 @@
package com.controller;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;
/**
*
*/
@RequestMapping("users")
@RestController
public class UserController{
@Autowired
private UserService userService;
@Autowired
private TokenService tokenService;
/**
*
*/
@IgnoreAuth
@PostMapping(value = "/login")
public R login(String username, String password, String role, HttpServletRequest request) {
UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
if(user != null){
if(!user.getRole().equals(role)){
return R.error("权限不正常");
}
if(user==null || !user.getPassword().equals(password)) {
return R.error("账号或密码不正确");
}
String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
return R.ok().put("token", token);
}else{
return R.error("账号或密码或权限不对");
}
}
/**
*
*/
@IgnoreAuth
@PostMapping(value = "/register")
public R register(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
return R.error("用户已存在");
}
userService.insert(user);
return R.ok();
}
/**
* 退
*/
@GetMapping(value = "logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
/**
*
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
if(user==null) {
return R.error("账号不存在");
}
user.setPassword("123456");
userService.update(user,null);
return R.ok("密码已重置为123456");
}
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,UserEntity user){
EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/list")
public R list( UserEntity user){
EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
ew.allEq(MPUtil.allEQMapPre( user, "user"));
return R.ok().put("data", userService.selectListView(ew));
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id){
UserEntity user = userService.selectById(id);
return R.ok().put("data", user);
}
/**
* session
*/
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
Integer id = (Integer)request.getSession().getAttribute("userId");
UserEntity user = userService.selectById(id);
return R.ok().put("data", user);
}
/**
*
*/
@PostMapping("/save")
public R save(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
return R.error("用户已存在");
}
userService.insert(user);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
userService.updateById(user);//全部更新
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
userService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}

@ -1,263 +0,0 @@
import java.security.*;
import java.util.*;
import java.util.regex.*;
import javax.crypto.*;
import javax.crypto.spec.SecretKeySpec;
/**
*
* /
*/
class UserManagementService {
// 内存存储结构(实际项目应使用数据库)
private final Map<String, User> userDatabase = new HashMap<>();
private final Map<String, Session> activeSessions = new HashMap<>();
private static final String SECRET_KEY = "express@Sys#Key2025"; // 加密密钥(生产环境应存储在安全配置)
/**
*
* @param username 4-16
* @param password
* @param role admin/staff/customer
* @return
*/
public RegistrationResult registerUser(String username, String password, String role)
throws NoSuchAlgorithmException, InvalidKeySpecException {
// 1. 参数验证
if (!isValidUsername(username)) {
return new RegistrationResult(false, "用户名需为4-16位字母数字");
}
if (userDatabase.containsKey(username)) {
return new RegistrationResult(false, "用户名已存在");
}
if (!isValidPassword(password)) {
return new RegistrationResult(false, "密码需包含大小写字母和数字至少8位");
}
if (!isValidRole(role)) {
return new RegistrationResult(false, "无效角色类型");
}
// 2. 密码加密处理
String salt = generateSalt();
String hashedPwd = hashPassword(password, salt);
// 3. 创建用户对象
User newUser = new User(username, hashedPwd, salt, role);
userDatabase.put(username, newUser);
return new RegistrationResult(true, "注册成功", newUser);
}
/**
*
* @param username
* @param password
* @return
*/
public AuthenticationResult authenticate(String username, String password)
throws NoSuchAlgorithmException, InvalidKeySpecException {
User user = userDatabase.get(username);
if (user == null) {
return new AuthenticationResult(false, "用户不存在");
}
// 验证密码
String testHash = hashPassword(password, user.getSalt());
if (!testHash.equals(user.getHashedPassword())) {
return new AuthenticationResult(false, "密码错误");
}
// 生成会话令牌JWT风格
String token = generateSessionToken(username);
activeSessions.put(token, new Session(token, username, new Date()));
return new AuthenticationResult(true, "认证成功", token);
}
/**
*
* @param password
* @return
*/
private boolean isValidPassword(String password) {
if (password.length() < 8) return false;
boolean hasUpper = false, hasLower = false, hasDigit = false;
for (char c : password.toCharArray()) {
if (Character.isUpperCase(c)) hasUpper = true;
else if (Character.isLowerCase(c)) hasLower = true;
else if (Character.isDigit(c)) hasDigit = true;
}
return hasUpper && hasLower && hasDigit;
}
/**
* 16
*/
private String generateSalt() {
SecureRandom random = new SecureRandom();
byte[] salt = new byte[16];
random.nextBytes(salt);
return Base64.getEncoder().encodeToString(salt);
}
/**
* PBKDF2
*/
private String hashPassword(String password, String salt)
throws NoSuchAlgorithmException, InvalidKeySpecException {
int iterations = 10000;
int keyLength = 256;
char[] passwordChars = password.toCharArray();
byte[] saltBytes = Base64.getDecoder().decode(salt);
PBEKeySpec spec = new PBEKeySpec(passwordChars, saltBytes, iterations, keyLength);
SecretKeyFactory skf = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256");
byte[] hash = skf.generateSecret(spec).getEncoded();
return String.format("%d$%s$%s",
iterations,
Base64.getEncoder().encodeToString(saltBytes),
Base64.getEncoder().encodeToString(hash));
}
/**
* HMAC-SHA256
*/
private String generateSessionToken(String username) {
try {
Mac sha256_HMAC = Mac.getInstance("HmacSHA256");
SecretKeySpec secret_key = new SecretKeySpec(SECRET_KEY.getBytes(), "HmacSHA256");
sha256_HMAC.init(secret_key);
String baseString = username + new Date().getTime();
return Base64.getEncoder().encodeToString(
sha256_HMAC.doFinal(baseString.getBytes())
);
} catch (Exception e) {
throw new RuntimeException("令牌生成失败", e);
}
}
/**
*
* @param requiredRole
*/
public static class RoleValidator {
private final String currentRole;
public RoleValidator(String sessionToken) {
// 实际应从会话中获取用户角色
this.currentRole = "customer"; // 示例值
}
public void validate(String requiredRole) throws InsufficientPermissionsException {
if (!currentRole.equals(requiredRole)) {
throw new InsufficientPermissionsException(
String.format("需要%s权限当前角色%s", requiredRole, currentRole));
}
}
}
/**
*
*/
static class User {
private final String username;
private final String hashedPassword;
private final String salt;
private final String role;
User(String username, String hashedPassword, String salt, String role) {
this.username = username;
this.hashedPassword = hashedPassword;
this.salt = salt;
this.role = role;
}
// Getter方法根据安全需求限制访问
public String getUsername() { return username; }
public String getHashedPassword() { return hashedPassword; }
public String getSalt() { return salt; }
public String getRole() { return role; }
}
/**
*
*/
static class Session {
private final String token;
private final String username;
private final Date createdAt;
Session(String token, String username, Date createdAt) {
this.token = token;
this.username = username;
this.createdAt = createdAt;
}
// Getter方法
public String getToken() { return token; }
public String getUsername() { return username; }
public Date getCreatedAt() { return createdAt; }
}
/**
*
*/
static class RegistrationResult {
private final boolean success;
private final String message;
private final User user;
RegistrationResult(boolean success, String message) {
this(success, message, null);
}
RegistrationResult(boolean success, String message, User user) {
this.success = success;
this.message = message;
this.user = user;
}
// Getter方法
public boolean isSuccess() { return success; }
public String getMessage() { return message; }
public User getUser() { return user; }
}
/**
*
*/
static class AuthenticationResult {
private final boolean success;
private final String message;
private final String token;
AuthenticationResult(boolean success, String message) {
this(success, message, null);
}
AuthenticationResult(boolean success, String message, String token) {
this.success = success;
this.message = message;
this.token = token;
}
// Getter方法
public boolean isSuccess() { return success; }
public String getMessage() { return message; }
public String getToken() { return token; }
}
/**
*
*/
static class InsufficientPermissionsException extends SecurityException {
public InsufficientPermissionsException(String message) {
super(message);
}
}
}

@ -1,246 +0,0 @@
package com.controller;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import com.entity.*;
import com.service.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.utils.StringUtil;
import java.lang.reflect.InvocationTargetException;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.view.YijiedanView;
import com.utils.PageUtils;
import com.utils.R;
/**
*
*
* @author
* @email
* @date 2021-03-11
*/
@RestController
@Controller
@RequestMapping("/yijiedan")
public class YijiedanController {
private static final Logger logger = LoggerFactory.getLogger(YijiedanController.class);
@Autowired
private YijiedanService yijiedanService;
@Autowired
private JiedanService jiedanService;
@Autowired
private DictionaryService dictionaryService;
@Autowired
private DaiquService daiquService;
//级联表service
@Autowired
private DaiqurenService daiqurenService;
@Autowired
private YonghuService yonghuService;
@Autowired
private ZhandianService zhandianService;
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
PageUtils page = null;
if(StringUtil.isNotEmpty(role) && "用户".equals(role)){
params.put("yonghuId",request.getSession().getAttribute("userId"));
page = yijiedanService.queryPage(params);
}else if(StringUtil.isNotEmpty(role) && "代取人".equals(role)){
params.put("daiqurenId",request.getSession().getAttribute("userId"));
page = yijiedanService.queryPage(params);
}
page = yijiedanService.queryPage(params);
//字典表数据转换
List<YijiedanView> list =(List<YijiedanView>)page.getList();
for(YijiedanView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c);
}
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
YijiedanEntity yijiedan = yijiedanService.selectById(id);
if(yijiedan !=null){
//entity转view
YijiedanView view = new YijiedanView();
BeanUtils.copyProperties( yijiedan , view );//把实体数据重构到view中
//级联表
DaiqurenEntity daiquren = daiqurenService.selectById(yijiedan.getDaiqurenId());
if(daiquren != null){
view.setDaiqurenId(daiquren.getId());
view.setYhname(daiquren.getName());
}
//级联表
YonghuEntity yonghu = yonghuService.selectById(yijiedan.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody YijiedanEntity yijiedan, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,yijiedan:{}",this.getClass().getName(),yijiedan.toString());
Wrapper<YijiedanEntity> queryWrapper = new EntityWrapper<YijiedanEntity>()
.eq("odd", yijiedan.getOdd())
.eq("yonghu_id", yijiedan.getYonghuId())
.eq("fbphone", yijiedan.getFbphone())
.eq("daiquren_id", yijiedan.getDaiqurenId())
.eq("jdphone", yijiedan.getJdphone())
.eq("ddzt_types", yijiedan.getDdztTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
YijiedanEntity yijiedanEntity = yijiedanService.selectOne(queryWrapper);
if(yijiedanEntity==null){
// String role = String.valueOf(request.getSession().getAttribute("role"));
// if("".equals(role)){
// yijiedan.set
// }
yijiedanService.insert(yijiedan);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody YijiedanEntity yijiedan, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,yijiedan:{}",this.getClass().getName(),yijiedan.toString());
//根据字段查询是否有相同数据
Wrapper<YijiedanEntity> queryWrapper = new EntityWrapper<YijiedanEntity>()
.notIn("id",yijiedan.getId())
.eq("odd", yijiedan.getOdd())
.eq("yonghu_id", yijiedan.getYonghuId())
.eq("fbphone", yijiedan.getFbphone())
.eq("daiquren_id", yijiedan.getDaiqurenId())
.eq("jdphone", yijiedan.getJdphone())
.eq("ddzt_types", yijiedan.getDdztTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
YijiedanEntity yijiedanEntity = yijiedanService.selectOne(queryWrapper);
yijiedan.setInitiateTime(new Date());
if(yijiedanEntity==null){
// String role = String.valueOf(request.getSession().getAttribute("role"));
// if("".equals(role)){
// yijiedan.set
// }
yijiedanService.updateById(yijiedan);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/accomplish")
public R accomplish(@RequestBody Integer ids){
YijiedanEntity yijiedan = yijiedanService.selectById(ids);
if(yijiedan == null){
return R.error();
}
JiedanEntity odd = jiedanService.selectOne(new EntityWrapper<JiedanEntity>().eq("odd", yijiedan.getOdd()));
if(odd == null){
return R.error();
}
if(odd.getKdlxTypes() == 1){
DaiquEntity takecode = daiquService.selectOne(new EntityWrapper().eq("takecode", odd.getJdtakecode()));
if(takecode == null){
return R.error();
}
takecode.setKdztTypes(2);
takecode.setPickupTime(new Date());
daiquService.updateById(takecode);
}else{
DaiquEntity daiqu = new DaiquEntity();
List<ZhandianEntity> zhandian = zhandianService.selectList(null);
int max=zhandian.size()-1,min=0;
int ran2 = (int) (Math.random()*(max-min)+min);
//随机站点
daiqu.setZhandianId(zhandian.get(ran2).getId());
//快递名称
daiqu.setDqname(odd.getDaiqukuaidimc());
//快递大小
daiqu.setKddxTypes(odd.getDx());
daiqu.setKdztTypes(1);
//收件用户id
YonghuEntity name = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("name", odd.getAddresseename()));
daiqu.setYonghuId(name.getId());
//手机号
daiqu.setDqphone(name.getPhone());
//取件码
daiqu.setTakecode(UUID.randomUUID().toString().toString().replace("-","").substring(0,6));
daiquService.insert(daiqu);
}
yijiedan.setDdztTypes(2);//2已完成
yijiedanService.updateById(yijiedan);
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
yijiedanService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}

@ -1,242 +0,0 @@
package com.controller;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.StringUtil;
import java.lang.reflect.InvocationTargetException;
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.YonghuEntity;
import com.service.YonghuService;
import com.entity.view.YonghuView;
import com.utils.PageUtils;
import com.utils.R;
/**
*
*
* @author
* @email
* @date 2021-03-11
*/
@RestController
@Controller
@RequestMapping("/yonghu")
public class YonghuController {
private static final Logger logger = LoggerFactory.getLogger(YonghuController.class);
@Autowired
private YonghuService yonghuService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
PageUtils page = yonghuService.queryPage(params);
//字典表数据转换
List<YonghuView> list =(List<YonghuView>)page.getList();
for(YonghuView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c);
}
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
YonghuEntity yonghu = yonghuService.selectById(id);
if(yonghu !=null){
//entity转view
YonghuView view = new YonghuView();
BeanUtils.copyProperties( yonghu , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/save")
public R save(@RequestBody YonghuEntity yonghu, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,yonghu:{}",this.getClass().getName(),yonghu.toString());
Wrapper<YonghuEntity> queryWrapper = new EntityWrapper<YonghuEntity>()
.eq("studentnumber", yonghu.getStudentnumber())
.eq("name", yonghu.getName())
.eq("username", yonghu.getUsername())
.eq("password", yonghu.getPassword())
.eq("sex_types", yonghu.getSexTypes())
.eq("phone", yonghu.getPhone())
.eq("zhuSuLou", yonghu.getZhuSuLou())
.eq("dormitory", yonghu.getDormitory())
.eq("role", yonghu.getRole())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);
if(yonghuEntity==null){
if(yonghu.getPassword()== "" || yonghu.getPassword() == null){
yonghu.setPassword("123456");
}
yonghu.setRole("用户");
yonghuService.insert(yonghu);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody YonghuEntity yonghu, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,yonghu:{}",this.getClass().getName(),yonghu.toString());
//根据字段查询是否有相同数据
Wrapper<YonghuEntity> queryWrapper = new EntityWrapper<YonghuEntity>()
.notIn("id",yonghu.getId())
.eq("studentnumber", yonghu.getStudentnumber())
.eq("name", yonghu.getName())
.eq("username", yonghu.getUsername())
.eq("password", yonghu.getPassword())
.eq("sex_types", yonghu.getSexTypes())
.eq("phone", yonghu.getPhone())
.eq("zhuSuLou", yonghu.getZhuSuLou())
.eq("dormitory", yonghu.getDormitory())
.eq("role", yonghu.getRole())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);
if("".equals(yonghu.getImgPhoto()) || "null".equals(yonghu.getImgPhoto())){
yonghu.setImgPhoto(null);
}
if(yonghuEntity==null){
yonghuService.updateById(yonghu);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
yonghuService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
*
*/
@RequestMapping("/yanz")
public R delete(Integer ids){
YonghuEntity yonghu = yonghuService.selectById(ids);
if(yonghu!= null){
return R.error();
}
yonghu.setYanzheng(1);
yonghuService.updateById(yonghu);
return R.ok();
}
/**
*
*/
@IgnoreAuth
@PostMapping(value = "/login")
public R login(String username, String password, String role, HttpServletRequest request) {
YonghuEntity yonghu = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("username", username));
if(yonghu==null || !yonghu.getPassword().equals(password)) {
return R.error("账号或密码不正确");
}
if(yonghu.getYanzheng() != 1){
return R.error("还未通过验证请耐心等待");
}
if(!role.equals(yonghu.getRole())){
return R.error("权限不正确");
}
String token = tokenService.generateToken(yonghu.getId(),username, "yonghu", "用户");
R r = R.ok();
r.put("token", token);
r.put("role","用户");
r.put("userId",yonghu.getId());
return r;
}
/**
*
*/
@IgnoreAuth
@PostMapping(value = "/register")
public R register(@RequestBody YonghuEntity yonghu){
// ValidatorUtils.validateEntity(user);
if(yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("username", yonghu.getUsername()).orNew().eq("phone",yonghu.getPhone())) !=null) {
return R.error("用户已存在或手机号身份证号已经被使用");
}
yonghuService.insert(yonghu);
return R.ok();
}
/**
* session
*/
@RequestMapping("/session")
public R getCurrYonghu(HttpServletRequest request){
Integer id = (Integer)request.getSession().getAttribute("userId");
YonghuEntity yonghu = yonghuService.selectById(id);
return R.ok().put("data", yonghu);
}
/**
* 退
*/
@GetMapping(value = "logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
}

@ -1,182 +0,0 @@
package com.controller;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.StringUtil;
import java.lang.reflect.InvocationTargetException;
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.ZhandianEntity;
import com.service.ZhandianService;
import com.entity.view.ZhandianView;
import com.utils.PageUtils;
import com.utils.R;
/**
*
*
* @author
* @email
* @date 2021-03-11
*/
/**
*
* CRUD
*
*
* 1.
* 2.
* 3.
*
* @author
* @email
* @date 2021-03-11
*/
@RestController
@RequestMapping("/zhandian")
public class ZhandianController {
private static final Logger logger = LoggerFactory.getLogger(ZhandianController.class);
@Autowired private ZhandianService zhandianService; // 站点核心业务服务
@Autowired private TokenService tokenService; // 用户认证服务
@Autowired private DictionaryService dictionaryService; // 数据字典服务
/**
*
* @param params page/limit
* @param request HTTP
* @return
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request) {
// 日志记录:输出调试信息(使用参数化日志避免字符串拼接)
logger.debug("分页查询参数: {}", JSONObject.toJSONString(params));
// 用户权限校验:普通用户只能查看关联数据
if("用户".equals(request.getSession().getAttribute("role"))) {
params.put("yonghuId", request.getSession().getAttribute("userId"));
}
// 执行分页查询
PageUtils page = zhandianService.queryPage(params);
// 数据转换:将实体列表转为视图对象并处理字典值
((List<ZhandianView>)page.getList()).forEach(dictionaryService::dictionaryConvert);
return R.ok().put("data", page);
}
/**
*
* @param id ID
* @return
* @throws 511
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id) {
logger.debug("查询站点详情, ID: {}", id);
ZhandianEntity entity = zhandianService.selectById(id);
if(entity == null) return R.error(511, "查不到数据");
// 实体转视图:过滤敏感字段并准备返回数据
ZhandianView view = new ZhandianView();
BeanUtils.copyProperties(entity, view);
// 字典值转换:将编码值转为可读文本
dictionaryService.dictionaryConvert(view);
return R.ok().put("data", view);
}
}
/**
*
*/
/**
*
* @param zhandian zdname/address
* @param request HTTP
* @return 200511
*
* @apiNote
* 1. zdname+address
* 2.
*/
@RequestMapping("/add")
public R add(@RequestBody ZhandianEntity zhandian, HttpServletRequest request) {
// 唯一性校验(名称+地址组合唯一)
Wrapper<ZhandianEntity> queryWrapper = new EntityWrapper<ZhandianEntity>()
.eq("zdname", zhandian.getZdname())
.eq("address", zhandian.getAddress());
if(zhandianService.selectOne(queryWrapper) == null) {
// 权限校验预留接口(当前注释状态)
zhandianService.insert(zhandian);
return R.ok();
}
return R.error(511, "表中有相同数据");
}
/**
*
* @param zhandian id
* @param request HTTP
* @return 200511
*
* @apiNote
* 1. idzdname+address
* 2.
* 3.
*/
@RequestMapping("/update")
public R update(@RequestBody ZhandianEntity zhandian, HttpServletRequest request) {
// 唯一性校验(排除当前记录)
Wrapper<ZhandianEntity> queryWrapper = new EntityWrapper<ZhandianEntity>()
.notIn("id", zhandian.getId())
.eq("zdname", zhandian.getZdname())
.eq("address", zhandian.getAddress());
logger.info("生成的SQL片段: {}", queryWrapper.getSqlSegment());
if(zhandianService.selectOne(queryWrapper) == null) {
zhandianService.updateById(zhandian);
return R.ok();
}
return R.error(511, "表中有相同数据");
}
/**
*
* @param ids ID
* @return
*
* @apiNote
* 1. 使
* 2.
* 3.
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids) {
logger.debug("待删除ID列表: {}", Arrays.toString(ids));
int affectRows = zhandianService.deleteBatchIds(Arrays.asList(ids));
return R.ok().put("data", "成功删除"+affectRows+"条记录");
}

@ -1,26 +0,0 @@
package com.dao;
import java.util.List;
import java.util.Map;
/**
*
*/
public interface CommonDao{
List<String> getOption(Map<String, Object> params);
Map<String, Object> getFollowByOption(Map<String, Object> params);
List<String> getFollowByOption2(Map<String, Object> params);
void sh(Map<String, Object> params);
int remindCount(Map<String, Object> params);
Map<String, Object> selectCal(Map<String, Object> params);
List<Map<String, Object>> selectGroup(Map<String, Object> params);
List<Map<String, Object>> selectValue(Map<String, Object> params);
}

@ -1,13 +0,0 @@
package com.dao;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.entity.ConfigEntity;
/**
*
*/
public interface ConfigDao extends BaseMapper<ConfigEntity> {
}

@ -1,22 +0,0 @@
package com.dao;
import com.entity.DaiquEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.DaiquView;
/**
* Dao
*
* @author
* @since 2021-03-11
*/
public interface DaiquDao extends BaseMapper<DaiquEntity> {
List<DaiquView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -1,22 +0,0 @@
package com.dao;
import com.entity.DaiqurenEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.DaiqurenView;
/**
* Dao
*
* @author
* @since 2021-03-11
*/
public interface DaiqurenDao extends BaseMapper<DaiqurenEntity> {
List<DaiqurenView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -1,22 +0,0 @@
package com.dao;
import com.entity.DictionaryEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.DictionaryView;
/**
* Dao
*
* @author
* @since 2021-03-11
*/
public interface DictionaryDao extends BaseMapper<DictionaryEntity> {
List<DictionaryView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -1,22 +0,0 @@
package com.dao;
import com.entity.JiedanEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.JiedanView;
/**
* Dao
*
* @author
* @since 2021-03-11
*/
public interface JiedanDao extends BaseMapper<JiedanEntity> {
List<JiedanView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -1,22 +0,0 @@
package com.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.entity.TokenEntity;
/**
* token
*/
public interface TokenDao extends BaseMapper<TokenEntity> {
List<TokenEntity> selectListView(@Param("ew") Wrapper<TokenEntity> wrapper);
List<TokenEntity> selectListView(Pagination page, @Param("ew") Wrapper<TokenEntity> wrapper);
}

@ -1,22 +0,0 @@
package com.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.entity.UserEntity;
/**
*
*/
public interface UserDao extends BaseMapper<UserEntity> {
List<UserEntity> selectListView(@Param("ew") Wrapper<UserEntity> wrapper);
List<UserEntity> selectListView(Pagination page, @Param("ew") Wrapper<UserEntity> wrapper);
}

@ -1,22 +0,0 @@
package com.dao;
import com.entity.YijiedanEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.YijiedanView;
/**
* Dao
*
* @author
* @since 2021-03-11
*/
public interface YijiedanDao extends BaseMapper<YijiedanEntity> {
List<YijiedanView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -1,22 +0,0 @@
package com.dao;
import com.entity.YonghuEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.YonghuView;
/**
* Dao
*
* @author
* @since 2021-03-11
*/
public interface YonghuDao extends BaseMapper<YonghuEntity> {
List<YonghuView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -1,22 +0,0 @@
package com.dao;
import com.entity.ZhandianEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.ZhandianView;
/**
* Dao
*
* @author
* @since 2021-03-11
*/
public interface ZhandianDao extends BaseMapper<ZhandianEntity> {
List<ZhandianView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -1,31 +0,0 @@
package com.model.enums;
import java.io.Serializable;
import com.baomidou.mybatisplus.enums.IEnum;
/**
* IEnum spring-mybatis.xml typeEnumsPackage
*/
public enum TypeEnum implements IEnum {
DISABLED(0, "禁用"),
NORMAL(1, "正常");
private final int value;
private final String desc;
TypeEnum(final int value, final String desc) {
this.value = value;
this.desc = desc;
}
@Override
public Serializable getValue() {
return this.value;
}
// Jackson 注解为 JsonValue 返回中文 json 描述
public String getDesc() {
return this.desc;
}
}
Loading…
Cancel
Save