first commit
This commit is contained in:
31
.gitignore
vendored
Normal file
31
.gitignore
vendored
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
HELP.md
|
||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**
|
||||||
|
!**/src/test/**
|
||||||
|
|
||||||
|
### STS ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
118
.mvn/wrapper/MavenWrapperDownloader.java
vendored
Normal file
118
.mvn/wrapper/MavenWrapperDownloader.java
vendored
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2012-2019 the original author or authors.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.net.*;
|
||||||
|
import java.io.*;
|
||||||
|
import java.nio.channels.*;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
public class MavenWrapperDownloader {
|
||||||
|
|
||||||
|
private static final String WRAPPER_VERSION = "0.5.5";
|
||||||
|
/**
|
||||||
|
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
|
||||||
|
*/
|
||||||
|
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
|
||||||
|
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
|
||||||
|
* use instead of the default one.
|
||||||
|
*/
|
||||||
|
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
|
||||||
|
".mvn/wrapper/maven-wrapper.properties";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Path where the maven-wrapper.jar will be saved to.
|
||||||
|
*/
|
||||||
|
private static final String MAVEN_WRAPPER_JAR_PATH =
|
||||||
|
".mvn/wrapper/maven-wrapper.jar";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Name of the property which should be used to override the default download url for the wrapper.
|
||||||
|
*/
|
||||||
|
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
|
||||||
|
|
||||||
|
public static void main(String args[]) {
|
||||||
|
System.out.println("- Downloader started");
|
||||||
|
File baseDirectory = new File(args[0]);
|
||||||
|
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
|
||||||
|
|
||||||
|
// If the maven-wrapper.properties exists, read it and check if it contains a custom
|
||||||
|
// wrapperUrl parameter.
|
||||||
|
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
|
||||||
|
String url = DEFAULT_DOWNLOAD_URL;
|
||||||
|
if (mavenWrapperPropertyFile.exists()) {
|
||||||
|
FileInputStream mavenWrapperPropertyFileInputStream = null;
|
||||||
|
try {
|
||||||
|
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
|
||||||
|
Properties mavenWrapperProperties = new Properties();
|
||||||
|
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
|
||||||
|
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
|
||||||
|
} catch (IOException e) {
|
||||||
|
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if (mavenWrapperPropertyFileInputStream != null) {
|
||||||
|
mavenWrapperPropertyFileInputStream.close();
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
// Ignore ...
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("- Downloading from: " + url);
|
||||||
|
|
||||||
|
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
|
||||||
|
if (!outputFile.getParentFile().exists()) {
|
||||||
|
if (!outputFile.getParentFile().mkdirs()) {
|
||||||
|
System.out.println(
|
||||||
|
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
|
||||||
|
try {
|
||||||
|
downloadFileFromURL(url, outputFile);
|
||||||
|
System.out.println("Done");
|
||||||
|
System.exit(0);
|
||||||
|
} catch (Throwable e) {
|
||||||
|
System.out.println("- Error downloading");
|
||||||
|
e.printStackTrace();
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
|
||||||
|
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
|
||||||
|
String username = System.getenv("MVNW_USERNAME");
|
||||||
|
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
|
||||||
|
Authenticator.setDefault(new Authenticator() {
|
||||||
|
@Override
|
||||||
|
protected PasswordAuthentication getPasswordAuthentication() {
|
||||||
|
return new PasswordAuthentication(username, password);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
URL website = new URL(urlString);
|
||||||
|
ReadableByteChannel rbc;
|
||||||
|
rbc = Channels.newChannel(website.openStream());
|
||||||
|
FileOutputStream fos = new FileOutputStream(destination);
|
||||||
|
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
|
||||||
|
fos.close();
|
||||||
|
rbc.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
BIN
.mvn/wrapper/maven-wrapper.jar
vendored
Normal file
BIN
.mvn/wrapper/maven-wrapper.jar
vendored
Normal file
Binary file not shown.
2
.mvn/wrapper/maven-wrapper.properties
vendored
Normal file
2
.mvn/wrapper/maven-wrapper.properties
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.2/apache-maven-3.6.2-bin.zip
|
||||||
|
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar
|
||||||
38
README.md
Normal file
38
README.md
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
项目概述:
|
||||||
|
此项目为dpapp项目,包含dp小程序,月租奖励,供应商,法大大等多个业务的组合
|
||||||
|
|
||||||
|
|
||||||
|
对接人:
|
||||||
|
王波涵 (如果需要接口文档以及业务逻辑上的问题请联系王波涵)
|
||||||
|
|
||||||
|
项目主要为推送以及定时任务:
|
||||||
|
以下为相关接口:
|
||||||
|
@PostMapping("/dpapp")
|
||||||
|
@PostMapping("/count")
|
||||||
|
@PostMapping("/count1")
|
||||||
|
@PostMapping("/geren")
|
||||||
|
@PostMapping("/gerentype")
|
||||||
|
@PostMapping("/nostatus")
|
||||||
|
@PostMapping("/nostatu")
|
||||||
|
@PostMapping("/useridtime")
|
||||||
|
@PostMapping("/selectmax")
|
||||||
|
@PostMapping("/reward")
|
||||||
|
@PostMapping("/id")
|
||||||
|
@PostMapping("/yingxiao")
|
||||||
|
@PostMapping("/zuofei")
|
||||||
|
@PostMapping("/test")
|
||||||
|
|
||||||
|
|
||||||
|
定时任务:
|
||||||
|
|
||||||
|
@Scheduled(fixedRate = 3600000)
|
||||||
|
public void main11() throws Exception {
|
||||||
|
。。。。。}
|
||||||
|
|
||||||
|
|
||||||
|
@Scheduled(cron = "0 0 1 * * ?")
|
||||||
|
|
||||||
|
public void maina() {
|
||||||
|
。。。。。。。。。。
|
||||||
|
}
|
||||||
|
|
||||||
322
mvnw
vendored
Normal file
322
mvnw
vendored
Normal file
@ -0,0 +1,322 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
# or more contributor license agreements. See the NOTICE file
|
||||||
|
# distributed with this work for additional information
|
||||||
|
# regarding copyright ownership. The ASF licenses this file
|
||||||
|
# to you under the Apache License, Version 2.0 (the
|
||||||
|
# "License"); you may not use this file except in compliance
|
||||||
|
# with the License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing,
|
||||||
|
# software distributed under the License is distributed on an
|
||||||
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
# KIND, either express or implied. See the License for the
|
||||||
|
# specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# Maven2 Start Up Batch script
|
||||||
|
#
|
||||||
|
# Required ENV vars:
|
||||||
|
# ------------------
|
||||||
|
# JAVA_HOME - location of a JDK home dir
|
||||||
|
#
|
||||||
|
# Optional ENV vars
|
||||||
|
# -----------------
|
||||||
|
# M2_HOME - location of maven2's installed home dir
|
||||||
|
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||||
|
# e.g. to debug Maven itself, use
|
||||||
|
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||||
|
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if [ -z "$MAVEN_SKIP_RC" ]; then
|
||||||
|
|
||||||
|
if [ -f /etc/mavenrc ]; then
|
||||||
|
. /etc/mavenrc
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "$HOME/.mavenrc" ]; then
|
||||||
|
. "$HOME/.mavenrc"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
# OS specific support. $var _must_ be set to either true or false.
|
||||||
|
cygwin=false
|
||||||
|
darwin=false
|
||||||
|
mingw=false
|
||||||
|
case "$(uname)" in
|
||||||
|
CYGWIN*) cygwin=true ;;
|
||||||
|
MINGW*) mingw=true ;;
|
||||||
|
Darwin*)
|
||||||
|
darwin=true
|
||||||
|
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
|
||||||
|
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
|
||||||
|
if [ -z "$JAVA_HOME" ]; then
|
||||||
|
if [ -x "/usr/libexec/java_home" ]; then
|
||||||
|
export JAVA_HOME="$(/usr/libexec/java_home)"
|
||||||
|
else
|
||||||
|
export JAVA_HOME="/Library/Java/Home"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -z "$JAVA_HOME" ]; then
|
||||||
|
if [ -r /etc/gentoo-release ]; then
|
||||||
|
JAVA_HOME=$(java-config --jre-home)
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$M2_HOME" ]; then
|
||||||
|
## resolve links - $0 may be a link to maven's home
|
||||||
|
PRG="$0"
|
||||||
|
|
||||||
|
# need this for relative symlinks
|
||||||
|
while [ -h "$PRG" ]; do
|
||||||
|
ls=$(ls -ld "$PRG")
|
||||||
|
link=$(expr "$ls" : '.*-> \(.*\)$')
|
||||||
|
if expr "$link" : '/.*' >/dev/null; then
|
||||||
|
PRG="$link"
|
||||||
|
else
|
||||||
|
PRG="$(dirname "$PRG")/$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
saveddir=$(pwd)
|
||||||
|
|
||||||
|
M2_HOME=$(dirname "$PRG")/..
|
||||||
|
|
||||||
|
# make it fully qualified
|
||||||
|
M2_HOME=$(cd "$M2_HOME" && pwd)
|
||||||
|
|
||||||
|
cd "$saveddir"
|
||||||
|
# echo Using m2 at $M2_HOME
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
||||||
|
if $cygwin; then
|
||||||
|
[ -n "$M2_HOME" ] &&
|
||||||
|
M2_HOME=$(cygpath --unix "$M2_HOME")
|
||||||
|
[ -n "$JAVA_HOME" ] &&
|
||||||
|
JAVA_HOME=$(cygpath --unix "$JAVA_HOME")
|
||||||
|
[ -n "$CLASSPATH" ] &&
|
||||||
|
CLASSPATH=$(cygpath --path --unix "$CLASSPATH")
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Mingw, ensure paths are in UNIX format before anything is touched
|
||||||
|
if $mingw; then
|
||||||
|
[ -n "$M2_HOME" ] &&
|
||||||
|
M2_HOME="$( (
|
||||||
|
cd "$M2_HOME"
|
||||||
|
pwd
|
||||||
|
))"
|
||||||
|
[ -n "$JAVA_HOME" ] &&
|
||||||
|
JAVA_HOME="$( (
|
||||||
|
cd "$JAVA_HOME"
|
||||||
|
pwd
|
||||||
|
))"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$JAVA_HOME" ]; then
|
||||||
|
javaExecutable="$(which javac)"
|
||||||
|
if [ -n "$javaExecutable" ] && ! [ "$(expr \"$javaExecutable\" : '\([^ ]*\)')" = "no" ]; then
|
||||||
|
# readlink(1) is not available as standard on Solaris 10.
|
||||||
|
readLink=$(which readlink)
|
||||||
|
if [ ! $(expr "$readLink" : '\([^ ]*\)') = "no" ]; then
|
||||||
|
if $darwin; then
|
||||||
|
javaHome="$(dirname \"$javaExecutable\")"
|
||||||
|
javaExecutable="$(cd \"$javaHome\" && pwd -P)/javac"
|
||||||
|
else
|
||||||
|
javaExecutable="$(readlink -f \"$javaExecutable\")"
|
||||||
|
fi
|
||||||
|
javaHome="$(dirname \"$javaExecutable\")"
|
||||||
|
javaHome=$(expr "$javaHome" : '\(.*\)/bin')
|
||||||
|
JAVA_HOME="$javaHome"
|
||||||
|
export JAVA_HOME
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$JAVACMD" ]; then
|
||||||
|
if [ -n "$JAVA_HOME" ]; then
|
||||||
|
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
|
||||||
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
|
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||||
|
else
|
||||||
|
JAVACMD="$JAVA_HOME/bin/java"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
JAVACMD="$(which java)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -x "$JAVACMD" ]; then
|
||||||
|
echo "Error: JAVA_HOME is not defined correctly." >&2
|
||||||
|
echo " We cannot execute $JAVACMD" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$JAVA_HOME" ]; then
|
||||||
|
echo "Warning: JAVA_HOME environment variable is not set."
|
||||||
|
fi
|
||||||
|
|
||||||
|
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
|
||||||
|
|
||||||
|
# traverses directory structure from process work directory to filesystem root
|
||||||
|
# first directory with .mvn subdirectory is considered project base directory
|
||||||
|
find_maven_basedir() {
|
||||||
|
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
echo "Path not specified to find_maven_basedir"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
basedir="$1"
|
||||||
|
wdir="$1"
|
||||||
|
while [ "$wdir" != '/' ]; do
|
||||||
|
if [ -d "$wdir"/.mvn ]; then
|
||||||
|
basedir=$wdir
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
|
||||||
|
if [ -d "${wdir}" ]; then
|
||||||
|
wdir=$(
|
||||||
|
cd "$wdir/.."
|
||||||
|
pwd
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
# end of workaround
|
||||||
|
done
|
||||||
|
echo "${basedir}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# concatenates all lines of a file
|
||||||
|
concat_lines() {
|
||||||
|
if [ -f "$1" ]; then
|
||||||
|
echo "$(tr -s '\n' ' ' <"$1")"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
BASE_DIR=$(find_maven_basedir "$(pwd)")
|
||||||
|
if [ -z "$BASE_DIR" ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
##########################################################################################
|
||||||
|
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||||
|
# This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||||
|
##########################################################################################
|
||||||
|
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Found .mvn/wrapper/maven-wrapper.jar"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
|
||||||
|
fi
|
||||||
|
if [ -n "$MVNW_REPOURL" ]; then
|
||||||
|
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
|
||||||
|
else
|
||||||
|
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
|
||||||
|
fi
|
||||||
|
while IFS="=" read key value; do
|
||||||
|
case "$key" in wrapperUrl)
|
||||||
|
jarUrl="$value"
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done <"$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Downloading from: $jarUrl"
|
||||||
|
fi
|
||||||
|
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
|
||||||
|
if $cygwin; then
|
||||||
|
wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath")
|
||||||
|
fi
|
||||||
|
|
||||||
|
if command -v wget >/dev/null; then
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Found wget ... using wget"
|
||||||
|
fi
|
||||||
|
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||||
|
wget "$jarUrl" -O "$wrapperJarPath"
|
||||||
|
else
|
||||||
|
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
|
||||||
|
fi
|
||||||
|
elif command -v curl >/dev/null; then
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Found curl ... using curl"
|
||||||
|
fi
|
||||||
|
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||||
|
curl -o "$wrapperJarPath" "$jarUrl" -f
|
||||||
|
else
|
||||||
|
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Falling back to using Java to download"
|
||||||
|
fi
|
||||||
|
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
|
||||||
|
# For Cygwin, switch paths to Windows format before running javac
|
||||||
|
if $cygwin; then
|
||||||
|
javaClass=$(cygpath --path --windows "$javaClass")
|
||||||
|
fi
|
||||||
|
if [ -e "$javaClass" ]; then
|
||||||
|
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo " - Compiling MavenWrapperDownloader.java ..."
|
||||||
|
fi
|
||||||
|
# Compiling the Java class
|
||||||
|
("$JAVA_HOME/bin/javac" "$javaClass")
|
||||||
|
fi
|
||||||
|
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||||
|
# Running the downloader
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo " - Running MavenWrapperDownloader.java ..."
|
||||||
|
fi
|
||||||
|
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
##########################################################################################
|
||||||
|
# End of extension
|
||||||
|
##########################################################################################
|
||||||
|
|
||||||
|
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo $MAVEN_PROJECTBASEDIR
|
||||||
|
fi
|
||||||
|
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
|
||||||
|
|
||||||
|
# For Cygwin, switch paths to Windows format before running java
|
||||||
|
if $cygwin; then
|
||||||
|
[ -n "$M2_HOME" ] &&
|
||||||
|
M2_HOME=$(cygpath --path --windows "$M2_HOME")
|
||||||
|
[ -n "$JAVA_HOME" ] &&
|
||||||
|
JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME")
|
||||||
|
[ -n "$CLASSPATH" ] &&
|
||||||
|
CLASSPATH=$(cygpath --path --windows "$CLASSPATH")
|
||||||
|
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
|
||||||
|
MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR")
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Provide a "standardized" way to retrieve the CLI args that will
|
||||||
|
# work with both Windows and non-Windows executions.
|
||||||
|
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
|
||||||
|
export MAVEN_CMD_LINE_ARGS
|
||||||
|
|
||||||
|
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||||
|
|
||||||
|
exec "$JAVACMD" \
|
||||||
|
$MAVEN_OPTS \
|
||||||
|
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
|
||||||
|
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
||||||
|
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
|
||||||
182
mvnw.cmd
vendored
Normal file
182
mvnw.cmd
vendored
Normal file
@ -0,0 +1,182 @@
|
|||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
@REM Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
@REM or more contributor license agreements. See the NOTICE file
|
||||||
|
@REM distributed with this work for additional information
|
||||||
|
@REM regarding copyright ownership. The ASF licenses this file
|
||||||
|
@REM to you under the Apache License, Version 2.0 (the
|
||||||
|
@REM "License"); you may not use this file except in compliance
|
||||||
|
@REM with the License. You may obtain a copy of the License at
|
||||||
|
@REM
|
||||||
|
@REM https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
@REM
|
||||||
|
@REM Unless required by applicable law or agreed to in writing,
|
||||||
|
@REM software distributed under the License is distributed on an
|
||||||
|
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
@REM KIND, either express or implied. See the License for the
|
||||||
|
@REM specific language governing permissions and limitations
|
||||||
|
@REM under the License.
|
||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
@REM Maven2 Start Up Batch script
|
||||||
|
@REM
|
||||||
|
@REM Required ENV vars:
|
||||||
|
@REM JAVA_HOME - location of a JDK home dir
|
||||||
|
@REM
|
||||||
|
@REM Optional ENV vars
|
||||||
|
@REM M2_HOME - location of maven2's installed home dir
|
||||||
|
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
|
||||||
|
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
|
||||||
|
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||||
|
@REM e.g. to debug Maven itself, use
|
||||||
|
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||||
|
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
|
||||||
|
@echo off
|
||||||
|
@REM set title of command window
|
||||||
|
title %0
|
||||||
|
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
|
||||||
|
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
|
||||||
|
|
||||||
|
@REM set %HOME% to equivalent of $HOME
|
||||||
|
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
|
||||||
|
|
||||||
|
@REM Execute a user defined script before this one
|
||||||
|
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
|
||||||
|
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
|
||||||
|
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
|
||||||
|
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
|
||||||
|
:skipRcPre
|
||||||
|
|
||||||
|
@setlocal
|
||||||
|
|
||||||
|
set ERROR_CODE=0
|
||||||
|
|
||||||
|
@REM To isolate internal variables from possible post scripts, we use another setlocal
|
||||||
|
@setlocal
|
||||||
|
|
||||||
|
@REM ==== START VALIDATION ====
|
||||||
|
if not "%JAVA_HOME%" == "" goto OkJHome
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo Error: JAVA_HOME not found in your environment. >&2
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||||
|
echo location of your Java installation. >&2
|
||||||
|
echo.
|
||||||
|
goto error
|
||||||
|
|
||||||
|
:OkJHome
|
||||||
|
if exist "%JAVA_HOME%\bin\java.exe" goto init
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo Error: JAVA_HOME is set to an invalid directory. >&2
|
||||||
|
echo JAVA_HOME = "%JAVA_HOME%" >&2
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||||
|
echo location of your Java installation. >&2
|
||||||
|
echo.
|
||||||
|
goto error
|
||||||
|
|
||||||
|
@REM ==== END VALIDATION ====
|
||||||
|
|
||||||
|
:init
|
||||||
|
|
||||||
|
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
|
||||||
|
@REM Fallback to current working directory if not found.
|
||||||
|
|
||||||
|
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
|
||||||
|
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
|
||||||
|
|
||||||
|
set EXEC_DIR=%CD%
|
||||||
|
set WDIR=%EXEC_DIR%
|
||||||
|
:findBaseDir
|
||||||
|
IF EXIST "%WDIR%"\.mvn goto baseDirFound
|
||||||
|
cd ..
|
||||||
|
IF "%WDIR%"=="%CD%" goto baseDirNotFound
|
||||||
|
set WDIR=%CD%
|
||||||
|
goto findBaseDir
|
||||||
|
|
||||||
|
:baseDirFound
|
||||||
|
set MAVEN_PROJECTBASEDIR=%WDIR%
|
||||||
|
cd "%EXEC_DIR%"
|
||||||
|
goto endDetectBaseDir
|
||||||
|
|
||||||
|
:baseDirNotFound
|
||||||
|
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
|
||||||
|
cd "%EXEC_DIR%"
|
||||||
|
|
||||||
|
:endDetectBaseDir
|
||||||
|
|
||||||
|
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
|
||||||
|
|
||||||
|
@setlocal EnableExtensions EnableDelayedExpansion
|
||||||
|
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
|
||||||
|
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
|
||||||
|
|
||||||
|
:endReadAdditionalConfig
|
||||||
|
|
||||||
|
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
|
||||||
|
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
|
||||||
|
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||||
|
|
||||||
|
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
|
||||||
|
|
||||||
|
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
|
||||||
|
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
|
||||||
|
)
|
||||||
|
|
||||||
|
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||||
|
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||||
|
if exist %WRAPPER_JAR% (
|
||||||
|
if "%MVNW_VERBOSE%" == "true" (
|
||||||
|
echo Found %WRAPPER_JAR%
|
||||||
|
)
|
||||||
|
) else (
|
||||||
|
if not "%MVNW_REPOURL%" == "" (
|
||||||
|
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
|
||||||
|
)
|
||||||
|
if "%MVNW_VERBOSE%" == "true" (
|
||||||
|
echo Couldn't find %WRAPPER_JAR%, downloading it ...
|
||||||
|
echo Downloading from: %DOWNLOAD_URL%
|
||||||
|
)
|
||||||
|
|
||||||
|
powershell -Command "&{"^
|
||||||
|
"$webclient = new-object System.Net.WebClient;"^
|
||||||
|
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
|
||||||
|
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
|
||||||
|
"}"^
|
||||||
|
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
|
||||||
|
"}"
|
||||||
|
if "%MVNW_VERBOSE%" == "true" (
|
||||||
|
echo Finished downloading %WRAPPER_JAR%
|
||||||
|
)
|
||||||
|
)
|
||||||
|
@REM End of extension
|
||||||
|
|
||||||
|
@REM Provide a "standardized" way to retrieve the CLI args that will
|
||||||
|
@REM work with both Windows and non-Windows executions.
|
||||||
|
set MAVEN_CMD_LINE_ARGS=%*
|
||||||
|
|
||||||
|
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
|
||||||
|
if ERRORLEVEL 1 goto error
|
||||||
|
goto end
|
||||||
|
|
||||||
|
:error
|
||||||
|
set ERROR_CODE=1
|
||||||
|
|
||||||
|
:end
|
||||||
|
@endlocal & set ERROR_CODE=%ERROR_CODE%
|
||||||
|
|
||||||
|
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
|
||||||
|
@REM check for post script, once with legacy .bat ending and once with .cmd ending
|
||||||
|
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
|
||||||
|
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
|
||||||
|
:skipRcPost
|
||||||
|
|
||||||
|
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
|
||||||
|
if "%MAVEN_BATCH_PAUSE%" == "on" pause
|
||||||
|
|
||||||
|
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
|
||||||
|
|
||||||
|
exit /B %ERROR_CODE%
|
||||||
79
pom.xml
Normal file
79
pom.xml
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
|
<version>2.2.1.RELEASE</version>
|
||||||
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
|
</parent>
|
||||||
|
<groupId>com.example</groupId>
|
||||||
|
<artifactId>sso</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
<name>sso</name>
|
||||||
|
<description>Demo project for Spring Boot</description>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<java.version>1.8</java.version>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.auth0</groupId>
|
||||||
|
<artifactId>java-jwt</artifactId>
|
||||||
|
<version>3.8.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
<artifactId>httpclient</artifactId>
|
||||||
|
<version>4.5.13</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>fastjson</artifactId>
|
||||||
|
<version>1.2.45</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fadada.api</groupId>
|
||||||
|
<artifactId>fasc-openapi-java-sdk</artifactId>
|
||||||
|
<version>5.3.7.1221</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.jcraft</groupId>
|
||||||
|
<artifactId>jsch</artifactId>
|
||||||
|
<version>0.1.55</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
||||||
17
src/main/java/com/example/sso/SsoApplication.java
Normal file
17
src/main/java/com/example/sso/SsoApplication.java
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
package com.example.sso;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
@EnableScheduling
|
||||||
|
@EnableAsync
|
||||||
|
public class SsoApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(SsoApplication.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
53
src/main/java/com/example/sso/config/AsyncConfig.java
Normal file
53
src/main/java/com/example/sso/config/AsyncConfig.java
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
package com.example.sso.config;
|
||||||
|
|
||||||
|
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.scheduling.annotation.AsyncConfigurer;
|
||||||
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||||
|
|
||||||
|
import java.util.concurrent.Executor;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@EnableAsync
|
||||||
|
public class AsyncConfig implements AsyncConfigurer {
|
||||||
|
|
||||||
|
// ThredPoolTaskExcutor的处理流程
|
||||||
|
// 当池子大小小于corePoolSize,就新建线程,并处理请求
|
||||||
|
// 当池子大小等于corePoolSize,把请求放入workQueue中,池子里的空闲线程就去workQueue中取任务并处理
|
||||||
|
// 当workQueue放不下任务时,就新建线程入池,并处理请求,如果池子大小撑到了maximumPoolSize,就用RejectedExecutionHandler来做拒绝处理
|
||||||
|
// 当池子的线程数大于corePoolSize时,多余的线程会等待keepAliveTime长时间,如果无请求可处理就自行销毁
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Bean
|
||||||
|
public Executor getAsyncExecutor() {
|
||||||
|
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||||
|
// 核心线程数:线程池创建的时候初始化的线程数
|
||||||
|
executor.setCorePoolSize(30);
|
||||||
|
// 最大线程数:线程池最大的线程数,只有缓冲队列满了之后才会申请超过核心线程数的线程
|
||||||
|
executor.setMaxPoolSize(100);
|
||||||
|
// 缓冲队列:用来缓冲执行任务的队列
|
||||||
|
executor.setQueueCapacity(50);
|
||||||
|
// 线程池关闭:等待所有任务都完成再关闭
|
||||||
|
executor.setWaitForTasksToCompleteOnShutdown(true);
|
||||||
|
// 等待时间:等待5秒后强制停止
|
||||||
|
executor.setAwaitTerminationSeconds(5);
|
||||||
|
// 允许空闲时间:超过核心线程之外的线程到达60秒后会被销毁
|
||||||
|
executor.setKeepAliveSeconds(60);
|
||||||
|
// 线程名称前缀
|
||||||
|
executor.setThreadNamePrefix("fadada");
|
||||||
|
// 缓冲队列满了之后的拒绝策略:由调用线程处理(一般是主线程)
|
||||||
|
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||||
|
|
||||||
|
// 初始化线程
|
||||||
|
executor.initialize();
|
||||||
|
return executor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
21
src/main/java/com/example/sso/config/FddConfig.java
Normal file
21
src/main/java/com/example/sso/config/FddConfig.java
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
package com.example.sso.config;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@ConfigurationProperties(prefix = "fdd")
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Validated
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class FddConfig {
|
||||||
|
private String AppID;
|
||||||
|
private String AppSecret;
|
||||||
|
}
|
||||||
23
src/main/java/com/example/sso/config/SSOConfig.java
Normal file
23
src/main/java/com/example/sso/config/SSOConfig.java
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
package com.example.sso.config;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
//import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@ConfigurationProperties(prefix = "sso")
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Validated
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class SSOConfig {
|
||||||
|
private String acs;
|
||||||
|
private String secret;
|
||||||
|
}
|
||||||
391
src/main/java/com/example/sso/controller/AppController.java
Normal file
391
src/main/java/com/example/sso/controller/AppController.java
Normal file
@ -0,0 +1,391 @@
|
|||||||
|
package com.example.sso.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
import com.example.sso.util.FDaDaUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@Slf4j
|
||||||
|
@Async
|
||||||
|
public class AppController {
|
||||||
|
@PostMapping("/dpapp")
|
||||||
|
public String qianzhangdp(@RequestBody JSONObject signature) throws Exception {
|
||||||
|
JSONObject data = signature.getJSONObject("data");
|
||||||
|
String yifang = data.getString("yifang");
|
||||||
|
String gongminshenfenhaoma = data.getString("gongminshenfenhaoma");
|
||||||
|
String lianxidianhua = data.getString("lianxidianhua");
|
||||||
|
String shoukuanrenmingcheng = data.getString("shoukuanrenmingcheng");
|
||||||
|
String kaihuhangmingcheng = data.getString("kaihuhangmingcheng");
|
||||||
|
String kaihuhangzhanghao = data.getString("kaihuhangzhanghao");
|
||||||
|
String fuwuqixianqishiriqinian = data.getString("fuwuqixianqishiriqinian");
|
||||||
|
String fuwuqixianqishiriqiyue = data.getString("fuwuqixianqishiriqiyue");
|
||||||
|
String fuwuqixianqishiriqiri = data.getString("fuwuqixianqishiriqiri");
|
||||||
|
String fuwuqixianjieshuriqinian = data.getString("fuwuqixianjieshuriqinian");
|
||||||
|
String fuwuqixianjieshuriqiyue = data.getString("fuwuqixianjieshuriqiyue");
|
||||||
|
String fuwuqixianjieshuriqiri = data.getString("fuwuqixianjieshuriqiri");
|
||||||
|
String gerenxinxiliushuihao = data.getString("gerenxinxiliushuihao");
|
||||||
|
String idFdd = data.getString("id_fdd");
|
||||||
|
|
||||||
|
//创建签署任务
|
||||||
|
JSONObject initiator = new JSONObject();
|
||||||
|
JSONObject openid = new JSONObject();
|
||||||
|
openid.put("idType", "corp");
|
||||||
|
openid.put("openId", "625776ecae6742cb8eb710beedef9b4c");
|
||||||
|
initiator.put("initiator", openid);
|
||||||
|
|
||||||
|
initiator.put("signTaskSubject", "经纪人服务协议");
|
||||||
|
|
||||||
|
|
||||||
|
initiator.put("signTemplateId", "1706240027829119578");
|
||||||
|
|
||||||
|
|
||||||
|
initiator.put("businessId", "a09900c24614bd4c1de10c55712a3e0e");
|
||||||
|
//参与方数组
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
//actor个人对象
|
||||||
|
JSONObject actor = new JSONObject();
|
||||||
|
//actor详细信息个人
|
||||||
|
JSONObject actorlist = new JSONObject();
|
||||||
|
actorlist.put("actorId", "用户方");
|
||||||
|
actorlist.put("actorType", "person");
|
||||||
|
if (yifang != null) {
|
||||||
|
actorlist.put("actorName", yifang);
|
||||||
|
}
|
||||||
|
JSONArray permissions = new JSONArray();
|
||||||
|
permissions.add("sign");
|
||||||
|
if (yifang != null) {
|
||||||
|
actorlist.put("identNameForMatch", yifang);
|
||||||
|
}
|
||||||
|
actorlist.put("certType", "id_card");
|
||||||
|
if (gongminshenfenhaoma != null) {
|
||||||
|
actorlist.put("certNoForMatch", gongminshenfenhaoma);
|
||||||
|
}
|
||||||
|
if (lianxidianhua != null) {
|
||||||
|
actorlist.put("notifyAddress", lianxidianhua);
|
||||||
|
}
|
||||||
|
JSONArray notifyType = new JSONArray();
|
||||||
|
notifyType.add("start");
|
||||||
|
notifyType.add("finish");
|
||||||
|
actorlist.put("notifyType", notifyType);
|
||||||
|
actorlist.put("permissions", permissions);
|
||||||
|
actor.put("actor", actorlist);
|
||||||
|
|
||||||
|
|
||||||
|
//企业方对象
|
||||||
|
JSONObject actors = new JSONObject();
|
||||||
|
//actor详细信息企业
|
||||||
|
JSONObject actorlists = new JSONObject();
|
||||||
|
actorlists.put("actorId", "企业方");
|
||||||
|
actorlists.put("actorType", "corp");
|
||||||
|
|
||||||
|
actorlists.put("actorName", "银建的士");
|
||||||
|
|
||||||
|
actorlists.put("actorOpenId", "625776ecae6742cb8eb710beedef9b4c");
|
||||||
|
/*JSONArray permissionss = new JSONArray();
|
||||||
|
permissionss.add("sign");
|
||||||
|
actorlists.put("permissions",permissionss);*/
|
||||||
|
/* if (flowCompany != null) {
|
||||||
|
if (flowCompany.equals("北京康建利福汽车服务有限公司")) {
|
||||||
|
actorlists.put("actorOpenId", "232063a6e4dd45889db2f843ff75b658");
|
||||||
|
} else if (flowCompany.equals("北京康建利华汽车服务有限责任公司")) {
|
||||||
|
actorlists.put("actorOpenId", "92c4c1cd7ae14c0ea799d4a7ec547950");
|
||||||
|
} else if (flowCompany.equals("北京康建益华汽车服务有限公司")) {
|
||||||
|
actorlists.put("actorOpenId", "d9cf1eb503b442e6bd963df573412af4");
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
/*actorlists.put("notifyAddress", "13520145209");*/
|
||||||
|
JSONArray notifyTypes = new JSONArray();
|
||||||
|
notifyTypes.add("start");
|
||||||
|
notifyTypes.add("finish");
|
||||||
|
actorlists.put("notifyType", notifyTypes);
|
||||||
|
JSONArray SignField = new JSONArray();
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
|
||||||
|
JSONObject ownerId = new JSONObject(); // docid
|
||||||
|
ownerId.put("ownerId", openid);
|
||||||
|
ownerId.put("signTemplateId", "1706240027829119578");
|
||||||
|
String ownerIdJSONString = ownerId.toJSONString();
|
||||||
|
String doc = FDaDaUtil.doc(ownerIdJSONString);
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject2.put("fieldDocId", doc);
|
||||||
|
|
||||||
|
|
||||||
|
/* if (flowCompany.equals("北京康建利福汽车服务有限公司")) {
|
||||||
|
jsonObject2.put("sealId", 1707030330912199731l);
|
||||||
|
} else if (flowCompany.equals("北京康建利华汽车服务有限责任公司")) {
|
||||||
|
jsonObject2.put("sealId", 1707030386850185754l);
|
||||||
|
} else if (flowCompany.equals("北京康建益华汽车服务有限公司")) {
|
||||||
|
jsonObject2.put("sealId", 1707029844237168249l);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
jsonObject2.put("sealId", 1705574268127146240l);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
SignField.add(jsonObject2);
|
||||||
|
JSONObject signConfigInfo = new JSONObject();
|
||||||
|
JSONObject signConfigInfos = new JSONObject();
|
||||||
|
signConfigInfos.put("requestVerifyFree", true);
|
||||||
|
signConfigInfo.put("signConfigInfo", signConfigInfo);
|
||||||
|
|
||||||
|
|
||||||
|
actors.put("actor", actorlists);
|
||||||
|
actors.put("signFields", SignField);
|
||||||
|
actors.put("signConfigInfo", signConfigInfos);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonArray.add(actor);
|
||||||
|
jsonArray.add(actors);
|
||||||
|
|
||||||
|
initiator.put("actors", jsonArray);
|
||||||
|
String jsonString = initiator.toJSONString();
|
||||||
|
|
||||||
|
String fdd = FDaDaUtil.fdd(jsonString);
|
||||||
|
log.info("DP小程序" + fdd);
|
||||||
|
JSONObject jsonObject = JSON.parseObject(fdd);
|
||||||
|
//任务id
|
||||||
|
String signTaskId = jsonObject.getJSONObject("data").getString("signTaskId");
|
||||||
|
String signTaskIds = String.valueOf(jsonObject.getJSONObject("data"));
|
||||||
|
System.out.println("signTaskId____________________" + signTaskId);
|
||||||
|
System.out.println("signTaskIds========================" + signTaskIds);
|
||||||
|
|
||||||
|
//填写控件
|
||||||
|
JSONObject sizejsonobject = new JSONObject();
|
||||||
|
sizejsonobject.put("signTaskId", signTaskId);
|
||||||
|
// jsonObject.put( "actorId", "参与方2");
|
||||||
|
JSONArray sizejsonarray = new JSONArray();
|
||||||
|
//身份证号
|
||||||
|
JSONObject DPflowPbid = new JSONObject();
|
||||||
|
DPflowPbid.put("fieldId", "2742648076");
|
||||||
|
if (yifang != null) {
|
||||||
|
DPflowPbid.put("fieldValue", yifang);
|
||||||
|
}
|
||||||
|
DPflowPbid.put("docId", doc);
|
||||||
|
|
||||||
|
//身份证号
|
||||||
|
JSONObject dpgongminshenfenhaoma = new JSONObject();
|
||||||
|
dpgongminshenfenhaoma.put("fieldId", "2695002117");
|
||||||
|
if (gongminshenfenhaoma != null) {
|
||||||
|
dpgongminshenfenhaoma.put("fieldValue", gongminshenfenhaoma);
|
||||||
|
}
|
||||||
|
dpgongminshenfenhaoma.put("docId", doc);
|
||||||
|
|
||||||
|
|
||||||
|
//身份证号
|
||||||
|
JSONObject dpglianxidianhua = new JSONObject();
|
||||||
|
dpglianxidianhua.put("fieldId", "5323259454");
|
||||||
|
if (lianxidianhua != null) {
|
||||||
|
dpglianxidianhua.put("fieldValue", lianxidianhua);
|
||||||
|
}
|
||||||
|
dpglianxidianhua.put("docId", doc);
|
||||||
|
|
||||||
|
|
||||||
|
//身份证号
|
||||||
|
JSONObject dpgshoukuanrenmingcheng = new JSONObject();
|
||||||
|
dpgshoukuanrenmingcheng.put("fieldId", "8995965727");
|
||||||
|
if (shoukuanrenmingcheng != null) {
|
||||||
|
dpgshoukuanrenmingcheng.put("fieldValue", shoukuanrenmingcheng);
|
||||||
|
}
|
||||||
|
dpgshoukuanrenmingcheng.put("docId", doc);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//身份证号
|
||||||
|
JSONObject dpkaihuhangmingcheng = new JSONObject();
|
||||||
|
dpkaihuhangmingcheng.put("fieldId", "3563634135");
|
||||||
|
if (kaihuhangmingcheng != null) {
|
||||||
|
dpkaihuhangmingcheng.put("fieldValue", kaihuhangmingcheng);
|
||||||
|
}
|
||||||
|
dpkaihuhangmingcheng.put("docId", doc);
|
||||||
|
|
||||||
|
|
||||||
|
//身份证号
|
||||||
|
JSONObject dpkaihuhangzhanghao = new JSONObject();
|
||||||
|
dpkaihuhangzhanghao.put("fieldId", "1234568350");
|
||||||
|
if (kaihuhangzhanghao != null) {
|
||||||
|
dpkaihuhangzhanghao.put("fieldValue", kaihuhangzhanghao);
|
||||||
|
}
|
||||||
|
dpkaihuhangzhanghao.put("docId", doc);
|
||||||
|
|
||||||
|
|
||||||
|
//身份证号
|
||||||
|
JSONObject dpfuwuqixianqishiriqinian = new JSONObject();
|
||||||
|
dpfuwuqixianqishiriqinian.put("fieldId", "7136400739");
|
||||||
|
if (fuwuqixianqishiriqinian != null) {
|
||||||
|
dpfuwuqixianqishiriqinian.put("fieldValue", fuwuqixianqishiriqinian);
|
||||||
|
}
|
||||||
|
dpfuwuqixianqishiriqinian.put("docId", doc);
|
||||||
|
|
||||||
|
//身份证号
|
||||||
|
JSONObject dpfuwuqixianqishiriqiyue = new JSONObject();
|
||||||
|
dpfuwuqixianqishiriqiyue.put("fieldId", "5133332576");
|
||||||
|
if (fuwuqixianqishiriqiyue != null) {
|
||||||
|
dpfuwuqixianqishiriqiyue.put("fieldValue", fuwuqixianqishiriqiyue);
|
||||||
|
}
|
||||||
|
dpfuwuqixianqishiriqiyue.put("docId", doc);
|
||||||
|
|
||||||
|
|
||||||
|
//身份证号
|
||||||
|
JSONObject dpfuwuqixianqishiriqiri = new JSONObject();
|
||||||
|
dpfuwuqixianqishiriqiri.put("fieldId", "5711127066");
|
||||||
|
if (fuwuqixianqishiriqiri != null) {
|
||||||
|
dpfuwuqixianqishiriqiri.put("fieldValue", fuwuqixianqishiriqiri);
|
||||||
|
}
|
||||||
|
dpfuwuqixianqishiriqiri.put("docId", doc);
|
||||||
|
|
||||||
|
//身份证号
|
||||||
|
JSONObject dpfuwuqixianjieshuriqinian = new JSONObject();
|
||||||
|
dpfuwuqixianjieshuriqinian.put("fieldId", "8594690260");
|
||||||
|
if (fuwuqixianjieshuriqinian != null) {
|
||||||
|
dpfuwuqixianjieshuriqinian.put("fieldValue", fuwuqixianjieshuriqinian);
|
||||||
|
}
|
||||||
|
dpfuwuqixianjieshuriqinian.put("docId", doc);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//身份证号
|
||||||
|
JSONObject dpfuwuqixianjieshuriqiyue = new JSONObject();
|
||||||
|
dpfuwuqixianjieshuriqiyue.put("fieldId", "8856624986");
|
||||||
|
if (fuwuqixianjieshuriqiyue != null) {
|
||||||
|
dpfuwuqixianjieshuriqiyue.put("fieldValue", fuwuqixianjieshuriqiyue);
|
||||||
|
}
|
||||||
|
dpfuwuqixianjieshuriqiyue.put("docId", doc);
|
||||||
|
|
||||||
|
|
||||||
|
//身份证号
|
||||||
|
JSONObject dpfuwuqixianjieshuriqiri = new JSONObject();
|
||||||
|
dpfuwuqixianjieshuriqiri.put("fieldId", "3016246868");
|
||||||
|
if (fuwuqixianjieshuriqiri != null) {
|
||||||
|
dpfuwuqixianjieshuriqiri.put("fieldValue", fuwuqixianjieshuriqiri);
|
||||||
|
}
|
||||||
|
dpfuwuqixianjieshuriqiri.put("docId", doc);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
sizejsonarray.add(DPflowPbid);
|
||||||
|
sizejsonarray.add(dpgongminshenfenhaoma);
|
||||||
|
sizejsonarray.add(dpglianxidianhua);
|
||||||
|
sizejsonarray.add(dpgshoukuanrenmingcheng);
|
||||||
|
sizejsonarray.add(dpkaihuhangmingcheng);
|
||||||
|
sizejsonarray.add(dpkaihuhangzhanghao);
|
||||||
|
sizejsonarray.add(dpfuwuqixianqishiriqinian);
|
||||||
|
sizejsonarray.add(dpfuwuqixianqishiriqiyue);
|
||||||
|
sizejsonarray.add(dpfuwuqixianqishiriqiri);
|
||||||
|
sizejsonarray.add(dpfuwuqixianjieshuriqinian);
|
||||||
|
sizejsonarray.add(dpfuwuqixianjieshuriqiyue);
|
||||||
|
sizejsonarray.add(dpfuwuqixianjieshuriqiri);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
sizejsonobject.put("docFieldValues", sizejsonarray);
|
||||||
|
String sizeString = sizejsonobject.toJSONString();
|
||||||
|
|
||||||
|
String sizekongjian = FDaDaUtil.sizekongjian(sizeString);
|
||||||
|
log.info("DPapp写控件" + sizekongjian);
|
||||||
|
System.out.println("控件填写完成=======================================");
|
||||||
|
String signtask = FDaDaUtil.signtask(signTaskIds);
|
||||||
|
log.info("DPapp完成" + signtask);
|
||||||
|
|
||||||
|
JSONObject json1 = new JSONObject();
|
||||||
|
json1.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
json1.put("entry_id", "661f4363a0c2bbedc4cc9c78");
|
||||||
|
|
||||||
|
JSONObject datas = new JSONObject();
|
||||||
|
|
||||||
|
JSONObject yifang1 = new JSONObject();
|
||||||
|
JSONObject gongminshenfenhaoma1 = new JSONObject();
|
||||||
|
JSONObject lianxidianhua1 = new JSONObject();
|
||||||
|
JSONObject shoukuanrenmingcheng1 = new JSONObject();
|
||||||
|
JSONObject kaihuhangmingcheng1 = new JSONObject();
|
||||||
|
JSONObject kaihuhangzhanghao1 = new JSONObject();
|
||||||
|
JSONObject fuwuqixianqishiriqinian1 = new JSONObject();
|
||||||
|
JSONObject fuwuqixianqishiriqiyue1 = new JSONObject();
|
||||||
|
JSONObject fuwuqixianqishiriqiri1 = new JSONObject();
|
||||||
|
JSONObject fuwuqixianjieshuriqiyue1 = new JSONObject();
|
||||||
|
JSONObject fuwuqixianjieshuriqiri1 = new JSONObject();
|
||||||
|
JSONObject fuwuqixianjieshuriqinian1 = new JSONObject();
|
||||||
|
JSONObject signTaskIdsignTaskId = new JSONObject();
|
||||||
|
JSONObject gerenxinxiliushuihaos = new JSONObject();
|
||||||
|
JSONObject idFdd1 = new JSONObject();
|
||||||
|
|
||||||
|
yifang1.put("value",yifang);
|
||||||
|
gongminshenfenhaoma1.put("value",gongminshenfenhaoma);
|
||||||
|
lianxidianhua1.put("value",lianxidianhua);
|
||||||
|
shoukuanrenmingcheng1.put("value",shoukuanrenmingcheng);
|
||||||
|
kaihuhangmingcheng1.put("value",kaihuhangmingcheng);
|
||||||
|
kaihuhangzhanghao1.put("value",kaihuhangzhanghao);
|
||||||
|
fuwuqixianqishiriqinian1.put("value",fuwuqixianqishiriqinian);
|
||||||
|
fuwuqixianqishiriqiyue1.put("value",fuwuqixianqishiriqiyue);
|
||||||
|
fuwuqixianqishiriqiri1.put("value",fuwuqixianqishiriqiri);
|
||||||
|
fuwuqixianjieshuriqiyue1.put("value",fuwuqixianjieshuriqiyue);
|
||||||
|
fuwuqixianjieshuriqiri1.put("value",fuwuqixianjieshuriqiri);
|
||||||
|
fuwuqixianjieshuriqinian1.put("value",fuwuqixianjieshuriqinian);
|
||||||
|
signTaskIdsignTaskId.put("value",signTaskId);
|
||||||
|
gerenxinxiliushuihaos.put("value",gerenxinxiliushuihao);
|
||||||
|
idFdd1.put("value",idFdd);
|
||||||
|
|
||||||
|
datas.put("yifang",yifang1);
|
||||||
|
datas.put("gongminshenfenhaoma",gongminshenfenhaoma1);
|
||||||
|
datas.put("lianxidianhua",lianxidianhua1);
|
||||||
|
datas.put("shoukuanrenmingcheng",shoukuanrenmingcheng1);
|
||||||
|
datas.put("kaihuhangmingcheng",kaihuhangmingcheng1);
|
||||||
|
datas.put("kaihuhangzhanghao",kaihuhangzhanghao1);
|
||||||
|
datas.put("fuwuqixianqishiriqinian",fuwuqixianqishiriqinian1);
|
||||||
|
datas.put("fuwuqixianqishiriqiyue",fuwuqixianqishiriqiyue1);
|
||||||
|
datas.put("fuwuqixianqishiriqiri",fuwuqixianqishiriqiri1);
|
||||||
|
datas.put("fuwuqixianjieshuriqiyue",fuwuqixianjieshuriqiyue1);
|
||||||
|
datas.put("fuwuqixianjieshuriqiri",fuwuqixianjieshuriqiri1);
|
||||||
|
datas.put("fuwuqixianjieshuriqinian",fuwuqixianjieshuriqinian1);
|
||||||
|
datas.put("id",signTaskIdsignTaskId);
|
||||||
|
datas.put("gerenxinxiliushuihao",gerenxinxiliushuihaos);
|
||||||
|
datas.put("id_fdd",idFdd1);
|
||||||
|
|
||||||
|
|
||||||
|
json1.put("data", datas);
|
||||||
|
String jsonString1 = json1.toJSONString();
|
||||||
|
String insert = APIUtils.insert(jsonString1);
|
||||||
|
log.info(insert);
|
||||||
|
|
||||||
|
return "";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
111
src/main/java/com/example/sso/controller/Count.java
Normal file
111
src/main/java/com/example/sso/controller/Count.java
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
package com.example.sso.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.dao.CountBiao;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
import com.example.sso.util.TimeUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
public class Count {
|
||||||
|
@PostMapping("/count")
|
||||||
|
public void count(@RequestBody JSONObject count){
|
||||||
|
|
||||||
|
log.info(count.toJSONString());
|
||||||
|
JSONObject data = count.getJSONObject("data");
|
||||||
|
String fUserId = data.getString("f_user_id");
|
||||||
|
String createTimes = data.getString("createTime");
|
||||||
|
String type = data.getString("type");
|
||||||
|
Long shangcheheyanriqiSjc = data.getLong("shangcheheyanriqi_sjc");
|
||||||
|
String examineStatus = data.getString("examine_status");
|
||||||
|
String createTime = createTimes.substring(0, 10);
|
||||||
|
long nowday = TimeUtil.nowday();
|
||||||
|
long tomorowday = TimeUtil.tomorowday();
|
||||||
|
JSONArray con = CountBiao.con();
|
||||||
|
for (Object o : con){
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String id = test.getString("id");
|
||||||
|
String day = TimeUtil.day();
|
||||||
|
Long a = test.getLong("a");
|
||||||
|
Long b = test.getLong("b");
|
||||||
|
Long c = test.getLong("c");
|
||||||
|
Long d = test.getLong("d");
|
||||||
|
String id1 = test.getString("_id");
|
||||||
|
|
||||||
|
|
||||||
|
if (fUserId.equals(id) && day.equals(createTime)){
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id", "661c8b33a33a34d4ebb211b0");
|
||||||
|
jsonObject.put("data_id",id1);
|
||||||
|
JSONObject A = new JSONObject();
|
||||||
|
JSONObject a1 = new JSONObject();
|
||||||
|
a1.put("value",a+1);
|
||||||
|
A.put("a",a1);
|
||||||
|
jsonObject.put("data",A);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String updata = APIUtils.updata(jsonString);
|
||||||
|
log.info(updata);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* if (fUserId.equals(id) && day.equals(createTime) && type.equals("驾驶员")){
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id", "661c8b33a33a34d4ebb211b0");
|
||||||
|
jsonObject.put("data_id",id1);
|
||||||
|
JSONObject B = new JSONObject();
|
||||||
|
JSONObject b1 = new JSONObject();
|
||||||
|
b1.put("value",b+1);
|
||||||
|
B.put("b",b1);
|
||||||
|
jsonObject.put("data",B);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String updata = APIUtils.updata(jsonString);
|
||||||
|
log.info(updata);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
if (fUserId.equals(id) && day.equals(createTime) && type.equals("经纪人")){
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id", "661c8b33a33a34d4ebb211b0");
|
||||||
|
jsonObject.put("data_id",id1);
|
||||||
|
JSONObject C = new JSONObject();
|
||||||
|
JSONObject c1 = new JSONObject();
|
||||||
|
c1.put("value",c+1);
|
||||||
|
C.put("c",c1);
|
||||||
|
jsonObject.put("data",C);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String updata = APIUtils.updata(jsonString);
|
||||||
|
log.info(updata);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*if (fUserId.equals(id) && type.equals("驾驶员") && shangcheheyanriqiSjc >=nowday &&
|
||||||
|
shangcheheyanriqiSjc < tomorowday && examineStatus.equals("交车完成")){
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id", "661c8b33a33a34d4ebb211b0");
|
||||||
|
jsonObject.put("data_id",id1);
|
||||||
|
JSONObject D = new JSONObject();
|
||||||
|
JSONObject d1 = new JSONObject();
|
||||||
|
d1.put("value",d+1);
|
||||||
|
D.put("d",d1);
|
||||||
|
jsonObject.put("data",D);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String updata = APIUtils.updata(jsonString);
|
||||||
|
log.info(updata);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
117
src/main/java/com/example/sso/controller/Count1.java
Normal file
117
src/main/java/com/example/sso/controller/Count1.java
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
package com.example.sso.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.dao.CountBiao;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
import com.example.sso.util.TimeUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
public class Count1 {
|
||||||
|
@PostMapping("/count1")
|
||||||
|
public void count(@RequestBody JSONObject count){
|
||||||
|
|
||||||
|
log.info(count.toJSONString());
|
||||||
|
JSONObject data = count.getJSONObject("data");
|
||||||
|
String fUserId = data.getString("id");
|
||||||
|
String createTimes = data.getString("times");
|
||||||
|
String type = data.getString("type");
|
||||||
|
String now = TimeUtil.now();
|
||||||
|
String createTime = createTimes.substring(0, 10);
|
||||||
|
|
||||||
|
JSONArray con = CountBiao.con();
|
||||||
|
for (Object o : con){
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String id = test.getString("id");
|
||||||
|
String day = TimeUtil.day();
|
||||||
|
Long a = test.getLong("a");
|
||||||
|
Long b = test.getLong("b");
|
||||||
|
Long c = test.getLong("c");
|
||||||
|
Long d = test.getLong("d");
|
||||||
|
String id1 = test.getString("_id");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (fUserId.equals(id) && now.equals(createTime) && type.equals("驾驶员")){
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id", "661c8b33a33a34d4ebb211b0");
|
||||||
|
jsonObject.put("data_id",id1);
|
||||||
|
JSONObject B = new JSONObject();
|
||||||
|
JSONObject b1 = new JSONObject();
|
||||||
|
b1.put("value",b+1);
|
||||||
|
B.put("b",b1);
|
||||||
|
jsonObject.put("data",B);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String updata = APIUtils.updata(jsonString);
|
||||||
|
log.info(updata);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (fUserId.equals(id) && now.equals(createTime) && type.equals("驾驶员") ){
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id", "661c8b33a33a34d4ebb211b0");
|
||||||
|
jsonObject.put("data_id",id1);
|
||||||
|
JSONObject C = new JSONObject();
|
||||||
|
JSONObject c1 = new JSONObject();
|
||||||
|
c1.put("value",c-1);
|
||||||
|
C.put("c",c1);
|
||||||
|
jsonObject.put("data",C);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String updata = APIUtils.updata(jsonString);
|
||||||
|
log.info(updata);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (fUserId.equals(id) && now.equals(createTime) && type.equals("经纪人")){
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id", "661c8b33a33a34d4ebb211b0");
|
||||||
|
jsonObject.put("data_id",id1);
|
||||||
|
JSONObject B = new JSONObject();
|
||||||
|
JSONObject b1 = new JSONObject();
|
||||||
|
b1.put("value",b-1);
|
||||||
|
B.put("b",b1);
|
||||||
|
jsonObject.put("data",B);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String updata = APIUtils.updata(jsonString);
|
||||||
|
log.info(updata);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (fUserId.equals(id) && now.equals(createTime) && type.equals("经纪人") ){
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id", "661c8b33a33a34d4ebb211b0");
|
||||||
|
jsonObject.put("data_id",id1);
|
||||||
|
JSONObject C = new JSONObject();
|
||||||
|
JSONObject c1 = new JSONObject();
|
||||||
|
c1.put("value",c+1);
|
||||||
|
C.put("c",c1);
|
||||||
|
jsonObject.put("data",C);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String updata = APIUtils.updata(jsonString);
|
||||||
|
log.info(updata);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
254
src/main/java/com/example/sso/controller/GeRen.java
Normal file
254
src/main/java/com/example/sso/controller/GeRen.java
Normal file
@ -0,0 +1,254 @@
|
|||||||
|
package com.example.sso.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.dao.Max;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
public class GeRen {
|
||||||
|
|
||||||
|
@PostMapping("/geren")
|
||||||
|
public JSONObject geren(String f_user_id, String updateTime, String examine_status) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
|
||||||
|
jsonObject.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id", "658bc54678f6daedd0cfa269");
|
||||||
|
jsonObject.put("limit", 999999);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject1 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray = jsonObject1.getJSONArray("data");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
for (Object o : jsonArray) {
|
||||||
|
JSONObject TEST = (JSONObject) o;
|
||||||
|
String string = TEST.getString("updateTime");
|
||||||
|
String substring = string.substring(0, 10);
|
||||||
|
|
||||||
|
TEST.put("updateTime", substring);
|
||||||
|
String string1 = TEST.getString("f_user_id");
|
||||||
|
String string2 = TEST.getString("updateTime");
|
||||||
|
String string3 = TEST.getString("examine_status");
|
||||||
|
if (f_user_id.equals(string1) && updateTime.equals(string2) && examine_status.equals(string3)) {
|
||||||
|
jsonArray1.add(TEST);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
int size = jsonArray1.size();
|
||||||
|
JSONObject jsonObject3 = new JSONObject();
|
||||||
|
jsonObject3.put("count", size);
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("data", jsonArray1);
|
||||||
|
jsonObject2.put("counts", jsonObject3);
|
||||||
|
return jsonObject2;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/gerentype")
|
||||||
|
public JSONObject gerentype(String f_user_id, String updateTime, String examine_status, String type) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
|
||||||
|
jsonObject.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id", "658bc54678f6daedd0cfa269");
|
||||||
|
jsonObject.put("limit", 999999);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject1 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray = jsonObject1.getJSONArray("data");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
for (Object o : jsonArray) {
|
||||||
|
JSONObject TEST = (JSONObject) o;
|
||||||
|
String string = TEST.getString("updateTime");
|
||||||
|
String substring = string.substring(0, 10);
|
||||||
|
|
||||||
|
TEST.put("updateTime", substring);
|
||||||
|
String string1 = TEST.getString("f_user_id");
|
||||||
|
String string2 = TEST.getString("updateTime");
|
||||||
|
String string3 = TEST.getString("examine_status");
|
||||||
|
String string4 = TEST.getString("type");
|
||||||
|
if (f_user_id.equals(string1) && updateTime.equals(string2) && examine_status.equals(string3) && type.equals(string4)) {
|
||||||
|
jsonArray1.add(TEST);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
int size = jsonArray1.size();
|
||||||
|
JSONObject jsonObject3 = new JSONObject();
|
||||||
|
jsonObject3.put("count", size);
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("data", jsonArray1);
|
||||||
|
jsonObject2.put("counts", jsonObject3);
|
||||||
|
return jsonObject2;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/nostatus")
|
||||||
|
public JSONObject nostatus(String f_user_id, String createTime) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
|
||||||
|
jsonObject.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id", "658bc54678f6daedd0cfa269");
|
||||||
|
jsonObject.put("limit", 999999);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject1 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray = jsonObject1.getJSONArray("data");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
for (Object o : jsonArray) {
|
||||||
|
JSONObject TEST = (JSONObject) o;
|
||||||
|
String string = TEST.getString("createTime");
|
||||||
|
String substring = string.substring(0, 10);
|
||||||
|
|
||||||
|
TEST.put("createTime", substring);
|
||||||
|
String string1 = TEST.getString("f_user_id");
|
||||||
|
String string2 = TEST.getString("createTime");
|
||||||
|
|
||||||
|
if (f_user_id.equals(string1) && createTime.equals(string2)) {
|
||||||
|
jsonArray1.add(TEST);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
int size = jsonArray1.size();
|
||||||
|
JSONObject jsonObject3 = new JSONObject();
|
||||||
|
jsonObject3.put("count", size);
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("data", jsonArray1);
|
||||||
|
jsonObject2.put("counts", jsonObject3);
|
||||||
|
return jsonObject2;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/nostatu")
|
||||||
|
public JSONObject nostatu(String f_user_id) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
|
||||||
|
jsonObject.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id", "658bc54678f6daedd0cfa269");
|
||||||
|
jsonObject.put("limit", 999999);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject1 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray = jsonObject1.getJSONArray("data");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
for (Object o : jsonArray) {
|
||||||
|
JSONObject TEST = (JSONObject) o;
|
||||||
|
String string = TEST.getString("createTime");
|
||||||
|
String substring = string.substring(0, 10);
|
||||||
|
|
||||||
|
TEST.put("createTime", substring);
|
||||||
|
String string1 = TEST.getString("f_user_id");
|
||||||
|
|
||||||
|
|
||||||
|
if (f_user_id.equals(string1)) {
|
||||||
|
jsonArray1.add(TEST);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
int size = jsonArray1.size();
|
||||||
|
JSONObject jsonObject3 = new JSONObject();
|
||||||
|
jsonObject3.put("count", size);
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("data", jsonArray1);
|
||||||
|
jsonObject2.put("counts", jsonObject3);
|
||||||
|
return jsonObject2;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/useridtime")
|
||||||
|
public JSONObject useridtime(String f_user_id, String createTime, String type) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
|
||||||
|
jsonObject.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id", "658bc54678f6daedd0cfa269");
|
||||||
|
jsonObject.put("limit", 999999);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject1 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray = jsonObject1.getJSONArray("data");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
for (Object o : jsonArray) {
|
||||||
|
JSONObject TEST = (JSONObject) o;
|
||||||
|
String string = TEST.getString("createTime");
|
||||||
|
String substring = string.substring(0, 10);
|
||||||
|
|
||||||
|
TEST.put("createTime", substring);
|
||||||
|
String string1 = TEST.getString("f_user_id");
|
||||||
|
String string2 = TEST.getString("createTime");
|
||||||
|
String string3 = TEST.getString("type");
|
||||||
|
|
||||||
|
if (f_user_id.equals(string1) && createTime.equals(string2) && type.equals(string3)) {
|
||||||
|
jsonArray1.add(TEST);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
int size = jsonArray1.size();
|
||||||
|
JSONObject jsonObject3 = new JSONObject();
|
||||||
|
jsonObject3.put("count", size);
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("data", jsonArray1);
|
||||||
|
jsonObject2.put("counts", jsonObject3);
|
||||||
|
return jsonObject2;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/selectmax")
|
||||||
|
public JSONObject selectmax() {
|
||||||
|
String s = Max.max();
|
||||||
|
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject2.put("entry_id", "658fce1d771e971c5816e475");
|
||||||
|
jsonObject2.put("limit", 999999);
|
||||||
|
JSONArray fields = new JSONArray();
|
||||||
|
fields.add("sid");
|
||||||
|
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
filter.put("rel", "and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject jsonObject3 = new JSONObject();
|
||||||
|
jsonObject3.put("field","sid");
|
||||||
|
jsonObject3.put("method","eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add(s);
|
||||||
|
jsonObject3.put("value",jsonArray1);
|
||||||
|
cond.add(jsonObject3);
|
||||||
|
filter.put("cond",cond);
|
||||||
|
jsonObject2.put("filter", filter);
|
||||||
|
jsonObject2.put("fields", fields);
|
||||||
|
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
String select1 = APIUtils.select(jsonString1);
|
||||||
|
JSONObject jsonObject4 = JSON.parseObject(select1);
|
||||||
|
|
||||||
|
return jsonObject4;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,83 @@
|
|||||||
|
package com.example.sso.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.dao.QianDuan;
|
||||||
|
import com.example.sso.test.N;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class QianDuanShiJianController {
|
||||||
|
@GetMapping("/qianduan")
|
||||||
|
public JSONObject ALL() {
|
||||||
|
JSONObject jsonObject = QianDuan.i();
|
||||||
|
Integer i = jsonObject.getInteger("integer");
|
||||||
|
String id = jsonObject.getString("id");
|
||||||
|
i += 1;
|
||||||
|
Integer max = QianDuan.max();
|
||||||
|
JSONArray fou = QianDuan.fou();
|
||||||
|
|
||||||
|
for (Object o : fou) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
Integer xuhao = test.getInteger("xuhao");
|
||||||
|
if (i == xuhao) {
|
||||||
|
i += 1;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i <= max) {
|
||||||
|
JSONArray select = QianDuan.select(i);
|
||||||
|
for (Object o : select) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String fsName = test.getString("fs_name");
|
||||||
|
Integer integer = test.getJSONObject("fs_user").getInteger("dept_no");
|
||||||
|
//QianDuan.insert(id,i,fsName,integer);
|
||||||
|
JSONObject object = new JSONObject();
|
||||||
|
object.put("xuhao", i);
|
||||||
|
object.put("fsName", fsName);
|
||||||
|
object.put("dept", integer);
|
||||||
|
return object;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
i = 1;
|
||||||
|
for (Object o : fou) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
Integer xuhao = test.getInteger("xuhao");
|
||||||
|
if (i == xuhao) {
|
||||||
|
i += 1;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
JSONArray select = QianDuan.select(i);
|
||||||
|
for (Object o : select) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String fsName = test.getString("fs_name");
|
||||||
|
Integer integer = test.getJSONObject("fs_user").getInteger("dept_no");
|
||||||
|
//QianDuan.insert(id, 1, fsName, integer);
|
||||||
|
JSONObject object = new JSONObject();
|
||||||
|
object.put("xuhao", i);
|
||||||
|
object.put("fsName", fsName);
|
||||||
|
object.put("dept", integer);
|
||||||
|
return object;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
|
||||||
|
return jsonObject1;
|
||||||
|
}
|
||||||
|
}
|
||||||
870
src/main/java/com/example/sso/controller/Reward.java
Normal file
870
src/main/java/com/example/sso/controller/Reward.java
Normal file
@ -0,0 +1,870 @@
|
|||||||
|
package com.example.sso.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.dao.*;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
import com.example.sso.util.TimeUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.util.concurrent.locks.Lock;
|
||||||
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@Slf4j
|
||||||
|
@Async
|
||||||
|
public class Reward {
|
||||||
|
|
||||||
|
//此乃dp月租
|
||||||
|
private final Lock lock = new ReentrantLock();
|
||||||
|
|
||||||
|
@PostMapping("/reward")
|
||||||
|
|
||||||
|
public String reward(@RequestBody JSONObject rewards) throws ParseException {
|
||||||
|
lock.lock();
|
||||||
|
try {
|
||||||
|
JSONObject dataa = rewards.getJSONObject("data");
|
||||||
|
log.info(dataa.toJSONString());
|
||||||
|
String id = dataa.getString("id");
|
||||||
|
String timeConversionS = dataa.getString("shangcheheyanriqi");
|
||||||
|
String timeConversion = TimeUtil.timeConversions(timeConversionS);
|
||||||
|
String hetongbianhao = dataa.getString("hetongbianhao");
|
||||||
|
String widget1704356902052 = dataa.getString("_widget_1704356902052");
|
||||||
|
String j = dataa.getString("j");
|
||||||
|
String a1 = dataa.getString("a");
|
||||||
|
Integer money1 = dataa.getInteger("money1"); //1000
|
||||||
|
Integer money2 = dataa.getInteger("money2"); //200
|
||||||
|
String dirDept = dataa.getString("dir_dept");
|
||||||
|
String per_type = dataa.getString("per_type");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id", "658bc54678f6daedd0cfa269");
|
||||||
|
jsonObject.put("is_start_trigger", true);
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("id");
|
||||||
|
jsonArray.add("nick_name");
|
||||||
|
jsonArray.add("real_name");
|
||||||
|
jsonArray.add("type");
|
||||||
|
jsonArray.add("f_user_id");
|
||||||
|
jsonArray.add("is_sign");
|
||||||
|
jsonArray.add("fs_name");
|
||||||
|
jsonArray.add("id_card");
|
||||||
|
|
||||||
|
jsonObject.put("fields", jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel", "and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field", "id");
|
||||||
|
jsonObject1.put("method", "eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add(id);
|
||||||
|
jsonObject1.put("value", jsonArray1);
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel", rel);
|
||||||
|
filter.put("cond", cond);
|
||||||
|
jsonObject.put("filter", filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
|
||||||
|
////////////////
|
||||||
|
String realNameone = "";
|
||||||
|
String nickName = "";
|
||||||
|
String type = "";
|
||||||
|
String isSign = "";
|
||||||
|
String f_user_id = "";
|
||||||
|
String max = Max.max();
|
||||||
|
String fs_name = "";
|
||||||
|
String fs_p1 = "";
|
||||||
|
String id_cards = "";
|
||||||
|
|
||||||
|
|
||||||
|
for (Object o : jsonArray2) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
realNameone = test.getString("real_name");
|
||||||
|
nickName = test.getString("nick_name");
|
||||||
|
type = test.getString("type");
|
||||||
|
isSign = test.getString("is_sign");
|
||||||
|
f_user_id = test.getString("f_user_id");
|
||||||
|
fs_name = test.getString("fs_name");
|
||||||
|
fs_name = test.getString("id_cards");
|
||||||
|
|
||||||
|
JSONObject widget1708503246372 = test.getJSONObject("_widget_1708503246372");
|
||||||
|
if (widget1708503246372 != null) {
|
||||||
|
fs_p1 = widget1708503246372.getString("name");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONArray mains = UpId.mains(f_user_id);
|
||||||
|
String f_user_idS = "";
|
||||||
|
/////////////////////////
|
||||||
|
String real_name = "";
|
||||||
|
String id_card3331 = "";
|
||||||
|
for (Object p : mains) {
|
||||||
|
JSONObject test1 = (JSONObject) p;
|
||||||
|
f_user_idS = test1.getString("f_user_id");
|
||||||
|
real_name = test1.getString("real_name");
|
||||||
|
id_card3331 = test1.getString("id_card");
|
||||||
|
}
|
||||||
|
// 奖励1
|
||||||
|
if (!f_user_id.equals("0") && !f_user_id.isEmpty() && f_user_id != null) {
|
||||||
|
JSONObject jiangli = new JSONObject();
|
||||||
|
jiangli.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jiangli.put("entry_id", "658fce1d771e971c5816e475");
|
||||||
|
jiangli.put("is_start_trigger", true);
|
||||||
|
JSONObject data = new JSONObject();
|
||||||
|
JSONObject sid1 = new JSONObject();
|
||||||
|
JSONObject user_id1 = new JSONObject();
|
||||||
|
JSONObject nick_name1 = new JSONObject();
|
||||||
|
JSONObject real_name1 = new JSONObject();
|
||||||
|
JSONObject type1 = new JSONObject();
|
||||||
|
JSONObject invite_money = new JSONObject();
|
||||||
|
JSONObject no_account_money = new JSONObject();
|
||||||
|
JSONObject account_money = new JSONObject();
|
||||||
|
JSONObject created_at = new JSONObject();
|
||||||
|
JSONObject enterprise_id = new JSONObject();
|
||||||
|
JSONObject idup = new JSONObject();
|
||||||
|
JSONObject fs_name1 = new JSONObject();
|
||||||
|
JSONObject jjr_real_name = new JSONObject();
|
||||||
|
JSONObject user_money_status = new JSONObject();
|
||||||
|
JSONObject jjr_is_sign = new JSONObject();
|
||||||
|
JSONObject sj_id = new JSONObject();
|
||||||
|
JSONObject sj_real_name = new JSONObject();
|
||||||
|
JSONObject sj_name = new JSONObject();
|
||||||
|
JSONObject invite_level = new JSONObject();
|
||||||
|
JSONObject a = new JSONObject();
|
||||||
|
JSONObject b = new JSONObject();
|
||||||
|
JSONObject c = new JSONObject();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
b.put("value",dirDept);
|
||||||
|
a.put("value", a1);
|
||||||
|
c.put("value",per_type);
|
||||||
|
invite_level.put("value", "1");
|
||||||
|
sj_name.put("value", nickName);
|
||||||
|
sj_real_name.put("value", realNameone);
|
||||||
|
sj_id.put("value", id);
|
||||||
|
jjr_is_sign.put("value", isSign);
|
||||||
|
user_money_status.put("value", "未收款");
|
||||||
|
jjr_real_name.put("value", real_name);
|
||||||
|
String s = OneIdcard.fs_name(f_user_id);
|
||||||
|
fs_name1.put("value", s);
|
||||||
|
idup.put("value", f_user_id);
|
||||||
|
enterprise_id.put("value", 0);
|
||||||
|
created_at.put("value", timeConversion);
|
||||||
|
account_money.put("value", 0);
|
||||||
|
no_account_money.put("value", money1);
|
||||||
|
invite_money.put("value", money1);
|
||||||
|
type1.put("value", type);
|
||||||
|
real_name1.put("value", realNameone);
|
||||||
|
nick_name1.put("value", nickName);
|
||||||
|
user_id1.put("value", id);
|
||||||
|
sid1.put("value", max);
|
||||||
|
|
||||||
|
|
||||||
|
data.put("sid", sid1);
|
||||||
|
data.put("user_id", user_id1);
|
||||||
|
data.put("nick_name", nick_name1);
|
||||||
|
data.put("real_name", real_name1);
|
||||||
|
data.put("type", type1);
|
||||||
|
data.put("invite_money", invite_money);
|
||||||
|
data.put("no_account_money", no_account_money);
|
||||||
|
data.put("account_money", account_money);
|
||||||
|
data.put("created_at", created_at);
|
||||||
|
data.put("enterprise_id", enterprise_id);
|
||||||
|
data.put("id", idup);
|
||||||
|
data.put("fs_name", fs_name1);
|
||||||
|
data.put("jjr_real_name", jjr_real_name);
|
||||||
|
data.put("user_money_status", user_money_status);
|
||||||
|
data.put("jjr_is_sign", jjr_is_sign);
|
||||||
|
data.put("sj_id", sj_id);
|
||||||
|
data.put("sj_real_name", sj_real_name);
|
||||||
|
data.put("sj_name", sj_name);
|
||||||
|
data.put("invite_level", invite_level);
|
||||||
|
data.put("a", a);
|
||||||
|
data.put("b", b);
|
||||||
|
data.put("per_type", c);
|
||||||
|
|
||||||
|
jiangli.put("data", data);
|
||||||
|
|
||||||
|
String jsonString1 = jiangli.toJSONString();
|
||||||
|
String insert = APIUtils.insert(jsonString1);
|
||||||
|
log.info("111111111111111111111111111111111111111111111111111111111" + insert);
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject jiangli333 = new JSONObject();
|
||||||
|
jiangli333.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jiangli333.put("entry_id", "660376f8e0f50cf16cd2971a");
|
||||||
|
jiangli333.put("is_start_trigger", true);
|
||||||
|
JSONObject data333 = new JSONObject();
|
||||||
|
JSONObject type333 = new JSONObject();
|
||||||
|
JSONObject name = new JSONObject();
|
||||||
|
JSONObject month = new JSONObject();
|
||||||
|
JSONObject yewubiaodanmingcheng = new JSONObject();
|
||||||
|
JSONObject yewubiaodanbianma = new JSONObject();
|
||||||
|
JSONObject abbreviation = new JSONObject();
|
||||||
|
JSONObject sijixingming = new JSONObject();
|
||||||
|
JSONObject id_card333 = new JSONObject();
|
||||||
|
JSONObject sijisuozaigongsi = new JSONObject();
|
||||||
|
JSONObject fs = new JSONObject();
|
||||||
|
JSONObject fs_p = new JSONObject();
|
||||||
|
JSONObject money = new JSONObject();
|
||||||
|
JSONObject pay = new JSONObject();
|
||||||
|
JSONObject no_money = new JSONObject();
|
||||||
|
JSONObject ys = new JSONObject();
|
||||||
|
JSONObject month1 = new JSONObject();
|
||||||
|
JSONObject _widget_1704356902052 = new JSONObject();
|
||||||
|
JSONObject _widget_1704357037281 = new JSONObject();
|
||||||
|
JSONObject sid111 = new JSONObject();
|
||||||
|
|
||||||
|
|
||||||
|
String xinxi = OneIdcard.XINXI(f_user_id);
|
||||||
|
String name1 = OneIdcard.name(f_user_id);
|
||||||
|
String jsonObject3 = OneIdcard._widget_1708503246372(f_user_id);
|
||||||
|
String dpCompany = OneIdcard.dp_company(f_user_id);
|
||||||
|
String fs_name1111 = OneIdcard.fs_name(f_user_id);
|
||||||
|
type333.put("value", "付款");
|
||||||
|
name.put("value", "邀请奖励");
|
||||||
|
String month2 = TimeUtil.month();
|
||||||
|
month.put("value", month2);
|
||||||
|
yewubiaodanmingcheng.put("value", "承租表单");
|
||||||
|
yewubiaodanbianma.put("value", hetongbianhao);
|
||||||
|
_widget_1704356902052.put("value", widget1704356902052);
|
||||||
|
String hetong = DpJianCheng.hetong(hetongbianhao);
|
||||||
|
abbreviation.put("value", j);
|
||||||
|
sijixingming.put("value", name1);
|
||||||
|
id_card333.put("value", xinxi);
|
||||||
|
sijisuozaigongsi.put("value", dpCompany);
|
||||||
|
fs.put("value", fs_name1111);
|
||||||
|
if (jsonObject3 != null && !jsonObject3.isEmpty()) {
|
||||||
|
int i = Integer.parseInt(jsonObject3);
|
||||||
|
fs_p.put("value", i);
|
||||||
|
}
|
||||||
|
money.put("value", money1);
|
||||||
|
pay.put("value", 0);
|
||||||
|
ys.put("value", timeConversion);
|
||||||
|
no_money.put("value", money1);
|
||||||
|
month1.put("value", month2);
|
||||||
|
_widget_1704357037281.put("value", widget1704356902052);
|
||||||
|
sid111.put("value", max);
|
||||||
|
|
||||||
|
|
||||||
|
data333.put("type", type333);
|
||||||
|
data333.put("name", name);
|
||||||
|
data333.put("month", month);
|
||||||
|
data333.put("yewubiaodanmingcheng", yewubiaodanmingcheng);
|
||||||
|
data333.put("yewubiaodanbianma", yewubiaodanbianma);
|
||||||
|
data333.put("sijixingming", sijixingming);
|
||||||
|
data333.put("no_account_money", no_account_money);
|
||||||
|
data333.put("id_card", id_card333);
|
||||||
|
data333.put("abbreviation", abbreviation);
|
||||||
|
data333.put("enterprise_id", enterprise_id);
|
||||||
|
data333.put("sijisuozaigongsi", sijisuozaigongsi);
|
||||||
|
data333.put("fs", fs);
|
||||||
|
data333.put("fs_p", fs_p);
|
||||||
|
data333.put("money", money);
|
||||||
|
data333.put("pay", pay);
|
||||||
|
data333.put("no_money", no_money);
|
||||||
|
data333.put("ys", ys);
|
||||||
|
data333.put("month1", month1);
|
||||||
|
data333.put("_widget_1704357037281", _widget_1704356902052);
|
||||||
|
data333.put("sid", sid111);
|
||||||
|
|
||||||
|
|
||||||
|
jiangli333.put("data", data333);
|
||||||
|
|
||||||
|
String jsonString333 = jiangli333.toJSONString();
|
||||||
|
String insert333 = APIUtils.insert(jsonString333);
|
||||||
|
log.info("3333333333333333333333333333333333" + insert333);
|
||||||
|
|
||||||
|
Integer panduan = ZhangHu.panduan(f_user_id);
|
||||||
|
|
||||||
|
if (panduan != 0) {
|
||||||
|
String id1 = ZhangHu.ID(f_user_id);
|
||||||
|
JSONArray ziduan = ZhangHu.ziduan(f_user_id);
|
||||||
|
JSONArray ziduanMINGXI = ZhangHu.ziduanMINGXI(f_user_id);
|
||||||
|
String real_name777 = "";
|
||||||
|
String id_card777 = "";
|
||||||
|
String nick_name777 = "";
|
||||||
|
String phone777 = "";
|
||||||
|
String is_sign777 = "";
|
||||||
|
String type777 = "";
|
||||||
|
Integer sum_money777 = 0;
|
||||||
|
Integer no_account_money777 = 0;
|
||||||
|
Integer account_money777 = 0;
|
||||||
|
|
||||||
|
for (Object o : ziduan) {
|
||||||
|
JSONObject test7 = (JSONObject) o;
|
||||||
|
real_name777 = test7.getString("real_name");
|
||||||
|
id_card777 = test7.getString("id_card");
|
||||||
|
nick_name777 = test7.getString("nick_name");
|
||||||
|
phone777 = test7.getString("phone");
|
||||||
|
is_sign777 = test7.getString("is_sign");
|
||||||
|
type777 = test7.getString("type");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Object o : ziduanMINGXI) {
|
||||||
|
JSONObject test7 = (JSONObject) o;
|
||||||
|
sum_money777 = test7.getInteger("sum_money");
|
||||||
|
no_account_money777 = test7.getInteger("no_account_money");
|
||||||
|
account_money777 = test7.getInteger("account_money");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject jsonObject4 = new JSONObject();
|
||||||
|
jsonObject4.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject4.put("entry_id", "658fd4fa771e971c5816e8da");
|
||||||
|
jsonObject4.put("data_id", id1);
|
||||||
|
JSONObject DATA = new JSONObject();
|
||||||
|
|
||||||
|
JSONObject real_name888 = new JSONObject();
|
||||||
|
JSONObject nick_name888 = new JSONObject();
|
||||||
|
JSONObject type888 = new JSONObject();
|
||||||
|
JSONObject phone888 = new JSONObject();
|
||||||
|
JSONObject sum_money888 = new JSONObject();
|
||||||
|
JSONObject no_account_money888 = new JSONObject();
|
||||||
|
JSONObject account_money888 = new JSONObject();
|
||||||
|
JSONObject _widget_1711967418636 = new JSONObject();
|
||||||
|
JSONObject _widget_1709204953031 = new JSONObject();
|
||||||
|
|
||||||
|
|
||||||
|
real_name888.put("value", real_name777);
|
||||||
|
nick_name888.put("value", nick_name777);
|
||||||
|
type888.put("value", type777);
|
||||||
|
phone888.put("value", phone777);
|
||||||
|
sum_money888.put("value", sum_money777 + money1);
|
||||||
|
no_account_money888.put("value", no_account_money777 + money1);
|
||||||
|
account_money888.put("value", account_money777 + 0);
|
||||||
|
_widget_1711967418636.put("value", id_card777);
|
||||||
|
_widget_1709204953031.put("value", is_sign777);
|
||||||
|
|
||||||
|
|
||||||
|
DATA.put("sum_money", sum_money888);
|
||||||
|
DATA.put("no_account_money", no_account_money888);
|
||||||
|
DATA.put("account_money", account_money888);
|
||||||
|
|
||||||
|
jsonObject4.put("data", DATA);
|
||||||
|
|
||||||
|
|
||||||
|
String jsonString2 = jsonObject4.toJSONString();
|
||||||
|
String updata = APIUtils.updata(jsonString2);
|
||||||
|
log.info(updata);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (panduan == 0) {
|
||||||
|
String id1 = ZhangHu.ID(f_user_id);
|
||||||
|
JSONArray ziduan = ZhangHu.ziduan(f_user_id);
|
||||||
|
JSONArray ziduanMINGXI = ZhangHu.ziduanMINGXI(f_user_id);
|
||||||
|
String real_name777 = "";
|
||||||
|
String id_card777 = "";
|
||||||
|
String nick_name777 = "";
|
||||||
|
String phone777 = "";
|
||||||
|
String is_sign777 = "";
|
||||||
|
String type777 = "";
|
||||||
|
Integer sum_money777 = 0;
|
||||||
|
Integer no_account_money777 = 0;
|
||||||
|
Integer account_money777 = 0;
|
||||||
|
|
||||||
|
for (Object o : ziduan) {
|
||||||
|
JSONObject test7 = (JSONObject) o;
|
||||||
|
real_name777 = test7.getString("real_name");
|
||||||
|
id_card777 = test7.getString("id_card");
|
||||||
|
nick_name777 = test7.getString("nick_name");
|
||||||
|
phone777 = test7.getString("phone");
|
||||||
|
is_sign777 = test7.getString("is_sign");
|
||||||
|
type777 = test7.getString("type");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Object o : ziduanMINGXI) {
|
||||||
|
JSONObject test7 = (JSONObject) o;
|
||||||
|
sum_money777 = test7.getInteger("sum_money");
|
||||||
|
no_account_money777 = test7.getInteger("no_account_money");
|
||||||
|
account_money777 = test7.getInteger("account_money");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject jsonObject4 = new JSONObject();
|
||||||
|
jsonObject4.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject4.put("entry_id", "658fd4fa771e971c5816e8da");
|
||||||
|
jsonObject4.put("is_start_trigger", true);
|
||||||
|
|
||||||
|
JSONObject DATA = new JSONObject();
|
||||||
|
|
||||||
|
JSONObject real_name888 = new JSONObject();
|
||||||
|
JSONObject nick_name888 = new JSONObject();
|
||||||
|
JSONObject type888 = new JSONObject();
|
||||||
|
JSONObject phone888 = new JSONObject();
|
||||||
|
JSONObject sum_money888 = new JSONObject();
|
||||||
|
JSONObject no_account_money888 = new JSONObject();
|
||||||
|
JSONObject account_money888 = new JSONObject();
|
||||||
|
JSONObject _widget_1711967418636 = new JSONObject();
|
||||||
|
JSONObject _widget_1709204953031 = new JSONObject();
|
||||||
|
JSONObject id888 = new JSONObject();
|
||||||
|
JSONObject ffzt = new JSONObject();
|
||||||
|
|
||||||
|
real_name888.put("value", real_name777);
|
||||||
|
nick_name888.put("value", nick_name777);
|
||||||
|
type888.put("value", type777);
|
||||||
|
phone888.put("value", phone777);
|
||||||
|
sum_money888.put("value", money1);
|
||||||
|
no_account_money888.put("value", money1);
|
||||||
|
account_money888.put("value", 0);
|
||||||
|
_widget_1711967418636.put("value", id_card777);
|
||||||
|
_widget_1709204953031.put("value", is_sign777);
|
||||||
|
id888.put("value", f_user_id);
|
||||||
|
ffzt.put("value", "发放完成");
|
||||||
|
|
||||||
|
DATA.put("real_name", real_name888);
|
||||||
|
DATA.put("nick_name", nick_name888);
|
||||||
|
DATA.put("type", type888);
|
||||||
|
DATA.put("phone", phone888);
|
||||||
|
DATA.put("sum_money", sum_money888);
|
||||||
|
DATA.put("no_account_money", no_account_money888);
|
||||||
|
DATA.put("account_money", account_money888);
|
||||||
|
DATA.put("_widget_1711967418636", _widget_1711967418636);
|
||||||
|
DATA.put("_widget_1709204953031", _widget_1709204953031);
|
||||||
|
DATA.put("id", id888);
|
||||||
|
DATA.put("ffzt", ffzt);
|
||||||
|
|
||||||
|
jsonObject4.put("data", DATA);
|
||||||
|
|
||||||
|
|
||||||
|
String jsonString2 = jsonObject4.toJSONString();
|
||||||
|
String updata = APIUtils.insert(jsonString2);
|
||||||
|
log.info(updata);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
// 奖励2
|
||||||
|
if (!f_user_idS.equals("0") && !f_user_idS.isEmpty() && f_user_idS != null) {
|
||||||
|
|
||||||
|
JSONObject jsonObject22 = new JSONObject();
|
||||||
|
jsonObject22.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject22.put("entry_id", "658bc54678f6daedd0cfa269");
|
||||||
|
jsonObject22.put("is_start_trigger", true);
|
||||||
|
JSONArray jsonArray22 = new JSONArray();
|
||||||
|
jsonArray22.add("id");
|
||||||
|
jsonArray22.add("nick_name");
|
||||||
|
jsonArray22.add("real_name");
|
||||||
|
jsonArray22.add("type");
|
||||||
|
jsonArray22.add("f_user_id");
|
||||||
|
jsonArray22.add("is_sign");
|
||||||
|
jsonArray22.add("fs_name");
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject22.put("fields", jsonArray22);
|
||||||
|
JSONObject filter22 = new JSONObject();
|
||||||
|
JSONObject rel22 = new JSONObject();
|
||||||
|
rel22.put("rel", "and");
|
||||||
|
JSONArray cond22 = new JSONArray();
|
||||||
|
JSONObject jsonObject12 = new JSONObject();
|
||||||
|
jsonObject12.put("field", "id");
|
||||||
|
jsonObject12.put("method", "eq");
|
||||||
|
JSONArray jsonArray12 = new JSONArray();
|
||||||
|
jsonArray12.add(f_user_id);
|
||||||
|
jsonObject12.put("value", jsonArray12);
|
||||||
|
cond22.add(jsonObject12);
|
||||||
|
filter22.put("rel", rel22);
|
||||||
|
filter22.put("cond", cond22);
|
||||||
|
jsonObject22.put("filter", filter22);
|
||||||
|
|
||||||
|
String jsonString14 = jsonObject22.toJSONString();
|
||||||
|
|
||||||
|
String select15 = APIUtils.select(jsonString14);
|
||||||
|
JSONObject jsonObject16 = JSON.parseObject(select15);
|
||||||
|
JSONArray jsonArray17 = jsonObject16.getJSONArray("data");
|
||||||
|
|
||||||
|
////////////////
|
||||||
|
String realName18 = "";
|
||||||
|
String nickName18 = "";
|
||||||
|
String type18 = "";
|
||||||
|
String isSign18 = "";
|
||||||
|
String f_user_ida = "";
|
||||||
|
String maxa = Max.max();
|
||||||
|
String fs_namea = "";
|
||||||
|
for (Object o : jsonArray17) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
realName18 = test.getString("real_name");
|
||||||
|
nickName18 = test.getString("nick_name");
|
||||||
|
type18 = test.getString("type");
|
||||||
|
isSign18 = test.getString("is_sign");
|
||||||
|
f_user_ida = test.getString("f_user_id");
|
||||||
|
fs_namea = test.getString("fs_name");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 类似奖励1
|
||||||
|
|
||||||
|
JSONObject jiangli = new JSONObject();
|
||||||
|
jiangli.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jiangli.put("entry_id", "658fce1d771e971c5816e475");
|
||||||
|
jiangli.put("is_start_trigger", true);
|
||||||
|
JSONObject data = new JSONObject();
|
||||||
|
JSONObject sid1 = new JSONObject();
|
||||||
|
JSONObject user_id1 = new JSONObject();
|
||||||
|
JSONObject nick_name1 = new JSONObject();
|
||||||
|
JSONObject real_name1 = new JSONObject();
|
||||||
|
JSONObject type1 = new JSONObject();
|
||||||
|
JSONObject invite_money = new JSONObject();
|
||||||
|
JSONObject no_account_money = new JSONObject();
|
||||||
|
JSONObject account_money = new JSONObject();
|
||||||
|
JSONObject created_at = new JSONObject();
|
||||||
|
JSONObject enterprise_id = new JSONObject();
|
||||||
|
JSONObject idup = new JSONObject();
|
||||||
|
JSONObject fs_name1 = new JSONObject();
|
||||||
|
JSONObject jjr_real_name = new JSONObject();
|
||||||
|
JSONObject user_money_status = new JSONObject();
|
||||||
|
JSONObject jjr_is_sign = new JSONObject();
|
||||||
|
JSONObject sj_id = new JSONObject();
|
||||||
|
JSONObject sj_real_name = new JSONObject();
|
||||||
|
JSONObject sj_name = new JSONObject();
|
||||||
|
JSONObject invite_level = new JSONObject();
|
||||||
|
JSONObject remark = new JSONObject();
|
||||||
|
JSONObject a = new JSONObject();
|
||||||
|
JSONObject b = new JSONObject();
|
||||||
|
JSONObject c = new JSONObject();
|
||||||
|
|
||||||
|
|
||||||
|
String realename = ThreeCount.realename(f_user_idS);
|
||||||
|
String fsname = ThreeCount.fsname(f_user_idS);
|
||||||
|
b.put("value", dirDept);
|
||||||
|
a.put("value", a1);
|
||||||
|
c.put("value", per_type);
|
||||||
|
remark.put("value", "邀请上级奖励");
|
||||||
|
invite_level.put("value", "2");
|
||||||
|
sj_name.put("value", nickName);
|
||||||
|
sj_real_name.put("value", realNameone);
|
||||||
|
sj_id.put("value", id);
|
||||||
|
jjr_is_sign.put("value", isSign18);
|
||||||
|
user_money_status.put("value", "未收款");
|
||||||
|
jjr_real_name.put("value", realename);
|
||||||
|
fs_name1.put("value", fsname);
|
||||||
|
idup.put("value", f_user_idS);
|
||||||
|
enterprise_id.put("value", 0);
|
||||||
|
created_at.put("value", timeConversion);
|
||||||
|
account_money.put("value", 0);
|
||||||
|
no_account_money.put("value", money2);
|
||||||
|
invite_money.put("value", money2);
|
||||||
|
type1.put("value", type18);
|
||||||
|
real_name1.put("value", realName18);
|
||||||
|
nick_name1.put("value", nickName18);
|
||||||
|
user_id1.put("value", f_user_id);
|
||||||
|
sid1.put("value", maxa);
|
||||||
|
|
||||||
|
|
||||||
|
data.put("sid", sid1);
|
||||||
|
data.put("user_id", user_id1);
|
||||||
|
data.put("nick_name", nick_name1);
|
||||||
|
data.put("real_name", real_name1);
|
||||||
|
data.put("type", type1);
|
||||||
|
data.put("invite_money", invite_money);
|
||||||
|
data.put("no_account_money", no_account_money);
|
||||||
|
data.put("account_money", account_money);
|
||||||
|
data.put("created_at", created_at);
|
||||||
|
data.put("enterprise_id", enterprise_id);
|
||||||
|
data.put("id", idup);
|
||||||
|
data.put("fs_name", fs_name1);
|
||||||
|
data.put("jjr_real_name", jjr_real_name);
|
||||||
|
data.put("user_money_status", user_money_status);
|
||||||
|
data.put("jjr_is_sign", jjr_is_sign);
|
||||||
|
data.put("sj_id", sj_id);
|
||||||
|
data.put("sj_real_name", sj_real_name);
|
||||||
|
data.put("sj_name", sj_name);
|
||||||
|
data.put("invite_level", invite_level);
|
||||||
|
data.put("remark", remark);
|
||||||
|
data.put("a", a);
|
||||||
|
data.put("b", b);
|
||||||
|
data.put("per_type", c);
|
||||||
|
|
||||||
|
jiangli.put("data", data);
|
||||||
|
|
||||||
|
String jsonString1 = jiangli.toJSONString();
|
||||||
|
String insert = APIUtils.insert(jsonString1);
|
||||||
|
log.info("1222222222222222222222222222222222222222222222222" + insert);
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject jiangli333 = new JSONObject();
|
||||||
|
jiangli333.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jiangli333.put("entry_id", "660376f8e0f50cf16cd2971a");
|
||||||
|
jiangli333.put("is_start_trigger", true);
|
||||||
|
JSONObject data333 = new JSONObject();
|
||||||
|
JSONObject type333 = new JSONObject();
|
||||||
|
JSONObject name = new JSONObject();
|
||||||
|
JSONObject month = new JSONObject();
|
||||||
|
JSONObject yewubiaodanmingcheng = new JSONObject();
|
||||||
|
JSONObject yewubiaodanbianma = new JSONObject();
|
||||||
|
JSONObject abbreviation = new JSONObject();
|
||||||
|
JSONObject sijixingming = new JSONObject();
|
||||||
|
JSONObject id_card333 = new JSONObject();
|
||||||
|
JSONObject sijisuozaigongsi = new JSONObject();
|
||||||
|
JSONObject fs = new JSONObject();
|
||||||
|
JSONObject fs_p = new JSONObject();
|
||||||
|
JSONObject money = new JSONObject();
|
||||||
|
JSONObject pay = new JSONObject();
|
||||||
|
JSONObject no_money = new JSONObject();
|
||||||
|
JSONObject ys = new JSONObject();
|
||||||
|
JSONObject month1 = new JSONObject();
|
||||||
|
JSONObject _widget_1704356902052 = new JSONObject();
|
||||||
|
JSONObject _widget_1704357037281 = new JSONObject();
|
||||||
|
JSONObject sid4444 = new JSONObject();
|
||||||
|
|
||||||
|
String xinxi = OneIdcard.XINXI(f_user_idS);
|
||||||
|
String name1 = OneIdcard.name(f_user_idS);
|
||||||
|
String jsonObject3 = OneIdcard._widget_1708503246372(f_user_idS);
|
||||||
|
String dpCompany = OneIdcard.dp_company(f_user_idS);
|
||||||
|
String fs_name1111 = OneIdcard.fs_name(f_user_idS);
|
||||||
|
type333.put("value", "付款");
|
||||||
|
name.put("value", "邀请上级奖励");
|
||||||
|
String month2 = TimeUtil.month();
|
||||||
|
month.put("value", month2);
|
||||||
|
yewubiaodanmingcheng.put("value", "承租表单");
|
||||||
|
yewubiaodanbianma.put("value", hetongbianhao);
|
||||||
|
_widget_1704356902052.put("value", widget1704356902052);
|
||||||
|
String hetong = DpJianCheng.hetong(hetongbianhao);
|
||||||
|
abbreviation.put("value", j);
|
||||||
|
sijixingming.put("value", name1);
|
||||||
|
id_card333.put("value", xinxi);
|
||||||
|
sijisuozaigongsi.put("value", dpCompany);
|
||||||
|
fs.put("value", fs_name1111);
|
||||||
|
if (jsonObject3 != null && !jsonObject3.isEmpty()) {
|
||||||
|
int i = Integer.parseInt(jsonObject3);
|
||||||
|
fs_p.put("value", i);
|
||||||
|
}
|
||||||
|
money.put("value", money2);
|
||||||
|
pay.put("value", 0);
|
||||||
|
ys.put("value", timeConversion);
|
||||||
|
no_money.put("value", money2);
|
||||||
|
month1.put("value", month2);
|
||||||
|
_widget_1704357037281.put("value", widget1704356902052);
|
||||||
|
sid4444.put("value", maxa);
|
||||||
|
|
||||||
|
|
||||||
|
data333.put("type", type333);
|
||||||
|
data333.put("name", name);
|
||||||
|
data333.put("month", month);
|
||||||
|
data333.put("yewubiaodanmingcheng", yewubiaodanmingcheng);
|
||||||
|
data333.put("yewubiaodanbianma", yewubiaodanbianma);
|
||||||
|
data333.put("sijixingming", sijixingming);
|
||||||
|
data333.put("no_account_money", no_account_money);
|
||||||
|
data333.put("id_card", id_card333);
|
||||||
|
data333.put("abbreviation", abbreviation);
|
||||||
|
data333.put("enterprise_id", enterprise_id);
|
||||||
|
data333.put("sijisuozaigongsi", sijisuozaigongsi);
|
||||||
|
data333.put("fs", fs);
|
||||||
|
data333.put("fs_p", fs_p);
|
||||||
|
data333.put("money", money);
|
||||||
|
data333.put("pay", pay);
|
||||||
|
data333.put("no_money", no_money);
|
||||||
|
data333.put("ys", ys);
|
||||||
|
data333.put("month1", month1);
|
||||||
|
data333.put("_widget_1704357037281", _widget_1704356902052);
|
||||||
|
data333.put("sid", sid4444);
|
||||||
|
|
||||||
|
|
||||||
|
jiangli333.put("data", data333);
|
||||||
|
|
||||||
|
String jsonString333 = jiangli333.toJSONString();
|
||||||
|
String insert333 = APIUtils.insert(jsonString333);
|
||||||
|
log.info("3333333333333333333333333333333333" + insert333);
|
||||||
|
|
||||||
|
|
||||||
|
Integer panduan = ZhangHu.panduan(f_user_idS);
|
||||||
|
|
||||||
|
if (panduan != 0) {
|
||||||
|
String id1 = ZhangHu.ID(f_user_idS);
|
||||||
|
JSONArray ziduan = ZhangHu.ziduan(f_user_idS);
|
||||||
|
JSONArray ziduanMINGXI = ZhangHu.ziduanMINGXI(f_user_idS);
|
||||||
|
String real_name777 = "";
|
||||||
|
String id_card777 = "";
|
||||||
|
String nick_name777 = "";
|
||||||
|
String phone777 = "";
|
||||||
|
String is_sign777 = "";
|
||||||
|
String type777 = "";
|
||||||
|
Integer sum_money777 = 0;
|
||||||
|
Integer no_account_money777 = 0;
|
||||||
|
Integer account_money777 = 0;
|
||||||
|
|
||||||
|
for (Object o : ziduan) {
|
||||||
|
JSONObject test7 = (JSONObject) o;
|
||||||
|
real_name777 = test7.getString("real_name");
|
||||||
|
id_card777 = test7.getString("id_card");
|
||||||
|
nick_name777 = test7.getString("nick_name");
|
||||||
|
phone777 = test7.getString("phone");
|
||||||
|
is_sign777 = test7.getString("is_sign");
|
||||||
|
type777 = test7.getString("type");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Object o : ziduanMINGXI) {
|
||||||
|
JSONObject test7 = (JSONObject) o;
|
||||||
|
sum_money777 = test7.getInteger("sum_money");
|
||||||
|
no_account_money777 = test7.getInteger("no_account_money");
|
||||||
|
account_money777 = test7.getInteger("account_money");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject jsonObject4 = new JSONObject();
|
||||||
|
jsonObject4.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject4.put("entry_id", "658fd4fa771e971c5816e8da");
|
||||||
|
jsonObject4.put("data_id", id1);
|
||||||
|
jsonObject4.put("is_start_trigger", true);
|
||||||
|
JSONObject DATA = new JSONObject();
|
||||||
|
|
||||||
|
JSONObject real_name888 = new JSONObject();
|
||||||
|
JSONObject nick_name888 = new JSONObject();
|
||||||
|
JSONObject type888 = new JSONObject();
|
||||||
|
JSONObject phone888 = new JSONObject();
|
||||||
|
JSONObject sum_money888 = new JSONObject();
|
||||||
|
JSONObject no_account_money888 = new JSONObject();
|
||||||
|
JSONObject account_money888 = new JSONObject();
|
||||||
|
JSONObject _widget_1711967418636 = new JSONObject();
|
||||||
|
JSONObject _widget_1709204953031 = new JSONObject();
|
||||||
|
real_name888.put("value", real_name777);
|
||||||
|
nick_name888.put("value", nick_name777);
|
||||||
|
type888.put("value", type777);
|
||||||
|
phone888.put("value", phone777);
|
||||||
|
sum_money888.put("value", sum_money777 + money2);
|
||||||
|
no_account_money888.put("value", no_account_money777 + money2);
|
||||||
|
account_money888.put("value", account_money777 + 0);
|
||||||
|
_widget_1711967418636.put("value", id_card777);
|
||||||
|
_widget_1709204953031.put("value", is_sign777);
|
||||||
|
|
||||||
|
|
||||||
|
DATA.put("sum_money", sum_money888);
|
||||||
|
DATA.put("no_account_money", no_account_money888);
|
||||||
|
DATA.put("account_money", account_money888);
|
||||||
|
|
||||||
|
jsonObject4.put("data", DATA);
|
||||||
|
|
||||||
|
|
||||||
|
String jsonString2 = jsonObject4.toJSONString();
|
||||||
|
String updata = APIUtils.updata(jsonString2);
|
||||||
|
log.info(updata);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (panduan == 0) {
|
||||||
|
String id1 = ZhangHu.ID(f_user_idS);
|
||||||
|
JSONArray ziduan = ZhangHu.ziduan(f_user_idS);
|
||||||
|
JSONArray ziduanMINGXI = ZhangHu.ziduanMINGXI(f_user_idS);
|
||||||
|
String real_name777 = "";
|
||||||
|
String id_card777 = "";
|
||||||
|
String nick_name777 = "";
|
||||||
|
String phone777 = "";
|
||||||
|
String is_sign777 = "";
|
||||||
|
String type777 = "";
|
||||||
|
Integer sum_money777 = 0;
|
||||||
|
Integer no_account_money777 = 0;
|
||||||
|
Integer account_money777 = 0;
|
||||||
|
|
||||||
|
for (Object o : ziduan) {
|
||||||
|
JSONObject test7 = (JSONObject) o;
|
||||||
|
real_name777 = test7.getString("real_name");
|
||||||
|
id_card777 = test7.getString("id_card");
|
||||||
|
nick_name777 = test7.getString("nick_name");
|
||||||
|
phone777 = test7.getString("phone");
|
||||||
|
is_sign777 = test7.getString("is_sign");
|
||||||
|
type777 = test7.getString("type");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Object o : ziduanMINGXI) {
|
||||||
|
JSONObject test7 = (JSONObject) o;
|
||||||
|
sum_money777 = test7.getInteger("sum_money");
|
||||||
|
no_account_money777 = test7.getInteger("no_account_money");
|
||||||
|
account_money777 = test7.getInteger("account_money");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject jsonObject4 = new JSONObject();
|
||||||
|
jsonObject4.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject4.put("entry_id", "658fd4fa771e971c5816e8da");
|
||||||
|
jsonObject4.put("is_start_trigger", true);
|
||||||
|
JSONObject DATA = new JSONObject();
|
||||||
|
|
||||||
|
JSONObject real_name888 = new JSONObject();
|
||||||
|
JSONObject nick_name888 = new JSONObject();
|
||||||
|
JSONObject type888 = new JSONObject();
|
||||||
|
JSONObject phone888 = new JSONObject();
|
||||||
|
JSONObject sum_money888 = new JSONObject();
|
||||||
|
JSONObject no_account_money888 = new JSONObject();
|
||||||
|
JSONObject account_money888 = new JSONObject();
|
||||||
|
JSONObject _widget_1711967418636 = new JSONObject();
|
||||||
|
JSONObject _widget_1709204953031 = new JSONObject();
|
||||||
|
JSONObject id888 = new JSONObject();
|
||||||
|
JSONObject ffzt = new JSONObject();
|
||||||
|
|
||||||
|
real_name888.put("value", real_name777);
|
||||||
|
nick_name888.put("value", nick_name777);
|
||||||
|
type888.put("value", type777);
|
||||||
|
phone888.put("value", phone777);
|
||||||
|
sum_money888.put("value", money2);
|
||||||
|
no_account_money888.put("value", money2);
|
||||||
|
account_money888.put("value", 0);
|
||||||
|
_widget_1711967418636.put("value", id_card777);
|
||||||
|
_widget_1709204953031.put("value", is_sign777);
|
||||||
|
id888.put("value", f_user_idS);
|
||||||
|
ffzt.put("value", "发放完成");
|
||||||
|
|
||||||
|
DATA.put("real_name", real_name888);
|
||||||
|
DATA.put("nick_name", nick_name888);
|
||||||
|
DATA.put("type", type888);
|
||||||
|
DATA.put("phone", phone888);
|
||||||
|
DATA.put("sum_money", sum_money888);
|
||||||
|
DATA.put("no_account_money", no_account_money888);
|
||||||
|
DATA.put("account_money", account_money888);
|
||||||
|
DATA.put("_widget_1711967418636", _widget_1711967418636);
|
||||||
|
DATA.put("_widget_1709204953031", _widget_1709204953031);
|
||||||
|
DATA.put("id", id888);
|
||||||
|
jsonObject4.put("data", DATA);
|
||||||
|
DATA.put("ffzt", ffzt);
|
||||||
|
|
||||||
|
|
||||||
|
String jsonString2 = jsonObject4.toJSONString();
|
||||||
|
String updata = APIUtils.insert(jsonString2);
|
||||||
|
log.info(updata);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
lock.unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
109
src/main/java/com/example/sso/controller/XunHuanId.java
Normal file
109
src/main/java/com/example/sso/controller/XunHuanId.java
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
package com.example.sso.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.dao.UpIdString;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
public class XunHuanId {
|
||||||
|
@PostMapping("/id")
|
||||||
|
public String XunHuanId(@RequestBody JSONObject signature) throws Exception {
|
||||||
|
JSONObject data = signature.getJSONObject("data");
|
||||||
|
String id = data.getString("id");
|
||||||
|
String id2 = UpIdString._id(id);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (id != null && !id.isEmpty()) {
|
||||||
|
String FID = id;
|
||||||
|
Boolean b = true;
|
||||||
|
String FID1 = "";
|
||||||
|
while (b) {
|
||||||
|
String id1 = UpIdString.ID(FID);
|
||||||
|
if (id1 != null && !id1.isEmpty() && !id1.equals("0") ){
|
||||||
|
FID = id1;
|
||||||
|
b = true;
|
||||||
|
} else {
|
||||||
|
FID1 = FID;
|
||||||
|
b = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
log.info(FID1);
|
||||||
|
|
||||||
|
UpIdString.UPDATAFID(id2,FID1);
|
||||||
|
|
||||||
|
|
||||||
|
try{
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id","65c0e6bf12787fa6f91e73d8");
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("id");
|
||||||
|
jsonArray.add("name");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields",jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel","and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field","id");
|
||||||
|
jsonObject1.put("method","eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add(FID1);
|
||||||
|
jsonObject1.put("value",jsonArray1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel",rel);
|
||||||
|
filter.put("cond",cond);
|
||||||
|
jsonObject.put("filter",filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
|
||||||
|
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
|
||||||
|
for (Object O : jsonArray2){
|
||||||
|
JSONObject test = (JSONObject) O;
|
||||||
|
String A = test.getString("name");
|
||||||
|
if (A != null && !A.isEmpty()){
|
||||||
|
UpIdString.UPDATAFNAME(id2,A);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}catch (Exception e){
|
||||||
|
throw new Exception(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
225
src/main/java/com/example/sso/controller/YingXiaoController.java
Normal file
225
src/main/java/com/example/sso/controller/YingXiaoController.java
Normal file
@ -0,0 +1,225 @@
|
|||||||
|
package com.example.sso.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.dao.*;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@Slf4j
|
||||||
|
public class YingXiaoController {
|
||||||
|
@PostMapping("/yingxiao")
|
||||||
|
public String qianzhangdp(@RequestBody JSONObject yingxiao) throws Exception {
|
||||||
|
JSONObject data = yingxiao.getJSONObject("data");
|
||||||
|
|
||||||
|
String sjid = data.getString("sjid");
|
||||||
|
// String yxname = data.getString("yxname");
|
||||||
|
//String username = data.getJSONObject("yxzd").getString("integrate_id");
|
||||||
|
String dataid = data.getString("_id");
|
||||||
|
String id = data.getString("id");
|
||||||
|
String fs = ChaFenSi.id(id);
|
||||||
|
String ylyx = ChaFenSi.ylyx(id);
|
||||||
|
|
||||||
|
|
||||||
|
Integer num = YingXiaoFs.num(fs);
|
||||||
|
|
||||||
|
if (num != 0) {
|
||||||
|
//这个是查询分司为金建分司
|
||||||
|
if (!id.isEmpty()){
|
||||||
|
log.info("我是第一次");
|
||||||
|
JSONArray array = ThreeOne.array(sjid);
|
||||||
|
int size = array.size();
|
||||||
|
if (size != 0){
|
||||||
|
for (Object o : array) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String username = test.getJSONObject("yxzd").getString("username");
|
||||||
|
String yxname = test.getString("yxname");
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","66c866b2d6520ecd19066bb0");
|
||||||
|
jsonObject.put("entry_id","66ce9d8650722812f7b3cb3a");
|
||||||
|
jsonObject.put("is_start_trigger", true);
|
||||||
|
|
||||||
|
jsonObject.put("data_id",dataid);
|
||||||
|
JSONObject data1 = new JSONObject();
|
||||||
|
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("value",username);
|
||||||
|
data1.put("yxzd",jsonObject2);
|
||||||
|
|
||||||
|
JSONObject jsonObject21 = new JSONObject();
|
||||||
|
jsonObject21.put("value",yxname);
|
||||||
|
data1.put("yxname",jsonObject21);
|
||||||
|
|
||||||
|
jsonObject.put("data",data1);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
APIUtils.updata(jsonString);
|
||||||
|
return "ok!!!!!!!!!";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
//这个是第二层逻辑
|
||||||
|
if (!id.isEmpty()){
|
||||||
|
log.info("我是第二次");
|
||||||
|
JSONArray array = ThreeTwo.array(ylyx);
|
||||||
|
int size = array.size();
|
||||||
|
if (size != 0){
|
||||||
|
for (Object o : array) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String username = test.getJSONObject("yxzd").getString("username");
|
||||||
|
String yxname = test.getString("yxname");
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","66c866b2d6520ecd19066bb0");
|
||||||
|
jsonObject.put("entry_id","66ce9d8650722812f7b3cb3a");
|
||||||
|
jsonObject.put("is_start_trigger", true);
|
||||||
|
jsonObject.put("data_id",dataid);
|
||||||
|
JSONObject data1 = new JSONObject();
|
||||||
|
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("value",username);
|
||||||
|
data1.put("yxzd",jsonObject2);
|
||||||
|
|
||||||
|
JSONObject jsonObject21 = new JSONObject();
|
||||||
|
jsonObject21.put("value",yxname);
|
||||||
|
data1.put("yxname",jsonObject21);
|
||||||
|
|
||||||
|
jsonObject.put("data",data1);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
APIUtils.updata(jsonString);
|
||||||
|
return "ok!!!!!!!!!";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
JSONArray jsonArray1 = YingXiaoId.id(sjid);
|
||||||
|
int size = jsonArray1.size();
|
||||||
|
|
||||||
|
if (size != 0) {
|
||||||
|
for (Object o : jsonArray1) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String yxnames = test.getString("yxname");
|
||||||
|
String yxzd = test.getJSONObject("yxzd").getString("integrate_id");
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "66c866b2d6520ecd19066bb0");
|
||||||
|
jsonObject.put("entry_id", "66ce9d8650722812f7b3cb3a");
|
||||||
|
jsonObject.put("data_id", dataid);
|
||||||
|
jsonObject.put("is_start_trigger", true);
|
||||||
|
JSONObject DATA = new JSONObject();
|
||||||
|
JSONObject yxname1 = new JSONObject();
|
||||||
|
yxname1.put("value", yxnames);
|
||||||
|
|
||||||
|
JSONObject yxzd1 = new JSONObject();
|
||||||
|
yxzd1.put("value", yxzd);
|
||||||
|
DATA.put("yxname", yxname1);
|
||||||
|
DATA.put("yxzd", yxzd1);
|
||||||
|
jsonObject.put("data", DATA);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String updata = APIUtils.updata(jsonString);
|
||||||
|
log.info(updata);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.info("我是第三次");
|
||||||
|
|
||||||
|
Integer maxs = Max.maxs();
|
||||||
|
Integer maxs1 = XuHaoNoNull.maxs();
|
||||||
|
JSONArray fou = NoteFou.fou();
|
||||||
|
|
||||||
|
int i = maxs1 + 1;
|
||||||
|
int xuhao = 0;
|
||||||
|
|
||||||
|
|
||||||
|
for (Object o : fou ) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String string = test.getString("xuhao");
|
||||||
|
int currentId = Integer.parseInt(string);
|
||||||
|
if (currentId == i) {
|
||||||
|
i += 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
if (i <= maxs) {
|
||||||
|
xuhao = i;
|
||||||
|
} else {
|
||||||
|
xuhao = 1;
|
||||||
|
for (Object o : fou ) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String string = test.getString("xuhao");
|
||||||
|
int currentId = Integer.parseInt(string);
|
||||||
|
if (currentId == xuhao) {
|
||||||
|
xuhao += 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
JSONArray array = SelectPerson.array(xuhao);
|
||||||
|
String yxname = "";
|
||||||
|
String string = "";
|
||||||
|
for (Object o : array){
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
yxname = test.getString("yxname");
|
||||||
|
string = test.getJSONObject("yxzd").getString("integrate_id");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "66c866b2d6520ecd19066bb0");
|
||||||
|
jsonObject.put("entry_id", "66ce9d8650722812f7b3cb3a");
|
||||||
|
jsonObject.put("data_id", dataid);
|
||||||
|
jsonObject.put("is_start_trigger", true);
|
||||||
|
JSONObject DATA = new JSONObject();
|
||||||
|
JSONObject yxname1 = new JSONObject();
|
||||||
|
yxname1.put("value",yxname);
|
||||||
|
|
||||||
|
JSONObject yxzd1 = new JSONObject();
|
||||||
|
yxzd1.put("value",string);
|
||||||
|
|
||||||
|
JSONObject xuhao1 = new JSONObject();
|
||||||
|
xuhao1.put("value",xuhao);
|
||||||
|
|
||||||
|
|
||||||
|
DATA.put("xuhao",xuhao1);
|
||||||
|
DATA.put("yxname",yxname1);
|
||||||
|
DATA.put("yxzd",yxzd1);
|
||||||
|
jsonObject.put("data",DATA);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
|
||||||
|
String updata = APIUtils.updata(jsonString);
|
||||||
|
log.info(updata);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
173
src/main/java/com/example/sso/controller/ZuoFeiController.java
Normal file
173
src/main/java/com/example/sso/controller/ZuoFeiController.java
Normal file
@ -0,0 +1,173 @@
|
|||||||
|
package com.example.sso.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.FDaDaUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@Slf4j
|
||||||
|
public class ZuoFeiController {
|
||||||
|
@PostMapping("/zuofei")
|
||||||
|
public String zuofei(@RequestBody JSONObject signature) throws Exception {
|
||||||
|
JSONObject data = signature.getJSONObject("data");
|
||||||
|
String id = data.getString("_widget_1715917383776");//id
|
||||||
|
String phone = data.getString("_widget_1715917383777");//手机号
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("initiatorId","625776ecae6742cb8eb710beedef9b4c");
|
||||||
|
jsonObject.put("signTaskId",id);
|
||||||
|
jsonObject.put("abolishedInitiator",jsonObject1);
|
||||||
|
JSONArray actors12 = new JSONArray();
|
||||||
|
JSONObject Actor = new JSONObject();
|
||||||
|
JSONArray notifyType = new JSONArray();
|
||||||
|
notifyType.add("start");
|
||||||
|
notifyType.add("finish");
|
||||||
|
notifyType.add("start");
|
||||||
|
Actor.put("notifyType",notifyType);
|
||||||
|
Actor.put("notifyAddress",phone);
|
||||||
|
Actor.put("actorId","用户方");
|
||||||
|
JSONObject jsonObjec = new JSONObject();
|
||||||
|
jsonObjec.put("actor",Actor);
|
||||||
|
actors12.add(jsonObjec);
|
||||||
|
jsonObject.put("actors",actors12);
|
||||||
|
|
||||||
|
jsonObject.put("reason","签署内容有误");
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
System.out.println(jsonString);
|
||||||
|
String zuofei = FDaDaUtil.zuofei(jsonString);
|
||||||
|
log.info("zuofei "+ zuofei);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(zuofei);
|
||||||
|
JSONObject jsonObject3 = jsonObject2.getJSONObject("data");
|
||||||
|
String abolishedSignTaskId = jsonObject3.getString("abolishedSignTaskId");
|
||||||
|
log.info("最开始的任务id "+abolishedSignTaskId);
|
||||||
|
JSONObject jsonObject4 = new JSONObject();
|
||||||
|
jsonObject4.put("signTaskId",abolishedSignTaskId);
|
||||||
|
String jsonString1 = jsonObject4.toJSONString();
|
||||||
|
String infor = FDaDaUtil.infor(jsonString1);
|
||||||
|
JSONObject jsonObject5 = JSON.parseObject(infor);
|
||||||
|
JSONArray jsonArray = jsonObject5.getJSONObject("data").getJSONArray("docs");
|
||||||
|
String docid = "";
|
||||||
|
for (Object o : jsonArray){
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
docid = test.getString("docId");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//企业
|
||||||
|
|
||||||
|
JSONObject jsonObject6 = new JSONObject();
|
||||||
|
jsonObject6.put("signTaskId",abolishedSignTaskId);
|
||||||
|
jsonObject6.put("actorId","企业方");
|
||||||
|
JSONArray fields = new JSONArray();
|
||||||
|
JSONObject zhang = new JSONObject();
|
||||||
|
zhang.put("docId",docid);
|
||||||
|
JSONArray docFieldszhang = new JSONArray();
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject zhanginfor = new JSONObject();
|
||||||
|
zhanginfor.put("fieldId","企业章");
|
||||||
|
zhanginfor.put("fieldName","企业章");
|
||||||
|
JSONObject positionzhang = new JSONObject();
|
||||||
|
positionzhang.put("positionX",168);
|
||||||
|
positionzhang.put("positionY",780);
|
||||||
|
positionzhang.put("positionMode","pixel");
|
||||||
|
positionzhang.put("positionPageNo",1);
|
||||||
|
|
||||||
|
zhanginfor.put("position",positionzhang);
|
||||||
|
zhanginfor.put("fieldType","corp_seal");
|
||||||
|
docFieldszhang.add(zhanginfor);
|
||||||
|
|
||||||
|
zhang.put("docFields",docFieldszhang);
|
||||||
|
fields.add(zhang);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject6.put("fields",fields);
|
||||||
|
String jsonString2 = jsonObject6.toJSONString();
|
||||||
|
String add1 = FDaDaUtil.add(jsonString2);
|
||||||
|
System.out.println("我是企业 "+add1);
|
||||||
|
|
||||||
|
|
||||||
|
//用户
|
||||||
|
JSONObject jsonObject61 = new JSONObject();
|
||||||
|
jsonObject61.put("signTaskId",abolishedSignTaskId);
|
||||||
|
jsonObject61.put("actorId","用户方");
|
||||||
|
JSONArray fields1 = new JSONArray();
|
||||||
|
JSONObject zhang1 = new JSONObject();
|
||||||
|
zhang1.put("docId",docid);
|
||||||
|
JSONArray docFieldszhang1 = new JSONArray();
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject zhanginfor1 = new JSONObject();
|
||||||
|
zhanginfor1.put("fieldId","用户签名");
|
||||||
|
zhanginfor1.put("fieldName","用户签名");
|
||||||
|
JSONObject positionzhang1 = new JSONObject();
|
||||||
|
positionzhang1.put("positionX",450);
|
||||||
|
positionzhang1.put("positionY",780);
|
||||||
|
positionzhang1.put("positionMode","pixel");
|
||||||
|
positionzhang1.put("positionPageNo",1);
|
||||||
|
|
||||||
|
zhanginfor1.put("position",positionzhang1);
|
||||||
|
zhanginfor1.put("fieldType","person_sign");
|
||||||
|
docFieldszhang1.add(zhanginfor1);
|
||||||
|
|
||||||
|
zhang1.put("docFields",docFieldszhang1);
|
||||||
|
fields1.add(zhang1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject61.put("fields",fields1);
|
||||||
|
String jsonString21 = jsonObject61.toJSONString();
|
||||||
|
String add = FDaDaUtil.add(jsonString21);
|
||||||
|
System.out.println("我是用户 " + add);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//修改签署任务参与方
|
||||||
|
JSONObject jsonObject7 = new JSONObject();
|
||||||
|
jsonObject7.put("signTaskId",abolishedSignTaskId);
|
||||||
|
jsonObject7.put("businessId","a09900c24614bd4c1de10c55712a3e0e");
|
||||||
|
|
||||||
|
|
||||||
|
//参与方数组
|
||||||
|
JSONArray actors = new JSONArray();
|
||||||
|
JSONObject jsonObject8 = new JSONObject();
|
||||||
|
jsonObject8.put("actorId","企业方");
|
||||||
|
JSONArray signFields = new JSONArray();
|
||||||
|
JSONObject jsonObject9 = new JSONObject();
|
||||||
|
jsonObject9.put("fieldDocId",docid);
|
||||||
|
jsonObject9.put("fieldId","企业章");
|
||||||
|
jsonObject9.put("sealId",1705574268127146240l);
|
||||||
|
signFields.add(jsonObject9);
|
||||||
|
jsonObject8.put("signFields",signFields);
|
||||||
|
JSONObject jsonObject10 = new JSONObject();
|
||||||
|
jsonObject10.put("requestVerifyFree",true);
|
||||||
|
jsonObject8.put("signConfigInfo",jsonObject10);
|
||||||
|
actors.add(jsonObject8);
|
||||||
|
jsonObject7.put("actors",actors);
|
||||||
|
|
||||||
|
String jsonString3 = jsonObject7.toJSONString();
|
||||||
|
String updata = FDaDaUtil.updata(jsonString3);
|
||||||
|
log.info("updata "+updata);
|
||||||
|
|
||||||
|
JSONObject jsonObject999 = new JSONObject();
|
||||||
|
jsonObject999.put("signTaskId",abolishedSignTaskId);
|
||||||
|
String jsonString11 = jsonObject999.toJSONString();
|
||||||
|
String signtask = FDaDaUtil.signtask(jsonString11);
|
||||||
|
System.out.println(signtask);
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
82
src/main/java/com/example/sso/dao/A.java
Normal file
82
src/main/java/com/example/sso/dao/A.java
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
package com.example.sso.dao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class A {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
JSONArray con = CountBiao.con();
|
||||||
|
for (Object o : con) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String id = test.getString("id");
|
||||||
|
String id1 = test.getString("_id");
|
||||||
|
|
||||||
|
Integer e = test.getInteger("e");
|
||||||
|
Integer f = test.getInteger("f");
|
||||||
|
Integer g = test.getInteger("g");
|
||||||
|
Integer h = test.getInteger("h");
|
||||||
|
Integer a = test.getInteger("a");
|
||||||
|
Integer b = test.getInteger("b");
|
||||||
|
Integer c = test.getInteger("c");
|
||||||
|
Integer d = test.getInteger("d");
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id", "661c8b33a33a34d4ebb211b0");
|
||||||
|
jsonObject.put("data_id", id1);
|
||||||
|
JSONObject data = new JSONObject();
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject A1 = new JSONObject();
|
||||||
|
A1.put("value", 0);
|
||||||
|
data.put("a", A1);
|
||||||
|
|
||||||
|
JSONObject B1 = new JSONObject();
|
||||||
|
B1.put("value", 0);
|
||||||
|
data.put("b", B1);
|
||||||
|
|
||||||
|
JSONObject C1 = new JSONObject();
|
||||||
|
C1.put("value", 0);
|
||||||
|
data.put("c", C1);
|
||||||
|
|
||||||
|
JSONObject D1 = new JSONObject();
|
||||||
|
D1.put("value", 0);
|
||||||
|
data.put("d", D1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject H1 = new JSONObject();
|
||||||
|
H1.put("value", d);
|
||||||
|
data.put("h", H1);
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject G1 = new JSONObject();
|
||||||
|
G1.put("value", c);
|
||||||
|
data.put("g", G1);
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject F1 = new JSONObject();
|
||||||
|
F1.put("value", b);
|
||||||
|
data.put("f", F1);
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject E1 = new JSONObject();
|
||||||
|
E1.put("value", a);
|
||||||
|
data.put("e", E1);
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("data", data);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
|
||||||
|
String updata = APIUtils.updata(jsonString);
|
||||||
|
log.info(updata);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
191
src/main/java/com/example/sso/dao/B.java
Normal file
191
src/main/java/com/example/sso/dao/B.java
Normal file
@ -0,0 +1,191 @@
|
|||||||
|
package com.example.sso.dao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.http.HttpEntity;
|
||||||
|
import org.apache.http.HttpResponse;
|
||||||
|
import org.apache.http.client.methods.HttpPost;
|
||||||
|
import org.apache.http.entity.ContentType;
|
||||||
|
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
||||||
|
import org.apache.http.entity.mime.content.FileBody;
|
||||||
|
import org.apache.http.entity.mime.content.StringBody;
|
||||||
|
import org.apache.http.impl.client.CloseableHttpClient;
|
||||||
|
import org.apache.http.impl.client.HttpClients;
|
||||||
|
import org.apache.http.util.EntityUtils;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.jws.soap.SOAPBinding;
|
||||||
|
import java.io.*;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.net.URLConnection;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
public class B {
|
||||||
|
private static final int size = 1024;
|
||||||
|
@PostMapping("/test")
|
||||||
|
public JSONObject main1(@RequestBody C c) throws IOException {
|
||||||
|
//String fileUrl = "https://fz-zion-static.functorz.com/202403290302/2580e8a228755ecb953645bcf20700ac/project/2000000000282320/images/HDzOpA6kQuD994hibpYtyA==.jpg";
|
||||||
|
String saveDir = "/home/appdowns/"; // 本地文件夹路径
|
||||||
|
String fileName ="";
|
||||||
|
|
||||||
|
try {
|
||||||
|
URL url = new URL(c.getFileUrl());
|
||||||
|
URLConnection conn = url.openConnection();
|
||||||
|
InputStream inputStream = conn.getInputStream();
|
||||||
|
|
||||||
|
fileName = c.getFileUrl().substring(c.getFileUrl().lastIndexOf("/") + 1);
|
||||||
|
log.info("我是fileName "+ fileName);
|
||||||
|
String saveFilePath = saveDir + File.separator + fileName;
|
||||||
|
|
||||||
|
FileOutputStream outputStream = new FileOutputStream(saveFilePath);
|
||||||
|
|
||||||
|
int bytesRead;
|
||||||
|
byte[] buffer = new byte[8192];
|
||||||
|
while ((bytesRead = inputStream.read(buffer)) != -1) {
|
||||||
|
outputStream.write(buffer, 0, bytesRead);
|
||||||
|
}
|
||||||
|
|
||||||
|
outputStream.close();
|
||||||
|
inputStream.close();
|
||||||
|
|
||||||
|
System.out.println("文件下载完成");
|
||||||
|
} catch (IOException e) {
|
||||||
|
System.out.println("我是异常 " + e);
|
||||||
|
}
|
||||||
|
String key = key(c.getToken(), fileName);
|
||||||
|
System.out.println(key);
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add(key);
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("key",jsonArray);
|
||||||
|
return jsonObject;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String key( String token,String top) throws IOException {
|
||||||
|
String url = "https://www.jiyuankeshang.com/_/file/upload/put_file";
|
||||||
|
File file = new File("/home" + File.separator + "appdowns/" + File.separator + top);
|
||||||
|
String PATH = "D:\\11.txt";
|
||||||
|
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||||
|
HttpPost httpPost = new HttpPost(url);
|
||||||
|
// httpPost.setHeader("Content-Type", "form-data");
|
||||||
|
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||||
|
builder.addPart("token", new StringBody(token, ContentType.create("text/plain", Charset.forName("UTF-8"))));
|
||||||
|
builder.addPart("file", new FileBody(file, ContentType.create("JPG"), file.getName()));
|
||||||
|
HttpEntity entity = builder.build();
|
||||||
|
|
||||||
|
httpPost.setEntity(entity);
|
||||||
|
HttpResponse response = httpClient.execute(httpPost);
|
||||||
|
int statusCode = response.getStatusLine().getStatusCode();
|
||||||
|
|
||||||
|
HttpEntity entity1 = response.getEntity();
|
||||||
|
String string = EntityUtils.toString(entity1);
|
||||||
|
JSONObject jsonObject = JSON.parseObject(string);
|
||||||
|
String key = jsonObject.getString("key");
|
||||||
|
|
||||||
|
return key;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*public static String keys( String token,String top) throws IOException {
|
||||||
|
String url = "https://www.jiyuankeshang.com/_/file/upload/put_file";
|
||||||
|
File file = new File("D:" + File.separator + "下载模板" + File.separator + top);
|
||||||
|
|
||||||
|
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||||
|
HttpPost httpPost = new HttpPost(url);
|
||||||
|
// httpPost.setHeader("Content-Type", "form-data");
|
||||||
|
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||||
|
builder.addPart("token", new StringBody(token, ContentType.create("text/plain", Charset.forName("UTF-8"))));
|
||||||
|
builder.addPart("file", new FileBody(file, ContentType.create("pdf"), file.getName()));
|
||||||
|
HttpEntity entity = builder.build();
|
||||||
|
|
||||||
|
httpPost.setEntity(entity);
|
||||||
|
HttpResponse response = httpClient.execute(httpPost);
|
||||||
|
int statusCode = response.getStatusLine().getStatusCode();
|
||||||
|
|
||||||
|
HttpEntity entity1 = response.getEntity();
|
||||||
|
String string = EntityUtils.toString(entity1);
|
||||||
|
JSONObject jsonObject = JSON.parseObject(string);
|
||||||
|
String key = jsonObject.getString("key");
|
||||||
|
|
||||||
|
return key;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/ceshi")
|
||||||
|
public JSONObject test(@RequestBody C c) throws IOException {
|
||||||
|
//String fileUrl = "https://fz-zion-static.functorz.com/202403290302/2580e8a228755ecb953645bcf20700ac/project/2000000000282320/images/HDzOpA6kQuD994hibpYtyA==.jpg";
|
||||||
|
String saveDir = "D:\\下载模板\\"; // 本地文件夹路径
|
||||||
|
String fileName ="";
|
||||||
|
|
||||||
|
try {
|
||||||
|
URL url = new URL(c.getFileUrl());
|
||||||
|
URLConnection conn = url.openConnection();
|
||||||
|
InputStream inputStream = conn.getInputStream();
|
||||||
|
|
||||||
|
fileName = c.getFileUrl().substring(c.getFileUrl().lastIndexOf("/") + 1);
|
||||||
|
String saveFilePath = saveDir + File.separator + fileName;
|
||||||
|
|
||||||
|
FileOutputStream outputStream = new FileOutputStream(saveFilePath);
|
||||||
|
|
||||||
|
int bytesRead;
|
||||||
|
byte[] buffer = new byte[4096];
|
||||||
|
while ((bytesRead = inputStream.read(buffer)) != -1) {
|
||||||
|
outputStream.write(buffer, 0, bytesRead);
|
||||||
|
}
|
||||||
|
|
||||||
|
outputStream.close();
|
||||||
|
inputStream.close();
|
||||||
|
|
||||||
|
System.out.println("文件下载完成");
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
String key = keys(c.getToken(), fileName);
|
||||||
|
System.out.println(key);
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add(key);
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("key",jsonArray);
|
||||||
|
return jsonObject;
|
||||||
|
|
||||||
|
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
10
src/main/java/com/example/sso/dao/C.java
Normal file
10
src/main/java/com/example/sso/dao/C.java
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
package com.example.sso.dao;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class C {
|
||||||
|
private String fileUrl;
|
||||||
|
private String token;
|
||||||
|
|
||||||
|
}
|
||||||
88
src/main/java/com/example/sso/dao/ChaFenSi.java
Normal file
88
src/main/java/com/example/sso/dao/ChaFenSi.java
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
package com.example.sso.dao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
|
||||||
|
public class ChaFenSi {
|
||||||
|
public static String id(String id) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id", "658bc54678f6daedd0cfa269");
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("fs_name");
|
||||||
|
jsonArray.add("id");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields", jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel", "and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field", "id");
|
||||||
|
jsonObject1.put("method", "eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add(id);
|
||||||
|
jsonObject1.put("value", jsonArray1);
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel", rel);
|
||||||
|
filter.put("cond", cond);
|
||||||
|
jsonObject.put("filter", filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
String FS = "";
|
||||||
|
for (Object o : jsonArray2){
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
FS = test.getString("fs_name");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return FS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String ylyx(String id) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id", "658bc54678f6daedd0cfa269");
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("ylyx");
|
||||||
|
jsonArray.add("id");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields", jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel", "and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field", "id");
|
||||||
|
jsonObject1.put("method", "eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add(id);
|
||||||
|
jsonObject1.put("value", jsonArray1);
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel", rel);
|
||||||
|
filter.put("cond", cond);
|
||||||
|
jsonObject.put("filter", filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
String FS = "";
|
||||||
|
for (Object o : jsonArray2){
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
FS = test.getString("ylyx");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return FS;
|
||||||
|
}
|
||||||
|
}
|
||||||
25
src/main/java/com/example/sso/dao/CountBiao.java
Normal file
25
src/main/java/com/example/sso/dao/CountBiao.java
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
package com.example.sso.dao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
|
||||||
|
public class CountBiao {
|
||||||
|
public static JSONArray con() {
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject2.put("entry_id", "661c8b33a33a34d4ebb211b0");
|
||||||
|
jsonObject2.put("limit", 99999999);
|
||||||
|
|
||||||
|
String jsonString = jsonObject2.toJSONString();
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray = jsonObject.getJSONArray("data");
|
||||||
|
return jsonArray;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
48
src/main/java/com/example/sso/dao/DpJianCheng.java
Normal file
48
src/main/java/com/example/sso/dao/DpJianCheng.java
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
package com.example.sso.dao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
|
||||||
|
public class DpJianCheng {
|
||||||
|
|
||||||
|
public static String hetong(String htong) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "6437c223ee895d000812a37d");
|
||||||
|
jsonObject.put("entry_id", "6589411e78f6daedd0c2c702");
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("_widget_1704261110996");
|
||||||
|
jsonArray.add("jiancheng");
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields", jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel", "and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field", "_widget_1704261110996");
|
||||||
|
jsonObject1.put("method", "eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add("htong");
|
||||||
|
jsonObject1.put("value", jsonArray1);
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel", rel);
|
||||||
|
filter.put("cond", cond);
|
||||||
|
jsonObject.put("filter", filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray dataA = jsonObject2.getJSONArray("data");
|
||||||
|
String J = "";
|
||||||
|
for (Object dataA1 : dataA){
|
||||||
|
JSONObject test = (JSONObject) dataA1;
|
||||||
|
J = test.getString("jiancheng");
|
||||||
|
}
|
||||||
|
return J;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
49
src/main/java/com/example/sso/dao/FddId.java
Normal file
49
src/main/java/com/example/sso/dao/FddId.java
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
package com.example.sso.dao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
|
||||||
|
public class FddId {
|
||||||
|
public static String id(String id) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id", "658bc54678f6daedd0cfa269");
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("id");
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields", jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel", "and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field", "id");
|
||||||
|
jsonObject1.put("method", "eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add(id);
|
||||||
|
jsonObject1.put("value", jsonArray1);
|
||||||
|
|
||||||
|
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel", rel);
|
||||||
|
filter.put("cond", cond);
|
||||||
|
jsonObject.put("filter", filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
|
||||||
|
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
String A = "";
|
||||||
|
for (Object O : jsonArray2) {
|
||||||
|
JSONObject test = (JSONObject) O;
|
||||||
|
A = test.getString("_id");
|
||||||
|
}
|
||||||
|
System.out.println(A);
|
||||||
|
return A;
|
||||||
|
}
|
||||||
|
}
|
||||||
16
src/main/java/com/example/sso/dao/Files.java
Normal file
16
src/main/java/com/example/sso/dao/Files.java
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
package com.example.sso.dao;
|
||||||
|
|
||||||
|
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class Files {
|
||||||
|
public static Map<String, String> test(){
|
||||||
|
APIUtils api = new APIUtils("65815f117de49256b1e67e75", "658bc54678f6daedd0cfa269","BkIyzlh1onqnqu9cQ3ralDQBjECn97ex");
|
||||||
|
Map<String, String> down = api.down();
|
||||||
|
return down;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
41
src/main/java/com/example/sso/dao/GeRen.java
Normal file
41
src/main/java/com/example/sso/dao/GeRen.java
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
package com.example.sso.dao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class GeRen {
|
||||||
|
/*public String app_id;
|
||||||
|
public String entry_id;
|
||||||
|
public String id_card;
|
||||||
|
public String updateTime;
|
||||||
|
public String examine_status;*/
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
|
||||||
|
jsonObject.put("app_id","65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id","658bc54678f6daedd0cfa269");
|
||||||
|
jsonObject.put("limit",999999);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject1 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray = jsonObject1.getJSONArray("data");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
for (Object o : jsonArray){
|
||||||
|
JSONObject TEST = (JSONObject) o;
|
||||||
|
String string = TEST.getString("updateTime");
|
||||||
|
String substring = string.substring(0, 10);
|
||||||
|
TEST.put("updateTime",substring);
|
||||||
|
String string1 = TEST.getString("id_card");
|
||||||
|
String string2 = TEST.getString("updateTime");
|
||||||
|
String string3 = TEST.getString("examine_status");
|
||||||
|
System.out.println(string2);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
76
src/main/java/com/example/sso/dao/Max.java
Normal file
76
src/main/java/com/example/sso/dao/Max.java
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
package com.example.sso.dao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
|
||||||
|
public class Max {
|
||||||
|
public static String max(){
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
|
||||||
|
jsonObject.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id", "658fce1d771e971c5816e475");
|
||||||
|
jsonObject.put("limit", 999999);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject1 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray = jsonObject1.getJSONArray("data");
|
||||||
|
int maxId = Integer.MIN_VALUE;
|
||||||
|
|
||||||
|
|
||||||
|
for (Object o : jsonArray) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String string = test.getString("sid");
|
||||||
|
int currentId = Integer.parseInt(string);
|
||||||
|
if (currentId > maxId) {
|
||||||
|
maxId = currentId;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
maxId += 1;
|
||||||
|
String s = String.valueOf(maxId);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Integer maxs(){
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
|
||||||
|
jsonObject.put("app_id", "66c866b2d6520ecd19066bb0");
|
||||||
|
jsonObject.put("entry_id", "66cebfaa2340ecd8b90e06a1");
|
||||||
|
jsonObject.put("limit", 10000);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
filter.put("rel","and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject11 = new JSONObject();
|
||||||
|
jsonObject11.put("field","yeno");
|
||||||
|
jsonObject11.put("method","ne");
|
||||||
|
JSONArray jsonArray12 = new JSONArray();
|
||||||
|
jsonArray12.add("否");
|
||||||
|
jsonObject11.put("value",jsonArray12);
|
||||||
|
cond.add(jsonObject11);
|
||||||
|
filter.put("cond",cond);
|
||||||
|
jsonObject.put("filter",filter);
|
||||||
|
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject1 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray = jsonObject1.getJSONArray("data");
|
||||||
|
int maxId = Integer.MIN_VALUE;
|
||||||
|
|
||||||
|
|
||||||
|
for (Object o : jsonArray) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String string = test.getString("xuhao");
|
||||||
|
int currentId = Integer.parseInt(string);
|
||||||
|
if (currentId > maxId) {
|
||||||
|
maxId = currentId;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return maxId;
|
||||||
|
}
|
||||||
|
}
|
||||||
35
src/main/java/com/example/sso/dao/NoteFou.java
Normal file
35
src/main/java/com/example/sso/dao/NoteFou.java
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package com.example.sso.dao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
|
||||||
|
public class NoteFou {
|
||||||
|
public static JSONArray fou() {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
|
||||||
|
jsonObject.put("app_id", "66c866b2d6520ecd19066bb0");
|
||||||
|
jsonObject.put("entry_id", "66cebfaa2340ecd8b90e06a1");
|
||||||
|
jsonObject.put("limit", 10000);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
filter.put("rel","and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject11 = new JSONObject();
|
||||||
|
jsonObject11.put("field","yeno");
|
||||||
|
jsonObject11.put("method","eq");
|
||||||
|
JSONArray jsonArray12 = new JSONArray();
|
||||||
|
jsonArray12.add("否");
|
||||||
|
jsonObject11.put("value",jsonArray12);
|
||||||
|
cond.add(jsonObject11);
|
||||||
|
filter.put("cond",cond);
|
||||||
|
jsonObject.put("filter",filter);
|
||||||
|
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject1 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray = jsonObject1.getJSONArray("data");
|
||||||
|
return jsonArray;
|
||||||
|
}
|
||||||
|
}
|
||||||
269
src/main/java/com/example/sso/dao/OneIdcard.java
Normal file
269
src/main/java/com/example/sso/dao/OneIdcard.java
Normal file
@ -0,0 +1,269 @@
|
|||||||
|
package com.example.sso.dao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
|
||||||
|
import javax.validation.constraints.Null;
|
||||||
|
|
||||||
|
public class OneIdcard {
|
||||||
|
public static String XINXI(String f_user_id ) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id","658bc54678f6daedd0cfa269");
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("id");
|
||||||
|
jsonArray.add("real_name");
|
||||||
|
jsonArray.add("id_card");
|
||||||
|
jsonArray.add("fs_name");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields",jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel","and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field","id");
|
||||||
|
jsonObject1.put("method","eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add(f_user_id);
|
||||||
|
jsonObject1.put("value",jsonArray1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel",rel);
|
||||||
|
filter.put("cond",cond);
|
||||||
|
jsonObject.put("filter",filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
|
||||||
|
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
String A = "";
|
||||||
|
for (Object O : jsonArray2){
|
||||||
|
JSONObject test = (JSONObject) O;
|
||||||
|
A = test.getString("id_card");
|
||||||
|
}
|
||||||
|
return A;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String name(String f_user_id ) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id","658bc54678f6daedd0cfa269");
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("id");
|
||||||
|
jsonArray.add("real_name");
|
||||||
|
jsonArray.add("id_card");
|
||||||
|
jsonArray.add("fs_name");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields",jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel","and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field","id");
|
||||||
|
jsonObject1.put("method","eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add(f_user_id);
|
||||||
|
jsonObject1.put("value",jsonArray1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel",rel);
|
||||||
|
filter.put("cond",cond);
|
||||||
|
jsonObject.put("filter",filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
|
||||||
|
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
String A = "";
|
||||||
|
for (Object O : jsonArray2){
|
||||||
|
JSONObject test = (JSONObject) O;
|
||||||
|
A = test.getString("real_name");
|
||||||
|
}
|
||||||
|
return A;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String dp_company(String f_user_id ) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id","658bc54678f6daedd0cfa269");
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("id");
|
||||||
|
jsonArray.add("real_name");
|
||||||
|
jsonArray.add("id_card");
|
||||||
|
jsonArray.add("fs_name");
|
||||||
|
jsonArray.add("dp_company");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields",jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel","and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field","id");
|
||||||
|
jsonObject1.put("method","eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add(f_user_id);
|
||||||
|
jsonObject1.put("value",jsonArray1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel",rel);
|
||||||
|
filter.put("cond",cond);
|
||||||
|
jsonObject.put("filter",filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
|
||||||
|
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
String A = "";
|
||||||
|
for (Object O : jsonArray2){
|
||||||
|
JSONObject test = (JSONObject) O;
|
||||||
|
A = test.getString("dp_company");
|
||||||
|
}
|
||||||
|
return A;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String fs_name(String f_user_id ) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id","658bc54678f6daedd0cfa269");
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("id");
|
||||||
|
jsonArray.add("real_name");
|
||||||
|
jsonArray.add("id_card");
|
||||||
|
|
||||||
|
jsonArray.add("fs_name");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields",jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel","and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field","id");
|
||||||
|
jsonObject1.put("method","eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add(f_user_id);
|
||||||
|
jsonObject1.put("value",jsonArray1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel",rel);
|
||||||
|
filter.put("cond",cond);
|
||||||
|
jsonObject.put("filter",filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
|
||||||
|
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
String A = "";
|
||||||
|
for (Object O : jsonArray2){
|
||||||
|
JSONObject test = (JSONObject) O;
|
||||||
|
A = test.getString("fs_name");
|
||||||
|
}
|
||||||
|
return A;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String _widget_1708503246372(String f_user_id ) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id","658bc54678f6daedd0cfa269");
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("id");
|
||||||
|
jsonArray.add("real_name");
|
||||||
|
jsonArray.add("id_card");
|
||||||
|
jsonArray.add("fs_name");
|
||||||
|
jsonArray.add("_widget_1708503246372");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields",jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel","and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field","id");
|
||||||
|
jsonObject1.put("method","eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add(f_user_id);
|
||||||
|
jsonObject1.put("value",jsonArray1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel",rel);
|
||||||
|
filter.put("cond",cond);
|
||||||
|
jsonObject.put("filter",filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
|
||||||
|
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
String A = "s";
|
||||||
|
for (Object O : jsonArray2){
|
||||||
|
JSONObject test = (JSONObject) O;
|
||||||
|
JSONObject widget1708503246372 = test.getJSONObject("_widget_1708503246372");
|
||||||
|
String jsonString1 = "";
|
||||||
|
if (widget1708503246372 != null) {
|
||||||
|
jsonString1 = widget1708503246372.toJSONString();
|
||||||
|
}
|
||||||
|
A = jsonString1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (A != null && !A.isEmpty()){
|
||||||
|
JSONObject jsonObject3 = JSON.parseObject(A);
|
||||||
|
Integer deptNo = jsonObject3.getInteger("dept_no");
|
||||||
|
A = deptNo.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
return A;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
165
src/main/java/com/example/sso/dao/QianDuan.java
Normal file
165
src/main/java/com/example/sso/dao/QianDuan.java
Normal file
@ -0,0 +1,165 @@
|
|||||||
|
package com.example.sso.dao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
|
||||||
|
public class QianDuan {
|
||||||
|
public static JSONObject i() {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "66c866b2d6520ecd19066bb0");
|
||||||
|
jsonObject.put("entry_id", "66cc5e16d6520ecd1915c3d7");
|
||||||
|
jsonObject.put("limit", 10000);
|
||||||
|
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("xuhao");
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields", jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel", "and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field", "xuhao");
|
||||||
|
jsonObject1.put("method", "not_empty");
|
||||||
|
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel", rel);
|
||||||
|
filter.put("cond", cond);
|
||||||
|
jsonObject.put("filter", filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray1 = jsonObject2.getJSONArray("data");
|
||||||
|
Integer integer = 0;
|
||||||
|
String id = "";
|
||||||
|
for (Object o : jsonArray1) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
integer = test.getInteger("xuhao");
|
||||||
|
id = test.getString("_id");
|
||||||
|
}
|
||||||
|
JSONObject jsonObject3 = new JSONObject();
|
||||||
|
jsonObject3.put("integer", integer);
|
||||||
|
jsonObject3.put("id", id);
|
||||||
|
|
||||||
|
return jsonObject3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Integer max() {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
|
||||||
|
jsonObject.put("app_id", "66c866b2d6520ecd19066bb0");
|
||||||
|
jsonObject.put("entry_id", "6762a23624d61bca7b2920c6");
|
||||||
|
jsonObject.put("limit", 999999);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject1 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray = jsonObject1.getJSONArray("data");
|
||||||
|
int maxId = Integer.MIN_VALUE;
|
||||||
|
|
||||||
|
|
||||||
|
for (Object o : jsonArray) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
Integer currentId = test.getInteger("xuhao");
|
||||||
|
|
||||||
|
if (currentId > maxId) {
|
||||||
|
maxId = currentId;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return maxId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JSONArray fou() {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
|
||||||
|
jsonObject.put("app_id", "66c866b2d6520ecd19066bb0");
|
||||||
|
jsonObject.put("entry_id", "6762a23624d61bca7b2920c6");
|
||||||
|
jsonObject.put("limit", 10000);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
filter.put("rel", "and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject11 = new JSONObject();
|
||||||
|
jsonObject11.put("field", "yeno");
|
||||||
|
jsonObject11.put("method", "eq");
|
||||||
|
JSONArray jsonArray12 = new JSONArray();
|
||||||
|
jsonArray12.add("否");
|
||||||
|
jsonObject11.put("value", jsonArray12);
|
||||||
|
cond.add(jsonObject11);
|
||||||
|
filter.put("cond", cond);
|
||||||
|
jsonObject.put("filter", filter);
|
||||||
|
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject1 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray = jsonObject1.getJSONArray("data");
|
||||||
|
return jsonArray;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JSONArray select(Integer id) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
|
||||||
|
jsonObject.put("app_id", "66c866b2d6520ecd19066bb0");
|
||||||
|
jsonObject.put("entry_id", "6762a23624d61bca7b2920c6");
|
||||||
|
jsonObject.put("limit", 10000);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
filter.put("rel", "and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject11 = new JSONObject();
|
||||||
|
jsonObject11.put("field", "xuhao");
|
||||||
|
jsonObject11.put("method", "eq");
|
||||||
|
JSONArray jsonArray12 = new JSONArray();
|
||||||
|
jsonArray12.add(id);
|
||||||
|
jsonObject11.put("value", jsonArray12);
|
||||||
|
cond.add(jsonObject11);
|
||||||
|
filter.put("cond", cond);
|
||||||
|
jsonObject.put("filter", filter);
|
||||||
|
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject1 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray = jsonObject1.getJSONArray("data");
|
||||||
|
return jsonArray;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void insert(String id, Integer xuhao1,String fsname1, Integer dept) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
|
||||||
|
jsonObject.put("app_id", "66c866b2d6520ecd19066bb0");
|
||||||
|
jsonObject.put("entry_id", "66cc5e16d6520ecd1915c3d7");
|
||||||
|
jsonObject.put("data_id", id);
|
||||||
|
|
||||||
|
JSONObject data = new JSONObject();
|
||||||
|
|
||||||
|
JSONObject xuhao = new JSONObject();
|
||||||
|
xuhao.put("value",xuhao1);
|
||||||
|
data.put("xuhao",xuhao);
|
||||||
|
|
||||||
|
JSONObject fsname = new JSONObject();
|
||||||
|
fsname.put("value",fsname1);
|
||||||
|
data.put("fsname",fsname);
|
||||||
|
|
||||||
|
JSONObject zzfs = new JSONObject();
|
||||||
|
zzfs.put("value",fsname1);
|
||||||
|
data.put("zzfs",zzfs);
|
||||||
|
|
||||||
|
JSONObject fsfzr = new JSONObject();
|
||||||
|
fsfzr.put("value",dept);
|
||||||
|
data.put("fsfzr",fsfzr);
|
||||||
|
|
||||||
|
jsonObject.put("data",data);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
APIUtils.updata(jsonString);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
46
src/main/java/com/example/sso/dao/SelectPerson.java
Normal file
46
src/main/java/com/example/sso/dao/SelectPerson.java
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
package com.example.sso.dao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
|
||||||
|
public class SelectPerson {
|
||||||
|
public static JSONArray array(Integer xuhao) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "66c866b2d6520ecd19066bb0");
|
||||||
|
jsonObject.put("entry_id", "66cebfaa2340ecd8b90e06a1");
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("yxname");
|
||||||
|
jsonArray.add("yxzd");
|
||||||
|
jsonArray.add("xuhao");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields", jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel", "and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field", "xuhao");
|
||||||
|
jsonObject1.put("method", "eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add(xuhao);
|
||||||
|
jsonObject1.put("value", jsonArray1);
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel", rel);
|
||||||
|
filter.put("cond", cond);
|
||||||
|
jsonObject.put("filter", filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
return jsonArray2;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
117
src/main/java/com/example/sso/dao/Test.java
Normal file
117
src/main/java/com/example/sso/dao/Test.java
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
package com.example.sso.dao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
import com.example.sso.util.TimeUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalTime;
|
||||||
|
import java.time.ZoneOffset;
|
||||||
|
import java.util.Calendar;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class Test {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
/*
|
||||||
|
String s = Max.max();
|
||||||
|
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject2.put("entry_id", "658fce1d771e971c5816e475");
|
||||||
|
jsonObject2.put("limit", 999999);
|
||||||
|
JSONArray fields = new JSONArray();
|
||||||
|
fields.add("sid");
|
||||||
|
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
filter.put("rel", "and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject jsonObject3 = new JSONObject();
|
||||||
|
jsonObject3.put("field","sid");
|
||||||
|
jsonObject3.put("method","eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add(s);
|
||||||
|
jsonObject3.put("value",jsonArray1);
|
||||||
|
cond.add(jsonObject3);
|
||||||
|
filter.put("cond",cond);
|
||||||
|
jsonObject2.put("filter", filter);
|
||||||
|
jsonObject2.put("fields", fields);
|
||||||
|
|
||||||
|
String jsonString1 = jsonObject2.toJSONString();
|
||||||
|
String select1 = APIUtils.select(jsonString1);
|
||||||
|
JSONObject jsonObject4 = JSON.parseObject(select1);
|
||||||
|
|
||||||
|
log.info("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"+select1);*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* LocalDate currentDate = LocalDate.now();
|
||||||
|
String string = currentDate.toString();
|
||||||
|
// 输出当前日期
|
||||||
|
System.out.println( string);*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
String fUserId = "1301";
|
||||||
|
String createTimes = "2024-04-15";
|
||||||
|
|
||||||
|
|
||||||
|
JSONArray con = CountBiao.con();
|
||||||
|
for (Object o : con) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
System.out.println(test);
|
||||||
|
String id = test.getString("id");
|
||||||
|
String day = TimeUtil.day();
|
||||||
|
Long a = test.getLong("a");
|
||||||
|
String id1 = test.getString("_id");
|
||||||
|
|
||||||
|
if (fUserId.equals(id) && day.equals(createTimes)) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id", "661c8b33a33a34d4ebb211b0");
|
||||||
|
jsonObject.put("data_id", id1);
|
||||||
|
JSONObject A = new JSONObject();
|
||||||
|
JSONObject a1 = new JSONObject();
|
||||||
|
a1.put("value", a + 1);
|
||||||
|
A.put("a", a1);
|
||||||
|
jsonObject.put("data", A);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String updata = APIUtils.updata(jsonString);
|
||||||
|
log.info(updata);
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 0); // 将小时设置为0
|
||||||
|
calendar.set(Calendar.MINUTE, 0); // 将分钟设置为0
|
||||||
|
calendar.set(Calendar.SECOND, 0); // 将秒设置为0
|
||||||
|
calendar.set(Calendar.MILLISECOND, 0); // 将毫秒设置为0
|
||||||
|
|
||||||
|
// 获取当天0点的时间戳(毫秒)
|
||||||
|
long timestamp = calendar.getTimeInMillis();
|
||||||
|
System.out.println(timestamp);
|
||||||
|
|
||||||
|
/* Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.add(Calendar.DAY_OF_MONTH, 1); // 将日期增加1天,即获取明天的日期
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 0); // 将小时设置为0
|
||||||
|
calendar.set(Calendar.MINUTE, 0); // 将分钟设置为0
|
||||||
|
calendar.set(Calendar.SECOND, 0); // 将秒设置为0
|
||||||
|
calendar.set(Calendar.MILLISECOND, 0); // 将毫秒设置为0
|
||||||
|
|
||||||
|
// 获取明天0点的时间戳(毫秒)
|
||||||
|
long timestamp = calendar.getTimeInMillis();
|
||||||
|
|
||||||
|
// 输出时间戳
|
||||||
|
System.out.println("明天0点时间戳(毫秒):" + timestamp);*/
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
126
src/main/java/com/example/sso/dao/ThreeCount.java
Normal file
126
src/main/java/com/example/sso/dao/ThreeCount.java
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
package com.example.sso.dao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
|
||||||
|
public class ThreeCount {
|
||||||
|
public static String realename(String f_user_idS) {
|
||||||
|
JSONObject jsonObject22 = new JSONObject();
|
||||||
|
jsonObject22.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject22.put("entry_id", "658bc54678f6daedd0cfa269");
|
||||||
|
JSONArray jsonArray22 = new JSONArray();
|
||||||
|
jsonArray22.add("id");
|
||||||
|
jsonArray22.add("nick_name");
|
||||||
|
jsonArray22.add("real_name");
|
||||||
|
jsonArray22.add("type");
|
||||||
|
jsonArray22.add("f_user_id");
|
||||||
|
jsonArray22.add("is_sign");
|
||||||
|
jsonArray22.add("fs_name");
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject22.put("fields", jsonArray22);
|
||||||
|
JSONObject filter22 = new JSONObject();
|
||||||
|
JSONObject rel22 = new JSONObject();
|
||||||
|
rel22.put("rel", "and");
|
||||||
|
JSONArray cond22 = new JSONArray();
|
||||||
|
JSONObject jsonObject12 = new JSONObject();
|
||||||
|
jsonObject12.put("field", "id");
|
||||||
|
jsonObject12.put("method", "eq");
|
||||||
|
JSONArray jsonArray12 = new JSONArray();
|
||||||
|
jsonArray12.add(f_user_idS);
|
||||||
|
jsonObject12.put("value", jsonArray12);
|
||||||
|
cond22.add(jsonObject12);
|
||||||
|
filter22.put("rel", rel22);
|
||||||
|
filter22.put("cond", cond22);
|
||||||
|
jsonObject22.put("filter", filter22);
|
||||||
|
|
||||||
|
String jsonString14 = jsonObject22.toJSONString();
|
||||||
|
|
||||||
|
String select15 = APIUtils.select(jsonString14);
|
||||||
|
JSONObject jsonObject16 = JSON.parseObject(select15);
|
||||||
|
JSONArray jsonArray17 = jsonObject16.getJSONArray("data");
|
||||||
|
|
||||||
|
////////////////
|
||||||
|
String realName18 = "";
|
||||||
|
String nickName18 = "";
|
||||||
|
String type18 = "";
|
||||||
|
String isSign18 = "";
|
||||||
|
String f_user_ida = "";
|
||||||
|
String maxa = Max.max();
|
||||||
|
String fs_namea = "";
|
||||||
|
for (Object o : jsonArray17) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
realName18 = test.getString("real_name");
|
||||||
|
nickName18 = test.getString("nick_name");
|
||||||
|
type18 = test.getString("type");
|
||||||
|
isSign18 = test.getString("is_sign");
|
||||||
|
f_user_ida = test.getString("f_user_id");
|
||||||
|
fs_namea = test.getString("fs_name");
|
||||||
|
|
||||||
|
}
|
||||||
|
return realName18;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String fsname(String f_user_idS) {
|
||||||
|
JSONObject jsonObject22 = new JSONObject();
|
||||||
|
jsonObject22.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject22.put("entry_id", "658bc54678f6daedd0cfa269");
|
||||||
|
JSONArray jsonArray22 = new JSONArray();
|
||||||
|
jsonArray22.add("id");
|
||||||
|
jsonArray22.add("nick_name");
|
||||||
|
jsonArray22.add("real_name");
|
||||||
|
jsonArray22.add("type");
|
||||||
|
jsonArray22.add("f_user_id");
|
||||||
|
jsonArray22.add("is_sign");
|
||||||
|
jsonArray22.add("fs_name");
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject22.put("fields", jsonArray22);
|
||||||
|
JSONObject filter22 = new JSONObject();
|
||||||
|
JSONObject rel22 = new JSONObject();
|
||||||
|
rel22.put("rel", "and");
|
||||||
|
JSONArray cond22 = new JSONArray();
|
||||||
|
JSONObject jsonObject12 = new JSONObject();
|
||||||
|
jsonObject12.put("field", "id");
|
||||||
|
jsonObject12.put("method", "eq");
|
||||||
|
JSONArray jsonArray12 = new JSONArray();
|
||||||
|
jsonArray12.add(f_user_idS);
|
||||||
|
jsonObject12.put("value", jsonArray12);
|
||||||
|
cond22.add(jsonObject12);
|
||||||
|
filter22.put("rel", rel22);
|
||||||
|
filter22.put("cond", cond22);
|
||||||
|
jsonObject22.put("filter", filter22);
|
||||||
|
|
||||||
|
String jsonString14 = jsonObject22.toJSONString();
|
||||||
|
|
||||||
|
String select15 = APIUtils.select(jsonString14);
|
||||||
|
JSONObject jsonObject16 = JSON.parseObject(select15);
|
||||||
|
JSONArray jsonArray17 = jsonObject16.getJSONArray("data");
|
||||||
|
|
||||||
|
////////////////
|
||||||
|
String realName18 = "";
|
||||||
|
String nickName18 = "";
|
||||||
|
String type18 = "";
|
||||||
|
String isSign18 = "";
|
||||||
|
String f_user_ida = "";
|
||||||
|
String maxa = Max.max();
|
||||||
|
String fs_namea = "";
|
||||||
|
for (Object o : jsonArray17) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
realName18 = test.getString("real_name");
|
||||||
|
nickName18 = test.getString("nick_name");
|
||||||
|
type18 = test.getString("type");
|
||||||
|
isSign18 = test.getString("is_sign");
|
||||||
|
f_user_ida = test.getString("f_user_id");
|
||||||
|
fs_namea = test.getString("fs_name");
|
||||||
|
|
||||||
|
}
|
||||||
|
return fs_namea;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
51
src/main/java/com/example/sso/dao/ThreeOne.java
Normal file
51
src/main/java/com/example/sso/dao/ThreeOne.java
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
package com.example.sso.dao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
|
||||||
|
public class ThreeOne {
|
||||||
|
public static JSONArray array(String sjid) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "66c866b2d6520ecd19066bb0");
|
||||||
|
jsonObject.put("entry_id", "66cebfaa2340ecd8b90e06a1");
|
||||||
|
jsonObject.put("limit", 10000);
|
||||||
|
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("yxname");
|
||||||
|
jsonArray.add("sjid");
|
||||||
|
jsonArray.add("yxzd");
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields", jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel", "and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field", "sjid");
|
||||||
|
jsonObject1.put("method", "eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add(sjid);
|
||||||
|
jsonObject1.put("value", jsonArray1);
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel", rel);
|
||||||
|
filter.put("cond", cond);
|
||||||
|
jsonObject.put("filter", filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
int size = jsonArray2.size();
|
||||||
|
if (size != 0) {
|
||||||
|
|
||||||
|
return jsonArray2;
|
||||||
|
} else {
|
||||||
|
JSONArray jsonArray3 = new JSONArray();
|
||||||
|
return jsonArray3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
50
src/main/java/com/example/sso/dao/ThreeTwo.java
Normal file
50
src/main/java/com/example/sso/dao/ThreeTwo.java
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
package com.example.sso.dao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
|
||||||
|
public class ThreeTwo {
|
||||||
|
public static JSONArray array(String yxbh) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "66c866b2d6520ecd19066bb0");
|
||||||
|
jsonObject.put("entry_id", "66cebfaa2340ecd8b90e06a1");
|
||||||
|
jsonObject.put("limit", 10000);
|
||||||
|
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("yxname");
|
||||||
|
jsonArray.add("yxbh");
|
||||||
|
jsonArray.add("yxzd");
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields", jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel", "and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field", "yxbh");
|
||||||
|
jsonObject1.put("method", "eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add(yxbh);
|
||||||
|
jsonObject1.put("value", jsonArray1);
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel", rel);
|
||||||
|
filter.put("cond", cond);
|
||||||
|
jsonObject.put("filter", filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
int size = jsonArray2.size();
|
||||||
|
if (size != 0) {
|
||||||
|
|
||||||
|
return jsonArray2;
|
||||||
|
} else {
|
||||||
|
JSONArray jsonArray3 = new JSONArray();
|
||||||
|
return jsonArray3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
45
src/main/java/com/example/sso/dao/UpId.java
Normal file
45
src/main/java/com/example/sso/dao/UpId.java
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
package com.example.sso.dao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
|
||||||
|
public class UpId {
|
||||||
|
public static JSONArray mains(String f_user_id) {
|
||||||
|
//String f_user_id = "1440";
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id","658bc54678f6daedd0cfa269");
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("f_user_id");
|
||||||
|
jsonArray.add("real_name");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields",jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel","and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field","id");
|
||||||
|
jsonObject1.put("method","eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add(f_user_id);
|
||||||
|
jsonObject1.put("value",jsonArray1);
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel",rel);
|
||||||
|
filter.put("cond",cond);
|
||||||
|
jsonObject.put("filter",filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
return jsonArray2;
|
||||||
|
}
|
||||||
|
}
|
||||||
138
src/main/java/com/example/sso/dao/UpIdString.java
Normal file
138
src/main/java/com/example/sso/dao/UpIdString.java
Normal file
@ -0,0 +1,138 @@
|
|||||||
|
package com.example.sso.dao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
|
||||||
|
public class UpIdString {
|
||||||
|
public static String ID(String ID) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id","658bc54678f6daedd0cfa269");
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("f_user_id");
|
||||||
|
jsonArray.add("real_name");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields",jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel","and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field","id");
|
||||||
|
jsonObject1.put("method","eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add(ID);
|
||||||
|
jsonObject1.put("value",jsonArray1);
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel",rel);
|
||||||
|
filter.put("cond",cond);
|
||||||
|
jsonObject.put("filter",filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
String s = "";
|
||||||
|
for (Object o : jsonArray2){
|
||||||
|
JSONObject TEST = (JSONObject) o;
|
||||||
|
s = TEST.getString("f_user_id");
|
||||||
|
}
|
||||||
|
System.out.println(s);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void UPDATAFID(String id, String fid) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id","658bc54678f6daedd0cfa269");
|
||||||
|
|
||||||
|
jsonObject.put("data_id",id);
|
||||||
|
JSONObject data = new JSONObject();
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("value",fid);
|
||||||
|
data.put("first_id",jsonObject2);
|
||||||
|
jsonObject.put("data",data);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
APIUtils.updata(jsonString);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void UPDATAFNAME(String id, String fid) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id","658bc54678f6daedd0cfa269");
|
||||||
|
|
||||||
|
jsonObject.put("data_id",id);
|
||||||
|
JSONObject data = new JSONObject();
|
||||||
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
|
jsonObject2.put("value",fid);
|
||||||
|
data.put("fs_member",jsonObject2);
|
||||||
|
jsonObject.put("data",data);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
APIUtils.updata(jsonString);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String _id(String f_user_id ) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id","658bc54678f6daedd0cfa269");
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("id");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields",jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel","and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field","id");
|
||||||
|
jsonObject1.put("method","eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add(f_user_id);
|
||||||
|
jsonObject1.put("value",jsonArray1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel",rel);
|
||||||
|
filter.put("cond",cond);
|
||||||
|
jsonObject.put("filter",filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
|
||||||
|
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
String A = "";
|
||||||
|
for (Object O : jsonArray2){
|
||||||
|
JSONObject test = (JSONObject) O;
|
||||||
|
A = test.getString("_id");
|
||||||
|
}
|
||||||
|
return A;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
81
src/main/java/com/example/sso/dao/XuHaoNoNull.java
Normal file
81
src/main/java/com/example/sso/dao/XuHaoNoNull.java
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
package com.example.sso.dao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
|
||||||
|
public class XuHaoNoNull {
|
||||||
|
public static Integer maxs() {
|
||||||
|
Boolean b = true;
|
||||||
|
String ID = "";
|
||||||
|
|
||||||
|
JSONArray jsonArrayEND = new JSONArray();
|
||||||
|
while (b) {
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "66c866b2d6520ecd19066bb0");
|
||||||
|
jsonObject.put("entry_id", "66ce9d8650722812f7b3cb3a");
|
||||||
|
jsonObject.put("limit", 10000);
|
||||||
|
if (!ID.isEmpty()) {
|
||||||
|
jsonObject.put("data_id", ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("xuhao");
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields", jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel", "and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field", "xuhao");
|
||||||
|
jsonObject1.put("method", "not_empty");
|
||||||
|
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel", rel);
|
||||||
|
filter.put("cond", cond);
|
||||||
|
jsonObject.put("filter", filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray1 = jsonObject2.getJSONArray("data");
|
||||||
|
|
||||||
|
int size = jsonArray1.size();
|
||||||
|
if (size < 10000) {
|
||||||
|
for (Object o : jsonArray1) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
jsonArrayEND.add(test);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
b = false;
|
||||||
|
} else {
|
||||||
|
for (Object o : jsonArray1) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String id = test.getString("_id");
|
||||||
|
|
||||||
|
ID = id;
|
||||||
|
jsonArrayEND.add(test);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Integer num = 0;
|
||||||
|
for (Object o : jsonArrayEND){
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
num = test.getInteger("xuhao");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return num;
|
||||||
|
}
|
||||||
|
}
|
||||||
43
src/main/java/com/example/sso/dao/YingXiaoFs.java
Normal file
43
src/main/java/com/example/sso/dao/YingXiaoFs.java
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
package com.example.sso.dao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
|
||||||
|
public class YingXiaoFs {
|
||||||
|
public static Integer num(String fs) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","66c866b2d6520ecd19066bb0");
|
||||||
|
jsonObject.put("entry_id","66cec00aa7f9d7700cdd9e52");
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("fs");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields",jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel","and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field","fs");
|
||||||
|
jsonObject1.put("method","eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add(fs);
|
||||||
|
jsonObject1.put("value",jsonArray1);
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel",rel);
|
||||||
|
filter.put("cond",cond);
|
||||||
|
jsonObject.put("filter",filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
int size = jsonArray2.size();
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
}
|
||||||
53
src/main/java/com/example/sso/dao/YingXiaoId.java
Normal file
53
src/main/java/com/example/sso/dao/YingXiaoId.java
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
package com.example.sso.dao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.test.J;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
|
||||||
|
public class YingXiaoId {
|
||||||
|
public static JSONArray id(String sjid) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "66c866b2d6520ecd19066bb0");
|
||||||
|
jsonObject.put("entry_id", "66cebfaa2340ecd8b90e06a1");
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("sjid");
|
||||||
|
jsonArray.add("yxname");
|
||||||
|
jsonArray.add("yxzd");
|
||||||
|
jsonArray.add("xuhao");
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields", jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel", "and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field", "sjid");
|
||||||
|
jsonObject1.put("method", "eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add(sjid);
|
||||||
|
jsonObject1.put("value", jsonArray1);
|
||||||
|
|
||||||
|
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel", rel);
|
||||||
|
filter.put("cond", cond);
|
||||||
|
jsonObject.put("filter", filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
int size = jsonArray2.size();
|
||||||
|
if (size != 0) {
|
||||||
|
|
||||||
|
return jsonArray2;
|
||||||
|
|
||||||
|
}
|
||||||
|
JSONArray jsonArray3 = new JSONArray();
|
||||||
|
return jsonArray3;
|
||||||
|
}
|
||||||
|
}
|
||||||
217
src/main/java/com/example/sso/dao/ZhangHu.java
Normal file
217
src/main/java/com/example/sso/dao/ZhangHu.java
Normal file
@ -0,0 +1,217 @@
|
|||||||
|
package com.example.sso.dao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
|
||||||
|
public class ZhangHu {
|
||||||
|
public static JSONArray ziduan(String fuserid) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id","658bc54678f6daedd0cfa269");
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("id");
|
||||||
|
jsonArray.add("real_name");
|
||||||
|
jsonArray.add("id_card");
|
||||||
|
jsonArray.add("nick_name");
|
||||||
|
jsonArray.add("phone");
|
||||||
|
jsonArray.add("is_sign");
|
||||||
|
jsonArray.add("type");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields",jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel","and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field","id");
|
||||||
|
jsonObject1.put("method","eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add(fuserid);
|
||||||
|
jsonObject1.put("value",jsonArray1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel",rel);
|
||||||
|
filter.put("cond",cond);
|
||||||
|
jsonObject.put("filter",filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
|
||||||
|
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
return jsonArray2;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JSONArray ziduanMINGXI(String fuserid) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id","658fd4fa771e971c5816e8da");
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("id");
|
||||||
|
jsonArray.add("real_name");
|
||||||
|
jsonArray.add("id_card");
|
||||||
|
jsonArray.add("nick_name");
|
||||||
|
jsonArray.add("phone");
|
||||||
|
jsonArray.add("is_sign");
|
||||||
|
jsonArray.add("type");
|
||||||
|
jsonArray.add("sum_money");
|
||||||
|
jsonArray.add("no_account_money");
|
||||||
|
jsonArray.add("account_money");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields",jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel","and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field","id");
|
||||||
|
jsonObject1.put("method","eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add(fuserid);
|
||||||
|
jsonObject1.put("value",jsonArray1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel",rel);
|
||||||
|
filter.put("cond",cond);
|
||||||
|
jsonObject.put("filter",filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
|
||||||
|
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
return jsonArray2;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Integer panduan(String fuserid) {
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id","658fd4fa771e971c5816e8da");
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("id");
|
||||||
|
jsonArray.add("real_name");
|
||||||
|
jsonArray.add("id_card");
|
||||||
|
jsonArray.add("nick_name");
|
||||||
|
jsonArray.add("phone");
|
||||||
|
jsonArray.add("is_sign");
|
||||||
|
jsonArray.add("type");
|
||||||
|
jsonArray.add("sum_money");
|
||||||
|
jsonArray.add("no_account_money");
|
||||||
|
jsonArray.add("account_money");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields",jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel","and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field","id");
|
||||||
|
jsonObject1.put("method","eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add(fuserid);
|
||||||
|
jsonObject1.put("value",jsonArray1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel",rel);
|
||||||
|
filter.put("cond",cond);
|
||||||
|
jsonObject.put("filter",filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
|
||||||
|
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
int size = jsonArray2.size();
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static String ID(String fuserid) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id","658fd4fa771e971c5816e8da");
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("id");
|
||||||
|
jsonArray.add("real_name");
|
||||||
|
jsonArray.add("id_card");
|
||||||
|
jsonArray.add("nick_name");
|
||||||
|
jsonArray.add("phone");
|
||||||
|
jsonArray.add("is_sign");
|
||||||
|
jsonArray.add("type");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields",jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel","and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field","id");
|
||||||
|
jsonObject1.put("method","eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add(fuserid);
|
||||||
|
jsonObject1.put("value",jsonArray1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel",rel);
|
||||||
|
filter.put("cond",cond);
|
||||||
|
jsonObject.put("filter",filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
|
||||||
|
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
String s = "";
|
||||||
|
for (Object o : jsonArray2){
|
||||||
|
JSONObject TEST = (JSONObject) o;
|
||||||
|
s = TEST.getString("_id");
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
7
src/main/java/com/example/sso/schedule/Down.java
Normal file
7
src/main/java/com/example/sso/schedule/Down.java
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
package com.example.sso.schedule;
|
||||||
|
|
||||||
|
public class Down {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
109
src/main/java/com/example/sso/schedule/Fdd.java
Normal file
109
src/main/java/com/example/sso/schedule/Fdd.java
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
package com.example.sso.schedule;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.dao.FddId;
|
||||||
|
import com.example.sso.dao.Files;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
import com.example.sso.util.DownUtil;
|
||||||
|
import com.example.sso.util.FDaDaUtil;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class Fdd {
|
||||||
|
@Scheduled(fixedRate = 3600000)
|
||||||
|
public void main11() throws Exception {
|
||||||
|
String saveDir = "/home/fadada/file/";
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id", "661f4363a0c2bbedc4cc9c78");
|
||||||
|
jsonObject.put("limit", 99999999);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
|
||||||
|
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
System.out.println(jsonArray2);
|
||||||
|
|
||||||
|
for (Object o : jsonArray2) {
|
||||||
|
JSONObject TEST = (JSONObject) o;
|
||||||
|
String id = TEST.getString("id");
|
||||||
|
String idFdd = TEST.getString("id_fdd");
|
||||||
|
String id1 = TEST.getString("_id");
|
||||||
|
JSONObject jsonObject3 = new JSONObject();
|
||||||
|
jsonObject3.put("signTaskId", id);
|
||||||
|
String jsonString1 = jsonObject3.toJSONString();
|
||||||
|
String infor = FDaDaUtil.infor(jsonString1);
|
||||||
|
JSONObject jsonObject31 = JSON.parseObject(infor);
|
||||||
|
String s = jsonObject31.getJSONObject("data").getString("signTaskStatus");
|
||||||
|
if (s.equals("task_finished")) {
|
||||||
|
String urls = DownUtil.urls(id);
|
||||||
|
FDaDaUtil.fileUrl(urls, id, saveDir);
|
||||||
|
|
||||||
|
//新增简道云文件准备
|
||||||
|
Map<String, String> test = Files.test();
|
||||||
|
JSONObject object = (JSONObject) JSON.toJSON(test);
|
||||||
|
String transactionid = object.getString("transaction_id"); //transaction_id
|
||||||
|
JSONArray list = object.getJSONArray("token_and_url_list");
|
||||||
|
JSONObject token = new JSONObject();
|
||||||
|
for (int j = 0; j < list.size(); j++) {
|
||||||
|
token = list.getJSONObject(j);
|
||||||
|
|
||||||
|
}
|
||||||
|
String tokens = token.getString("token");//token
|
||||||
|
String keys = APIUtils.keys(id, tokens);
|
||||||
|
|
||||||
|
//新增简道云
|
||||||
|
JSONObject test11 = new JSONObject(); //最外层
|
||||||
|
test11.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
test11.put("entry_id", "658bc54678f6daedd0cfa269");
|
||||||
|
test11.put("transaction_id", transactionid);
|
||||||
|
test11.put("is_start_trigger", true);
|
||||||
|
String id2 = FddId.id(idFdd);
|
||||||
|
test11.put("data_id", id2);
|
||||||
|
|
||||||
|
JSONObject jsonObjectdata = new JSONObject(); //data层
|
||||||
|
|
||||||
|
JSONObject ht = new JSONObject(); //文件
|
||||||
|
JSONArray hts = new JSONArray();
|
||||||
|
hts.add(keys);
|
||||||
|
ht.put("value", hts);
|
||||||
|
|
||||||
|
JSONObject htqianshu = new JSONObject(); //文件
|
||||||
|
htqianshu.put("value", "签署完成");
|
||||||
|
|
||||||
|
|
||||||
|
jsonObjectdata.put("sign_url", ht);
|
||||||
|
jsonObjectdata.put("is_sign", htqianshu);
|
||||||
|
test11.put("data", jsonObjectdata);
|
||||||
|
String jsonString11 = test11.toJSONString();
|
||||||
|
|
||||||
|
String add = APIUtils.updata(jsonString11);
|
||||||
|
System.out.println(add);
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject jsonObject11 = new JSONObject();
|
||||||
|
jsonObject11.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject11.put("entry_id", "661f4363a0c2bbedc4cc9c78");
|
||||||
|
jsonObject11.put("data_id", id1);
|
||||||
|
|
||||||
|
String jsonString111 = jsonObject11.toJSONString();
|
||||||
|
String delete = APIUtils.delete(jsonString111);
|
||||||
|
|
||||||
|
|
||||||
|
System.out.println(delete);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
87
src/main/java/com/example/sso/schedule/UpdataCount.java
Normal file
87
src/main/java/com/example/sso/schedule/UpdataCount.java
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
package com.example.sso.schedule;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.dao.CountBiao;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class UpdataCount {
|
||||||
|
@Scheduled(cron = "0 0 1 * * ?")
|
||||||
|
|
||||||
|
public void maina() {
|
||||||
|
JSONArray con = CountBiao.con();
|
||||||
|
for (Object o : con) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String id = test.getString("id");
|
||||||
|
String id1 = test.getString("_id");
|
||||||
|
|
||||||
|
Integer e = test.getInteger("e");
|
||||||
|
Integer f = test.getInteger("f");
|
||||||
|
Integer g = test.getInteger("g");
|
||||||
|
Integer h = test.getInteger("h");
|
||||||
|
Integer a = test.getInteger("a");
|
||||||
|
Integer b = test.getInteger("b");
|
||||||
|
Integer c = test.getInteger("c");
|
||||||
|
Integer d = test.getInteger("d");
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id", "661c8b33a33a34d4ebb211b0");
|
||||||
|
jsonObject.put("data_id", id1);
|
||||||
|
JSONObject data = new JSONObject();
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject A1 = new JSONObject();
|
||||||
|
A1.put("value", 0);
|
||||||
|
data.put("a", A1);
|
||||||
|
|
||||||
|
JSONObject B1 = new JSONObject();
|
||||||
|
B1.put("value", 0);
|
||||||
|
data.put("b", B1);
|
||||||
|
|
||||||
|
JSONObject C1 = new JSONObject();
|
||||||
|
C1.put("value", 0);
|
||||||
|
data.put("c", C1);
|
||||||
|
|
||||||
|
JSONObject D1 = new JSONObject();
|
||||||
|
D1.put("value", 0);
|
||||||
|
data.put("d", D1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject H1 = new JSONObject();
|
||||||
|
H1.put("value", d);
|
||||||
|
data.put("h", H1);
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject G1 = new JSONObject();
|
||||||
|
G1.put("value", c);
|
||||||
|
data.put("g", G1);
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject F1 = new JSONObject();
|
||||||
|
F1.put("value", b);
|
||||||
|
data.put("f", F1);
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject E1 = new JSONObject();
|
||||||
|
E1.put("value", a);
|
||||||
|
data.put("e", E1);
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("data", data);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
|
||||||
|
String updata = APIUtils.updata(jsonString);
|
||||||
|
log.info(updata);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
44
src/main/java/com/example/sso/service/SSOService.java
Normal file
44
src/main/java/com/example/sso/service/SSOService.java
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
package com.example.sso.service;
|
||||||
|
|
||||||
|
import com.auth0.jwt.JWT;
|
||||||
|
import com.auth0.jwt.JWTVerifier;
|
||||||
|
import com.auth0.jwt.algorithms.Algorithm;
|
||||||
|
import com.auth0.jwt.interfaces.DecodedJWT;
|
||||||
|
import com.example.sso.config.SSOConfig;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class SSOService {
|
||||||
|
@Getter @Setter @Autowired private SSOConfig ssoConfig;
|
||||||
|
|
||||||
|
public String getResponse(String request,String username) {
|
||||||
|
Algorithm algorithm = Algorithm.HMAC256("");
|
||||||
|
JWTVerifier verifier = JWT.require(algorithm)
|
||||||
|
.withIssuer("com.jiandaoyun")
|
||||||
|
.build();
|
||||||
|
// DecodedJWT decoded = verifier.verify(request);
|
||||||
|
// if (!"sso_req".equals(decoded.getClaim("type").asString())) {
|
||||||
|
// return "";
|
||||||
|
// }
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(new Date());
|
||||||
|
calendar.add(Calendar.HOUR_OF_DAY, 1);
|
||||||
|
return JWT.create()
|
||||||
|
.withIssuer("com.jiandaoyun")
|
||||||
|
.withClaim("type", "sso_res")
|
||||||
|
.withClaim("username", username)
|
||||||
|
.withAudience("com.jiandaoyun")
|
||||||
|
.withExpiresAt(calendar.getTime())
|
||||||
|
.sign(algorithm);
|
||||||
|
}
|
||||||
|
}
|
||||||
807
src/main/java/com/example/sso/test/A.java
Normal file
807
src/main/java/com/example/sso/test/A.java
Normal file
@ -0,0 +1,807 @@
|
|||||||
|
package com.example.sso.test;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.dao.*;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
import com.example.sso.util.TimeUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.text.ParseException;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class A {
|
||||||
|
public static void main(String[] args) throws ParseException {
|
||||||
|
String id = "100001915";
|
||||||
|
String timeConversionS = "2024-04-14T16:00:00.000Z";
|
||||||
|
String timeConversion = TimeUtil.timeConversions(timeConversionS);
|
||||||
|
String hetongbianhao = "HT-240400120";
|
||||||
|
String widget1704356902052 = "京BDB5119";
|
||||||
|
String j = "sdas";
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id", "658bc54678f6daedd0cfa269");
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("id");
|
||||||
|
jsonArray.add("nick_name");
|
||||||
|
jsonArray.add("real_name");
|
||||||
|
jsonArray.add("type");
|
||||||
|
jsonArray.add("f_user_id");
|
||||||
|
jsonArray.add("is_sign");
|
||||||
|
jsonArray.add("fs_name");
|
||||||
|
jsonArray.add("id_card");
|
||||||
|
|
||||||
|
jsonObject.put("fields", jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel", "and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field", "id");
|
||||||
|
jsonObject1.put("method", "eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add(id);
|
||||||
|
jsonObject1.put("value", jsonArray1);
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel", rel);
|
||||||
|
filter.put("cond", cond);
|
||||||
|
jsonObject.put("filter", filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
|
||||||
|
////////////////
|
||||||
|
String realNameone = "";
|
||||||
|
String nickName = "";
|
||||||
|
String type = "";
|
||||||
|
String isSign = "";
|
||||||
|
String f_user_id = "";
|
||||||
|
String max = Max.max();
|
||||||
|
String fs_name = "";
|
||||||
|
String fs_p1 = "";
|
||||||
|
String id_cards = "";
|
||||||
|
|
||||||
|
|
||||||
|
for (Object o : jsonArray2) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
realNameone = test.getString("real_name");
|
||||||
|
nickName = test.getString("nick_name");
|
||||||
|
type = test.getString("type");
|
||||||
|
isSign = test.getString("is_sign");
|
||||||
|
f_user_id = test.getString("f_user_id");
|
||||||
|
fs_name = test.getString("fs_name");
|
||||||
|
fs_name = test.getString("id_cards");
|
||||||
|
|
||||||
|
JSONObject widget1708503246372 = test.getJSONObject("_widget_1708503246372");
|
||||||
|
if (widget1708503246372 != null) {
|
||||||
|
fs_p1 = widget1708503246372.getString("name");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONArray mains = UpId.mains(f_user_id);
|
||||||
|
String f_user_idS = "";
|
||||||
|
/////////////////////////
|
||||||
|
String real_name = "";
|
||||||
|
String id_card3331 = "";
|
||||||
|
for (Object p : mains) {
|
||||||
|
JSONObject test1 = (JSONObject) p;
|
||||||
|
f_user_idS = test1.getString("f_user_id");
|
||||||
|
real_name = test1.getString("real_name");
|
||||||
|
id_card3331 = test1.getString("id_card");
|
||||||
|
}
|
||||||
|
// 奖励1
|
||||||
|
if (!f_user_id.equals("0") && !f_user_id.isEmpty() && f_user_id != null) {
|
||||||
|
JSONObject jiangli = new JSONObject();
|
||||||
|
jiangli.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jiangli.put("entry_id", "6620995ea0c2bbedc4d3562c");
|
||||||
|
JSONObject data = new JSONObject();
|
||||||
|
JSONObject sid1 = new JSONObject();
|
||||||
|
JSONObject user_id1 = new JSONObject();
|
||||||
|
JSONObject nick_name1 = new JSONObject();
|
||||||
|
JSONObject real_name1 = new JSONObject();
|
||||||
|
JSONObject type1 = new JSONObject();
|
||||||
|
JSONObject invite_money = new JSONObject();
|
||||||
|
JSONObject no_account_money = new JSONObject();
|
||||||
|
JSONObject account_money = new JSONObject();
|
||||||
|
JSONObject created_at = new JSONObject();
|
||||||
|
JSONObject enterprise_id = new JSONObject();
|
||||||
|
JSONObject idup = new JSONObject();
|
||||||
|
JSONObject fs_name1 = new JSONObject();
|
||||||
|
JSONObject jjr_real_name = new JSONObject();
|
||||||
|
JSONObject user_money_status = new JSONObject();
|
||||||
|
JSONObject jjr_is_sign = new JSONObject();
|
||||||
|
JSONObject sj_id = new JSONObject();
|
||||||
|
JSONObject sj_real_name = new JSONObject();
|
||||||
|
JSONObject sj_name = new JSONObject();
|
||||||
|
JSONObject invite_level = new JSONObject();
|
||||||
|
|
||||||
|
|
||||||
|
invite_level.put("value", "1");
|
||||||
|
sj_name.put("value", nickName);
|
||||||
|
sj_real_name.put("value", realNameone);
|
||||||
|
sj_id.put("value", id);
|
||||||
|
jjr_is_sign.put("value", isSign);
|
||||||
|
user_money_status.put("value", "未收款");
|
||||||
|
jjr_real_name.put("value", real_name);
|
||||||
|
fs_name1.put("value", fs_name);
|
||||||
|
idup.put("value", f_user_id);
|
||||||
|
enterprise_id.put("value", 0);
|
||||||
|
created_at.put("value", timeConversion);
|
||||||
|
account_money.put("value", 0);
|
||||||
|
no_account_money.put("value", 1000);
|
||||||
|
invite_money.put("value", 1000);
|
||||||
|
type1.put("value", type);
|
||||||
|
real_name1.put("value", realNameone);
|
||||||
|
nick_name1.put("value", nickName);
|
||||||
|
user_id1.put("value", id);
|
||||||
|
sid1.put("value", max);
|
||||||
|
|
||||||
|
|
||||||
|
data.put("sid", sid1);
|
||||||
|
data.put("user_id", user_id1);
|
||||||
|
data.put("nick_name", nick_name1);
|
||||||
|
data.put("real_name", real_name1);
|
||||||
|
data.put("type", type1);
|
||||||
|
data.put("invite_money", invite_money);
|
||||||
|
data.put("no_account_money", no_account_money);
|
||||||
|
data.put("account_money", account_money);
|
||||||
|
data.put("created_at", created_at);
|
||||||
|
data.put("enterprise_id", enterprise_id);
|
||||||
|
data.put("id", idup);
|
||||||
|
data.put("fs_name", fs_name1);
|
||||||
|
data.put("jjr_real_name", jjr_real_name);
|
||||||
|
data.put("user_money_status", user_money_status);
|
||||||
|
data.put("jjr_is_sign", jjr_is_sign);
|
||||||
|
data.put("sj_id", sj_id);
|
||||||
|
data.put("sj_real_name", sj_real_name);
|
||||||
|
data.put("sj_name", sj_name);
|
||||||
|
data.put("invite_level", invite_level);
|
||||||
|
|
||||||
|
jiangli.put("data", data);
|
||||||
|
|
||||||
|
String jsonString1 = jiangli.toJSONString();
|
||||||
|
String insert = APIUtils.insert(jsonString1);
|
||||||
|
log.info("111111111111111111111111111111111111111111111111111111111" + insert);
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject jiangli333 = new JSONObject();
|
||||||
|
jiangli333.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jiangli333.put("entry_id", "660376f8e0f50cf16cd2971a");
|
||||||
|
JSONObject data333 = new JSONObject();
|
||||||
|
JSONObject type333 = new JSONObject();
|
||||||
|
JSONObject name = new JSONObject();
|
||||||
|
JSONObject month = new JSONObject();
|
||||||
|
JSONObject yewubiaodanmingcheng = new JSONObject();
|
||||||
|
JSONObject yewubiaodanbianma = new JSONObject();
|
||||||
|
JSONObject abbreviation = new JSONObject();
|
||||||
|
JSONObject sijixingming = new JSONObject();
|
||||||
|
JSONObject id_card333 = new JSONObject();
|
||||||
|
JSONObject sijisuozaigongsi = new JSONObject();
|
||||||
|
JSONObject fs = new JSONObject();
|
||||||
|
JSONObject fs_p = new JSONObject();
|
||||||
|
JSONObject money = new JSONObject();
|
||||||
|
JSONObject pay = new JSONObject();
|
||||||
|
JSONObject no_money = new JSONObject();
|
||||||
|
JSONObject ys = new JSONObject();
|
||||||
|
JSONObject month1 = new JSONObject();
|
||||||
|
JSONObject _widget_1704356902052 = new JSONObject();
|
||||||
|
JSONObject _widget_1704357037281 = new JSONObject();
|
||||||
|
JSONObject sid111 = new JSONObject();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String xinxi = OneIdcard.XINXI(f_user_id);
|
||||||
|
String name1 = OneIdcard.name(f_user_id);
|
||||||
|
String jsonObject3 = OneIdcard._widget_1708503246372(f_user_id);
|
||||||
|
String dpCompany = OneIdcard.dp_company(f_user_id);
|
||||||
|
String fs_name1111 = OneIdcard.fs_name(f_user_id);
|
||||||
|
type333.put("value", "付款");
|
||||||
|
name.put("value", "邀请奖励");
|
||||||
|
String month2 = TimeUtil.month();
|
||||||
|
month.put("value", month2);
|
||||||
|
yewubiaodanmingcheng.put("value", "承租表单");
|
||||||
|
yewubiaodanbianma.put("value", hetongbianhao);
|
||||||
|
_widget_1704356902052.put("value", widget1704356902052);
|
||||||
|
String hetong = DpJianCheng.hetong(hetongbianhao);
|
||||||
|
abbreviation.put("value", j);
|
||||||
|
sijixingming.put("value", name1);
|
||||||
|
id_card333.put("value", xinxi);
|
||||||
|
sijisuozaigongsi.put("value", dpCompany);
|
||||||
|
fs.put("value", fs_name1111);
|
||||||
|
if (jsonObject3 != null && !jsonObject3.isEmpty() ) {
|
||||||
|
int i = Integer.parseInt(jsonObject3);
|
||||||
|
fs_p.put("value", i);
|
||||||
|
}
|
||||||
|
money.put("value", 1000);
|
||||||
|
pay.put("value", 0);
|
||||||
|
ys.put("value", timeConversion);
|
||||||
|
no_money.put("value", 1000);
|
||||||
|
month1.put("value", month2);
|
||||||
|
_widget_1704357037281.put("value",widget1704356902052);
|
||||||
|
sid111.put("value",max);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
data333.put("type", type333);
|
||||||
|
data333.put("name", name);
|
||||||
|
data333.put("month", month);
|
||||||
|
data333.put("yewubiaodanmingcheng", yewubiaodanmingcheng);
|
||||||
|
data333.put("yewubiaodanbianma", yewubiaodanbianma);
|
||||||
|
data333.put("sijixingming", sijixingming);
|
||||||
|
data333.put("no_account_money", no_account_money);
|
||||||
|
data333.put("id_card", id_card333);
|
||||||
|
data333.put("abbreviation", abbreviation);
|
||||||
|
data333.put("enterprise_id", enterprise_id);
|
||||||
|
data333.put("sijisuozaigongsi", sijisuozaigongsi);
|
||||||
|
data333.put("fs", fs);
|
||||||
|
data333.put("fs_p", fs_p);
|
||||||
|
data333.put("money", money);
|
||||||
|
data333.put("pay", pay);
|
||||||
|
data333.put("no_money", no_money);
|
||||||
|
data333.put("ys", ys);
|
||||||
|
data333.put("month1", month1);
|
||||||
|
data333.put("_widget_1704357037281", _widget_1704356902052);
|
||||||
|
data333.put("sid", sid111);
|
||||||
|
|
||||||
|
|
||||||
|
jiangli333.put("data", data333);
|
||||||
|
|
||||||
|
String jsonString333 = jiangli333.toJSONString();
|
||||||
|
String insert333 = APIUtils.insert(jsonString333);
|
||||||
|
log.info("3333333333333333333333333333333333" + insert333);
|
||||||
|
|
||||||
|
Integer panduan = ZhangHu.panduan(f_user_id);
|
||||||
|
|
||||||
|
if (panduan != 0){
|
||||||
|
String id1 = ZhangHu.ID(f_user_id);
|
||||||
|
JSONArray ziduan = ZhangHu.ziduan(f_user_id);
|
||||||
|
JSONArray ziduanMINGXI = ZhangHu.ziduanMINGXI(f_user_id);
|
||||||
|
String real_name777 = "";
|
||||||
|
String id_card777 = "";
|
||||||
|
String nick_name777 = "";
|
||||||
|
String phone777 = "";
|
||||||
|
String is_sign777 = "";
|
||||||
|
String type777 = "";
|
||||||
|
Integer sum_money777 = 0;
|
||||||
|
Integer no_account_money777 = 0;
|
||||||
|
Integer account_money777 = 0;
|
||||||
|
|
||||||
|
for (Object o : ziduan){
|
||||||
|
JSONObject test7 = (JSONObject) o;
|
||||||
|
real_name777 = test7.getString("real_name");
|
||||||
|
id_card777 = test7.getString("id_card");
|
||||||
|
nick_name777= test7.getString("nick_name");
|
||||||
|
phone777= test7.getString("phone");
|
||||||
|
is_sign777= test7.getString("is_sign");
|
||||||
|
type777= test7.getString("type");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Object o : ziduanMINGXI){
|
||||||
|
JSONObject test7 = (JSONObject) o;
|
||||||
|
sum_money777 = test7.getInteger("sum_money");
|
||||||
|
no_account_money777 = test7.getInteger("no_account_money");
|
||||||
|
account_money777= test7.getInteger("account_money");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject jsonObject4 = new JSONObject();
|
||||||
|
jsonObject4.put("app_id","65815f117de49256b1e67e75");
|
||||||
|
jsonObject4.put("entry_id","662331d1a33a34d4ebd84c48");
|
||||||
|
jsonObject4.put("data_id",id1);
|
||||||
|
JSONObject DATA = new JSONObject();
|
||||||
|
|
||||||
|
JSONObject real_name888 = new JSONObject();
|
||||||
|
JSONObject nick_name888 = new JSONObject();
|
||||||
|
JSONObject type888 = new JSONObject();
|
||||||
|
JSONObject phone888 = new JSONObject();
|
||||||
|
JSONObject sum_money888 = new JSONObject();
|
||||||
|
JSONObject no_account_money888 = new JSONObject();
|
||||||
|
JSONObject account_money888 = new JSONObject();
|
||||||
|
JSONObject _widget_1711967418636 = new JSONObject();
|
||||||
|
JSONObject _widget_1709204953031 = new JSONObject();
|
||||||
|
real_name888.put("value",real_name777);
|
||||||
|
nick_name888.put("value",nick_name777);
|
||||||
|
type888.put("value",type777);
|
||||||
|
phone888.put("value",phone777);
|
||||||
|
sum_money888.put("value",sum_money777+1000);
|
||||||
|
no_account_money888.put("value",no_account_money777+1000);
|
||||||
|
account_money888.put("value",account_money777+0);
|
||||||
|
_widget_1711967418636.put("value",id_card777);
|
||||||
|
_widget_1709204953031.put("value",is_sign777);
|
||||||
|
|
||||||
|
|
||||||
|
DATA.put("sum_money",sum_money888);
|
||||||
|
DATA.put("no_account_money",no_account_money888);
|
||||||
|
DATA.put("account_money",account_money888);
|
||||||
|
|
||||||
|
jsonObject4.put("data",DATA);
|
||||||
|
|
||||||
|
|
||||||
|
String jsonString2 = jsonObject4.toJSONString();
|
||||||
|
String updata = APIUtils.updata(jsonString2);
|
||||||
|
log.info(updata);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (panduan == 0){
|
||||||
|
String id1 = ZhangHu.ID(f_user_id);
|
||||||
|
JSONArray ziduan = ZhangHu.ziduan(f_user_id);
|
||||||
|
JSONArray ziduanMINGXI = ZhangHu.ziduanMINGXI(f_user_id);
|
||||||
|
String real_name777 = "";
|
||||||
|
String id_card777 = "";
|
||||||
|
String nick_name777 = "";
|
||||||
|
String phone777 = "";
|
||||||
|
String is_sign777 = "";
|
||||||
|
String type777 = "";
|
||||||
|
Integer sum_money777 = 0;
|
||||||
|
Integer no_account_money777 = 0;
|
||||||
|
Integer account_money777 = 0;
|
||||||
|
|
||||||
|
for (Object o : ziduan){
|
||||||
|
JSONObject test7 = (JSONObject) o;
|
||||||
|
real_name777 = test7.getString("real_name");
|
||||||
|
id_card777 = test7.getString("id_card");
|
||||||
|
nick_name777= test7.getString("nick_name");
|
||||||
|
phone777= test7.getString("phone");
|
||||||
|
is_sign777= test7.getString("is_sign");
|
||||||
|
type777= test7.getString("type");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Object o : ziduanMINGXI){
|
||||||
|
JSONObject test7 = (JSONObject) o;
|
||||||
|
sum_money777 = test7.getInteger("sum_money");
|
||||||
|
no_account_money777 = test7.getInteger("no_account_money");
|
||||||
|
account_money777= test7.getInteger("account_money");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject jsonObject4 = new JSONObject();
|
||||||
|
jsonObject4.put("app_id","65815f117de49256b1e67e75");
|
||||||
|
jsonObject4.put("entry_id","662331d1a33a34d4ebd84c48");
|
||||||
|
|
||||||
|
JSONObject DATA = new JSONObject();
|
||||||
|
|
||||||
|
JSONObject real_name888 = new JSONObject();
|
||||||
|
JSONObject nick_name888 = new JSONObject();
|
||||||
|
JSONObject type888 = new JSONObject();
|
||||||
|
JSONObject phone888 = new JSONObject();
|
||||||
|
JSONObject sum_money888 = new JSONObject();
|
||||||
|
JSONObject no_account_money888 = new JSONObject();
|
||||||
|
JSONObject account_money888 = new JSONObject();
|
||||||
|
JSONObject _widget_1711967418636 = new JSONObject();
|
||||||
|
JSONObject _widget_1709204953031 = new JSONObject();
|
||||||
|
real_name888.put("value",real_name777);
|
||||||
|
nick_name888.put("value",nick_name777);
|
||||||
|
type888.put("value",type777);
|
||||||
|
phone888.put("value",phone777);
|
||||||
|
sum_money888.put("value",1000);
|
||||||
|
no_account_money888.put("value",1000);
|
||||||
|
account_money888.put("value",0);
|
||||||
|
_widget_1711967418636.put("value",id_card777);
|
||||||
|
_widget_1709204953031.put("value",is_sign777);
|
||||||
|
|
||||||
|
DATA.put("real_name",real_name888);
|
||||||
|
DATA.put("nick_name",nick_name888);
|
||||||
|
DATA.put("type",type888);
|
||||||
|
DATA.put("phone",phone888);
|
||||||
|
DATA.put("sum_money",sum_money888);
|
||||||
|
DATA.put("no_account_money",no_account_money888);
|
||||||
|
DATA.put("account_money",account_money888);
|
||||||
|
DATA.put("_widget_1711967418636",_widget_1711967418636);
|
||||||
|
DATA.put("_widget_1709204953031",_widget_1709204953031);
|
||||||
|
jsonObject4.put("data",DATA);
|
||||||
|
|
||||||
|
|
||||||
|
String jsonString2 = jsonObject4.toJSONString();
|
||||||
|
String updata = APIUtils.insert(jsonString2);
|
||||||
|
log.info(updata);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
// 奖励2
|
||||||
|
if (!f_user_idS.equals("0") && !f_user_idS.isEmpty() && f_user_idS != null) {
|
||||||
|
|
||||||
|
JSONObject jsonObject22 = new JSONObject();
|
||||||
|
jsonObject22.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject22.put("entry_id", "658bc54678f6daedd0cfa269");
|
||||||
|
JSONArray jsonArray22 = new JSONArray();
|
||||||
|
jsonArray22.add("id");
|
||||||
|
jsonArray22.add("nick_name");
|
||||||
|
jsonArray22.add("real_name");
|
||||||
|
jsonArray22.add("type");
|
||||||
|
jsonArray22.add("f_user_id");
|
||||||
|
jsonArray22.add("is_sign");
|
||||||
|
jsonArray22.add("fs_name");
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject22.put("fields", jsonArray22);
|
||||||
|
JSONObject filter22 = new JSONObject();
|
||||||
|
JSONObject rel22 = new JSONObject();
|
||||||
|
rel22.put("rel", "and");
|
||||||
|
JSONArray cond22 = new JSONArray();
|
||||||
|
JSONObject jsonObject12 = new JSONObject();
|
||||||
|
jsonObject12.put("field", "id");
|
||||||
|
jsonObject12.put("method", "eq");
|
||||||
|
JSONArray jsonArray12 = new JSONArray();
|
||||||
|
jsonArray12.add(f_user_id);
|
||||||
|
jsonObject12.put("value", jsonArray12);
|
||||||
|
cond22.add(jsonObject12);
|
||||||
|
filter22.put("rel", rel22);
|
||||||
|
filter22.put("cond", cond22);
|
||||||
|
jsonObject22.put("filter", filter22);
|
||||||
|
|
||||||
|
String jsonString14 = jsonObject22.toJSONString();
|
||||||
|
|
||||||
|
String select15 = APIUtils.select(jsonString14);
|
||||||
|
JSONObject jsonObject16 = JSON.parseObject(select15);
|
||||||
|
JSONArray jsonArray17 = jsonObject16.getJSONArray("data");
|
||||||
|
|
||||||
|
////////////////
|
||||||
|
String realName18 = "";
|
||||||
|
String nickName18 = "";
|
||||||
|
String type18 = "";
|
||||||
|
String isSign18 = "";
|
||||||
|
String f_user_ida = "";
|
||||||
|
String maxa = Max.max();
|
||||||
|
String fs_namea = "";
|
||||||
|
for (Object o : jsonArray17) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
realName18 = test.getString("real_name");
|
||||||
|
nickName18 = test.getString("nick_name");
|
||||||
|
type18 = test.getString("type");
|
||||||
|
isSign18 = test.getString("is_sign");
|
||||||
|
f_user_ida = test.getString("f_user_id");
|
||||||
|
fs_namea = test.getString("fs_name");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 类似奖励1
|
||||||
|
|
||||||
|
JSONObject jiangli = new JSONObject();
|
||||||
|
jiangli.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jiangli.put("entry_id", "6620995ea0c2bbedc4d3562c");
|
||||||
|
JSONObject data = new JSONObject();
|
||||||
|
JSONObject sid1 = new JSONObject();
|
||||||
|
JSONObject user_id1 = new JSONObject();
|
||||||
|
JSONObject nick_name1 = new JSONObject();
|
||||||
|
JSONObject real_name1 = new JSONObject();
|
||||||
|
JSONObject type1 = new JSONObject();
|
||||||
|
JSONObject invite_money = new JSONObject();
|
||||||
|
JSONObject no_account_money = new JSONObject();
|
||||||
|
JSONObject account_money = new JSONObject();
|
||||||
|
JSONObject created_at = new JSONObject();
|
||||||
|
JSONObject enterprise_id = new JSONObject();
|
||||||
|
JSONObject idup = new JSONObject();
|
||||||
|
JSONObject fs_name1 = new JSONObject();
|
||||||
|
JSONObject jjr_real_name = new JSONObject();
|
||||||
|
JSONObject user_money_status = new JSONObject();
|
||||||
|
JSONObject jjr_is_sign = new JSONObject();
|
||||||
|
JSONObject sj_id = new JSONObject();
|
||||||
|
JSONObject sj_real_name = new JSONObject();
|
||||||
|
JSONObject sj_name = new JSONObject();
|
||||||
|
JSONObject invite_level = new JSONObject();
|
||||||
|
JSONObject remark = new JSONObject();
|
||||||
|
|
||||||
|
|
||||||
|
String realename = ThreeCount.realename(f_user_idS);
|
||||||
|
String fsname = ThreeCount.fsname(f_user_idS);
|
||||||
|
remark.put("value", "邀请上级奖励");
|
||||||
|
invite_level.put("value", "2");
|
||||||
|
sj_name.put("value", nickName);
|
||||||
|
sj_real_name.put("value", realNameone);
|
||||||
|
sj_id.put("value", id);
|
||||||
|
jjr_is_sign.put("value", isSign18);
|
||||||
|
user_money_status.put("value", "未收款");
|
||||||
|
jjr_real_name.put("value", realename);
|
||||||
|
fs_name1.put("value", fsname);
|
||||||
|
idup.put("value", f_user_idS);
|
||||||
|
enterprise_id.put("value", 0);
|
||||||
|
created_at.put("value", timeConversion);
|
||||||
|
account_money.put("value", 0);
|
||||||
|
no_account_money.put("value", 200);
|
||||||
|
invite_money.put("value", 200);
|
||||||
|
type1.put("value", type18);
|
||||||
|
real_name1.put("value", realName18);
|
||||||
|
nick_name1.put("value", nickName18);
|
||||||
|
user_id1.put("value", f_user_id);
|
||||||
|
sid1.put("value", maxa);
|
||||||
|
|
||||||
|
|
||||||
|
data.put("sid", sid1);
|
||||||
|
data.put("user_id", user_id1);
|
||||||
|
data.put("nick_name", nick_name1);
|
||||||
|
data.put("real_name", real_name1);
|
||||||
|
data.put("type", type1);
|
||||||
|
data.put("invite_money", invite_money);
|
||||||
|
data.put("no_account_money", no_account_money);
|
||||||
|
data.put("account_money", account_money);
|
||||||
|
data.put("created_at", created_at);
|
||||||
|
data.put("enterprise_id", enterprise_id);
|
||||||
|
data.put("id", idup);
|
||||||
|
data.put("fs_name", fs_name1);
|
||||||
|
data.put("jjr_real_name", jjr_real_name);
|
||||||
|
data.put("user_money_status", user_money_status);
|
||||||
|
data.put("jjr_is_sign", jjr_is_sign);
|
||||||
|
data.put("sj_id", sj_id);
|
||||||
|
data.put("sj_real_name", sj_real_name);
|
||||||
|
data.put("sj_name", sj_name);
|
||||||
|
data.put("invite_level", invite_level);
|
||||||
|
data.put("remark", remark);
|
||||||
|
|
||||||
|
jiangli.put("data", data);
|
||||||
|
|
||||||
|
String jsonString1 = jiangli.toJSONString();
|
||||||
|
String insert = APIUtils.insert(jsonString1);
|
||||||
|
log.info("1222222222222222222222222222222222222222222222222" + insert);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject jiangli333 = new JSONObject();
|
||||||
|
jiangli333.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jiangli333.put("entry_id", "660376f8e0f50cf16cd2971a");
|
||||||
|
JSONObject data333 = new JSONObject();
|
||||||
|
JSONObject type333 = new JSONObject();
|
||||||
|
JSONObject name = new JSONObject();
|
||||||
|
JSONObject month = new JSONObject();
|
||||||
|
JSONObject yewubiaodanmingcheng = new JSONObject();
|
||||||
|
JSONObject yewubiaodanbianma = new JSONObject();
|
||||||
|
JSONObject abbreviation = new JSONObject();
|
||||||
|
JSONObject sijixingming = new JSONObject();
|
||||||
|
JSONObject id_card333 = new JSONObject();
|
||||||
|
JSONObject sijisuozaigongsi = new JSONObject();
|
||||||
|
JSONObject fs = new JSONObject();
|
||||||
|
JSONObject fs_p = new JSONObject();
|
||||||
|
JSONObject money = new JSONObject();
|
||||||
|
JSONObject pay = new JSONObject();
|
||||||
|
JSONObject no_money = new JSONObject();
|
||||||
|
JSONObject ys = new JSONObject();
|
||||||
|
JSONObject month1 = new JSONObject();
|
||||||
|
JSONObject _widget_1704356902052 = new JSONObject();
|
||||||
|
JSONObject _widget_1704357037281 = new JSONObject();
|
||||||
|
JSONObject sid4444 = new JSONObject();
|
||||||
|
|
||||||
|
String xinxi = OneIdcard.XINXI(f_user_idS);
|
||||||
|
String name1 = OneIdcard.name(f_user_idS);
|
||||||
|
String jsonObject3 = OneIdcard._widget_1708503246372(f_user_idS);
|
||||||
|
String dpCompany = OneIdcard.dp_company(f_user_idS);
|
||||||
|
String fs_name1111 = OneIdcard.fs_name(f_user_idS);
|
||||||
|
type333.put("value", "付款");
|
||||||
|
name.put("value", "邀请上级奖励");
|
||||||
|
String month2 = TimeUtil.month();
|
||||||
|
month.put("value", month2);
|
||||||
|
yewubiaodanmingcheng.put("value", "承租表单");
|
||||||
|
yewubiaodanbianma.put("value", hetongbianhao);
|
||||||
|
_widget_1704356902052.put("value", widget1704356902052);
|
||||||
|
String hetong = DpJianCheng.hetong(hetongbianhao);
|
||||||
|
abbreviation.put("value", j);
|
||||||
|
sijixingming.put("value", name1);
|
||||||
|
id_card333.put("value", xinxi);
|
||||||
|
sijisuozaigongsi.put("value", dpCompany);
|
||||||
|
fs.put("value", fs_name1111);
|
||||||
|
if (jsonObject3 != null && !jsonObject3.isEmpty() ) {
|
||||||
|
int i = Integer.parseInt(jsonObject3);
|
||||||
|
fs_p.put("value", i);
|
||||||
|
}
|
||||||
|
money.put("value", 200);
|
||||||
|
pay.put("value", 0);
|
||||||
|
ys.put("value", timeConversion);
|
||||||
|
no_money.put("value", 200);
|
||||||
|
month1.put("value", month2);
|
||||||
|
_widget_1704357037281.put("value",widget1704356902052);
|
||||||
|
sid4444.put("value",maxa);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
data333.put("type", type333);
|
||||||
|
data333.put("name", name);
|
||||||
|
data333.put("month", month);
|
||||||
|
data333.put("yewubiaodanmingcheng", yewubiaodanmingcheng);
|
||||||
|
data333.put("yewubiaodanbianma", yewubiaodanbianma);
|
||||||
|
data333.put("sijixingming", sijixingming);
|
||||||
|
data333.put("no_account_money", no_account_money);
|
||||||
|
data333.put("id_card", id_card333);
|
||||||
|
data333.put("abbreviation", abbreviation);
|
||||||
|
data333.put("enterprise_id", enterprise_id);
|
||||||
|
data333.put("sijisuozaigongsi", sijisuozaigongsi);
|
||||||
|
data333.put("fs", fs);
|
||||||
|
data333.put("fs_p", fs_p);
|
||||||
|
data333.put("money", money);
|
||||||
|
data333.put("pay", pay);
|
||||||
|
data333.put("no_money", no_money);
|
||||||
|
data333.put("ys", ys);
|
||||||
|
data333.put("month1", month1);
|
||||||
|
data333.put("_widget_1704357037281", _widget_1704356902052);
|
||||||
|
data333.put("sid", sid4444);
|
||||||
|
|
||||||
|
|
||||||
|
jiangli333.put("data", data333);
|
||||||
|
|
||||||
|
String jsonString333 = jiangli333.toJSONString();
|
||||||
|
String insert333 = APIUtils.insert(jsonString333);
|
||||||
|
log.info("3333333333333333333333333333333333" + insert333);
|
||||||
|
|
||||||
|
|
||||||
|
Integer panduan = ZhangHu.panduan(f_user_idS);
|
||||||
|
|
||||||
|
if (panduan != 0){
|
||||||
|
String id1 = ZhangHu.ID(f_user_idS);
|
||||||
|
JSONArray ziduan = ZhangHu.ziduan(f_user_idS);
|
||||||
|
JSONArray ziduanMINGXI = ZhangHu.ziduanMINGXI(f_user_idS);
|
||||||
|
String real_name777 = "";
|
||||||
|
String id_card777 = "";
|
||||||
|
String nick_name777 = "";
|
||||||
|
String phone777 = "";
|
||||||
|
String is_sign777 = "";
|
||||||
|
String type777 = "";
|
||||||
|
Integer sum_money777 = 0;
|
||||||
|
Integer no_account_money777 = 0;
|
||||||
|
Integer account_money777 = 0;
|
||||||
|
|
||||||
|
for (Object o : ziduan){
|
||||||
|
JSONObject test7 = (JSONObject) o;
|
||||||
|
real_name777 = test7.getString("real_name");
|
||||||
|
id_card777 = test7.getString("id_card");
|
||||||
|
nick_name777= test7.getString("nick_name");
|
||||||
|
phone777= test7.getString("phone");
|
||||||
|
is_sign777= test7.getString("is_sign");
|
||||||
|
type777= test7.getString("type");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Object o : ziduanMINGXI){
|
||||||
|
JSONObject test7 = (JSONObject) o;
|
||||||
|
sum_money777 = test7.getInteger("sum_money");
|
||||||
|
no_account_money777 = test7.getInteger("no_account_money");
|
||||||
|
account_money777= test7.getInteger("account_money");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject jsonObject4 = new JSONObject();
|
||||||
|
jsonObject4.put("app_id","65815f117de49256b1e67e75");
|
||||||
|
jsonObject4.put("entry_id","662331d1a33a34d4ebd84c48");
|
||||||
|
jsonObject4.put("data_id",id1);
|
||||||
|
JSONObject DATA = new JSONObject();
|
||||||
|
|
||||||
|
JSONObject real_name888 = new JSONObject();
|
||||||
|
JSONObject nick_name888 = new JSONObject();
|
||||||
|
JSONObject type888 = new JSONObject();
|
||||||
|
JSONObject phone888 = new JSONObject();
|
||||||
|
JSONObject sum_money888 = new JSONObject();
|
||||||
|
JSONObject no_account_money888 = new JSONObject();
|
||||||
|
JSONObject account_money888 = new JSONObject();
|
||||||
|
JSONObject _widget_1711967418636 = new JSONObject();
|
||||||
|
JSONObject _widget_1709204953031 = new JSONObject();
|
||||||
|
real_name888.put("value",real_name777);
|
||||||
|
nick_name888.put("value",nick_name777);
|
||||||
|
type888.put("value",type777);
|
||||||
|
phone888.put("value",phone777);
|
||||||
|
sum_money888.put("value",sum_money777+1000);
|
||||||
|
no_account_money888.put("value",no_account_money777+1000);
|
||||||
|
account_money888.put("value",account_money777+0);
|
||||||
|
_widget_1711967418636.put("value",id_card777);
|
||||||
|
_widget_1709204953031.put("value",is_sign777);
|
||||||
|
|
||||||
|
|
||||||
|
DATA.put("sum_money",sum_money888);
|
||||||
|
DATA.put("no_account_money",no_account_money888);
|
||||||
|
DATA.put("account_money",account_money888);
|
||||||
|
|
||||||
|
jsonObject4.put("data",DATA);
|
||||||
|
|
||||||
|
|
||||||
|
String jsonString2 = jsonObject4.toJSONString();
|
||||||
|
String updata = APIUtils.updata(jsonString2);
|
||||||
|
log.info(updata);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (panduan == 0){
|
||||||
|
String id1 = ZhangHu.ID(f_user_idS);
|
||||||
|
JSONArray ziduan = ZhangHu.ziduan(f_user_idS);
|
||||||
|
JSONArray ziduanMINGXI = ZhangHu.ziduanMINGXI(f_user_idS);
|
||||||
|
String real_name777 = "";
|
||||||
|
String id_card777 = "";
|
||||||
|
String nick_name777 = "";
|
||||||
|
String phone777 = "";
|
||||||
|
String is_sign777 = "";
|
||||||
|
String type777 = "";
|
||||||
|
Integer sum_money777 = 0;
|
||||||
|
Integer no_account_money777 = 0;
|
||||||
|
Integer account_money777 = 0;
|
||||||
|
|
||||||
|
for (Object o : ziduan){
|
||||||
|
JSONObject test7 = (JSONObject) o;
|
||||||
|
real_name777 = test7.getString("real_name");
|
||||||
|
id_card777 = test7.getString("id_card");
|
||||||
|
nick_name777= test7.getString("nick_name");
|
||||||
|
phone777= test7.getString("phone");
|
||||||
|
is_sign777= test7.getString("is_sign");
|
||||||
|
type777= test7.getString("type");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Object o : ziduanMINGXI){
|
||||||
|
JSONObject test7 = (JSONObject) o;
|
||||||
|
sum_money777 = test7.getInteger("sum_money");
|
||||||
|
no_account_money777 = test7.getInteger("no_account_money");
|
||||||
|
account_money777= test7.getInteger("account_money");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject jsonObject4 = new JSONObject();
|
||||||
|
jsonObject4.put("app_id","65815f117de49256b1e67e75");
|
||||||
|
jsonObject4.put("entry_id","662331d1a33a34d4ebd84c48");
|
||||||
|
|
||||||
|
JSONObject DATA = new JSONObject();
|
||||||
|
|
||||||
|
JSONObject real_name888 = new JSONObject();
|
||||||
|
JSONObject nick_name888 = new JSONObject();
|
||||||
|
JSONObject type888 = new JSONObject();
|
||||||
|
JSONObject phone888 = new JSONObject();
|
||||||
|
JSONObject sum_money888 = new JSONObject();
|
||||||
|
JSONObject no_account_money888 = new JSONObject();
|
||||||
|
JSONObject account_money888 = new JSONObject();
|
||||||
|
JSONObject _widget_1711967418636 = new JSONObject();
|
||||||
|
JSONObject _widget_1709204953031 = new JSONObject();
|
||||||
|
real_name888.put("value",real_name777);
|
||||||
|
nick_name888.put("value",nick_name777);
|
||||||
|
type888.put("value",type777);
|
||||||
|
phone888.put("value",phone777);
|
||||||
|
sum_money888.put("value",1000);
|
||||||
|
no_account_money888.put("value",1000);
|
||||||
|
account_money888.put("value",0);
|
||||||
|
_widget_1711967418636.put("value",id_card777);
|
||||||
|
_widget_1709204953031.put("value",is_sign777);
|
||||||
|
|
||||||
|
DATA.put("real_name",real_name888);
|
||||||
|
DATA.put("nick_name",nick_name888);
|
||||||
|
DATA.put("type",type888);
|
||||||
|
DATA.put("phone",phone888);
|
||||||
|
DATA.put("sum_money",sum_money888);
|
||||||
|
DATA.put("no_account_money",no_account_money888);
|
||||||
|
DATA.put("account_money",account_money888);
|
||||||
|
DATA.put("_widget_1711967418636",_widget_1711967418636);
|
||||||
|
DATA.put("_widget_1709204953031",_widget_1709204953031);
|
||||||
|
jsonObject4.put("data",DATA);
|
||||||
|
|
||||||
|
|
||||||
|
String jsonString2 = jsonObject4.toJSONString();
|
||||||
|
String updata = APIUtils.insert(jsonString2);
|
||||||
|
log.info(updata);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
75
src/main/java/com/example/sso/test/B.java
Normal file
75
src/main/java/com/example/sso/test/B.java
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
package com.example.sso.test;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.dao.Max;
|
||||||
|
import com.example.sso.dao.UpId;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.hibernate.validator.internal.util.logging.Log;
|
||||||
|
@Slf4j
|
||||||
|
public class B {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String id = "100001901";
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id","658bc54678f6daedd0cfa269");
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("id");
|
||||||
|
jsonArray.add("nick_name");
|
||||||
|
jsonArray.add("real_name");
|
||||||
|
jsonArray.add("type");
|
||||||
|
jsonArray.add("f_user_id");
|
||||||
|
jsonArray.add("is_sign");
|
||||||
|
|
||||||
|
jsonObject.put("fields",jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel","and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field","id");
|
||||||
|
jsonObject1.put("method","eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add(id);
|
||||||
|
jsonObject1.put("value",jsonArray1);
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel",rel);
|
||||||
|
filter.put("cond",cond);
|
||||||
|
jsonObject.put("filter",filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
|
||||||
|
////////////////
|
||||||
|
String realName ="";
|
||||||
|
String nickName ="";
|
||||||
|
String type ="";
|
||||||
|
String isSign = "";
|
||||||
|
String f_user_id = "";
|
||||||
|
String max = Max.max();
|
||||||
|
for (Object o : jsonArray2){
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
realName = test.getString("real_name");
|
||||||
|
nickName = test.getString("nick_name");
|
||||||
|
type = test.getString("type");
|
||||||
|
isSign = test.getString("is_sign");
|
||||||
|
f_user_id = test.getString("f_user_id");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONArray mains = UpId.mains(f_user_id);
|
||||||
|
String f_user_idS = "";
|
||||||
|
for(Object p : mains){
|
||||||
|
JSONObject test1 = (JSONObject) p;
|
||||||
|
f_user_idS = test1.getString("f_user_id");
|
||||||
|
}
|
||||||
|
log.info(f_user_idS);
|
||||||
|
}
|
||||||
|
}
|
||||||
62
src/main/java/com/example/sso/test/C.java
Normal file
62
src/main/java/com/example/sso/test/C.java
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
package com.example.sso.test;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.dao.QianDuan;
|
||||||
|
import com.example.sso.util.TimeUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.text.ParseException;
|
||||||
|
@Slf4j
|
||||||
|
public class C {
|
||||||
|
public static void main(String[] args) {{
|
||||||
|
JSONObject jsonObject = QianDuan.i();
|
||||||
|
Integer i = jsonObject.getInteger("integer");
|
||||||
|
String id = jsonObject.getString("id");
|
||||||
|
i += 1;
|
||||||
|
Integer max = QianDuan.max();
|
||||||
|
JSONArray fou = QianDuan.fou();
|
||||||
|
log.info("c俄式" + i + id +max );
|
||||||
|
for (Object o : fou) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
Integer xuhao = test.getInteger("xuhao");
|
||||||
|
if (i == xuhao) {
|
||||||
|
i += 1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i <= max) {
|
||||||
|
JSONArray select = QianDuan.select(i);
|
||||||
|
for (Object o : select ){
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String fsName = test.getString("fs_name");
|
||||||
|
Integer integer = test.getJSONObject("fs_user").getInteger("dept_no");
|
||||||
|
QianDuan.insert(id,i,fsName,integer);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}else {
|
||||||
|
|
||||||
|
JSONArray select = QianDuan.select(1);
|
||||||
|
for (Object o : select ){
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String fsName = test.getString("fs_name");
|
||||||
|
Integer integer = test.getJSONObject("fs_user").getInteger("dept_no");
|
||||||
|
QianDuan.insert(id,1,fsName,integer);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
99
src/main/java/com/example/sso/test/CeShi.java
Normal file
99
src/main/java/com/example/sso/test/CeShi.java
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
/*
|
||||||
|
package com.example.sso.test;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.dao.C;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.http.HttpEntity;
|
||||||
|
import org.apache.http.HttpResponse;
|
||||||
|
import org.apache.http.client.methods.HttpPost;
|
||||||
|
import org.apache.http.entity.ContentType;
|
||||||
|
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
||||||
|
import org.apache.http.entity.mime.content.FileBody;
|
||||||
|
import org.apache.http.entity.mime.content.StringBody;
|
||||||
|
import org.apache.http.impl.client.CloseableHttpClient;
|
||||||
|
import org.apache.http.impl.client.HttpClients;
|
||||||
|
import org.apache.http.util.EntityUtils;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.net.URLConnection;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
public class CeShi {
|
||||||
|
@PostMapping("/test")
|
||||||
|
public JSONObject main1(@RequestBody C c) throws IOException {
|
||||||
|
//String fileUrl = "https://fz-zion-static.functorz.com/202403290302/2580e8a228755ecb953645bcf20700ac/project/2000000000282320/images/HDzOpA6kQuD994hibpYtyA==.jpg";
|
||||||
|
String saveDir = "/home/appdown"; // 本地文件夹路径
|
||||||
|
String fileName ="";
|
||||||
|
|
||||||
|
try {
|
||||||
|
URL url = new URL(c.getFileUrl());
|
||||||
|
URLConnection conn = url.openConnection();
|
||||||
|
InputStream inputStream = conn.getInputStream();
|
||||||
|
|
||||||
|
fileName = c.getFileUrl().substring(c.getFileUrl().lastIndexOf("/") + 1);
|
||||||
|
String saveFilePath = saveDir + File.separator + fileName;
|
||||||
|
|
||||||
|
FileOutputStream outputStream = new FileOutputStream(saveFilePath);
|
||||||
|
|
||||||
|
int bytesRead;
|
||||||
|
byte[] buffer = new byte[4096];
|
||||||
|
while ((bytesRead = inputStream.read(buffer)) != -1) {
|
||||||
|
outputStream.write(buffer, 0, bytesRead);
|
||||||
|
}
|
||||||
|
|
||||||
|
outputStream.close();
|
||||||
|
inputStream.close();
|
||||||
|
|
||||||
|
System.out.println("文件下载完成");
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
String key = key(c.getToken(), fileName);
|
||||||
|
System.out.println(key);
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add(key);
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("key",jsonArray);
|
||||||
|
return jsonObject;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String key( String token,String top) throws IOException {
|
||||||
|
String url = "https://www.jiyuankeshang.com/_/file/upload/put_file";
|
||||||
|
File file = new File("/home" + File.separator + "appdown" + File.separator + top);
|
||||||
|
String PATH = "D:\\11.txt";
|
||||||
|
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||||
|
HttpPost httpPost = new HttpPost(url);
|
||||||
|
// httpPost.setHeader("Content-Type", "form-data");
|
||||||
|
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||||
|
builder.addPart("token", new StringBody(token, ContentType.create("text/plain", Charset.forName("UTF-8"))));
|
||||||
|
builder.addPart("file", new FileBody(file, ContentType.create("jpg"), file.getName()));
|
||||||
|
HttpEntity entity = builder.build();
|
||||||
|
|
||||||
|
httpPost.setEntity(entity);
|
||||||
|
HttpResponse response = httpClient.execute(httpPost);
|
||||||
|
int statusCode = response.getStatusLine().getStatusCode();
|
||||||
|
|
||||||
|
HttpEntity entity1 = response.getEntity();
|
||||||
|
String string = EntityUtils.toString(entity1);
|
||||||
|
JSONObject jsonObject = JSON.parseObject(string);
|
||||||
|
String key = jsonObject.getString("key");
|
||||||
|
|
||||||
|
return key;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
20
src/main/java/com/example/sso/test/D.java
Normal file
20
src/main/java/com/example/sso/test/D.java
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
package com.example.sso.test;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Calendar;
|
||||||
|
|
||||||
|
public class D {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
|
||||||
|
// 获取当前月份
|
||||||
|
int year = calendar.get(Calendar.YEAR);
|
||||||
|
int month = calendar.get(Calendar.MONTH) + 1; // 月份从 0 开始,所以要加 1
|
||||||
|
|
||||||
|
// 格式化为 "YYYY-MM"
|
||||||
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM");
|
||||||
|
String formattedMonth = dateFormat.format(calendar.getTime());
|
||||||
|
|
||||||
|
System.out.println("Current Month: " + formattedMonth);
|
||||||
|
}
|
||||||
|
}
|
||||||
62
src/main/java/com/example/sso/test/E.java
Normal file
62
src/main/java/com/example/sso/test/E.java
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
package com.example.sso.test;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
|
||||||
|
|
||||||
|
public class E {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id","658bc54678f6daedd0cfa269");
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("f_user_id");
|
||||||
|
jsonArray.add("real_name");
|
||||||
|
jsonArray.add("id_card");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields",jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel","and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field","id");
|
||||||
|
jsonObject1.put("method","eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add("1440");
|
||||||
|
jsonObject1.put("value",jsonArray1);
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject jsonObject11 = new JSONObject();
|
||||||
|
jsonObject11.put("field","real_name");
|
||||||
|
jsonObject11.put("method","eq");
|
||||||
|
JSONArray jsonArray11 = new JSONArray();
|
||||||
|
jsonArray11.add("马晶晶");
|
||||||
|
jsonObject11.put("value",jsonArray11);
|
||||||
|
|
||||||
|
cond.add(jsonObject11);
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel",rel);
|
||||||
|
filter.put("cond",cond);
|
||||||
|
jsonObject.put("filter",filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
|
||||||
|
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
String A = "";
|
||||||
|
for (Object O : jsonArray2){
|
||||||
|
JSONObject test = (JSONObject) O;
|
||||||
|
A = test.getString("id_card");
|
||||||
|
}
|
||||||
|
System.out.println(A);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
69
src/main/java/com/example/sso/test/F.java
Normal file
69
src/main/java/com/example/sso/test/F.java
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
package com.example.sso.test;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
|
||||||
|
public class F {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id","65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id","658bc54678f6daedd0cfa269");
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("id");
|
||||||
|
jsonArray.add("real_name");
|
||||||
|
jsonArray.add("id_card");
|
||||||
|
jsonArray.add("fs_name");
|
||||||
|
jsonArray.add("_widget_1708503246372");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields",jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel","and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field","id");
|
||||||
|
jsonObject1.put("method","eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add("100001923");
|
||||||
|
jsonObject1.put("value",jsonArray1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel",rel);
|
||||||
|
filter.put("cond",cond);
|
||||||
|
jsonObject.put("filter",filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
|
||||||
|
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
String A = "";
|
||||||
|
for (Object O : jsonArray2){
|
||||||
|
JSONObject test = (JSONObject) O;
|
||||||
|
JSONObject widget1708503246372 = test.getJSONObject("_widget_1708503246372");
|
||||||
|
String jsonString1 = "";
|
||||||
|
if (widget1708503246372 != null) {
|
||||||
|
jsonString1 = widget1708503246372.toJSONString();
|
||||||
|
}
|
||||||
|
A = jsonString1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (A != null && !A.isEmpty()){
|
||||||
|
JSONObject jsonObject3 = JSON.parseObject(A);
|
||||||
|
Integer deptNo = jsonObject3.getInteger("dept_no");
|
||||||
|
A = deptNo.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println(A);
|
||||||
|
}
|
||||||
|
}
|
||||||
18
src/main/java/com/example/sso/test/G.java
Normal file
18
src/main/java/com/example/sso/test/G.java
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package com.example.sso.test;
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class G {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Date currentDate = new Date();
|
||||||
|
|
||||||
|
// 创建日期格式化对象,指定目标格式
|
||||||
|
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
|
||||||
|
// 格式化当前日期为指定格式的字符串
|
||||||
|
String formattedDate = dateFormat.format(currentDate);
|
||||||
|
System.out.println(formattedDate);
|
||||||
|
}
|
||||||
|
}
|
||||||
44
src/main/java/com/example/sso/test/H.java
Normal file
44
src/main/java/com/example/sso/test/H.java
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
package com.example.sso.test;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
|
||||||
|
public class H {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "65815f117de49256b1e67e75");
|
||||||
|
jsonObject.put("entry_id", "658bc54678f6daedd0cfa269");
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("id");
|
||||||
|
jsonArray.add("f_user_id");
|
||||||
|
jsonArray.add("first_id");
|
||||||
|
jsonObject.put("fields", jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel", "and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field", "id");
|
||||||
|
jsonObject1.put("method", "eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add("ZYT00000846");
|
||||||
|
jsonObject1.put("value", jsonArray1);
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel", rel);
|
||||||
|
filter.put("cond", cond);
|
||||||
|
jsonObject.put("filter", filter);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
String S = "";
|
||||||
|
for (Object o : jsonArray2){
|
||||||
|
JSONObject TEST = (JSONObject) o;
|
||||||
|
S = TEST.getString("f_user_id");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
163
src/main/java/com/example/sso/test/J.java
Normal file
163
src/main/java/com/example/sso/test/J.java
Normal file
@ -0,0 +1,163 @@
|
|||||||
|
package com.example.sso.test;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.FDaDaUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class J {
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("initiatorId","625776ecae6742cb8eb710beedef9b4c");
|
||||||
|
jsonObject.put("signTaskId","1714041777102179755");
|
||||||
|
jsonObject.put("abolishedInitiator",jsonObject1);
|
||||||
|
JSONArray actors12 = new JSONArray();
|
||||||
|
JSONObject Actor = new JSONObject();
|
||||||
|
JSONArray notifyType = new JSONArray();
|
||||||
|
notifyType.add("start");
|
||||||
|
notifyType.add("finish");
|
||||||
|
notifyType.add("start");
|
||||||
|
Actor.put("notifyType",notifyType);
|
||||||
|
Actor.put("notifyAddress","15232585208");
|
||||||
|
Actor.put("actorId","用户方");
|
||||||
|
JSONObject jsonObjec = new JSONObject();
|
||||||
|
jsonObjec.put("actor",Actor);
|
||||||
|
actors12.add(jsonObjec);
|
||||||
|
jsonObject.put("actors",actors12);
|
||||||
|
|
||||||
|
jsonObject.put("reason","签署内容有误");
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
System.out.println(jsonString);
|
||||||
|
String zuofei = FDaDaUtil.zuofei(jsonString);
|
||||||
|
log.info("zuofei "+ zuofei);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(zuofei);
|
||||||
|
JSONObject jsonObject3 = jsonObject2.getJSONObject("data");
|
||||||
|
String abolishedSignTaskId = jsonObject3.getString("abolishedSignTaskId");
|
||||||
|
log.info("最开始的任务id "+abolishedSignTaskId);
|
||||||
|
JSONObject jsonObject4 = new JSONObject();
|
||||||
|
jsonObject4.put("signTaskId",abolishedSignTaskId);
|
||||||
|
String jsonString1 = jsonObject4.toJSONString();
|
||||||
|
String infor = FDaDaUtil.infor(jsonString1);
|
||||||
|
JSONObject jsonObject5 = JSON.parseObject(infor);
|
||||||
|
JSONArray jsonArray = jsonObject5.getJSONObject("data").getJSONArray("docs");
|
||||||
|
String docid = "";
|
||||||
|
for (Object o : jsonArray){
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
docid = test.getString("docId");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//企业
|
||||||
|
|
||||||
|
JSONObject jsonObject6 = new JSONObject();
|
||||||
|
jsonObject6.put("signTaskId",abolishedSignTaskId);
|
||||||
|
jsonObject6.put("actorId","企业方");
|
||||||
|
JSONArray fields = new JSONArray();
|
||||||
|
JSONObject zhang = new JSONObject();
|
||||||
|
zhang.put("docId",docid);
|
||||||
|
JSONArray docFieldszhang = new JSONArray();
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject zhanginfor = new JSONObject();
|
||||||
|
zhanginfor.put("fieldId","企业章");
|
||||||
|
zhanginfor.put("fieldName","企业章");
|
||||||
|
JSONObject positionzhang = new JSONObject();
|
||||||
|
positionzhang.put("positionX",168);
|
||||||
|
positionzhang.put("positionY",780);
|
||||||
|
positionzhang.put("positionMode","pixel");
|
||||||
|
positionzhang.put("positionPageNo",1);
|
||||||
|
|
||||||
|
zhanginfor.put("position",positionzhang);
|
||||||
|
zhanginfor.put("fieldType","corp_seal");
|
||||||
|
docFieldszhang.add(zhanginfor);
|
||||||
|
|
||||||
|
zhang.put("docFields",docFieldszhang);
|
||||||
|
fields.add(zhang);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject6.put("fields",fields);
|
||||||
|
String jsonString2 = jsonObject6.toJSONString();
|
||||||
|
String add1 = FDaDaUtil.add(jsonString2);
|
||||||
|
System.out.println("我是企业 "+add1);
|
||||||
|
|
||||||
|
|
||||||
|
//用户
|
||||||
|
JSONObject jsonObject61 = new JSONObject();
|
||||||
|
jsonObject61.put("signTaskId",abolishedSignTaskId);
|
||||||
|
jsonObject61.put("actorId","用户方");
|
||||||
|
JSONArray fields1 = new JSONArray();
|
||||||
|
JSONObject zhang1 = new JSONObject();
|
||||||
|
zhang1.put("docId",docid);
|
||||||
|
JSONArray docFieldszhang1 = new JSONArray();
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject zhanginfor1 = new JSONObject();
|
||||||
|
zhanginfor1.put("fieldId","用户签名");
|
||||||
|
zhanginfor1.put("fieldName","用户签名");
|
||||||
|
JSONObject positionzhang1 = new JSONObject();
|
||||||
|
positionzhang1.put("positionX",450);
|
||||||
|
positionzhang1.put("positionY",780);
|
||||||
|
positionzhang1.put("positionMode","pixel");
|
||||||
|
positionzhang1.put("positionPageNo",1);
|
||||||
|
|
||||||
|
zhanginfor1.put("position",positionzhang1);
|
||||||
|
zhanginfor1.put("fieldType","person_sign");
|
||||||
|
docFieldszhang1.add(zhanginfor1);
|
||||||
|
|
||||||
|
zhang1.put("docFields",docFieldszhang1);
|
||||||
|
fields1.add(zhang1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject61.put("fields",fields1);
|
||||||
|
String jsonString21 = jsonObject61.toJSONString();
|
||||||
|
String add = FDaDaUtil.add(jsonString21);
|
||||||
|
System.out.println("我是用户 " + add);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//修改签署任务参与方
|
||||||
|
JSONObject jsonObject7 = new JSONObject();
|
||||||
|
jsonObject7.put("signTaskId",abolishedSignTaskId);
|
||||||
|
jsonObject7.put("businessId","a09900c24614bd4c1de10c55712a3e0e");
|
||||||
|
|
||||||
|
|
||||||
|
//参与方数组
|
||||||
|
JSONArray actors = new JSONArray();
|
||||||
|
JSONObject jsonObject8 = new JSONObject();
|
||||||
|
jsonObject8.put("actorId","企业方");
|
||||||
|
JSONArray signFields = new JSONArray();
|
||||||
|
JSONObject jsonObject9 = new JSONObject();
|
||||||
|
jsonObject9.put("fieldDocId",docid);
|
||||||
|
jsonObject9.put("fieldId","企业章");
|
||||||
|
jsonObject9.put("sealId",1705574268127146240l);
|
||||||
|
signFields.add(jsonObject9);
|
||||||
|
jsonObject8.put("signFields",signFields);
|
||||||
|
JSONObject jsonObject10 = new JSONObject();
|
||||||
|
jsonObject10.put("requestVerifyFree",true);
|
||||||
|
jsonObject8.put("signConfigInfo",jsonObject10);
|
||||||
|
actors.add(jsonObject8);
|
||||||
|
jsonObject7.put("actors",actors);
|
||||||
|
|
||||||
|
String jsonString3 = jsonObject7.toJSONString();
|
||||||
|
String updata = FDaDaUtil.updata(jsonString3);
|
||||||
|
log.info("updata "+updata);
|
||||||
|
|
||||||
|
JSONObject jsonObject999 = new JSONObject();
|
||||||
|
jsonObject999.put("signTaskId",abolishedSignTaskId);
|
||||||
|
String jsonString11 = jsonObject999.toJSONString();
|
||||||
|
String signtask = FDaDaUtil.signtask(jsonString11);
|
||||||
|
System.out.println(signtask);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
40
src/main/java/com/example/sso/test/K.java
Normal file
40
src/main/java/com/example/sso/test/K.java
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
package com.example.sso.test;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
public class K {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
JSONObject jsonObject6 = new JSONObject();
|
||||||
|
jsonObject6.put("signTaskId","abolishedSignTaskId");
|
||||||
|
jsonObject6.put("actorId","企业方");
|
||||||
|
JSONArray fields = new JSONArray();
|
||||||
|
JSONObject zhang = new JSONObject();
|
||||||
|
zhang.put("docId","docid");
|
||||||
|
JSONArray docFieldszhang = new JSONArray();
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject zhanginfor = new JSONObject();
|
||||||
|
zhanginfor.put("fieldId","企业章");
|
||||||
|
zhanginfor.put("fieldName","企业章");
|
||||||
|
JSONObject positionzhang = new JSONObject();
|
||||||
|
positionzhang.put("positionX",168);
|
||||||
|
positionzhang.put("positionY",506);
|
||||||
|
positionzhang.put("positionMode","pixel");
|
||||||
|
positionzhang.put("positionPageNo",1);
|
||||||
|
|
||||||
|
zhanginfor.put("position",positionzhang);
|
||||||
|
zhanginfor.put("fieldType","corp_seal");
|
||||||
|
docFieldszhang.add(zhanginfor);
|
||||||
|
|
||||||
|
zhang.put("docFields",docFieldszhang);
|
||||||
|
fields.add(zhang);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject6.put("fields",fields);
|
||||||
|
System.out.println(jsonObject6);
|
||||||
|
}
|
||||||
|
}
|
||||||
33
src/main/java/com/example/sso/test/L.java
Normal file
33
src/main/java/com/example/sso/test/L.java
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
package com.example.sso.test;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.dao.YingXiaoFs;
|
||||||
|
import com.example.sso.dao.YingXiaoId;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class L {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "66c866b2d6520ecd19066bb0");
|
||||||
|
jsonObject.put("entry_id", "66ce9d8650722812f7b3cb3a");
|
||||||
|
jsonObject.put("data_id", "66d01ecb015365f3099c108f");
|
||||||
|
jsonObject.put("is_start_trigger", true);
|
||||||
|
JSONObject DATA = new JSONObject();
|
||||||
|
JSONObject yxname1 = new JSONObject();
|
||||||
|
yxname1.put("value","yxnames");
|
||||||
|
|
||||||
|
JSONObject yxzd1 = new JSONObject();
|
||||||
|
yxzd1.put("value","608422034");
|
||||||
|
DATA.put("yxname",yxname1);
|
||||||
|
DATA.put("yxzd",yxzd1);
|
||||||
|
jsonObject.put("data",DATA);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String updata = APIUtils.updata(jsonString);
|
||||||
|
log.info(updata);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
28
src/main/java/com/example/sso/test/M.java
Normal file
28
src/main/java/com/example/sso/test/M.java
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
package com.example.sso.test;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.dao.YingXiaoFs;
|
||||||
|
import com.example.sso.dao.YingXiaoId;
|
||||||
|
|
||||||
|
public class M {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Integer num = YingXiaoFs.num("12分");
|
||||||
|
if (num != 0){
|
||||||
|
JSONArray jsonArray1 = YingXiaoId.id("8341");
|
||||||
|
int size = jsonArray1.size();
|
||||||
|
|
||||||
|
if (size !=0){
|
||||||
|
for (Object o : jsonArray1){
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String yxnames = test.getString("yxname");
|
||||||
|
String yxzd = test.getJSONObject("yxzd").getString("integrate_id");
|
||||||
|
System.out.println(yxzd);
|
||||||
|
System.out.println(yxnames);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
18
src/main/java/com/example/sso/test/N.java
Normal file
18
src/main/java/com/example/sso/test/N.java
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package com.example.sso.test;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.dao.Max;
|
||||||
|
import com.example.sso.dao.XuHaoNoNull;
|
||||||
|
import com.example.sso.dao.YingXiaoId;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
|
||||||
|
import javax.jws.soap.SOAPBinding;
|
||||||
|
|
||||||
|
public class N {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Integer maxs = XuHaoNoNull.maxs();
|
||||||
|
System.out.println(maxs);
|
||||||
|
}
|
||||||
|
}
|
||||||
61
src/main/java/com/example/sso/test/O.java
Normal file
61
src/main/java/com/example/sso/test/O.java
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
package com.example.sso.test;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.dao.ChaFenSi;
|
||||||
|
import com.example.sso.dao.Max;
|
||||||
|
import com.example.sso.dao.SelectPerson;
|
||||||
|
import com.example.sso.dao.XuHaoNoNull;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class O {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Integer maxs = Max.maxs();
|
||||||
|
Integer maxs1 = XuHaoNoNull.maxs();
|
||||||
|
int i = maxs1 + 1;
|
||||||
|
int xuhao = 0;
|
||||||
|
if (i <= maxs) {
|
||||||
|
xuhao = i;
|
||||||
|
}else {
|
||||||
|
xuhao = 1;
|
||||||
|
}
|
||||||
|
JSONArray array = SelectPerson.array(xuhao);
|
||||||
|
String yxname = "";
|
||||||
|
String string = "";
|
||||||
|
for (Object o : array){
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
yxname = test.getString("yxname");
|
||||||
|
string = test.getJSONObject("yxzd").getString("integrate_id");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "66c866b2d6520ecd19066bb0");
|
||||||
|
jsonObject.put("entry_id", "66ce9d8650722812f7b3cb3a");
|
||||||
|
jsonObject.put("data_id", "66d03135c3fc01d8c655052c");
|
||||||
|
jsonObject.put("is_start_trigger", true);
|
||||||
|
JSONObject DATA = new JSONObject();
|
||||||
|
JSONObject yxname1 = new JSONObject();
|
||||||
|
yxname1.put("value",yxname);
|
||||||
|
|
||||||
|
JSONObject yxzd1 = new JSONObject();
|
||||||
|
yxzd1.put("value",string);
|
||||||
|
|
||||||
|
JSONObject xuhao1 = new JSONObject();
|
||||||
|
xuhao1.put("value",xuhao);
|
||||||
|
|
||||||
|
|
||||||
|
DATA.put("xuhao",xuhao1);
|
||||||
|
DATA.put("yxname",yxname1);
|
||||||
|
DATA.put("yxzd",yxzd1);
|
||||||
|
jsonObject.put("data",DATA);
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
log.info("1111111 "+ jsonString);
|
||||||
|
String updata = APIUtils.updata(jsonString);
|
||||||
|
log.info(updata);
|
||||||
|
}
|
||||||
|
}
|
||||||
79
src/main/java/com/example/sso/test/P.java
Normal file
79
src/main/java/com/example/sso/test/P.java
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
package com.example.sso.test;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
|
|
||||||
|
public class P {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Boolean b = true;
|
||||||
|
String ID = "";
|
||||||
|
|
||||||
|
JSONArray jsonArrayEND = new JSONArray();
|
||||||
|
while (b) {
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "66c866b2d6520ecd19066bb0");
|
||||||
|
jsonObject.put("entry_id", "66ce9d8650722812f7b3cb3a");
|
||||||
|
jsonObject.put("limit", 10000);
|
||||||
|
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("xuhao");
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields", jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel", "and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field", "xuhao");
|
||||||
|
jsonObject1.put("method", "not_empty");
|
||||||
|
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel", rel);
|
||||||
|
filter.put("cond", cond);
|
||||||
|
jsonObject.put("filter", filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray1 = jsonObject2.getJSONArray("data");
|
||||||
|
|
||||||
|
int size = jsonArray1.size();
|
||||||
|
if (size < 10000) {
|
||||||
|
for (Object o : jsonArray1) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
jsonArrayEND.add(test);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
b = false;
|
||||||
|
} else {
|
||||||
|
for (Object o : jsonArray1) {
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
String id = test.getString("_id");
|
||||||
|
|
||||||
|
ID = id;
|
||||||
|
jsonArrayEND.add(test);
|
||||||
|
|
||||||
|
}
|
||||||
|
jsonObject.put("data_id", ID);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Integer num = 0;
|
||||||
|
for (Object o : jsonArrayEND){
|
||||||
|
JSONObject test = (JSONObject) o;
|
||||||
|
num = test.getInteger("xuhao");
|
||||||
|
|
||||||
|
}
|
||||||
|
System.out.println(num);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
11
src/main/java/com/example/sso/test/Q.java
Normal file
11
src/main/java/com/example/sso/test/Q.java
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package com.example.sso.test;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.example.sso.dao.ThreeOne;
|
||||||
|
|
||||||
|
public class Q {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
JSONArray array = ThreeOne.array("8613");
|
||||||
|
System.out.println(array);
|
||||||
|
}
|
||||||
|
}
|
||||||
35
src/main/java/com/example/sso/test/R.java
Normal file
35
src/main/java/com/example/sso/test/R.java
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package com.example.sso.test;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
|
||||||
|
public class R {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
|
||||||
|
jsonObject.put("app_id", "66c866b2d6520ecd19066bb0");
|
||||||
|
jsonObject.put("entry_id", "66cebfaa2340ecd8b90e06a1");
|
||||||
|
jsonObject.put("limit", 10000);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
filter.put("rel","and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject11 = new JSONObject();
|
||||||
|
jsonObject11.put("field","yeno");
|
||||||
|
jsonObject11.put("method","eq");
|
||||||
|
JSONArray jsonArray12 = new JSONArray();
|
||||||
|
jsonArray12.add("否");
|
||||||
|
jsonObject11.put("value",jsonArray12);
|
||||||
|
cond.add(jsonObject11);
|
||||||
|
filter.put("cond",cond);
|
||||||
|
jsonObject.put("filter",filter);
|
||||||
|
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject1 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray = jsonObject1.getJSONArray("data");
|
||||||
|
System.out.println(jsonArray);
|
||||||
|
}
|
||||||
|
}
|
||||||
48
src/main/java/com/example/sso/test/i.java
Normal file
48
src/main/java/com/example/sso/test/i.java
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
package com.example.sso.test;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.sso.util.APIUtils;
|
||||||
|
import com.example.sso.util.FDaDaUtil;
|
||||||
|
|
||||||
|
public class i {
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("app_id", "66c866b2d6520ecd19066bb0");
|
||||||
|
jsonObject.put("entry_id", "66cebfaa2340ecd8b90e06a1");
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add("sjid");
|
||||||
|
jsonArray.add("yxname");
|
||||||
|
jsonArray.add("yxzd");
|
||||||
|
jsonArray.add("xuhao");
|
||||||
|
|
||||||
|
|
||||||
|
jsonObject.put("fields", jsonArray);
|
||||||
|
JSONObject filter = new JSONObject();
|
||||||
|
JSONObject rel = new JSONObject();
|
||||||
|
rel.put("rel", "and");
|
||||||
|
JSONArray cond = new JSONArray();
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("field", "sjid");
|
||||||
|
jsonObject1.put("method", "eq");
|
||||||
|
JSONArray jsonArray1 = new JSONArray();
|
||||||
|
jsonArray1.add("804");
|
||||||
|
jsonObject1.put("value", jsonArray1);
|
||||||
|
cond.add(jsonObject1);
|
||||||
|
filter.put("rel", rel);
|
||||||
|
filter.put("cond", cond);
|
||||||
|
jsonObject.put("filter", filter);
|
||||||
|
|
||||||
|
String jsonString = jsonObject.toJSONString();
|
||||||
|
String select = APIUtils.select(jsonString);
|
||||||
|
JSONObject jsonObject2 = JSON.parseObject(select);
|
||||||
|
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
|
||||||
|
int size = jsonArray2.size();
|
||||||
|
if (size != 0) {
|
||||||
|
|
||||||
|
System.out.println(jsonArray2);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
877
src/main/java/com/example/sso/util/APIUtils.java
Normal file
877
src/main/java/com/example/sso/util/APIUtils.java
Normal file
@ -0,0 +1,877 @@
|
|||||||
|
package com.example.sso.util;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import org.apache.commons.codec.Charsets;
|
||||||
|
import org.apache.http.Header;
|
||||||
|
import org.apache.http.HttpEntity;
|
||||||
|
import org.apache.http.HttpResponse;
|
||||||
|
import org.apache.http.client.HttpClient;
|
||||||
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||||
|
import org.apache.http.client.methods.HttpGet;
|
||||||
|
import org.apache.http.client.methods.HttpPost;
|
||||||
|
import org.apache.http.client.methods.HttpRequestBase;
|
||||||
|
import org.apache.http.client.utils.URIBuilder;
|
||||||
|
import org.apache.http.conn.ssl.NoopHostnameVerifier;
|
||||||
|
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
|
||||||
|
import org.apache.http.entity.ContentType;
|
||||||
|
import org.apache.http.entity.StringEntity;
|
||||||
|
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
||||||
|
import org.apache.http.entity.mime.content.FileBody;
|
||||||
|
import org.apache.http.entity.mime.content.StringBody;
|
||||||
|
import org.apache.http.impl.client.CloseableHttpClient;
|
||||||
|
import org.apache.http.impl.client.HttpClients;
|
||||||
|
import org.apache.http.message.BasicHeader;
|
||||||
|
import org.apache.http.ssl.SSLContextBuilder;
|
||||||
|
import org.apache.http.ssl.SSLContexts;
|
||||||
|
import org.apache.http.ssl.TrustStrategy;
|
||||||
|
import org.apache.http.util.EntityUtils;
|
||||||
|
|
||||||
|
import javax.net.ssl.SSLContext;
|
||||||
|
import javax.net.ssl.TrustManager;
|
||||||
|
import javax.net.ssl.X509TrustManager;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
|
import java.security.cert.CertificateException;
|
||||||
|
import java.security.cert.X509Certificate;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
public class APIUtils {
|
||||||
|
|
||||||
|
|
||||||
|
public static final String WEBSITE = "https://www.jiyuankeshang.com";
|
||||||
|
private static boolean retryIfRateLimited = true;
|
||||||
|
private String urlGetWidgets;
|
||||||
|
private String urlGetFormData;
|
||||||
|
private String urlRetrieveData;
|
||||||
|
private String urlUpdateData;
|
||||||
|
private String urlCreateData;
|
||||||
|
private String urlDeleteData;
|
||||||
|
private String urlCreateUSer;
|
||||||
|
private String urlCreatePerson;
|
||||||
|
private String urlCreatePersonAll;
|
||||||
|
private String urlCreateDep;
|
||||||
|
private String urlCreateDepAll;
|
||||||
|
private String urlGetDepartment;
|
||||||
|
private String urlGetPeople;
|
||||||
|
private String urlDeletePeople;
|
||||||
|
private String urlDown;
|
||||||
|
|
||||||
|
private static String apiKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param appId - 应用id
|
||||||
|
* @param entryId - 表单id
|
||||||
|
* @param apiKey - apiKey
|
||||||
|
*/
|
||||||
|
public APIUtils(String appId, String entryId, String apiKey) {
|
||||||
|
this.apiKey = apiKey;
|
||||||
|
this.initUrl(appId, entryId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Object> createPerson(Map<String, Object> person) {
|
||||||
|
Map<String, Object> data = null;
|
||||||
|
try {
|
||||||
|
Map<String, Object> result = (Map<String, Object>) this.sendRequest("POST", urlCreatePerson, person);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Object> createDep(Map<String, Object> person) {
|
||||||
|
Map<String, Object> data = null;
|
||||||
|
try {
|
||||||
|
Map<String, Object> result = (Map<String, Object>) this.sendRequest("POST", urlCreatePerson, person);
|
||||||
|
data = (Map<String, Object>) result.get("department");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initUrl(String appId, String entryId) {
|
||||||
|
urlGetWidgets = WEBSITE + "/api/v1/app/" + appId + "/entry/" + entryId + "/widgets";
|
||||||
|
urlGetFormData = WEBSITE + "/api/v1/app/" + appId + "/entry/" + entryId + "/data";
|
||||||
|
urlRetrieveData = WEBSITE + "/api/v1/app/" + appId + "/entry/" + entryId + "/data_retrieve";
|
||||||
|
urlUpdateData = WEBSITE + "/api/v1/app/" + appId + "/entry/" + entryId + "/data_update";
|
||||||
|
urlCreateData = WEBSITE + "/api/v3/app/" + appId + "/entry/" + entryId + "/data_create";
|
||||||
|
urlDeleteData = WEBSITE + "/api/v1/app/" + appId + "/entry/" + entryId + "/data_delete";
|
||||||
|
urlCreatePerson = WEBSITE + "/api/v2/user/create";
|
||||||
|
urlCreateUSer = WEBSITE + "/api/v2/user/create";
|
||||||
|
urlCreateDep = WEBSITE + "/api/v2/department/create";
|
||||||
|
urlCreateDepAll = WEBSITE + "/api/v2/department/import";
|
||||||
|
urlCreatePersonAll = WEBSITE + "/api/v2/user/import";
|
||||||
|
urlGetDepartment = WEBSITE + "/api/v2/department/1/department_list";
|
||||||
|
urlGetPeople = WEBSITE + "/api/v2/department/1/member_list";
|
||||||
|
urlDeletePeople = WEBSITE + "/api/v2/user/batch_delete";
|
||||||
|
urlDown = WEBSITE + "/api/v1/app/" + appId + "/entry/" + entryId + "/file/get_upload_token";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HttpClient getSSLHttpClient() throws Exception {
|
||||||
|
SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, new TrustStrategy() {
|
||||||
|
//信任所有
|
||||||
|
public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}).build();
|
||||||
|
SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslContext);
|
||||||
|
return HttpClients.custom().setSSLSocketFactory(sslsf).build();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取部门成员信息
|
||||||
|
*
|
||||||
|
* @param - 创建数据内容
|
||||||
|
* @return 更新后的数据
|
||||||
|
*/
|
||||||
|
public Map<String, Object> deletePeopleBatch(Map<String, Object> map) {
|
||||||
|
Map<String, Object> data = null;
|
||||||
|
try {
|
||||||
|
Map<String, Object> result = (Map<String, Object>) this.sendRequest("POST", urlDeletePeople, map);
|
||||||
|
return result;
|
||||||
|
// data = (Map<String, Object>) result.get("department");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取请求头信息
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Header[] getHttpHeaders() {
|
||||||
|
List<Header> headerList = new ArrayList<Header>();
|
||||||
|
headerList.add(new BasicHeader("Authorization", "Bearer " + apiKey));
|
||||||
|
headerList.add(new BasicHeader("Content-Type", "application/json;charset=utf-8"));
|
||||||
|
return headerList.toArray(new Header[headerList.size()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询人员信息
|
||||||
|
*
|
||||||
|
* @param username - 创建数据内容
|
||||||
|
* @return 更新后的数据
|
||||||
|
*/
|
||||||
|
public Map<String, Object> findPerson(String username) {
|
||||||
|
Map<String, Object> data = null;
|
||||||
|
try {
|
||||||
|
Map<String, Object> result = (Map<String, Object>) this.sendRequest("POST", WEBSITE + "/api/v2/user/" + username + "/user_retrieve", new HashMap<>());
|
||||||
|
data = (Map<String, Object>) result.get("data");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送HTTP请求
|
||||||
|
*
|
||||||
|
* @param method - HTTP动词 { GET|POST }
|
||||||
|
* @param url - 请求路径
|
||||||
|
* @param data - 请求的数据
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static Object sendRequest(String method, String url, Map<String, Object> data) throws Exception {
|
||||||
|
HttpClient client = getSSLHttpClient();
|
||||||
|
Header[] headers = getHttpHeaders();
|
||||||
|
HttpRequestBase request;
|
||||||
|
method = method.toUpperCase();
|
||||||
|
if ("GET".equals(method)) {
|
||||||
|
// GET请求
|
||||||
|
URIBuilder uriBuilder = new URIBuilder(url);
|
||||||
|
if (data != null) {
|
||||||
|
// 添加请求参数
|
||||||
|
for (Map.Entry<String, Object> entry : data.entrySet()) {
|
||||||
|
uriBuilder.addParameter(entry.getKey(), (String) entry.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
request = new HttpGet(uriBuilder.build());
|
||||||
|
} else if ("POST".equals(method)) {
|
||||||
|
// POST请求
|
||||||
|
request = new HttpPost(url);
|
||||||
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
|
HttpEntity entity = new StringEntity(mapper.writeValueAsString(data), Charsets.UTF_8);
|
||||||
|
((HttpPost) request).setEntity(entity);
|
||||||
|
} else {
|
||||||
|
throw new RuntimeException("不支持的HTTP动词");
|
||||||
|
}
|
||||||
|
// 设置请求头
|
||||||
|
request.setHeaders(headers);
|
||||||
|
// 发送请求并获取返回结果
|
||||||
|
HttpResponse response = client.execute(request);
|
||||||
|
int statusCode = response.getStatusLine().getStatusCode();
|
||||||
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
|
Map<String, Object> result = (Map<String, Object>) mapper.readValue(response.getEntity().getContent(), Object.class);
|
||||||
|
if (statusCode >= 400) {
|
||||||
|
// 请求错误
|
||||||
|
if ((Integer) result.get("code") == 8303 && retryIfRateLimited) {
|
||||||
|
// 频率超限,1s后重试
|
||||||
|
Thread.sleep(1000);
|
||||||
|
return sendRequest(method, url, data);
|
||||||
|
} else {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 处理返回结果
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取表单字段
|
||||||
|
*
|
||||||
|
* @return 表单字段
|
||||||
|
*/
|
||||||
|
public List<Map<String, Object>> getFormWidgets() {
|
||||||
|
List<Map<String, Object>> widgets = null;
|
||||||
|
try {
|
||||||
|
Map<String, Object> result = (Map<String, Object>) this.sendRequest("POST", urlGetWidgets, new HashMap<String, Object>());
|
||||||
|
widgets = (List<Map<String, Object>>) result.get("widgets");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return widgets;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<Map<String, Object>> createUser(String username, String name, Integer[] departments) {
|
||||||
|
Map<String, Object> data = null;
|
||||||
|
try {
|
||||||
|
Map<String, Object> requestData = new HashMap<String, Object>();
|
||||||
|
requestData.put("username", username);
|
||||||
|
requestData.put("name", name);
|
||||||
|
requestData.put("departments", departments);
|
||||||
|
Map<String, Object> result = (Map<String, Object>) this.sendRequest("POST", urlCreateUSer, requestData);
|
||||||
|
data = (Map<String, Object>) result.get("data");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return (List<Map<String, Object>>) data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按条件获取表单数据
|
||||||
|
*
|
||||||
|
* @param limit - 数据条数
|
||||||
|
* @param fields - 显示的字段
|
||||||
|
* @param filter - 过滤条件
|
||||||
|
* @param dataId - 上次取数的最后一个数据id
|
||||||
|
* @return - 返回的数据
|
||||||
|
*/
|
||||||
|
public List<Map<String, Object>> getFormData(final int limit, final String[] fields, final Map<String, Object> filter, String dataId) {
|
||||||
|
List<Map<String, Object>> data = null;
|
||||||
|
try {
|
||||||
|
// 构造请求数据
|
||||||
|
Map<String, Object> requestData = new HashMap<String, Object>() {
|
||||||
|
{
|
||||||
|
put("limit", limit);
|
||||||
|
put("fields", fields);
|
||||||
|
put("filter", filter);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if (dataId != null) {
|
||||||
|
requestData.put("data_id", dataId);
|
||||||
|
}
|
||||||
|
Map<String, Object> result = (Map<String, Object>) this.sendRequest("POST", urlGetFormData, requestData);
|
||||||
|
data = (List<Map<String, Object>>) result.get("data");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按条件获取全部表单数据
|
||||||
|
*
|
||||||
|
* @return 表单数据
|
||||||
|
*/
|
||||||
|
public List<Map<String, Object>> getAllFormData(String[] fields, Map<String, Object> filter) {
|
||||||
|
List<Map<String, Object>> dataList = new ArrayList<Map<String, Object>>();
|
||||||
|
String offset = null;
|
||||||
|
do {
|
||||||
|
List<Map<String, Object>> data = this.getFormData(100, fields, filter, offset);
|
||||||
|
// 获取返回的数据
|
||||||
|
if (data == null || data.isEmpty()) {
|
||||||
|
// 已经获取全部的数据
|
||||||
|
offset = null;
|
||||||
|
} else {
|
||||||
|
// 获取最后一条数据的id
|
||||||
|
offset = (String) data.get(data.size() - 1).get("_id");
|
||||||
|
dataList.addAll(data);
|
||||||
|
}
|
||||||
|
} while (offset != null);
|
||||||
|
return dataList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 搜索单条数据
|
||||||
|
*
|
||||||
|
* @param dataId - 要查询的数据id
|
||||||
|
* @return 表单数据
|
||||||
|
*/
|
||||||
|
public Map<String, Object> retrieveData(String dataId) {
|
||||||
|
Map<String, Object> data = null;
|
||||||
|
try {
|
||||||
|
Map<String, Object> requestData = new HashMap<String, Object>();
|
||||||
|
requestData.put("data_id", dataId);
|
||||||
|
Map<String, Object> result = (Map<String, Object>) this.sendRequest("POST", urlRetrieveData, requestData);
|
||||||
|
data = (Map<String, Object>) result.get("data");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增部门
|
||||||
|
*
|
||||||
|
* @param - 创建数据内容
|
||||||
|
* @return 更新后的数据
|
||||||
|
*/
|
||||||
|
public Map<String, Object> createDataDep(Map<String, Object> requestData) {
|
||||||
|
Map<String, Object> data = null;
|
||||||
|
try {
|
||||||
|
Map<String, Object> result = (Map<String, Object>) this.sendRequest("POST", urlCreateDep, requestData);
|
||||||
|
// data = (Map<String, Object>) result.get("department");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量创建部门
|
||||||
|
*
|
||||||
|
* @param - 创建数据内容
|
||||||
|
* @return 更新后的数据
|
||||||
|
*/
|
||||||
|
public Map<String, Object> createDataDepAll(Map<String, Object> requestData) {
|
||||||
|
Map<String, Object> data = null;
|
||||||
|
try {
|
||||||
|
Map<String, Object> result = (Map<String, Object>) this.sendRequest("POST", urlCreateDepAll, requestData);
|
||||||
|
// data = (Map<String, Object>) result.get("department");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量创建人员
|
||||||
|
*
|
||||||
|
* @param - 创建数据内容
|
||||||
|
* @return 更新后的数据
|
||||||
|
*/
|
||||||
|
public Map<String, Object> createDataPersonAll(Map<String, Object> requestData) {
|
||||||
|
Map<String, Object> data = null;
|
||||||
|
try {
|
||||||
|
Map<String, Object> result = (Map<String, Object>) this.sendRequest("POST", urlCreatePersonAll, requestData);
|
||||||
|
System.out.println(result);
|
||||||
|
return result;
|
||||||
|
// data = (Map<String, Object>) result.get("department");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取部门信息
|
||||||
|
*
|
||||||
|
* @param - 创建数据内容
|
||||||
|
* @return 更新后的数据
|
||||||
|
*/
|
||||||
|
public Map<String, Object> getDepartment() {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("has_child", 1);
|
||||||
|
Map<String, Object> data = null;
|
||||||
|
try {
|
||||||
|
Map<String, Object> result = (Map<String, Object>) this.sendRequest("POST", urlGetDepartment, map);
|
||||||
|
System.out.println(result);
|
||||||
|
return result;
|
||||||
|
// data = (Map<String, Object>) result.get("department");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取部门成员信息
|
||||||
|
*
|
||||||
|
* @param - 创建数据内容
|
||||||
|
* @return 更新后的数据
|
||||||
|
*/
|
||||||
|
public Map<String, Object> getDepartmentPerson(String dno) {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
// map.put("has_child",1);
|
||||||
|
Map<String, Object> data = null;
|
||||||
|
try {
|
||||||
|
Map<String, Object> result = (Map<String, Object>) this.sendRequest("POST", WEBSITE + "/api/v2/department/" + dno + "/member_list", map);
|
||||||
|
return result;
|
||||||
|
// data = (Map<String, Object>) result.get("department");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Object> deleteDepartment(Integer no) {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("has_child", 1);
|
||||||
|
Map<String, Object> data = null;
|
||||||
|
try {
|
||||||
|
Map<String, Object> result = (Map<String, Object>) this.sendRequest("POST", WEBSITE + "/api/v2/department/" + no + "/delete", new HashMap<>());
|
||||||
|
System.out.println(result);
|
||||||
|
return result;
|
||||||
|
// data = (Map<String, Object>) result.get("department");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 新增部门
|
||||||
|
// * @param - 创建数据内容
|
||||||
|
// * @return 更新后的数据
|
||||||
|
// */
|
||||||
|
// public Map<String, Object> createDataDep (Map<String, Object> requestData) {
|
||||||
|
// Map<String, Object> data = null;
|
||||||
|
// try {
|
||||||
|
// Map<String, Object> result = (Map<String, Object>) this.sendRequest("POST",urlCreateDep, requestData);
|
||||||
|
// data = (Map<String, Object>) result.get("data");
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// e.printStackTrace();
|
||||||
|
// }
|
||||||
|
// return data;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建单条数据
|
||||||
|
*
|
||||||
|
* @param rawData - 创建数据内容
|
||||||
|
* @return 更新后的数据
|
||||||
|
*/
|
||||||
|
public Map<String, Object> createData(Map<String, Object> rawData) {
|
||||||
|
Map<String, Object> data = null;
|
||||||
|
try {
|
||||||
|
Map<String, Object> requestData = new HashMap<String, Object>();
|
||||||
|
requestData.put("data", rawData);
|
||||||
|
requestData.put("is_start_workflow", true);
|
||||||
|
Map<String, Object> result = (Map<String, Object>) this.sendRequest("POST", urlCreateData, requestData);
|
||||||
|
data = (Map<String, Object>) result.get("data");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有的人在简道云
|
||||||
|
*
|
||||||
|
* @return 更新后的数据
|
||||||
|
*/
|
||||||
|
public List<Map<String, Object>> getAllPeople() {
|
||||||
|
List<Map<String, Object>> data = null;
|
||||||
|
try {
|
||||||
|
Map<String, Object> requestData = new HashMap<String, Object>();
|
||||||
|
requestData.put("has_child", true);
|
||||||
|
// System.out.println("准备发起HTTP请求!"+urlGetPeople);
|
||||||
|
Map<String, Object> result = (Map<String, Object>) this.sendRequest("POST", urlGetPeople, requestData);
|
||||||
|
data = (List<Map<String, Object>>) result.get("users");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新单条数据
|
||||||
|
*
|
||||||
|
* @return 更新结果
|
||||||
|
*/
|
||||||
|
public Map<String, Object> updateData(String dataId, Map<String, Object> update) {
|
||||||
|
Map<String, Object> data = null;
|
||||||
|
try {
|
||||||
|
Map<String, Object> requestData = new HashMap<String, Object>();
|
||||||
|
requestData.put("data_id", dataId);
|
||||||
|
requestData.put("data", update);
|
||||||
|
Map<String, Object> result = (Map<String, Object>) this.sendRequest("POST", urlUpdateData, requestData);
|
||||||
|
data = (Map<String, Object>) result.get("data");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除单条数据
|
||||||
|
*
|
||||||
|
* @return 删除结果
|
||||||
|
*/
|
||||||
|
public Map<String, String> deleteData(String dataId) {
|
||||||
|
Map<String, String> result = null;
|
||||||
|
try {
|
||||||
|
Map<String, Object> requestData = new HashMap<String, Object>();
|
||||||
|
requestData.put("data_id", dataId);
|
||||||
|
result = (Map<String, String>) this.sendRequest("POST", urlDeleteData, requestData);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载
|
||||||
|
*
|
||||||
|
|
||||||
|
* @return 更新后的数据
|
||||||
|
*/
|
||||||
|
public Map<String, String> down() {
|
||||||
|
Map<String, String> result = null;
|
||||||
|
try {
|
||||||
|
UUID uuid = UUID.randomUUID();
|
||||||
|
Map<String, Object> requestData = new HashMap<String, Object>();
|
||||||
|
requestData.put("transaction_id", uuid.toString());
|
||||||
|
result = (Map<String, String>) this.sendRequest("POST", urlDown, requestData);
|
||||||
|
|
||||||
|
result.put("transaction_id", uuid.toString());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* V5新增
|
||||||
|
*
|
||||||
|
|
||||||
|
* @return 更新后的数据
|
||||||
|
*/
|
||||||
|
public static String add(String jsonBody) throws Exception {
|
||||||
|
SSLContext sslContext = createTrustAllSSLContext();
|
||||||
|
CloseableHttpClient httpClient = createHttpClient(sslContext);
|
||||||
|
|
||||||
|
// 创建 POST 请求对象
|
||||||
|
HttpPost httpPost = new HttpPost("https://www.jiyuankeshang.com/api/v5/app/entry/data/create");
|
||||||
|
|
||||||
|
String responseBody = null;
|
||||||
|
try {
|
||||||
|
// 设置请求头
|
||||||
|
httpPost.setHeader("Content-Type", "application/json");
|
||||||
|
httpPost.setHeader("Authorization", "Bearer " + "BkIyzlh1onqnqu9cQ3ralDQBjECn97ex");
|
||||||
|
|
||||||
|
|
||||||
|
StringEntity entity = new StringEntity(jsonBody, ContentType.APPLICATION_JSON);
|
||||||
|
httpPost.setEntity(entity);
|
||||||
|
|
||||||
|
// 执行请求,获取响应对象
|
||||||
|
CloseableHttpResponse response = httpClient.execute(httpPost);
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 从响应对象中获取响应实体
|
||||||
|
HttpEntity responseEntity = response.getEntity();
|
||||||
|
|
||||||
|
// 处理响应数据
|
||||||
|
responseBody = EntityUtils.toString(responseEntity);
|
||||||
|
System.out.println(responseBody);
|
||||||
|
} finally {
|
||||||
|
// 关闭响应对象
|
||||||
|
response.close();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
// 关闭 HttpClient
|
||||||
|
httpClient.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return responseBody;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* V5获取文件key
|
||||||
|
*
|
||||||
|
|
||||||
|
* @return 更新后的数据
|
||||||
|
*/
|
||||||
|
public static String keys(String top, String token) throws Exception {
|
||||||
|
String url = "https://www.jiyuankeshang.com/_/file/upload/put_file";
|
||||||
|
File file = new File("/home" + File.separator + "fadada" + File.separator +"file"+ File.separator + top+".pdf");
|
||||||
|
String PATH = "D:\\11.txt";
|
||||||
|
SSLContext sslContext = createTrustAllSSLContext();
|
||||||
|
CloseableHttpClient httpClient = createHttpClient(sslContext);
|
||||||
|
HttpPost httpPost = new HttpPost(url);
|
||||||
|
// httpPost.setHeader("Content-Type", "form-data");
|
||||||
|
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||||
|
builder.addPart("token", new StringBody(token, ContentType.create("text/plain", Charset.forName("UTF-8"))));
|
||||||
|
builder.addPart("file", new FileBody(file, ContentType.create("pdf"), file.getName()));
|
||||||
|
HttpEntity entity = builder.build();
|
||||||
|
|
||||||
|
httpPost.setEntity(entity);
|
||||||
|
HttpResponse response = httpClient.execute(httpPost);
|
||||||
|
int statusCode = response.getStatusLine().getStatusCode();
|
||||||
|
|
||||||
|
HttpEntity entity1 = response.getEntity();
|
||||||
|
String string = EntityUtils.toString(entity1);
|
||||||
|
JSONObject jsonObject = JSON.parseObject(string);
|
||||||
|
String key = jsonObject.getString("key");
|
||||||
|
|
||||||
|
return key;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static SSLContext createTrustAllSSLContext() throws Exception {
|
||||||
|
// 创建一个信任所有证书的 TrustManager
|
||||||
|
TrustManager[] trustAllCerts = new TrustManager[]{
|
||||||
|
new X509TrustManager() {
|
||||||
|
@Override
|
||||||
|
public X509Certificate[] getAcceptedIssuers() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void checkClientTrusted(X509Certificate[] certs, String authType) throws CertificateException {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void checkServerTrusted(X509Certificate[] certs, String authType) throws CertificateException {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 创建 SSL 上下文并初始化
|
||||||
|
SSLContext sslContext = SSLContexts.custom().build();
|
||||||
|
sslContext.init(null, trustAllCerts, null);
|
||||||
|
|
||||||
|
return sslContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static CloseableHttpClient createHttpClient(SSLContext sslContext) {
|
||||||
|
// 创建 HttpClient 并设置信任所有证书的 SSL 上下文
|
||||||
|
return HttpClients.custom()
|
||||||
|
.setSSLContext(sslContext)
|
||||||
|
.setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static String select(String jsonBody) {
|
||||||
|
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||||
|
|
||||||
|
// 创建 POST 请求对象
|
||||||
|
HttpPost httpPost = new HttpPost("https://www.jiyuankeshang.com/api/v5/app/entry/data/list");
|
||||||
|
|
||||||
|
String responseBody = null;
|
||||||
|
try {
|
||||||
|
// 设置请求头
|
||||||
|
httpPost.setHeader("Content-Type", "application/json");
|
||||||
|
httpPost.setHeader("Authorization", "Bearer " + "BkIyzlh1onqnqu9cQ3ralDQBjECn97ex");
|
||||||
|
|
||||||
|
|
||||||
|
StringEntity entity = new StringEntity(jsonBody, ContentType.APPLICATION_JSON);
|
||||||
|
httpPost.setEntity(entity);
|
||||||
|
|
||||||
|
// 执行请求,获取响应对象
|
||||||
|
CloseableHttpResponse response = httpClient.execute(httpPost);
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 从响应对象中获取响应实体
|
||||||
|
HttpEntity responseEntity = response.getEntity();
|
||||||
|
|
||||||
|
// 处理响应数据
|
||||||
|
responseBody = EntityUtils.toString(responseEntity);
|
||||||
|
System.out.println(responseBody);
|
||||||
|
} finally {
|
||||||
|
// 关闭响应对象
|
||||||
|
response.close();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
// 关闭 HttpClient
|
||||||
|
httpClient.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return responseBody;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String updata(String jsonBody) {
|
||||||
|
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||||
|
|
||||||
|
// 创建 POST 请求对象
|
||||||
|
HttpPost httpPost = new HttpPost("https://www.jiyuankeshang.com/api/v5/app/entry/data/update");
|
||||||
|
|
||||||
|
String responseBody = null;
|
||||||
|
try {
|
||||||
|
// 设置请求头
|
||||||
|
httpPost.setHeader("Content-Type", "application/json");
|
||||||
|
httpPost.setHeader("Authorization", "Bearer " + "BkIyzlh1onqnqu9cQ3ralDQBjECn97ex");
|
||||||
|
|
||||||
|
|
||||||
|
StringEntity entity = new StringEntity(jsonBody, ContentType.APPLICATION_JSON);
|
||||||
|
httpPost.setEntity(entity);
|
||||||
|
|
||||||
|
// 执行请求,获取响应对象
|
||||||
|
CloseableHttpResponse response = httpClient.execute(httpPost);
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 从响应对象中获取响应实体
|
||||||
|
HttpEntity responseEntity = response.getEntity();
|
||||||
|
|
||||||
|
// 处理响应数据
|
||||||
|
responseBody = EntityUtils.toString(responseEntity);
|
||||||
|
System.out.println(responseBody);
|
||||||
|
} finally {
|
||||||
|
// 关闭响应对象
|
||||||
|
response.close();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
// 关闭 HttpClient
|
||||||
|
httpClient.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return responseBody;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static String delete(String jsonBody) {
|
||||||
|
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||||
|
|
||||||
|
// 创建 POST 请求对象
|
||||||
|
HttpPost httpPost = new HttpPost("https://www.jiyuankeshang.com/api/v5/app/entry/data/delete");
|
||||||
|
|
||||||
|
String responseBody = null;
|
||||||
|
try {
|
||||||
|
// 设置请求头
|
||||||
|
httpPost.setHeader("Content-Type", "application/json");
|
||||||
|
httpPost.setHeader("Authorization", "Bearer " + "BkIyzlh1onqnqu9cQ3ralDQBjECn97ex");
|
||||||
|
|
||||||
|
|
||||||
|
StringEntity entity = new StringEntity(jsonBody, ContentType.APPLICATION_JSON);
|
||||||
|
httpPost.setEntity(entity);
|
||||||
|
|
||||||
|
// 执行请求,获取响应对象
|
||||||
|
CloseableHttpResponse response = httpClient.execute(httpPost);
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 从响应对象中获取响应实体
|
||||||
|
HttpEntity responseEntity = response.getEntity();
|
||||||
|
|
||||||
|
// 处理响应数据
|
||||||
|
responseBody = EntityUtils.toString(responseEntity);
|
||||||
|
System.out.println(responseBody);
|
||||||
|
} finally {
|
||||||
|
// 关闭响应对象
|
||||||
|
response.close();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
// 关闭 HttpClient
|
||||||
|
httpClient.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return responseBody;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String insert(String jsonBody) {
|
||||||
|
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||||
|
|
||||||
|
// 创建 POST 请求对象
|
||||||
|
HttpPost httpPost = new HttpPost("https://www.jiyuankeshang.com/api/v5/app/entry/data/create");
|
||||||
|
|
||||||
|
String responseBody = null;
|
||||||
|
try {
|
||||||
|
// 设置请求头
|
||||||
|
httpPost.setHeader("Content-Type", "application/json");
|
||||||
|
httpPost.setHeader("Authorization", "Bearer " + "BkIyzlh1onqnqu9cQ3ralDQBjECn97ex");
|
||||||
|
|
||||||
|
|
||||||
|
StringEntity entity = new StringEntity(jsonBody, ContentType.APPLICATION_JSON);
|
||||||
|
httpPost.setEntity(entity);
|
||||||
|
|
||||||
|
// 执行请求,获取响应对象
|
||||||
|
CloseableHttpResponse response = httpClient.execute(httpPost);
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 从响应对象中获取响应实体
|
||||||
|
HttpEntity responseEntity = response.getEntity();
|
||||||
|
|
||||||
|
// 处理响应数据
|
||||||
|
responseBody = EntityUtils.toString(responseEntity);
|
||||||
|
System.out.println(responseBody);
|
||||||
|
} finally {
|
||||||
|
// 关闭响应对象
|
||||||
|
response.close();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
// 关闭 HttpClient
|
||||||
|
httpClient.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return responseBody;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
22
src/main/java/com/example/sso/util/DownUtil.java
Normal file
22
src/main/java/com/example/sso/util/DownUtil.java
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package com.example.sso.util;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
public class DownUtil {
|
||||||
|
|
||||||
|
public static String urls(String id) throws Exception {
|
||||||
|
JSONObject jsonobjects = new JSONObject();
|
||||||
|
JSONObject ownerIds = new JSONObject();
|
||||||
|
ownerIds.put("idType", "corp");
|
||||||
|
ownerIds.put("openId", "625776ecae6742cb8eb710beedef9b4c");
|
||||||
|
jsonobjects.put("ownerId", ownerIds);
|
||||||
|
jsonobjects.put("signTaskId", id);
|
||||||
|
String jsonString = jsonobjects.toJSONString();
|
||||||
|
String down = FDaDaUtil.down(jsonString);
|
||||||
|
JSONObject jsonObject = JSON.parseObject(down);
|
||||||
|
String strings = jsonObject.getJSONObject("data").getString("downloadUrl");
|
||||||
|
return strings;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
1423
src/main/java/com/example/sso/util/FDaDaUtil.java
Normal file
1423
src/main/java/com/example/sso/util/FDaDaUtil.java
Normal file
File diff suppressed because it is too large
Load Diff
86
src/main/java/com/example/sso/util/FddCryptUtil.java
Normal file
86
src/main/java/com/example/sso/util/FddCryptUtil.java
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
package com.example.sso.util;
|
||||||
|
|
||||||
|
import com.fasc.open.api.utils.string.StringUtil;
|
||||||
|
|
||||||
|
import javax.crypto.Mac;
|
||||||
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
import javax.xml.bind.DatatypeConverter;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.security.MessageDigest;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Fadada
|
||||||
|
* 2021/9/8 16:09:38
|
||||||
|
*/
|
||||||
|
public class FddCryptUtil {
|
||||||
|
|
||||||
|
|
||||||
|
private FddCryptUtil() {
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Charset UTF8 = StandardCharsets.UTF_8;
|
||||||
|
|
||||||
|
public static byte[] hmac256(byte[] key, String msg) throws Exception {
|
||||||
|
Mac mac = Mac.getInstance("HmacSHA256");
|
||||||
|
SecretKeySpec secretKeySpec = new SecretKeySpec(key, mac.getAlgorithm());
|
||||||
|
mac.init(secretKeySpec);
|
||||||
|
return mac.doFinal(msg.getBytes(UTF8));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String sha256Hex(String s) throws Exception {
|
||||||
|
MessageDigest md = MessageDigest.getInstance("SHA-256");
|
||||||
|
byte[] d = md.digest(s.getBytes(UTF8));
|
||||||
|
return DatatypeConverter.printHexBinary(d).toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param sortParam 排序后得参数字符串
|
||||||
|
* @param timestamp 时间戳
|
||||||
|
* @param appSecret 应用秘钥
|
||||||
|
* @return 签名值
|
||||||
|
* @throws Exception 异常
|
||||||
|
*/
|
||||||
|
public static String sign(String sortParam,
|
||||||
|
String timestamp,
|
||||||
|
String appSecret) throws Exception {
|
||||||
|
//将排序后字符串转为sha256Hex
|
||||||
|
String signText = sha256Hex(sortParam);
|
||||||
|
// ************* 计算签名 *************
|
||||||
|
byte[] secretSigning = hmac256((appSecret).getBytes(UTF8), timestamp);
|
||||||
|
//计算后得到签名
|
||||||
|
return DatatypeConverter.printHexBinary(hmac256(secretSigning, signText)).toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String sortParameters(Map<String, String> parameters) {
|
||||||
|
if (parameters.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
List<String> removeKeys = new ArrayList<>();
|
||||||
|
for (Entry<String, String> entry : parameters.entrySet()) {
|
||||||
|
if (StringUtil.isBlank(entry.getValue())) {
|
||||||
|
removeKeys.add(entry.getKey());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (String key : removeKeys) {
|
||||||
|
parameters.remove(key);
|
||||||
|
}
|
||||||
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
|
SortedMap<String, String> paramMap = new TreeMap<>(parameters);
|
||||||
|
int index = 0;
|
||||||
|
for (Entry<String, String> entry : paramMap.entrySet()) {
|
||||||
|
stringBuilder.append(entry.getKey()).append("=").append(entry.getValue());
|
||||||
|
index++;
|
||||||
|
if (index != parameters.size()) {
|
||||||
|
stringBuilder.append("&");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return stringBuilder.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
167
src/main/java/com/example/sso/util/HttpUtil.java
Normal file
167
src/main/java/com/example/sso/util/HttpUtil.java
Normal file
@ -0,0 +1,167 @@
|
|||||||
|
package com.example.sso.util;
|
||||||
|
|
||||||
|
import org.apache.http.Consts;
|
||||||
|
import org.apache.http.HttpEntity;
|
||||||
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||||
|
import org.apache.http.client.methods.HttpPost;
|
||||||
|
import org.apache.http.config.Registry;
|
||||||
|
import org.apache.http.config.RegistryBuilder;
|
||||||
|
import org.apache.http.conn.socket.ConnectionSocketFactory;
|
||||||
|
import org.apache.http.conn.socket.PlainConnectionSocketFactory;
|
||||||
|
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
|
||||||
|
import org.apache.http.entity.StringEntity;
|
||||||
|
import org.apache.http.impl.client.CloseableHttpClient;
|
||||||
|
import org.apache.http.impl.client.HttpClients;
|
||||||
|
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
|
||||||
|
import org.apache.http.util.EntityUtils;
|
||||||
|
|
||||||
|
import javax.net.ssl.SSLContext;
|
||||||
|
import javax.net.ssl.TrustManager;
|
||||||
|
import javax.net.ssl.X509TrustManager;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.security.KeyManagementException;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.security.cert.CertificateException;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/** * Http工具类,发送Http请求, Get请求请将参数放在url中 Post请求请将参数放在Map中 * * @author 程高伟 * @date 2017年1月5日 下午6:03:50 */
|
||||||
|
public class HttpUtil {
|
||||||
|
// private static final Logger log = LoggerFactory.getLogger(HttpUtil.class);
|
||||||
|
private static final CloseableHttpClient httpclient = HttpClients.createDefault();
|
||||||
|
private static final String userAgent = "Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.87 Safari/537.36";
|
||||||
|
|
||||||
|
public static SSLContext createIgnoreVerifySSL() throws NoSuchAlgorithmException, KeyManagementException {
|
||||||
|
SSLContext sc = SSLContext.getInstance("SSLv3");
|
||||||
|
|
||||||
|
// 实现一个X509TrustManager接口,用于绕过验证,不用修改里面的方法
|
||||||
|
X509TrustManager trustManager = new X509TrustManager() {
|
||||||
|
@Override
|
||||||
|
public void checkClientTrusted(
|
||||||
|
java.security.cert.X509Certificate[] paramArrayOfX509Certificate,
|
||||||
|
String paramString) throws CertificateException {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void checkServerTrusted(
|
||||||
|
java.security.cert.X509Certificate[] paramArrayOfX509Certificate,
|
||||||
|
String paramString) throws CertificateException {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
sc.init(null, new TrustManager[] { trustManager }, null);
|
||||||
|
return sc;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String sendPosts(String url, String jsonStr) throws KeyManagementException, NoSuchAlgorithmException {
|
||||||
|
//采用绕过验证的方式处理https请求
|
||||||
|
SSLContext sslcontext = createIgnoreVerifySSL();
|
||||||
|
|
||||||
|
// 设置协议http和https对应的处理socket链接工厂的对象
|
||||||
|
Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder.<ConnectionSocketFactory>create()
|
||||||
|
.register("http", PlainConnectionSocketFactory.INSTANCE)
|
||||||
|
.register("https", new SSLConnectionSocketFactory(sslcontext))
|
||||||
|
.build();
|
||||||
|
PoolingHttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager(socketFactoryRegistry);
|
||||||
|
CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(connManager).build();
|
||||||
|
String result = null;
|
||||||
|
// 字符串编码
|
||||||
|
StringEntity entity = new StringEntity(jsonStr, Consts.UTF_8);
|
||||||
|
// 设置content-type
|
||||||
|
entity.setContentType("application/json");
|
||||||
|
HttpPost httpPost = new HttpPost(url);
|
||||||
|
// 防止被当成攻击添加的
|
||||||
|
|
||||||
|
httpPost.setHeader("Authorization", "Bearer "+"BkIyzlh1onqnqu9cQ3ralDQBjECn97ex");
|
||||||
|
// 接收参数设置
|
||||||
|
|
||||||
|
httpPost.setEntity(entity);
|
||||||
|
CloseableHttpResponse response = null;
|
||||||
|
try {
|
||||||
|
response = httpClient.execute(httpPost);
|
||||||
|
HttpEntity httpEntity = response.getEntity();
|
||||||
|
result = EntityUtils.toString(httpEntity);
|
||||||
|
} catch (IOException e) {
|
||||||
|
// log.error(e.getMessage());
|
||||||
|
} finally {
|
||||||
|
// 关闭CloseableHttpResponse
|
||||||
|
if (response != null) {
|
||||||
|
try {
|
||||||
|
response.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
// log.error(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println(result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
POST请求。获取token
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
public static String sendPost(String url) throws Exception {
|
||||||
|
String result = null;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String appSecret = "0WPTPAJKWRULHJ9BGBCZGWGLNZRHY5HD";
|
||||||
|
String nonce = UUIDGenerator.getUuid();
|
||||||
|
String timestamp = Long.toString(System.currentTimeMillis());
|
||||||
|
Map<String, String> paramMap = new HashMap<>();
|
||||||
|
paramMap.put("X-FASC-App-Id", "00000916");
|
||||||
|
paramMap.put("X-FASC-Sign-Type", "HMAC-SHA256");
|
||||||
|
paramMap.put("X-FASC-Timestamp", timestamp);
|
||||||
|
paramMap.put("X-FASC-Nonce", nonce);
|
||||||
|
paramMap.put("X-FASC-Grant-Type", "client_credential");
|
||||||
|
paramMap.put("X-FASC-Api-SubVersion", "5.1");
|
||||||
|
String paramToSignStr = FddCryptUtil.sortParameters(paramMap);
|
||||||
|
String signature = FddCryptUtil.sign(paramToSignStr, timestamp, appSecret);
|
||||||
|
// System.out.println("签名值为================="+signature);
|
||||||
|
|
||||||
|
// 得到一个HttpPost对象
|
||||||
|
HttpPost httpPost = new HttpPost(url);
|
||||||
|
// 防止被当成攻击添加的
|
||||||
|
httpPost.setHeader("User-Agent", userAgent);
|
||||||
|
httpPost.setHeader("X-FASC-App-Id","00000916");
|
||||||
|
httpPost.setHeader("X-FASC-Sign-Type","HMAC-SHA256");
|
||||||
|
httpPost.setHeader("X-FASC-Sign",signature);
|
||||||
|
httpPost.setHeader("X-FASC-Timestamp",timestamp);
|
||||||
|
httpPost.setHeader("X-FASC-Nonce",nonce);
|
||||||
|
httpPost.setHeader("X-FASC-Grant-Type","client_credential");
|
||||||
|
httpPost.setHeader("X-FASC-Api-SubVersion","5.1");
|
||||||
|
|
||||||
|
CloseableHttpResponse response = null;
|
||||||
|
try {
|
||||||
|
// 执行HttpPost请求,并得到一个CloseableHttpResponse
|
||||||
|
response = httpclient.execute(httpPost);
|
||||||
|
// 从CloseableHttpResponse中拿到HttpEntity
|
||||||
|
HttpEntity entity = response.getEntity();
|
||||||
|
// 将HttpEntity转换为字符串
|
||||||
|
result = EntityUtils.toString(entity);
|
||||||
|
} catch (IOException e) {
|
||||||
|
// log.error(e.getMessage());
|
||||||
|
} finally {
|
||||||
|
// 关闭CloseableHttpResponse
|
||||||
|
if (response != null) {
|
||||||
|
try {
|
||||||
|
response.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
// log.error(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
141
src/main/java/com/example/sso/util/TimeUtil.java
Normal file
141
src/main/java/com/example/sso/util/TimeUtil.java
Normal file
@ -0,0 +1,141 @@
|
|||||||
|
package com.example.sso.util;
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class TimeUtil {
|
||||||
|
public static String day() {
|
||||||
|
LocalDate currentDate = LocalDate.now();
|
||||||
|
String one = currentDate.toString();
|
||||||
|
return one;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long nowday() {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 0); // 将小时设置为0
|
||||||
|
calendar.set(Calendar.MINUTE, 0); // 将分钟设置为0
|
||||||
|
calendar.set(Calendar.SECOND, 0); // 将秒设置为0
|
||||||
|
calendar.set(Calendar.MILLISECOND, 0); // 将毫秒设置为0
|
||||||
|
|
||||||
|
// 获取当天0点的时间戳(毫秒)
|
||||||
|
long timestamp = calendar.getTimeInMillis();
|
||||||
|
return timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long tomorowday() {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.add(Calendar.DAY_OF_MONTH, 1); // 将日期增加1天,即获取明天的日期
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 0); // 将小时设置为0
|
||||||
|
calendar.set(Calendar.MINUTE, 0); // 将分钟设置为0
|
||||||
|
calendar.set(Calendar.SECOND, 0); // 将秒设置为0
|
||||||
|
calendar.set(Calendar.MILLISECOND, 0); // 将毫秒设置为0
|
||||||
|
|
||||||
|
// 获取明天0点的时间戳(毫秒)
|
||||||
|
long timestamp = calendar.getTimeInMillis();
|
||||||
|
return timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String timeConversion(String originalDateTime) throws ParseException {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 创建日期时间格式化对象
|
||||||
|
DateFormat originalFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
|
||||||
|
originalFormat.setTimeZone(TimeZone.getTimeZone("UTC")); // 设置时区为UTC
|
||||||
|
|
||||||
|
// 解析原始日期时间字符串为Date对象
|
||||||
|
Date date = originalFormat.parse(originalDateTime);
|
||||||
|
|
||||||
|
// 加上8个小时
|
||||||
|
long timeInMillis = date.getTime() + (8 * 60 * 60 * 1000); // 8小时的毫秒数
|
||||||
|
|
||||||
|
// 创建新的日期对象
|
||||||
|
Date newDate = new Date(timeInMillis);
|
||||||
|
|
||||||
|
// 创建日期时间格式化对象,用于格式化新的日期对象
|
||||||
|
DateFormat newFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
|
// 格式化新的日期对象为字符串
|
||||||
|
String newDateTime = newFormat.format(newDate);
|
||||||
|
|
||||||
|
// 输出结果
|
||||||
|
|
||||||
|
return newDateTime;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String timeConversions(String originalDateTime) throws ParseException {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 创建日期时间格式化对象
|
||||||
|
DateFormat originalFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
|
||||||
|
|
||||||
|
// 设置时区为UTC
|
||||||
|
originalFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||||
|
|
||||||
|
// 解析原始日期时间字符串为Date对象
|
||||||
|
Date date = originalFormat.parse(originalDateTime);
|
||||||
|
|
||||||
|
// 创建日期时间格式化对象,用于格式化Date对象为字符串
|
||||||
|
DateFormat newFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
|
// 格式化Date对象为字符串
|
||||||
|
String newDateTime = newFormat.format(date);
|
||||||
|
return newDateTime;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static String month() {
|
||||||
|
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
|
||||||
|
// 获取当前月份
|
||||||
|
int year = calendar.get(Calendar.YEAR);
|
||||||
|
int month = calendar.get(Calendar.MONTH) + 1; // 月份从 0 开始,所以要加 1
|
||||||
|
|
||||||
|
// 格式化为 "YYYY-MM"
|
||||||
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM");
|
||||||
|
String formattedMonth = dateFormat.format(calendar.getTime());
|
||||||
|
return formattedMonth;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static String now() {
|
||||||
|
|
||||||
|
Date currentDate = new Date();
|
||||||
|
|
||||||
|
// 创建日期格式化对象,指定目标格式
|
||||||
|
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
|
||||||
|
// 格式化当前日期为指定格式的字符串
|
||||||
|
String formattedDate = dateFormat.format(currentDate);
|
||||||
|
return formattedDate;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
50
src/main/java/com/example/sso/util/TimeUtils.java
Normal file
50
src/main/java/com/example/sso/util/TimeUtils.java
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
package com.example.sso.util;
|
||||||
|
|
||||||
|
import java.util.Calendar;
|
||||||
|
|
||||||
|
public class TimeUtils {
|
||||||
|
public static Long tim(long currentTimestamp){
|
||||||
|
|
||||||
|
|
||||||
|
// 创建 Calendar 对象,并设置为当前时间
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTimeInMillis(currentTimestamp);
|
||||||
|
|
||||||
|
// 将时间往前推 24 小时
|
||||||
|
calendar.add(Calendar.HOUR_OF_DAY, -24);
|
||||||
|
|
||||||
|
// 获取前24小时的时间戳
|
||||||
|
long previous24HoursTimestamp = calendar.getTimeInMillis();
|
||||||
|
return previous24HoursTimestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Long tim4(long currentTimestamp){
|
||||||
|
|
||||||
|
|
||||||
|
// 创建 Calendar 对象,并设置为当前时间
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTimeInMillis(currentTimestamp);
|
||||||
|
|
||||||
|
// 将时间往前推 24 小时
|
||||||
|
calendar.add(Calendar.HOUR_OF_DAY, -48);
|
||||||
|
|
||||||
|
// 获取前24小时的时间戳
|
||||||
|
long previous24HoursTimestamp = calendar.getTimeInMillis();
|
||||||
|
return previous24HoursTimestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Long tim2(long currentTimestamp){
|
||||||
|
|
||||||
|
|
||||||
|
// 创建 Calendar 对象,并设置为当前时间
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTimeInMillis(currentTimestamp);
|
||||||
|
|
||||||
|
// 将时间往前推 24 小时
|
||||||
|
calendar.add(Calendar.HOUR_OF_DAY, -120);
|
||||||
|
|
||||||
|
// 获取前24小时的时间戳
|
||||||
|
long previous24HoursTimestamp = calendar.getTimeInMillis();
|
||||||
|
return previous24HoursTimestamp;
|
||||||
|
}
|
||||||
|
}
|
||||||
45
src/main/java/com/example/sso/util/UUIDGenerator.java
Normal file
45
src/main/java/com/example/sso/util/UUIDGenerator.java
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
/**
|
||||||
|
* com.yq365.utils.random
|
||||||
|
* UUIDGenetrator.java
|
||||||
|
*/
|
||||||
|
package com.example.sso.util;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Fadada
|
||||||
|
* 2021/9/8 16:09:38
|
||||||
|
*/
|
||||||
|
public class UUIDGenerator {
|
||||||
|
private UUIDGenerator() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得一个UUID
|
||||||
|
*
|
||||||
|
* @return String UUID
|
||||||
|
*/
|
||||||
|
public static String getUuid() {
|
||||||
|
String s = UUID.randomUUID().toString();
|
||||||
|
//去掉“-”符号
|
||||||
|
return s.substring(0, 8) + s.substring(9, 13) + s.substring(14, 18) + s.substring(19, 23) + s.substring(24);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得指定数目的UUID
|
||||||
|
*
|
||||||
|
* @param number int 需要获得的UUID数量
|
||||||
|
* @return String[] UUID数组
|
||||||
|
*/
|
||||||
|
public static String[] getUuid(int number) {
|
||||||
|
if (number < 1) {
|
||||||
|
return new String[0];
|
||||||
|
}
|
||||||
|
String[] ss = new String[number];
|
||||||
|
for (int i = 0; i < number; i++) {
|
||||||
|
ss[i] = getUuid();
|
||||||
|
}
|
||||||
|
return ss;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
11
src/main/resources/application.yaml
Normal file
11
src/main/resources/application.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
sso:
|
||||||
|
acs: https://www.jiandaoyun.com/sso/custom/59bb7045f3b3ab31f241bbf1/acs
|
||||||
|
secret:
|
||||||
|
fdd:
|
||||||
|
AppID: 80000693
|
||||||
|
AppSecret: IZRCNUH7GBDBDFPLRNJYBTVYDIVYTWGL
|
||||||
|
server:
|
||||||
|
port: 8090
|
||||||
|
#正式环境
|
||||||
|
# port: 8080
|
||||||
|
#测试环境
|
||||||
27
src/test/java/com/example/sso/SsoApplicationTests.java
Normal file
27
src/test/java/com/example/sso/SsoApplicationTests.java
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
package com.example.sso;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
//import org.junit.Test;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@SpringBootTest
|
||||||
|
class SsoApplicationTests {
|
||||||
|
|
||||||
|
// @Test
|
||||||
|
void context() {
|
||||||
|
String json = "[{\"name\":\"1111\",\"code\":\"123\"},{\"name\":\"1111\",\"code\":\"123\"},{\"name\":\"1234\",\"code\":\"111\"}]";
|
||||||
|
List list = JSONObject.parseArray(json);
|
||||||
|
HashSet hs = new HashSet(list);
|
||||||
|
String jsonSet = JSON.toJSONString(hs);
|
||||||
|
JSONArray newjsonarray= new JSONArray(Collections.singletonList(jsonSet));
|
||||||
|
System.out.println(newjsonarray);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user