Commit 5fbfa3f0 authored by “yiyousong”'s avatar “yiyousong”
parents ae42d7ac 26edbee0
...@@ -255,32 +255,23 @@ export default { ...@@ -255,32 +255,23 @@ export default {
// 获取数据列表 // 获取数据列表
async getDatasetList() { async getDatasetList() {
this.loading = true; this.loading = true;
let orConditionList = [ let obj = {};
{ let orConditionList = [];
fieldCode: this.fieldCode, let form = {
fieldValue: `%${this.searchVal}%`,
},
...this.sortSearch,
];
let res = await getDatasetList({
page: this.current, page: this.current,
size: this.size, size: this.size,
appId: this.appId, appId: this.appId,
orConditionList, };
// fieldCode: this.fieldCode, if (this.fieldCode) {
// fieldValue: `%${this.searchVal}%`, obj.fieldCode = this.fieldCode;
// orConditionList: [ obj.fieldValue = `%${this.searchVal}%`;
// { orConditionList.push(obj);
// fieldCode: this.fieldCode, }
// fieldValue: `%${this.searchVal}%`, orConditionList = [...orConditionList, ...this.sortSearch];
// }, if (orConditionList.length) {
// { form.orConditionList = orConditionList;
// fieldCode: "top", }
// fieldValue: `%%`, let res = await getDatasetList(form);
// },
// ],
});
this.loading = false; this.loading = false;
if (res.data.code === 1) { if (res.data.code === 1) {
let { data, total } = res.data.data; let { data, total } = res.data.data;
......
...@@ -14,11 +14,6 @@ ...@@ -14,11 +14,6 @@
v-model="searchForm.name" v-model="searchForm.name"
allowClear allowClear
/> />
<a-input
placeholder="请输入二级组织搜索"
v-model="searchForm.secondOrganize"
allowClear
/>
<a-button type="primary" @click="onSearch">搜索</a-button> <a-button type="primary" @click="onSearch">搜索</a-button>
<a-button @click="resetSearch">重置</a-button> <a-button @click="resetSearch">重置</a-button>
</a-space> </a-space>
...@@ -185,7 +180,6 @@ export default { ...@@ -185,7 +180,6 @@ export default {
searchValue: "", // 搜索 searchValue: "", // 搜索
searchForm: { searchForm: {
name: "", name: "",
secondOrganize: "",
}, },
tableData: [], tableData: [],
selectedRowKeys: [], selectedRowKeys: [],
...@@ -205,7 +199,6 @@ export default { ...@@ -205,7 +199,6 @@ export default {
page: this.current, page: this.current,
size: this.size, size: this.size,
name: `%${this.searchForm.name}%`, name: `%${this.searchForm.name}%`,
secondOrganize: `%${this.searchForm.secondOrganize}%`,
}); });
this.loading = false; this.loading = false;
if (res.data.code == 1) { if (res.data.code == 1) {
......
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>release</id>
<formats>
<format>tar.gz</format>
</formats>
<!-- 需要打包的文件集 -->
<fileSets>
<fileSet>
<directory>${project.parent.basedir}/base-manager-ui/admin/dist</directory>
<includes>
<include>**/*</include>
</includes>
<outputDirectory>/dist</outputDirectory>
</fileSet>
</fileSets>
</assembly>
\ No newline at end of file
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<fileMode>0755</fileMode> <fileMode>0755</fileMode>
</fileSet> </fileSet>
<fileSet> <fileSet>
<directory>${project.parent.basedir}/dist/${project.parent.artifactId}/boot</directory> <directory>${project.parent.basedir}/dist/${project.parent.artifactId}/boot</directory>
<outputDirectory>boot</outputDirectory> <outputDirectory>boot</outputDirectory>
<fileMode>0755</fileMode> <fileMode>0755</fileMode>
</fileSet> </fileSet>
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
<directory>./db</directory> <directory>./db</directory>
<includes> <includes>
<include>*.sql</include> <include>*.sql</include>
<include>service.exe</include>
<include>service.xml</include>
</includes> </includes>
<outputDirectory>db</outputDirectory> <outputDirectory>db</outputDirectory>
<fileMode>0755</fileMode> <fileMode>0755</fileMode>
......
...@@ -253,3 +253,17 @@ INSERT INTO mortals_xhx_task VALUES (null, '同步全部站点事项材料附件 ...@@ -253,3 +253,17 @@ INSERT INTO mortals_xhx_task VALUES (null, '同步全部站点事项材料附件
-- 2024-07-20 -- 2024-07-20
-- ---------------------------- -- ----------------------------
INSERT INTO `mortals_sys_base_area`(`id`, `ancestors`, `name`, `iid`, `pid`, `haveSonArea`, `haveSonDept`, `haveGetDept`, `haveGetMatterList`, `areaCode`, `areaLevel`, `shortName`, `domain`, `status`, `createTime`, `createUserId`, `updateTime`) VALUES (null, '', '巴中经济开发区', 'f190133f82dd46f0ae2e2116a8b9b13b', '60a505e9dfa643e9826902e0810de55f', 'false', 'True', 'false', 'false', '511971000000', 3, '巴中经济开发区', 'bzsbzq.sczwfw.gov.cn', 1, '2021-07-19 11:59:30', NULL, NULL); INSERT INTO `mortals_sys_base_area`(`id`, `ancestors`, `name`, `iid`, `pid`, `haveSonArea`, `haveSonDept`, `haveGetDept`, `haveGetMatterList`, `areaCode`, `areaLevel`, `shortName`, `domain`, `status`, `createTime`, `createUserId`, `updateTime`) VALUES (null, '', '巴中经济开发区', 'f190133f82dd46f0ae2e2116a8b9b13b', '60a505e9dfa643e9826902e0810de55f', 'false', 'True', 'false', 'false', '511971000000', 3, '巴中经济开发区', 'bzsbzq.sczwfw.gov.cn', 1, '2021-07-19 11:59:30', NULL, NULL);
-- ----------------------------
-- 2024-11-20 索引添加
-- ----------------------------
CREATE INDEX idx_matterId ON mortals_sys_matter_accept (matterId);
CREATE INDEX idx_matterId ON mortals_sys_matter_datum (matterId);
CREATE INDEX idx_matterId ON mortals_sys_matter_charges (matterId);
CREATE INDEX idx_matterId ON mortals_sys_matter_flowlimit (matterId);
CREATE INDEX idx_matterId ON mortals_sys_matter_intermediary (matterId);
CREATE INDEX idx_matterId ON mortals_sys_matter_question (matterId);
CREATE INDEX idx_matterId ON mortals_sys_matter_setbase (matterId);
CREATE INDEX idx_datumId ON mortals_sys_matter_datum_file (datumId);
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -24,6 +24,10 @@ ...@@ -24,6 +24,10 @@
<profiles.filepath>/mortals/app/data</profiles.filepath> <profiles.filepath>/mortals/app/data</profiles.filepath>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group> <profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace> <profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.req.json.check>false</profiles.req.json.check>
<profiles.trustedReferer></profiles.trustedReferer>
<package.environment>build</package.environment>
<skipUi>true</skipUi>
</properties> </properties>
<profiles> <profiles>
...@@ -44,10 +48,9 @@ ...@@ -44,10 +48,9 @@
<properties> <properties>
<profiles.active>test</profiles.active> <profiles.active>test</profiles.active>
<profiles.server.debug>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5513</profiles.server.debug> <profiles.server.debug>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5513</profiles.server.debug>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.nacos.server-addr>192.168.0.252:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>192.168.0.252:8848</profiles.nacos.server-addr>
<package.environment>test</package.environment> <profiles.req.json.check>false</profiles.req.json.check>
<skipUi>true</skipUi> <profiles.trustedReferer>192.168.0.98,localhost</profiles.trustedReferer>
</properties> </properties>
</profile> </profile>
...@@ -55,9 +58,8 @@ ...@@ -55,9 +58,8 @@
<id>product</id> <id>product</id>
<properties> <properties>
<profiles.active>product</profiles.active> <profiles.active>product</profiles.active>
<profiles.server.debug>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5513</profiles.server.debug>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<package.environment>build</package.environment>
<skipUi>true</skipUi>
</properties> </properties>
</profile> </profile>
...@@ -67,7 +69,6 @@ ...@@ -67,7 +69,6 @@
<profiles.active>yibin</profiles.active> <profiles.active>yibin</profiles.active>
<profiles.nacos.server-addr>172.15.28.120:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>172.15.28.120:8848</profiles.nacos.server-addr>
<package.environment>yibin</package.environment> <package.environment>yibin</package.environment>
<skipUi>true</skipUi>
</properties> </properties>
</profile> </profile>
...@@ -77,7 +78,6 @@ ...@@ -77,7 +78,6 @@
<profiles.active>regtest</profiles.active> <profiles.active>regtest</profiles.active>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<package.environment>build</package.environment> <package.environment>build</package.environment>
<skipUi>true</skipUi>
</properties> </properties>
</profile> </profile>
...@@ -86,7 +86,6 @@ ...@@ -86,7 +86,6 @@
<properties> <properties>
<profiles.active>qiling</profiles.active> <profiles.active>qiling</profiles.active>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<skipUi>true</skipUi>
</properties> </properties>
</profile> </profile>
...@@ -95,8 +94,6 @@ ...@@ -95,8 +94,6 @@
<properties> <properties>
<profiles.active>reg</profiles.active> <profiles.active>reg</profiles.active>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<package.environment>build</package.environment>
<skipUi>true</skipUi>
</properties> </properties>
</profile> </profile>
...@@ -105,8 +102,6 @@ ...@@ -105,8 +102,6 @@
<properties> <properties>
<profiles.active>yanyuan</profiles.active> <profiles.active>yanyuan</profiles.active>
<profiles.nacos.server-addr>172.16.30.245:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>172.16.30.245:8848</profiles.nacos.server-addr>
<package.environment>build</package.environment>
<skipUi>true</skipUi>
</properties> </properties>
</profile> </profile>
...@@ -115,8 +110,6 @@ ...@@ -115,8 +110,6 @@
<properties> <properties>
<profiles.active>pengxi</profiles.active> <profiles.active>pengxi</profiles.active>
<profiles.nacos.server-addr>192.168.106.6:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>192.168.106.6:8848</profiles.nacos.server-addr>
<package.environment>build</package.environment>
<skipUi>true</skipUi>
</properties> </properties>
</profile> </profile>
...@@ -125,8 +118,6 @@ ...@@ -125,8 +118,6 @@
<properties> <properties>
<profiles.active>bzjkq</profiles.active> <profiles.active>bzjkq</profiles.active>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<package.environment>build</package.environment>
<skipUi>true</skipUi>
</properties> </properties>
</profile> </profile>
...@@ -323,51 +314,9 @@ ...@@ -323,51 +314,9 @@
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<configuration>
<skip>${skipUi}</skip>
</configuration>
<executions>
<execution>
<id>exec-npm-install</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>yarn</executable>
<arguments>
<argument></argument>
</arguments>
<workingDirectory>${project.parent.basedir}/base-manager-ui/admin</workingDirectory>
</configuration>
</execution>
<execution>
<id>exec-npm-run-build</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>yarn</executable>
<arguments>
<argument>run</argument>
<arguments>${package.environment}</arguments>
</arguments>
<workingDirectory>${project.parent.basedir}/base-manager-ui/admin</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version> <version>3.3.0</version>
<executions> <executions>
<execution> <execution>
<id>make-assembly</id> <id>make-assembly</id>
...@@ -384,22 +333,6 @@ ...@@ -384,22 +333,6 @@
<outputDirectory>${project.parent.basedir}/dist/${project.artifactId}</outputDirectory> <outputDirectory>${project.parent.basedir}/dist/${project.artifactId}</outputDirectory>
</configuration> </configuration>
</execution> </execution>
<execution>
<id>make-assembly-ui</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<skipAssembly>${skipUi}</skipAssembly>
<finalName>${project.artifactId}-ui</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>./assembly/assembly-manager-ui.xml</descriptor>
</descriptors>
<outputDirectory>${project.parent.basedir}/dist/${project.artifactId}</outputDirectory>
</configuration>
</execution>
</executions> </executions>
</plugin> </plugin>
</plugins> </plugins>
......
#!/bin/sh
RETVAL=$?
SHELL_NAME="deploy"
BASEDIR=$(dirname $0)
BASEDIR=$( (
cd "$BASEDIR"
pwd
))
LOCK_FILE="/tmp/deploy.lock"
# 时间变量
CDATE=$(date "+%Y-%m-%d")
CTIME=$(date "+%H:%M:%S")
SHELL_LOG="${BASEDIR}/${SHELL_NAME}.log"
JAVA_HOME="/usr/local/java/jdk1.8"
SERVICE_PATH="/usr/lib/systemd/system"
PUBLISH_PATH="/home/publish"
PROJECT_NAME="@project.artifactId@"
PROJECT_EXECPATH="${PUBLISH_PATH}/${PROJECT_NAME}"
PROJECT_FILENAME="${PROJECT_NAME}.tar.gz"
PROJECT_SERVICE="${SERVICE_PATH}/${PROJECT_NAME}.service"
#写日志
writelog() {
LOGINFO=$1
echo "${CDATE} ${CTIME}: ${SHELL_NAME} : ${LOGINFO}" >>${SHELL_LOG}
echo ${LOGINFO}
}
#清理目标
clear_deploy() {
SERVICE=$1
EXECPATH=$2
#清理后台自启服务
rm -f ${SERVICE}
#清理执行文件目录
}
build_service() {
SERVICE=$1
EXECPATH=$2
echo "" >${SERVICE}
echo "[Unit]" >>${SERVICE}
echo "Description=${PROJECT_NAME}" >>${SERVICE}
echo "After=network.target" >>${SERVICE}
echo "" >>${SERVICE}
echo "[Service]" >>${SERVICE}
echo "Environment=\"JAVA_HOME=$JAVA_HOME\"" >>${SERVICE}
echo "Type=forking" >>${SERVICE}
echo "ExecStartPre=-/bin/sleep 5s" >>${SERVICE}
echo "ExecStart=${EXECPATH}/bin/start.sh" >>${SERVICE}
echo "ExecStop=${EXECPATH}/bin/shutdown.sh" >>${SERVICE}
echo "PrivateTmp=true" >>${SERVICE}
echo "" >>${SERVICE}
echo "[Install]" >>${SERVICE}
echo "WantedBy=multi-user.target" >>${SERVICE}
writelog "${PROJECT_NAME}服务创建完成!"
}
#启动服务与nginx
start_service() {
systemctl enable ${PROJECT_NAME}
systemctl daemon-reload
writelog "${PROJECT_NAME}服务启动..."
systemctl stop ${PROJECT_NAME}&&systemctl start ${PROJECT_NAME}
project_status=$(systemctl status "${PROJECT_NAME}"|grep Active |awk '{print $2}')
jcpid=$(ps -ef | grep -v "grep" | grep "${PROJECT_NAME} " | awk '{print $2}')
writelog "${PROJECT_NAME}服务启动,PID is ${jcpid} ,status:${project_status}"
}
#部署后台服务
project_deploy() {
writelog "${PROJECT_NAME}_deploy"
clear_deploy ${PROJECT_SERVICE} ${PROJECT_EXECPATH}
writelog "${PROJECT_NAME}_clear_finish"
tar -zvxf ./${PROJECT_FILENAME} -C ${PUBLISH_PATH}
build_service ${PROJECT_SERVICE} ${PROJECT_EXECPATH}
start_service
writelog "${PROJECT_NAME}_deploy_finish"
}
#主函数
main() {
echo "后台服务部署"
project_deploy
exit ${RETVAL}
}
main $1
package com.mortals.xhx.base.framework.config; package com.mortals.xhx.base.framework.config;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.mortals.xhx.base.framework.DateJacksonConverter; import com.mortals.xhx.base.framework.DateJacksonConverter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean; import org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean;
...@@ -10,6 +12,10 @@ import org.springframework.http.converter.json.MappingJackson2HttpMessageConvert ...@@ -10,6 +12,10 @@ import org.springframework.http.converter.json.MappingJackson2HttpMessageConvert
@Configuration @Configuration
public class ConverterConfig { public class ConverterConfig {
@Value("${jsonCheck:false}")
private Boolean jsonCheck;
@Bean @Bean
public DateJacksonConverter dateJacksonConverter() { public DateJacksonConverter dateJacksonConverter() {
return new DateJacksonConverter(); return new DateJacksonConverter();
...@@ -24,8 +30,14 @@ public class ConverterConfig { ...@@ -24,8 +30,14 @@ public class ConverterConfig {
@Bean @Bean
public MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter(ObjectMapper objectMapper) { public MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter(ObjectMapper objectMapper) {
if(jsonCheck!=null&&jsonCheck){
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true);
}
MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter = new MappingJackson2HttpMessageConverter(); MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter = new MappingJackson2HttpMessageConverter();
mappingJackson2HttpMessageConverter.setObjectMapper(objectMapper); mappingJackson2HttpMessageConverter.setObjectMapper(objectMapper);
return mappingJackson2HttpMessageConverter; return mappingJackson2HttpMessageConverter;
} }
} }
...@@ -11,7 +11,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -11,7 +11,7 @@ import javax.servlet.http.HttpServletResponse;
* @date: 2022/6/6 15:05 * @date: 2022/6/6 15:05
* @description:添加跨域响应 * @description:添加跨域响应
**/ **/
@Component //@Component
public class CrossInterceptor extends HandlerInterceptorAdapter { public class CrossInterceptor extends HandlerInterceptorAdapter {
@Override @Override
......
package com.mortals.xhx.base.framework.config; package com.mortals.xhx.base.framework.config;
import com.mortals.framework.filter.RepeatableFilter;
import com.mortals.framework.filter.XssFilter; import com.mortals.framework.filter.XssFilter;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.base.framework.filter.RepeatReadHttpRequest; import com.mortals.xhx.base.framework.filter.RepeatReadHttpRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
...@@ -21,6 +21,7 @@ import java.util.Map; ...@@ -21,6 +21,7 @@ import java.util.Map;
* @author zxfei * @author zxfei
*/ */
@Configuration @Configuration
@Slf4j
public class FilterConfig { public class FilterConfig {
@Value("${xss.enabled}") @Value("${xss.enabled}")
private String enabled; private String enabled;
...@@ -60,7 +61,6 @@ public class FilterConfig { ...@@ -60,7 +61,6 @@ public class FilterConfig {
public static class RequestReplaceFilter implements Filter { public static class RequestReplaceFilter implements Filter {
@Override @Override
public void init(javax.servlet.FilterConfig filterConfig) throws ServletException { public void init(javax.servlet.FilterConfig filterConfig) throws ServletException {
} }
@Override @Override
......
package com.mortals.xhx.base.framework.exception; package com.mortals.xhx.base.framework.exception;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpStatus;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.exception.AppException;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired;
import org.slf4j.LoggerFactory; import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException;
import com.alibaba.fastjson.JSONObject; import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.exception.AppException;
/** /**
* 统一异常处理 * 统一异常处理
...@@ -17,6 +21,10 @@ import com.mortals.framework.exception.AppException; ...@@ -17,6 +21,10 @@ import com.mortals.framework.exception.AppException;
@Slf4j @Slf4j
public class ExceptionHandle { public class ExceptionHandle {
@Autowired
private HttpServletResponse response;
public static final String KEY_RESULT_CODE = "code"; public static final String KEY_RESULT_CODE = "code";
public static final String KEY_RESULT_MSG = "msg"; public static final String KEY_RESULT_MSG = "msg";
public static final String KEY_RESULT_DATA = "data"; public static final String KEY_RESULT_DATA = "data";
...@@ -33,9 +41,14 @@ public class ExceptionHandle { ...@@ -33,9 +41,14 @@ public class ExceptionHandle {
stack.getClassName(), stack.getMethodName(), stack.getLineNumber(), e.getClass().getName()); stack.getClassName(), stack.getMethodName(), stack.getLineNumber(), e.getClass().getName());
AppException ex = (AppException) e; AppException ex = (AppException) e;
ret.put(KEY_RESULT_MSG, ex.getMessage()); ret.put(KEY_RESULT_MSG, ex.getMessage());
} else if (e instanceof HttpMessageNotReadableException || e instanceof MethodArgumentTypeMismatchException) {
log.error("[system error]", e);
response.setStatus(HttpStatus.HTTP_BAD_REQUEST);
ret.put(KEY_RESULT_MSG, "参数错误," + StrUtil.subBefore(e.getMessage(), ";", false));
} else { } else {
log.error("[system error]", e); log.error("[system error]", e);
ret.put(KEY_RESULT_MSG, "未知错误!"); response.setStatus(HttpStatus.HTTP_BAD_REQUEST);
ret.put(KEY_RESULT_MSG, "未知错误!" + e.getMessage());
} }
return ret.toJSONString(); return ret.toJSONString();
} }
......
package com.mortals.xhx.base.framework.filter;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.URLUtil;
import com.mortals.framework.service.ICacheService;
import com.mortals.xhx.common.key.RedisKey;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Profile;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URI;
import java.net.URL;
import java.util.List;
@Slf4j
//@Component
//@Profile({"yanyuan", "test"})
public class SameSiteCookieFilter implements Filter {
@Autowired
private ICacheService cacheService;
@Value("${token.database:0}")
private Integer portalDb;
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
HttpServletResponse httpResponse = (HttpServletResponse) response;
RedisTemplate<String, String> redisTemplate = cacheService.selectDbRedisTemplate(portalDb);
String trustedReferer =redisTemplate.opsForValue().get(RedisKey.KEY_REFERERS_CACHE);
List<String> allowedOrigins = StrUtil.split(trustedReferer, ",");
// Set allowedOrigins= new HashSet(Arrays.asList(allowDomain));
String originHeader=((HttpServletRequest) request).getHeader("Origin");
if(!ObjectUtils.isEmpty(originHeader)){
URI host = URLUtil.getHost(new URL(originHeader));
String origin = host.getHost();
if (allowedOrigins.contains(origin)){
httpResponse.setHeader("Access-Control-Allow-Origin", originHeader);
httpResponse.setContentType("application/json;charset=UTF-8");
httpResponse.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
httpResponse.setHeader("Access-Control-Max-Age", "3600");
httpResponse.setHeader("Access-Control-Allow-Headers", "Content-Type,authorization,authtoken");
// 如果要把Cookie发到服务器,需要指定Access-Control-Allow-Credentials字段为true
httpResponse.setHeader("Access-Control-Allow-Credentials", "true");
httpResponse.setHeader("Access-Control-Expose-Headers", "*");
}
}
chain.doFilter(request, response);
}
@Override
public void init(FilterConfig filterConfig) throws ServletException {}
@Override
public void destroy() {}
}
package com.mortals.xhx.base.framework.interceptor; package com.mortals.xhx.base.framework.interceptor;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.URLUtil;
import cn.hutool.http.HttpStatus;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth; import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.service.IAuthTokenService; import com.mortals.framework.service.IAuthTokenService;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.service.IUser; import com.mortals.framework.service.IUser;
import com.mortals.framework.util.AESUtil; import com.mortals.framework.util.AESUtil;
import com.mortals.framework.utils.ServletUtils; import com.mortals.framework.utils.ServletUtils;
import com.mortals.framework.web.interceptor.BaseInterceptor; import com.mortals.framework.web.interceptor.BaseInterceptor;
import com.mortals.xhx.base.framework.config.InterceptorConfig; import com.mortals.xhx.base.framework.config.InterceptorConfig;
import com.mortals.xhx.common.code.ApiRespCodeEnum; import com.mortals.xhx.common.code.ApiRespCodeEnum;
import com.mortals.xhx.common.key.RedisKey;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.method.HandlerMethod; import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.resource.ResourceHttpRequestHandler; import org.springframework.web.servlet.resource.ResourceHttpRequestHandler;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.util.List;
import static com.mortals.xhx.common.key.ErrorCode.*; import static com.mortals.xhx.common.key.ErrorCode.*;
...@@ -34,6 +47,11 @@ public class AuthUserInterceptor extends BaseInterceptor { ...@@ -34,6 +47,11 @@ public class AuthUserInterceptor extends BaseInterceptor {
private InterceptorConfig config; private InterceptorConfig config;
@Autowired @Autowired
private IAuthTokenService authTokenService; private IAuthTokenService authTokenService;
@Autowired
private ICacheService cacheService;
@Value("${token.database:0}")
private Integer portalDb;
@Override @Override
public int getOrder() { public int getOrder() {
...@@ -43,7 +61,22 @@ public class AuthUserInterceptor extends BaseInterceptor { ...@@ -43,7 +61,22 @@ public class AuthUserInterceptor extends BaseInterceptor {
@Override @Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
throws Exception { throws Exception {
//response.setContentType("application/json"); String referer = request.getHeader("Referer");
RedisTemplate<String, String> redisTemplate = cacheService.selectDbRedisTemplate(portalDb);
String trustedReferer =redisTemplate.opsForValue().get(RedisKey.KEY_REFERERS_CACHE);
if (!ObjectUtils.isEmpty(referer)) {
//校验host即可
URI host = URLUtil.getHost(new URL(referer));
referer = host.getHost();
//referer = StrUtil.removeSuffix(referer, "/");
List<String> trustReferers = StrUtil.split(trustedReferer, ",");
if (!ObjectUtils.isEmpty(trustReferers)) {
if (!trustReferers.contains(referer)) {
response.setStatus(HttpStatus.HTTP_BAD_REQUEST);
return false;
}
}
}
if (handler instanceof HandlerMethod) { if (handler instanceof HandlerMethod) {
HandlerMethod handlerMethod = (HandlerMethod) handler; HandlerMethod handlerMethod = (HandlerMethod) handler;
Method method = handlerMethod.getMethod(); Method method = handlerMethod.getMethod();
...@@ -64,7 +97,7 @@ public class AuthUserInterceptor extends BaseInterceptor { ...@@ -64,7 +97,7 @@ public class AuthUserInterceptor extends BaseInterceptor {
if (!auth) { if (!auth) {
//校验token不正常 //校验token不正常
String token = authTokenService.getToken(request); String token = authTokenService.getToken(request);
if(ObjectUtils.isEmpty(token)){ if (ObjectUtils.isEmpty(token)) {
ServletUtils.renderString(response, JSONObject.toJSONString(Rest.fail(ERROR_TOKEN_UNAUTHORIZED, ERROR_TOKEN_UNAUTHORIZED_CONTENT))); ServletUtils.renderString(response, JSONObject.toJSONString(Rest.fail(ERROR_TOKEN_UNAUTHORIZED, ERROR_TOKEN_UNAUTHORIZED_CONTENT)));
return false; return false;
} }
...@@ -106,4 +139,10 @@ public class AuthUserInterceptor extends BaseInterceptor { ...@@ -106,4 +139,10 @@ public class AuthUserInterceptor extends BaseInterceptor {
} }
public static void main(String[] args) throws MalformedURLException {
String url="http://192.168.0.1:9989";
URI host = URLUtil.getHost(new URL(url));
System.out.println(host.getHost());
}
} }
...@@ -62,24 +62,5 @@ public class OperLogController extends BaseCRUDJsonBodyMappingController<OperLog ...@@ -62,24 +62,5 @@ public class OperLogController extends BaseCRUDJsonBodyMappingController<OperLog
}); });
} }
/* @Override
protected void init(HttpServletRequest request, HttpServletResponse response, OperLogForm form,
Map<String, Object> model, Context context) {
Map<String, Object> status = new HashMap<String, Object>(1);
// 返回日志类型
status.put("operType", OperTypeEnum.getEnumMap());
model.put(KEY_RESULT_DICT, status);
super.init(request, response, form, model, context);
}
@Override
protected void doListBefore(HttpServletRequest request, HttpServletResponse response, OperLogForm form, Map<String, Object> model, Context context) throws AppException {
form.getQuery().setOrderColList(new ArrayList<OrderCol>() {
{
add(new OrderCol("a.logDate", "desc"));
}
});
}*/
} }
\ No newline at end of file
...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.RepeatSubmit; import com.mortals.framework.annotation.RepeatSubmit;
import com.mortals.framework.annotation.UnAuth; import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.code.PageDisplayType; import com.mortals.framework.common.code.PageDisplayType;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.util.FileUtil; import com.mortals.framework.util.FileUtil;
...@@ -21,6 +22,7 @@ import com.mortals.xhx.common.code.ModStatusEnum; ...@@ -21,6 +22,7 @@ import com.mortals.xhx.common.code.ModStatusEnum;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
...@@ -48,6 +50,16 @@ public class ParamController extends BaseCRUDJsonBodyMappingController<ParamServ ...@@ -48,6 +50,16 @@ public class ParamController extends BaseCRUDJsonBodyMappingController<ParamServ
model.put(KEY_RESULT_DICT, status); model.put(KEY_RESULT_DICT, status);
} }
/**
* @param query
* @param list
* @param context
* @throws AppException
*/
@Override
protected void doListAfter(ParamEntity query, List<ParamEntity> list, Context context) throws AppException {
super.doListAfter(query, list, context);
}
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "key") @RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "key")
@UnAuth @UnAuth
......
...@@ -395,23 +395,6 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE ...@@ -395,23 +395,6 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
siteService.updateAllSiteTree(null); siteService.updateAllSiteTree(null);
/* //单独更新全站点
UserEntity userEntity = new UserEntity();
userEntity.initAttrValue();
userEntity.setId(0L);
Context contextTemp = new Context();
contextTemp.setUser(userEntity);
SyncTreeSiteThread syncTreeSiteThread = new SyncTreeSiteThread(contextTemp);
ThreadPool.getInstance().execute(syncTreeSiteThread);
userEntity = new UserEntity();
userEntity.initAttrValue();
userEntity.setId(1L);
contextTemp = new Context();
contextTemp.setUser(userEntity);
syncTreeSiteThread = new SyncTreeSiteThread(contextTemp);
ThreadPool.getInstance().execute(syncTreeSiteThread);
*/
} }
...@@ -429,7 +412,7 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE ...@@ -429,7 +412,7 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
List<UserEntity> newUserList = userPduList.stream().map(newUser -> { List<UserEntity> newUserList = userPduList.stream().map(newUser -> {
UserEntity userEntity = new UserEntity(); UserEntity userEntity = new UserEntity();
userEntity.initAttrValue(); userEntity.initAttrValue();
BeanUtils.copyProperties(newUser, userEntity, new String[]{ "lastLoginTime", "lastLoginAddress"}); BeanUtils.copyProperties(newUser, userEntity, new String[]{"lastLoginTime", "lastLoginAddress"});
return userEntity; return userEntity;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
...@@ -497,8 +480,8 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE ...@@ -497,8 +480,8 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
System.out.println(SecurityUtil.md5DoubleEncoding("xhxADMIN8@a")); System.out.println(SecurityUtil.md5DoubleEncoding("xhxADMIN8@a"));
System.out.println(SecurityUtil.md5DoubleEncoding("123")); // System.out.println(SecurityUtil.md5DoubleEncoding("123"));
// System.out.println(SecurityUtil.md5DoubleEncoding("Qt123456@")); // System.out.println(SecurityUtil.md5DoubleEncoding("Qt123456@"));
/* /*
//宜宾一体化账号密码 //宜宾一体化账号密码
......
...@@ -38,4 +38,10 @@ public class RedisKey { ...@@ -38,4 +38,10 @@ public class RedisKey {
*/ */
public static final Long KEY_SEARCH_TIMEOUTT_CACHE = 3600L; public static final Long KEY_SEARCH_TIMEOUTT_CACHE = 3600L;
/**
* referers
*/
public static final String KEY_REFERERS_CACHE = "referers";
} }
...@@ -20,8 +20,8 @@ public class AreaMatchCodeUtil { ...@@ -20,8 +20,8 @@ public class AreaMatchCodeUtil {
if (AreaLevelEnum.地市州.getValue() == areaLevel) { if (AreaLevelEnum.地市州.getValue() == areaLevel) {
matchCode=StrUtil.sub(matchCode, 0, 3); matchCode=StrUtil.sub(matchCode, 0, 4);
return StrUtil.padAfter(matchCode, 3, "0"); return StrUtil.padAfter(matchCode, 4, "0");
} else if (AreaLevelEnum.区县.getValue() == areaLevel) { } else if (AreaLevelEnum.区县.getValue() == areaLevel) {
//510921174000 //510921174000
matchCode=StrUtil.sub(matchCode, 0, 6); matchCode=StrUtil.sub(matchCode, 0, 6);
......
...@@ -81,10 +81,28 @@ public class MatterDetailHtmlParseUtil { ...@@ -81,10 +81,28 @@ public class MatterDetailHtmlParseUtil {
String blankSampleExp = "//div[@id=\"zhezhao\"]//div[@class='zhezhao4']"; String blankSampleExp = "//div[@id=\"zhezhao\"]//div[@class='zhezhao4']";
String sampleExp = "//div[@id=\"zhezhao\"]//div[@class='zhezhao2']"; String sampleExp = "//div[@id=\"zhezhao\"]//div[@class='zhezhao2']";
String baseInfoExp = "//div[@id=\"zhezhao\"]//div[@class='zhezhao3']"; String baseInfoExp = "//div[@id=\"zhezhao\"]//div[@class='zhezhao3']";
String baseInfoTableNameExp = "//*[@id=\"material\"]//tr//td[2]/span[1]";
// String baseInfoTableNameExp = "//*[@id=\"material\"]//tr/td[2]/span[1]";
String baseInfoTableMustExp = "//*[@id=\"material\"]//tr/td[3]/span[1]";
try { try {
Elements baseInfoTableNameElements = dom.selectXpath(baseInfoTableNameExp);
Elements baseInfoTableMustElements = dom.selectXpath(baseInfoTableMustExp);
int size = baseInfoTableNameElements.size();
int size1 = baseInfoTableMustElements.size();
Map<String, String> nameMustMap = new HashMap<>();
if (size == size1) {
for (int i = 0; i < size; i++) {
Element element = baseInfoTableNameElements.get(i);
Element element1 = baseInfoTableMustElements.get(i);
if (!ObjectUtils.isEmpty(element)&&!ObjectUtils.isEmpty(element1)) {
nameMustMap.put(element.text(), element1.text());
}
}
}
Elements elements = dom.selectXpath(blankSampleExp); Elements elements = dom.selectXpath(blankSampleExp);
int rowNum = elements.size(); int rowNum = elements.size();
for (int i = 1; i <= rowNum; i++) { for (int i = 1; i <= rowNum; i++) {
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
List<MatterDatumFileEntity> datumFileEntities = new ArrayList<>(); List<MatterDatumFileEntity> datumFileEntities = new ArrayList<>();
...@@ -111,20 +129,8 @@ public class MatterDetailHtmlParseUtil { ...@@ -111,20 +129,8 @@ public class MatterDetailHtmlParseUtil {
List<String> allGroup = ReUtil.findAllGroup1("'(.*?)'", onclickStr); List<String> allGroup = ReUtil.findAllGroup1("'(.*?)'", onclickStr);
if (!ObjectUtils.isEmpty(allGroup)) { if (!ObjectUtils.isEmpty(allGroup)) {
/* String encryUrl = "http://www.sczwfw.gov.cn/jiq/interface/item/annex/encryptUrl?id=" + allGroup.get(0);
String resp = HttpUtil.get(encryUrl);
JSONObject obj = JSON.parseObject(resp);
String code = obj.getString("code");
String data = obj.getString("data");
if ("0".equals(code)) {
fileEntity.setFileUrl(data);
fileEntity.setLocalFileUrl(data);
}*/
fileEntity.setFileUrl(allGroup.get(0)); fileEntity.setFileUrl(allGroup.get(0));
} }
// fileEntity.setFileUrl(node.firstChild().attr("href").trim());
datumFileEntities.add(fileEntity); datumFileEntities.add(fileEntity);
} }
} }
...@@ -151,25 +157,13 @@ public class MatterDetailHtmlParseUtil { ...@@ -151,25 +157,13 @@ public class MatterDetailHtmlParseUtil {
List<String> allGroup = ReUtil.findAllGroup1("'(.*?)'", onclickStr); List<String> allGroup = ReUtil.findAllGroup1("'(.*?)'", onclickStr);
if (!ObjectUtils.isEmpty(allGroup)) { if (!ObjectUtils.isEmpty(allGroup)) {
/* String encryUrl = "http://www.sczwfw.gov.cn/jiq/interface/item/annex/encryptUrl?id=" + allGroup.get(0);
String resp = HttpUtil.get(encryUrl);
JSONObject obj = JSON.parseObject(resp);
String code = obj.getString("code");
String data = obj.getString("data");
if ("0".equals(code)) {
fileEntity.setFileUrl(data);
fileEntity.setLocalFileUrl(data);
}*/
fileEntity.setFileUrl(allGroup.get(0)); fileEntity.setFileUrl(allGroup.get(0));
} }
// fileEntity.setFileUrl(node.firstChild().attr("href").trim());
datumSampleFileEntities.add(fileEntity); datumSampleFileEntities.add(fileEntity);
} }
map.put("sampleList", datumSampleFileEntities); map.put("sampleList", datumSampleFileEntities);
} }
//查询基本信息 //查询基本信息
String tempxPath2 = baseInfoExp + String.format("[%d]//table//tr//td", i); String tempxPath2 = baseInfoExp + String.format("[%d]//table//tr//td", i);
Elements baseinfoList = dom.selectXpath(tempxPath2); Elements baseinfoList = dom.selectXpath(tempxPath2);
...@@ -184,6 +178,11 @@ public class MatterDetailHtmlParseUtil { ...@@ -184,6 +178,11 @@ public class MatterDetailHtmlParseUtil {
baseInfoMap.put(prenode.text().trim(), node.text().trim()); baseInfoMap.put(prenode.text().trim(), node.text().trim());
} }
} }
String name = baseInfoMap.get("材料名称");
String must = nameMustMap.get(name);
if(!ObjectUtils.isEmpty(must)){
baseInfoMap.put("材料必要性", must);
}
map.put("baseinfo", baseInfoMap); map.put("baseinfo", baseInfoMap);
mapList.add(map); mapList.add(map);
} }
...@@ -441,7 +440,8 @@ public class MatterDetailHtmlParseUtil { ...@@ -441,7 +440,8 @@ public class MatterDetailHtmlParseUtil {
// String url = "http://www.sczwfw.gov.cn/jiq/front/transition/ywTransToDetail?areaCode=511500000000&itemCode=511A0151400000-511500000000-000-511501-7-1-00&taskType=1&deptCode=511501-7"; // String url = "http://www.sczwfw.gov.cn/jiq/front/transition/ywTransToDetail?areaCode=511500000000&itemCode=511A0151400000-511500000000-000-511501-7-1-00&taskType=1&deptCode=511501-7";
// String url = "http://www.sczwfw.gov.cn/jiq/front/transition/ywTransToDetail?areaCode=511500000000&itemCode=511A0000400004-511500000000-000-1151120000870212XU-1-00&taskType=1&deptCode=3922757070285361152"; // String url = "http://www.sczwfw.gov.cn/jiq/front/transition/ywTransToDetail?areaCode=511500000000&itemCode=511A0000400004-511500000000-000-1151120000870212XU-1-00&taskType=1&deptCode=3922757070285361152";
// String url = "http://www.sczwfw.gov.cn/jiq/front/transition/ywTransToDetail?areaCode=511500000000&itemCode=512036008003-511500000000-000-11511200MB1503849K-1-00&taskType=20&deptCode=3907787168696946688"; // String url = "http://www.sczwfw.gov.cn/jiq/front/transition/ywTransToDetail?areaCode=511500000000&itemCode=512036008003-511500000000-000-11511200MB1503849K-1-00&taskType=20&deptCode=3907787168696946688";
String url = "https://www.sczwfw.gov.cn/jiq/front/transition/ywTransToDetail?areaCode=511500000000&itemCode=511A0101600004-511500000000-000-11511200008702584B-1-00&taskType=1&deptCode=511501-7"; //String url = "https://www.sczwfw.gov.cn/jiq/front/transition/ywTransToDetail?areaCode=511500000000&itemCode=511A0101600004-511500000000-000-11511200008702584B-1-00&taskType=1&deptCode=511501-7";
String url = "http://www.sczwfw.gov.cn/jiq/front/transition/ywTransToDetail?areaCode=511500000000&itemCode=511A0358400001-511500000000-000-11511200MB1666138E-1-00&taskType=1&deptCode=11511200008702664Y";
Document dom = MatterDetailHtmlParseUtil.getDomByHtml(url); Document dom = MatterDetailHtmlParseUtil.getDomByHtml(url);
Map<String, String> baseInfoMap = MatterDetailHtmlParseUtil.getbaseInfoMapByHtml(dom); Map<String, String> baseInfoMap = MatterDetailHtmlParseUtil.getbaseInfoMapByHtml(dom);
......
...@@ -10,6 +10,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -10,6 +10,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import static com.mortals.xhx.common.key.Constant.USER_SITE_TREE; import static com.mortals.xhx.common.key.Constant.USER_SITE_TREE;
...@@ -22,6 +23,8 @@ public class DemoStartedService implements IApplicationStartedService { ...@@ -22,6 +23,8 @@ public class DemoStartedService implements IApplicationStartedService {
private ICacheService cacheService; private ICacheService cacheService;
@Autowired @Autowired
private SiteService siteService; private SiteService siteService;
@Autowired
private UserService userService;
@Override @Override
public void start() { public void start() {
...@@ -29,7 +32,9 @@ public class DemoStartedService implements IApplicationStartedService { ...@@ -29,7 +32,9 @@ public class DemoStartedService implements IApplicationStartedService {
log.info("开始服务..[初始化用户站点树]"); log.info("开始服务..[初始化用户站点树]");
//删除redis 中的 站点树 //删除redis 中的 站点树
cacheService.del(USER_SITE_TREE); cacheService.del(USER_SITE_TREE);
siteService.updateAllSiteTree(null);
//从门户获取所有站点用户
userService.refreshUser();
} }
@Override @Override
......
package com.mortals.xhx.daemon.task;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.service.ITask;
import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.framework.utils.ServletUtils;
import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.module.matter.model.MatterDatumFileEntity;
import com.mortals.xhx.module.matter.model.MatterDatumFileQuery;
import com.mortals.xhx.module.matter.service.MatterDatumFileService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StopWatch;
import org.springframework.web.multipart.MultipartFile;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.ConnectException;
import java.net.SocketTimeoutException;
import java.util.ArrayList;
import java.util.List;
import static com.mortals.xhx.common.key.Constant.MAX_RETRY_COUNT;
/**
* 同步全部站点事项材料附件
*
* @author: zxfei
* @date: 2024/2/27 15:34
*/
@Slf4j
//@Service("SyncMatterDaumFileTask")
public class SyncMatterDaumFileTaskImpl implements ITaskExcuteService {
@Autowired
private MatterDatumFileService matterDatumFileService;
@Autowired
private UploadService uploadService;
@Override
public void excuteTask(ITask task) throws AppException {
log.info("开始同步材料列表附件! 分页获取");
int total = matterDatumFileService.count(new MatterDatumFileQuery(), null);
int page = total / 1000 + 1;
StopWatch stopWatch = new StopWatch("watch daum file");
for (int i = 1; i <= page; i++) {
try {
stopWatch.start("同步附件");
PageInfo pageInfo = new PageInfo();
pageInfo.setCurrPage(i);
pageInfo.setPrePageResult(1000);
List<MatterDatumFileEntity> datumFileEntities = matterDatumFileService.find(new MatterDatumFileQuery(), pageInfo, null).getList();
List<MatterDatumFileEntity> updateList = new ArrayList<>();
for (MatterDatumFileEntity datumFileEntity : datumFileEntities) {
String localFileUrl = datumFileEntity.getLocalFileUrl();
if (ObjectUtils.isEmpty(localFileUrl) && !ObjectUtils.isEmpty(datumFileEntity.getFileUrl())) {
String encryUrl = "http://www.sczwfw.gov.cn/jiq/interface/item/annex/encryptUrl?id=" + datumFileEntity.getFileUrl();
// Thread.sleep(300);
String resp = HttpUtil.get(encryUrl, 60000);
JSONObject obj = JSON.parseObject(resp);
String code = obj.getString("code");
String data = obj.getString("data");
if ("0".equals(code)) {
//下载文件
int reCount = 0;
while (reCount < 3) {
try {
byte[] fileData = HttpUtil.downloadBytes(data);
InputStream inputStream = new ByteArrayInputStream(fileData);
MultipartFile file = ServletUtils.getMultipartFile(inputStream, datumFileEntity.getFileName());
String filePath = uploadService.saveFileUpload(file, "file/fileupload/daumfile", null);
if (!ObjectUtils.isEmpty(filePath)) {
datumFileEntity.setLocalFileUrl("/" + filePath);
MatterDatumFileEntity updateEntity = new MatterDatumFileEntity();
updateEntity.setId(datumFileEntity.getId());
updateEntity.setLocalFileUrl(datumFileEntity.getLocalFileUrl());
updateList.add(updateEntity);
}
break;
} catch (Exception e) {
log.error("下载附件异常,id:{},url:{}",datumFileEntity.getFileUrl(),data, e);
reCount++;
try {
Thread.sleep(2000);
} catch (InterruptedException ie) {
}
}
}
}
}
}
if (!ObjectUtils.isEmpty(updateList)) {
log.info("开始更新附件本地地址==》{}", updateList.size());
matterDatumFileService.update(updateList);
}
log.info("同步材料附件{}条完成,耗时:{}s", updateList.size(), stopWatch.getLastTaskTimeMillis() / 1000);
} catch (Exception e) {
log.error("同步材料附件异常", e);
}
stopWatch.stop();
}
}
@Override
public void stopTask(ITask task) throws AppException {
}
public static void main(String[] args) {
int total = 1001;
int page = total / 1000;
System.out.println(page);
}
}
...@@ -36,54 +36,10 @@ public class SyncUserTaskImpl implements ITaskExcuteService { ...@@ -36,54 +36,10 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
@Autowired @Autowired
private UserService userService; private UserService userService;
@Autowired
private IUserFeign userFeign;
@Override @Override
public void excuteTask(ITask task) throws AppException { public void excuteTask(ITask task) throws AppException {
userService.refreshUser();
log.info("同步用户"); log.info("同步用户");
/* UserPdu userPdu = new UserPdu(); userService.refreshUser();
userPdu.setPage(1);
userPdu.setSize(-1);
Rest<RespData<List<UserPdu>>> list = userFeign.list(userPdu);
userService.updateUserList(list.getData().getData());*/
//resourceService.updateUserList();
/* UserPdu userPdu = new UserPdu();
userPdu.setPage(1);
userPdu.setSize(-1);
Rest<RespData<List<UserPdu>>> list = userFeign.list(userPdu);
*//* List<UserPdu> firstList = list.getData().getData();
List<UserEntity> secondList = userService.find(new UserQuery());
//交叉对比后,多的新增 少的删除
List<UserEntity> diffList = secondList.parallelStream()
.filter(item -> !firstList.parallelStream().map(e -> e.getId()).collect(Collectors.toList()).contains(item.getId()))
.collect(Collectors.toList());*//*
//log.info("diffList:{}",JSON.toJSONString(diffList));
//更新本地用户信息,并且更新用户站点树
list.getData().getData().forEach(user -> {
//查询用户是否存在,
//UserEntity userEntity = userService.get(user.getId());
UserEntity userEntity =userService.selectOne(new UserQuery().loginName(user.getLoginName()));
if (ObjectUtils.isEmpty(userEntity)) {
//新增
UserEntity entity = new UserEntity();
entity.initAttrValue();
BeanUtils.copyProperties(user, entity, BeanUtil.getNullPropertyNames(user));
userService.save(entity);
Context context = new Context();
context.setUser(entity);
new Thread(new SyncTreeSiteThread(siteService, context)).start();
}
});*/
} }
......
...@@ -13,5 +13,5 @@ import java.util.List; ...@@ -13,5 +13,5 @@ import java.util.List;
public interface AppDao extends ICRUDDao<AppEntity,Long>{ public interface AppDao extends ICRUDDao<AppEntity,Long>{
String doSting();
} }
...@@ -17,5 +17,12 @@ import java.util.List; ...@@ -17,5 +17,12 @@ import java.util.List;
public class AppDaoImpl extends BaseCRUDDaoMybatis<AppEntity,Long> implements AppDao { public class AppDaoImpl extends BaseCRUDDaoMybatis<AppEntity,Long> implements AppDao {
/**
* @return
*/
@Override
public String doSting() {
//todo
return null;
}
} }
...@@ -23,10 +23,22 @@ public class AppVo extends BaseEntityLong { ...@@ -23,10 +23,22 @@ public class AppVo extends BaseEntityLong {
* 站点列表 * 站点列表
*/ */
private List<Long> siteIdList; private List<Long> siteIdList;
private Long siteIdStart
;
private Long siteIdEnd;
/** /**
* *
*/ */
private List <Long> idList; private List <Long> idList;
private Long idStart;
private Long idEnd;
private Long idIncrement;
/** /**
* 自主应用访问地址 * 自主应用访问地址
*/ */
......
...@@ -33,4 +33,6 @@ public interface AppService extends ICRUDService<AppEntity, Long> { ...@@ -33,4 +33,6 @@ public interface AppService extends ICRUDService<AppEntity, Long> {
AppDao getAppDao(); AppDao getAppDao();
} }
\ No newline at end of file
...@@ -12,6 +12,7 @@ import com.mortals.framework.exception.AppException; ...@@ -12,6 +12,7 @@ import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.model.OrderCol; import com.mortals.framework.model.OrderCol;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.base.system.upload.service.UploadService; import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
...@@ -49,7 +50,7 @@ import static com.mortals.xhx.common.key.Constant.CUSTAPP_ROOT_PATH; ...@@ -49,7 +50,7 @@ import static com.mortals.xhx.common.key.Constant.CUSTAPP_ROOT_PATH;
*/ */
@Service("appService") @Service("appService")
@Slf4j @Slf4j
public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, Long> implements AppService { public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEntity, Long> implements AppService {
@Autowired @Autowired
private UploadService uploadService; private UploadService uploadService;
...@@ -110,42 +111,8 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L ...@@ -110,42 +111,8 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
} else { } else {
item.setAppIconUrl(item.getAppIconPath()); item.setAppIconUrl(item.getAppIconPath());
} }
};
super.findAfter(params, pageInfo, context, list);
}
private void sortAppByIdList(AppEntity params, List<AppEntity> list) {
if (!ObjectUtils.isEmpty(params.getIdList())) {
log.info("请求的排序id列表:{}", JSON.toJSONString(params.getIdList()));
try {
//去除idlist中不存在的
Set<Long> idSet = list.stream().map(item -> item.getId()).collect(Collectors.toSet());
List<Long> idList = params.getIdList();
Iterator<Long> ite = idList.iterator();
while (ite.hasNext()) {
Long next = ite.next();
if (!idSet.contains(next)) {
ite.remove();
}
}
//根据idList进行排序
for (int i = 0; i < idList.size(); i++) {
Long id = idList.get(i);
for (int j = 0; j < list.size(); j++) {
if (id.equals(list.get(j).getId())) {
//判断位置是否一直
if (i != j) {
//交换
Collections.swap(list, i, j);
}
}
}
}
} catch (Exception e) {
log.error("排序异常!", e);
}
} }
super.findAfter(params, pageInfo, context, list);
} }
private void checkDeviceBlackApp(AppEntity params, List<AppEntity> list) { private void checkDeviceBlackApp(AppEntity params, List<AppEntity> list) {
...@@ -452,7 +419,7 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L ...@@ -452,7 +419,7 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
versionEntity.initAttrValue(); versionEntity.initAttrValue();
versionEntity.setAppId(entity.getId()); versionEntity.setAppId(entity.getId());
versionEntity.setAppName(entity.getAppName()); versionEntity.setAppName(entity.getAppName());
versionEntity.setVersion(++versionNum); versionEntity.setVersion(versionNum);
versionEntity.setNotes(entity.getNotes()); versionEntity.setNotes(entity.getNotes());
versionEntity.setFileName(entity.getFileName()); versionEntity.setFileName(entity.getFileName());
versionEntity.setFilePath(entity.getFilePath()); versionEntity.setFilePath(entity.getFilePath());
......
package com.mortals.xhx.module.base.web; package com.mortals.xhx.module.base.web;
import com.mortals.framework.annotation.UnAuth; import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ICacheService; import com.mortals.framework.service.ICacheService;
import com.mortals.framework.util.ThreadPool; import com.mortals.framework.util.ThreadPool;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.keys.RedisCacheKeys; import com.mortals.xhx.common.keys.RedisCacheKeys;
import com.mortals.xhx.common.utils.SyncGovMatterDetailThread; import com.mortals.xhx.common.utils.SyncGovMatterDetailThread;
import com.mortals.xhx.common.utils.SyncSubAreaThread; import com.mortals.xhx.common.utils.SyncSubAreaThread;
...@@ -99,7 +101,13 @@ public class BaseAreaController extends BaseCRUDJsonBodyMappingController<BaseAr ...@@ -99,7 +101,13 @@ public class BaseAreaController extends BaseCRUDJsonBodyMappingController<BaseAr
if (!bool) { if (!bool) {
throw new AppException("当前正在同步区域数据中,请勿重复提交!"); throw new AppException("当前正在同步区域数据中,请勿重复提交!");
} }
ThreadPool.getInstance().execute(new SyncSubAreaThread(this.service, baseAreaEntity, getContext()));
Rest<String> rest = this.service.genSubAreaByRootName(baseAreaEntity, getContext());
if(YesNoEnum.NO.getValue()==rest.getCode()){
throw new AppException("更新子区域失败,"+rest.getMsg());
}
// ThreadPool.getInstance().execute(new SyncSubAreaThread(this.service, baseAreaEntity, getContext()));
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS); jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_MSG, "初始同步区域数据命令下发成功!"); jsonObject.put(KEY_RESULT_MSG, "初始同步区域数据命令下发成功!");
......
...@@ -1108,6 +1108,9 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter ...@@ -1108,6 +1108,9 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
Map<String, String> baseInfoMap = MatterDetailHtmlParseUtil.getbaseInfoMapByHtml(dom); Map<String, String> baseInfoMap = MatterDetailHtmlParseUtil.getbaseInfoMapByHtml(dom);
Integer matterEditionRemote = DataUtil.converStr2Int(baseInfoMap.getOrDefault("事项版本", "0"), 0); Integer matterEditionRemote = DataUtil.converStr2Int(baseInfoMap.getOrDefault("事项版本", "0"), 0);
//由于附件连接有效性,强制更新材料属性与附件地址
saveDatumInfo(matterEntity, context, dom, sqclInfoSetting);
if (matterEditionLocal >= matterEditionRemote) { if (matterEditionLocal >= matterEditionRemote) {
return Rest.fail("本地事项版本大于等于远端,不需要更新!"); return Rest.fail("本地事项版本大于等于远端,不需要更新!");
} }
...@@ -1118,8 +1121,7 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter ...@@ -1118,8 +1121,7 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
matterEntity.setDeptName(extCache == null ? "" : extCache.getName()); matterEntity.setDeptName(extCache == null ? "" : extCache.getName());
//构建基础信息参数 //构建基础信息参数
savebaseInfo(matterEntity, baseInfoMap, baseInfoSetting); savebaseInfo(matterEntity, baseInfoMap, baseInfoSetting);
//更新材料属性
saveDatumInfo(matterEntity, context, dom, sqclInfoSetting);
//更新受理条件 //更新受理条件
saveSltjInfo(matterEntity, context, dom); saveSltjInfo(matterEntity, context, dom);
//更新办理流程 //更新办理流程
......
...@@ -15,6 +15,7 @@ import java.util.List; ...@@ -15,6 +15,7 @@ import java.util.List;
@Data @Data
public class ModelVo extends BaseEntityLong { public class ModelVo extends BaseEntityLong {
private List <Long> idList;
private Long siteId; private Long siteId;
/** 模块下包含的数据统计 */ /** 模块下包含的数据统计 */
private List<ModelCensusEntity> censusList; private List<ModelCensusEntity> censusList;
......
...@@ -194,9 +194,9 @@ public class SiteEntity extends SiteVo { ...@@ -194,9 +194,9 @@ public class SiteEntity extends SiteVo {
this.districtCode = ""; this.districtCode = "";
this.siteIp = ""; this.siteIp = "127.0.0.1";
this.sitePort = ""; this.sitePort = "9980";
this.longitude = ""; this.longitude = "";
......
...@@ -26,8 +26,12 @@ public class SiteVo extends BaseEntityLong { ...@@ -26,8 +26,12 @@ public class SiteVo extends BaseEntityLong {
private Integer areaLevel; private Integer areaLevel;
private List<Integer> areaLevelList;
private Integer total =0; private Integer total =0;
private List<SiteEntity> subList=new ArrayList<>(); private List<SiteEntity> subList=new ArrayList<>();
private List<String> modelData;
} }
\ No newline at end of file
...@@ -8,6 +8,7 @@ import com.mortals.framework.service.ICRUDService; ...@@ -8,6 +8,7 @@ import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.area.model.AreaEntity; import com.mortals.xhx.module.area.model.AreaEntity;
import com.mortals.xhx.module.area.model.AreaTreeSelect; import com.mortals.xhx.module.area.model.AreaTreeSelect;
import com.mortals.xhx.module.matter.model.MatterEntity; import com.mortals.xhx.module.matter.model.MatterEntity;
import com.mortals.xhx.module.site.dao.SiteDao;
import com.mortals.xhx.module.site.model.SiteEntity; import com.mortals.xhx.module.site.model.SiteEntity;
import com.mortals.xhx.module.site.model.SiteQuery; import com.mortals.xhx.module.site.model.SiteQuery;
import com.mortals.xhx.module.site.model.SiteTreeSelect; import com.mortals.xhx.module.site.model.SiteTreeSelect;
...@@ -28,6 +29,9 @@ import java.util.Set; ...@@ -28,6 +29,9 @@ import java.util.Set;
*/ */
public interface SiteService extends ICRUDCacheService<SiteEntity, Long> { public interface SiteService extends ICRUDCacheService<SiteEntity, Long> {
SiteDao getDao();
/** /**
* 区域站点树 * 区域站点树
* *
...@@ -69,4 +73,8 @@ public interface SiteService extends ICRUDCacheService<SiteEntity, Long> { ...@@ -69,4 +73,8 @@ public interface SiteService extends ICRUDCacheService<SiteEntity, Long> {
void deleteBysiteIdAndSource(Long siteId, Integer source, Context context); void deleteBysiteIdAndSource(Long siteId, Integer source, Context context);
void updateAllSiteTree(Context context); void updateAllSiteTree(Context context);
void updateSiteInfo(SiteEntity siteEntity, Context context);
} }
\ No newline at end of file
...@@ -33,6 +33,12 @@ import com.mortals.xhx.common.utils.MatterHtmlParseUtil; ...@@ -33,6 +33,12 @@ import com.mortals.xhx.common.utils.MatterHtmlParseUtil;
import com.mortals.xhx.common.utils.SyncTreeSiteThread; import com.mortals.xhx.common.utils.SyncTreeSiteThread;
import com.mortals.xhx.feign.device.IDeviceFeign; import com.mortals.xhx.feign.device.IDeviceFeign;
import com.mortals.xhx.feign.user.IUserFeign; import com.mortals.xhx.feign.user.IUserFeign;
import com.mortals.xhx.module.app.model.AppCategoryEntity;
import com.mortals.xhx.module.app.model.AppCategoryQuery;
import com.mortals.xhx.module.app.model.AppEntity;
import com.mortals.xhx.module.app.model.AppQuery;
import com.mortals.xhx.module.app.service.AppCategoryService;
import com.mortals.xhx.module.app.service.AppService;
import com.mortals.xhx.module.area.model.AreaEntity; import com.mortals.xhx.module.area.model.AreaEntity;
import com.mortals.xhx.module.area.model.AreaQuery; import com.mortals.xhx.module.area.model.AreaQuery;
import com.mortals.xhx.module.area.service.AreaService; import com.mortals.xhx.module.area.service.AreaService;
...@@ -117,6 +123,12 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -117,6 +123,12 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
@Autowired @Autowired
private IDeviceFeign deviceFeign; private IDeviceFeign deviceFeign;
@Autowired
private AppService appService;
@Autowired
private AppCategoryService appCategoryService;
private volatile Boolean refresh = false; private volatile Boolean refresh = false;
@Override @Override
...@@ -135,7 +147,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -135,7 +147,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
refresh = true; refresh = true;
} }
if (!oldSite.getEnglishName().equals(entity.getEnglishName())) { if (!ObjectUtils.isEmpty(oldSite.getEnglishName())&&!oldSite.getEnglishName().equals(entity.getEnglishName())) {
refresh = true; refresh = true;
} }
...@@ -201,27 +213,12 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -201,27 +213,12 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
super.saveBefore(entity, context); super.saveBefore(entity, context);
} }
@Override @Override
protected void saveAfter(SiteEntity entity, Context context) throws AppException { protected void saveAfter(SiteEntity entity, Context context) throws AppException {
super.saveAfter(entity, context); super.saveAfter(entity, context);
//刷新站点树 userService.refreshUser();
//ThreadPool.getInstance().execute(new SyncTreeSiteThread(this,context)); // this.updateAllSiteTree(context);
/* Rest<String> rest = userFeign.synchSiteAuth();
if (rest.getCode().equals(YesNoEnum.YES.getValue())) {
UserPdu userPdu = new UserPdu();
userPdu.setPage(1);
userPdu.setSize(-1);
Rest<RespData<List<UserPdu>>> list = userFeign.list(userPdu);
userService.updateUserList(list.getData().getData());
}*/
this.updateAllSiteTree(context);
//新加的站点 只需要更新全树
//更新同步部门相关
//deptService.syncDeptBySiteId(entity, context);
//通知php系统更新 //通知php系统更新
String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://127.0.0.1:11078/zwfw_api"); String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://127.0.0.1:11078/zwfw_api");
HashMap<String, String> paramsMap = new HashMap<>(); HashMap<String, String> paramsMap = new HashMap<>();
...@@ -362,14 +359,6 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -362,14 +359,6 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
protected void updateAfter(SiteEntity entity, Context context) throws AppException { protected void updateAfter(SiteEntity entity, Context context) throws AppException {
super.updateAfter(entity, context); super.updateAfter(entity, context);
//刷新站点树 //刷新站点树
/* Rest<String> rest = userFeign.synchSiteAuth();
if (rest.getCode().equals(YesNoEnum.YES.getValue())) {
UserPdu userPdu = new UserPdu();
userPdu.setPage(1);
userPdu.setSize(-1);
Rest<RespData<List<UserPdu>>> list = userFeign.list(userPdu);
userService.updateUserList(list.getData().getData());
}*/
if (refresh) { if (refresh) {
//通知设备更新站点信息 //通知设备更新站点信息
DevicePdu devicePdu = new DevicePdu(); DevicePdu devicePdu = new DevicePdu();
...@@ -377,14 +366,11 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -377,14 +366,11 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
Rest<Void> rest1 = deviceFeign.refreshMessage(devicePdu); Rest<Void> rest1 = deviceFeign.refreshMessage(devicePdu);
log.info("调用刷新结果:{}", JSON.toJSONString(rest1)); log.info("调用刷新结果:{}", JSON.toJSONString(rest1));
refresh = false; refresh = false;
//刷新用户站点树
// cacheService.del(USER_SITE_TREE);
// this.updateAllSiteTree(context);
//刷新站点树 userService.refreshUser();
cacheService.del(USER_SITE_TREE);
this.updateAllSiteTree(context);
} }
} }
...@@ -396,8 +382,14 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -396,8 +382,14 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
UserPdu userPdu = new UserPdu(); UserPdu userPdu = new UserPdu();
userPdu.setPage(1); userPdu.setPage(1);
userPdu.setSize(-1); userPdu.setSize(-1);
Rest<RespData<List<UserPdu>>> list = userFeign.list(userPdu); Rest<RespData<List<UserPdu>>> userRest = userFeign.list(userPdu);
userService.updateUserList(list.getData().getData()); if(YesNoEnum.YES.getValue()==userRest.getCode()){
if(!ObjectUtils.isEmpty(userRest.getData())
&&!ObjectUtils.isEmpty(userRest.getData().getData())) {
userService.updateUserList(userRest.getData().getData());
}
}
} }
super.removeAfter(ids, context, result); super.removeAfter(ids, context, result);
} }
...@@ -565,7 +557,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -565,7 +557,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
//没有站点 //没有站点
siteAreaVo.setSiteList(Collections.EMPTY_LIST); siteAreaVo.setSiteList(Collections.EMPTY_LIST);
} }
if(!ObjectUtils.isEmpty(siteAreaVo.getSiteList())){ if (!ObjectUtils.isEmpty(siteAreaVo.getSiteList())) {
list.add(siteAreaVo); list.add(siteAreaVo);
} }
} }
...@@ -580,17 +572,37 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -580,17 +572,37 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
@Override @Override
public Rest<List<SiteEntity>> getAreaSitesByAreaLevel(SiteQuery query, Context context) { public Rest<List<SiteEntity>> getAreaSitesByAreaLevel(SiteQuery query, Context context) {
if (!ObjectUtils.isEmpty(query.getSiteName())) { if (!ObjectUtils.isEmpty(query.getSiteName())) {
SiteEntity siteEntity = this.selectOne(new SiteQuery().siteName(query.getSiteName())); List<SiteEntity> siteEntities = this.find(new SiteQuery().siteName(query.getSiteName()));
if (!ObjectUtils.isEmpty(siteEntity)) { if (!ObjectUtils.isEmpty(siteEntities)) {
AreaEntity areaCache = areaService.getExtCache(siteEntity.getAreaCode()); List<Integer> areaLevelList = siteEntities.stream().map(siteEntity -> {
query.setAreaLevel(areaCache == null ? 1 : areaCache.getAreaLevel()); AreaEntity areaCache = areaService.getExtCache(siteEntity.getAreaCode());
log.info("areaLevel:{}", query.getAreaLevel()); if (!ObjectUtils.isEmpty(areaCache)) {
return areaCache.getAreaLevel();
}
return null;
}).filter(f -> f != null).collect(Collectors.toList());
query.setAreaLevelList(ObjectUtils.isEmpty(areaLevelList) ? Arrays.asList(1) : areaLevelList);
} else { } else {
return Rest.ok(new ArrayList<>()); return Rest.ok(new ArrayList<>());
} }
} }
//获取所有层级的区域 //获取所有层级的区域
List<AreaEntity> areaEntities = areaService.find(new AreaQuery().areaLevel(query.getAreaLevel())); List<AreaEntity> areaEntities = areaService.find(new AreaQuery().areaLevelList(query.getAreaLevelList()));
//如果针对某个区域查询 过滤到其它区域
if (!ObjectUtils.isEmpty(query.getSiteName())) {
List<SiteEntity> siteEntities = this.find(new SiteQuery().siteName(query.getSiteName()));
if (!ObjectUtils.isEmpty(siteEntities)) {
Set<String> areaSet = siteEntities.stream().map(siteEntity -> {
AreaEntity areaCache = areaService.getExtCache(siteEntity.getAreaCode());
if (!ObjectUtils.isEmpty(areaCache)) {
return areaCache.getName();
}
return null;
}).filter(f -> f != null).collect(Collectors.toSet());
areaEntities = areaEntities.stream().filter(f -> areaSet.contains(f.getName())).collect(Collectors.toList());
}
}
List<SiteEntity> list = new ArrayList<>(); List<SiteEntity> list = new ArrayList<>();
for (AreaEntity areaEntity : areaEntities) { for (AreaEntity areaEntity : areaEntities) {
...@@ -705,13 +717,11 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -705,13 +717,11 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
Integer total = restStat.getData().getOrDefault("total", 0); Integer total = restStat.getData().getOrDefault("total", 0);
//获取事项全列表 //获取事项全列表
Rest<List<MatterEntity>> matterAllRest = this.getMatterAllListByGOV(params, pageNum, context); Rest<List<MatterEntity>> matterAllRest = this.getMatterAllListByGOV(params, pageNum, context);
if (matterAllRest.getCode() == YesNoEnum.YES.getValue()) { if (matterAllRest.getCode() == YesNoEnum.YES.getValue()) {
return matterAllRest.getData(); return matterAllRest.getData();
} }
} }
return new ArrayList<MatterEntity>(); return new ArrayList<MatterEntity>();
} }
...@@ -740,56 +750,8 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -740,56 +750,8 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
} }
} }
log.info("抓取事项结束"); log.info("抓取事项结束");
/* HashMap<String, String> params = new HashMap<>();
params.put("dxType", dxType);
params.put("areaCode", siteEntity.getAreaCode());
params.put("deptCode", "");
params.put("searchtext", "");
params.put("taskType", "");
params.put("pageno", "1");
params.put("type", "2");
List<MatterEntity> govMatterList = this.getMatters(params, context);
dxType = "3";
params = new HashMap<>();
params.put("dxType", dxType);
params.put("areaCode", siteEntity.getAreaCode());
params.put("deptCode", "");
params.put("searchtext", "");
params.put("taskType", "");
params.put("pageno", "1");
params.put("type", "2");
List<MatterEntity> mattersTwo = this.getMatters(params, context);
govMatterList.addAll(mattersTwo);*/
// new MatterQuery().setMatterNoNotList();
// List<MatterEntity> localMatterList = matterService.find(new MatterQuery().areaCode(siteEntity.getAreaCode()));
//HashSet<String> matterNoSet = new HashSet<>();
Set<String> matterNoSet = matterService.getDao().getMatterListByAreaCode(new MatterQuery().areaCode(siteEntity.getAreaCode())).parallelStream().map(i -> i.getMatterNo()).collect(Collectors.toSet()); Set<String> matterNoSet = matterService.getDao().getMatterListByAreaCode(new MatterQuery().areaCode(siteEntity.getAreaCode())).parallelStream().map(i -> i.getMatterNo()).collect(Collectors.toSet());
/* Integer page = 1;
Integer size = 200;
PageInfo pageInfo = new PageInfo();
pageInfo.setCountPage(false);
while (true) {
pageInfo.setCurrPage(page);
pageInfo.setPrePageResult(size);
Result<MatterEntity> matterEntityResult = matterService.find(new MatterQuery().areaCode(siteEntity.getAreaCode()), pageInfo, context);
if (ObjectUtils.isEmpty(matterEntityResult.getList())) {
break;
}
Set<String> collect = matterEntityResult.getList().parallelStream().map(i -> i.getMatterNo()).collect(Collectors.toSet());
matterNoSet.addAll(collect);
page++;
log.info("page:{},size:{}", page, collect.size());
}*/
log.info("计算差集"); log.info("计算差集");
// List<MatterEntity> subList = this.subList(govMatterList, localMatterList); // List<MatterEntity> subList = this.subList(govMatterList, localMatterList);
List<MatterEntity> subList = this.subListSet(govMatterList, matterNoSet); List<MatterEntity> subList = this.subListSet(govMatterList, matterNoSet);
...@@ -805,47 +767,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -805,47 +767,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
matterEntity.setCreateTime(new Date()); matterEntity.setCreateTime(new Date());
matterService.save(matterEntity, context); matterService.save(matterEntity, context);
} }
/* List<List<MatterEntity>> partition = ListUtil.partition(subList, 100);
for (List<MatterEntity> matterEntityList : partition) {
log.info("insert subList size:" + matterEntityList.size());
int count = matterService.save(matterEntityList, context);
log.info("insert subList size success:" + count);
}*/
}
/* Rest<Map<String, Integer>> restStat = MatterHtmlParseUtil.statSiteMatterDeptCount(params, url);
if (restStat.getCode() == YesNoEnum.YES.getValue()) {
Integer pageNum = restStat.getData().getOrDefault("pageNum", 0);
Integer total = restStat.getData().getOrDefault("total", 0);
//获取事项全列表
Rest<List<MatterEntity>> matterAllRest = this.getMatterAllListByGOV(params, pageNum, context);
if (matterAllRest.getCode() == YesNoEnum.YES.getValue()) {
List<MatterEntity> govMatterList = matterAllRest.getData();
List<MatterEntity> localMatterList = matterService.find(new MatterQuery().areaCode(siteEntity.getAreaCode()));
List<MatterEntity> subList = this.subList(govMatterList, localMatterList);
log.info("需要添加事项数量====" + subList.size());
//差集进行插入并更新详细数据
if (!ObjectUtils.isEmpty(subList)) {
for (MatterEntity matterEntity : subList) {
DeptEntity deptCache = deptService.getExtCache(matterEntity.getDeptCode());
matterEntity.setDeptName(deptCache == null ? "" : deptCache.getName());
matterService.save(matterEntity, context);
}
List<List<MatterEntity>> partition = ListUtil.partition(subList, 100);
for (List<MatterEntity> matterEntityList : partition) {
log.info("insert subList size:" + matterEntityList.size());
int count = matterService.save(matterEntityList, context);
log.info("insert subList size success:" + count);
}
}
}
} }
*/
return Rest.ok("同步事项条数成功!"); return Rest.ok("同步事项条数成功!");
} }
...@@ -879,6 +801,45 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -879,6 +801,45 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
ThreadPool.getInstance().execute(syncTreeSiteThread); ThreadPool.getInstance().execute(syncTreeSiteThread);
} }
/**
* 外部添加站点,更新站点相关信息
*
* @param siteEntity
* @param context
*/
@Override
public void updateSiteInfo(SiteEntity siteEntity, Context context) {
List<AppEntity> updateAppList = appService.find(new AppQuery().siteId(siteEntity.getId())).stream().map(item -> {
item.setSiteId(siteEntity.getId());
item.setSiteName(siteEntity.getSiteName());
return item;
}).collect(Collectors.toList());
if(!ObjectUtils.isEmpty(updateAppList)){
appService.update(updateAppList,context);
}
List<AppCategoryEntity> updateAppCategoryList = appCategoryService.find(new AppCategoryQuery().siteId(siteEntity.getId())).stream().map(item -> {
item.setSiteId(siteEntity.getId());
item.setSiteName(siteEntity.getSiteName());
return item;
}).collect(Collectors.toList());
if(!ObjectUtils.isEmpty(updateAppCategoryList)){
appCategoryService.update(updateAppCategoryList,context);
}
List<WindowEntity> updateWindowList = windowService.find(new WindowQuery().siteId(siteEntity.getId())).stream().map(item -> {
item.setSiteId(siteEntity.getId());
item.setSiteName(siteEntity.getSiteName());
return item;
}).collect(Collectors.toList());
if(!ObjectUtils.isEmpty(updateWindowList)){
windowService.update(updateWindowList,context);
}
}
public List<MatterEntity> subList(List<MatterEntity> firstList, List<MatterEntity> secondList) { public List<MatterEntity> subList(List<MatterEntity> firstList, List<MatterEntity> secondList) {
Set<String> secondSet = secondList.parallelStream().map(e -> e.getMatterNo()).collect(Collectors.toSet()); Set<String> secondSet = secondList.parallelStream().map(e -> e.getMatterNo()).collect(Collectors.toSet());
......
...@@ -8,15 +8,21 @@ import com.mortals.framework.model.Context; ...@@ -8,15 +8,21 @@ import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result; import com.mortals.framework.model.Result;
import com.mortals.framework.service.ICacheService; import com.mortals.framework.service.ICacheService;
import com.mortals.framework.util.StringUtils;
import com.mortals.framework.util.ThreadPool; import com.mortals.framework.util.ThreadPool;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.base.system.user.model.UserEntity; import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.common.code.AreaLevelEnum; import com.mortals.xhx.common.code.AreaLevelEnum;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.key.Constant;
import com.mortals.xhx.common.keys.RedisCacheKeys; import com.mortals.xhx.common.keys.RedisCacheKeys;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.user.UserPdu;
import com.mortals.xhx.common.utils.SyncDeptThread; import com.mortals.xhx.common.utils.SyncDeptThread;
import com.mortals.xhx.common.utils.SyncGovMatterDetailThread; import com.mortals.xhx.common.utils.SyncGovMatterDetailThread;
import com.mortals.xhx.common.utils.SyncTreeSiteThread;
import com.mortals.xhx.feign.user.IUserFeign;
import com.mortals.xhx.module.area.model.AreaEntity; import com.mortals.xhx.module.area.model.AreaEntity;
import com.mortals.xhx.module.area.model.AreaQuery; import com.mortals.xhx.module.area.model.AreaQuery;
import com.mortals.xhx.module.area.service.AreaService; import com.mortals.xhx.module.area.service.AreaService;
...@@ -34,6 +40,7 @@ import com.mortals.xhx.module.site.service.SiteService; ...@@ -34,6 +40,7 @@ import com.mortals.xhx.module.site.service.SiteService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -58,15 +65,12 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic ...@@ -58,15 +65,12 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
@Autowired @Autowired
private ICacheService cacheService; private ICacheService cacheService;
@Autowired @Autowired
private MatterService matterService;
@Autowired
private DeptService deptService;
@Autowired
private SiteService siteService; private SiteService siteService;
@Autowired @Autowired
private SiteMatterService siteMatterService;
@Autowired
private AreaService areaService; private AreaService areaService;
@Autowired
@Lazy
private IUserFeign userFeign;
public SiteController() { public SiteController() {
super.setModuleDesc("站点"); super.setModuleDesc("站点");
...@@ -536,4 +540,77 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic ...@@ -536,4 +540,77 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
return jsonObject.toJSONString(); return jsonObject.toJSONString();
} }
/**
* 外部站点添加
*/
@PostMapping(value = "api/add")
@UnAuth
public String apiAdd(@RequestBody SiteEntity siteEntity) {
JSONObject jsonObject = new JSONObject();
String busiDesc = "外部站点添加" + this.getModuleDesc();
try {
String areaCode = siteEntity.getAreaCode();
String siteName = siteEntity.getSiteName();
if (ObjectUtils.isEmpty(areaCode)) {
throw new AppException("区域编码不能为空!");
}
SiteEntity one = this.service.selectOne(new SiteQuery().areaCode(areaCode).siteName(siteName), getContext());
if (!ObjectUtils.isEmpty(one)) throw new AppException("当前区域下站点名称已存在!");
AreaEntity areaEntity = areaService.selectOne(new AreaQuery().areaCode(areaCode), getContext());
siteEntity.initAttrValue();
//查询是否有站点了,如果有站点,这强制更新为站点 id=1的数据
SiteEntity site = this.service.get(1L);
if (!ObjectUtils.isEmpty(site)) {
siteEntity.setId(site.getId());
}
siteEntity.setAreaCode(areaCode);
siteEntity.setSiteName(siteName);
if (!ObjectUtils.isEmpty(areaEntity)) {
siteEntity.setAreaID(areaEntity.getIid());
siteEntity.setAreaName(areaEntity.getName());
siteEntity.setAreaLevel(areaEntity.getAreaLevel());
}
if (!ObjectUtils.isEmpty(siteEntity.getId())) {
List<SiteEntity> siteEntities = this.service.find(new SiteQuery().areaCode(siteEntity.getAreaCode()));
siteEntity.setSiteCode(siteEntity.getAreaCode() + Constant.SITE_SPLIT_MARK + StringUtils.lpad(siteEntities.size() + 1, Constant.SITE_CODE_NUM));
this.service.getDao().update(siteEntity);
//todo 更新用户站点树
/* Rest<String> rest = userFeign.synchSiteAuth();
if (rest.getCode().equals(YesNoEnum.YES.getValue())) {
UserPdu userPdu = new UserPdu();
userPdu.setPage(1);
userPdu.setSize(-1);
Rest<RespData<List<UserPdu>>> list = userFeign.list(userPdu);
this.service.updateUserList(list.getData().getData());
// ThreadPool.getInstance().execute(new SyncTreeSiteThread(this,context));
this.service.updateAllSiteTree(null);*/
} else {
this.service.save(siteEntity, getContext());
}
//todo 更新相关表中的站点名称,站点编码,站点ID
this.service.updateSiteInfo(siteEntity, getContext());
recordSysLog(request, busiDesc + " 【成功】");
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_DATA, siteEntity);
jsonObject.put(KEY_RESULT_MSG, "外部站点添加成功!");
} catch (Exception e) {
log.error("外部站点添加", e);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
jsonObject.put(KEY_RESULT_MSG, super.convertException(e));
}
return jsonObject.toJSONString();
}
} }
\ No newline at end of file
...@@ -24,6 +24,15 @@ import com.mortals.xhx.common.utils.FreeMarkerUtils; ...@@ -24,6 +24,15 @@ import com.mortals.xhx.common.utils.FreeMarkerUtils;
import com.mortals.xhx.common.utils.SendSkinRefreshTask; import com.mortals.xhx.common.utils.SendSkinRefreshTask;
import com.mortals.xhx.feign.skin.ISkinFillFeign; import com.mortals.xhx.feign.skin.ISkinFillFeign;
import com.mortals.xhx.feign.skin.ISkinSampleFeign; import com.mortals.xhx.feign.skin.ISkinSampleFeign;
import com.mortals.xhx.module.app.model.AppEntity;
import com.mortals.xhx.module.app.model.AppQuery;
import com.mortals.xhx.module.app.model.AppVersionEntity;
import com.mortals.xhx.module.app.model.AppVersionQuery;
import com.mortals.xhx.module.app.service.AppService;
import com.mortals.xhx.module.app.service.AppVersionService;
import com.mortals.xhx.module.model.model.ModelEntity;
import com.mortals.xhx.module.model.model.ModelQuery;
import com.mortals.xhx.module.model.service.ModelService;
import com.mortals.xhx.module.product.model.ProductEntity; import com.mortals.xhx.module.product.model.ProductEntity;
import com.mortals.xhx.module.product.service.ProductService; import com.mortals.xhx.module.product.service.ProductService;
import com.mortals.xhx.module.skin.dao.SkinBaseDao; import com.mortals.xhx.module.skin.dao.SkinBaseDao;
...@@ -34,6 +43,7 @@ import com.mortals.xhx.module.skin.model.SkinFieldQuery; ...@@ -34,6 +43,7 @@ import com.mortals.xhx.module.skin.model.SkinFieldQuery;
import com.mortals.xhx.module.skin.service.SkinBaseService; import com.mortals.xhx.module.skin.service.SkinBaseService;
import com.mortals.xhx.module.skin.service.SkinFieldService; import com.mortals.xhx.module.skin.service.SkinFieldService;
import freemarker.template.Template; import freemarker.template.Template;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory; import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.disk.DiskFileItemFactory;
...@@ -67,6 +77,7 @@ import java.util.zip.ZipOutputStream; ...@@ -67,6 +77,7 @@ import java.util.zip.ZipOutputStream;
* @date 2022-05-24 * @date 2022-05-24
*/ */
@Service("skinBaseService") @Service("skinBaseService")
@Slf4j
public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, SkinBaseEntity, Long> implements SkinBaseService { public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, SkinBaseEntity, Long> implements SkinBaseService {
@Autowired @Autowired
...@@ -81,6 +92,12 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk ...@@ -81,6 +92,12 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk
private ISkinSampleFeign skinSampleFeign; private ISkinSampleFeign skinSampleFeign;
@Autowired @Autowired
private ISkinFillFeign skinFillFeign; private ISkinFillFeign skinFillFeign;
@Autowired
private AppService appService;
@Autowired
private ModelService modelService;
@Autowired
private AppVersionService appVersionService;
@Override @Override
protected void validData(SkinBaseEntity entity, Context context) throws AppException { protected void validData(SkinBaseEntity entity, Context context) throws AppException {
...@@ -317,12 +334,31 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk ...@@ -317,12 +334,31 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk
File file = new File(filePath); File file = new File(filePath);
if (file.exists()) { if (file.exists()) {
try { try {
zip.putNextEntry(new ZipEntry(StrUtil.subAfter(cssFilePath, "/", false))); //读取css文件 提取图片地址
List<String> cssLines = FileUtil.readUtf8Lines(file);
for (String cssLine : cssLines) {
String cssFileUrl = StrUtil.subBetween(cssLine, "url(", ")");
if (!ObjectUtils.isEmpty(cssFileUrl)) {
String cssFileUrlPath = uploadService.getFilePath(cssFileUrl);
File cssFile = new File(cssFileUrlPath);
log.info("cssFileUrl:{} ,存在:{}", cssFileUrl, cssFile.exists());
if (cssFile.exists()) {
zip.putNextEntry(new ZipEntry(StrUtil.removePrefix(cssFileUrlPath, "/")));
IOUtils.write(FileUtil.readBytes(cssFile), zip);
zip.flush();
zip.closeEntry();
}
}
}
zip.putNextEntry(new ZipEntry(StrUtil.removePrefix(filePath, "/")));
IOUtils.write(FileUtil.readBytes(file), zip); IOUtils.write(FileUtil.readBytes(file), zip);
zip.flush(); zip.flush();
zip.closeEntry(); zip.closeEntry();
} catch (Exception e) { } catch (Exception e) {
log.error("异常", e); // log.error("异常", e.getMessage());
} }
} }
...@@ -331,12 +367,13 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk ...@@ -331,12 +367,13 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk
file = new File(filePath); file = new File(filePath);
if (file.exists()) { if (file.exists()) {
try { try {
zip.putNextEntry(new ZipEntry(StrUtil.subAfter(previewImagePath, "/", false))); zip.putNextEntry(new ZipEntry(StrUtil.removePrefix(filePath, "/")));
IOUtils.write(FileUtil.readBytes(file), zip); IOUtils.write(FileUtil.readBytes(file), zip);
zip.flush(); zip.flush();
zip.closeEntry(); zip.closeEntry();
} catch (Exception e) { } catch (Exception e) {
log.error("异常", e);
log.error("异常", e.getMessage());
} }
} }
} }
...@@ -350,16 +387,91 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk ...@@ -350,16 +387,91 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk
File file = new File(filePath); File file = new File(filePath);
if (file.exists()) { if (file.exists()) {
try { try {
zip.putNextEntry(new ZipEntry(StrUtil.subAfter(fieldValue, "/", false))); zip.putNextEntry(new ZipEntry(StrUtil.removePrefix(filePath, "/")));
IOUtils.write(FileUtil.readBytes(file), zip);
zip.flush();
zip.closeEntry();
} catch (Exception e) {
log.error("异常", e.getMessage());
}
}
}
//查询所有app 图标
List<AppEntity> appEntityList = appService.find(new AppQuery());
for (AppEntity appEntity : appEntityList) {
String fieldValue = appEntity.getFilePath();
String filePath = uploadService.getFilePath(fieldValue);
File file = new File(filePath);
if (file.exists()) {
try {
zip.putNextEntry(new ZipEntry(StrUtil.removePrefix(filePath, "/")));
IOUtils.write(FileUtil.readBytes(file), zip);
zip.flush();
zip.closeEntry();
} catch (Exception e) {
log.error("异常", e.getMessage());
}
}
String appIconPath = appEntity.getAppIconPath();
filePath = uploadService.getFilePath(appIconPath);
file = new File(filePath);
if (file.exists()) {
try {
zip.putNextEntry(new ZipEntry(StrUtil.removePrefix(filePath, "/")));
IOUtils.write(FileUtil.readBytes(file), zip);
zip.flush();
zip.closeEntry();
} catch (Exception e) {
log.error("异常", e.getMessage());
}
}
}
//查询所有model 图标
List<ModelEntity> modelEntities = modelService.find(new ModelQuery());
for (ModelEntity modelEntity : modelEntities) {
String fieldValue = modelEntity.getModelIcon();
String filePath = uploadService.getFilePath(fieldValue);
File file = new File(filePath);
if (file.exists()) {
try {
zip.putNextEntry(new ZipEntry(StrUtil.removePrefix(filePath, "/")));
IOUtils.write(FileUtil.readBytes(file), zip);
zip.flush();
zip.closeEntry();
} catch (Exception e) {
log.error("异常", e.getMessage());
}
}
}
//应用版本
List<Long> appIdList = appService.find(new AppQuery().siteId(1L)).stream().map(i -> i.getId()).collect(Collectors.toList());
AppVersionQuery appVersionQuery = new AppVersionQuery();
if (!ObjectUtils.isEmpty(appIdList)) {
appVersionQuery.setAppIdList(appIdList);
}
appVersionQuery.setUsed(1);
List<AppVersionEntity> appVersionEntities = appVersionService.find(appVersionQuery);
for (AppVersionEntity appVersionEntity : appVersionEntities) {
String filePath = appVersionEntity.getFilePath();
filePath = uploadService.getFilePath(filePath);
File file = new File(filePath);
if (file.exists()) {
try {
zip.putNextEntry(new ZipEntry(StrUtil.removePrefix(filePath, "/")));
IOUtils.write(FileUtil.readBytes(file), zip); IOUtils.write(FileUtil.readBytes(file), zip);
zip.flush(); zip.flush();
zip.closeEntry(); zip.closeEntry();
} catch (Exception e) { } catch (Exception e) {
log.error("异常", e); log.error("异常", e.getMessage());
} }
} }
} }
IOUtils.closeQuietly(zip); IOUtils.closeQuietly(zip);
return Rest.ok(outputStream.toByteArray()); return Rest.ok(outputStream.toByteArray());
} }
...@@ -381,7 +493,7 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk ...@@ -381,7 +493,7 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk
skinBaseEntity.setPreviewImagePath(StrUtil.prependIfMissing(skinBaseEntity.getPreviewImagePath(), "/")); skinBaseEntity.setPreviewImagePath(StrUtil.prependIfMissing(skinBaseEntity.getPreviewImagePath(), "/"));
} }
if(!ObjectUtils.isEmpty(query.getPrependPath())){ if (!ObjectUtils.isEmpty(query.getPrependPath())) {
} }
...@@ -399,6 +511,21 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk ...@@ -399,6 +511,21 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk
} }
skinFieldService.update(skinFieldEntities, context); skinFieldService.update(skinFieldEntities, context);
List<AppEntity> appEntityList = appService.find(new AppQuery());
for (AppEntity appEntity : appEntityList) {
if (!ObjectUtils.isEmpty(appEntity.getAppIconPath())) {
appEntity.setAppIconPath(StrUtil.prependIfMissing(appEntity.getAppIconPath(), "/"));
}
}
appService.update(appEntityList, context);
List<ModelEntity> modelEntities = modelService.find(new ModelQuery());
for (ModelEntity modelEntity : modelEntities) {
if (!ObjectUtils.isEmpty(modelEntity.getModelIcon())) {
modelEntity.setModelIcon(StrUtil.prependIfMissing(modelEntity.getModelIcon(), "/"));
}
}
modelService.update(modelEntities, context);
return Rest.ok(); return Rest.ok();
} }
...@@ -411,7 +538,7 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk ...@@ -411,7 +538,7 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk
System.out.println(result);*/ System.out.println(result);*/
String str = "/file/upload/12332.png"; String str = "file/upload/12332.png";
String s1 = StrUtil.subAfter(str, "/", false); String s1 = StrUtil.subAfter(str, "/", false);
......
...@@ -139,10 +139,9 @@ public class SkinBaseController extends BaseCRUDJsonBodyMappingController<SkinBa ...@@ -139,10 +139,9 @@ public class SkinBaseController extends BaseCRUDJsonBodyMappingController<SkinBa
/** /**
* 获取皮肤所有相关资源文件并压缩打包成zip * 获取皮肤所有相关资源文件并压缩打包成zip
*/ */
// @PostMapping(value = "skinzip") @GetMapping(value = "zip")
@GetMapping(value = "skinzip")
@UnAuth @UnAuth
public void skinzip() { public void zip() {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
try { try {
SkinBaseEntity query = new SkinBaseEntity(); SkinBaseEntity query = new SkinBaseEntity();
......
...@@ -30,6 +30,7 @@ import org.springframework.stereotype.Service; ...@@ -30,6 +30,7 @@ import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.module.window.dao.WindowBusinessDao; import com.mortals.xhx.module.window.dao.WindowBusinessDao;
import com.mortals.xhx.module.window.service.WindowBusinessService; import com.mortals.xhx.module.window.service.WindowBusinessService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.*; import java.util.*;
...@@ -133,15 +134,11 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus ...@@ -133,15 +134,11 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus
@Override @Override
protected void findAfter(WindowBusinessEntity entity, PageInfo pageInfo, Context context, List<WindowBusinessEntity> list) throws AppException { protected void findAfter(WindowBusinessEntity entity, PageInfo pageInfo, Context context, List<WindowBusinessEntity> list) throws AppException {
// Map<Long, WindowEntity> collect = windowService.getCacheList().stream().collect(Collectors.toMap(x -> x.getId(), y -> y, (o, n) -> n));
//Map<Long, WindowEntity> collect = windowService.findToMap(new WindowQuery(), context);
Map<Long, WindowHallEntity> windowHallEntityMap = windowHallService.getCacheList().stream().collect(Collectors.toMap(x -> x.getWindowId(), y -> y, (o, n) -> n)); Map<Long, WindowHallEntity> windowHallEntityMap = windowHallService.getCacheList().stream().collect(Collectors.toMap(x -> x.getWindowId(), y -> y, (o, n) -> n));
// Map<Long, WindowHallEntity> windowHallEntityMap = windowHallService.find(new WindowHallQuery(), context).parallelStream().collect(Collectors.toMap(x -> x.getWindowId(), Function.identity()));
Iterator iterator = list.iterator(); Iterator iterator = list.iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
WindowBusinessEntity item = (WindowBusinessEntity) iterator.next(); WindowBusinessEntity item = (WindowBusinessEntity) iterator.next();
//WindowEntity windowEntity = collect.get(item.getWindowId()); WindowEntity windowEntity = windowService.getCache(item.getWindowId().toString());
WindowEntity windowEntity = windowService.getCache(item.getWindowId().toString());
if (!ObjectUtils.isEmpty(item.getWindowId()) && !ObjectUtils.isEmpty(windowEntity)) { if (!ObjectUtils.isEmpty(item.getWindowId()) && !ObjectUtils.isEmpty(windowEntity)) {
item.setDeptId(windowEntity.getDeptId()); item.setDeptId(windowEntity.getDeptId());
item.setDeptName(windowEntity.getDeptName()); item.setDeptName(windowEntity.getDeptName());
...@@ -176,7 +173,7 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus ...@@ -176,7 +173,7 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus
} }
/* *//** /* *//**
* @param entity * @param entity
* @param context * @param context
* @throws AppException * @throws AppException
...@@ -189,7 +186,9 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus ...@@ -189,7 +186,9 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus
}*/ }*/
/* *//** /* */
/**
* @param entity * @param entity
* @param context * @param context
* @throws AppException * @throws AppException
...@@ -199,7 +198,6 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus ...@@ -199,7 +198,6 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus
pushChangeMsg(entity); pushChangeMsg(entity);
super.updateAfter(entity, context); super.updateAfter(entity, context);
}*/ }*/
private void pushChangeMsg(WindowBusinessEntity entity) { private void pushChangeMsg(WindowBusinessEntity entity) {
String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://172.15.28.116:8090"); String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://172.15.28.116:8090");
phpUrl += "/api/window/winNameChange"; phpUrl += "/api/window/winNameChange";
......
spring: spring:
main: main:
allow-bean-definition-overriding: true allow-bean-definition-overriding: true
# jackson:
# deserialization:
# fail-on-unknown-properties: true
application: application:
log: log:
level: info level: info
......
...@@ -13,6 +13,7 @@ spring: ...@@ -13,6 +13,7 @@ spring:
jackson: jackson:
serialization: serialization:
WRITE_DATES_AS_TIMESTAMPS: true WRITE_DATES_AS_TIMESTAMPS: true
fail_on_empty_beans: true
default-property-inclusion: NON_NULL default-property-inclusion: NON_NULL
# time-zone: GMT+8 # time-zone: GMT+8
# date-format: yyyy-MM-dd HH:mm:ss # date-format: yyyy-MM-dd HH:mm:ss
...@@ -47,3 +48,5 @@ application: ...@@ -47,3 +48,5 @@ application:
uncheckUrl: /refresh,/error,/login/login,/login/index,/login/logout,/securitycode/createCode,/file/common/*,/test*,/padsign/*,/terminal/*,/resource/list,/api/asset/*,/api/*,/flow/*,/uploads/*,/project/file/*,/file/*,/assessment/* uncheckUrl: /refresh,/error,/login/login,/login/index,/login/logout,/securitycode/createCode,/file/common/*,/test*,/padsign/*,/terminal/*,/resource/list,/api/asset/*,/api/*,/flow/*,/uploads/*,/project/file/*,/file/*,/assessment/*
dm: dm:
enable: true enable: true
jsonCheck: @profiles.req.json.check@
trustedReferer : @profiles.trustedReferer@
\ No newline at end of file
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</plugin> </plugin>
<plugin interceptor="com.mortals.framework.thirty.mybatis.LogInterceptor"> <plugin interceptor="com.mortals.framework.thirty.mybatis.LogInterceptor">
<property name="enableExecutorTime" value="false" /> <property name="enableExecutorTime" value="false" />
<property name="showSql" value="true" /> <property name="showSql" value="false" />
</plugin> </plugin>
<!-- <plugin interceptor="com.mortals.framework.thirty.dm.DmTransInterceptor"> <!-- <plugin interceptor="com.mortals.framework.thirty.dm.DmTransInterceptor">
......
...@@ -20,12 +20,12 @@ client.global.set("authToken", JSON.parse(response.body).data.token); ...@@ -20,12 +20,12 @@ client.global.set("authToken", JSON.parse(response.body).data.token);
%} %}
###自助终端应用列表 ###自助终端应用列表
POST {{baseUrl}}/app/list POST {{baseUrl}}/app/interlist
Content-Type: application/json Content-Type: application/json
{ {
"idList": [2,3,1],
"siteId": 1, "siteId": 1,
"appTypeNotList": [4],
"page": 1, "page": 1,
"size": -1 "size": -1
} }
...@@ -91,7 +91,7 @@ client.global.set("App_id", JSON.parse(response.body).data.id); ...@@ -91,7 +91,7 @@ client.global.set("App_id", JSON.parse(response.body).data.id);
%} %}
###自助终端应用查看 ###自助终端应用查看
GET {{baseUrl}}/app/info?id=1 GET {{baseUrl}}/app/interinfo?id=19999999999999999999999
Accept: application/json Accept: application/json
###自助终端应用编辑 ###自助终端应用编辑
......
...@@ -56,12 +56,15 @@ POST {{baseUrl}}/app/dataset/list ...@@ -56,12 +56,15 @@ POST {{baseUrl}}/app/dataset/list
Content-Type: application/json Content-Type: application/json
{ {
"appId": 54,
"fieldCode": "title",
"page": 1, "page": 1,
"size": 10 "size": 10,
"appId": "84",
"orConditionList": [
{
"fieldCode": "",
"fieldValue": "%%"
}
]
} }
......
...@@ -54,7 +54,7 @@ POST {{baseUrl}}/base/area/genSubAreaByAreaName ...@@ -54,7 +54,7 @@ POST {{baseUrl}}/base/area/genSubAreaByAreaName
Content-Type: application/json Content-Type: application/json
{ {
"areaCode": "513224000000" "areaCode": "511900000000"
} }
......
...@@ -9,11 +9,21 @@ ...@@ -9,11 +9,21 @@
"baseUrl": "http://192.168.0.98:11071/base" "baseUrl": "http://192.168.0.98:11071/base"
}, },
"base-product": {
"baseUrl": "http://192.168.0.250:11071/base"
},
"base-yanyuan-test": { "base-yanyuan-test": {
"baseUrl": "http://192.168.0.119:11078/base" "baseUrl": "http://192.168.0.119:11078/base"
}, },
"base-myjkq": {
"baseUrl": "http://10.6.50.2:11078/base"
},
"base-test-https": { "base-test-https": {
"baseUrl": "https://192.168.0.98:31071/basics_api/base" "baseUrl": "https://192.168.0.98:31071/basics_api/base"
}, },
......
...@@ -45,12 +45,14 @@ Content-Type: application/json ...@@ -45,12 +45,14 @@ Content-Type: application/json
###基础事项列表 ###基础事项列表
POST {{baseUrl}}/site/matter/list POST {{baseUrl}}/site/matter/interlist
Content-Type: application/json Content-Type: application/json
{ {
"page": 1, "page": 1,
"size": 10 "size": 10,
"siteId": 1,
"matterName": "特种设备作业人员资格认定取证"
} }
###微官网事项列表 ###微官网事项列表
...@@ -151,7 +153,7 @@ client.global.set("Matter_id", JSON.parse(response.body).data.id); ...@@ -151,7 +153,7 @@ client.global.set("Matter_id", JSON.parse(response.body).data.id);
%} %}
###基础事项查看 ###基础事项查看
GET {{baseUrl}}/matter/interinfo?id=34081 GET {{baseUrl}}/matter/interinfo?id=40248
Accept: application/json Accept: application/json
###基础事项编辑 ###基础事项编辑
......
...@@ -20,6 +20,17 @@ Content-Type: application/json ...@@ -20,6 +20,17 @@ Content-Type: application/json
} }
###站点列表
POST http://10.233.82.175:11078/base/site/interlist
Content-Type: application/json
{
"page":1,
"size":10
}
###站点更新与保存 ###站点更新与保存
POST {{baseUrl}}/site/save POST {{baseUrl}}/site/save
Content-Type: application/json Content-Type: application/json
...@@ -98,9 +109,20 @@ POST {{baseUrl}}/site/getAreaSitesByAreaLevel ...@@ -98,9 +109,20 @@ POST {{baseUrl}}/site/getAreaSitesByAreaLevel
Content-Type: application/json Content-Type: application/json
{ {
"areaLevel":2
"areaLevelList": [3,4,5]
} }
###根据区域等级获取站点列表
POST {{baseUrl}}/site/getSitesGroupByAreaLevel
Content-Type: application/json
{
"areaLevel":3,
"areaLevelList": [3]
}
###站点列表 ###站点列表
POST {{baseUrl}}/site/getAreaSitesBySite POST {{baseUrl}}/site/getAreaSitesBySite
Content-Type: application/json Content-Type: application/json
...@@ -147,4 +169,4 @@ Content-Type: application/json ...@@ -147,4 +169,4 @@ Content-Type: application/json
POST {{baseUrl}}/site/getSitesGroupByAreaLevel POST {{baseUrl}}/site/getSitesGroupByAreaLevel
Content-Type: application/json Content-Type: application/json
{"areaLevel":2} {"areaLevel":3,"siteName": "%翠屏区%"}
GET http://localhost:80/api/item?id=99
Accept: application/json
###
###登录 ###登录
POST {{baseUrl}}/login/login POST {{baseUrl}}/login/login
...@@ -43,7 +47,7 @@ Content-Type: application/json ...@@ -43,7 +47,7 @@ Content-Type: application/json
###短信设置查看 ###短信设置查看
GET {{baseUrl}}/sms/set/info?id=1 GET {{baseUrl}}/sms/set/interinfo?id=1
Authorization: {{authToken}} Authorization: {{authToken}}
Accept: application/json Accept: application/json
...@@ -208,14 +212,12 @@ Content-Type: application/x-www-form-urlencoded ...@@ -208,14 +212,12 @@ Content-Type: application/x-www-form-urlencoded
businessid=125&matter=125&devicenum=C0-FB-F9-CD-3B-5D&peopleid=13 businessid=125&matter=125&devicenum=C0-FB-F9-CD-3B-5D&peopleid=13
### 参数列表组合查询 ### 参数列表组合查询
POST {{baseUrl}}/param/list POST {{baseUrl}}/param/interlist
Content-Type: application/json Content-Type: application/json
{ {
"page":1, "page":1,
"size": -1, "name": "%domain%"
"firstOrganize": "Window",
"secondOrganize": "hongqi"
} }
...@@ -259,3 +261,13 @@ Content-Type: application/json ...@@ -259,3 +261,13 @@ Content-Type: application/json
{} {}
###参数信息更新与保存
POST http://192.168.0.98:8090/basics_api/zwfw/page/bury/save
Content-Type: application/json
{
"name":"upd19g"
}
...@@ -29,7 +29,7 @@ JAVA_HOME="${SOFT_PATH}/java/jdk1.8" ...@@ -29,7 +29,7 @@ JAVA_HOME="${SOFT_PATH}/java/jdk1.8"
# nginx # nginx
NGINX="nginx" NGINX="nginx"
NGINX_FILENAME="nginx-1.22.0.tar.gz" NGINX_FILENAME="nginx-1.27.1.tar.gz"
NGINX_SERVICE="${SERVICE_PATH}/${NGINX}.service" NGINX_SERVICE="${SERVICE_PATH}/${NGINX}.service"
NGINX_EXECPATH="${OPT_PATH}/${NGINX}" NGINX_EXECPATH="${OPT_PATH}/${NGINX}"
NGINX_CONF="/etc/nginx/nginx.conf" NGINX_CONF="/etc/nginx/nginx.conf"
...@@ -37,7 +37,7 @@ NGINX_CONF_PATH="/etc/nginx/conf.d" ...@@ -37,7 +37,7 @@ NGINX_CONF_PATH="/etc/nginx/conf.d"
# mysql变量 # mysql变量
MYSQL="mysql" MYSQL="mysql"
MYSQL_CENTOS_FILENAME="mysql-5.7.39-linux-glibc2.12-x86_64.tar.gz" MYSQL_CENTOS_FILENAME="mysql-5.7.43-linux-glibc2.12-x86_64.tar.gz"
MYSQL_EXECPATH="${SOFT_PATH}/${MYSQL}" MYSQL_EXECPATH="${SOFT_PATH}/${MYSQL}"
MYSQL_CONF_PATH="/etc/my.cnf" MYSQL_CONF_PATH="/etc/my.cnf"
MYSQL_DATA_PATH="${BASE_PATH}/${MYSQL}/data" MYSQL_DATA_PATH="${BASE_PATH}/${MYSQL}/data"
...@@ -129,7 +129,7 @@ unix_is_centos() { ...@@ -129,7 +129,7 @@ unix_is_centos() {
if [ -f "/etc/redhat-release" ]; then if [ -f "/etc/redhat-release" ]; then
writelog "centos" writelog "centos"
else else
writelog "ubuntu" writelog "centos"
fi fi
} }
...@@ -497,8 +497,8 @@ nacos_deploy() { ...@@ -497,8 +497,8 @@ nacos_deploy() {
rm -rf ${NACOS_SERVICE} rm -rf ${NACOS_SERVICE}
rm -rf ${NACOS_EXECPATH} rm -rf ${NACOS_EXECPATH}
mkdir -p ${NACOS_EXECPATH} mkdir -p ${NACOS_EXECPATH}
writelog "tar -zvxf $BASEDIR/release/nacos/${NACOS_FILENAME} -C ${NACOS_EXECPATH} --strip-components 2" writelog "tar -zvxf $BASEDIR/release/nacos/${NACOS_FILENAME} -C ${NACOS_EXECPATH} --strip-components 3"
tar -zvxf $BASEDIR/release/nacos/${NACOS_FILENAME} -C ${NACOS_EXECPATH} --strip-components 2 tar -zvxf $BASEDIR/release/nacos/${NACOS_FILENAME} -C ${NACOS_EXECPATH} --strip-components 3
writelog "${NACOS}_deploy init db..." writelog "${NACOS}_deploy init db..."
writelog " mysql -h${MYSQL_HOST} -P${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PASSWORD} <${NACOS_EXECPATH}/db/nacos.sql" writelog " mysql -h${MYSQL_HOST} -P${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PASSWORD} <${NACOS_EXECPATH}/db/nacos.sql"
mysql -h${MYSQL_HOST} -P${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PASSWORD} <${NACOS_EXECPATH}/db/nacos.sql mysql -h${MYSQL_HOST} -P${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PASSWORD} <${NACOS_EXECPATH}/db/nacos.sql
......
...@@ -101,6 +101,10 @@ ...@@ -101,6 +101,10 @@
<configuration> <configuration>
<delimiters>@</delimiters> <delimiters>@</delimiters>
<useDefaultDelimiters>false</useDefaultDelimiters> <useDefaultDelimiters>false</useDefaultDelimiters>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>exe</nonFilteredFileExtension>
<nonFilteredFileExtension>doc</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration> </configuration>
</plugin> </plugin>
......
...@@ -427,12 +427,6 @@ export default { ...@@ -427,12 +427,6 @@ export default {
// } // }
} }
&:nth-child(1) { &:nth-child(1) {
.type-list {
border-style: solid;
border-right-width: 2px;
border-image: linear-gradient(180deg, #0000 0%, #fff 30%, #0000 90%) 1;
// border-image-slice: 2;
}
.item-logo { .item-logo {
background: linear-gradient(180deg, #c7e1f6 0%, #ffffff 85%); background: linear-gradient(180deg, #c7e1f6 0%, #ffffff 85%);
} }
...@@ -440,6 +434,8 @@ export default { ...@@ -440,6 +434,8 @@ export default {
&:nth-child(2) { &:nth-child(2) {
.type-list { .type-list {
border-style: solid; border-style: solid;
border-width: 0px;
border-left-width: 2px;
border-right-width: 2px; border-right-width: 2px;
border-image: linear-gradient(180deg, #0000 0%, #fff 30%, #0000 90%) 1; border-image: linear-gradient(180deg, #0000 0%, #fff 30%, #0000 90%) 1;
// border-image-slice: 2; // border-image-slice: 2;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<outputDirectory>boot</outputDirectory> <outputDirectory>boot</outputDirectory>
<fileMode>0755</fileMode> <fileMode>0755</fileMode>
</fileSet> </fileSet>
<fileSet> <!-- <fileSet>
<directory>./db</directory> <directory>./db</directory>
<includes> <includes>
<include>*.sql</include> <include>*.sql</include>
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</includes> </includes>
<outputDirectory>db</outputDirectory> <outputDirectory>db</outputDirectory>
<fileMode>0755</fileMode> <fileMode>0755</fileMode>
</fileSet> </fileSet>-->
</fileSets> </fileSets>
<files> <files>
......
/*
Navicat Premium Data Transfer
Source Server : 250
Source Server Type : MySQL
Source Server Version : 50743
Source Host : 192.168.0.250:3306
Source Schema : portal-platform
Target Server Type : MySQL
Target Server Version : 50743
File Encoding : 65001
Date: 26/11/2024 10:12:39
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for mortals_xhx_apps
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_apps`;
CREATE TABLE `mortals_xhx_apps` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键,自增长',
`name` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '应用名称',
`imgPath` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图标',
`url` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '连接地址',
`sortNum` int(8) NULL DEFAULT 0 COMMENT '排序号',
`status` tinyint(4) NULL DEFAULT 0 COMMENT '状态,0暂未开通,1已开通',
`remark` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '描述',
`createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`updateTime` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`createUserId` bigint(20) NULL DEFAULT NULL COMMENT '创建用户ID',
`createUserName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建用户名称',
`updateUserId` bigint(20) NULL DEFAULT NULL COMMENT '更新用户',
`updateUserName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新用户名称',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统应用列';
-- ----------------------------
-- Records of mortals_xhx_apps
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_apps_census
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_apps_census`;
CREATE TABLE `mortals_xhx_apps_census` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID,主键,自增长',
`appId` bigint(20) NULL DEFAULT NULL COMMENT '应用ID,主键',
`censusName` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '数据统计名称',
`censusUrl` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '链接地址',
`censusType` tinyint(2) NOT NULL COMMENT '统计类型, 1:服务,2:协同,3:监管,4:数据,5:运营。默认1',
`status` tinyint(2) NOT NULL COMMENT '状态,0暂未开通,1已开通',
`createUserId` bigint(20) NULL DEFAULT NULL COMMENT '创建用户',
`createUserName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建用户名称',
`createTime` datetime(0) NOT NULL COMMENT '创建时间',
`updateTime` datetime(0) NOT NULL COMMENT '更新时间',
`updateUserId` bigint(20) NULL DEFAULT NULL COMMENT '更新用户',
`updateUserName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新用户名称',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统应用数据统计';
-- ----------------------------
-- Records of mortals_xhx_apps_census
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_idgenerator
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_idgenerator`;
CREATE TABLE `mortals_xhx_idgenerator` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号,主键,自增长',
`idType` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'id类型',
`idMaxValue` bigint(20) UNSIGNED NOT NULL COMMENT 'id值',
`remark` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '备注',
`versionNum` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '版本号,默认0',
`gmtModify` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '最后修改时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '主键Id生成器';
-- ----------------------------
-- Records of mortals_xhx_idgenerator
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_menu
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_menu`;
CREATE TABLE `mortals_xhx_menu` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '菜单ID,主键,自增长',
`name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '菜单名称',
`url` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '连接地址',
`parentId` bigint(20) NULL DEFAULT NULL COMMENT '父菜单ID,一级菜单的该字段值为-1',
`linkType` tinyint(2) NULL DEFAULT NULL COMMENT '链接方式,(0.内链,1.外链,2.脚本)',
`imgPath` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '主菜单图标,主菜单图标的css样式名',
`buttonImgPath` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '按钮图标',
`imgCommPath` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '常用菜单图标',
`visible` tinyint(2) NULL DEFAULT NULL COMMENT '菜单显示(0.隐藏,1.显示)',
`menuType` tinyint(2) NULL DEFAULT NULL COMMENT '菜单类型(0.目录,1.菜单,2.按钮)',
`status` tinyint(2) NULL DEFAULT NULL COMMENT '菜单状态(0.禁用,1.启用)',
`authType` tinyint(2) NULL DEFAULT NULL COMMENT '权限类型(0.无限制,1.无需登录查看,2.需要登录查看,3.需要角色权限查看)',
`orderId` int(4) NULL DEFAULT NULL COMMENT '排序编号',
`createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`createUserId` bigint(20) NULL DEFAULT NULL COMMENT '创建用户',
`createUserName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建用户名称',
`remark` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '描述备注',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 25 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '菜单信息业务';
-- ----------------------------
-- Records of mortals_xhx_menu
-- ----------------------------
BEGIN;
INSERT INTO `mortals_xhx_menu` VALUES (1, '数据管理', '/home/dataManagement', -1, 0, '', NULL, NULL, 1, 0, 1, 0, 0, '2022-06-10 16:27:05', 1, '系统管理员', 'aa'), (2, '站点编排', '/home/siteArrange', -1, 0, '', NULL, NULL, 1, 0, 1, 0, 2, '2022-06-10 16:27:05', 1, '系统管理员', 'aa'), (3, '数据精算', '/home/dataActuary', -1, 0, '', NULL, NULL, 1, 0, 1, 0, 3, '2022-06-10 16:30:12', 1, '系统管理员', 'aa'), (4, '平台设置', '/home/thePlatformIsSet/setPlatformes', -1, 0, '', NULL, NULL, 1, 0, 1, 0, 4, '2022-06-10 16:31:34', 1, '系统管理员', 'aa'), (5, '业务数据分析', '/home/dataActuary/business/basecontent', 3, 1, 'file/fileupload/1676000367284.png', NULL, NULL, 1, 1, 1, 1, 5, '2022-06-10 16:31:34', 1, '系统管理员', '实时动态监管人流聚集、窗口运行、业务办理以及服务行为、助力合理统筹调配政务资源。'), (6, '用户画像图谱', '/home/dataActuary/portrayal/portrayalbase', 3, 1, 'file/fileupload/1676000768099.png', NULL, NULL, 1, 1, 1, 1, 5, '2022-07-07 02:29:19', 1, '系统管理员', '依托大数据用户画像技术、输出个人位置分布、办件类型等分析服务、协助中心提供精准服务。'), (8, '使用行为分析', '/home/dataActuary/behaviour/eventanalyse', 3, 1, 'file/fileupload/1676000545942.png', NULL, NULL, 1, 1, 1, 1, 5, '2022-07-07 02:29:19', 1, '系统管理员', '对用户行为监测数据进行分析、从而找出软件及业务存在的问题、助力提供更加精准、有效的服务。'), (11, '数据仓库', 'http://10.102.252.13:11060/#/', 3, 1, 'file/fileupload/1676000517015.png', NULL, NULL, 1, 1, 1, 1, 5, '2022-07-07 02:29:19', 1, '系统管理员', '基于分布式查询引擎,应对海量数据查询场景。元数据和数据多副本存储,解决单点依赖。'), (13, 'RBAC用户-权限模型', '/home/thePlatformIsSet/permissionsModel', 4, 1, 'file/fileupload/1732154880327.png', NULL, NULL, 1, 1, 1, 1, 5, '2022-07-07 02:29:19', 1, '系统管理员', '用户和角色关联,角色赋予对应权限 以继承关系防止越权'), (14, 'API服务', '/home/thePlatformIsSet/APIServe', 4, 1, 'file/fileupload/1732154902904.png', NULL, NULL, 1, 1, 1, 1, 6, '2022-07-07 02:29:19', 1, '系统管理员', 'API一体化管理,实现数据、应用、服 务间灵活流转与敏捷集成'), (15, '应用服务', '/home/thePlatformIsSet/applService', 4, 1, 'file/fileupload/1732154932470.png', NULL, NULL, 1, 1, 1, 1, 7, '2022-07-07 02:29:19', 1, '系统管理员', '提供产品应用全生命周期服务,覆盖全终端全场景'), (16, '产品管理', '/home/thePlatformIsSet/productManage', 4, 1, 'file/fileupload/1732154949984.png', NULL, NULL, 1, 1, 1, 1, 8, '2022-07-07 02:29:19', 1, '系统管理员', '提供产品的全管理流程,增强核心能力'), (17, '菜单管理', '/home/thePlatformIsSet/menuManagement', 4, 1, 'file/fileupload/1732154961234.png', NULL, NULL, 1, 1, 1, 1, 9, '2022-07-07 02:29:19', 1, '系统管理员', '提供友好、灵活的功能菜单配置页面 提供更便捷的功能访问入口'), (19, '字典管理', '/home/thePlatformIsSet/dictionary', 4, 1, 'file/fileupload/1732155001316.png', NULL, NULL, 1, 1, 1, 1, 11, '2022-07-07 02:29:19', 1, '系统管理员', '提供对各种枚举数据进行维护的功能'), (20, '日志服务', '/home/thePlatformIsSet/logService', 4, 1, 'file/fileupload/1732154993072.png', NULL, NULL, 1, 1, 1, 1, 12, '2022-07-07 02:29:19', 1, '系统管理员', '提供高可靠的日志收集机制,保证 数据传输安全'), (21, '聚焦服务', '11', 1, 0, '', '', '', 1, 1, 1, 3, 1, '2022-12-19 16:56:57', 1, '系统管理员', '聚焦服务');
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_oper_log
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_oper_log`;
CREATE TABLE `mortals_xhx_oper_log` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号,主键,自增长',
`platformMark` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '平台标识',
`userId` bigint(20) NULL DEFAULT NULL COMMENT '用户id',
`userName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户名称',
`loginName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户登录名',
`requestUrl` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '请求地址',
`content` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作内容,记录操作具体信息,如修改前修改或的数据',
`ip` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作IP地址',
`logDate` datetime(0) NULL DEFAULT NULL COMMENT '操作时间',
`operType` tinyint(2) NULL DEFAULT NULL COMMENT '操作类型,(0.新增,1.修改,2.删除)',
`createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`createUserId` bigint(20) NULL DEFAULT NULL COMMENT '创建用户',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 14 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '操作日志业务';
-- ----------------------------
-- Records of mortals_xhx_oper_log
-- ----------------------------
BEGIN;
INSERT INTO `mortals_xhx_oper_log` VALUES (1, 'portal-manager', 1, '系统管理员', 'admin', '/zwfw/login/login', '用户登录系统成功!', '127.0.0.1', '2024-11-22 14:39:42', NULL, NULL, NULL), (2, 'portal-manager', 1, '系统管理员', 'admin', '/zwfw/site/model/census/list', '查询数据管理 【成功】', '127.0.0.1', '2024-11-22 14:39:43', NULL, NULL, NULL), (3, 'portal-manager', 1, '系统管理员', 'admin', '/zwfw/login/login', '用户登录系统成功!', '127.0.0.1', '2024-11-26 09:34:07', NULL, NULL, NULL), (4, 'portal-manager', 1, '系统管理员', 'admin', '/zwfw/site/model/census/list', '查询数据管理 【成功】', '127.0.0.1', '2024-11-26 09:34:07', NULL, NULL, NULL), (5, 'portal-manager', 1, '系统管理员', 'admin', '/zwfw/user/model/collect/get', '查看用户模块收藏 【成功】', '127.0.0.1', '2024-11-26 09:34:11', NULL, NULL, NULL), (6, 'portal-manager', 1, '系统管理员', 'admin', '/zwfw/site/model/list/group', '查询站点编排 【成功】', '127.0.0.1', '2024-11-26 09:34:11', NULL, NULL, NULL), (7, 'portal-manager', 1, '系统管理员', 'admin', '/zwfw/login/logout', '退出登录', '127.0.0.1', '2024-11-26 09:46:33', NULL, NULL, NULL), (8, 'portal-manager', 1, '系统管理员', 'admin', '/zwfw/login/login', '用户登录系统成功!', '127.0.0.1', '2024-11-26 09:46:44', NULL, NULL, NULL), (9, 'portal-manager', 1, '系统管理员', 'admin', '/zwfw/site/model/census/list', '查询数据管理 【成功】', '127.0.0.1', '2024-11-26 09:46:44', NULL, NULL, NULL), (10, 'portal-manager', 1, '系统管理员', 'admin', '/zwfw/user/model/collect/get', '查看用户模块收藏 【成功】', '127.0.0.1', '2024-11-26 09:47:20', NULL, NULL, NULL), (11, 'portal-manager', 1, '系统管理员', 'admin', '/zwfw/site/model/list/group', '查询站点编排 【成功】', '127.0.0.1', '2024-11-26 09:47:20', NULL, NULL, NULL), (12, 'portal-manager', 1, '系统管理员', 'admin', '/zwfw/user/model/collect/get', '查看用户模块收藏 【成功】', '127.0.0.1', '2024-11-26 09:57:55', NULL, NULL, NULL), (13, 'portal-manager', 1, '系统管理员', 'admin', '/zwfw/site/model/list/group', '查询站点编排 【成功】', '127.0.0.1', '2024-11-26 09:57:55', NULL, NULL, NULL);
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_page_access
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_page_access`;
CREATE TABLE `mortals_xhx_page_access` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号,主键,自增长',
`deviceNum` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备编码',
`productId` bigint(20) NULL DEFAULT NULL COMMENT '产品id',
`productName` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品名称',
`firstCode` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '页面编码(页面路由)',
`firstName` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '页面名称',
`secondCode` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '页面编码(页面路由)',
`secondName` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '页面名称',
`thirdCode` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '页面编码(页面路由)',
`thirdName` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '页面名称',
`fourthCode` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '页面编码(页面路由)',
`fourthName` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '页面名称',
`accessContent` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '完整路径',
`pageDepth` int(8) NULL DEFAULT 0 COMMENT '页面深度',
`createUserId` bigint(20) NULL DEFAULT NULL COMMENT '创建用户',
`createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`updateUserId` bigint(20) NULL DEFAULT NULL COMMENT '更新用户',
`updateTime` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '产品页面访问记录';
-- ----------------------------
-- Records of mortals_xhx_page_access
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_page_access_depth
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_page_access_depth`;
CREATE TABLE `mortals_xhx_page_access_depth` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号,主键,自增长',
`deviceNum` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备编码',
`productId` bigint(20) NULL DEFAULT NULL COMMENT '产品id',
`productName` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品名称',
`pageCode` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '页面编码(页面路由)',
`pageName` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '页面名称',
`depthValue` int(8) NULL DEFAULT NULL COMMENT '本次访问深度',
`createUserId` bigint(20) NULL DEFAULT NULL COMMENT '创建用户',
`createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`updateUserId` bigint(20) NULL DEFAULT NULL COMMENT '更新用户',
`updateTime` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '产品页面配置';
-- ----------------------------
-- Records of mortals_xhx_page_access_depth
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_page_event
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_page_event`;
CREATE TABLE `mortals_xhx_page_event` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号,主键,自增长',
`deviceNum` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备编码',
`productId` bigint(20) NULL DEFAULT NULL COMMENT '产品id',
`productName` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品名称',
`businessCode` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '业务场景编码',
`businessName` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '业务场景名称',
`eventCode` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '事件编码',
`eventName` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '事件名称',
`takeTime` int(8) NULL DEFAULT NULL COMMENT '事件耗时(单位毫秒)',
`pageCode` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '页面编码(页面路由)',
`pageName` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '页面名称',
`coordinate` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '事件坐标(x,y)',
`createUserId` bigint(20) NULL DEFAULT NULL COMMENT '创建用户',
`createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`updateUserId` bigint(20) NULL DEFAULT NULL COMMENT '更新用户',
`updateTime` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '页面事件记录';
-- ----------------------------
-- Records of mortals_xhx_page_event
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_page_info
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_page_info`;
CREATE TABLE `mortals_xhx_page_info` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号,主键,自增长',
`deviceNum` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备编码',
`productId` bigint(20) NULL DEFAULT NULL COMMENT '产品id',
`productName` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品名称',
`pageCode` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '页面编码(页面路由)',
`pageName` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '页面名称',
`screenUrl` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '页面截图地址',
`createUserId` bigint(20) NULL DEFAULT NULL COMMENT '创建用户',
`createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`updateUserId` bigint(20) NULL DEFAULT NULL COMMENT '更新用户',
`updateTime` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '产品页面配置';
-- ----------------------------
-- Records of mortals_xhx_page_info
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_page_route
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_page_route`;
CREATE TABLE `mortals_xhx_page_route` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号,主键,自增长',
`deviceNum` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备编码',
`productId` bigint(20) NULL DEFAULT NULL COMMENT '产品id',
`productName` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品名称',
`sourceCode` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '开始页面编码(路由)',
`sourceName` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '开始页面名称',
`targetCode` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '目标页面编码(路由)',
`targetName` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '目标页面名称',
`createUserId` bigint(20) NULL DEFAULT NULL COMMENT '创建用户',
`createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`updateUserId` bigint(20) NULL DEFAULT NULL COMMENT '更新用户',
`updateTime` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '页面路径记录';
-- ----------------------------
-- Records of mortals_xhx_page_route
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_param
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_param`;
CREATE TABLE `mortals_xhx_param` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号,主键,自增长',
`name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '参数名称',
`firstOrganize` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '一级组织,如:平台配置',
`secondOrganize` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '二级组织,如:基础配置',
`paramKey` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '参数键,全局唯一',
`paramValue` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '参数值',
`validStatus` tinyint(2) NULL DEFAULT NULL COMMENT '参数有效状态,(0.禁用,1.启用)',
`modStatus` tinyint(2) NULL DEFAULT NULL COMMENT '参数修改状态(0.隐藏,1.页面仅查看,2.页面可修改,3.页面可删除,4.页面可修改删除)',
`displayType` tinyint(2) NULL DEFAULT NULL COMMENT '展现类型(0.普通文本框,1.多行文本框,2.开关,3.块输入框)',
`remark` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`createUserId` bigint(20) NULL DEFAULT NULL COMMENT '创建用户',
`createUserName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建用户名称',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 90 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '参数信息业务';
-- ----------------------------
-- Records of mortals_xhx_param
-- ----------------------------
BEGIN;
INSERT INTO `mortals_xhx_param` VALUES (1, '用户类型', 'User', 'userType', '0', '系统用户', 1, 4, 0, 'userType', NULL, NULL, NULL), (2, '用户类型', 'User', 'userType', '1', '普通用户', 1, 4, 0, 'userType', NULL, NULL, NULL), (3, '用户类型', 'User', 'userType', '2', '工作人员', 1, 4, 0, 'userType', NULL, NULL, NULL), (4, '用户状态', 'User', 'status', '0', '停用', 1, 4, 0, 'status', NULL, NULL, NULL), (5, '用户状态', 'User', 'status', '1', '正常', 1, 4, 0, 'status', NULL, NULL, NULL), (6, '用户状态', 'User', 'status', '2', '冻结', 1, 4, 0, 'status', NULL, NULL, NULL), (7, '用户状态', 'User', 'status', '3', '销户', 1, 4, 0, 'status', NULL, NULL, NULL), (8, '用户状态', 'User', 'status', '4', '离职', 1, 4, 0, 'status', NULL, NULL, NULL), (9, '角色类型', 'Role', 'roleType', '0', '系统内置角色', 1, 4, 0, 'roleType', NULL, NULL, NULL), (10, '角色类型', 'Role', 'roleType', '1', '默认系统角色', 1, 4, 0, 'roleType', NULL, NULL, NULL), (11, '角色类型', 'Role', 'roleType', '2', '普通角色', 1, 4, 0, 'roleType', NULL, NULL, NULL), (12, '角色状态', 'Role', 'status', '0', '停用', 1, 4, 0, 'status', NULL, NULL, NULL), (13, '角色状态', 'Role', 'status', '1', '启用', 1, 4, 0, 'status', NULL, NULL, NULL), (14, '链接方式,', 'Menu', 'linkType', '0', '普通', 1, 4, 0, 'linkType', NULL, NULL, NULL), (15, '链接方式,', 'Menu', 'linkType', '1', '弹出', 1, 4, 0, 'linkType', NULL, NULL, NULL), (16, '链接方式,', 'Menu', 'linkType', '2', '脚本', 1, 4, 0, 'linkType', NULL, NULL, NULL), (17, '菜单显示', 'Menu', 'visible', '0', '隐藏', 1, 4, 0, 'visible', NULL, NULL, NULL), (18, '菜单显示', 'Menu', 'visible', '1', '显示', 1, 4, 0, 'visible', NULL, NULL, NULL), (19, '菜单类型', 'Menu', 'menuType', '0', '目录', 1, 4, 0, 'menuType', NULL, NULL, NULL), (20, '菜单类型', 'Menu', 'menuType', '1', '菜单', 1, 4, 0, 'menuType', NULL, NULL, NULL), (21, '菜单类型', 'Menu', 'menuType', '2', '按钮', 1, 4, 0, 'menuType', NULL, NULL, NULL), (22, '菜单状态', 'Menu', 'status', '0', '禁用', 1, 4, 0, 'status', NULL, NULL, NULL), (23, '菜单状态', 'Menu', 'status', '1', '启用', 1, 4, 0, 'status', NULL, NULL, NULL), (24, '权限类型', 'Menu', 'authType', '0', '无限制', 1, 4, 0, 'authType', NULL, NULL, NULL), (25, '权限类型', 'Menu', 'authType', '1', '无需登录查看', 1, 4, 0, 'authType', NULL, NULL, NULL), (26, '权限类型', 'Menu', 'authType', '2', '需要登录查看', 1, 4, 0, 'authType', NULL, NULL, NULL), (27, '权限类型', 'Menu', 'authType', '3', '需要角色权限查看', 1, 4, 0, 'authType', NULL, NULL, NULL), (28, '文件类型,', 'Uploadfile', 'fileType', '1', 'excel', 1, 4, 0, 'fileType', NULL, NULL, NULL), (29, '文件类型,', 'Uploadfile', 'fileType', '2', 'img', 1, 4, 0, 'fileType', NULL, NULL, NULL), (30, '文件类型,', 'Uploadfile', 'fileType', '3', 'zip', 1, 4, 0, 'fileType', NULL, NULL, NULL), (31, '文件类型,', 'Uploadfile', 'fileType', '4', 'pdf', 1, 4, 0, 'fileType', NULL, NULL, NULL), (32, '参数有效状态,', 'Param', 'validStatus', '0', '禁用', 1, 4, 0, 'validStatus', NULL, NULL, NULL), (33, '参数有效状态,', 'Param', 'validStatus', '1', '启用', 1, 4, 0, 'validStatus', NULL, NULL, NULL), (34, '参数修改状态', 'Param', 'modStatus', '0', '隐藏', 1, 4, 0, 'modStatus', NULL, NULL, NULL), (35, '参数修改状态', 'Param', 'modStatus', '1', '页面仅查看', 1, 4, 0, 'modStatus', NULL, NULL, NULL), (36, '参数修改状态', 'Param', 'modStatus', '2', '页面可修改', 1, 4, 0, 'modStatus', NULL, NULL, NULL), (37, '参数修改状态', 'Param', 'modStatus', '3', '页面可删除', 1, 4, 0, 'modStatus', NULL, NULL, NULL), (38, '参数修改状态', 'Param', 'modStatus', '4', '页面可修改删除', 1, 4, 0, 'modStatus', NULL, NULL, NULL), (39, '展现类型', 'Param', 'displayType', '0', '普通文本框', 1, 4, 0, 'displayType', NULL, NULL, NULL), (40, '展现类型', 'Param', 'displayType', '1', '多行文本框', 1, 4, 0, 'displayType', NULL, NULL, NULL), (41, '展现类型', 'Param', 'displayType', '2', '开关', 1, 4, 0, 'displayType', NULL, NULL, NULL), (42, '展现类型', 'Param', 'displayType', '3', '块输入框', 1, 4, 0, 'displayType', NULL, NULL, NULL), (43, '任务状态,', 'Task', 'status', '1', '执行中', 1, 4, 0, 'status', NULL, NULL, NULL), (44, '执行策略', 'Task', 'excuteStrategy', '1', '按日', 1, 4, 0, 'excuteStrategy', NULL, NULL, NULL), (45, '执行策略', 'Task', 'excuteStrategy', '2', '按周', 1, 4, 0, 'excuteStrategy', NULL, NULL, NULL), (46, '执行策略', 'Task', 'excuteStrategy', '3', '按月', 1, 4, 0, 'excuteStrategy', NULL, NULL, NULL), (47, '执行策略', 'Task', 'excuteStrategy', '4', '按间隔时间', 1, 4, 0, 'excuteStrategy', NULL, NULL, NULL), (48, '临时执行状态,', 'Task', 'interimExcuteStatus', '0', '未启用', 1, 4, 0, 'interimExcuteStatus', NULL, NULL, NULL), (49, '临时执行状态,', 'Task', 'interimExcuteStatus', '1', '立即执行并保留', 1, 4, 0, 'interimExcuteStatus', NULL, NULL, NULL), (50, '临时执行状态,', 'Task', 'interimExcuteStatus', '2', '立即执行并删除', 1, 4, 0, 'interimExcuteStatus', NULL, NULL, NULL), (51, '操作类型,', 'OperLog', 'operType', '0', '新增', 1, 4, 0, 'operType', NULL, NULL, NULL), (52, '操作类型,', 'OperLog', 'operType', '1', '修改', 1, 4, 0, 'operType', NULL, NULL, NULL), (53, '操作类型,', 'OperLog', 'operType', '2', '删除', 1, 4, 0, 'operType', NULL, NULL, NULL), (54, '请求类型', 'ProductInterface', 'requestType', '1', 'POST', 1, 4, 0, 'requestType', NULL, NULL, NULL), (55, '请求类型', 'ProductInterface', 'requestType', '2', 'GET', 1, 4, 0, 'requestType', NULL, NULL, NULL), (56, '请求类型', 'ProductInterface', 'requestType', '3', 'PUT', 1, 4, 0, 'requestType', NULL, NULL, NULL), (57, '请求类型', 'ProductInterface', 'requestType', '4', 'DELETE', 1, 4, 0, 'requestType', NULL, NULL, NULL), (58, '请求类型', 'ProductInterface', 'requestType', '5', 'CONNECT', 1, 4, 0, 'requestType', NULL, NULL, NULL), (59, '请求类型', 'ProductInterface', 'requestType', '6', 'OPTIONS', 1, 4, 0, 'requestType', NULL, NULL, NULL), (60, '内容类型', 'ProductInterface', 'contentType', '1', 'text/html', 1, 4, 0, 'contentType', NULL, NULL, NULL), (61, '内容类型', 'ProductInterface', 'contentType', '2', 'text/xml', 1, 4, 0, 'contentType', NULL, NULL, NULL), (62, '内容类型', 'ProductInterface', 'contentType', '3', 'application/json', 1, 4, 0, 'contentType', NULL, NULL, NULL), (63, '内容类型', 'ProductInterface', 'contentType', '4', 'application/xml', 1, 4, 0, 'contentType', NULL, NULL, NULL), (64, '内容类型', 'ProductInterface', 'contentType', '5', 'application/x-www-form-urlencoded', 1, 4, 0, 'contentType', NULL, NULL, NULL), (65, '内容类型', 'ProductInterface', 'contentType', '6', 'multipart/form-data', 1, 4, 0, 'contentType', NULL, NULL, NULL), (66, '请求协议', 'ProductInterface', 'requestProtocol', '1', 'HTTP', 1, 4, 0, 'requestProtocol', NULL, NULL, NULL), (67, '请求协议', 'ProductInterface', 'requestProtocol', '2', 'HTTPS', 1, 4, 0, 'requestProtocol', NULL, NULL, NULL), (68, '限流策略', 'ProductInterface', 'limitStrategy', '1', '10000次/日', 1, 4, 0, 'limitStrategy', NULL, NULL, NULL), (69, '限流策略', 'ProductInterface', 'limitStrategy', '2', '1000次/日', 1, 4, 0, 'limitStrategy', NULL, NULL, NULL), (70, '限流策略', 'ProductInterface', 'limitStrategy', '3', '100次/日', 1, 4, 0, 'limitStrategy', NULL, NULL, NULL), (71, '限流策略', 'ProductInterface', 'limitStrategy', '4', '1000次/小时', 1, 4, 0, 'limitStrategy', NULL, NULL, NULL), (72, '限流策略', 'ProductInterface', 'limitStrategy', '5', '100次/小时', 1, 4, 0, 'limitStrategy', NULL, NULL, NULL), (73, '限流策略', 'ProductInterface', 'limitStrategy', '6', '100次/分钟', 1, 4, 0, 'limitStrategy', NULL, NULL, NULL), (74, '限流策略', 'ProductInterface', 'limitStrategy', '7', '10次/分钟', 1, 4, 0, 'limitStrategy', NULL, NULL, NULL), (75, '限流策略', 'ProductInterface', 'limitStrategy', '8', '1次/分钟', 1, 4, 0, 'limitStrategy', NULL, NULL, NULL), (76, '访问网络', 'ProductInterface', 'network', '1', '互联网', 1, 4, 0, 'network', NULL, NULL, NULL), (77, '访问网络', 'ProductInterface', 'network', '2', '政务网', 1, 4, 0, 'network', NULL, NULL, NULL), (78, '接口标签', 'ProductInterface', 'interfaceTag', '1', '政务外网', 1, 4, 0, 'interfaceTag', NULL, NULL, NULL), (79, '接口标签', 'ProductInterface', 'interfaceTag', '2', '便民服务', 1, 4, 0, 'interfaceTag', NULL, NULL, NULL), (80, '接口标签', 'ProductInterface', 'interfaceTag', '3', '三化建设', 1, 4, 0, 'interfaceTag', NULL, NULL, NULL), (81, '接口来源', 'ProductInterface', 'interfaceSource', '1', '自建发布', 1, 4, 0, 'interfaceSource', NULL, NULL, NULL), (82, '接口来源', 'ProductInterface', 'interfaceSource', '2', '对接转化', 1, 4, 0, 'interfaceSource', NULL, NULL, NULL), (83, '开发语言', 'ProductApps', 'deveLanguage', '1', 'JAVA', 1, 4, 0, 'deveLanguage', NULL, NULL, NULL), (84, '开发语言', 'ProductApps', 'deveLanguage', '2', 'PHP', 1, 4, 0, 'deveLanguage', NULL, NULL, NULL), (85, '开发语言', 'ProductApps', 'deveLanguage', '3', 'Android', 1, 4, 0, 'deveLanguage', NULL, NULL, NULL), (86, '开发语言', 'ProductApps', 'deveLanguage', '4', 'C#', 1, 4, 0, 'deveLanguage', NULL, NULL, NULL), (87, '开发语言', 'ProductApps', 'deveLanguage', '5', 'C++', 1, 4, 0, 'deveLanguage', NULL, NULL, NULL), (88, '是否启用', 'ProductApps', 'isEnable', '0', '否', 1, 4, 0, 'isEnable', NULL, NULL, NULL), (89, '是否启用', 'ProductApps', 'isEnable', '1', '是', 1, 4, 0, 'isEnable', NULL, NULL, NULL);
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_product
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_product`;
CREATE TABLE `mortals_xhx_product` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号,主键,自增长',
`siteId` bigint(20) NOT NULL COMMENT '站点id',
`productName` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '产品名称',
`logoUrl` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Logo图片地址',
`productCode` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品编码',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createTime` datetime(0) NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) NULL DEFAULT NULL COMMENT '更新用户',
`updateTime` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '产品信息';
-- ----------------------------
-- Records of mortals_xhx_product
-- ----------------------------
BEGIN;
INSERT INTO `mortals_xhx_product` VALUES (1, 1, '信息发布系统4', '', '', 1, '2023-05-15 19:30:00', 1, '2023-06-27 15:58:12'), (2, 1, '基础设置', '', '', 1, '2023-05-15 19:31:31', 1, '2023-05-22 10:57:58'), (3, 1, '排号系统', '', '', 1, '2023-05-15 19:32:17', 1, '2023-05-22 10:58:07'), (4, 1, '填单系统', '', '', 1, '2023-05-15 19:37:20', 1, '2023-05-22 10:58:19'), (5, 1, '微官网T', '', '', 1, '2023-05-22 11:02:11', 1, '2023-07-25 10:09:00'), (6, 1, '考勤绩效S', '', '', 1, '2023-07-25 10:09:16', 1, '2023-07-25 10:09:27'), (7, 1, '背靠背评价', '', '', 1, '2023-07-25 10:09:38', NULL, NULL);
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_product_apps
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_product_apps`;
CREATE TABLE `mortals_xhx_product_apps` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号,主键,自增长',
`productId` bigint(20) NOT NULL COMMENT '产品id',
`appName` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '应用名称',
`deveLanguage` tinyint(2) NOT NULL COMMENT '开发语言',
`versionNumber` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '版本号',
`versionInfo` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '版本信息',
`appFileUrl` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '应用文件地址',
`isEnable` tinyint(2) NULL DEFAULT 1 COMMENT '是否启用1是0否',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createTime` datetime(0) NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) NULL DEFAULT NULL COMMENT '更新用户',
`updateTime` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '产品应用表';
-- ----------------------------
-- Records of mortals_xhx_product_apps
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_product_document
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_product_document`;
CREATE TABLE `mortals_xhx_product_document` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号,主键,自增长',
`productId` bigint(20) NOT NULL COMMENT '产品id',
`docName` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '资料名称',
`versionNumber` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '版本号',
`versionInfo` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '版本信息',
`docFileUrl` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '资料文件地址',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createTime` datetime(0) NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) NULL DEFAULT NULL COMMENT '更新用户',
`updateTime` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '产品资料表';
-- ----------------------------
-- Records of mortals_xhx_product_document
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_product_interface
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_product_interface`;
CREATE TABLE `mortals_xhx_product_interface` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号,主键,自增长',
`productId` bigint(20) NOT NULL COMMENT '产品id',
`interfaceName` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '接口名称',
`versionNumber` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '版本号',
`requestType` tinyint(2) NULL DEFAULT 1 COMMENT '请求类型1:POST,2:GET',
`requestProtocol` tinyint(2) NULL DEFAULT 1 COMMENT '请求协议1:HTTP,2:HTTPS',
`requestUrl` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '请求路径',
`timeoutValue` int(8) NULL DEFAULT NULL COMMENT '超时时间(秒)',
`limitStrategy` tinyint(2) NULL DEFAULT NULL COMMENT '限流策略1:分钟,2:小时',
`network` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '访问网络1互联网2政务网',
`description` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '接口描述',
`contentType` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '内容类型',
`interfaceTag` tinyint(2) NULL DEFAULT NULL COMMENT '标签',
`interfaceSource` tinyint(2) NULL DEFAULT 1 COMMENT '来源1自有2非自有',
`inEncrypt` tinyint(2) NULL DEFAULT NULL COMMENT '入参是否加密',
`requestParameters` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '请求参数',
`outEncrypt` tinyint(2) NULL DEFAULT NULL COMMENT '出参是否加密',
`responseParameters` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '响应数据',
`remark` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '接口描述',
`normalResponse` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '正常返回示例',
`abnormalResponse` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '异常返回示例',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createTime` datetime(0) NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) NULL DEFAULT NULL COMMENT '更新用户',
`updateTime` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`authInfo` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '授权信息',
`flowInfo` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流控信息',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '产品接口';
-- ----------------------------
-- Records of mortals_xhx_product_interface
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_product_interface_log
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_product_interface_log`;
CREATE TABLE `mortals_xhx_product_interface_log` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号,主键,自增长',
`interfaceId` bigint(20) NULL DEFAULT NULL COMMENT '接口id',
`requestParameters` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '请求参数',
`version` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '版本号',
`content` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '内容说明',
`remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createTime` datetime(0) NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) NULL DEFAULT NULL COMMENT '更新用户',
`updateTime` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '产品接口';
-- ----------------------------
-- Records of mortals_xhx_product_interface_log
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_resource
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_resource`;
CREATE TABLE `mortals_xhx_resource` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '菜单ID,主键,自增长',
`name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名称',
`url` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '连接地址,多个地址以逗号分隔',
`authType` tinyint(2) NULL DEFAULT NULL COMMENT '权限类型(0.无限制,1.无需登录查看,2.需要登录查看,3.需要角色权限查看)',
`sourceType` tinyint(2) NULL DEFAULT NULL COMMENT '资源类型(0.系统资源,1.开放资源)',
`createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`createUserId` bigint(20) NULL DEFAULT NULL COMMENT '创建用户',
`createUserName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建用户名称',
`userType` tinyint(2) NULL DEFAULT NULL COMMENT '用户类型(0.系统用户,1.代理商用户,2.品牌商用户)',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 56 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '资源信息业务';
-- ----------------------------
-- Records of mortals_xhx_resource
-- ----------------------------
BEGIN;
INSERT INTO `mortals_xhx_resource` VALUES (1, '菜单信息业务-维护', '/menu/batchSave,/menu/add,/menu/edit,/menu/importData,/menu/change/status,/menu/upOrDown,/menu/save,/menu/list/tree,/menu/logicDelete,/menu/delete', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (2, '页面路径记录-查看', '/page/route/view,/page/route/downloadTemplate,/page/route/list,/page/route/info,/page/route/exportExcel', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (3, 'SITE/MODEL接口模块-维护', '/site/model/list/group,/site/model/list/all', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (4, '产品应用-维护', '/product/apps/save,/product/apps/importData,/product/apps/delete,/product/apps/edit,/product/apps/add,/product/apps/batchSave,/product/apps/logicDelete', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (5, '用户密码修改记录-查看', '/user/pwd/record/info,/user/pwd/record/downloadTemplate,/user/pwd/record/list,/user/pwd/record/view,/user/pwd/record/exportExcel', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (6, '角色资源权限业务-维护', '/role/auth/distributionSource,/role/auth/batchSave,/role/auth/importData,/role/auth/assignMenuToRole,/role/auth/save,/role/auth/logicDelete,/role/auth/edit,/role/auth/add,/role/auth/delete', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (7, '系统管理-分表索引信息管理-查看', '/table/index/view,/table/index/downloadTemplate,/table/index/exportExcel', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (8, '产品资料-查看', '/product/document/downloadTemplate,/product/document/exportExcel,/product/document/list,/product/document/info,/product/document/view', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (9, '系统管理-API服务管理-查看', '/system/service/api/view,/system/service/api/exportExcel,/system/service/api/downloadTemplate,/system/service/api/info,/system/service/api/list', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (10, '系统管理-API服务管理-查看', '/system/service/exportExcel,/system/service/view,/system/service/downloadTemplate,/system/service/list,/system/service/info', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (11, '用户密码修改记录-维护', '/user/pwd/record/save,/user/pwd/record/delete,/user/pwd/record/logicDelete,/user/pwd/record/add,/user/pwd/record/importData,/user/pwd/record/batchSave,/user/pwd/record/edit', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (12, 'SITE/MODEL接口模块-查看', '/site/model/list,/site/model/census/list', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (13, '产品应用-查看', '/product/apps/downloadTemplate,/product/apps/exportExcel,/product/apps/info,/product/apps/list,/product/apps/view', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (14, '产品接口日志-维护', '/product/interface/log/save,/product/interface/log/delete,/product/interface/log/batchSave,/product/interface/log/edit,/product/interface/log/logicDelete,/product/interface/log/add,/product/interface/log/importData', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (15, '系统管理-分表索引信息管理-维护', '/table/index/delete,/table/index/save,/table/index/logicDelete,/table/index/edit,/table/index/importData,/table/index/add', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (16, '角色信息业务-查看', '/role/view,/role/info,/role/list,/role/downloadTemplate,/role/exportExcel', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (17, '系统管理-验证码信息管理-查看', '/validcode/exportExcel,/validcode/view,/validcode/downloadTemplate', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (18, '角色信息业务-维护', '/role/batchSave,/role/edit,/role/delete,/role/save,/role/logicDelete,/role/add,/role/importData', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (19, '系统管理-资源信息管理-查看', '/resource/info,/resource/list,/resource/exportExcel,/resource/downloadTemplate,/resource/view', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (20, '系统管理-验证码信息管理-维护', '/validcode/edit,/validcode/save,/validcode/add,/validcode/delete,/validcode/importData,/validcode/logicDelete', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (21, '系统管理-API服务管理-维护', '/system/service/api/edit,/system/service/api/importData,/system/service/api/save,/system/service/api/add,/system/service/api/delete,/system/service/api/logicDelete,/system/service/api/batchSave', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (22, '系统管理-API服务管理-维护', '/system/service/batchSave,/system/service/edit,/system/service/save,/system/service/importData,/system/service/add,/system/service/delete,/system/service/logicDelete', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (23, '产品信息-查看', '/product/info,/product/list,/product/view,/product/downloadTemplate,/product/exportExcel', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (24, 'API/USER接口模块-查看', '/api/user/findAllUser', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (25, '页面路径记录-维护', '/page/route/importData,/page/route/logicDelete,/page/route/edit,/page/route/save,/page/route/add,/page/route/delete,/page/route/batchSave', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (26, '角色用户业务-维护', '/role/user/edit,/role/user/assignRoleToUser,/role/user/delete,/role/user/save,/role/user/logicDelete,/role/user/batchSave,/role/user/add,/role/user/importData', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (27, '产品信息-维护', '/product/importData,/product/add,/product/edit,/product/logicDelete,/product/batchSave,/product/delete,/product/save', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (28, '产品页面配置-查看', '/page/info/downloadTemplate,/page/info/exportExcel,/page/info/info,/page/info/list,/page/info/view', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (29, '产品页面配置-查看', '/page/access/info,/page/access/list,/page/access/downloadTemplate,/page/access/view,/page/access/exportExcel', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (30, '系统管理-操作日志管理-查看', '/oper/log/view,/oper/log/exportExcel,/oper/log/downloadTemplate', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (31, '区域-维护', '/area/importData,/area/add,/area/treeselect,/area/save,/area/batchSave,/area/delete,/area/edit,/area/logicDelete', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (32, '参数信息业务-维护', '/param/delete,/param/add,/param/importData,/param/save,/param/logicDelete,/param/batchSave,/param/edit', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (33, '系统管理-任务信息管理-维护', '/task/importData,/task/change/status,/task/logicDelete,/task/save,/task/batchSave,/task/add,/task/edit,/task/delete', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (34, '页面事件记录-维护', '/page/event/importData,/page/event/save,/page/event/logicDelete,/page/event/batchSave,/page/event/edit,/page/event/delete,/page/event/add', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (35, '产品接口-维护', '/product/interface/importData,/product/interface/batchSave,/product/interface/delete,/product/interface/add,/product/interface/save,/product/interface/edit,/product/interface/logicDelete', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (36, '用户模块收藏-查看', '/user/model/collect/exportExcel,/user/model/collect/list,/user/model/collect/get,/user/model/collect/downloadTemplate,/user/model/collect/info,/user/model/collect/view', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (37, '产品接口日志-查看', '/product/interface/log/downloadTemplate,/product/interface/log/list,/product/interface/log/info,/product/interface/log/exportExcel,/product/interface/log/view', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (38, '用户信息业务-查看', '/user/list,/user/exportExcel,/user/info,/user/downloadTemplate,/user/view', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (39, '角色用户业务-查看', '/role/user/list,/role/user/view,/role/user/downloadTemplate,/role/user/exportExcel,/role/user/info', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (40, '系统管理-资源信息管理-维护', '/resource/importData,/resource/batchSave,/resource/allResources,/resource/logicDelete,/resource/save,/resource/add,/resource/edit,/resource/delete', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (41, '产品接口-查看', '/product/interface/view,/product/interface/downloadTemplate,/product/interface/list,/product/interface/info,/product/interface/exportExcel', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (42, '系统管理-任务信息管理-查看', '/task/view,/task/info,/task/list,/task/downloadTemplate,/task/exportExcel', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (43, '页面事件记录-查看', '/page/event/downloadTemplate,/page/event/view,/page/event/info,/page/event/list,/page/event/exportExcel', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (44, '区域-查看', '/area/view,/area/downloadTemplate,/area/info,/area/list,/area/exportExcel,/area/getListByParentId', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (45, '用户信息业务-维护', '/user/save,/user/batchSave,/user/add,/user/edit,/user/delete,/user/change/password,/user/importData,/user/siteAuth,/user/logicDelete,/user/reset/password', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (46, '角色模块数据-查看', '/role/model/view,/role/model/exportExcel,/role/model/downloadTemplate,/role/model/info,/role/model/list', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (47, '菜单信息业务-查看', '/menu/view,/menu/findAll,/menu/list,/menu/exportExcel,/menu/info,/menu/downloadTemplate', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (48, '产品页面配置-维护', '/page/info/logicDelete,/page/info/add,/page/info/importData,/page/info/delete,/page/info/save,/page/info/batchSave,/page/info/edit', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (49, '产品页面配置-维护', '/page/access/add,/page/access/delete,/page/access/logicDelete,/page/access/batchSave,/page/access/importData,/page/access/save,/page/access/edit', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (50, '系统管理-操作日志管理-维护', '/oper/log/delete,/oper/log/importData,/oper/log/save,/oper/log/edit,/oper/log/logicDelete,/oper/log/add', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (51, '产品资料-维护', '/product/document/save,/product/document/edit,/product/document/add,/product/document/batchSave,/product/document/logicDelete,/product/document/importData,/product/document/delete', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (52, '用户模块收藏-维护', '/user/model/collect/save,/user/model/collect/add,/user/model/collect/batchSave,/user/model/collect/importData,/user/model/collect/delete,/user/model/collect/edit,/user/model/collect/logicDelete', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (53, '角色资源权限业务-查看', '/role/auth/list,/role/auth/info,/role/auth/view,/role/auth/downloadTemplate,/role/auth/exportExcel', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL), (54, '角色模块数据-维护', '/role/model/logicDelete,/role/model/importData,/role/model/edit,/role/model/delete,/role/model/save,/role/model/add,/role/model/batchSave', 3, 1, '2023-11-18 17:22:40', 1, NULL, NULL), (55, '参数信息业务-查看', '/param/downloadTemplate,/param/list,/param/info,/param/view,/param/exportExcel', 3, 0, '2023-11-18 17:22:40', 1, NULL, NULL);
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_role
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_role`;
CREATE TABLE `mortals_xhx_role` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号,主键,自增长',
`name` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '角色名称',
`roleCode` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '角色编码',
`roleSort` int(4) NULL DEFAULT NULL COMMENT '角色排序字段',
`roleType` tinyint(2) NULL DEFAULT NULL COMMENT '角色类型(0.系统内置角色,1.默认系统角色,2.普通角色)',
`remark` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`status` tinyint(2) NULL DEFAULT NULL COMMENT '角色状态(0.停用,1.启用)',
`createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`createUserId` bigint(20) NULL DEFAULT NULL COMMENT '创建用户',
`createUserName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建用户名称',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色信息';
-- ----------------------------
-- Records of mortals_xhx_role
-- ----------------------------
BEGIN;
INSERT INTO `mortals_xhx_role` VALUES (1, '管理员', '', 0, 1, '管理员', 1, '2023-01-12 09:52:47', 1, '系统管理员'), (2, '客户', '', 0, 1, '客户', 1, '2023-03-01 18:53:15', 1, '系统管理员'), (3, '超管', '', 0, 1, '超管', 1, '2023-05-16 21:10:36', 1, '系统管理员'), (4, '工作人员', '', 0, 1, '一体化用户工作人员', 1, '2023-05-24 20:42:26', 1, '系统管理员'), (5, '商事登记股信息发布角色', '', 0, 1, '蒋佳', 1, '2024-04-11 09:21:38', 1, '系统管理员'), (6, '办公室考勤负责人', '', 0, 1, '张平', 1, '2024-05-16 11:44:03', 1, '系统管理员'), (7, '麒麟互认证', '', 0, 1, '麒麟互认证专用角色', 1, '2024-08-19 14:05:45', 1, '系统管理员');
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_role_auth
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_role_auth`;
CREATE TABLE `mortals_xhx_role_auth` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号,主键,自增长',
`roleId` bigint(20) NULL DEFAULT NULL COMMENT '角色ID',
`menuId` bigint(20) NULL DEFAULT NULL COMMENT '菜单ID',
`resourceId` bigint(20) NULL DEFAULT NULL COMMENT '资源id',
`createTime` datetime(0) NULL DEFAULT NULL,
`createUserId` bigint(20) NULL DEFAULT NULL,
`createUserName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1581 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色菜单权限关联';
-- ----------------------------
-- Records of mortals_xhx_role_auth
-- ----------------------------
BEGIN;
INSERT INTO `mortals_xhx_role_auth` VALUES (1570, 1, 16, NULL, NULL, NULL, NULL), (1571, 1, 17, NULL, NULL, NULL, NULL), (1572, 1, 19, NULL, NULL, NULL, NULL), (1573, 1, 3, NULL, NULL, NULL, NULL), (1574, 1, 20, NULL, NULL, NULL, NULL), (1575, 1, 4, NULL, NULL, NULL, NULL), (1576, 1, 5, NULL, NULL, NULL, NULL), (1577, 1, 8, NULL, NULL, NULL, NULL), (1578, 1, 13, NULL, NULL, NULL, NULL), (1579, 1, 14, NULL, NULL, NULL, NULL), (1580, 1, 15, NULL, NULL, NULL, NULL);
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_role_model
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_role_model`;
CREATE TABLE `mortals_xhx_role_model` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键,自增长',
`roleId` bigint(20) NULL DEFAULT NULL COMMENT '角色ID,主键',
`modelIds` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '模块ID,主键',
`censusIds` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '模块下的数据统计',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 75 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色模块数据';
-- ----------------------------
-- Records of mortals_xhx_role_model
-- ----------------------------
BEGIN;
INSERT INTO `mortals_xhx_role_model` VALUES (68, 1, '1,2,3,4,5,7,9,10,12,14,15,16,17,25,27,29,30,28,33,34,35,36', '1,2,3,4,5,6,8,9,10,11,12,13,14,15,17');
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_role_user
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_role_user`;
CREATE TABLE `mortals_xhx_role_user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号,主键,自增长',
`roleId` bigint(20) NULL DEFAULT NULL COMMENT '角色ID',
`userId` bigint(20) NULL DEFAULT NULL COMMENT '用户ID',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 24 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色用户关联';
-- ----------------------------
-- Records of mortals_xhx_role_user
-- ----------------------------
BEGIN;
INSERT INTO `mortals_xhx_role_user` VALUES (20, 1, 1);
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_site_apps
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_site_apps`;
CREATE TABLE `mortals_xhx_site_apps` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键,自增长',
`siteId` bigint(20) NULL DEFAULT NULL COMMENT '站点ID,主键',
`includApps` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点开通的应用',
`excludeApps` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点排除的应用',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '站点应用对照列';
-- ----------------------------
-- Records of mortals_xhx_site_apps
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_system_service
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_system_service`;
CREATE TABLE `mortals_xhx_system_service` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '系统API的ID,主键,自增长',
`systemServiceName` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '模块名称',
`systemServiceCode` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '模块编码',
`systemServiceUrl` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '模块地址',
`packageName` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '包名称',
`packagePath` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '包的下载路径',
`packageVersion` varchar(5) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '包的版本',
`apiStatus` tinyint(2) NULL DEFAULT NULL COMMENT '包的状态(1:启用,0:停用)',
`createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`lapseTime` datetime(0) NULL DEFAULT NULL COMMENT '失效时间',
`packageRemark` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '包的说明',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = 'API服务';
-- ----------------------------
-- Records of mortals_xhx_system_service
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_system_service_api
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_system_service_api`;
CREATE TABLE `mortals_xhx_system_service_api` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '系统API的ID,主键,自增长',
`systemServiceName` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '模块名称',
`systemServiceCode` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '模块编码',
`systemServiceUrl` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '模块地址',
`apiName` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'API接口名称',
`apiUrl` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'API接口(链接)',
`apiVersion` varchar(5) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'API接口版本',
`apiStatus` tinyint(2) NULL DEFAULT NULL COMMENT 'API接口状态(1:启用,0:停用)',
`createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`lapseTime` datetime(0) NULL DEFAULT NULL COMMENT '失效时间',
`apiRemark` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'API接口说明',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = 'API服务';
-- ----------------------------
-- Records of mortals_xhx_system_service_api
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_table_index
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_table_index`;
CREATE TABLE `mortals_xhx_table_index` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '菜单ID,主键,自增长',
`tableName` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '表名称',
`tableMark` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '表标识',
`createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '分索引信息业务';
-- ----------------------------
-- Records of mortals_xhx_table_index
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_task
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_task`;
CREATE TABLE `mortals_xhx_task` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号,主键,自增长',
`name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '任务名称',
`taskKey` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '任务关键字,区分任务执行流程',
`status` tinyint(2) NULL DEFAULT NULL COMMENT '任务状态,(0,未启动,1.执行中)',
`excuteService` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '任务执行服务',
`excuteParam` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '任务执行参数',
`excuteHost` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '任务执行主机,为空表示不限制任务的执行主机,多个用逗号分隔',
`excuteStrategy` tinyint(2) NULL DEFAULT NULL COMMENT '执行策略(1.按日,2.按周,3.按月,4.按间隔时间)',
`excuteDate` int(11) NULL DEFAULT NULL COMMENT '执行日期,按日:则为0;按周:则为1-7;按月:则为:1-31;按间隔时间:则为间隔时间,单位:秒;',
`excuteTime` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '执行时间,格式:HH:mm,',
`remark` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`lastExcuteHost` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '最后执行主机',
`lastExcuteTime` datetime(0) NULL DEFAULT NULL COMMENT '最后执行时间',
`interimExcuteStatus` tinyint(2) NULL DEFAULT NULL COMMENT '临时执行状态,(0.未启用,1.立即执行并保留,2.立即执行并删除)',
`createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`createUserId` bigint(20) NULL DEFAULT NULL COMMENT '创建用户',
`createUserName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建用户名称',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '任务信息业务';
-- ----------------------------
-- Records of mortals_xhx_task
-- ----------------------------
BEGIN;
INSERT INTO `mortals_xhx_task` VALUES (2, '分表创建任务', 'tableIndexService', 0, 'tableIndexService', NULL, NULL, 1, 0, '00:30', NULL, '192.168.1.106', '2021-08-18 00:30:01', 0, '2021-08-12 11:07:23', 1, '系统管理员');
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_uploadfile
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_uploadfile`;
CREATE TABLE `mortals_xhx_uploadfile` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID,主键,自增长',
`fileName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件名称',
`filePath` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件路径',
`fileType` tinyint(2) NULL DEFAULT NULL COMMENT '文件类型,(1.excel ,2. img,3.zip, 4.pdf)',
`createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`createUser` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建用户',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '上传文件业务';
-- ----------------------------
-- Records of mortals_xhx_uploadfile
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_user
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_user`;
CREATE TABLE `mortals_xhx_user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户ID,主键,自增长',
`loginName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '登录名',
`loginPwd` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '登录密码,使用md5双次加密',
`loginLimitAddress` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '登录限制地址,多个IP地址用逗号分隔,可以使用IP段匹配,如:172.17.*非空:则只能该值内的IP可以登录',
`realName` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户名',
`mobile` varchar(21) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户手机号',
`phone` varchar(21) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户联系电话',
`email` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户邮箱',
`qq` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'QQ号码',
`userType` tinyint(2) NULL DEFAULT NULL COMMENT '用户类型(0.系统用户,1.普通用户,2.工作人员)',
`siteIds` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '所属站点id,多个逗号分隔',
`areaCodes` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '所属区域code,多个逗号分隔',
`areaNames` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '所属区域名称,多个逗号分隔',
`status` tinyint(2) NULL DEFAULT NULL COMMENT '用户状态(0.停用,1.正常,2.冻结,3.销户,4.离职)',
`createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`createUserId` bigint(20) NULL DEFAULT NULL COMMENT '创建用户',
`createUserName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建用户名称',
`lastLoginTime` datetime(0) NULL DEFAULT NULL COMMENT '最后一次登录时间',
`lastLoginAddress` varchar(21) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '最后一次登录地址',
`saltKey` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '密码盐值',
`lastUpdatePwdTime` datetime(0) NULL DEFAULT NULL COMMENT '最后一次修改密码时间',
`errorCount` tinyint(2) NULL DEFAULT 0 COMMENT '当日登录失败数',
`loginLock` tinyint(2) NULL DEFAULT 0 COMMENT '登录锁定状态0未锁定1已锁定',
`lockTime` datetime(0) NULL DEFAULT NULL COMMENT '锁定时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `loginName`(`loginName`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户信息业务';
-- ----------------------------
-- Records of mortals_xhx_user
-- ----------------------------
BEGIN;
INSERT INTO `mortals_xhx_user` VALUES (1, 'admin', 'de7abfba6f99cb20b794867cdf664445', NULL, '系统管理员', '13808095770', NULL, NULL, NULL, 1, '1', '510800000000', '[{\"areaCode\":\"510800000000\",\"label\":\"广元市\"}]', 1, '2022-06-02 09:12:26', 1, 'admin', '2024-11-26 09:46:43', '127.0.0.1', 'sadyfp', '2099-11-24 13:45:06', 0, 1, '2024-10-22 16:27:18');
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_user_model_collect
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_user_model_collect`;
CREATE TABLE `mortals_xhx_user_model_collect` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键,自增长',
`userId` bigint(20) NULL DEFAULT NULL COMMENT '用户ID,主键,自增长',
`realName` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '登录名',
`modelIds` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '收藏模块',
`createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`siteId` bigint(20) NULL DEFAULT NULL COMMENT '站点ID',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户模块收藏';
-- ----------------------------
-- Records of mortals_xhx_user_model_collect
-- ----------------------------
BEGIN;
INSERT INTO `mortals_xhx_user_model_collect` VALUES (1, 1, '系统管理员', '1,3,17,45,19,25', '2023-11-23 09:41:40', 1), (2, 2084, '信宏翔', '1,2,4,3,5,15,13,7', '2023-12-20 15:41:26', 1), (3, 2086, '文娟', '2,4,5,25', '2024-04-25 12:32:25', 1), (4, 2087, '张平', '25', '2024-05-16 13:26:45', 1), (5, 2088, '张平1', '25', '2024-05-21 09:05:18', 1), (6, 2089, '郭香蕉专用', '1,2,4,28,25,16', '2024-07-02 11:09:58', 1), (7, 2090, '徐局长', '1,4,25', '2024-07-16 11:40:16', 1);
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_user_pwd_record
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_user_pwd_record`;
CREATE TABLE `mortals_xhx_user_pwd_record` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键,自增长',
`userId` bigint(20) NULL DEFAULT NULL COMMENT '用户ID,主键,自增长',
`loginName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '登录名',
`loginPwd` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '登录密码,使用md5双次加密',
`createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`createUserId` bigint(20) NULL DEFAULT NULL COMMENT '创建用户',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户密码修改记录';
-- ----------------------------
-- Records of mortals_xhx_user_pwd_record
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for mortals_xhx_valid_code
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_valid_code`;
CREATE TABLE `mortals_xhx_valid_code` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '菜单ID,主键,自增长',
`code` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '验证码',
`url` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '校验地址,email校验使用',
`mobile` varchar(21) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '校验手机号',
`email` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '校验邮箱',
`type` tinyint(2) NULL DEFAULT NULL COMMENT '校验方式(0.图片校验,1.手机校验,2.邮箱校验)',
`sessionId` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '会话ID',
`ip` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'IP地址',
`createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`lapseTime` datetime(0) NULL DEFAULT NULL COMMENT '失效时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '验证码信息业务';
-- ----------------------------
-- Records of mortals_xhx_valid_code
-- ----------------------------
BEGIN;
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;
...@@ -19,9 +19,15 @@ ...@@ -19,9 +19,15 @@
<profiles.server.debug></profiles.server.debug> <profiles.server.debug></profiles.server.debug>
<profiles.server.port>17212</profiles.server.port> <profiles.server.port>17212</profiles.server.port>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path> <profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.level>info</profiles.log.level> <profiles.log.level>info</profiles.log.level>
<profiles.publish.path>/home/publish</profiles.publish.path> <profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.filepath>/mortals/app/data</profiles.filepath> <profiles.filepath>/mortals/app/data</profiles.filepath>
<profiles.req.json.check>false</profiles.req.json.check>
<profiles.trustedReferer></profiles.trustedReferer>
<package.environment>build</package.environment>
<skipUi>true</skipUi>
</properties> </properties>
...@@ -31,24 +37,16 @@ ...@@ -31,24 +37,16 @@
<properties> <properties>
<profiles.active>develop</profiles.active> <profiles.active>develop</profiles.active>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<package.environment>test</package.environment> <package.environment>test</package.environment>
<skipUi>false</skipUi>
</properties> </properties>
</profile> </profile>
<profile> <profile>
<id>test</id> <id>test</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties> <properties>
<profiles.active>test</profiles.active> <profiles.active>test</profiles.active>
<profiles.nacos.server-addr>192.168.0.252:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>192.168.0.252:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group> <profiles.trustedReferer>192.168.0.98,localhost,192.168.0.252</profiles.trustedReferer>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace> <profiles.req.json.check>false</profiles.req.json.check>
<package.environment>test</package.environment>
<skipUi>true</skipUi>
</properties> </properties>
</profile> </profile>
...@@ -56,11 +54,7 @@ ...@@ -56,11 +54,7 @@
<id>product</id> <id>product</id>
<properties> <properties>
<profiles.active>product</profiles.active> <profiles.active>product</profiles.active>
<profiles.nacos.server-addr>192.168.0.250:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<package.environment>build</package.environment>
<skipUi>true</skipUi>
</properties> </properties>
</profile> </profile>
<profile> <profile>
...@@ -68,10 +62,6 @@ ...@@ -68,10 +62,6 @@
<properties> <properties>
<profiles.active>yibin</profiles.active> <profiles.active>yibin</profiles.active>
<profiles.nacos.server-addr>172.15.28.120:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>172.15.28.120:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<package.environment>yibin</package.environment>
<skipUi>true</skipUi>
</properties> </properties>
</profile> </profile>
...@@ -80,22 +70,7 @@ ...@@ -80,22 +70,7 @@
<properties> <properties>
<profiles.active>sngx</profiles.active> <profiles.active>sngx</profiles.active>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<package.environment>yibin</package.environment> <package.environment>yibin</package.environment>
<skipUi>false</skipUi>
</properties>
</profile>
<profile>
<id>regtest</id>
<properties>
<profiles.active>regtest</profiles.active>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<package.environment>build</package.environment>
<skipUi>true</skipUi>
</properties> </properties>
</profile> </profile>
...@@ -104,10 +79,6 @@ ...@@ -104,10 +79,6 @@
<properties> <properties>
<profiles.active>reg</profiles.active> <profiles.active>reg</profiles.active>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<package.environment>build</package.environment>
<skipUi>true</skipUi>
</properties> </properties>
</profile> </profile>
...@@ -116,10 +87,6 @@ ...@@ -116,10 +87,6 @@
<properties> <properties>
<profiles.active>qiling</profiles.active> <profiles.active>qiling</profiles.active>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<package.environment>build</package.environment>
<skipUi>true</skipUi>
</properties> </properties>
</profile> </profile>
...@@ -128,10 +95,7 @@ ...@@ -128,10 +95,7 @@
<properties> <properties>
<profiles.active>yanyuan</profiles.active> <profiles.active>yanyuan</profiles.active>
<profiles.nacos.server-addr>172.16.30.245:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>172.16.30.245:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group> <profiles.trustedReferer>127.0.0.1,localhost,10.233.82.175,172.16.30.245,172.16.30.246,172.16.30.247,172.16.30.248</profiles.trustedReferer>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<package.environment>build</package.environment>
<skipUi>true</skipUi>
</properties> </properties>
</profile> </profile>
...@@ -140,10 +104,6 @@ ...@@ -140,10 +104,6 @@
<properties> <properties>
<profiles.active>pengxi</profiles.active> <profiles.active>pengxi</profiles.active>
<profiles.nacos.server-addr>192.168.106.6:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>192.168.106.6:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<package.environment>build</package.environment>
<skipUi>true</skipUi>
</properties> </properties>
</profile> </profile>
...@@ -152,10 +112,6 @@ ...@@ -152,10 +112,6 @@
<properties> <properties>
<profiles.active>bzjkq</profiles.active> <profiles.active>bzjkq</profiles.active>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<package.environment>build</package.environment>
<skipUi>true</skipUi>
</properties> </properties>
</profile> </profile>
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.mortals.xhx</groupId>
<artifactId>smart-gov-platform</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>portal-manager</artifactId>
<packaging>jar</packaging>
<description>一体化政务门户管理平台</description>
<profiles>
<profile>
<id>develop</id>
<properties>
<profiles.active>develop</profiles.active>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.level>INFO</profiles.log.level>
<profiles.log.path>/mortals/app/logs</profiles.log.path>
<package.environment>test</package.environment>
<skipUi>false</skipUi>
</properties>
</profile>
<profile>
<id>test</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<profiles.active>test</profiles.active>
<profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.rabbitmq.host>127.0.0.1</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
<profiles.rabbitmq.username>taxi_mq</profiles.rabbitmq.username>
<profiles.rabbitmq.password>admin@2020</profiles.rabbitmq.password>
<profiles.rabbitmq.virtualhost>/</profiles.rabbitmq.virtualhost>
<profiles.nacos.server-addr>192.168.0.252:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.level>INFO</profiles.log.level>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<package.environment>test</package.environment>
<skipUi>true</skipUi>
</properties>
</profile>
<profile>
<id>product</id>
<properties>
<profiles.active>product</profiles.active>
<profiles.server.path>/zwfw</profiles.server.path>
<profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.rabbitmq.host>192.168.0.250</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
<profiles.rabbitmq.username>taxi_mq</profiles.rabbitmq.username>
<profiles.rabbitmq.password>admin@2020</profiles.rabbitmq.password>
<profiles.rabbitmq.virtualhost>/</profiles.rabbitmq.virtualhost>
<profiles.nacos.server-addr>192.168.0.250:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.level>INFO</profiles.log.level>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<package.environment>build</package.environment>
<skipUi>true</skipUi>
</properties>
</profile>
<profile>
<id>yibin</id>
<properties>
<profiles.active>yibin</profiles.active>
<profiles.server.port>17212</profiles.server.port>
<profiles.server.path>/zwfw</profiles.server.path>
<profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.rabbitmq.host>172.15.28.117</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
<profiles.rabbitmq.username>taxi_mq</profiles.rabbitmq.username>
<profiles.rabbitmq.password>admin@2020</profiles.rabbitmq.password>
<profiles.rabbitmq.virtualhost>/</profiles.rabbitmq.virtualhost>
<profiles.nacos.server-addr>172.15.28.120:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.level>INFO</profiles.log.level>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<package.environment>yibin</package.environment>
<skipUi>true</skipUi>
</properties>
</profile>
<profile>
<id>sngx</id>
<properties>
<profiles.active>sngx</profiles.active>
<profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.rabbitmq.host>127.0.0.1</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
<profiles.rabbitmq.username>taxi_mq</profiles.rabbitmq.username>
<profiles.rabbitmq.password>admin@2020</profiles.rabbitmq.password>
<profiles.rabbitmq.virtualhost>/</profiles.rabbitmq.virtualhost>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.level>INFO</profiles.log.level>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<package.environment>yibin</package.environment>
<skipUi>false</skipUi>
</properties>
</profile>
<profile>
<id>regtest</id>
<properties>
<profiles.active>regtest</profiles.active>
<profiles.server.port>17212</profiles.server.port>
<profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.rabbitmq.host>127.0.0.1</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
<profiles.rabbitmq.username>taxi_mq</profiles.rabbitmq.username>
<profiles.rabbitmq.password>admin@2020</profiles.rabbitmq.password>
<profiles.rabbitmq.virtualhost>/</profiles.rabbitmq.virtualhost>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.log.level>info</profiles.log.level>
<package.environment>build</package.environment>
<skipUi>false</skipUi>
</properties>
</profile>
<profile>
<id>reg</id>
<properties>
<profiles.active>reg</profiles.active>
<profiles.server.port>17212</profiles.server.port>
<profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.rabbitmq.host>127.0.0.1</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
<profiles.rabbitmq.username>taxi_mq</profiles.rabbitmq.username>
<profiles.rabbitmq.password>admin@2020</profiles.rabbitmq.password>
<profiles.rabbitmq.virtualhost>/</profiles.rabbitmq.virtualhost>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.log.level>info</profiles.log.level>
<package.environment>build</package.environment>
<skipUi>false</skipUi>
</properties>
</profile>
<profile>
<id>yanyuan</id>
<properties>
<profiles.active>yanyuan</profiles.active>
<profiles.server.port>17212</profiles.server.port>
<profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.rabbitmq.host>172.16.30.245</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
<profiles.rabbitmq.username>taxi_mq</profiles.rabbitmq.username>
<profiles.rabbitmq.password>admin@2020</profiles.rabbitmq.password>
<profiles.rabbitmq.virtualhost>/</profiles.rabbitmq.virtualhost>
<profiles.nacos.server-addr>172.16.30.245:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<package.environment>build</package.environment>
<skipUi>true</skipUi>
<profiles.holidayUrl>https://timor.tech/api/holiday/year/</profiles.holidayUrl>
</properties>
</profile>
</profiles>
<properties>
</properties>
<dependencies>
<dependency>
<groupId>com.mortals.xhx</groupId>
<artifactId>common-lib</artifactId>
</dependency>
<!-- 引入 SpringMVC 相关依赖,并实现对其的自动配置 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
<version>2.5.2</version>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.31</version>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.github.javaparser</groupId>
<artifactId>javaparser-core</artifactId>
<version>3.25.6</version>
</dependency>
<!--Token生成与解析-->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-bin</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<encoding>UTF-8</encoding>
<outputDirectory>target/bin
</outputDirectory>
<resources>
<resource>
<directory>src/main/bin/</directory>
<excludes>
<exclude>deploy.sh</exclude>
</excludes>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-deploy</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<encoding>UTF-8</encoding>
<outputDirectory>${project.parent.basedir}/dist/${project.artifactId}/
</outputDirectory>
<resources>
<resource>
<directory>src/main/bin</directory>
<includes>
<include>deploy.sh</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<configuration>
<skip>${skipUi}</skip>
</configuration>
<executions>
<execution>
<id>exec-npm-install</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>yarn</executable>
<arguments>
<argument></argument>
</arguments>
<workingDirectory>${project.parent.basedir}/${project.artifactId}-ui/admin</workingDirectory>
</configuration>
</execution>
<execution>
<id>exec-npm-run-build</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>yarn</executable>
<arguments>
<argument>run</argument>
<arguments>${package.environment}</arguments>
</arguments>
<workingDirectory>${project.parent.basedir}/${project.artifactId}-ui/admin</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>${project.artifactId}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>./assembly/assembly.xml</descriptor>
</descriptors>
<outputDirectory>${project.parent.basedir}/dist/${project.artifactId}</outputDirectory>
</configuration>
</execution>
<execution>
<id>make-assembly-ui</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<skipAssembly>${skipUi}</skipAssembly>
<finalName>${project.artifactId}-ui</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>./assembly/assembly-manager-ui.xml</descriptor>
</descriptors>
<outputDirectory>${project.parent.basedir}/dist/${project.artifactId}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
#!/bin/sh
RETVAL=$?
SHELL_NAME="deploy"
BASEDIR=$(dirname $0)
BASEDIR=$( (
cd "$BASEDIR"
pwd
))
LOCK_FILE="/tmp/deploy.lock"
# 时间变量
CDATE=$(date "+%Y-%m-%d")
CTIME=$(date "+%H:%M:%S")
SHELL_LOG="${BASEDIR}/${SHELL_NAME}.log"
JAVA_HOME="/usr/local/java/jdk1.8"
SERVICE_PATH="/usr/lib/systemd/system"
PUBLISH_PATH="/home/publish"
PROJECT_NAME="@project.artifactId@"
PROJECT_EXECPATH="${PUBLISH_PATH}/${PROJECT_NAME}"
PROJECT_FILENAME="${PROJECT_NAME}.tar.gz"
PROJECT_SERVICE="${SERVICE_PATH}/${PROJECT_NAME}.service"
#写日志
writelog() {
LOGINFO=$1
echo "${CDATE} ${CTIME}: ${SHELL_NAME} : ${LOGINFO}" >>${SHELL_LOG}
echo ${LOGINFO}
}
#清理目标
clear_deploy() {
SERVICE=$1
EXECPATH=$2
#清理后台自启服务
rm -f ${SERVICE}
#清理执行文件目录
}
build_service() {
SERVICE=$1
EXECPATH=$2
echo "" >${SERVICE}
echo "[Unit]" >>${SERVICE}
echo "Description=${PROJECT_NAME}" >>${SERVICE}
echo "After=network.target" >>${SERVICE}
echo "" >>${SERVICE}
echo "[Service]" >>${SERVICE}
echo "Environment=\"JAVA_HOME=$JAVA_HOME\"" >>${SERVICE}
echo "Type=forking" >>${SERVICE}
echo "ExecStartPre=-/bin/sleep 5s" >>${SERVICE}
echo "ExecStart=${EXECPATH}/bin/start.sh" >>${SERVICE}
echo "ExecStop=${EXECPATH}/bin/shutdown.sh" >>${SERVICE}
echo "PrivateTmp=true" >>${SERVICE}
echo "" >>${SERVICE}
echo "[Install]" >>${SERVICE}
echo "WantedBy=multi-user.target" >>${SERVICE}
writelog "${PROJECT_NAME}服务创建完成!"
}
#启动服务与nginx
start_service() {
systemctl enable ${PROJECT_NAME}
systemctl daemon-reload
writelog "${PROJECT_NAME}服务启动..."
systemctl stop ${PROJECT_NAME}&&systemctl start ${PROJECT_NAME}
project_status=$(systemctl status "${PROJECT_NAME}"|grep Active |awk '{print $2}')
jcpid=$(ps -ef | grep -v "grep" | grep "${PROJECT_NAME} " | awk '{print $2}')
writelog "${PROJECT_NAME}服务启动,PID is ${jcpid} ,status:${project_status}"
}
#部署后台服务
project_deploy() {
writelog "${PROJECT_NAME}_deploy"
clear_deploy ${PROJECT_SERVICE} ${PROJECT_EXECPATH}
writelog "${PROJECT_NAME}_clear_finish"
tar -zvxf ./${PROJECT_FILENAME} -C ${PUBLISH_PATH}
build_service ${PROJECT_SERVICE} ${PROJECT_EXECPATH}
start_service
writelog "${PROJECT_NAME}_deploy_finish"
}
#主函数
main() {
echo "后台服务部署"
project_deploy
exit ${RETVAL}
}
main $1
#!/bin/sh #!/bin/sh
PORT="@profiles.server.port@" PORT="@profiles.server.port@"
DEBUG=@profiles.server.debug@
BASEDIR=`dirname $0`/.. BASEDIR=`dirname $0`/..
BASEDIR=`(cd "$BASEDIR"; pwd)` BASEDIR=`(cd "$BASEDIR"; pwd)`
PROJECT_NAME="@project.artifactId@"; PROJECT_NAME="@project.artifactId@";
MAIN_CLASS="$PROJECT_NAME-@project.version@.jar"; MAIN_CLASS="$PROJECT_NAME-@project.version@.jar";
LOG_PATH="@profiles.log.path@/$PROJECT_NAME" LOG_PATH="@profiles.log.path@/$PROJECT_NAME"
GC_PATH=$LOG_PATH/PROJECT_NAME"-gc.log" GC_PATH=$LOG_PATH/$PROJECT_NAME"-gc.log"
HS_ERR_PATH=$LOG_PATH/PROJECT_NAME"-hs_err.log" HS_ERR_PATH=$LOG_PATH/$PROJECT_NAME"-hs_err.log"
HEAP_DUMP_PATH=$LOG_PATH/PROJECT_NAME"-heap_dump.hprof" HEAP_DUMP_PATH=$LOG_PATH/$PROJECT_NAME"-heap_dump.hprof"
TEMP_PATH=$LOG_PATH/temp/ TEMP_PATH=$LOG_PATH/temp/
SUCCESS=0 SUCCESS=0
FAIL=9 FAIL=9
...@@ -45,7 +46,7 @@ fi ...@@ -45,7 +46,7 @@ fi
if [ -e "$BASEDIR" ] if [ -e "$BASEDIR" ]
then then
JAVA_OPTS="-Xms512M -Xmx1024M -Xss256K -XX:+UseAdaptiveSizePolicy -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:GCTimeRatio=39 -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$GC_PATH -XX:+HeapDumpOnOutOfMemoryError -XX:ErrorFile=$HS_ERR_PATH -XX:HeapDumpPath=$HEAP_DUMP_PATH" JAVA_OPTS="-Xms1024M -Xmx2048M -Xss256K -XX:+UseAdaptiveSizePolicy -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:GCTimeRatio=39 -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$GC_PATH -XX:+HeapDumpOnOutOfMemoryError -XX:ErrorFile=$HS_ERR_PATH -XX:HeapDumpPath=$HEAP_DUMP_PATH"
fi fi
CLASSPATH=$CLASSPATH_PREFIX: CLASSPATH=$CLASSPATH_PREFIX:
...@@ -56,13 +57,12 @@ cd "$BASEDIR/boot"; ...@@ -56,13 +57,12 @@ cd "$BASEDIR/boot";
echo "starting application $PROJECT_NAME......" echo "starting application $PROJECT_NAME......"
exec "$JAVACMD" $JAVA_OPTS \ exec "$JAVACMD" $JAVA_OPTS \
$EXTRA_JVM_ARGUMENTS \ $EXTRA_JVM_ARGUMENTS \
$DEBUG \
-Dapp.name="$PROJECT_NAME" \ -Dapp.name="$PROJECT_NAME" \
-Dapp.port="$PORT" \ -Dapp.port="$PORT" \
-Dbasedir="$BASEDIR" \ -Dbasedir="$BASEDIR" \
-Dfile.encoding=utf-8 \ -Dfile.encoding=utf-8 \
-Djava.io.tmpdir=$TEMP_PATH \ -Djava.io.tmpdir=$TEMP_PATH \
-Dloader.path="file://$BASEDIR/conf,file://$BASEDIR/lib" \
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=21072 \
-jar $MAIN_CLASS \ -jar $MAIN_CLASS \
> /dev/null & > /dev/null &
......
package com.mortals.xhx.base.framework;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
import java.io.IOException;
import java.text.ParseException;
import java.util.Date;
/**
* 自定义Jackson反序列化日期类型时应用的类型转换器,一般用于@RequestBody接受参数时使用
*/
public class DateJacksonConverter extends JsonDeserializer {
private static String[] pattern = new String[]{"yyyy-MM-dd", "yyyy-MM-dd HH:mm", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.S", "yyyy.MM.dd", "yyyy.MM.dd HH:mm", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm:ss.S", "yyyy/MM/dd", "yyyy/MM/dd HH:mm", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm:ss.S"};
@Override
public Date deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
Date targetDate = null;
String originDate = p.getText();
if (StringUtils.isNotEmpty(originDate)) {
try {
long longDate = Long.valueOf(originDate.trim());
targetDate = new Date(longDate);
} catch (NumberFormatException e) {
try {
targetDate = DateUtils.parseDate(originDate, DateJacksonConverter.pattern);
} catch (ParseException pe) {
throw new IOException(String.format("'%s' can not convert to type 'java.util.Date',just support timestamp(type of long) and following date format(%s)",
originDate,
StringUtils.join(pattern, ",")));
}
}
}
return targetDate;
}
@Override
public Class handledType() {
return Date.class;
}
}
package com.mortals.xhx.base.framework;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import java.util.ArrayList;
import java.util.List;
/**
* @author: zxfei
* @date: 2022/6/28 15:57
* @description:
**/
// 创建一个新的转换器 解析微信的 [text/plain]
public class WxMessageConverter extends MappingJackson2HttpMessageConverter {
public WxMessageConverter() {
List<MediaType> mediaTypes = new ArrayList<>();
mediaTypes.add(MediaType.TEXT_PLAIN);
setSupportedMediaTypes(mediaTypes);
}
}
\ No newline at end of file
package com.mortals.xhx.base.framework.config;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.mortals.xhx.base.framework.DateJacksonConverter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
@Configuration
public class ConverterConfig {
@Value("${jsonCheck:false}")
private Boolean jsonCheck;
@Bean
public DateJacksonConverter dateJacksonConverter() {
return new DateJacksonConverter();
}
@Bean
public Jackson2ObjectMapperFactoryBean jackson2ObjectMapperFactoryBean(DateJacksonConverter dateJacksonConverter) {
Jackson2ObjectMapperFactoryBean jackson2ObjectMapperFactoryBean = new Jackson2ObjectMapperFactoryBean();
jackson2ObjectMapperFactoryBean.setDeserializers(dateJacksonConverter);
return jackson2ObjectMapperFactoryBean;
}
@Bean
public MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter(ObjectMapper objectMapper) {
if(jsonCheck!=null&&jsonCheck){
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true);
}
MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter = new MappingJackson2HttpMessageConverter();
mappingJackson2HttpMessageConverter.setObjectMapper(objectMapper);
return mappingJackson2HttpMessageConverter;
}
}
...@@ -23,7 +23,7 @@ public class CorsConfig implements WebMvcConfigurer { ...@@ -23,7 +23,7 @@ public class CorsConfig implements WebMvcConfigurer {
CorsConfiguration configuration = new CorsConfiguration(); CorsConfiguration configuration = new CorsConfiguration();
//允许跨域访问的域名 //允许跨域访问的域名
configuration.addAllowedOrigin("*"); configuration.addAllowedOrigin("*");
// configuration.setAllowCredentials(true); //运行携带cookie configuration.setAllowCredentials(true); //运行携带cookie
configuration.addAllowedMethod("*"); //代表所有请求方法 configuration.addAllowedMethod("*"); //代表所有请求方法
configuration.addAllowedHeader("*"); //允许携带任何头信息 configuration.addAllowedHeader("*"); //允许携带任何头信息
......
package com.mortals.xhx.base.framework.exception; package com.mortals.xhx.base.framework.exception;
import org.slf4j.Logger; import cn.hutool.core.util.StrUtil;
import org.slf4j.LoggerFactory; import cn.hutool.http.HttpStatus;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.exception.AppException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.messaging.handler.annotation.support.MethodArgumentTypeMismatchException;
import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import com.alibaba.fastjson.JSONObject; import javax.servlet.http.HttpServletRequest;
import com.mortals.framework.exception.AppException; import javax.servlet.http.HttpServletResponse;
/** /**
* 统一异常处理 * 统一异常处理
*/ */
@ControllerAdvice @ControllerAdvice
@Slf4j
public class ExceptionHandle { public class ExceptionHandle {
private final static Logger log = LoggerFactory.getLogger(ExceptionHandle.class); @Autowired
private HttpServletResponse response;
public static final String KEY_RESULT_CODE = "code"; public static final String KEY_RESULT_CODE = "code";
public static final String KEY_RESULT_MSG = "msg"; public static final String KEY_RESULT_MSG = "msg";
public static final String KEY_RESULT_DATA = "data"; public static final String KEY_RESULT_DATA = "data";
public static final int VALUE_RESULT_FAILURE = -1; public static final int VALUE_RESULT_FAILURE = -1;
@ExceptionHandler(value = Exception.class) @ExceptionHandler(value = Exception.class)
@ResponseBody @ResponseBody
public String handle(Exception e) { public String handle(Exception e) {
JSONObject ret = new JSONObject(); JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE); ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
if (e instanceof AppException) { if (e instanceof AppException) {
StackTraceElement stack = e.getStackTrace()[0]; StackTraceElement stack = e.getStackTrace()[0];
log.error("[business error]=========stack message[{}],[{},method:{},line{}][{}]", e.getMessage(), log.error("[business error]=========stack message[{}],[{},method:{},line{}][{}]", e.getMessage(),
stack.getClassName(), stack.getMethodName(), stack.getLineNumber(), e.getClass().getName()); stack.getClassName(), stack.getMethodName(), stack.getLineNumber(), e.getClass().getName());
AppException ex = (AppException) e; AppException ex = (AppException) e;
ret.put(KEY_RESULT_MSG, ex.getMessage()); ret.put(KEY_RESULT_MSG, ex.getMessage());
} else { } else if (e instanceof HttpMessageNotReadableException || e instanceof MethodArgumentTypeMismatchException) {
log.error("[system error]", e); log.error("[system error]", e);
ret.put(KEY_RESULT_MSG, "未知错误!"); //response.setStatus(HttpStatus.HTTP_BAD_REQUEST);
} ret.put(KEY_RESULT_MSG, "参数错误," + StrUtil.subBefore(e.getMessage(), ";", false));
return ret.toJSONString(); } else {
} log.error("[system error]", e);
//response.setStatus(HttpStatus.HTTP_BAD_REQUEST);
ret.put(KEY_RESULT_MSG, "未知错误!" + e.getMessage());
}
return ret.toJSONString();
}
} }
package com.mortals.xhx.base.framework.filter;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.URLUtil;
import cn.hutool.http.HttpStatus;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import javax.servlet.*;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URI;
import java.net.URL;
import java.util.*;
@Slf4j
//@Component
//@Profile({"yanyuan"})
public class SameSiteCookieFilter implements Filter {
@Value("${trustedReferer:''}")
private String trustedReferer;
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
HttpServletResponse httpResponse = (HttpServletResponse) response;
List<String> allowedOrigins = StrUtil.split(trustedReferer, ",");
// Set allowedOrigins= new HashSet(Arrays.asList(allowDomain));
String originHeader=((HttpServletRequest) request).getHeader("Origin");
if(!ObjectUtils.isEmpty(originHeader)){
URI host = URLUtil.getHost(new URL(originHeader));
String origin = host.getHost();
if (allowedOrigins.contains(origin)){
httpResponse.setHeader("Access-Control-Allow-Origin", originHeader);
httpResponse.setContentType("application/json;charset=UTF-8");
httpResponse.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
httpResponse.setHeader("Access-Control-Max-Age", "3600");
httpResponse.setHeader("Access-Control-Allow-Headers", "Content-Type,authorization,authtoken");
// 如果要把Cookie发到服务器,需要指定Access-Control-Allow-Credentials字段为true
httpResponse.setHeader("Access-Control-Allow-Credentials", "true");
httpResponse.setHeader("Access-Control-Expose-Headers", "*");
}
}
// addSameSiteAttribute((HttpServletResponse) response);
chain.doFilter(request, response);
}
private void addSameSiteAttribute(HttpServletResponse response) {
Collection<String> headers = response.getHeaders("Set-Cookie");
boolean firstHeader = true;
for (String header : headers) {
if (firstHeader) {
response.setHeader("Set-Cookie", String.format("%s; %s", header, "SameSite=Strict"));
firstHeader = false;
continue;
}
response.addHeader("Set-Cookie", String.format("%s; %s", header, "SameSite=Strict"));
}
}
@Override
public void init(FilterConfig filterConfig) throws ServletException {}
@Override
public void destroy() {}
}
package com.mortals.xhx.base.framework.interceptor; package com.mortals.xhx.base.framework.interceptor;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.URLUtil;
import cn.hutool.http.HttpStatus;
import com.alibaba.druid.support.http.ResourceServlet; import com.alibaba.druid.support.http.ResourceServlet;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth; import com.mortals.framework.annotation.UnAuth;
...@@ -18,14 +21,19 @@ import com.mortals.xhx.module.user.service.UserService; ...@@ -18,14 +21,19 @@ import com.mortals.xhx.module.user.service.UserService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.ParameterResolutionDelegate; import org.springframework.beans.factory.annotation.ParameterResolutionDelegate;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.method.HandlerMethod; import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.resource.ResourceHttpRequestHandler; import org.springframework.web.servlet.resource.ResourceHttpRequestHandler;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.net.URI;
import java.net.URL;
import java.util.List;
import java.util.Set; import java.util.Set;
/** /**
...@@ -47,6 +55,8 @@ public class AuthUserInterceptor extends BaseInterceptor { ...@@ -47,6 +55,8 @@ public class AuthUserInterceptor extends BaseInterceptor {
private ResourceService resourceService; private ResourceService resourceService;
@Autowired @Autowired
private UserService userService; private UserService userService;
@Value("${trustedReferer:''}")
private String trustedReferer;
@Override @Override
public int getOrder() { public int getOrder() {
...@@ -56,6 +66,7 @@ public class AuthUserInterceptor extends BaseInterceptor { ...@@ -56,6 +66,7 @@ public class AuthUserInterceptor extends BaseInterceptor {
@Override @Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
throws Exception { throws Exception {
JSONObject ret = new JSONObject(); JSONObject ret = new JSONObject();
try { try {
if (handler instanceof HandlerMethod) { if (handler instanceof HandlerMethod) {
......
...@@ -12,7 +12,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -12,7 +12,7 @@ import javax.servlet.http.HttpServletResponse;
* @date: 2022/6/6 15:05 * @date: 2022/6/6 15:05
* @description:添加跨域响应 * @description:添加跨域响应
**/ **/
@Component //@Component
public class CrossInterceptor extends BaseInterceptor { public class CrossInterceptor extends BaseInterceptor {
@Override @Override
......
...@@ -111,299 +111,9 @@ public class AuthTokenServiceImpl implements IAuthTokenService { ...@@ -111,299 +111,9 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
cacheService.hset(RedisKey.KEY_USER_MENU_CACHE, userEntity.getId().toString(), menuUrlCode); cacheService.hset(RedisKey.KEY_USER_MENU_CACHE, userEntity.getId().toString(), menuUrlCode);
} }
userEntity.setMenuUrl(menuUrlCode); userEntity.setMenuUrl(menuUrlCode);
return userEntity; return userEntity;
/*return new IUser() {
*//**
* @return
*//*
@Override
public Long getId() {
return userEntity.getId();
}
*//**
* @return
*//*
@Override
public Long getDeptId() {
return userEntity.getDeptId();
}
*//**
* @return
*//*
@Override
public String getDeptName() {
return userEntity.getDeptName();
}
*//**
* @return
*//*
@Override
public Long getCustomerId() {
return userEntity.getCustomerId();
}
*//**
* @return
*//*
@Override
public Long getSiteId() {
return userEntity.getSiteId();
}
*//**
* @return
*//*
@Override
public String getSiteIds() {
return userEntity.getSiteIds();
}
*//**
* @return
*//*
@Override
public String getAreaCodes() {
return userEntity.getAreaCodes();
}
*//**
* @return
*//*
@Override
public Long getCustomerJoinId() {
return userEntity.getCustomerJoinId();
}
*//**
* @return
*//*
@Override
public String getCustomerNum() {
return userEntity.getCustomerNum();
}
*//**
* @return
*//*
@Override
public String getLoginName() {
return userEntity.getLoginName();
}
*//**
* @return
*//*
@Override
public String getRealName() {
return userEntity.getRealName();
}
*//**
* @return
*//*
@Override
public boolean isAdmin() {
return userEntity.isAdmin();
}
*//**
* @return
*//*
@Override
public boolean isSystemUser() {
return userEntity.isSystemUser();
}
*//**
* @return
*//*
@Override
public boolean isManager() {
return userEntity.isManager();
}
*//**
* @return
*//*
@Override
public Integer getUserType() {
return userEntity.getUserType();
}
*//**
* @return
*//*
@Override
public String getToken() {
return userEntity.getToken();
}
*//**
* @return
*//*
@Override
public Long getLoginTime() {
return userEntity.getLoginTime();
}
*//**
* @return
*//*
@Override
public Long getExpireTime() {
return userEntity.getExpireTime();
}
*//**
* @param expireTime
*//*
@Override
public void setExpireTime(Long expireTime) {
}
*//**
* @return
*//*
@Override
public String getMenuUrl() {
return userEntity.getMenuUrl();
}
};*/
// return userEntity;
/* if (StringUtils.isNotEmpty(userStr)) {
JSONObject userObj = JSON.parseObject(userStr);
Long userId = userObj.getLongValue("id");
Integer userType = userObj.getIntValue("userType");
Long customerId = userObj.getLongValue("customerId");
Long siteId = userObj.getLongValue("siteId");
Long loginTime = userObj.getLongValue("loginTime");
Long expireTime = userObj.getLongValue("expireTime");
String loginName = userObj.getString("loginName");
String realName = userObj.getString("realName");
String siteIds = userObj.getString("siteIds");
String menuUrl = userObj.getString("menuUrl");
Boolean isManager = userObj.getBoolean("manager");
Boolean isSystemUser = userObj.getBoolean("systemUser");
String areaCodes = userObj.getString("areaCodes");
return new IUser() {
@Override
public Long getId() {
return userId;
}
@Override
public Long getDeptId() {
return null;
}
@Override
public String getDeptName() {
return null;
}
@Override
public Long getCustomerId() {
return customerId;
}
@Override
public Long getSiteId() {
return siteId;
}
@Override
public String getSiteIds() {
return siteIds;
}
@Override
public String getAreaCodes() {
return areaCodes;
}
@Override
public Long getCustomerJoinId() {
return null;
}
@Override
public String getCustomerNum() {
return null;
}
@Override
public String getLoginName() {
return loginName;
}
@Override
public String getRealName() {
return realName;
}
@Override
public boolean isAdmin() {
return userId == 1L;
}
@Override
public boolean isSystemUser() {
return isSystemUser;
}
@Override
public boolean isManager() {
return isManager;
}
@Override
public Integer getUserType() {
return userType;
}
@Override
public String getToken() {
return token;
}
@Override
public Long getLoginTime() {
return loginTime;
}
@Override
public Long getExpireTime() {
return expireTime;
}
@Override
public void setExpireTime(Long expireTime) {
}
@Override
public String getMenuUrl() {
return menuUrl;
}
};
}*/
// return cacheService.get(userKey, IUser.class);
} catch (Exception e) { } catch (Exception e) {
log.error("解析jwt token异常!", e); log.error("解析jwt token异常!", e.getMessage());
return null; return null;
} }
} }
......
...@@ -58,10 +58,17 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi ...@@ -58,10 +58,17 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
@RequestMapping("login") @RequestMapping("login")
public String login(@RequestBody LoginForm loginForm) throws Exception { public String login(@RequestBody LoginForm loginForm) throws Exception {
//log.info("Session:"+this.request.getSession().getId());
JSONObject ret = new JSONObject(); JSONObject ret = new JSONObject();
Map<String, Object> data = new HashMap<>(); Map<String, Object> data = new HashMap<>();
String loginName = loginForm.getLoginName(); String loginName = loginForm.getLoginName();
String password = loginForm.getPassword(); String password = loginForm.getPassword();
//loginForm.setSecurityCode("admin");
// if(!StringUtils.isEmpty(loginForm.getMark())){
// ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
// ret.put(KEY_RESULT_MSG, "非法的参数");
// return ret.toJSONString();
// }
String ip = super.getRequestIP(request); String ip = super.getRequestIP(request);
if (StringUtils.isEmpty(loginName) || StringUtils.isEmpty(password)) { if (StringUtils.isEmpty(loginName) || StringUtils.isEmpty(password)) {
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE); ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
......
...@@ -6,7 +6,6 @@ import com.mortals.xhx.base.login.service.GifSecurityImage; ...@@ -6,7 +6,6 @@ import com.mortals.xhx.base.login.service.GifSecurityImage;
import com.mortals.xhx.base.system.valid.model.ValidCodeEntity; import com.mortals.xhx.base.system.valid.model.ValidCodeEntity;
import com.mortals.xhx.base.system.valid.service.ValidCodeService; import com.mortals.xhx.base.system.valid.service.ValidCodeService;
import com.mortals.xhx.base.system.valid.web.ValidCodeForm; import com.mortals.xhx.base.system.valid.web.ValidCodeForm;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -25,9 +24,9 @@ public class SecurityCodeController ...@@ -25,9 +24,9 @@ public class SecurityCodeController
@RequestMapping("createCode") @RequestMapping("createCode")
public void createCode(HttpServletRequest request, HttpServletResponse response) { public void createCode(HttpServletRequest request, HttpServletResponse response) {
//log.info("Session:"+this.request.getSession().getId());
// 获取默认难度和长度的验证码 // 获取默认难度和长度的验证码
String securityCode = validCodeService.createImageValidCode(request.getParameter("mark"), super.getRequestIP(request)); String securityCode = validCodeService.createImageValidCode(request.getParameter("t"), super.getRequestIP(request));
// int imageType = ParamUtil.getInt("securityImage", 1); // int imageType = ParamUtil.getInt("securityImage", 1);
int imageType = 0; int imageType = 0;
switch (imageType) { switch (imageType) {
......
...@@ -113,6 +113,9 @@ public class OperLogServiceImpl extends AbstractCRUDServiceImpl<OperLogDao,OperL ...@@ -113,6 +113,9 @@ public class OperLogServiceImpl extends AbstractCRUDServiceImpl<OperLogDao,OperL
operLogEntity.setContent(content); operLogEntity.setContent(content);
save(operLogEntity, null); save(operLogEntity, null);
} }
private void formatterLogContent(OperLogEntity operLogEntity, String content, String id, OperTypeEnum operType) { private void formatterLogContent(OperLogEntity operLogEntity, String content, String id, OperTypeEnum operType) {
if (operType == OperTypeEnum.SAVE) { if (operType == OperTypeEnum.SAVE) {
......
/**
* 文件:OperLogController.java
* 版本:1.0.0
* 日期:
* Copyright &reg;
* All right reserved.
*/
package com.mortals.xhx.base.system.oper.web; package com.mortals.xhx.base.system.oper.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.model.OrderCol; import com.mortals.framework.model.OrderCol;
import com.mortals.framework.model.Result; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BaseCRUDJsonMappingController;
import com.mortals.xhx.base.system.oper.model.OperLogEntity; import com.mortals.xhx.base.system.oper.model.OperLogEntity;
import com.mortals.xhx.base.system.oper.service.OperLogService; import com.mortals.xhx.base.system.oper.service.OperLogService;
import com.mortals.xhx.common.code.OperTypeEnum; import com.mortals.xhx.common.code.OperTypeEnum;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
...@@ -39,65 +25,42 @@ import java.util.Map; ...@@ -39,65 +25,42 @@ import java.util.Map;
*/ */
@RestController @RestController
@RequestMapping("oper/log") @RequestMapping("oper/log")
public class OperLogController extends BaseCRUDJsonMappingController<OperLogService,OperLogForm,OperLogEntity,Long> { public class OperLogController extends BaseCRUDJsonBodyMappingController<OperLogService,OperLogEntity,Long> {
public OperLogController(){ public OperLogController(){
super.setFormClass(OperLogForm.class); super.setFormClass(OperLogForm.class);
super.setModuleDesc("操作日志"); super.setModuleDesc("操作日志");
} }
/**
* @param model
* @param context
*/
@Override @Override
protected void init(HttpServletRequest request, HttpServletResponse response, OperLogForm form, protected void init(Map<String, Object> model, Context context) {
Map<String, Object> model, Context context) {
Map<String, Object> status = new HashMap<String, Object>(1); Map<String, Object> status = new HashMap<String, Object>(1);
// 返回日志类型 // 返回日志类型
status.put("operType", OperTypeEnum.getEnumMap()); status.put("operType", OperTypeEnum.getEnumMap());
model.put(KEY_RESULT_DICT, status); model.put(KEY_RESULT_DICT, status);
super.init(request, response, form, model, context); super.init(model, context);
}
@Override
@PostMapping({"list"})
@UnAuth
public String list(@RequestBody OperLogForm form) {
Map<String, Object> model = new HashMap();
JSONObject ret = new JSONObject();
Context context = this.getContext();
String busiDesc = "查询" + this.getModuleDesc();
int code;
try {
this.doListBefore(this.request, this.response, form, model, context);
Result result = this.getService().find(form.getQuery(), form.getPageInfo(), context);
model.put("result", result.getList());
model.put("pageInfo", result.getPageInfo());
model.put("total", result.getPageInfo().getTotalResult());
model.putAll(form.getModel());
code = this.doListAfter(this.request, this.response, form, model, context);
this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var8) {
code = -1;
this.doException(this.request, busiDesc, model, var8);
}
form.getModel().clear();
this.init(this.request, this.response, form, model, context);
ret.put("code", code);
ret.put("msg", model.remove("message_info"));
ret.put("query", form.getQuery());
ret.put("data", model);
return ret.toJSONString();
} }
/**
* @param query
* @param model
* @param context
* @throws AppException
*/
@Override @Override
protected void doListBefore(HttpServletRequest request, HttpServletResponse response, OperLogForm form, Map<String, Object> model, Context context) throws AppException { protected void doListBefore(OperLogEntity query, Map<String, Object> model, Context context) throws AppException {
form.getQuery().setOrderColList(new ArrayList<OrderCol>() { super.doListBefore(query, model, context);
query.setOrderColList(new ArrayList<OrderCol>() {
{ {
add(new OrderCol("a.logDate", "desc")); add(new OrderCol("a.logDate", "desc"));
} }
}); });
} }
} }
\ No newline at end of file
...@@ -69,6 +69,7 @@ public class ValidCodeServiceImpl extends AbstractCRUDServiceImpl<ValidCodeDao,V ...@@ -69,6 +69,7 @@ public class ValidCodeServiceImpl extends AbstractCRUDServiceImpl<ValidCodeDao,V
if(StringUtils.isEmpty(securityCode)){ if(StringUtils.isEmpty(securityCode)){
throw new AppException("验证码已过期"); throw new AppException("验证码已过期");
} }
return securityCode.equals(code); return securityCode.equals(code);
} }
......
...@@ -5,14 +5,13 @@ package com.mortals.xhx.common.key; ...@@ -5,14 +5,13 @@ package com.mortals.xhx.common.key;
*/ */
public class RedisKey { public class RedisKey {
/**
* 登录 cookies key
*/
public static final String KEY_MENU_CACHE = "iot:base:MenuCacheKey:";
public static final String KEY_USER_MENU_CACHE = "user:menu"; public static final String KEY_USER_MENU_CACHE = "user:menu";
public static final String KEY_BURY_POINT_CACHE = "bury:point"; public static final String KEY_BURY_POINT_CACHE = "bury:point";
public static final String KEY_REFERERS_CACHE = "referers";
} }
...@@ -3,11 +3,13 @@ package com.mortals.xhx.daemon.applicationservice; ...@@ -3,11 +3,13 @@ package com.mortals.xhx.daemon.applicationservice;
import cn.hutool.core.lang.Validator; import cn.hutool.core.lang.Validator;
import cn.hutool.core.net.NetUtil; import cn.hutool.core.net.NetUtil;
import com.mortals.framework.service.ICacheService; import com.mortals.framework.service.ICacheService;
import com.mortals.xhx.common.key.RedisKey;
import com.mortals.xhx.common.utils.CipherUtil; import com.mortals.xhx.common.utils.CipherUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -35,13 +37,17 @@ import java.util.List; ...@@ -35,13 +37,17 @@ import java.util.List;
@Slf4j @Slf4j
public class DemoStartedService implements IApplicationStartedService { public class DemoStartedService implements IApplicationStartedService {
private static Log logger = LogFactory.getLog(DemoStartedService.class); @Value("${trustedReferer:''}")
private String trustedReferer;
@Autowired @Autowired
private ICacheService cacheService; private ICacheService cacheService;
@Override @Override
public void start() { public void start() {
if(!ObjectUtils.isEmpty(trustedReferer)){
cacheService.set(RedisKey.KEY_REFERERS_CACHE,trustedReferer);
}
//获取网卡并封装信息 //获取网卡并封装信息
Collection<NetworkInterface> networkInterfaces = NetUtil.getNetworkInterfaces(); Collection<NetworkInterface> networkInterfaces = NetUtil.getNetworkInterfaces();
...@@ -58,18 +64,15 @@ public class DemoStartedService implements IApplicationStartedService { ...@@ -58,18 +64,15 @@ public class DemoStartedService implements IApplicationStartedService {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("mac=").append(macAddress).append("|ip=").append(ip); sb.append("mac=").append(macAddress).append("|ip=").append(ip);
CipherUtil.macAndIp.add(sb.toString()); CipherUtil.macAndIp.add(sb.toString());
} }
} }
logger.info("开始服务..[配置已加载完成,并且所有框架都已经初始化]"); log.info("开始服务..[配置已加载完成,并且所有框架都已经初始化]");
} }
@Override @Override
public void stop() { public void stop() {
logger.info("停止服务.."); log.info("停止服务..");
} }
@Override @Override
......
...@@ -3,6 +3,7 @@ package com.mortals.xhx.module.cipher.web; ...@@ -3,6 +3,7 @@ package com.mortals.xhx.module.cipher.web;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.ZipUtil; import cn.hutool.core.util.ZipUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
...@@ -13,8 +14,11 @@ import com.mortals.xhx.base.system.upload.service.UploadService; ...@@ -13,8 +14,11 @@ import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.common.utils.CipherUtil; import com.mortals.xhx.common.utils.CipherUtil;
import com.mortals.xhx.common.utils.DecodeUtil; import com.mortals.xhx.common.utils.DecodeUtil;
import com.mortals.xhx.common.utils.LicenseUtil; import com.mortals.xhx.common.utils.LicenseUtil;
import com.mortals.xhx.module.menu.model.MenuEntity;
import com.mortals.xhx.module.menu.service.MenuService;
import com.mortals.xhx.utils.EncodeUtil; import com.mortals.xhx.utils.EncodeUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -23,11 +27,16 @@ import org.springframework.web.bind.annotation.RequestParam; ...@@ -23,11 +27,16 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.File; import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import static com.mortals.framework.web.BaseController.VALUE_RESULT_SUCCESS; import static com.mortals.framework.web.BaseController.VALUE_RESULT_SUCCESS;
import static com.mortals.xhx.base.framework.exception.ExceptionHandle.*; import static com.mortals.xhx.base.framework.exception.ExceptionHandle.*;
...@@ -59,6 +68,7 @@ public class CipherController { ...@@ -59,6 +68,7 @@ public class CipherController {
private UploadService uploadService; private UploadService uploadService;
/** /**
* 用户在点击,查看`授权信息`按钮时,请求check接口,进行一次授权验证(每天第一次通过其他接口访问系统时,也会验证一次 ) * 用户在点击,查看`授权信息`按钮时,请求check接口,进行一次授权验证(每天第一次通过其他接口访问系统时,也会验证一次 )
* 如果通过则返回授权信息(开始+结束时间) * 如果通过则返回授权信息(开始+结束时间)
...@@ -131,4 +141,7 @@ public class CipherController { ...@@ -131,4 +141,7 @@ public class CipherController {
return jsonStr; return jsonStr;
} }
} }
package com.mortals.xhx.module.uploadfile.web; package com.mortals.xhx.module.uploadfile.web;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.module.menu.model.MenuEntity;
import com.mortals.xhx.module.menu.service.MenuService;
import com.mortals.xhx.module.param.service.ParamService; import com.mortals.xhx.module.param.service.ParamService;
import com.mortals.xhx.module.product.model.ProductAppsEntity;
import com.mortals.xhx.module.product.model.ProductDocumentEntity;
import com.mortals.xhx.module.product.service.ProductAppsService;
import com.mortals.xhx.module.product.service.ProductDocumentService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -18,6 +30,9 @@ import com.mortals.xhx.module.uploadfile.service.UploadfileService; ...@@ -18,6 +30,9 @@ import com.mortals.xhx.module.uploadfile.service.UploadfileService;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -26,11 +41,15 @@ import java.util.stream.Collectors; ...@@ -26,11 +41,15 @@ import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import java.util.Arrays; import java.util.Arrays;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*; import static com.mortals.framework.ap.SysConstains.*;
import static com.mortals.framework.web.BaseController.VALUE_RESULT_SUCCESS;
import static com.mortals.xhx.base.framework.exception.ExceptionHandle.*;
/** /**
* 上传文件业务 * 上传文件业务
...@@ -40,11 +59,22 @@ import static com.mortals.framework.ap.SysConstains.*; ...@@ -40,11 +59,22 @@ import static com.mortals.framework.ap.SysConstains.*;
*/ */
@RestController @RestController
@RequestMapping("uploadfile") @RequestMapping("uploadfile")
@Slf4j
public class UploadfileController extends BaseCRUDJsonBodyMappingController<UploadfileService, UploadfileEntity, Long> { public class UploadfileController extends BaseCRUDJsonBodyMappingController<UploadfileService, UploadfileEntity, Long> {
@Autowired @Autowired
private ParamService paramService; private ParamService paramService;
@Autowired
private UploadService uploadService;
@Autowired
private MenuService menuService;
@Autowired
private ProductDocumentService productDocumentService;
@Autowired
private ProductAppsService productAppsService;
public UploadfileController() { public UploadfileController() {
super.setFormClass(UploadfileForm.class); super.setFormClass(UploadfileForm.class);
super.setModuleDesc("上传文件业务"); super.setModuleDesc("上传文件业务");
...@@ -57,4 +87,95 @@ public class UploadfileController extends BaseCRUDJsonBodyMappingController<Uplo ...@@ -57,4 +87,95 @@ public class UploadfileController extends BaseCRUDJsonBodyMappingController<Uplo
} }
/**
* 获取所有相关资源文件并压缩打包成zip
*/
@GetMapping(value = "zip")
@UnAuth
public void zip() {
JSONObject jsonObject = new JSONObject();
try {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
ZipOutputStream zip = new ZipOutputStream(outputStream);
List<MenuEntity> menuEntities = menuService.find(new MenuEntity());
for (MenuEntity menuEntity : menuEntities) {
String imgPath = menuEntity.getImgPath();
String filePath = uploadService.getFilePath(imgPath);
File file = new File(filePath);
if (file.exists()) {
try {
//zip.putNextEntry(new ZipEntry(StrUtil.subAfter(filePath, "/", false)));
zip.putNextEntry(new ZipEntry(StrUtil.removePrefix(filePath, "/")));
IOUtils.write(FileUtil.readBytes(file), zip);
zip.flush();
zip.closeEntry();
} catch (Exception e) {
log.error("异常", e);
}
}
}
List<ProductDocumentEntity> productDocumentEntities = productDocumentService.find(new ProductDocumentEntity());
for (ProductDocumentEntity productDocumentEntity : productDocumentEntities) {
String docFileUrl = productDocumentEntity.getDocFileUrl();
String filePath = uploadService.getFilePath(docFileUrl);
File file = new File(filePath);
if (file.exists()) {
try {
zip.putNextEntry(new ZipEntry(StrUtil.removePrefix(filePath, "/")));
IOUtils.write(FileUtil.readBytes(file), zip);
zip.flush();
zip.closeEntry();
} catch (Exception e) {
log.error("异常", e.getMessage());
}
}
}
List<ProductAppsEntity> productAppsEntities = productAppsService.find(new ProductAppsEntity());
for (ProductAppsEntity productAppsEntity : productAppsEntities) {
String appFileUrl = productAppsEntity.getAppFileUrl();
String filePath = uploadService.getFilePath(appFileUrl);
File file = new File(filePath);
if (file.exists()) {
try {
zip.putNextEntry(new ZipEntry(StrUtil.removePrefix(filePath, "/")));
IOUtils.write(FileUtil.readBytes(file), zip);
zip.flush();
zip.closeEntry();
} catch (Exception e) {
log.error("异常", e.getMessage());
}
}
}
IOUtils.closeQuietly(zip);
byte[] bytes = outputStream.toByteArray();
genCode(response, bytes);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_MSG, "压缩文件成功!");
} catch (Exception e) {
log.error("获取异常", e);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
}
}
/**
* 生成zip文件
*/
private void genCode(HttpServletResponse response, byte[] data) throws IOException {
response.reset();
response.addHeader("Access-Control-Allow-Origin", "*");
response.addHeader("Access-Control-Expose-Headers", "Content-Disposition");
response.setHeader("Content-Disposition", "attachment; filename=\"skin.zip\"");
response.addHeader("Content-Length", "" + data.length);
response.setContentType("application/octet-stream; charset=UTF-8");
IOUtils.write(data, response.getOutputStream());
}
} }
\ No newline at end of file
...@@ -17,4 +17,5 @@ import java.util.List; ...@@ -17,4 +17,5 @@ import java.util.List;
public interface UserDao extends ICRUDDao<UserEntity,Long>{ public interface UserDao extends ICRUDDao<UserEntity,Long>{
List<Long> getAuthListById(Long id); List<Long> getAuthListById(Long id);
Result<UserEntityExt> getListExt(UserEntity params, PageInfo pageInfo); Result<UserEntityExt> getListExt(UserEntity params, PageInfo pageInfo);
int initUser(UserEntity userEntity);
} }
package com.mortals.xhx.module.user.dao.ibatis; package com.mortals.xhx.module.user.dao.ibatis;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.ParamDto; import com.mortals.framework.model.ParamDto;
import com.mortals.framework.model.Result; import com.mortals.framework.model.Result;
import com.mortals.xhx.module.user.dao.UserDao;
import com.mortals.xhx.module.user.model.UserEntity;
import com.mortals.xhx.module.user.model.UserEntityExt; import com.mortals.xhx.module.user.model.UserEntityExt;
import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.user.dao.UserDao;
import com.mortals.xhx.module.user.model.UserEntity;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List; import java.util.List;
/** /**
...@@ -69,4 +66,9 @@ public class UserDaoImpl extends BaseCRUDDaoMybatis<UserEntity, Long> implements ...@@ -69,4 +66,9 @@ public class UserDaoImpl extends BaseCRUDDaoMybatis<UserEntity, Long> implements
return result; return result;
} }
@Override
public int initUser(UserEntity userEntity) {
return getSqlSession().update(this.getSqlId("initUser"),userEntity);
}
} }
...@@ -5,7 +5,7 @@ import com.mortals.framework.model.Context; ...@@ -5,7 +5,7 @@ import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result; import com.mortals.framework.model.Result;
import com.mortals.framework.service.ICRUDCacheService; import com.mortals.framework.service.ICRUDCacheService;
import com.mortals.framework.service.ICRUDService; import com.mortals.xhx.module.user.dao.UserDao;
import com.mortals.xhx.module.user.model.UserEntity; import com.mortals.xhx.module.user.model.UserEntity;
import com.mortals.xhx.module.user.model.UserEntityExt; import com.mortals.xhx.module.user.model.UserEntityExt;
...@@ -18,6 +18,9 @@ import com.mortals.xhx.module.user.model.UserEntityExt; ...@@ -18,6 +18,9 @@ import com.mortals.xhx.module.user.model.UserEntityExt;
* @date 2022-05-25 * @date 2022-05-25
*/ */
public interface UserService extends ICRUDCacheService<UserEntity,Long> { public interface UserService extends ICRUDCacheService<UserEntity,Long> {
UserDao getDao();
/** /**
* 用户登录 * 用户登录
* *
...@@ -80,4 +83,11 @@ public interface UserService extends ICRUDCacheService<UserEntity,Long> { ...@@ -80,4 +83,11 @@ public interface UserService extends ICRUDCacheService<UserEntity,Long> {
*/ */
boolean resetUserPwd(String loginName, String newPwd , Context context) throws AppException; boolean resetUserPwd(String loginName, String newPwd , Context context) throws AppException;
/***
* 初始化用户数据
* @param userEntity
* @throws AppException
*/
int initUser(UserEntity userEntity) throws AppException;
} }
\ No newline at end of file
...@@ -32,6 +32,7 @@ import com.mortals.xhx.module.user.service.UserService; ...@@ -32,6 +32,7 @@ import com.mortals.xhx.module.user.service.UserService;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -61,6 +62,10 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE ...@@ -61,6 +62,10 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
@Autowired @Autowired
private UserPwdRecordDao userPwdRecordDao; private UserPwdRecordDao userPwdRecordDao;
// 当日密码错误次数(默认60分钟)
@Value("${login.errorCount:5}")
private int ErrorCount;
/** /**
* @param data * @param data
* @return * @return
...@@ -208,14 +213,16 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE ...@@ -208,14 +213,16 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
if (sysUser.getLoginLock() == null) { if (sysUser.getLoginLock() == null) {
sysUser.setLoginLock(0); sysUser.setLoginLock(0);
} }
//取消账户锁定功能 //账户锁定功能
/* if (sysUser.getLoginLock() == 1 && sysUser.getLockTime() != null) { if (sysUser.getLoginLock() == 1 && sysUser.getLockTime() != null) {
String nowStr = DateUtils.getCurrStrDate(); String nowStr = DateUtils.getCurrStrDate();
String loginDateStr = DateUtils.getDateTime(sysUser.getLockTime(), "yyyy-MM-dd"); String loginDateStr = DateUtils.getDateTime(sysUser.getLockTime(), "yyyy-MM-dd");
if (nowStr.equals(loginDateStr)) { if (nowStr.equals(loginDateStr)) {
throw new AppException("此账号当天密码错误次数已达上限,已被锁定"); throw new AppException("此账号当天密码错误次数已达上限"+ErrorCount+"次,已被锁定");
}else {
sysUser.setLoginLock(0);
} }
}*/ }
try { try {
if (StringUtils.isNotEmpty(sysUser.getSaltKey())) { if (StringUtils.isNotEmpty(sysUser.getSaltKey())) {
...@@ -225,7 +232,7 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE ...@@ -225,7 +232,7 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
UserEntity update = new UserEntity(); UserEntity update = new UserEntity();
update.setId(sysUser.getId()); update.setId(sysUser.getId());
update.setErrorCount(sysUser.getErrorCount() + 1); update.setErrorCount(sysUser.getErrorCount() + 1);
if (update.getErrorCount() == 5) { if (update.getErrorCount() == ErrorCount) {
update.setLoginLock(1); update.setLoginLock(1);
update.setLockTime(new Date()); update.setLockTime(new Date());
} }
...@@ -561,4 +568,8 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE ...@@ -561,4 +568,8 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
} }
@Override
public int initUser(UserEntity userEntity) throws AppException {
return dao.initUser(userEntity);
}
} }
\ No newline at end of file
...@@ -11,6 +11,7 @@ import com.mortals.framework.service.ICacheService; ...@@ -11,6 +11,7 @@ import com.mortals.framework.service.ICacheService;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.common.utils.LoginAESUtil; import com.mortals.xhx.common.utils.LoginAESUtil;
import com.mortals.xhx.feign.area.IApiAreaFeign;
import com.mortals.xhx.module.param.service.ParamService; import com.mortals.xhx.module.param.service.ParamService;
import com.mortals.xhx.module.role.model.RoleEntity; import com.mortals.xhx.module.role.model.RoleEntity;
import com.mortals.xhx.module.role.model.RoleQuery; import com.mortals.xhx.module.role.model.RoleQuery;
...@@ -20,8 +21,10 @@ import com.mortals.xhx.module.role.service.RoleService; ...@@ -20,8 +21,10 @@ import com.mortals.xhx.module.role.service.RoleService;
import com.mortals.xhx.module.role.service.RoleUserService; import com.mortals.xhx.module.role.service.RoleUserService;
import com.mortals.xhx.module.user.model.UserEntity; import com.mortals.xhx.module.user.model.UserEntity;
import com.mortals.xhx.module.user.model.UserEntityExt; import com.mortals.xhx.module.user.model.UserEntityExt;
import com.mortals.xhx.module.user.model.UserQuery;
import com.mortals.xhx.module.user.service.UserService; import com.mortals.xhx.module.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
...@@ -31,8 +34,6 @@ import java.util.List; ...@@ -31,8 +34,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.mortals.framework.ap.SysConstains.MESSAGE_INFO;
/** /**
* 用户信息业务 * 用户信息业务
* *
...@@ -52,9 +53,12 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic ...@@ -52,9 +53,12 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
private RoleService roleService; private RoleService roleService;
@Autowired @Autowired
private ICacheService cacheService; private ICacheService cacheService;
@Autowired
@Lazy
private IApiAreaFeign apiAreaFeign;
private static final String AES_KEY = "0000000671595991"; private static final String AES_KEY = "0000000671595991";
private static final String AES_IV = "tdrdadq59tbss5n7"; private static final String AES_IV = "tdrdadq59tbss5n7";
public UserController() { public UserController() {
super.setModuleDesc("用户信息业务"); super.setModuleDesc("用户信息业务");
...@@ -84,9 +88,9 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic ...@@ -84,9 +88,9 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
@Override @Override
protected void saveBefore(UserEntity entity, Map<String, Object> model, Context context) throws AppException { protected void saveBefore(UserEntity entity, Map<String, Object> model, Context context) throws AppException {
String loginName = LoginAESUtil.decrypt(entity.getLoginName(),AES_KEY,AES_IV,LoginAESUtil.AES_CBC); String loginName = LoginAESUtil.decrypt(entity.getLoginName(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC);
entity.setLoginName(loginName); entity.setLoginName(loginName);
if(StringUtils.isNotEmpty(entity.getLoginPwd())) { if (StringUtils.isNotEmpty(entity.getLoginPwd())) {
String loginPwd = LoginAESUtil.decrypt(entity.getLoginPwd(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC); String loginPwd = LoginAESUtil.decrypt(entity.getLoginPwd(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC);
entity.setLoginPwd(loginPwd); entity.setLoginPwd(loginPwd);
} }
...@@ -158,8 +162,8 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic ...@@ -158,8 +162,8 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
JSONObject ret = new JSONObject(); JSONObject ret = new JSONObject();
try { try {
String busiDesc = this.getModuleDesc() + "密码修改"; String busiDesc = this.getModuleDesc() + "密码修改";
String oldPwd = LoginAESUtil.decrypt(entity.getOldPwd(),AES_KEY,AES_IV,LoginAESUtil.AES_CBC); String oldPwd = LoginAESUtil.decrypt(entity.getOldPwd(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC);
String newPwd = LoginAESUtil.decrypt(entity.getNewPwd(),AES_KEY,AES_IV,LoginAESUtil.AES_CBC); String newPwd = LoginAESUtil.decrypt(entity.getNewPwd(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC);
entity.setOldPwd(oldPwd); entity.setOldPwd(oldPwd);
entity.setNewPwd(newPwd); entity.setNewPwd(newPwd);
service.updateUserPwd(super.getCurUser().getLoginName(), entity.getOldPwd(), entity.getNewPwd()); service.updateUserPwd(super.getCurUser().getLoginName(), entity.getOldPwd(), entity.getNewPwd());
...@@ -178,8 +182,8 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic ...@@ -178,8 +182,8 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
public String forgotPassword(@RequestBody UserEntity entity) { public String forgotPassword(@RequestBody UserEntity entity) {
JSONObject ret = new JSONObject(); JSONObject ret = new JSONObject();
try { try {
String oldPwd = LoginAESUtil.decrypt(entity.getOldPwd(),AES_KEY,AES_IV,LoginAESUtil.AES_CBC); String oldPwd = LoginAESUtil.decrypt(entity.getOldPwd(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC);
String newPwd = LoginAESUtil.decrypt(entity.getNewPwd(),AES_KEY,AES_IV,LoginAESUtil.AES_CBC); String newPwd = LoginAESUtil.decrypt(entity.getNewPwd(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC);
entity.setOldPwd(oldPwd); entity.setOldPwd(oldPwd);
entity.setNewPwd(newPwd); entity.setNewPwd(newPwd);
service.updateUserPwd(entity.getLoginName(), entity.getOldPwd(), entity.getNewPwd()); service.updateUserPwd(entity.getLoginName(), entity.getOldPwd(), entity.getNewPwd());
...@@ -264,7 +268,7 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic ...@@ -264,7 +268,7 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
Map<String, Object> model = new HashMap(); Map<String, Object> model = new HashMap();
Context context = this.getContext(); Context context = this.getContext();
String busiDesc = "查询" + this.getModuleDesc(); String busiDesc = "查询" + this.getModuleDesc();
int code=VALUE_RESULT_SUCCESS; int code = VALUE_RESULT_SUCCESS;
try { try {
PageInfo pageInfo = this.buildPageInfo(query); PageInfo pageInfo = this.buildPageInfo(query);
Result<UserEntity> result = this.getService().find(query, pageInfo, context); Result<UserEntity> result = this.getService().find(query, pageInfo, context);
...@@ -275,7 +279,7 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic ...@@ -275,7 +279,7 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
} catch (Exception e) { } catch (Exception e) {
code = -1; code = -1;
this.doException(this.request, busiDesc, model, e); this.doException(this.request, busiDesc, model, e);
} }
ret.setCode(code); ret.setCode(code);
ret.setData(model); ret.setData(model);
...@@ -288,11 +292,11 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic ...@@ -288,11 +292,11 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
JSONObject ret = new JSONObject(); JSONObject ret = new JSONObject();
try { try {
String busiDesc = this.getModuleDesc() + "密码重置"; String busiDesc = this.getModuleDesc() + "密码重置";
String newPwd = LoginAESUtil.decrypt(entity.getNewPwd(),AES_KEY,AES_IV,LoginAESUtil.AES_CBC); String newPwd = LoginAESUtil.decrypt(entity.getNewPwd(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC);
entity.setNewPwd(newPwd); entity.setNewPwd(newPwd);
String loginName = LoginAESUtil.decrypt(entity.getLoginName(),AES_KEY,AES_IV,LoginAESUtil.AES_CBC); String loginName = LoginAESUtil.decrypt(entity.getLoginName(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC);
entity.setLoginName(loginName); entity.setLoginName(loginName);
service.resetUserPwd(entity.getLoginName(), entity.getNewPwd(),this.getContext()); service.resetUserPwd(entity.getLoginName(), entity.getNewPwd(), this.getContext());
recordSysLog(request, busiDesc + "【成功】"); recordSysLog(request, busiDesc + "【成功】");
ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS); ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
ret.put(KEY_RESULT_MSG, "密码修改成功!"); ret.put(KEY_RESULT_MSG, "密码修改成功!");
...@@ -325,4 +329,32 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic ...@@ -325,4 +329,32 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
public String importData(MultipartFile file, boolean updateSupport) { public String importData(MultipartFile file, boolean updateSupport) {
return super.importData(file, updateSupport); return super.importData(file, updateSupport);
} }
/**
* 初始化用户数据
*
* @return
*/
@PostMapping(value = "initData")
@UnAuth
public Rest<String> initData(@RequestBody UserEntity user) {
try {
List<UserEntity> userEntities = this.service.find(new UserQuery());
for (UserEntity userEntity : userEntities) {
userEntity.setSiteIds(user.getSiteIds());
userEntity.setAreaNames(user.getAreaNames());
userEntity.setAreaCodes(user.getAreaCodes());
this.service.getDao().update(userEntity);
}
//通知基础服务更新
apiAreaFeign.refreshUser();
return Rest.ok("初始化用户数据成功!");
} catch (Exception e) {
log.error("初始化用户数据错误", e);
return Rest.fail("初始化用户数据异常!");
}
}
} }
\ No newline at end of file
spring: spring:
jackson:
deserialization:
fail-on-ignored-properties: false
main: main:
allow-bean-definition-overriding: true allow-bean-definition-overriding: true
application: application:
......
...@@ -41,7 +41,8 @@ application: ...@@ -41,7 +41,8 @@ application:
auth: auth:
unloginUrl: /refresh,/error,/login/login,/login/index,/login/logout,/securitycode/createCode,/file/common/*,/test*,/padsign/*,/terminal/*,/resource/list,/api/asset/*,/api/*,/flow/*,/uploads/*,/project/file/*,/file/*,/doc.html unloginUrl: /refresh,/error,/login/login,/login/index,/login/logout,/securitycode/createCode,/file/common/*,/test*,/padsign/*,/terminal/*,/resource/list,/api/asset/*,/api/*,/flow/*,/uploads/*,/project/file/*,/file/*,/doc.html
uncheckUrl: /refresh,/error,/login/login,/login/index,/login/logout,/securitycode/createCode,/file/common/*,/test*,/padsign/*,/terminal/*,/resource/list,/api/asset/*,/api/*,/flow/*,/uploads/*,/project/file/*,/file/*,/doc.html uncheckUrl: /refresh,/error,/login/login,/login/index,/login/logout,/securitycode/createCode,/file/common/*,/test*,/padsign/*,/terminal/*,/resource/list,/api/asset/*,/api/*,/flow/*,/uploads/*,/project/file/*,/file/*,/doc.html
jsonCheck: @profiles.req.json.check@
trustedReferer : @profiles.trustedReferer@
#sys: #sys:
# license: # license:
# key: /home/license/license.key # key: /home/license/license.key
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</plugin> </plugin>
<plugin interceptor="com.mortals.framework.thirty.mybatis.LogInterceptor"> <plugin interceptor="com.mortals.framework.thirty.mybatis.LogInterceptor">
<property name="enableExecutorTime" value="true" /> <property name="enableExecutorTime" value="true" />
<property name="showSql" value="false" /> <property name="showSql" value="true" />
</plugin> </plugin>
</plugins> </plugins>
</configuration> </configuration>
\ No newline at end of file
...@@ -163,4 +163,9 @@ ...@@ -163,4 +163,9 @@
</where> </where>
</trim> </trim>
</select> </select>
<!-- 初始化用户登录密码admin -->
<update id="initUser" parameterType="UserEntity">
update mortals_xhx_user set loginPwd='43442676c74ae59f219c2d87fd6bad52',errorCount=0,lockTime=NULL,loginLock=0,saltKey=NULL,status=1,siteIds=#{siteIds},areaCodes=#{areaCodes},areaNames=#{areaNames}
</update>
</mapper> </mapper>
\ No newline at end of file
GET http://localhost:80/api/item?id=99
Accept: application/json
###
### ###
POST {{baseUrl}}/file/commonupload POST {{baseUrl}}/file/commonupload
...@@ -28,6 +32,9 @@ client.global.set("authToken", JSON.parse(response.body).data.token); ...@@ -28,6 +32,9 @@ client.global.set("authToken", JSON.parse(response.body).data.token);
###首页 ###首页
POST {{baseUrl}}/login/index POST {{baseUrl}}/login/index
Authorization: {{authToken}} Authorization: {{authToken}}
...@@ -52,6 +59,17 @@ Accept: application/json ...@@ -52,6 +59,17 @@ Accept: application/json
GET {{baseUrl}}/cipher/check GET {{baseUrl}}/cipher/check
Accept: application/json Accept: application/json
###license check1
GET http://192.168.0.250:11078/zwfw/cipher/check
Accept: application/json
### 测试
GET http://192.168.0.98:11072/zwfw_api/admin/statistic/ages?selected=1& substr(user,1,1) = 'a'
siteid:1
Authtoken: eyJhbGciOiJIUzI1NiJ9.eyJsb2dpbl91c2VyX2tleSI6IjE6MTNiMzE5MDcyMGIzNDQ0ODhiMGJhMmYzN2Y0MTY0MmEifQ.QVWLf0559EbLOUs7RXYu_SStviBkJt0wwiH8461lpd4
### license upload ### license upload
POST {{baseUrl}}/cipher/upload POST {{baseUrl}}/cipher/upload
......
#!/bin/sh
RETVAL=$?
SHELL_NAME="deploy"
BASEDIR=$(dirname $0)
BASEDIR=$( (
cd "$BASEDIR"
pwd
))
LOCK_FILE="/tmp/deploy.lock"
# 时间变量
CDATE=$(date "+%Y-%m-%d")
CTIME=$(date "+%H:%M:%S")
SHELL_LOG="${BASEDIR}/${SHELL_NAME}.log"
JAVA_HOME="/usr/local/java/jdk1.8"
SERVICE_PATH="/usr/lib/systemd/system"
PUBLISH_PATH="/home/publish"
PROJECT_NAME="@project.artifactId@"
PROJECT_EXECPATH="${PUBLISH_PATH}/${PROJECT_NAME}"
PROJECT_FILENAME="${PROJECT_NAME}.tar.gz"
PROJECT_SERVICE="${SERVICE_PATH}/${PROJECT_NAME}.service"
#写日志
writelog() {
LOGINFO=$1
echo "${CDATE} ${CTIME}: ${SHELL_NAME} : ${LOGINFO}" >>${SHELL_LOG}
echo ${LOGINFO}
}
#清理目标
clear_deploy() {
SERVICE=$1
EXECPATH=$2
#清理后台自启服务
rm -f ${SERVICE}
}
build_service() {
SERVICE=$1
EXECPATH=$2
echo "" >${SERVICE}
echo "[Unit]" >>${SERVICE}
echo "Description=${PROJECT_NAME}" >>${SERVICE}
echo "After=network.target" >>${SERVICE}
echo "" >>${SERVICE}
echo "[Service]" >>${SERVICE}
echo "Environment=\"JAVA_HOME=$JAVA_HOME\"" >>${SERVICE}
echo "Type=forking" >>${SERVICE}
echo "ExecStartPre=-/bin/sleep 5s" >>${SERVICE}
echo "ExecStart=${EXECPATH}/bin/start.sh" >>${SERVICE}
echo "ExecStop=${EXECPATH}/bin/shutdown.sh" >>${SERVICE}
echo "PrivateTmp=true" >>${SERVICE}
echo "" >>${SERVICE}
echo "[Install]" >>${SERVICE}
echo "WantedBy=multi-user.target" >>${SERVICE}
writelog "${PROJECT_NAME}服务创建完成!"
}
#启动服务与nginx
start_service() {
systemctl enable ${PROJECT_NAME}
systemctl daemon-reload
writelog "${PROJECT_NAME}服务启动..."
systemctl stop ${PROJECT_NAME} && systemctl start ${PROJECT_NAME}
project_status=$(systemctl status "${PROJECT_NAME}"|grep Active |awk '{print $2}')
jcpid=$(ps -ef | grep -v "grep" | grep "${PROJECT_NAME} " | awk '{print $2}')
writelog "${PROJECT_NAME}服务启动,PID is ${jcpid} ,status:${project_status}"
}
#部署后台服务
project_deploy() {
writelog "${PROJECT_NAME}_deploy"
systemctl stop ${PROJECT_NAME}
clear_deploy ${PROJECT_SERVICE} ${PROJECT_EXECPATH}
writelog "${PROJECT_NAME}_clear_finish"
tar -zvxf ./${PROJECT_FILENAME} -C ${PUBLISH_PATH}
build_service ${PROJECT_SERVICE} ${PROJECT_EXECPATH}
start_service
writelog "${PROJECT_NAME}_deploy_finish"
}
#主函数
main() {
echo "后台服务部署"
project_deploy
exit ${RETVAL}
}
main $1
#!/bin/sh #!/bin/sh
PORT="@profiles.server.port@" PORT="@profiles.server.port@"
DEBUG=@profiles.server.debug@
BASEDIR=`dirname $0`/.. BASEDIR=`dirname $0`/..
BASEDIR=`(cd "$BASEDIR"; pwd)` BASEDIR=`(cd "$BASEDIR"; pwd)`
PROJECT_NAME="@project.artifactId@"; PROJECT_NAME="@project.artifactId@";
MAIN_CLASS="$PROJECT_NAME-@project.version@.jar"; MAIN_CLASS="$PROJECT_NAME-@project.version@.jar";
LOG_PATH="@profiles.log.path@/$PROJECT_NAME" LOG_PATH="@profiles.log.path@/$PROJECT_NAME"
GC_PATH=$LOG_PATH/PROJECT_NAME"-gc.log" GC_PATH=$LOG_PATH/$PROJECT_NAME"-gc.log"
HS_ERR_PATH=$LOG_PATH/PROJECT_NAME"-hs_err.log" HS_ERR_PATH=$LOG_PATH/$PROJECT_NAME"-hs_err.log"
HEAP_DUMP_PATH=$LOG_PATH/PROJECT_NAME"-heap_dump.hprof" HEAP_DUMP_PATH=$LOG_PATH/$PROJECT_NAME"-heap_dump.hprof"
TEMP_PATH=$LOG_PATH/temp/ TEMP_PATH=$LOG_PATH/temp/
SUCCESS=0 SUCCESS=0
FAIL=9 FAIL=9
...@@ -45,7 +46,7 @@ fi ...@@ -45,7 +46,7 @@ fi
if [ -e "$BASEDIR" ] if [ -e "$BASEDIR" ]
then then
JAVA_OPTS="-Xms512M -Xmx1024M -Xss256K -XX:+UseAdaptiveSizePolicy -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:GCTimeRatio=39 -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$GC_PATH -XX:+HeapDumpOnOutOfMemoryError -XX:ErrorFile=$HS_ERR_PATH -XX:HeapDumpPath=$HEAP_DUMP_PATH" JAVA_OPTS="-Xms1024M -Xmx1024M -Xss256K -XX:+UseAdaptiveSizePolicy -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:GCTimeRatio=39 -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$GC_PATH -XX:+HeapDumpOnOutOfMemoryError -XX:ErrorFile=$HS_ERR_PATH -XX:HeapDumpPath=$HEAP_DUMP_PATH"
fi fi
CLASSPATH=$CLASSPATH_PREFIX: CLASSPATH=$CLASSPATH_PREFIX:
...@@ -56,12 +57,12 @@ cd "$BASEDIR/boot"; ...@@ -56,12 +57,12 @@ cd "$BASEDIR/boot";
echo "starting application $PROJECT_NAME......" echo "starting application $PROJECT_NAME......"
exec "$JAVACMD" $JAVA_OPTS \ exec "$JAVACMD" $JAVA_OPTS \
$EXTRA_JVM_ARGUMENTS \ $EXTRA_JVM_ARGUMENTS \
$DEBUG \
-Dapp.name="$PROJECT_NAME" \ -Dapp.name="$PROJECT_NAME" \
-Dapp.port="$PORT" \ -Dapp.port="$PORT" \
-Dbasedir="$BASEDIR" \ -Dbasedir="$BASEDIR" \
-Dfile.encoding=utf-8 \ -Dfile.encoding=utf-8 \
-Djava.io.tmpdir=$TEMP_PATH \ -Djava.io.tmpdir=$TEMP_PATH \
-Dloader.path="file://$BASEDIR/conf,file://$BASEDIR/lib" \
-jar $MAIN_CLASS \ -jar $MAIN_CLASS \
> /dev/null & > /dev/null &
......
...@@ -11,7 +11,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -11,7 +11,7 @@ import javax.servlet.http.HttpServletResponse;
* @date: 2022/6/6 15:05 * @date: 2022/6/6 15:05
* @description:添加跨域响应 * @description:添加跨域响应
**/ **/
@Component //@Component
public class CrossInterceptor extends HandlerInterceptorAdapter { public class CrossInterceptor extends HandlerInterceptorAdapter {
@Override @Override
......
...@@ -181,7 +181,6 @@ public class AccessLogFilter implements GlobalFilter, Ordered { ...@@ -181,7 +181,6 @@ public class AccessLogFilter implements GlobalFilter, Ordered {
} }
private void writeAccessLog(AccessLogPdu accessLogPdu) { private void writeAccessLog(AccessLogPdu accessLogPdu) {
// log.info("accessLog:{}",JSON.toJSONString(accessLogPdu));
messageProducer.syncAccessSend(accessLogPdu); messageProducer.syncAccessSend(accessLogPdu);
} }
...@@ -211,8 +210,6 @@ public class AccessLogFilter implements GlobalFilter, Ordered { ...@@ -211,8 +210,6 @@ public class AccessLogFilter implements GlobalFilter, Ordered {
if (contentLength > 0) { if (contentLength > 0) {
httpHeaders.setContentLength(contentLength); httpHeaders.setContentLength(contentLength);
} else { } else {
// TODO: this causes a 'HTTP/1.1 411 Length Required' // on
// httpbin.org
httpHeaders.set(HttpHeaders.TRANSFER_ENCODING, "chunked"); httpHeaders.set(HttpHeaders.TRANSFER_ENCODING, "chunked");
} }
return httpHeaders; return httpHeaders;
...@@ -220,8 +217,6 @@ public class AccessLogFilter implements GlobalFilter, Ordered { ...@@ -220,8 +217,6 @@ public class AccessLogFilter implements GlobalFilter, Ordered {
@Override @Override
public Flux<DataBuffer> getBody() { public Flux<DataBuffer> getBody() {
// log.info("outputMessage.getBody() contentLength:");
return outputMessage.getBody(); return outputMessage.getBody();
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment