mirror of
https://github.com/chatopera/cosin.git
synced 2025-07-11 20:17:03 +08:00
Spring Boot 3
This commit is contained in:
parent
2680ed3bbb
commit
95f35c13e0
@ -19,21 +19,6 @@
|
|||||||
<build>
|
<build>
|
||||||
<finalName>contact-center</finalName>
|
<finalName>contact-center</finalName>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
<goal>repackage</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-resources-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>pl.project13.maven</groupId>
|
<groupId>pl.project13.maven</groupId>
|
||||||
<artifactId>git-commit-id-plugin</artifactId>
|
<artifactId>git-commit-id-plugin</artifactId>
|
||||||
@ -73,28 +58,6 @@
|
|||||||
<injectAllReactorProjects>true</injectAllReactorProjects>
|
<injectAllReactorProjects>true</injectAllReactorProjects>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<fork>true</fork>
|
|
||||||
</configuration>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework</groupId>
|
|
||||||
<artifactId>springloaded</artifactId>
|
|
||||||
<version>1.2.8.RELEASE</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
<encoding>UTF-8</encoding>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-war-plugin</artifactId>
|
<artifactId>maven-war-plugin</artifactId>
|
||||||
@ -113,13 +76,27 @@
|
|||||||
</configuration>
|
</configuration>
|
||||||
<version>3.3.2</version>
|
<version>3.3.2</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>repackage</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>springloaded</artifactId>
|
||||||
|
<version>1.2.8.RELEASE</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
<configuration>
|
|
||||||
<source>9</source>
|
|
||||||
<target>9</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
<defaultGoal>compile</defaultGoal>
|
<defaultGoal>compile</defaultGoal>
|
||||||
|
@ -21,6 +21,7 @@ import com.cskefu.cc.basic.MainContext;
|
|||||||
import com.cskefu.cc.config.AppCtxRefreshEventListener;
|
import com.cskefu.cc.config.AppCtxRefreshEventListener;
|
||||||
import com.cskefu.cc.util.SystemEnvHelper;
|
import com.cskefu.cc.util.SystemEnvHelper;
|
||||||
import com.cskefu.cc.util.mobile.MobileNumberUtils;
|
import com.cskefu.cc.util.mobile.MobileNumberUtils;
|
||||||
|
import jakarta.servlet.MultipartConfigElement;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@ -28,15 +29,18 @@ import org.springframework.beans.factory.annotation.Value;
|
|||||||
import org.springframework.boot.Banner;
|
import org.springframework.boot.Banner;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.jms.JmsPoolConnectionFactoryFactory;
|
||||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||||
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
|
import org.springframework.boot.web.server.ConfigurableWebServerFactory;
|
||||||
import org.springframework.boot.web.servlet.ErrorPage;
|
import org.springframework.boot.web.server.ErrorPage;
|
||||||
|
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
|
||||||
import org.springframework.boot.web.servlet.MultipartConfigFactory;
|
import org.springframework.boot.web.servlet.MultipartConfigFactory;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
import org.springframework.util.unit.DataSize;
|
||||||
|
|
||||||
import javax.servlet.MultipartConfigElement;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
@ -50,10 +54,10 @@ public class Application {
|
|||||||
private String uploaddir;
|
private String uploaddir;
|
||||||
|
|
||||||
@Value("${spring.servlet.multipart.max-file-size}")
|
@Value("${spring.servlet.multipart.max-file-size}")
|
||||||
private String multipartMaxUpload;
|
private Long multipartMaxUpload;
|
||||||
|
|
||||||
@Value("${spring.servlet.multipart.max-request-size}")
|
@Value("${spring.servlet.multipart.max-request-size}")
|
||||||
private String multipartMaxRequest;
|
private Long multipartMaxRequest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加载模块
|
* 加载模块
|
||||||
@ -63,7 +67,6 @@ public class Application {
|
|||||||
if (StringUtils.equalsIgnoreCase(SystemEnvHelper.parseFromApplicationProps("cskefu.modules.contacts"), "true")) {
|
if (StringUtils.equalsIgnoreCase(SystemEnvHelper.parseFromApplicationProps("cskefu.modules.contacts"), "true")) {
|
||||||
MainContext.enableModule(Constants.CSKEFU_MODULE_CONTACTS);
|
MainContext.enableModule(Constants.CSKEFU_MODULE_CONTACTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 会话监控模块 Customer Chats Audit
|
// 会话监控模块 Customer Chats Audit
|
||||||
if (StringUtils.equalsIgnoreCase(SystemEnvHelper.parseFromApplicationProps("cskefu.modules.cca"), "true")) {
|
if (StringUtils.equalsIgnoreCase(SystemEnvHelper.parseFromApplicationProps("cskefu.modules.cca"), "true")) {
|
||||||
MainContext.enableModule(Constants.CSKEFU_MODULE_CCA);
|
MainContext.enableModule(Constants.CSKEFU_MODULE_CCA);
|
||||||
@ -107,24 +110,34 @@ public class Application {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO lecjy
|
||||||
@Bean
|
@Bean
|
||||||
public MultipartConfigElement multipartConfigElement() {
|
public MultipartConfigElement multipartConfigElement() {
|
||||||
MultipartConfigFactory factory = new MultipartConfigFactory();
|
MultipartConfigFactory factory = new MultipartConfigFactory();
|
||||||
factory.setMaxFileSize(multipartMaxUpload); //KB,MB
|
factory.setMaxFileSize(DataSize.ofMegabytes(multipartMaxUpload)); //KB,MB
|
||||||
factory.setMaxRequestSize(multipartMaxRequest);
|
factory.setMaxRequestSize(DataSize.ofMegabytes(multipartMaxRequest));
|
||||||
factory.setLocation(uploaddir);
|
factory.setLocation(uploaddir);
|
||||||
return factory.createMultipartConfig();
|
return factory.createMultipartConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO lecjy
|
||||||
@Bean
|
@Bean
|
||||||
public EmbeddedServletContainerCustomizer containerCustomizer() {
|
public WebServerFactoryCustomizer<ConfigurableWebServerFactory> webServerFactoryCustomizer() {
|
||||||
return container -> {
|
return factory -> {
|
||||||
ErrorPage error = new ErrorPage("/error.html");
|
// 定义404错误页
|
||||||
container.addErrorPages(error);
|
HttpStatus notFound = HttpStatus.NOT_FOUND;
|
||||||
|
// 定义404错误页
|
||||||
|
ErrorPage errorPage = new ErrorPage(notFound, "/error.html");
|
||||||
|
// 追加错误页,替换springboot默认的错误页
|
||||||
|
factory.addErrorPages(errorPage);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
Application.serve(args);
|
try {
|
||||||
|
Application.serve(args);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2017 优客服-多渠道客服系统
|
|
||||||
* Modifications copyright (C) 2018-2023 Chatopera Inc, <https://www.chatopera.com>
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
package com.cskefu.cc;
|
|
||||||
|
|
||||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
|
||||||
import org.springframework.boot.web.support.SpringBootServletInitializer;
|
|
||||||
|
|
||||||
public class ServletInitializer extends SpringBootServletInitializer{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
|
||||||
return application.sources(Application.class);
|
|
||||||
}
|
|
||||||
}
|
|
@ -37,6 +37,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
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 java.util.Date;
|
import java.util.Date;
|
||||||
@ -61,6 +62,7 @@ public class ACDAgentService {
|
|||||||
private ACDPolicyService acdPolicyService;
|
private ACDPolicyService acdPolicyService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@Lazy
|
||||||
private PeerSyncIM peerSyncIM;
|
private PeerSyncIM peerSyncIM;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -325,7 +327,7 @@ public class ACDAgentService {
|
|||||||
*/
|
*/
|
||||||
AgentService service = null;
|
AgentService service = null;
|
||||||
if (StringUtils.isNotBlank(agentUser.getAgentserviceid())) {
|
if (StringUtils.isNotBlank(agentUser.getAgentserviceid())) {
|
||||||
service = agentServiceRes.findById(agentUser.getAgentserviceid());
|
service = agentServiceRes.getReferenceById(agentUser.getAgentserviceid());
|
||||||
} else if (agentStatus != null) {
|
} else if (agentStatus != null) {
|
||||||
// 该访客没有和坐席对话,因此没有 AgentService
|
// 该访客没有和坐席对话,因此没有 AgentService
|
||||||
// 当做留言处理,创建一个新的 AgentService
|
// 当做留言处理,创建一个新的 AgentService
|
||||||
@ -339,7 +341,7 @@ public class ACDAgentService {
|
|||||||
service.setSessiontimes(System.currentTimeMillis() - service.getServicetime().getTime());
|
service.setSessiontimes(System.currentTimeMillis() - service.getServicetime().getTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
final AgentUserTask agentUserTask = agentUserTaskRes.findOne(
|
final AgentUserTask agentUserTask = agentUserTaskRes.getReferenceById(
|
||||||
agentUser.getId());
|
agentUser.getId());
|
||||||
if (agentUserTask != null) {
|
if (agentUserTask != null) {
|
||||||
service.setAgentreplyinterval(agentUserTask.getAgentreplyinterval());
|
service.setAgentreplyinterval(agentUserTask.getAgentreplyinterval());
|
||||||
@ -514,7 +516,7 @@ public class ACDAgentService {
|
|||||||
|
|
||||||
AgentService agentService = new AgentService();
|
AgentService agentService = new AgentService();
|
||||||
if (StringUtils.isNotBlank(agentUser.getAgentserviceid())) {
|
if (StringUtils.isNotBlank(agentUser.getAgentserviceid())) {
|
||||||
AgentService existAgentService = agentServiceRes.findById(agentUser.getAgentserviceid());
|
AgentService existAgentService = agentServiceRes.getReferenceById(agentUser.getAgentserviceid());
|
||||||
if (existAgentService != null) {
|
if (existAgentService != null) {
|
||||||
agentService = existAgentService;
|
agentService = existAgentService;
|
||||||
} else {
|
} else {
|
||||||
@ -581,7 +583,7 @@ public class ACDAgentService {
|
|||||||
agentService.setOwner(agentUser.getOwner());
|
agentService.setOwner(agentUser.getOwner());
|
||||||
agentService.setTimes(0);
|
agentService.setTimes(0);
|
||||||
|
|
||||||
final User agent = userRes.findOne(agentService.getAgentno());
|
final User agent = userRes.getReferenceById(agentService.getAgentno());
|
||||||
agentUser.setAgentname(agent.getUname());
|
agentUser.setAgentname(agent.getUname());
|
||||||
agentUser.setAgentno(agentService.getAgentno());
|
agentUser.setAgentno(agentService.getAgentno());
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ public class ACDChatbotService {
|
|||||||
AgentService agentService = new AgentService(); //放入缓存的对象
|
AgentService agentService = new AgentService(); //放入缓存的对象
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
if (StringUtils.isNotBlank(agentUser.getAgentserviceid())) {
|
if (StringUtils.isNotBlank(agentUser.getAgentserviceid())) {
|
||||||
agentService = agentServiceRes.findById(agentUser.getAgentserviceid());
|
agentService = agentServiceRes.getReferenceById(agentUser.getAgentserviceid());
|
||||||
agentService.setEndtime(now);
|
agentService.setEndtime(now);
|
||||||
if (agentService.getServicetime() != null) {
|
if (agentService.getServicetime() != null) {
|
||||||
agentService.setSessiontimes(System.currentTimeMillis() - agentService.getServicetime().getTime());
|
agentService.setSessiontimes(System.currentTimeMillis() - agentService.getServicetime().getTime());
|
||||||
|
@ -164,7 +164,7 @@ public class ACDPolicyService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (agentUser != null && StringUtils.isNotBlank(agentUser.getAgentno())) {
|
if (agentUser != null && StringUtils.isNotBlank(agentUser.getAgentno())) {
|
||||||
User user = userRes.findById(agentUser.getAgentno());
|
User user = userRes.getReferenceById(agentUser.getAgentno());
|
||||||
if (user != null && !user.isSuperadmin()) {
|
if (user != null && !user.isSuperadmin()) {
|
||||||
// 用户不为空,并且不是超级管理员
|
// 用户不为空,并且不是超级管理员
|
||||||
// 指定坐席
|
// 指定坐席
|
||||||
|
@ -25,7 +25,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处置访客分配
|
* 处置访客分配
|
||||||
|
@ -57,7 +57,7 @@ public class ACDVisBindingMw implements Middleware<ACDComposeContext> {
|
|||||||
if (StringUtils.isNotBlank(ctx.getOrganid())) {
|
if (StringUtils.isNotBlank(ctx.getOrganid())) {
|
||||||
logger.info("[apply] bind skill {}", ctx.getOrganid());
|
logger.info("[apply] bind skill {}", ctx.getOrganid());
|
||||||
// 绑定技能组
|
// 绑定技能组
|
||||||
Organ organ = organRes.findOne(ctx.getOrganid());
|
Organ organ = organRes.getReferenceById(ctx.getOrganid());
|
||||||
if (organ != null) {
|
if (organ != null) {
|
||||||
ctx.getAgentUser().setSkill(organ.getId());
|
ctx.getAgentUser().setSkill(organ.getId());
|
||||||
ctx.setOrgan(organ);
|
ctx.setOrgan(organ);
|
||||||
@ -73,7 +73,7 @@ public class ACDVisBindingMw implements Middleware<ACDComposeContext> {
|
|||||||
// 绑定坐席有可能是因为前端展示了技能组和坐席
|
// 绑定坐席有可能是因为前端展示了技能组和坐席
|
||||||
// 也有可能是坐席发送了邀请,该访客接收邀请
|
// 也有可能是坐席发送了邀请,该访客接收邀请
|
||||||
ctx.getAgentUser().setAgentno(ctx.getAgentno());
|
ctx.getAgentUser().setAgentno(ctx.getAgentno());
|
||||||
User agent = userRes.findOne(ctx.getAgentno());
|
User agent = userRes.getReferenceById(ctx.getAgentno());
|
||||||
ctx.setAgent(agent);
|
ctx.setAgent(agent);
|
||||||
ctx.getAgentUser().setAgentname(agent.getUname());
|
ctx.getAgentUser().setAgentname(agent.getUname());
|
||||||
} else {
|
} else {
|
||||||
|
@ -69,7 +69,7 @@ public class AgentAuditSubscription {
|
|||||||
// 查找关联的会话监控信息
|
// 查找关联的会话监控信息
|
||||||
final AgentUserAudit agentUserAudit = cache.findOneAgentUserAuditById(
|
final AgentUserAudit agentUserAudit = cache.findOneAgentUserAuditById(
|
||||||
json.get("agentUserId").getAsString()).orElseGet(() -> {
|
json.get("agentUserId").getAsString()).orElseGet(() -> {
|
||||||
final AgentUser agentUser = agentUserRes.findOne(json.get("agentUserId").getAsString());
|
final AgentUser agentUser = agentUserRes.getReferenceById(json.get("agentUserId").getAsString());
|
||||||
if (agentUser != null) {
|
if (agentUser != null) {
|
||||||
return agentAuditProxy.updateAgentUserAudits(agentUser);
|
return agentAuditProxy.updateAgentUserAudits(agentUser);
|
||||||
} else {
|
} else {
|
||||||
|
@ -12,15 +12,18 @@
|
|||||||
package com.cskefu.cc.activemq;
|
package com.cskefu.cc.activemq;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import jakarta.annotation.PostConstruct;
|
||||||
import org.apache.activemq.ScheduledMessage;
|
import org.apache.activemq.ScheduledMessage;
|
||||||
import org.apache.activemq.command.ActiveMQTopic;
|
import org.apache.activemq.command.ActiveMQTopic;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.jms.core.JmsMessagingTemplate;
|
||||||
import org.springframework.jms.core.JmsTemplate;
|
import org.springframework.jms.core.JmsTemplate;
|
||||||
|
import org.springframework.messaging.Message;
|
||||||
|
import org.springframework.messaging.core.MessagePostProcessor;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@ -36,7 +39,6 @@ public class BrokerPublisher {
|
|||||||
logger.info("[ActiveMQ Publisher] setup successfully.");
|
logger.info("[ActiveMQ Publisher] setup successfully.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 时延消息
|
* 时延消息
|
||||||
*
|
*
|
||||||
|
@ -22,7 +22,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|||||||
import org.springframework.jms.annotation.JmsListener;
|
import org.springframework.jms.annotation.JmsListener;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IM OnlineUser
|
* IM OnlineUser
|
||||||
|
@ -27,7 +27,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|||||||
import org.springframework.jms.annotation.JmsListener;
|
import org.springframework.jms.annotation.JmsListener;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -62,8 +62,8 @@ import org.springframework.beans.FatalBeanException;
|
|||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
import org.springframework.util.ClassUtils;
|
import org.springframework.util.ClassUtils;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.beans.BeanInfo;
|
import java.beans.BeanInfo;
|
||||||
import java.beans.Introspector;
|
import java.beans.Introspector;
|
||||||
@ -891,7 +891,7 @@ public class MainUtils {
|
|||||||
Template templet = null;
|
Template templet = null;
|
||||||
if ((templet = MainContext.getCache().findOneSystemById(id)) == null) {
|
if ((templet = MainContext.getCache().findOneSystemById(id)) == null) {
|
||||||
TemplateRepository templateRes = MainContext.getContext().getBean(TemplateRepository.class);
|
TemplateRepository templateRes = MainContext.getContext().getBean(TemplateRepository.class);
|
||||||
templet = templateRes.findById(id);
|
templet = templateRes.getReferenceById(id);
|
||||||
MainContext.getCache().putSystemById(id, templet);
|
MainContext.getCache().putSystemById(id, templet);
|
||||||
}
|
}
|
||||||
return templet;
|
return templet;
|
||||||
@ -1030,7 +1030,7 @@ public class MainUtils {
|
|||||||
SystemConfig config = MainUtils.getSystemConfig();
|
SystemConfig config = MainUtils.getSystemConfig();
|
||||||
if (config != null && config.isEnablemail() && config.getEmailid() != null) {
|
if (config != null && config.isEnablemail() && config.getEmailid() != null) {
|
||||||
SystemMessage systemMessage = MainContext.getContext().getBean(
|
SystemMessage systemMessage = MainContext.getContext().getBean(
|
||||||
SystemMessageRepository.class).findById(config.getEmailid());
|
SystemMessageRepository.class).getReferenceById(config.getEmailid());
|
||||||
MailSender sender = new MailSender(
|
MailSender sender = new MailSender(
|
||||||
systemMessage.getSmtpserver(), systemMessage.getMailfrom(), systemMessage.getSmtpuser(),
|
systemMessage.getSmtpserver(), systemMessage.getMailfrom(), systemMessage.getSmtpuser(),
|
||||||
decryption(systemMessage.getSmtppassword()), systemMessage.getSeclev(), systemMessage.getSslport());
|
decryption(systemMessage.getSmtppassword()), systemMessage.getSeclev(), systemMessage.getSslport());
|
||||||
@ -1234,7 +1234,7 @@ public class MainUtils {
|
|||||||
SystemConfig config = MainUtils.getSystemConfig();
|
SystemConfig config = MainUtils.getSystemConfig();
|
||||||
if (config != null) {
|
if (config != null) {
|
||||||
SystemMessage systemMessage = MainContext.getContext().getBean(
|
SystemMessage systemMessage = MainContext.getContext().getBean(
|
||||||
SystemMessageRepository.class).findById(id);
|
SystemMessageRepository.class).getReferenceById(id);
|
||||||
if (systemMessage == null) {
|
if (systemMessage == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.cskefu.cc.basic;
|
package com.cskefu.cc.basic;
|
||||||
|
|
||||||
import javax.annotation.PreDestroy;
|
import jakarta.annotation.PreDestroy;
|
||||||
|
|
||||||
public class TerminateBean {
|
public class TerminateBean {
|
||||||
@PreDestroy
|
@PreDestroy
|
||||||
|
@ -27,7 +27,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|||||||
import org.springframework.data.redis.core.ValueOperations;
|
import org.springframework.data.redis.core.ValueOperations;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,7 +20,8 @@ import com.cskefu.cc.basic.MainContext;
|
|||||||
import com.cskefu.cc.model.JobDetail;
|
import com.cskefu.cc.model.JobDetail;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.util.logging.Logger;
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author jaddy0302 Rivulet Resource.java 2010-3-6
|
* @author jaddy0302 Rivulet Resource.java 2010-3-6
|
||||||
@ -28,7 +29,7 @@ import java.util.logging.Logger;
|
|||||||
*/
|
*/
|
||||||
public abstract class Resource {
|
public abstract class Resource {
|
||||||
|
|
||||||
public static Logger log = Logger.getLogger(Resource.class.getName()) ;
|
public static Logger log = LoggerFactory.getLogger(Resource.class.getName()) ;
|
||||||
|
|
||||||
public abstract void begin() throws Exception;
|
public abstract void begin() throws Exception;
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ import org.springframework.data.redis.core.*;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
@ -10,14 +10,13 @@
|
|||||||
*/
|
*/
|
||||||
package com.cskefu.cc.config;
|
package com.cskefu.cc.config;
|
||||||
|
|
||||||
|
import jakarta.jms.ConnectionFactory;
|
||||||
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.jms.annotation.EnableJms;
|
import org.springframework.jms.annotation.EnableJms;
|
||||||
import org.springframework.jms.config.DefaultJmsListenerContainerFactory;
|
import org.springframework.jms.config.DefaultJmsListenerContainerFactory;
|
||||||
import org.springframework.jms.config.JmsListenerContainerFactory;
|
import org.springframework.jms.config.JmsListenerContainerFactory;
|
||||||
|
|
||||||
import javax.jms.ConnectionFactory;
|
|
||||||
|
|
||||||
@EnableJms
|
@EnableJms
|
||||||
@Configuration
|
@Configuration
|
||||||
public class ActiveMQConfigure {
|
public class ActiveMQConfigure {
|
||||||
|
@ -24,9 +24,9 @@ import org.slf4j.LoggerFactory;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.security.web.util.matcher.RequestMatcher;
|
import org.springframework.security.web.util.matcher.RequestMatcher;
|
||||||
|
|
||||||
import javax.servlet.*;
|
import jakarta.servlet.*;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import static com.cskefu.cc.basic.Constants.AUTH_TOKEN_TYPE_BASIC;
|
import static com.cskefu.cc.basic.Constants.AUTH_TOKEN_TYPE_BASIC;
|
||||||
|
@ -22,13 +22,10 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
import org.springframework.web.servlet.config.annotation.*;
|
||||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
public class CSKeFuWebAppConfigurer
|
public class CSKeFuWebAppConfigurer implements WebMvcConfigurer {
|
||||||
extends WebMvcConfigurerAdapter {
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(CSKeFuWebAppConfigurer.class);
|
private final static Logger logger = LoggerFactory.getLogger(CSKeFuWebAppConfigurer.class);
|
||||||
private final static String ENABLE_LOG_REQUEST = SystemEnvHelper.parseFromApplicationProps("extras.log.request");
|
private final static String ENABLE_LOG_REQUEST = SystemEnvHelper.parseFromApplicationProps("extras.log.request");
|
||||||
|
|
||||||
@ -43,6 +40,17 @@ public class CSKeFuWebAppConfigurer
|
|||||||
registry.addMapping("/**").allowedOrigins("*");
|
registry.addMapping("/**").allowedOrigins("*");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
public void configurePathMatch(PathMatchConfigurer configurer) {
|
||||||
|
configurer.setUseSuffixPatternMatch(Boolean.TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||||
|
registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addInterceptors(InterceptorRegistry registry) {
|
public void addInterceptors(InterceptorRegistry registry) {
|
||||||
// 多个拦截器组成一个拦截器链
|
// 多个拦截器组成一个拦截器链
|
||||||
@ -60,6 +68,5 @@ public class CSKeFuWebAppConfigurer
|
|||||||
}
|
}
|
||||||
|
|
||||||
registry.addInterceptor(new ViewsInterceptorHandler()).addPathPatterns("/**");
|
registry.addInterceptor(new ViewsInterceptorHandler()).addPathPatterns("/**");
|
||||||
super.addInterceptors(registry);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -21,9 +21,9 @@ import com.cskefu.cc.model.User;
|
|||||||
import org.apache.catalina.connector.ClientAbortException;
|
import org.apache.catalina.connector.ClientAbortException;
|
||||||
import org.springframework.security.web.util.matcher.RequestMatcher;
|
import org.springframework.security.web.util.matcher.RequestMatcher;
|
||||||
|
|
||||||
import javax.servlet.*;
|
import jakarta.servlet.*;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class DelegateRequestMatchingFilter implements Filter {
|
public class DelegateRequestMatchingFilter implements Filter {
|
||||||
|
@ -1,102 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2017 优客服-多渠道客服系统
|
|
||||||
* Modifications copyright (C) 2018-2023 Chatopera Inc, <https://www.chatopera.com>
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
package com.cskefu.cc.config;
|
|
||||||
|
|
||||||
import com.alibaba.druid.support.http.StatViewServlet;
|
|
||||||
import com.alibaba.druid.support.http.WebStatFilter;
|
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
||||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
|
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
||||||
import org.springframework.boot.jdbc.DatabaseDriver;
|
|
||||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
|
||||||
import org.springframework.boot.web.servlet.ServletRegistrationBean;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
|
||||||
|
|
||||||
@Configuration
|
|
||||||
@ConditionalOnClass(com.alibaba.druid.pool.DruidDataSource.class)
|
|
||||||
@ConditionalOnProperty(name = "spring.datasource.type", havingValue = "com.alibaba.druid.pool.DruidDataSource", matchIfMissing = true)
|
|
||||||
public class DruidConfiguration {
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
protected <T> T createDataSource(DataSourceProperties properties,
|
|
||||||
Class<? extends DataSource> type) {
|
|
||||||
return (T) properties.initializeDataSourceBuilder().type(type).build();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration.Tomcat 仿写的你可以去了解
|
|
||||||
* @param properties 读入的配置
|
|
||||||
* @return DruidDataSource
|
|
||||||
*/
|
|
||||||
@Bean
|
|
||||||
@ConfigurationProperties("spring.datasource.druid")
|
|
||||||
public com.alibaba.druid.pool.DruidDataSource dataSource(DataSourceProperties properties) {
|
|
||||||
|
|
||||||
com.alibaba.druid.pool.DruidDataSource dataSource = createDataSource(properties, com.alibaba.druid.pool.DruidDataSource.class);
|
|
||||||
|
|
||||||
DatabaseDriver databaseDriver = DatabaseDriver.fromJdbcUrl(properties.determineUrl());
|
|
||||||
|
|
||||||
String validationQuery = databaseDriver.getValidationQuery();
|
|
||||||
if (validationQuery != null) {
|
|
||||||
dataSource.setTestOnBorrow(true);
|
|
||||||
dataSource.setValidationQuery(validationQuery);
|
|
||||||
}
|
|
||||||
|
|
||||||
return dataSource;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 注册一个StatViewServlet
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Bean
|
|
||||||
public ServletRegistrationBean DruidStatViewServle2(){
|
|
||||||
//org.springframework.boot.context.embedded.ServletRegistrationBean提供类的进行注册.
|
|
||||||
ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(new StatViewServlet(),"/druid/*");
|
|
||||||
//添加初始化参数:initParams
|
|
||||||
//白名单:
|
|
||||||
// servletRegistrationBean.addInitParameter("allow","127.0.0.1");
|
|
||||||
//IP黑名单 (存在共同时,deny优先于allow) : 如果满足deny的话提示:Sorry, you are not permitted to view this page.
|
|
||||||
// servletRegistrationBean.addInitParameter("deny","192.168.1.73");
|
|
||||||
//登录查看信息的账号密码.
|
|
||||||
servletRegistrationBean.addInitParameter("loginUsername","admin");
|
|
||||||
servletRegistrationBean.addInitParameter("loginPassword","123456");
|
|
||||||
//是否能够重置数据.
|
|
||||||
servletRegistrationBean.addInitParameter("resetEnable","false");
|
|
||||||
return servletRegistrationBean;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 注册一个:filterRegistrationBean
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public FilterRegistrationBean druidStatFilter2(){
|
|
||||||
FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(new WebStatFilter());
|
|
||||||
//添加过滤规则.
|
|
||||||
filterRegistrationBean.addUrlPatterns("/*");
|
|
||||||
//添加不需要忽略的格式信息.
|
|
||||||
filterRegistrationBean.addInitParameter("exclusions","*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid2/*");
|
|
||||||
return filterRegistrationBean;
|
|
||||||
}
|
|
||||||
}
|
|
@ -27,7 +27,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
|
|
||||||
import javax.annotation.PreDestroy;
|
import jakarta.annotation.PreDestroy;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -30,7 +30,6 @@ public class PugConfig {
|
|||||||
|
|
||||||
@Value("${spring.pug4j.template-loader-path}")
|
@Value("${spring.pug4j.template-loader-path}")
|
||||||
private String templatePath;
|
private String templatePath;
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public SpringTemplateLoader templateLoader() {
|
public SpringTemplateLoader templateLoader() {
|
||||||
SpringTemplateLoader templateLoader = new SpringTemplateLoader();
|
SpringTemplateLoader templateLoader = new SpringTemplateLoader();
|
||||||
|
@ -10,7 +10,7 @@ public class PugCskefuViewResolver extends PugViewResolver {
|
|||||||
AbstractUrlBasedView view = super.buildView(viewName);
|
AbstractUrlBasedView view = super.buildView(viewName);
|
||||||
if (viewName.startsWith("/resource/css")) {
|
if (viewName.startsWith("/resource/css")) {
|
||||||
PugView pugView = (PugView) view;
|
PugView pugView = (PugView) view;
|
||||||
pugView.setContentType("text/css ; charset=UTF-8");
|
pugView.setContentType("text/css; charset=UTF-8");
|
||||||
}
|
}
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
@ -15,10 +15,9 @@
|
|||||||
*/
|
*/
|
||||||
package com.cskefu.cc.config;
|
package com.cskefu.cc.config;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
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.data.redis.connection.jedis.JedisConnectionFactory;
|
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||||
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
|
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
|
||||||
|
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
@ -26,13 +25,10 @@ import java.util.concurrent.Executors;
|
|||||||
@Configuration
|
@Configuration
|
||||||
public class RedisConfigure {
|
public class RedisConfigure {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
JedisConnectionFactory jedisConnectionFactory;
|
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
RedisMessageListenerContainer redisContainer() {
|
RedisMessageListenerContainer redisContainer(RedisConnectionFactory redisConnectionFactory) {
|
||||||
final RedisMessageListenerContainer container = new RedisMessageListenerContainer();
|
final RedisMessageListenerContainer container = new RedisMessageListenerContainer();
|
||||||
container.setConnectionFactory(jedisConnectionFactory);
|
container.setConnectionFactory(redisConnectionFactory);
|
||||||
container.setTaskExecutor(Executors.newFixedThreadPool(100));
|
container.setTaskExecutor(Executors.newFixedThreadPool(100));
|
||||||
return container;
|
return container;
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ import org.springframework.web.bind.support.ConfigurableWebBindingInitializer;
|
|||||||
import org.springframework.web.multipart.support.StandardServletMultipartResolver;
|
import org.springframework.web.multipart.support.StandardServletMultipartResolver;
|
||||||
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter;
|
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
public class WebConfigBeans {
|
public class WebConfigBeans {
|
||||||
|
@ -16,11 +16,19 @@
|
|||||||
*/
|
*/
|
||||||
package com.cskefu.cc.config;
|
package com.cskefu.cc.config;
|
||||||
|
|
||||||
|
import jakarta.servlet.Filter;
|
||||||
|
import jakarta.servlet.FilterChain;
|
||||||
|
import jakarta.servlet.ServletException;
|
||||||
|
import jakarta.servlet.http.Cookie;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
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.security.config.Customizer;
|
||||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
import org.springframework.security.config.annotation.web.configurers.CsrfConfigurer;
|
||||||
|
import org.springframework.security.web.SecurityFilterChain;
|
||||||
import org.springframework.security.web.authentication.www.BasicAuthenticationFilter;
|
import org.springframework.security.web.authentication.www.BasicAuthenticationFilter;
|
||||||
import org.springframework.security.web.csrf.CsrfToken;
|
import org.springframework.security.web.csrf.CsrfToken;
|
||||||
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
|
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
|
||||||
@ -28,29 +36,24 @@ import org.springframework.security.web.util.matcher.RequestMatcher;
|
|||||||
import org.springframework.web.filter.OncePerRequestFilter;
|
import org.springframework.web.filter.OncePerRequestFilter;
|
||||||
import org.springframework.web.util.WebUtils;
|
import org.springframework.web.util.WebUtils;
|
||||||
|
|
||||||
import javax.servlet.Filter;
|
|
||||||
import javax.servlet.FilterChain;
|
|
||||||
import javax.servlet.ServletException;
|
|
||||||
import javax.servlet.http.Cookie;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableWebSecurity
|
@EnableWebSecurity
|
||||||
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
public class WebSecurityConfig {
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void configure(HttpSecurity http) throws Exception {
|
|
||||||
http.addFilterAfter(tokenInfoTokenFilterSecurityInterceptor() , BasicAuthenticationFilter.class)
|
|
||||||
.antMatcher("*/*").authorizeRequests()
|
|
||||||
.anyRequest().permitAll()
|
|
||||||
.and().addFilterAfter(csrfHeaderFilter(), BasicAuthenticationFilter.class)
|
|
||||||
.addFilterAfter(apiTokenFilterSecurityInterceptor(), BasicAuthenticationFilter.class);
|
|
||||||
}
|
|
||||||
@Bean
|
@Bean
|
||||||
public Filter tokenInfoTokenFilterSecurityInterceptor() throws Exception
|
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||||
{
|
return http.addFilterAfter(tokenInfoTokenFilterSecurityInterceptor(), BasicAuthenticationFilter.class)
|
||||||
|
.authorizeHttpRequests(authorize -> authorize.requestMatchers("/**").permitAll())
|
||||||
|
.csrf().disable().headers().frameOptions().sameOrigin()
|
||||||
|
// .addFilterAfter(csrfHeaderFilter(), BasicAuthenticationFilter.class) // TODO lecjy
|
||||||
|
.and().addFilterAfter(apiTokenFilterSecurityInterceptor(), BasicAuthenticationFilter.class)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Filter tokenInfoTokenFilterSecurityInterceptor() throws Exception {
|
||||||
RequestMatcher autconfig = new AntPathRequestMatcher("/autoconfig/**");
|
RequestMatcher autconfig = new AntPathRequestMatcher("/autoconfig/**");
|
||||||
RequestMatcher configprops = new AntPathRequestMatcher("/configprops/**");
|
RequestMatcher configprops = new AntPathRequestMatcher("/configprops/**");
|
||||||
RequestMatcher beans = new AntPathRequestMatcher("/beans/**");
|
RequestMatcher beans = new AntPathRequestMatcher("/beans/**");
|
||||||
@ -67,12 +70,11 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
// RequestMatcher health = new AntPathRequestMatcher("/health/**");
|
// RequestMatcher health = new AntPathRequestMatcher("/health/**");
|
||||||
// RequestMatcher metrics = new AntPathRequestMatcher("/metrics/**");
|
// RequestMatcher metrics = new AntPathRequestMatcher("/metrics/**");
|
||||||
// return new DelegateRequestMatchingFilter(autconfig , configprops , beans , dump , env , health , info , mappings , metrics , trace, druid);
|
// return new DelegateRequestMatchingFilter(autconfig , configprops , beans , dump , env , health , info , mappings , metrics , trace, druid);
|
||||||
return new DelegateRequestMatchingFilter(autconfig , configprops , beans , dump , env , mappings , trace, druid);
|
return new DelegateRequestMatchingFilter(autconfig, configprops, beans, dump, env, mappings, trace, druid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public Filter apiTokenFilterSecurityInterceptor() throws Exception
|
public Filter apiTokenFilterSecurityInterceptor() throws Exception {
|
||||||
{
|
|
||||||
return new ApiRequestMatchingFilter(new AntPathRequestMatcher("/api/**"));
|
return new ApiRequestMatchingFilter(new AntPathRequestMatcher("/api/**"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,11 +18,10 @@ package com.cskefu.cc.config;
|
|||||||
|
|
||||||
import org.apache.catalina.connector.Connector;
|
import org.apache.catalina.connector.Connector;
|
||||||
import org.apache.coyote.http11.Http11NioProtocol;
|
import org.apache.coyote.http11.Http11NioProtocol;
|
||||||
import org.apache.tomcat.util.http.LegacyCookieProcessor;
|
import org.apache.tomcat.util.http.Rfc6265CookieProcessor;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.boot.context.embedded.EmbeddedServletContainerFactory;
|
import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer;
|
||||||
import org.springframework.boot.context.embedded.tomcat.TomcatConnectorCustomizer;
|
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
|
||||||
import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
@ -42,12 +41,13 @@ public class WebServerContainerConfigure {
|
|||||||
private String path;
|
private String path;
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public EmbeddedServletContainerFactory createEmbeddedServletContainerFactory() throws IOException, NoSuchAlgorithmException {
|
public TomcatServletWebServerFactory createEmbeddedServletContainerFactory() throws IOException, NoSuchAlgorithmException {
|
||||||
TomcatEmbeddedServletContainerFactory tomcatFactory = new TomcatEmbeddedServletContainerFactory();
|
TomcatServletWebServerFactory tomcatFactory = new TomcatServletWebServerFactory();
|
||||||
tomcatFactory.addConnectorCustomizers(new CSKeFuTomcatConnectorCustomizer(maxthread, maxconnections));
|
tomcatFactory.addConnectorCustomizers(new CSKeFuTomcatConnectorCustomizer(maxthread, maxconnections));
|
||||||
// Enable cookie value with space
|
// Enable cookie value with space
|
||||||
// https://stackoverflow.com/questions/38687210/error-with-cookie-value-when-adding-a-new-spring-session
|
// https://stackoverflow.com/questions/38687210/error-with-cookie-value-when-adding-a-new-spring-session
|
||||||
tomcatFactory.addContextCustomizers(context -> context.setCookieProcessor(new LegacyCookieProcessor()));
|
// TODO lecjy
|
||||||
|
tomcatFactory.addContextCustomizers(context -> context.setCookieProcessor(new Rfc6265CookieProcessor()));
|
||||||
return tomcatFactory;
|
return tomcatFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,6 +60,7 @@ public class WebServerContainerConfigure {
|
|||||||
this.maxconnection = maxconnection;
|
this.maxconnection = maxconnection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void customize(Connector connector) {
|
public void customize(Connector connector) {
|
||||||
Http11NioProtocol protocol = (Http11NioProtocol) connector.getProtocolHandler();
|
Http11NioProtocol protocol = (Http11NioProtocol) connector.getProtocolHandler();
|
||||||
//设置最大连接数
|
//设置最大连接数
|
||||||
|
@ -25,10 +25,12 @@ import org.springframework.context.annotation.Primary;
|
|||||||
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
|
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||||
import org.springframework.session.data.redis.RedisFlushMode;
|
import org.springframework.session.FlushMode;
|
||||||
import org.springframework.session.data.redis.RedisOperationsSessionRepository;
|
import org.springframework.session.data.redis.RedisSessionRepository;
|
||||||
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
|
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
|
||||||
|
|
||||||
|
import java.time.Duration;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* maxInactiveIntervalInSeconds: 设置 Session 失效时间,
|
* maxInactiveIntervalInSeconds: 设置 Session 失效时间,
|
||||||
@ -39,14 +41,13 @@ import org.springframework.session.data.redis.config.annotation.web.http.EnableR
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableRedisHttpSession()
|
|
||||||
public class WebServerSessionConfigure {
|
public class WebServerSessionConfigure {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* spring在多长时间后强制使redis中的session失效,默认是1800.(单位/秒)
|
* spring在多长时间后强制使redis中的session失效,默认是1800.(单位/秒)
|
||||||
*/
|
*/
|
||||||
@Value("${server.session-timeout}")
|
@Value("${server.session-timeout}")
|
||||||
private int maxInactiveIntervalInSeconds;
|
private long maxInactiveIntervalInSeconds;
|
||||||
|
|
||||||
@Value("${spring.redis.host}")
|
@Value("${spring.redis.host}")
|
||||||
private String host;
|
private String host;
|
||||||
@ -68,16 +69,17 @@ public class WebServerSessionConfigure {
|
|||||||
|
|
||||||
@Primary
|
@Primary
|
||||||
@Bean
|
@Bean
|
||||||
public RedisOperationsSessionRepository sessionRepository(RedisTemplate<Object, Object> sessionRedisTemplate) {
|
// TODO lecjy
|
||||||
RedisOperationsSessionRepository sessionRepository = new RedisOperationsSessionRepository(sessionRedisTemplate);
|
public RedisSessionRepository sessionRepository(RedisTemplate<String, Object> sessionRedisTemplate) {
|
||||||
sessionRepository.setDefaultMaxInactiveInterval(maxInactiveIntervalInSeconds);
|
RedisSessionRepository sessionRepository = new RedisSessionRepository(sessionRedisTemplate);
|
||||||
sessionRepository.setRedisFlushMode(RedisFlushMode.IMMEDIATE);
|
sessionRepository.setDefaultMaxInactiveInterval(Duration.ofSeconds(maxInactiveIntervalInSeconds));
|
||||||
|
sessionRepository.setFlushMode(FlushMode.IMMEDIATE);
|
||||||
sessionRepository.setRedisKeyNamespace(RedisKey.CACHE_SESSIONS);
|
sessionRepository.setRedisKeyNamespace(RedisKey.CACHE_SESSIONS);
|
||||||
return sessionRepository;
|
return sessionRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public RedisTemplate<Object, Object> sessionRedisTemplate() {
|
public RedisTemplate<String, Object> sessionRedisTemplate() {
|
||||||
JedisConnectionFactory factory = new JedisConnectionFactory();
|
JedisConnectionFactory factory = new JedisConnectionFactory();
|
||||||
factory.setHostName(host);
|
factory.setHostName(host);
|
||||||
factory.setPort(port);
|
factory.setPort(port);
|
||||||
@ -87,7 +89,7 @@ public class WebServerSessionConfigure {
|
|||||||
}
|
}
|
||||||
factory.setTimeout(timeout);
|
factory.setTimeout(timeout);
|
||||||
factory.afterPropertiesSet();
|
factory.afterPropertiesSet();
|
||||||
RedisTemplate<Object, Object> template = new RedisTemplate<>();
|
RedisTemplate<String, Object> template = new RedisTemplate<>();
|
||||||
template.setKeySerializer(new StringRedisSerializer());
|
template.setKeySerializer(new StringRedisSerializer());
|
||||||
template.setHashKeySerializer(new StringRedisSerializer());
|
template.setHashKeySerializer(new StringRedisSerializer());
|
||||||
template.setConnectionFactory(factory);
|
template.setConnectionFactory(factory);
|
||||||
|
@ -22,6 +22,7 @@ import com.cskefu.cc.basic.MainContext;
|
|||||||
import com.cskefu.cc.basic.MainUtils;
|
import com.cskefu.cc.basic.MainUtils;
|
||||||
import com.cskefu.cc.cache.Cache;
|
import com.cskefu.cc.cache.Cache;
|
||||||
import com.cskefu.cc.model.Organ;
|
import com.cskefu.cc.model.Organ;
|
||||||
|
import com.cskefu.cc.model.PbxHost;
|
||||||
import com.cskefu.cc.model.User;
|
import com.cskefu.cc.model.User;
|
||||||
import com.cskefu.cc.persistence.repository.ExtensionRepository;
|
import com.cskefu.cc.persistence.repository.ExtensionRepository;
|
||||||
import com.cskefu.cc.persistence.repository.OrganRepository;
|
import com.cskefu.cc.persistence.repository.OrganRepository;
|
||||||
@ -37,8 +38,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -117,19 +118,18 @@ public class ApplicationController extends Handler {
|
|||||||
// 呼叫中心信息
|
// 呼叫中心信息
|
||||||
if (MainContext.hasModule(Constants.CSKEFU_MODULE_CALLCENTER) && logined.isCallcenter()) {
|
if (MainContext.hasModule(Constants.CSKEFU_MODULE_CALLCENTER) && logined.isCallcenter()) {
|
||||||
extensionRes.findByAgentno(logined.getId()).ifPresent(ext -> {
|
extensionRes.findByAgentno(logined.getId()).ifPresent(ext -> {
|
||||||
pbxHostRes.findById(ext.getHostid()).ifPresent(pbx -> {
|
PbxHost one = pbxHostRes.getReferenceById(ext.getHostid());
|
||||||
Map<String, Object> webrtcData = new HashMap<>();
|
Map<String, Object> webrtcData = new HashMap<>();
|
||||||
webrtcData.put("callCenterWebrtcIP", pbx.getWebrtcaddress());
|
webrtcData.put("callCenterWebrtcIP", one.getWebrtcaddress());
|
||||||
webrtcData.put("callCenterWebRtcPort", pbx.getWebrtcport());
|
webrtcData.put("callCenterWebRtcPort", one.getWebrtcport());
|
||||||
webrtcData.put("callCenterExtensionNum", ext.getExtension());
|
webrtcData.put("callCenterExtensionNum", ext.getExtension());
|
||||||
try {
|
try {
|
||||||
webrtcData.put("callCenterExtensionPassword", MainUtils.decryption(ext.getPassword()));
|
webrtcData.put("callCenterExtensionPassword", MainUtils.decryption(ext.getPassword()));
|
||||||
} catch (NoSuchAlgorithmException e) {
|
} catch (NoSuchAlgorithmException e) {
|
||||||
logger.error("[admin]", e);
|
logger.error("[admin]", e);
|
||||||
webrtcData.put("callCenterError", "Invalid data for callcenter agent.");
|
webrtcData.put("callCenterError", "Invalid data for callcenter agent.");
|
||||||
}
|
}
|
||||||
view.addObject("webrtc", webrtcData);
|
view.addObject("webrtc", webrtcData);
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,7 +145,7 @@ public class ApplicationController extends Handler {
|
|||||||
@ResponseBody
|
@ResponseBody
|
||||||
public String setOrgan(HttpServletRequest request, @Valid String organ) {
|
public String setOrgan(HttpServletRequest request, @Valid String organ) {
|
||||||
if (StringUtils.isNotBlank(organ)) {
|
if (StringUtils.isNotBlank(organ)) {
|
||||||
Organ currentOrgan = organRepository.findById(organ);
|
Organ currentOrgan = organRepository.getReferenceById(organ);
|
||||||
if (currentOrgan != null) {
|
if (currentOrgan != null) {
|
||||||
request.getSession(true).setAttribute(Constants.ORGAN_SESSION_NAME, currentOrgan);
|
request.getSession(true).setAttribute(Constants.ORGAN_SESSION_NAME, currentOrgan);
|
||||||
}
|
}
|
||||||
|
@ -39,8 +39,8 @@ import org.springframework.web.bind.annotation.SessionAttributes;
|
|||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.Cookie;
|
import jakarta.servlet.http.Cookie;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -46,10 +46,10 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.Cookie;
|
import jakarta.servlet.http.Cookie;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@ -140,7 +140,7 @@ public class LoginController extends Handler {
|
|||||||
try {
|
try {
|
||||||
flagid = MainUtils.decryption(cookie.getValue());
|
flagid = MainUtils.decryption(cookie.getValue());
|
||||||
if (StringUtils.isNotBlank(flagid)) {
|
if (StringUtils.isNotBlank(flagid)) {
|
||||||
User user = userRepository.findById(flagid);
|
User user = userRepository.getReferenceById(flagid);
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
view = this.processLogin(request, user, referer);
|
view = this.processLogin(request, user, referer);
|
||||||
}
|
}
|
||||||
@ -214,10 +214,11 @@ public class LoginController extends Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// add authorization code for rest api
|
// add authorization code for rest api
|
||||||
String token = String.format("%s %s", Constants.AUTH_TOKEN_TYPE_BEARER, MainUtils.getUUID());
|
String uuid = MainUtils.getUUID();
|
||||||
|
String token = String.format("%s %s", Constants.AUTH_TOKEN_TYPE_BEARER, uuid);
|
||||||
bearerTokenMgr.update(token, loginUser);
|
bearerTokenMgr.update(token, loginUser);
|
||||||
userRepository.save(loginUser); // 更新登录状态到数据库
|
userRepository.save(loginUser); // 更新登录状态到数据库
|
||||||
response.addCookie((new Cookie("authorization", token)));
|
response.addCookie((new Cookie("authorization", uuid)));
|
||||||
|
|
||||||
// 该登录用户是坐席,并且具有坐席对话的角色
|
// 该登录用户是坐席,并且具有坐席对话的角色
|
||||||
if ((loginUser.isAgent() &&
|
if ((loginUser.isAgent() &&
|
||||||
|
@ -36,7 +36,7 @@ import org.springframework.ui.ModelMap;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -34,8 +34,8 @@ import org.springframework.ui.ModelMap;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -143,10 +143,10 @@ public class OrganController extends Handler {
|
|||||||
public ModelAndView add(ModelMap map, HttpServletRequest request, @Valid String parent, @Valid String area) {
|
public ModelAndView add(ModelMap map, HttpServletRequest request, @Valid String parent, @Valid String area) {
|
||||||
map.addAttribute("areaList", areaRepository.findAll());
|
map.addAttribute("areaList", areaRepository.findAll());
|
||||||
if (!StringUtils.isBlank(parent)) {
|
if (!StringUtils.isBlank(parent)) {
|
||||||
map.addAttribute("organ", organRepository.findById(parent));
|
map.addAttribute("organ", organRepository.getReferenceById(parent));
|
||||||
}
|
}
|
||||||
if (!StringUtils.isBlank(area)) {
|
if (!StringUtils.isBlank(area)) {
|
||||||
map.addAttribute("area", areaRepository.findById(area));
|
map.addAttribute("area", areaRepository.getReferenceById(area));
|
||||||
}
|
}
|
||||||
|
|
||||||
map.addAttribute("organList", getOwnOragans(request));
|
map.addAttribute("organList", getOwnOragans(request));
|
||||||
@ -184,7 +184,7 @@ public class OrganController extends Handler {
|
|||||||
public ModelAndView seluser(ModelMap map, HttpServletRequest request, @Valid String organ) {
|
public ModelAndView seluser(ModelMap map, HttpServletRequest request, @Valid String organ) {
|
||||||
Map<String, Organ> organs = organProxy.findAllOrganByParent(super.getOrgan(request));
|
Map<String, Organ> organs = organProxy.findAllOrganByParent(super.getOrgan(request));
|
||||||
map.addAttribute("userList", userProxy.findUserInOrgans(organs.keySet()));
|
map.addAttribute("userList", userProxy.findUserInOrgans(organs.keySet()));
|
||||||
Organ organData = organRepository.findById(organ);
|
Organ organData = organRepository.getReferenceById(organ);
|
||||||
map.addAttribute("userOrganList", userProxy
|
map.addAttribute("userOrganList", userProxy
|
||||||
.findByOrganAndDatastatus(organ, false));
|
.findByOrganAndDatastatus(organ, false));
|
||||||
map.addAttribute("organ", organData);
|
map.addAttribute("organ", organData);
|
||||||
@ -210,8 +210,8 @@ public class OrganController extends Handler {
|
|||||||
|
|
||||||
if (users != null && users.length > 0) {
|
if (users != null && users.length > 0) {
|
||||||
List<String> chosen = new ArrayList<>(Arrays.asList(users));
|
List<String> chosen = new ArrayList<>(Arrays.asList(users));
|
||||||
Organ organData = organRepository.findById(organ);
|
Organ organData = organRepository.getReferenceById(organ);
|
||||||
List<User> organUserList = userRepository.findAll(chosen);
|
List<User> organUserList = userRepository.findAllById(chosen);
|
||||||
for (final User user : organUserList) {
|
for (final User user : organUserList) {
|
||||||
OrganUser ou = organUserRes.findByUseridAndOrgan(user.getId(), organ);
|
OrganUser ou = organUserRes.findByUseridAndOrgan(user.getId(), organ);
|
||||||
|
|
||||||
@ -254,7 +254,7 @@ public class OrganController extends Handler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
userRepository.save(organUserList);
|
userRepository.saveAll(organUserList);
|
||||||
}
|
}
|
||||||
|
|
||||||
return request(super.createView("redirect:/admin/organ/index.html?organ=" + organ));
|
return request(super.createView("redirect:/admin/organ/index.html?organ=" + organ));
|
||||||
@ -285,7 +285,7 @@ public class OrganController extends Handler {
|
|||||||
ModelAndView view = request(super.createView("/admin/organ/edit"));
|
ModelAndView view = request(super.createView("/admin/organ/edit"));
|
||||||
Organ currentOrgan = super.getOrgan(request);
|
Organ currentOrgan = super.getOrgan(request);
|
||||||
map.addAttribute("areaList", areaRepository.findAll());
|
map.addAttribute("areaList", areaRepository.findAll());
|
||||||
view.addObject("organData", organRepository.findById(id));
|
view.addObject("organData", organRepository.getReferenceById(id));
|
||||||
view.addObject("isRootOrgan", id.equals(currentOrgan.getId()));
|
view.addObject("isRootOrgan", id.equals(currentOrgan.getId()));
|
||||||
map.addAttribute("organList", getOwnOragans(request));
|
map.addAttribute("organList", getOwnOragans(request));
|
||||||
return view;
|
return view;
|
||||||
@ -310,14 +310,14 @@ public class OrganController extends Handler {
|
|||||||
}
|
}
|
||||||
map.addAttribute("cacheList", Dict.getInstance().getDic(Constants.CSKEFU_SYSTEM_AREA_DIC));
|
map.addAttribute("cacheList", Dict.getInstance().getDic(Constants.CSKEFU_SYSTEM_AREA_DIC));
|
||||||
|
|
||||||
map.addAttribute("organData", organRepository.findById(id));
|
map.addAttribute("organData", organRepository.getReferenceById(id));
|
||||||
return request(super.createView("/admin/organ/area"));
|
return request(super.createView("/admin/organ/area"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/area/update")
|
@RequestMapping("/area/update")
|
||||||
@Menu(type = "admin", subtype = "organ")
|
@Menu(type = "admin", subtype = "organ")
|
||||||
public ModelAndView areaupdate(HttpServletRequest request, @Valid Organ organ) {
|
public ModelAndView areaupdate(HttpServletRequest request, @Valid Organ organ) {
|
||||||
Organ tempOrgan = organRepository.findById(organ.getId());
|
Organ tempOrgan = organRepository.getReferenceById(organ.getId());
|
||||||
String msg = "admin_organ_update_success";
|
String msg = "admin_organ_update_success";
|
||||||
if (tempOrgan != null) {
|
if (tempOrgan != null) {
|
||||||
tempOrgan.setArea(organ.getArea());
|
tempOrgan.setArea(organ.getArea());
|
||||||
@ -334,7 +334,7 @@ public class OrganController extends Handler {
|
|||||||
public ModelAndView delete(HttpServletRequest request, @Valid Organ organ) {
|
public ModelAndView delete(HttpServletRequest request, @Valid Organ organ) {
|
||||||
String msg = "admin_organ_delete";
|
String msg = "admin_organ_delete";
|
||||||
|
|
||||||
Organ organSelf = organRepository.findById(organ.getId());
|
Organ organSelf = organRepository.getReferenceById(organ.getId());
|
||||||
List<Organ> organParentAre = organRepository.findByParent(organSelf.getId());
|
List<Organ> organParentAre = organRepository.findByParent(organSelf.getId());
|
||||||
if (organ != null && organParentAre != null && organParentAre.size() > 0) {
|
if (organ != null && organParentAre != null && organParentAre.size() > 0) {
|
||||||
msg = "admin_oran_not_delete";
|
msg = "admin_oran_not_delete";
|
||||||
@ -353,9 +353,9 @@ public class OrganController extends Handler {
|
|||||||
@RequestMapping("/auth/save")
|
@RequestMapping("/auth/save")
|
||||||
@Menu(type = "admin", subtype = "role")
|
@Menu(type = "admin", subtype = "role")
|
||||||
public ModelAndView authsave(HttpServletRequest request, @Valid String id, @Valid String menus) {
|
public ModelAndView authsave(HttpServletRequest request, @Valid String id, @Valid String menus) {
|
||||||
Organ organData = organRepository.findById(id);
|
Organ organData = organRepository.getReferenceById(id);
|
||||||
List<OrganRole> organRoleList = organRoleRes.findByOrgan(organData);
|
List<OrganRole> organRoleList = organRoleRes.findByOrgan(organData);
|
||||||
organRoleRes.delete(organRoleList);
|
organRoleRes.deleteAll(organRoleList);
|
||||||
if (!StringUtils.isBlank(menus)) {
|
if (!StringUtils.isBlank(menus)) {
|
||||||
String[] menusarray = menus.split(",");
|
String[] menusarray = menus.split(",");
|
||||||
for (String menu : menusarray) {
|
for (String menu : menusarray) {
|
||||||
|
@ -38,8 +38,8 @@ import org.springframework.ui.ModelMap;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -96,10 +96,10 @@ public class RoleController extends Handler {
|
|||||||
|
|
||||||
// Page<UserRole> userRoleList =
|
// Page<UserRole> userRoleList =
|
||||||
// userRoleRes.findByOrganAndRole(currentOrgan.getId(), roleData,
|
// userRoleRes.findByOrganAndRole(currentOrgan.getId(), roleData,
|
||||||
// new PageRequest(super.getP(request), super.getPs(request)));
|
// PageRequest.of(super.getP(request), super.getPs(request)));
|
||||||
|
|
||||||
Page<UserRole> userRoleList = userRoleRes.findByOrganInAndRole(organs.keySet(), roleData,
|
Page<UserRole> userRoleList = userRoleRes.findByOrganInAndRole(organs.keySet(), roleData,
|
||||||
new PageRequest(super.getP(request), super.getPs(request)));
|
PageRequest.of(super.getP(request), super.getPs(request)));
|
||||||
|
|
||||||
if (userRoleList.getContent().size() > 0) {
|
if (userRoleList.getContent().size() > 0) {
|
||||||
for (UserRole ur : userRoleList.getContent()) {
|
for (UserRole ur : userRoleList.getContent()) {
|
||||||
@ -148,7 +148,7 @@ public class RoleController extends Handler {
|
|||||||
public ModelAndView seluser(ModelMap map, HttpServletRequest request, @Valid String role) {
|
public ModelAndView seluser(ModelMap map, HttpServletRequest request, @Valid String role) {
|
||||||
Organ currentOrgan = super.getOrgan(request);
|
Organ currentOrgan = super.getOrgan(request);
|
||||||
map.addAttribute("userList", userProxy.findUserInOrgans(Arrays.asList(currentOrgan.getId())));
|
map.addAttribute("userList", userProxy.findUserInOrgans(Arrays.asList(currentOrgan.getId())));
|
||||||
Role roleData = roleRepository.findById(role);
|
Role roleData = roleRepository.getReferenceById(role);
|
||||||
map.addAttribute("userRoleList", userRoleRes.findByRole(roleData));
|
map.addAttribute("userRoleList", userRoleRes.findByRole(roleData));
|
||||||
map.addAttribute("role", roleData);
|
map.addAttribute("role", roleData);
|
||||||
return request(super.createView("/admin/role/seluser"));
|
return request(super.createView("/admin/role/seluser"));
|
||||||
@ -158,7 +158,7 @@ public class RoleController extends Handler {
|
|||||||
@Menu(type = "admin", subtype = "saveuser", admin = true)
|
@Menu(type = "admin", subtype = "saveuser", admin = true)
|
||||||
public ModelAndView saveuser(HttpServletRequest request, @Valid String[] users, @Valid String role) {
|
public ModelAndView saveuser(HttpServletRequest request, @Valid String[] users, @Valid String role) {
|
||||||
Organ currentOrgan = super.getOrgan(request);
|
Organ currentOrgan = super.getOrgan(request);
|
||||||
Role roleData = roleRepository.findById(role);
|
Role roleData = roleRepository.getReferenceById(role);
|
||||||
List<UserRole> userRoleList = userRoleRes.findByRole(roleData);
|
List<UserRole> userRoleList = userRoleRes.findByRole(roleData);
|
||||||
if (users != null && users.length > 0) {
|
if (users != null && users.length > 0) {
|
||||||
for (String user : users) {
|
for (String user : users) {
|
||||||
@ -186,7 +186,7 @@ public class RoleController extends Handler {
|
|||||||
@Menu(type = "admin", subtype = "role")
|
@Menu(type = "admin", subtype = "role")
|
||||||
public ModelAndView userroledelete(HttpServletRequest request, @Valid String id, @Valid String role) {
|
public ModelAndView userroledelete(HttpServletRequest request, @Valid String id, @Valid String role) {
|
||||||
if (role != null) {
|
if (role != null) {
|
||||||
userRoleRes.delete(id);
|
userRoleRes.deleteById(id);
|
||||||
}
|
}
|
||||||
return request(super.createView("redirect:/admin/role/index.html?role=" + role));
|
return request(super.createView("redirect:/admin/role/index.html?role=" + role));
|
||||||
}
|
}
|
||||||
@ -195,7 +195,7 @@ public class RoleController extends Handler {
|
|||||||
@Menu(type = "admin", subtype = "role")
|
@Menu(type = "admin", subtype = "role")
|
||||||
public ModelAndView edit(ModelMap map, HttpServletRequest request, @Valid String id) {
|
public ModelAndView edit(ModelMap map, HttpServletRequest request, @Valid String id) {
|
||||||
ModelAndView view = request(super.createView("/admin/role/edit"));
|
ModelAndView view = request(super.createView("/admin/role/edit"));
|
||||||
view.addObject("roleData", roleRepository.findById(id));
|
view.addObject("roleData", roleRepository.getReferenceById(id));
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,7 +206,7 @@ public class RoleController extends Handler {
|
|||||||
String msg = "";
|
String msg = "";
|
||||||
if (tempRoleExist == null) {
|
if (tempRoleExist == null) {
|
||||||
msg = "admin_role_update_success";
|
msg = "admin_role_update_success";
|
||||||
Role tempRole = roleRepository.findById(role.getId());
|
Role tempRole = roleRepository.getReferenceById(role.getId());
|
||||||
tempRole.setName(role.getName());
|
tempRole.setName(role.getName());
|
||||||
tempRole.setUpdatetime(new Date());
|
tempRole.setUpdatetime(new Date());
|
||||||
roleRepository.save(tempRole);
|
roleRepository.save(tempRole);
|
||||||
@ -221,7 +221,7 @@ public class RoleController extends Handler {
|
|||||||
public ModelAndView delete(HttpServletRequest request, @Valid Role role) {
|
public ModelAndView delete(HttpServletRequest request, @Valid Role role) {
|
||||||
String msg = "admin_role_delete";
|
String msg = "admin_role_delete";
|
||||||
if (role != null) {
|
if (role != null) {
|
||||||
userRoleRes.delete(userRoleRes.findByRole(role));
|
userRoleRes.deleteAll(userRoleRes.findByRole(role));
|
||||||
roleRepository.delete(role);
|
roleRepository.delete(role);
|
||||||
} else {
|
} else {
|
||||||
msg = "admin_role_not_exist";
|
msg = "admin_role_not_exist";
|
||||||
@ -238,7 +238,7 @@ public class RoleController extends Handler {
|
|||||||
map.addAttribute("resourceList", sysDicRes.findByDicid(sysDic.getId()));
|
map.addAttribute("resourceList", sysDicRes.findByDicid(sysDic.getId()));
|
||||||
}
|
}
|
||||||
map.addAttribute("sysDic", sysDic);
|
map.addAttribute("sysDic", sysDic);
|
||||||
Role role = roleRepository.findById(id);
|
Role role = roleRepository.getReferenceById(id);
|
||||||
map.addAttribute("role", role);
|
map.addAttribute("role", role);
|
||||||
map.addAttribute("roleAuthList", roleAuthRes.findByRoleid(role.getId()));
|
map.addAttribute("roleAuthList", roleAuthRes.findByRoleid(role.getId()));
|
||||||
return request(super.createView("/admin/role/auth"));
|
return request(super.createView("/admin/role/auth"));
|
||||||
@ -250,7 +250,7 @@ public class RoleController extends Handler {
|
|||||||
// logger.info("[authsave] id {}, menus {}", id, menus);
|
// logger.info("[authsave] id {}, menus {}", id, menus);
|
||||||
|
|
||||||
List<RoleAuth> roleAuthList = roleAuthRes.findByRoleid(id);
|
List<RoleAuth> roleAuthList = roleAuthRes.findByRoleid(id);
|
||||||
roleAuthRes.delete(roleAuthList);
|
roleAuthRes.deleteAll(roleAuthList);
|
||||||
if (StringUtils.isNotBlank(menus)) {
|
if (StringUtils.isNotBlank(menus)) {
|
||||||
String[] menuarray = menus.split(",");
|
String[] menuarray = menus.split(",");
|
||||||
|
|
||||||
|
@ -21,17 +21,13 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
import com.cskefu.cc.basic.Constants;
|
import com.cskefu.cc.basic.Constants;
|
||||||
import com.cskefu.cc.basic.MainContext;
|
import com.cskefu.cc.basic.MainContext;
|
||||||
import com.cskefu.cc.controller.Handler;
|
import com.cskefu.cc.controller.Handler;
|
||||||
import com.cskefu.cc.model.Organ;
|
import com.cskefu.cc.model.*;
|
||||||
import com.cskefu.cc.model.OrganUser;
|
|
||||||
import com.cskefu.cc.model.Role;
|
|
||||||
import com.cskefu.cc.model.User;
|
|
||||||
import com.cskefu.cc.model.UserRole;
|
|
||||||
import com.cskefu.cc.persistence.repository.ExtensionRepository;
|
import com.cskefu.cc.persistence.repository.ExtensionRepository;
|
||||||
import com.cskefu.cc.persistence.repository.OrganUserRepository;
|
import com.cskefu.cc.persistence.repository.OrganUserRepository;
|
||||||
import com.cskefu.cc.persistence.repository.PbxHostRepository;
|
import com.cskefu.cc.persistence.repository.PbxHostRepository;
|
||||||
@ -103,7 +99,7 @@ public class UsersController extends Handler {
|
|||||||
organs.add(currentOrgan.getId());
|
organs.add(currentOrgan.getId());
|
||||||
|
|
||||||
map.addAttribute("currentOrgan", currentOrgan);
|
map.addAttribute("currentOrgan", currentOrgan);
|
||||||
map.addAttribute("userList", userProxy.findUserInOrgans(organs, new PageRequest(
|
map.addAttribute("userList", userProxy.findUserInOrgans(organs, PageRequest.of(
|
||||||
super.getP(request),
|
super.getP(request),
|
||||||
super.getPs(request),
|
super.getPs(request),
|
||||||
Sort.Direction.ASC,
|
Sort.Direction.ASC,
|
||||||
@ -130,17 +126,16 @@ public class UsersController extends Handler {
|
|||||||
@Menu(type = "admin", subtype = "user")
|
@Menu(type = "admin", subtype = "user")
|
||||||
public ModelAndView edit(ModelMap map, HttpServletRequest request, @Valid String id) {
|
public ModelAndView edit(ModelMap map, HttpServletRequest request, @Valid String id) {
|
||||||
ModelAndView view = request(super.createView("/admin/user/edit"));
|
ModelAndView view = request(super.createView("/admin/user/edit"));
|
||||||
User user = userRepository.findById(id);
|
User user = userRepository.getReferenceById(id);
|
||||||
if (user != null && MainContext.hasModule(Constants.CSKEFU_MODULE_CALLCENTER)) {
|
if (user != null && MainContext.hasModule(Constants.CSKEFU_MODULE_CALLCENTER)) {
|
||||||
// 加载呼叫中心信息
|
// 加载呼叫中心信息
|
||||||
extensionRes.findByAgentno(user.getId()).ifPresent(p -> {
|
extensionRes.findByAgentno(user.getId()).ifPresent(p -> {
|
||||||
user.setExtensionId(p.getId());
|
user.setExtensionId(p.getId());
|
||||||
user.setExtension(p);
|
user.setExtension(p);
|
||||||
|
|
||||||
pbxHostRes.findById(p.getHostid()).ifPresent(b -> {
|
PbxHost one = pbxHostRes.getReferenceById(p.getHostid());
|
||||||
user.setPbxhostId(b.getId());
|
user.setPbxhostId(one.getId());
|
||||||
user.setPbxHost(b);
|
user.setPbxHost(one);
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
view.addObject("userData", user);
|
view.addObject("userData", user);
|
||||||
@ -152,16 +147,16 @@ public class UsersController extends Handler {
|
|||||||
public ModelAndView delete(HttpServletRequest request, @Valid User user) {
|
public ModelAndView delete(HttpServletRequest request, @Valid User user) {
|
||||||
String msg = "admin_user_delete";
|
String msg = "admin_user_delete";
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
User dbUser = userRepository.getOne(user.getId());
|
User dbUser = userRepository.getReferenceById(user.getId());
|
||||||
if (dbUser.isSuperadmin()) {
|
if (dbUser.isSuperadmin()) {
|
||||||
msg = "admin_user_abandoned";
|
msg = "admin_user_abandoned";
|
||||||
} else {
|
} else {
|
||||||
// 删除用户的时候,同时删除用户对应的权限数据
|
// 删除用户的时候,同时删除用户对应的权限数据
|
||||||
List<UserRole> userRole = userRoleRes.findByUser(user);
|
List<UserRole> userRole = userRoleRes.findByUser(user);
|
||||||
userRoleRes.delete(userRole);
|
userRoleRes.deleteAll(userRole);
|
||||||
// 删除用户对应的组织机构关系
|
// 删除用户对应的组织机构关系
|
||||||
List<OrganUser> organUsers = organUserRes.findByUserid(user.getId());
|
List<OrganUser> organUsers = organUserRes.findByUserid(user.getId());
|
||||||
organUserRes.delete(organUsers);
|
organUserRes.deleteAll(organUsers);
|
||||||
|
|
||||||
userRepository.delete(dbUser);
|
userRepository.delete(dbUser);
|
||||||
|
|
||||||
|
@ -37,8 +37,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -74,7 +74,7 @@ public class ChannelController extends Handler {
|
|||||||
@Menu(type = "admin", subtype = "im", admin = true)
|
@Menu(type = "admin", subtype = "im", admin = true)
|
||||||
public ModelAndView index(ModelMap map, HttpServletRequest request, @Valid String execute, @RequestParam(name = "status", required = false) String status) {
|
public ModelAndView index(ModelMap map, HttpServletRequest request, @Valid String execute, @RequestParam(name = "status", required = false) String status) {
|
||||||
Map<String, Organ> organs = organProxy.findAllOrganByParent(super.getOrgan(request));
|
Map<String, Organ> organs = organProxy.findAllOrganByParent(super.getOrgan(request));
|
||||||
map.addAttribute("snsAccountList", snsAccountRes.findByTypeAndOrgan(MainContext.ChannelType.WEBIM.toString(), organs.keySet(), new PageRequest(super.getP(request), super.getPs(request))));
|
map.addAttribute("snsAccountList", snsAccountRes.findByTypeAndOrgan(MainContext.ChannelType.WEBIM.toString(), organs.keySet(), PageRequest.of(super.getP(request), super.getPs(request))));
|
||||||
|
|
||||||
map.addAttribute("status", status);
|
map.addAttribute("status", status);
|
||||||
List<Secret> secretConfig = secRes.findAll();
|
List<Secret> secretConfig = secRes.findAll();
|
||||||
@ -140,7 +140,7 @@ public class ChannelController extends Handler {
|
|||||||
public ModelAndView delete(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String confirm) {
|
public ModelAndView delete(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String confirm) {
|
||||||
boolean execute;
|
boolean execute;
|
||||||
if (execute = MainUtils.secConfirm(secRes, confirm)) {
|
if (execute = MainUtils.secConfirm(secRes, confirm)) {
|
||||||
Channel channel = snsAccountRes.findById(id);
|
Channel channel = snsAccountRes.getReferenceById(id);
|
||||||
if (snsAccountRes != null) {
|
if (snsAccountRes != null) {
|
||||||
// 删除网站渠道记录
|
// 删除网站渠道记录
|
||||||
snsAccountRes.delete(channel);
|
snsAccountRes.delete(channel);
|
||||||
@ -162,8 +162,8 @@ public class ChannelController extends Handler {
|
|||||||
@RequestMapping("/edit")
|
@RequestMapping("/edit")
|
||||||
@Menu(type = "admin", subtype = "send", admin = true)
|
@Menu(type = "admin", subtype = "send", admin = true)
|
||||||
public ModelAndView edit(ModelMap map, HttpServletRequest request, @Valid String id) {
|
public ModelAndView edit(ModelMap map, HttpServletRequest request, @Valid String id) {
|
||||||
Channel channel = snsAccountRes.findById(id);
|
Channel channel = snsAccountRes.getReferenceById(id);
|
||||||
Organ organ = organRes.findOne(channel.getOrgan());
|
Organ organ = organRes.getReferenceById(channel.getOrgan());
|
||||||
map.put("organ", organ);
|
map.put("organ", organ);
|
||||||
map.addAttribute("channel", channel);
|
map.addAttribute("channel", channel);
|
||||||
return request(super.createView("/admin/channel/im/edit"));
|
return request(super.createView("/admin/channel/im/edit"));
|
||||||
@ -172,7 +172,7 @@ public class ChannelController extends Handler {
|
|||||||
@RequestMapping("/update")
|
@RequestMapping("/update")
|
||||||
@Menu(type = "admin", subtype = "send", admin = true)
|
@Menu(type = "admin", subtype = "send", admin = true)
|
||||||
public ModelAndView update(HttpServletRequest request, @Valid Channel channel) throws NoSuchAlgorithmException {
|
public ModelAndView update(HttpServletRequest request, @Valid Channel channel) throws NoSuchAlgorithmException {
|
||||||
Channel oldChannel = snsAccountRes.findById(channel.getId());
|
Channel oldChannel = snsAccountRes.getReferenceById(channel.getId());
|
||||||
if (oldChannel != null) {
|
if (oldChannel != null) {
|
||||||
oldChannel.setName(channel.getName());
|
oldChannel.setName(channel.getName());
|
||||||
oldChannel.setBaseURL(channel.getBaseURL());
|
oldChannel.setBaseURL(channel.getBaseURL());
|
||||||
|
@ -37,8 +37,8 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -44,8 +44,8 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -34,8 +34,8 @@ import org.springframework.ui.ModelMap;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -53,7 +53,7 @@ public class SystemMessageController extends Handler {
|
|||||||
@RequestMapping("/email/index")
|
@RequestMapping("/email/index")
|
||||||
@Menu(type = "setting", subtype = "email")
|
@Menu(type = "setting", subtype = "email")
|
||||||
public ModelAndView index(ModelMap map, HttpServletRequest request) throws IOException {
|
public ModelAndView index(ModelMap map, HttpServletRequest request) throws IOException {
|
||||||
Page<SystemMessage> emails = systemMessageRepository.findByMsgtype("email", new PageRequest(super.getP(request), super.getPs(request)));
|
Page<SystemMessage> emails = systemMessageRepository.findByMsgtype("email", PageRequest.of(super.getP(request), super.getPs(request)));
|
||||||
List<Organ> organs = organRes.findAll();
|
List<Organ> organs = organRes.findAll();
|
||||||
|
|
||||||
emails.getContent().stream().forEach(p -> {
|
emails.getContent().stream().forEach(p -> {
|
||||||
@ -86,14 +86,14 @@ public class SystemMessageController extends Handler {
|
|||||||
@Menu(type = "admin", subtype = "email")
|
@Menu(type = "admin", subtype = "email")
|
||||||
public ModelAndView edit(ModelMap map, HttpServletRequest request, @Valid String id) {
|
public ModelAndView edit(ModelMap map, HttpServletRequest request, @Valid String id) {
|
||||||
map.put("organList", organRes.findAll());
|
map.put("organList", organRes.findAll());
|
||||||
map.addAttribute("email", systemMessageRepository.findById(id));
|
map.addAttribute("email", systemMessageRepository.getReferenceById(id));
|
||||||
return request(super.createView("/admin/email/edit"));
|
return request(super.createView("/admin/email/edit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/email/update")
|
@RequestMapping("/email/update")
|
||||||
@Menu(type = "admin", subtype = "user", admin = true)
|
@Menu(type = "admin", subtype = "user", admin = true)
|
||||||
public ModelAndView update(HttpServletRequest request, @Valid SystemMessage email) throws NoSuchAlgorithmException {
|
public ModelAndView update(HttpServletRequest request, @Valid SystemMessage email) throws NoSuchAlgorithmException {
|
||||||
SystemMessage temp = systemMessageRepository.findById(email.getId());
|
SystemMessage temp = systemMessageRepository.getReferenceById(email.getId());
|
||||||
if (email != null) {
|
if (email != null) {
|
||||||
email.setCreatetime(temp.getCreatetime());
|
email.setCreatetime(temp.getCreatetime());
|
||||||
email.setMsgtype(MainContext.SystemMessageType.EMAIL.toString());
|
email.setMsgtype(MainContext.SystemMessageType.EMAIL.toString());
|
||||||
@ -110,7 +110,7 @@ public class SystemMessageController extends Handler {
|
|||||||
@RequestMapping("/email/delete")
|
@RequestMapping("/email/delete")
|
||||||
@Menu(type = "admin", subtype = "user")
|
@Menu(type = "admin", subtype = "user")
|
||||||
public ModelAndView delete(HttpServletRequest request, @Valid SystemMessage email) {
|
public ModelAndView delete(HttpServletRequest request, @Valid SystemMessage email) {
|
||||||
SystemMessage temp = systemMessageRepository.findById(email.getId());
|
SystemMessage temp = systemMessageRepository.getReferenceById(email.getId());
|
||||||
if (email != null) {
|
if (email != null) {
|
||||||
systemMessageRepository.delete(temp);
|
systemMessageRepository.delete(temp);
|
||||||
}
|
}
|
||||||
@ -121,7 +121,7 @@ public class SystemMessageController extends Handler {
|
|||||||
@RequestMapping("/sms/index")
|
@RequestMapping("/sms/index")
|
||||||
@Menu(type = "setting", subtype = "sms")
|
@Menu(type = "setting", subtype = "sms")
|
||||||
public ModelAndView smsindex(ModelMap map, HttpServletRequest request) throws IOException {
|
public ModelAndView smsindex(ModelMap map, HttpServletRequest request) throws IOException {
|
||||||
map.addAttribute("smsList", systemMessageRepository.findByMsgtype("sms", new PageRequest(super.getP(request), super.getPs(request))));
|
map.addAttribute("smsList", systemMessageRepository.findByMsgtype("sms", PageRequest.of(super.getP(request), super.getPs(request))));
|
||||||
return request(super.createView("/admin/sms/index"));
|
return request(super.createView("/admin/sms/index"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,14 +147,14 @@ public class SystemMessageController extends Handler {
|
|||||||
@Menu(type = "admin", subtype = "sms")
|
@Menu(type = "admin", subtype = "sms")
|
||||||
public ModelAndView smsedit(ModelMap map, HttpServletRequest request, @Valid String id) {
|
public ModelAndView smsedit(ModelMap map, HttpServletRequest request, @Valid String id) {
|
||||||
map.addAttribute("smsType", Dict.getInstance().getDic("com.dic.sms.type"));
|
map.addAttribute("smsType", Dict.getInstance().getDic("com.dic.sms.type"));
|
||||||
map.addAttribute("sms", systemMessageRepository.findById(id));
|
map.addAttribute("sms", systemMessageRepository.getReferenceById(id));
|
||||||
return request(super.createView("/admin/sms/edit"));
|
return request(super.createView("/admin/sms/edit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/sms/update")
|
@RequestMapping("/sms/update")
|
||||||
@Menu(type = "admin", subtype = "sms", admin = true)
|
@Menu(type = "admin", subtype = "sms", admin = true)
|
||||||
public ModelAndView smsupdate(HttpServletRequest request, @Valid SystemMessage sms) throws NoSuchAlgorithmException {
|
public ModelAndView smsupdate(HttpServletRequest request, @Valid SystemMessage sms) throws NoSuchAlgorithmException {
|
||||||
SystemMessage temp = systemMessageRepository.findById(sms.getId());
|
SystemMessage temp = systemMessageRepository.getReferenceById(sms.getId());
|
||||||
if (sms != null) {
|
if (sms != null) {
|
||||||
sms.setCreatetime(temp.getCreatetime());
|
sms.setCreatetime(temp.getCreatetime());
|
||||||
sms.setMsgtype(MainContext.SystemMessageType.SMS.toString());
|
sms.setMsgtype(MainContext.SystemMessageType.SMS.toString());
|
||||||
@ -171,7 +171,7 @@ public class SystemMessageController extends Handler {
|
|||||||
@RequestMapping("/sms/delete")
|
@RequestMapping("/sms/delete")
|
||||||
@Menu(type = "admin", subtype = "sms")
|
@Menu(type = "admin", subtype = "sms")
|
||||||
public ModelAndView smsdelete(HttpServletRequest request, @Valid SystemMessage sms) {
|
public ModelAndView smsdelete(HttpServletRequest request, @Valid SystemMessage sms) {
|
||||||
SystemMessage temp = systemMessageRepository.findById(sms.getId());
|
SystemMessage temp = systemMessageRepository.getReferenceById(sms.getId());
|
||||||
if (sms != null) {
|
if (sms != null) {
|
||||||
systemMessageRepository.delete(temp);
|
systemMessageRepository.delete(temp);
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,6 @@ import com.cskefu.cc.util.metadata.UKColumnMetadata;
|
|||||||
import com.cskefu.cc.util.metadata.UKTableMetaData;
|
import com.cskefu.cc.util.metadata.UKTableMetaData;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.jdbc.Work;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.BeansException;
|
import org.springframework.beans.BeansException;
|
||||||
@ -40,10 +39,10 @@ import org.springframework.ui.ModelMap;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.persistence.EntityManager;
|
import jakarta.persistence.EntityManager;
|
||||||
import javax.persistence.PersistenceContext;
|
import jakarta.persistence.PersistenceContext;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -75,21 +74,21 @@ public class MetadataController extends Handler {
|
|||||||
@RequestMapping("/index")
|
@RequestMapping("/index")
|
||||||
@Menu(type = "admin", subtype = "metadata", admin = true)
|
@Menu(type = "admin", subtype = "metadata", admin = true)
|
||||||
public ModelAndView index(ModelMap map, HttpServletRequest request) throws SQLException {
|
public ModelAndView index(ModelMap map, HttpServletRequest request) throws SQLException {
|
||||||
map.addAttribute("metadataList", metadataRes.findAll(new PageRequest(super.getP(request), super.getPs(request))));
|
map.addAttribute("metadataList", metadataRes.findAll(PageRequest.of(super.getP(request), super.getPs(request))));
|
||||||
return request(super.createView("/admin/system/metadata/index"));
|
return request(super.createView("/admin/system/metadata/index"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/edit")
|
@RequestMapping("/edit")
|
||||||
@Menu(type = "admin", subtype = "metadata", admin = true)
|
@Menu(type = "admin", subtype = "metadata", admin = true)
|
||||||
public ModelAndView edit(ModelMap map, HttpServletRequest request, @Valid String id) {
|
public ModelAndView edit(ModelMap map, HttpServletRequest request, @Valid String id) {
|
||||||
map.addAttribute("metadata", metadataRes.findById(id));
|
map.addAttribute("metadata", metadataRes.getReferenceById(id));
|
||||||
return request(super.createView("/admin/system/metadata/edit"));
|
return request(super.createView("/admin/system/metadata/edit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/update")
|
@RequestMapping("/update")
|
||||||
@Menu(type = "admin", subtype = "metadata", admin = true)
|
@Menu(type = "admin", subtype = "metadata", admin = true)
|
||||||
public ModelAndView update(ModelMap map, HttpServletRequest request, @Valid MetadataTable metadata) throws SQLException {
|
public ModelAndView update(ModelMap map, HttpServletRequest request, @Valid MetadataTable metadata) throws SQLException {
|
||||||
MetadataTable table = metadataRes.findById(metadata.getId());
|
MetadataTable table = metadataRes.getReferenceById(metadata.getId());
|
||||||
table.setName(metadata.getName());
|
table.setName(metadata.getName());
|
||||||
table.setFromdb(metadata.isFromdb());
|
table.setFromdb(metadata.isFromdb());
|
||||||
table.setListblocktemplet(metadata.getListblocktemplet());
|
table.setListblocktemplet(metadata.getListblocktemplet());
|
||||||
@ -101,7 +100,7 @@ public class MetadataController extends Handler {
|
|||||||
@RequestMapping("/properties/edit")
|
@RequestMapping("/properties/edit")
|
||||||
@Menu(type = "admin", subtype = "metadata", admin = true)
|
@Menu(type = "admin", subtype = "metadata", admin = true)
|
||||||
public ModelAndView propertiesedit(ModelMap map, HttpServletRequest request, @Valid String id) {
|
public ModelAndView propertiesedit(ModelMap map, HttpServletRequest request, @Valid String id) {
|
||||||
map.addAttribute("tp", tablePropertiesRes.findById(id));
|
map.addAttribute("tp", tablePropertiesRes.getReferenceById(id));
|
||||||
map.addAttribute("sysdicList", sysDicRes.findByParentid("0"));
|
map.addAttribute("sysdicList", sysDicRes.findByParentid("0"));
|
||||||
map.addAttribute("dataImplList", Dict.getInstance().getDic("com.dic.data.impl"));
|
map.addAttribute("dataImplList", Dict.getInstance().getDic("com.dic.data.impl"));
|
||||||
|
|
||||||
@ -111,7 +110,7 @@ public class MetadataController extends Handler {
|
|||||||
@RequestMapping("/properties/update")
|
@RequestMapping("/properties/update")
|
||||||
@Menu(type = "admin", subtype = "metadata", admin = true)
|
@Menu(type = "admin", subtype = "metadata", admin = true)
|
||||||
public ModelAndView propertiesupdate(ModelMap map, HttpServletRequest request, @Valid TableProperties tp) throws SQLException {
|
public ModelAndView propertiesupdate(ModelMap map, HttpServletRequest request, @Valid TableProperties tp) throws SQLException {
|
||||||
TableProperties tableProperties = tablePropertiesRes.findById(tp.getId());
|
TableProperties tableProperties = tablePropertiesRes.getReferenceById(tp.getId());
|
||||||
tableProperties.setName(tp.getName());
|
tableProperties.setName(tp.getName());
|
||||||
tableProperties.setSeldata(tp.isSeldata());
|
tableProperties.setSeldata(tp.isSeldata());
|
||||||
tableProperties.setSeldatacode(tp.getSeldatacode());
|
tableProperties.setSeldatacode(tp.getSeldatacode());
|
||||||
@ -136,7 +135,7 @@ public class MetadataController extends Handler {
|
|||||||
@RequestMapping("/delete")
|
@RequestMapping("/delete")
|
||||||
@Menu(type = "admin", subtype = "metadata", admin = true)
|
@Menu(type = "admin", subtype = "metadata", admin = true)
|
||||||
public ModelAndView delete(ModelMap map, HttpServletRequest request, @Valid String id) throws SQLException {
|
public ModelAndView delete(ModelMap map, HttpServletRequest request, @Valid String id) throws SQLException {
|
||||||
MetadataTable table = metadataRes.findById(id);
|
MetadataTable table = metadataRes.getReferenceById(id);
|
||||||
metadataRes.delete(table);
|
metadataRes.delete(table);
|
||||||
return request(super.createView("redirect:/admin/metadata/index.html"));
|
return request(super.createView("redirect:/admin/metadata/index.html"));
|
||||||
}
|
}
|
||||||
@ -145,7 +144,7 @@ public class MetadataController extends Handler {
|
|||||||
@Menu(type = "admin", subtype = "metadata", admin = true)
|
@Menu(type = "admin", subtype = "metadata", admin = true)
|
||||||
public ModelAndView batdelete(ModelMap map, HttpServletRequest request, @Valid String[] ids) throws SQLException {
|
public ModelAndView batdelete(ModelMap map, HttpServletRequest request, @Valid String[] ids) throws SQLException {
|
||||||
if (ids != null && ids.length > 0) {
|
if (ids != null && ids.length > 0) {
|
||||||
metadataRes.delete(metadataRes.findAll(Arrays.asList(ids)));
|
metadataRes.deleteAll(metadataRes.findAllById(Arrays.asList(ids)));
|
||||||
}
|
}
|
||||||
return request(super.createView("redirect:/admin/metadata/index.html"));
|
return request(super.createView("redirect:/admin/metadata/index.html"));
|
||||||
}
|
}
|
||||||
@ -153,7 +152,7 @@ public class MetadataController extends Handler {
|
|||||||
@RequestMapping("/properties/delete")
|
@RequestMapping("/properties/delete")
|
||||||
@Menu(type = "admin", subtype = "metadata", admin = true)
|
@Menu(type = "admin", subtype = "metadata", admin = true)
|
||||||
public ModelAndView propertiesdelete(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String tbid) throws SQLException {
|
public ModelAndView propertiesdelete(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String tbid) throws SQLException {
|
||||||
TableProperties prop = tablePropertiesRes.findById(id);
|
TableProperties prop = tablePropertiesRes.getReferenceById(id);
|
||||||
tablePropertiesRes.delete(prop);
|
tablePropertiesRes.delete(prop);
|
||||||
return request(super.createView("redirect:/admin/metadata/table.html?id=" + (!StringUtils.isBlank(tbid) ? tbid : prop.getDbtableid())));
|
return request(super.createView("redirect:/admin/metadata/table.html?id=" + (!StringUtils.isBlank(tbid) ? tbid : prop.getDbtableid())));
|
||||||
}
|
}
|
||||||
@ -162,7 +161,7 @@ public class MetadataController extends Handler {
|
|||||||
@Menu(type = "admin", subtype = "metadata", admin = true)
|
@Menu(type = "admin", subtype = "metadata", admin = true)
|
||||||
public ModelAndView propertiesbatdelete(ModelMap map, HttpServletRequest request, @Valid String[] ids, @Valid String tbid) throws SQLException {
|
public ModelAndView propertiesbatdelete(ModelMap map, HttpServletRequest request, @Valid String[] ids, @Valid String tbid) throws SQLException {
|
||||||
if (ids != null && ids.length > 0) {
|
if (ids != null && ids.length > 0) {
|
||||||
tablePropertiesRes.delete(tablePropertiesRes.findAll(Arrays.asList(ids)));
|
tablePropertiesRes.deleteAll(tablePropertiesRes.findAllById(Arrays.asList(ids)));
|
||||||
}
|
}
|
||||||
return request(super.createView("redirect:/admin/metadata/table.html?id=" + tbid));
|
return request(super.createView("redirect:/admin/metadata/table.html?id=" + tbid));
|
||||||
}
|
}
|
||||||
@ -172,7 +171,7 @@ public class MetadataController extends Handler {
|
|||||||
public ModelAndView table(ModelMap map, HttpServletRequest request, @Valid String id) throws SQLException {
|
public ModelAndView table(ModelMap map, HttpServletRequest request, @Valid String id) throws SQLException {
|
||||||
map.addAttribute("propertiesList", tablePropertiesRes.findByDbtableid(id));
|
map.addAttribute("propertiesList", tablePropertiesRes.findByDbtableid(id));
|
||||||
map.addAttribute("tbid", id);
|
map.addAttribute("tbid", id);
|
||||||
map.addAttribute("table", metadataRes.findById(id));
|
map.addAttribute("table", metadataRes.getReferenceById(id));
|
||||||
return request(super.createView("/admin/system/metadata/table"));
|
return request(super.createView("/admin/system/metadata/table"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -270,7 +269,7 @@ public class MetadataController extends Handler {
|
|||||||
@Menu(type = "admin", subtype = "metadata", admin = true)
|
@Menu(type = "admin", subtype = "metadata", admin = true)
|
||||||
public ModelAndView clean(ModelMap map, HttpServletRequest request, @Valid String id) throws SQLException, BeansException, ClassNotFoundException {
|
public ModelAndView clean(ModelMap map, HttpServletRequest request, @Valid String id) throws SQLException, BeansException, ClassNotFoundException {
|
||||||
if (!StringUtils.isBlank(id)) {
|
if (!StringUtils.isBlank(id)) {
|
||||||
MetadataTable table = metadataRes.findById(id);
|
MetadataTable table = metadataRes.getReferenceById(id);
|
||||||
}
|
}
|
||||||
return request(super.createView("redirect:/admin/metadata/index.html"));
|
return request(super.createView("redirect:/admin/metadata/index.html"));
|
||||||
}
|
}
|
||||||
@ -280,7 +279,7 @@ public class MetadataController extends Handler {
|
|||||||
@Menu(type = "admin", subtype = "metadata", admin = true)
|
@Menu(type = "admin", subtype = "metadata", admin = true)
|
||||||
public ModelAndView synctoes(ModelMap map, HttpServletRequest request, @Valid String id) throws SQLException, BeansException, ClassNotFoundException {
|
public ModelAndView synctoes(ModelMap map, HttpServletRequest request, @Valid String id) throws SQLException, BeansException, ClassNotFoundException {
|
||||||
if (!StringUtils.isBlank(id)) {
|
if (!StringUtils.isBlank(id)) {
|
||||||
MetadataTable table = metadataRes.findById(id);
|
MetadataTable table = metadataRes.getReferenceById(id);
|
||||||
if (table.isFromdb() && !StringUtils.isBlank(table.getListblocktemplet())) {
|
if (table.isFromdb() && !StringUtils.isBlank(table.getListblocktemplet())) {
|
||||||
SysDic dic = Dict.getInstance().getDicItem(table.getListblocktemplet());
|
SysDic dic = Dict.getInstance().getDicItem(table.getListblocktemplet());
|
||||||
}
|
}
|
||||||
@ -293,7 +292,7 @@ public class MetadataController extends Handler {
|
|||||||
@Menu(type = "admin", subtype = "metadata", admin = true)
|
@Menu(type = "admin", subtype = "metadata", admin = true)
|
||||||
public ModelAndView synctodb(ModelMap map, HttpServletRequest request, @Valid String id) throws SQLException, BeansException, ClassNotFoundException {
|
public ModelAndView synctodb(ModelMap map, HttpServletRequest request, @Valid String id) throws SQLException, BeansException, ClassNotFoundException {
|
||||||
if (!StringUtils.isBlank(id)) {
|
if (!StringUtils.isBlank(id)) {
|
||||||
MetadataTable table = metadataRes.findById(id);
|
MetadataTable table = metadataRes.getReferenceById(id);
|
||||||
if (table.isFromdb() && !StringUtils.isBlank(table.getListblocktemplet())) {
|
if (table.isFromdb() && !StringUtils.isBlank(table.getListblocktemplet())) {
|
||||||
SysDic dic = Dict.getInstance().getDicItem(table.getListblocktemplet());
|
SysDic dic = Dict.getInstance().getDicItem(table.getListblocktemplet());
|
||||||
}
|
}
|
||||||
|
@ -30,8 +30,8 @@ import org.springframework.ui.ModelMap;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ public class SysDicController extends Handler {
|
|||||||
@RequestMapping("/index")
|
@RequestMapping("/index")
|
||||||
@Menu(type = "admin", subtype = "sysdic")
|
@Menu(type = "admin", subtype = "sysdic")
|
||||||
public ModelAndView index(ModelMap map, HttpServletRequest request) {
|
public ModelAndView index(ModelMap map, HttpServletRequest request) {
|
||||||
map.addAttribute("sysDicList", sysDicRes.findByParentid("0", new PageRequest(super.getP(request), super.getPs(request), Direction.DESC, "createtime")));
|
map.addAttribute("sysDicList", sysDicRes.findByParentid("0", PageRequest.of(super.getP(request), super.getPs(request), Direction.DESC, "createtime")));
|
||||||
return request(super.createView("/admin/system/sysdic/index"));
|
return request(super.createView("/admin/system/sysdic/index"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ public class SysDicController extends Handler {
|
|||||||
@RequestMapping("/edit")
|
@RequestMapping("/edit")
|
||||||
@Menu(type = "admin", subtype = "sysdic")
|
@Menu(type = "admin", subtype = "sysdic")
|
||||||
public ModelAndView edit(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String p) {
|
public ModelAndView edit(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String p) {
|
||||||
map.addAttribute("sysDic", sysDicRes.findById(id));
|
map.addAttribute("sysDic", sysDicRes.getReferenceById(id));
|
||||||
map.addAttribute("p", p);
|
map.addAttribute("p", p);
|
||||||
return request(super.createView("/admin/system/sysdic/edit"));
|
return request(super.createView("/admin/system/sysdic/edit"));
|
||||||
}
|
}
|
||||||
@ -90,7 +90,7 @@ public class SysDicController extends Handler {
|
|||||||
public ModelAndView update(HttpServletRequest request, @Valid SysDic dic, @Valid String p) {
|
public ModelAndView update(HttpServletRequest request, @Valid SysDic dic, @Valid String p) {
|
||||||
List<SysDic> sysDicList = sysDicRes.findByCodeOrName(dic.getCode(), dic.getName());
|
List<SysDic> sysDicList = sysDicRes.findByCodeOrName(dic.getCode(), dic.getName());
|
||||||
if (sysDicList.size() == 0 || (sysDicList.size() == 1 && sysDicList.get(0).getId().equals(dic.getId()))) {
|
if (sysDicList.size() == 0 || (sysDicList.size() == 1 && sysDicList.get(0).getId().equals(dic.getId()))) {
|
||||||
SysDic sysDic = sysDicRes.findById(dic.getId());
|
SysDic sysDic = sysDicRes.getReferenceById(dic.getId());
|
||||||
sysDic.setName(dic.getName());
|
sysDic.setName(dic.getName());
|
||||||
sysDic.setCode(dic.getCode());
|
sysDic.setCode(dic.getCode());
|
||||||
sysDic.setCtype(dic.getCtype());
|
sysDic.setCtype(dic.getCtype());
|
||||||
@ -106,8 +106,8 @@ public class SysDicController extends Handler {
|
|||||||
@RequestMapping("/delete")
|
@RequestMapping("/delete")
|
||||||
@Menu(type = "admin", subtype = "sysdic")
|
@Menu(type = "admin", subtype = "sysdic")
|
||||||
public ModelAndView delete(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String p) {
|
public ModelAndView delete(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String p) {
|
||||||
SysDic sysDic = sysDicRes.findById(id);
|
SysDic sysDic = sysDicRes.getReferenceById(id);
|
||||||
sysDicRes.delete(sysDicRes.findByDicid(id));
|
sysDicRes.deleteAll(sysDicRes.findByDicid(id));
|
||||||
sysDicRes.delete(sysDic);
|
sysDicRes.delete(sysDic);
|
||||||
|
|
||||||
reloadSysDicItem(sysDic);
|
reloadSysDicItem(sysDic);
|
||||||
@ -118,15 +118,15 @@ public class SysDicController extends Handler {
|
|||||||
@RequestMapping("/dicitem")
|
@RequestMapping("/dicitem")
|
||||||
@Menu(type = "admin", subtype = "sysdic")
|
@Menu(type = "admin", subtype = "sysdic")
|
||||||
public ModelAndView dicitem(ModelMap map, HttpServletRequest request, @Valid String id) {
|
public ModelAndView dicitem(ModelMap map, HttpServletRequest request, @Valid String id) {
|
||||||
map.addAttribute("sysDic", sysDicRes.findById(id));
|
map.addAttribute("sysDic", sysDicRes.getReferenceById(id));
|
||||||
map.addAttribute("sysDicList", sysDicRes.findByParentid(id, new PageRequest(super.getP(request), super.getPs(request), Direction.DESC, "createtime")));
|
map.addAttribute("sysDicList", sysDicRes.findByParentid(id, PageRequest.of(super.getP(request), super.getPs(request), Direction.DESC, "createtime")));
|
||||||
return request(super.createView("/admin/system/sysdic/dicitem"));
|
return request(super.createView("/admin/system/sysdic/dicitem"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/dicitem/add")
|
@RequestMapping("/dicitem/add")
|
||||||
@Menu(type = "admin", subtype = "sysdic")
|
@Menu(type = "admin", subtype = "sysdic")
|
||||||
public ModelAndView dicitemadd(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String p) {
|
public ModelAndView dicitemadd(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String p) {
|
||||||
map.addAttribute("sysDic", sysDicRes.findById(id));
|
map.addAttribute("sysDic", sysDicRes.getReferenceById(id));
|
||||||
map.addAttribute("p", p);
|
map.addAttribute("p", p);
|
||||||
return request(super.createView("/admin/system/sysdic/dicitemadd"));
|
return request(super.createView("/admin/system/sysdic/dicitemadd"));
|
||||||
}
|
}
|
||||||
@ -172,7 +172,7 @@ public class SysDicController extends Handler {
|
|||||||
@RequestMapping("/dicitem/batadd")
|
@RequestMapping("/dicitem/batadd")
|
||||||
@Menu(type = "admin", subtype = "sysdic")
|
@Menu(type = "admin", subtype = "sysdic")
|
||||||
public ModelAndView dicitembatadd(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String p) {
|
public ModelAndView dicitembatadd(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String p) {
|
||||||
map.addAttribute("sysDic", sysDicRes.findById(id));
|
map.addAttribute("sysDic", sysDicRes.getReferenceById(id));
|
||||||
map.addAttribute("p", p);
|
map.addAttribute("p", p);
|
||||||
return request(super.createView("/admin/system/sysdic/batadd"));
|
return request(super.createView("/admin/system/sysdic/batadd"));
|
||||||
}
|
}
|
||||||
@ -200,7 +200,7 @@ public class SysDicController extends Handler {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
reloadSysDicItem(sysDicRes.getOne(sysDic.getParentid()));
|
reloadSysDicItem(sysDicRes.getReferenceById(sysDic.getParentid()));
|
||||||
|
|
||||||
return request(super.createView("redirect:/admin/sysdic/dicitem.html?id=" + sysDic.getParentid() + "&p=" + p));
|
return request(super.createView("redirect:/admin/sysdic/dicitem.html?id=" + sysDic.getParentid() + "&p=" + p));
|
||||||
}
|
}
|
||||||
@ -208,7 +208,7 @@ public class SysDicController extends Handler {
|
|||||||
@RequestMapping("/dicitem/edit")
|
@RequestMapping("/dicitem/edit")
|
||||||
@Menu(type = "admin", subtype = "sysdic")
|
@Menu(type = "admin", subtype = "sysdic")
|
||||||
public ModelAndView dicitemedit(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String p) {
|
public ModelAndView dicitemedit(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String p) {
|
||||||
map.addAttribute("sysDic", sysDicRes.findById(id));
|
map.addAttribute("sysDic", sysDicRes.getReferenceById(id));
|
||||||
map.addAttribute("p", p);
|
map.addAttribute("p", p);
|
||||||
return request(super.createView("/admin/system/sysdic/dicitemedit"));
|
return request(super.createView("/admin/system/sysdic/dicitemedit"));
|
||||||
}
|
}
|
||||||
@ -218,7 +218,7 @@ public class SysDicController extends Handler {
|
|||||||
public ModelAndView dicitemupdate(HttpServletRequest request, @Valid SysDic dic, @Valid String p) {
|
public ModelAndView dicitemupdate(HttpServletRequest request, @Valid SysDic dic, @Valid String p) {
|
||||||
List<SysDic> sysDicList = sysDicRes.findByDicidAndName(dic.getDicid(), dic.getName());
|
List<SysDic> sysDicList = sysDicRes.findByDicidAndName(dic.getDicid(), dic.getName());
|
||||||
if (sysDicList.size() == 0 || (sysDicList.size() == 1 && sysDicList.get(0).getId().equals(dic.getId()))) {
|
if (sysDicList.size() == 0 || (sysDicList.size() == 1 && sysDicList.get(0).getId().equals(dic.getId()))) {
|
||||||
SysDic sysDic = sysDicRes.findById(dic.getId());
|
SysDic sysDic = sysDicRes.getReferenceById(dic.getId());
|
||||||
sysDic.setName(dic.getName());
|
sysDic.setName(dic.getName());
|
||||||
sysDic.setCode(dic.getCode());
|
sysDic.setCode(dic.getCode());
|
||||||
sysDic.setCtype(dic.getCtype());
|
sysDic.setCtype(dic.getCtype());
|
||||||
@ -236,8 +236,8 @@ public class SysDicController extends Handler {
|
|||||||
@RequestMapping("/dicitem/delete")
|
@RequestMapping("/dicitem/delete")
|
||||||
@Menu(type = "admin", subtype = "sysdic")
|
@Menu(type = "admin", subtype = "sysdic")
|
||||||
public ModelAndView dicitemdelete(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String p) {
|
public ModelAndView dicitemdelete(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String p) {
|
||||||
sysDicRes.delete(sysDicRes.findByDicid(id));
|
sysDicRes.deleteAll(sysDicRes.findByDicid(id));
|
||||||
SysDic dic = sysDicRes.getOne(id);
|
SysDic dic = sysDicRes.getReferenceById(id);
|
||||||
sysDicRes.delete(dic);
|
sysDicRes.delete(dic);
|
||||||
reloadSysDicItem(dic);
|
reloadSysDicItem(dic);
|
||||||
return request(super.createView("redirect:/admin/sysdic/dicitem.html?id=" + dic.getParentid() + "&p=" + p));
|
return request(super.createView("redirect:/admin/sysdic/dicitem.html?id=" + dic.getParentid() + "&p=" + p));
|
||||||
|
@ -35,9 +35,9 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -97,7 +97,7 @@ public class TemplateController extends Handler {
|
|||||||
@RequestMapping("/list")
|
@RequestMapping("/list")
|
||||||
@Menu(type = "admin", subtype = "template", admin = true)
|
@Menu(type = "admin", subtype = "template", admin = true)
|
||||||
public ModelAndView list(ModelMap map, HttpServletRequest request, @Valid String type) {
|
public ModelAndView list(ModelMap map, HttpServletRequest request, @Valid String type) {
|
||||||
map.addAttribute("sysDic", dicRes.findById(type));
|
map.addAttribute("sysDic", dicRes.getReferenceById(type));
|
||||||
map.addAttribute("templateList", templateRes.findByTemplettype(type));
|
map.addAttribute("templateList", templateRes.findByTemplettype(type));
|
||||||
return request(super.createView("/admin/system/template/list"));
|
return request(super.createView("/admin/system/template/list"));
|
||||||
}
|
}
|
||||||
@ -105,7 +105,7 @@ public class TemplateController extends Handler {
|
|||||||
@RequestMapping("/add")
|
@RequestMapping("/add")
|
||||||
@Menu(type = "admin", subtype = "template", admin = true)
|
@Menu(type = "admin", subtype = "template", admin = true)
|
||||||
public ModelAndView add(ModelMap map, HttpServletRequest request, @Valid String type) {
|
public ModelAndView add(ModelMap map, HttpServletRequest request, @Valid String type) {
|
||||||
map.addAttribute("sysDic", dicRes.findById(type));
|
map.addAttribute("sysDic", dicRes.getReferenceById(type));
|
||||||
return request(super.createView("/admin/system/template/add"));
|
return request(super.createView("/admin/system/template/add"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ public class TemplateController extends Handler {
|
|||||||
public ModelAndView save(HttpServletRequest request, @Valid Template template) {
|
public ModelAndView save(HttpServletRequest request, @Valid Template template) {
|
||||||
template.setCreatetime(new Date());
|
template.setCreatetime(new Date());
|
||||||
|
|
||||||
SysDic dic = dicRes.findById(template.getTemplettype());
|
SysDic dic = dicRes.getReferenceById(template.getTemplettype());
|
||||||
if (dic != null && StringUtils.isBlank(template.getCode())) {
|
if (dic != null && StringUtils.isBlank(template.getCode())) {
|
||||||
template.setCode(dic.getCode());
|
template.setCode(dic.getCode());
|
||||||
}
|
}
|
||||||
@ -126,17 +126,17 @@ public class TemplateController extends Handler {
|
|||||||
@RequestMapping("/edit")
|
@RequestMapping("/edit")
|
||||||
@Menu(type = "admin", subtype = "template", admin = true)
|
@Menu(type = "admin", subtype = "template", admin = true)
|
||||||
public ModelAndView edit(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String type) {
|
public ModelAndView edit(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String type) {
|
||||||
map.addAttribute("sysDic", dicRes.findById(type));
|
map.addAttribute("sysDic", dicRes.getReferenceById(type));
|
||||||
map.addAttribute("template", templateRes.findById(id));
|
map.addAttribute("template", templateRes.getReferenceById(id));
|
||||||
return request(super.createView("/admin/system/template/edit"));
|
return request(super.createView("/admin/system/template/edit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/update")
|
@RequestMapping("/update")
|
||||||
@Menu(type = "admin", subtype = "template", admin = true)
|
@Menu(type = "admin", subtype = "template", admin = true)
|
||||||
public ModelAndView update(HttpServletRequest request, @Valid Template template) {
|
public ModelAndView update(HttpServletRequest request, @Valid Template template) {
|
||||||
Template oldTemplate = templateRes.findById(template.getId());
|
Template oldTemplate = templateRes.getReferenceById(template.getId());
|
||||||
if (oldTemplate != null) {
|
if (oldTemplate != null) {
|
||||||
SysDic dic = dicRes.findById(oldTemplate.getTemplettype());
|
SysDic dic = dicRes.getReferenceById(oldTemplate.getTemplettype());
|
||||||
if (dic != null) {
|
if (dic != null) {
|
||||||
oldTemplate.setCode(dic.getCode());
|
oldTemplate.setCode(dic.getCode());
|
||||||
}
|
}
|
||||||
@ -158,15 +158,15 @@ public class TemplateController extends Handler {
|
|||||||
@RequestMapping("/code")
|
@RequestMapping("/code")
|
||||||
@Menu(type = "admin", subtype = "template", admin = true)
|
@Menu(type = "admin", subtype = "template", admin = true)
|
||||||
public ModelAndView code(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String type) {
|
public ModelAndView code(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String type) {
|
||||||
map.addAttribute("sysDic", dicRes.findById(type));
|
map.addAttribute("sysDic", dicRes.getReferenceById(type));
|
||||||
map.addAttribute("template", templateRes.findById(id));
|
map.addAttribute("template", templateRes.getReferenceById(id));
|
||||||
return request(super.createView("/admin/system/template/code"));
|
return request(super.createView("/admin/system/template/code"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/codesave")
|
@RequestMapping("/codesave")
|
||||||
@Menu(type = "admin", subtype = "template", admin = true)
|
@Menu(type = "admin", subtype = "template", admin = true)
|
||||||
public ModelAndView codesave(HttpServletRequest request, @Valid Template template) {
|
public ModelAndView codesave(HttpServletRequest request, @Valid Template template) {
|
||||||
Template oldTemplate = templateRes.findById(template.getId());
|
Template oldTemplate = templateRes.getReferenceById(template.getId());
|
||||||
if (oldTemplate != null) {
|
if (oldTemplate != null) {
|
||||||
oldTemplate.setTemplettext(template.getTemplettext());
|
oldTemplate.setTemplettext(template.getTemplettext());
|
||||||
oldTemplate.setTemplettitle(template.getTemplettitle());
|
oldTemplate.setTemplettitle(template.getTemplettitle());
|
||||||
|
@ -41,6 +41,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@ -49,8 +50,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -76,6 +77,7 @@ public class ApiAgentUserController extends Handler {
|
|||||||
private Cache cache;
|
private Cache cache;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@Lazy
|
||||||
private PeerSyncIM peerSyncIM;
|
private PeerSyncIM peerSyncIM;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -158,8 +160,8 @@ public class ApiAgentUserController extends Handler {
|
|||||||
if (StringUtils.isNotBlank(agentUserId) &&
|
if (StringUtils.isNotBlank(agentUserId) &&
|
||||||
StringUtils.isNotBlank(transAgentId) &&
|
StringUtils.isNotBlank(transAgentId) &&
|
||||||
StringUtils.isNotBlank(agentServiceId)) {
|
StringUtils.isNotBlank(agentServiceId)) {
|
||||||
final User targetAgent = userRes.findOne(transAgentId);
|
final User targetAgent = userRes.getReferenceById(transAgentId);
|
||||||
final AgentService agentService = agentServiceRes.findById(agentServiceId);
|
final AgentService agentService = agentServiceRes.getReferenceById(agentServiceId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新AgentUser
|
* 更新AgentUser
|
||||||
@ -295,7 +297,7 @@ public class ApiAgentUserController extends Handler {
|
|||||||
final User logined = super.getUser(request);
|
final User logined = super.getUser(request);
|
||||||
JsonObject resp = new JsonObject();
|
JsonObject resp = new JsonObject();
|
||||||
|
|
||||||
final AgentUser agentUser = agentUserRes.findById(payload.get("id").getAsString());
|
final AgentUser agentUser = agentUserRes.getReferenceById(payload.get("id").getAsString());
|
||||||
if (agentUser != null) {
|
if (agentUser != null) {
|
||||||
if ((StringUtils.equals(
|
if ((StringUtils.equals(
|
||||||
logined.getId(), agentUser.getAgentno()) || logined.isAdmin())) {
|
logined.getId(), agentUser.getAgentno()) || logined.isAdmin())) {
|
||||||
|
@ -33,8 +33,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/apps")
|
@RequestMapping("/api/apps")
|
||||||
|
@ -31,8 +31,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取对话内容
|
* 获取对话内容
|
||||||
@ -57,7 +57,7 @@ public class ApiChatMessageController extends Handler {
|
|||||||
public ResponseEntity<RestResult> list(HttpServletRequest request, @Valid String serviceid) {
|
public ResponseEntity<RestResult> list(HttpServletRequest request, @Valid String serviceid) {
|
||||||
ResponseEntity<RestResult> result = null;
|
ResponseEntity<RestResult> result = null;
|
||||||
if (!StringUtils.isBlank(serviceid)) {
|
if (!StringUtils.isBlank(serviceid)) {
|
||||||
result = new ResponseEntity<>(new RestResult(RestResultType.OK, chatMessageRes.findByAgentserviceid(serviceid, new PageRequest(super.getP(request), super.getPs(request), Sort.Direction.DESC, "createtime"))), HttpStatus.OK);
|
result = new ResponseEntity<>(new RestResult(RestResultType.OK, chatMessageRes.findByAgentserviceid(serviceid, PageRequest.of(super.getP(request), super.getPs(request), Sort.Direction.DESC, "createtime"))), HttpStatus.OK);
|
||||||
} else {
|
} else {
|
||||||
result = new ResponseEntity<>(new RestResult(RestResultType.LACKDATA, RestResultType.LACKDATA.getMessage()), HttpStatus.OK);
|
result = new ResponseEntity<>(new RestResult(RestResultType.LACKDATA, RestResultType.LACKDATA.getMessage()), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ public class ApiContactNotesController extends Handler {
|
|||||||
private JsonObject creater(final String creater) {
|
private JsonObject creater(final String creater) {
|
||||||
JsonObject data = new JsonObject();
|
JsonObject data = new JsonObject();
|
||||||
// 增加创建人
|
// 增加创建人
|
||||||
User u = userRes.findById(creater);
|
User u = userRes.getReferenceById(creater);
|
||||||
if (u != null) {
|
if (u != null) {
|
||||||
data.addProperty("creater", u.getId());
|
data.addProperty("creater", u.getId());
|
||||||
data.addProperty("creatername", u.getUname());
|
data.addProperty("creatername", u.getUname());
|
||||||
@ -100,7 +100,7 @@ public class ApiContactNotesController extends Handler {
|
|||||||
JsonArray y = new JsonArray();
|
JsonArray y = new JsonArray();
|
||||||
|
|
||||||
for (final OrganUser organ : organs) {
|
for (final OrganUser organ : organs) {
|
||||||
Organ o = organRes.findOne(organ.getOrgan());
|
Organ o = organRes.getReferenceById(organ.getOrgan());
|
||||||
if (o != null) {
|
if (o != null) {
|
||||||
JsonObject x = new JsonObject();
|
JsonObject x = new JsonObject();
|
||||||
x.addProperty("createrorgan", o.getName());
|
x.addProperty("createrorgan", o.getName());
|
||||||
@ -127,7 +127,7 @@ public class ApiContactNotesController extends Handler {
|
|||||||
JsonObject resp = new JsonObject();
|
JsonObject resp = new JsonObject();
|
||||||
// TODO 增加权限检查
|
// TODO 增加权限检查
|
||||||
if (j.has("id") && StringUtils.isNotBlank(j.get("id").getAsString())) {
|
if (j.has("id") && StringUtils.isNotBlank(j.get("id").getAsString())) {
|
||||||
ContactNotes cn = contactNotesRes.findOne(j.get("id").getAsString());
|
ContactNotes cn = contactNotesRes.getReferenceById(j.get("id").getAsString());
|
||||||
if (cn != null) {
|
if (cn != null) {
|
||||||
JsonObject data = new JsonObject();
|
JsonObject data = new JsonObject();
|
||||||
data.addProperty("contactid", cn.getContactid());
|
data.addProperty("contactid", cn.getContactid());
|
||||||
@ -213,7 +213,7 @@ public class ApiContactNotesController extends Handler {
|
|||||||
if ((!payload.has("contactid")) || StringUtils.isBlank(payload.get("contactid").getAsString())) {
|
if ((!payload.has("contactid")) || StringUtils.isBlank(payload.get("contactid").getAsString())) {
|
||||||
return "参数传递不合法,没有[contactid]。";
|
return "参数传递不合法,没有[contactid]。";
|
||||||
} else {
|
} else {
|
||||||
Contacts c = contactsRes.findOne(payload.get("contactid").getAsString());
|
Contacts c = contactsRes.getReferenceById(payload.get("contactid").getAsString());
|
||||||
if (c == null)
|
if (c == null)
|
||||||
return "参数不合法,不存在该联系人。";
|
return "参数不合法,不存在该联系人。";
|
||||||
}
|
}
|
||||||
@ -248,7 +248,7 @@ public class ApiContactNotesController extends Handler {
|
|||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
final String cid = j.get("contactid").getAsString();
|
final String cid = j.get("contactid").getAsString();
|
||||||
Contacts c = contactsRes.findOne(cid);
|
Contacts c = contactsRes.getReferenceById(cid);
|
||||||
|
|
||||||
if (c == null) {
|
if (c == null) {
|
||||||
resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_4);
|
resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_4);
|
||||||
@ -258,7 +258,7 @@ public class ApiContactNotesController extends Handler {
|
|||||||
|
|
||||||
String q = querybuilder(j);
|
String q = querybuilder(j);
|
||||||
|
|
||||||
Page<ContactNotes> cns = contactNotesRes.findByContactidOrderByCreatetimeDesc(cid, new PageRequest(super.getP(request), super.getPs(request)));
|
Page<ContactNotes> cns = contactNotesRes.findByContactidOrderByCreatetimeDesc(cid, PageRequest.of(super.getP(request), super.getPs(request)));
|
||||||
|
|
||||||
resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC);
|
resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC);
|
||||||
resp.addProperty("size", cns.getSize());
|
resp.addProperty("size", cns.getSize());
|
||||||
|
@ -40,7 +40,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -129,7 +129,7 @@ public class ApiContactTagsController extends Handler {
|
|||||||
|
|
||||||
final String tagId = j.get("tagId").getAsString();
|
final String tagId = j.get("tagId").getAsString();
|
||||||
final String contactid = j.get("contactid").getAsString();
|
final String contactid = j.get("contactid").getAsString();
|
||||||
Tag tag = tagRes.findOne(tagId);
|
Tag tag = tagRes.getReferenceById(tagId);
|
||||||
|
|
||||||
if (tag == null) {
|
if (tag == null) {
|
||||||
resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_2);
|
resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_2);
|
||||||
@ -167,7 +167,7 @@ public class ApiContactTagsController extends Handler {
|
|||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
TagRelation t = tagRelationRes.findOne(j.get("xid").getAsString());
|
TagRelation t = tagRelationRes.getReferenceById(j.get("xid").getAsString());
|
||||||
if (t == null) {
|
if (t == null) {
|
||||||
resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_4);
|
resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_4);
|
||||||
resp.addProperty(RestUtils.RESP_KEY_ERROR, "该联系人没有打这个标签。");
|
resp.addProperty(RestUtils.RESP_KEY_ERROR, "该联系人没有打这个标签。");
|
||||||
|
@ -46,8 +46,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@ -87,12 +87,12 @@ public class ApiContactsController extends Handler {
|
|||||||
if (!StringUtils.isBlank(creater)) {
|
if (!StringUtils.isBlank(creater)) {
|
||||||
User user = super.getUser(request);
|
User user = super.getUser(request);
|
||||||
contactsList = contactsRepository.findByCreaterAndSharesAndDatastatus(user.getId(), "all", false,
|
contactsList = contactsRepository.findByCreaterAndSharesAndDatastatus(user.getId(), "all", false,
|
||||||
new PageRequest(
|
PageRequest.of(
|
||||||
super.getP(request),
|
super.getP(request),
|
||||||
super.getPs(request)));
|
super.getPs(request)));
|
||||||
} else {
|
} else {
|
||||||
contactsList = contactsRepository.findByDatastatus(false,
|
contactsList = contactsRepository.findByDatastatus(false,
|
||||||
new PageRequest(super.getP(request), super.getPs(request)));
|
PageRequest.of(super.getP(request), super.getPs(request)));
|
||||||
}
|
}
|
||||||
return new ResponseEntity<>(new RestResult(RestResultType.OK, contactsList), HttpStatus.OK);
|
return new ResponseEntity<>(new RestResult(RestResultType.OK, contactsList), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
@ -131,7 +131,7 @@ public class ApiContactsController extends Handler {
|
|||||||
public ResponseEntity<RestResult> delete(HttpServletRequest request, @Valid String id) {
|
public ResponseEntity<RestResult> delete(HttpServletRequest request, @Valid String id) {
|
||||||
RestResult result = new RestResult(RestResultType.OK);
|
RestResult result = new RestResult(RestResultType.OK);
|
||||||
if (!StringUtils.isBlank(id)) {
|
if (!StringUtils.isBlank(id)) {
|
||||||
Contacts contacts = contactsRepository.findOne(id);
|
Contacts contacts = contactsRepository.getReferenceById(id);
|
||||||
if (contacts != null) { //系统管理员, 不允许 使用 接口删除
|
if (contacts != null) { //系统管理员, 不允许 使用 接口删除
|
||||||
contacts.setDatastatus(true);
|
contacts.setDatastatus(true);
|
||||||
contactsRepository.save(contacts);
|
contactsRepository.save(contacts);
|
||||||
|
@ -34,11 +34,11 @@ 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.persistence.criteria.CriteriaBuilder;
|
import jakarta.persistence.criteria.CriteriaBuilder;
|
||||||
import javax.persistence.criteria.CriteriaQuery;
|
import jakarta.persistence.criteria.CriteriaQuery;
|
||||||
import javax.persistence.criteria.Predicate;
|
import jakarta.persistence.criteria.Predicate;
|
||||||
import javax.persistence.criteria.Root;
|
import jakarta.persistence.criteria.Root;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -64,13 +64,14 @@ public class ApiLeavemsgController extends Handler {
|
|||||||
public ResponseEntity<RestResult> list(HttpServletRequest request, @RequestBody RequestValues<AgentService> values) {
|
public ResponseEntity<RestResult> list(HttpServletRequest request, @RequestBody RequestValues<AgentService> values) {
|
||||||
Page<AgentService> page = agentServiceRepository.findAll((root, query, cb) -> {
|
Page<AgentService> page = agentServiceRepository.findAll((root, query, cb) -> {
|
||||||
List<Predicate> list = new ArrayList<>();
|
List<Predicate> list = new ArrayList<>();
|
||||||
|
|
||||||
list.add(cb.equal(root.get("leavemsg").as(Boolean.class), true));
|
list.add(cb.equal(root.get("leavemsg").as(Boolean.class), true));
|
||||||
|
|
||||||
list.add(cb.equal(root.get("leavemsgstatus").as(String.class), MainContext.LeaveMsgStatus.NOTPROCESS.toString()));
|
list.add(cb.equal(root.get("leavemsgstatus").as(String.class), MainContext.LeaveMsgStatus.NOTPROCESS.toString()));
|
||||||
|
|
||||||
Predicate[] p = new Predicate[list.size()];
|
Predicate[] p = new Predicate[list.size()];
|
||||||
return cb.and(list.toArray(p));
|
return cb.and(list.toArray(p));
|
||||||
}, new PageRequest(super.getP(values.getQuery()), super.getPs(values.getQuery()), Sort.Direction.DESC, "createtime"));
|
}, PageRequest.of(super.getP(values.getQuery()), super.getPs(values.getQuery()), Sort.Direction.DESC, "createtime"));
|
||||||
return new ResponseEntity<>(new RestResult(RestResultType.OK, page), HttpStatus.OK);
|
return new ResponseEntity<>(new RestResult(RestResultType.OK, page), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -34,8 +34,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取在线访客功能
|
* 获取在线访客功能
|
||||||
@ -59,9 +59,9 @@ public class ApiOnlineUserController extends Handler {
|
|||||||
public ResponseEntity<RestResult> list(HttpServletRequest request, @Valid String userid) {
|
public ResponseEntity<RestResult> list(HttpServletRequest request, @Valid String userid) {
|
||||||
Page<PassportWebIMUser> onlineUserList = null;
|
Page<PassportWebIMUser> onlineUserList = null;
|
||||||
if (!StringUtils.isBlank(userid)) {
|
if (!StringUtils.isBlank(userid)) {
|
||||||
onlineUserList = passportWebIMUserRepository.findByUserid(userid, new PageRequest(super.getP(request), super.getPs(request), Sort.Direction.DESC, "createtime"));
|
onlineUserList = passportWebIMUserRepository.findByUserid(userid, PageRequest.of(super.getP(request), super.getPs(request), Sort.Direction.DESC, "createtime"));
|
||||||
} else {
|
} else {
|
||||||
onlineUserList = passportWebIMUserRepository.findByStatus(MainContext.OnlineUserStatusEnum.ONLINE.toString(), new PageRequest(super.getP(request), super.getPs(request), Sort.Direction.DESC, "createtime"));
|
onlineUserList = passportWebIMUserRepository.findByStatus(MainContext.OnlineUserStatusEnum.ONLINE.toString(), PageRequest.of(super.getP(request), super.getPs(request), Sort.Direction.DESC, "createtime"));
|
||||||
}
|
}
|
||||||
return new ResponseEntity<>(new RestResult(RestResultType.OK, onlineUserList), HttpStatus.OK);
|
return new ResponseEntity<>(new RestResult(RestResultType.OK, onlineUserList), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
@ -30,8 +30,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组织机构/部门/技能组功能
|
* 组织机构/部门/技能组功能
|
||||||
@ -82,7 +82,7 @@ public class ApiOrganController extends Handler{
|
|||||||
RestResult result = new RestResult(RestResultType.OK) ;
|
RestResult result = new RestResult(RestResultType.OK) ;
|
||||||
Organ organ = null ;
|
Organ organ = null ;
|
||||||
if(!StringUtils.isBlank(id)){
|
if(!StringUtils.isBlank(id)){
|
||||||
organ = organRepository.findById(id) ;
|
organ = organRepository.getReferenceById(id) ;
|
||||||
if(organ != null){ //系统管理员, 不允许 使用 接口删除
|
if(organ != null){ //系统管理员, 不允许 使用 接口删除
|
||||||
organRepository.delete(organ);
|
organRepository.delete(organ);
|
||||||
}else{
|
}else{
|
||||||
|
@ -34,12 +34,12 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.persistence.criteria.CriteriaBuilder;
|
import jakarta.persistence.criteria.CriteriaBuilder;
|
||||||
import javax.persistence.criteria.CriteriaQuery;
|
import jakarta.persistence.criteria.CriteriaQuery;
|
||||||
import javax.persistence.criteria.Predicate;
|
import jakarta.persistence.criteria.Predicate;
|
||||||
import javax.persistence.criteria.Root;
|
import jakarta.persistence.criteria.Root;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ public class ApiQualityController extends Handler {
|
|||||||
|
|
||||||
Predicate[] p = new Predicate[list.size()];
|
Predicate[] p = new Predicate[list.size()];
|
||||||
return cb.and(list.toArray(p));
|
return cb.and(list.toArray(p));
|
||||||
}, new PageRequest(super.getP(request), super.getPs(request), Sort.Direction.DESC, "createtime"));
|
}, PageRequest.of(super.getP(request), super.getPs(request), Sort.Direction.DESC, "createtime"));
|
||||||
return new ResponseEntity<>(new RestResult(RestResultType.OK, page), HttpStatus.OK);
|
return new ResponseEntity<>(new RestResult(RestResultType.OK, page), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -36,8 +36,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -41,8 +41,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -41,7 +41,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 标签
|
* 标签
|
||||||
@ -70,7 +70,7 @@ public class ApiTagsController extends Handler {
|
|||||||
tagType = j.get("tagtype").getAsString();
|
tagType = j.get("tagtype").getAsString();
|
||||||
|
|
||||||
Page<Tag> records = tagRes.findByTagtype(tagType,
|
Page<Tag> records = tagRes.findByTagtype(tagType,
|
||||||
new PageRequest(super.getP(request), super.getPs(request), Sort.Direction.DESC, "createtime"));
|
PageRequest.of(super.getP(request), super.getPs(request), Sort.Direction.DESC, "createtime"));
|
||||||
|
|
||||||
JsonArray ja = new JsonArray();
|
JsonArray ja = new JsonArray();
|
||||||
|
|
||||||
|
@ -16,12 +16,13 @@
|
|||||||
*/
|
*/
|
||||||
package com.cskefu.cc.controller.api;
|
package com.cskefu.cc.controller.api;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
import com.cskefu.cc.cache.Cache;
|
import com.cskefu.cc.cache.Cache;
|
||||||
import com.cskefu.cc.basic.Constants;
|
import com.cskefu.cc.basic.Constants;
|
||||||
@ -54,6 +55,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.PageRequest;
|
import org.springframework.data.domain.PageRequest;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@ -100,17 +102,16 @@ public class ApiUserController extends Handler {
|
|||||||
public ResponseEntity<RestResult> list(HttpServletRequest request, @Valid String id, @Valid String username) {
|
public ResponseEntity<RestResult> list(HttpServletRequest request, @Valid String id, @Valid String username) {
|
||||||
Page<User> userList = null;
|
Page<User> userList = null;
|
||||||
if (StringUtils.isNotBlank(id)) {
|
if (StringUtils.isNotBlank(id)) {
|
||||||
userList = userRes.findById(
|
userList = userRes.findByIdIn(Collections.singleton(id), PageRequest.of(super.getP(request), super.getPs(request)));
|
||||||
id, new PageRequest(super.getP(request), super.getPs(request)));
|
|
||||||
} else {
|
} else {
|
||||||
if (StringUtils.isNotBlank(username)) {
|
if (StringUtils.isNotBlank(username)) {
|
||||||
userList = userRes.findByDatastatusAndUsernameLike(
|
userList = userRes.findByDatastatusAndUsernameLike(
|
||||||
false, username, new PageRequest(
|
false, username, PageRequest.of(
|
||||||
super.getP(request),
|
super.getP(request),
|
||||||
super.getPs(request)));
|
super.getPs(request)));
|
||||||
} else {
|
} else {
|
||||||
userList = userRes.findByDatastatus(
|
userList = userRes.findByDatastatus(
|
||||||
false, new PageRequest(super.getP(request), super.getPs(request)));
|
false, PageRequest.of(super.getP(request), super.getPs(request)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new ResponseEntity<>(new RestResult(RestResultType.OK, userList), HttpStatus.OK);
|
return new ResponseEntity<>(new RestResult(RestResultType.OK, userList), HttpStatus.OK);
|
||||||
@ -173,7 +174,7 @@ public class ApiUserController extends Handler {
|
|||||||
String parent = payload.get("parent").getAsString();
|
String parent = payload.get("parent").getAsString();
|
||||||
Organ parentOrgan = super.getOrgan(request);
|
Organ parentOrgan = super.getOrgan(request);
|
||||||
if (StringUtils.isNotEmpty(parent)) {
|
if (StringUtils.isNotEmpty(parent)) {
|
||||||
parentOrgan = organRes.getOne(parent);
|
parentOrgan = organRes.getReferenceById(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
String roleId = payload.get("role").getAsString();
|
String roleId = payload.get("role").getAsString();
|
||||||
@ -185,7 +186,7 @@ public class ApiUserController extends Handler {
|
|||||||
JsonObject resp = userProxy.createNewUser(user, parentOrgan);
|
JsonObject resp = userProxy.createNewUser(user, parentOrgan);
|
||||||
|
|
||||||
if (StringUtils.isNotEmpty(roleId)) {
|
if (StringUtils.isNotEmpty(roleId)) {
|
||||||
Role role = roleRes.getOne(roleId);
|
Role role = roleRes.getReferenceById(roleId);
|
||||||
UserRole userRole = new UserRole();
|
UserRole userRole = new UserRole();
|
||||||
userRole.setUser(user);
|
userRole.setUser(user);
|
||||||
userRole.setRole(role);
|
userRole.setRole(role);
|
||||||
@ -215,7 +216,7 @@ public class ApiUserController extends Handler {
|
|||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
final User previous = userRes.findById(updated.getId());
|
final User previous = userRes.getReferenceById(updated.getId());
|
||||||
if (previous != null) {
|
if (previous != null) {
|
||||||
String msg = userProxy.validUserUpdate(updated, previous);
|
String msg = userProxy.validUserUpdate(updated, previous);
|
||||||
if (StringUtils.equals(msg, "edit_user_success")) {
|
if (StringUtils.equals(msg, "edit_user_success")) {
|
||||||
@ -286,7 +287,7 @@ public class ApiUserController extends Handler {
|
|||||||
if (payload.has("organ")) {
|
if (payload.has("organ")) {
|
||||||
List<OrganUser> organUsers = organUserRes.findByOrgan(payload.get("organ").getAsString());
|
List<OrganUser> organUsers = organUserRes.findByOrgan(payload.get("organ").getAsString());
|
||||||
List<String> userids = organUsers.stream().map(OrganUser::getUserid).collect(Collectors.toList());
|
List<String> userids = organUsers.stream().map(OrganUser::getUserid).collect(Collectors.toList());
|
||||||
List<User> users = userRes.findAll(userids);
|
List<User> users = userRes.findAllById(userids);
|
||||||
|
|
||||||
JsonArray data = new JsonArray();
|
JsonArray data = new JsonArray();
|
||||||
users.stream().forEach(u -> {
|
users.stream().forEach(u -> {
|
||||||
@ -319,7 +320,7 @@ public class ApiUserController extends Handler {
|
|||||||
if (payload.has("id")) {
|
if (payload.has("id")) {
|
||||||
String id = payload.get("id").getAsString();
|
String id = payload.get("id").getAsString();
|
||||||
if (StringUtils.isNotBlank(id)) {
|
if (StringUtils.isNotBlank(id)) {
|
||||||
User user = userRes.findById(id);
|
User user = userRes.getReferenceById(id);
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
// 用户不存在
|
// 用户不存在
|
||||||
resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC);
|
resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC);
|
||||||
@ -331,10 +332,10 @@ public class ApiUserController extends Handler {
|
|||||||
if (!user.isSuperadmin()) {
|
if (!user.isSuperadmin()) {
|
||||||
// 删除用户的时候,同时删除用户对应的权限
|
// 删除用户的时候,同时删除用户对应的权限
|
||||||
List<UserRole> userRoles = userRoleRes.findByUser(user);
|
List<UserRole> userRoles = userRoleRes.findByUser(user);
|
||||||
userRoleRes.delete(userRoles);
|
userRoleRes.deleteAll(userRoles);
|
||||||
// 删除用户对应的组织机构关系
|
// 删除用户对应的组织机构关系
|
||||||
List<OrganUser> organUsers = organUserRes.findByUserid(id);
|
List<OrganUser> organUsers = organUserRes.findByUserid(id);
|
||||||
organUserRes.delete(organUsers);
|
organUserRes.deleteAll(organUsers);
|
||||||
// 删除用户
|
// 删除用户
|
||||||
userRes.delete(user);
|
userRes.delete(user);
|
||||||
resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC);
|
resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC);
|
||||||
|
@ -30,8 +30,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 在线客服
|
* 在线客服
|
||||||
|
@ -30,8 +30,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 标签功能
|
* 标签功能
|
||||||
|
@ -49,9 +49,9 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
@ -113,7 +113,7 @@ public class AccountController extends Handler {
|
|||||||
|
|
||||||
map.addAttribute("entCustomerList", accountRes.findByOrganInAndSharesAllAndDatastatusFalse(
|
map.addAttribute("entCustomerList", accountRes.findByOrganInAndSharesAllAndDatastatusFalse(
|
||||||
super.getMyCurrentAffiliatesFlat(logined),
|
super.getMyCurrentAffiliatesFlat(logined),
|
||||||
new PageRequest(super.getP(request), super.getPs(request))));
|
PageRequest.of(super.getP(request), super.getPs(request))));
|
||||||
|
|
||||||
return request(super.createView("/apps/customer/index"));
|
return request(super.createView("/apps/customer/index"));
|
||||||
}
|
}
|
||||||
@ -138,7 +138,7 @@ public class AccountController extends Handler {
|
|||||||
map.addAttribute("entCustomerList", accountRes.findByCreaterAndSharesAndDatastatus(super.getUser(request).getId(),
|
map.addAttribute("entCustomerList", accountRes.findByCreaterAndSharesAndDatastatus(super.getUser(request).getId(),
|
||||||
super.getUser(request).getId(),
|
super.getUser(request).getId(),
|
||||||
false,
|
false,
|
||||||
new PageRequest(super.getP(request), super.getPs(request))));
|
PageRequest.of(super.getP(request), super.getPs(request))));
|
||||||
|
|
||||||
return request(super.createView("/apps/customer/index"));
|
return request(super.createView("/apps/customer/index"));
|
||||||
}
|
}
|
||||||
@ -164,7 +164,7 @@ public class AccountController extends Handler {
|
|||||||
|
|
||||||
map.addAttribute("entCustomerList", accountRes.findByCreaterAndSharesAndDatastatus(super.getUser(request).getId(), super.getUser(request).getId(),
|
map.addAttribute("entCustomerList", accountRes.findByCreaterAndSharesAndDatastatus(super.getUser(request).getId(), super.getUser(request).getId(),
|
||||||
false,
|
false,
|
||||||
new PageRequest(super.getP(request), super.getPs(request))));
|
PageRequest.of(super.getP(request), super.getPs(request))));
|
||||||
|
|
||||||
return request(super.createView("/apps/customer/index"));
|
return request(super.createView("/apps/customer/index"));
|
||||||
}
|
}
|
||||||
@ -190,7 +190,7 @@ public class AccountController extends Handler {
|
|||||||
map.addAttribute("entCustomerList", accountRes.findByCreaterAndSharesAndDatastatus(super.getUser(request).getId(),
|
map.addAttribute("entCustomerList", accountRes.findByCreaterAndSharesAndDatastatus(super.getUser(request).getId(),
|
||||||
super.getUser(request).getId(),
|
super.getUser(request).getId(),
|
||||||
false,
|
false,
|
||||||
new PageRequest(super.getP(request), super.getPs(request))));
|
PageRequest.of(super.getP(request), super.getPs(request))));
|
||||||
return request(super.createView("/apps/customer/index"));
|
return request(super.createView("/apps/customer/index"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,7 +215,7 @@ public class AccountController extends Handler {
|
|||||||
map.addAttribute("entCustomerList", accountRes.findByCreaterAndSharesAndDatastatus(super.getUser(request).getId(),
|
map.addAttribute("entCustomerList", accountRes.findByCreaterAndSharesAndDatastatus(super.getUser(request).getId(),
|
||||||
super.getUser(request).getId(),
|
super.getUser(request).getId(),
|
||||||
false,
|
false,
|
||||||
new PageRequest(super.getP(request), super.getPs(request))));
|
PageRequest.of(super.getP(request), super.getPs(request))));
|
||||||
return request(super.createView("/apps/customer/index"));
|
return request(super.createView("/apps/customer/index"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,7 +238,7 @@ public class AccountController extends Handler {
|
|||||||
map.put("q", q);
|
map.put("q", q);
|
||||||
}
|
}
|
||||||
|
|
||||||
map.addAttribute("entCustomerList", accountRes.findByCreaterAndSharesAndDatastatus(super.getUser(request).getId(), super.getUser(request).getId(), false, new PageRequest(super.getP(request), super.getPs(request))));
|
map.addAttribute("entCustomerList", accountRes.findByCreaterAndSharesAndDatastatus(super.getUser(request).getId(), super.getUser(request).getId(), false, PageRequest.of(super.getP(request), super.getPs(request))));
|
||||||
return request(super.createView("/apps/customer/index"));
|
return request(super.createView("/apps/customer/index"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -285,7 +285,7 @@ public class AccountController extends Handler {
|
|||||||
@Menu(type = "customer", subtype = "customer")
|
@Menu(type = "customer", subtype = "customer")
|
||||||
public ModelAndView delete(HttpServletRequest request, @Valid Account account, @Valid String p, @Valid String ekind) {
|
public ModelAndView delete(HttpServletRequest request, @Valid Account account, @Valid String p, @Valid String ekind) {
|
||||||
if (account != null) {
|
if (account != null) {
|
||||||
account = accountRes.findOne(account.getId());
|
account = accountRes.getReferenceById(account.getId());
|
||||||
account.setDatastatus(true); //客户和联系人都是 逻辑删除
|
account.setDatastatus(true); //客户和联系人都是 逻辑删除
|
||||||
accountRes.save(account);
|
accountRes.save(account);
|
||||||
}
|
}
|
||||||
@ -295,7 +295,7 @@ public class AccountController extends Handler {
|
|||||||
@RequestMapping("/edit")
|
@RequestMapping("/edit")
|
||||||
@Menu(type = "customer", subtype = "customer")
|
@Menu(type = "customer", subtype = "customer")
|
||||||
public ModelAndView edit(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String ekind) {
|
public ModelAndView edit(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String ekind) {
|
||||||
map.addAttribute("entCustomer", accountRes.findOne(id));
|
map.addAttribute("entCustomer", accountRes.getReferenceById(id));
|
||||||
map.addAttribute("ekindId", ekind);
|
map.addAttribute("ekindId", ekind);
|
||||||
return request(super.createView("/apps/customer/edit"));
|
return request(super.createView("/apps/customer/edit"));
|
||||||
}
|
}
|
||||||
@ -304,7 +304,7 @@ public class AccountController extends Handler {
|
|||||||
@Menu(type = "customer", subtype = "customer")
|
@Menu(type = "customer", subtype = "customer")
|
||||||
public ModelAndView update(HttpServletRequest request, @Valid CustomerGroupForm customerGroupForm, @Valid String ekindId) {
|
public ModelAndView update(HttpServletRequest request, @Valid CustomerGroupForm customerGroupForm, @Valid String ekindId) {
|
||||||
final User logined = super.getUser(request);
|
final User logined = super.getUser(request);
|
||||||
Account customer = accountRes.findOne(customerGroupForm.getEntcustomer().getId());
|
Account customer = accountRes.getReferenceById(customerGroupForm.getEntcustomer().getId());
|
||||||
String msg = "";
|
String msg = "";
|
||||||
|
|
||||||
List<PropertiesEvent> events = PropertiesEventUtil.processPropertiesModify(request, customerGroupForm.getEntcustomer(), customer, "id", "creater", "createtime", "updatetime"); //记录 数据变更 历史
|
List<PropertiesEvent> events = PropertiesEventUtil.processPropertiesModify(request, customerGroupForm.getEntcustomer(), customer, "id", "creater", "createtime", "updatetime"); //记录 数据变更 历史
|
||||||
@ -372,7 +372,7 @@ public class AccountController extends Handler {
|
|||||||
@Menu(type = "customer", subtype = "customer")
|
@Menu(type = "customer", subtype = "customer")
|
||||||
public void expids(ModelMap map, HttpServletRequest request, HttpServletResponse response, @Valid String[] ids) throws IOException {
|
public void expids(ModelMap map, HttpServletRequest request, HttpServletResponse response, @Valid String[] ids) throws IOException {
|
||||||
if (ids != null && ids.length > 0) {
|
if (ids != null && ids.length > 0) {
|
||||||
Iterable<Account> entCustomerList = accountRes.findAll(Arrays.asList(ids));
|
Iterable<Account> entCustomerList = accountRes.findAllById(Arrays.asList(ids));
|
||||||
MetadataTable table = metadataRes.findByTablename("uk_entcustomer");
|
MetadataTable table = metadataRes.findByTablename("uk_entcustomer");
|
||||||
List<Map<String, Object>> values = new ArrayList<>();
|
List<Map<String, Object>> values = new ArrayList<>();
|
||||||
for (Account customer : entCustomerList) {
|
for (Account customer : entCustomerList) {
|
||||||
@ -403,7 +403,7 @@ public class AccountController extends Handler {
|
|||||||
map.put("ekind", ekind);
|
map.put("ekind", ekind);
|
||||||
}
|
}
|
||||||
|
|
||||||
Iterable<Account> entCustomerList = accountRes.findByCreaterAndSharesAndDatastatus(super.getUser(request).getId(), super.getUser(request).getId(), false, new PageRequest(super.getP(request), super.getPs(request)));
|
Iterable<Account> entCustomerList = accountRes.findByCreaterAndSharesAndDatastatus(super.getUser(request).getId(), super.getUser(request).getId(), false, PageRequest.of(super.getP(request), super.getPs(request)));
|
||||||
|
|
||||||
MetadataTable table = metadataRes.findByTablename("uk_entcustomer");
|
MetadataTable table = metadataRes.findByTablename("uk_entcustomer");
|
||||||
List<Map<String, Object>> values = new ArrayList<>();
|
List<Map<String, Object>> values = new ArrayList<>();
|
||||||
@ -441,7 +441,7 @@ public class AccountController extends Handler {
|
|||||||
super.getUser(request).getId(),
|
super.getUser(request).getId(),
|
||||||
|
|
||||||
false,
|
false,
|
||||||
new PageRequest(super.getP(request), super.getPs(request)));
|
PageRequest.of(super.getP(request), super.getPs(request)));
|
||||||
MetadataTable table = metadataRes.findByTablename("uk_entcustomer");
|
MetadataTable table = metadataRes.findByTablename("uk_entcustomer");
|
||||||
List<Map<String, Object>> values = new ArrayList<>();
|
List<Map<String, Object>> values = new ArrayList<>();
|
||||||
for (Account customer : entCustomerList) {
|
for (Account customer : entCustomerList) {
|
||||||
|
@ -36,6 +36,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.data.domain.PageRequest;
|
import org.springframework.data.domain.PageRequest;
|
||||||
import org.springframework.data.domain.Sort;
|
import org.springframework.data.domain.Sort;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
@ -43,8 +44,8 @@ import org.springframework.ui.ModelMap;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@ -100,6 +101,7 @@ public class AgentAuditController extends Handler {
|
|||||||
private Cache cache;
|
private Cache cache;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@Lazy
|
||||||
private PeerSyncIM peerSyncIM;
|
private PeerSyncIM peerSyncIM;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -149,14 +151,14 @@ public class AgentAuditController extends Handler {
|
|||||||
criterias.add(new Sort.Order(Sort.Direction.DESC, "status"));
|
criterias.add(new Sort.Order(Sort.Direction.DESC, "status"));
|
||||||
criterias.add(new Sort.Order(Sort.Direction.DESC, "createtime"));
|
criterias.add(new Sort.Order(Sort.Direction.DESC, "createtime"));
|
||||||
} else if (sort.equals("default")) {
|
} else if (sort.equals("default")) {
|
||||||
defaultSort = new Sort(Sort.Direction.DESC, "status");
|
defaultSort = Sort.by(Sort.Direction.DESC, "status");
|
||||||
}
|
}
|
||||||
if (criterias.size() > 0) {
|
if (criterias.size() > 0) {
|
||||||
defaultSort = new Sort(criterias);
|
defaultSort = Sort.by(criterias);
|
||||||
map.addAttribute("sort", sort);
|
map.addAttribute("sort", sort);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
defaultSort = new Sort(Sort.Direction.DESC, "status");
|
defaultSort = Sort.by(Sort.Direction.DESC, "status");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 坐席对话列表
|
// 坐席对话列表
|
||||||
@ -211,7 +213,7 @@ public class AgentAuditController extends Handler {
|
|||||||
|
|
||||||
final User logined = super.getUser(request);
|
final User logined = super.getUser(request);
|
||||||
|
|
||||||
Sort defaultSort = new Sort(Sort.Direction.DESC, "status");
|
Sort defaultSort = Sort.by(Sort.Direction.DESC, "status");
|
||||||
|
|
||||||
// 坐席对话列表
|
// 坐席对话列表
|
||||||
List<AgentUser> agentUsers;
|
List<AgentUser> agentUsers;
|
||||||
@ -241,7 +243,7 @@ public class AgentAuditController extends Handler {
|
|||||||
public ModelAndView agentusers(HttpServletRequest request, String userid) {
|
public ModelAndView agentusers(HttpServletRequest request, String userid) {
|
||||||
ModelAndView view = request(super.createView("/apps/cca/agentusers"));
|
ModelAndView view = request(super.createView("/apps/cca/agentusers"));
|
||||||
User logined = super.getUser(request);
|
User logined = super.getUser(request);
|
||||||
Sort defaultSort = new Sort(Sort.Direction.DESC, "status");
|
Sort defaultSort = Sort.by(Sort.Direction.DESC, "status");
|
||||||
view.addObject(
|
view.addObject(
|
||||||
"agentUserList", agentUserRes.findByStatusAndAgentnoIsNot(
|
"agentUserList", agentUserRes.findByStatusAndAgentnoIsNot(
|
||||||
MainContext.AgentUserStatusEnum.INSERVICE.toString(), logined.getId(), defaultSort));
|
MainContext.AgentUserStatusEnum.INSERVICE.toString(), logined.getId(), defaultSort));
|
||||||
@ -266,7 +268,7 @@ public class AgentAuditController extends Handler {
|
|||||||
}
|
}
|
||||||
ModelAndView view = request(super.createView(mainagentuser));
|
ModelAndView view = request(super.createView(mainagentuser));
|
||||||
final User logined = super.getUser(request);
|
final User logined = super.getUser(request);
|
||||||
AgentUser agentUser = agentUserRepository.findById(id);
|
AgentUser agentUser = agentUserRepository.getReferenceById(id);
|
||||||
|
|
||||||
if (agentUser != null) {
|
if (agentUser != null) {
|
||||||
view.addObject("curagentuser", agentUser);
|
view.addObject("curagentuser", agentUser);
|
||||||
@ -277,12 +279,10 @@ public class AgentAuditController extends Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
view.addObject("inviteData", OnlineUserProxy.consult(agentUser.getAppid()));
|
view.addObject("inviteData", OnlineUserProxy.consult(agentUser.getAppid()));
|
||||||
List<AgentUserTask> agentUserTaskList = agentUserTaskRes.findById(id);
|
|
||||||
if (agentUserTaskList.size() > 0) {
|
AgentUserTask agentUserTask = agentUserTaskRes.getReferenceById(id);
|
||||||
AgentUserTask agentUserTask = agentUserTaskList.get(0);
|
agentUserTask.setTokenum(0);
|
||||||
agentUserTask.setTokenum(0);
|
agentUserTaskRes.save(agentUserTask);
|
||||||
agentUserTaskRes.save(agentUserTask);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(agentUser.getAgentserviceid())) {
|
if (StringUtils.isNotBlank(agentUser.getAgentserviceid())) {
|
||||||
List<AgentServiceSummary> summarizes = this.serviceSummaryRes.findByAgentserviceid(
|
List<AgentServiceSummary> summarizes = this.serviceSummaryRes.findByAgentserviceid(
|
||||||
@ -295,14 +295,12 @@ public class AgentAuditController extends Handler {
|
|||||||
view.addObject(
|
view.addObject(
|
||||||
"agentUserMessageList",
|
"agentUserMessageList",
|
||||||
this.chatMessageRepository.findByUsession(agentUser.getUserid(),
|
this.chatMessageRepository.findByUsession(agentUser.getUserid(),
|
||||||
new PageRequest(0, 20, Sort.Direction.DESC,
|
PageRequest.of(0, 20, Sort.Direction.DESC,"updatetime")
|
||||||
"updatetime"
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
AgentService agentService = null;
|
AgentService agentService = null;
|
||||||
if (StringUtils.isNotBlank(agentUser.getAgentserviceid())) {
|
if (StringUtils.isNotBlank(agentUser.getAgentserviceid())) {
|
||||||
agentService = this.agentServiceRes.findOne(agentUser.getAgentserviceid());
|
agentService = this.agentServiceRes.getReferenceById(agentUser.getAgentserviceid());
|
||||||
view.addObject("curAgentService", agentService);
|
view.addObject("curAgentService", agentService);
|
||||||
if (agentService != null) {
|
if (agentService != null) {
|
||||||
/**
|
/**
|
||||||
@ -312,7 +310,7 @@ public class AgentAuditController extends Handler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (MainContext.ChannelType.WEBIM.toString().equals(agentUser.getChanneltype())) {
|
if (MainContext.ChannelType.WEBIM.toString().equals(agentUser.getChanneltype())) {
|
||||||
PassportWebIMUser passportWebIMUser = onlineUserRes.findOne(agentUser.getUserid());
|
PassportWebIMUser passportWebIMUser = onlineUserRes.getReferenceById(agentUser.getUserid());
|
||||||
if (passportWebIMUser != null) {
|
if (passportWebIMUser != null) {
|
||||||
if (passportWebIMUser.getLogintime() != null) {
|
if (passportWebIMUser.getLogintime() != null) {
|
||||||
if (MainContext.OnlineUserStatusEnum.OFFLINE.toString().equals(passportWebIMUser.getStatus())) {
|
if (MainContext.OnlineUserStatusEnum.OFFLINE.toString().equals(passportWebIMUser.getStatus())) {
|
||||||
@ -333,7 +331,7 @@ public class AgentAuditController extends Handler {
|
|||||||
.toString()));
|
.toString()));
|
||||||
view.addObject("tagRelationList", tagRelationRes.findByUserid(agentUser.getUserid()));
|
view.addObject("tagRelationList", tagRelationRes.findByUserid(agentUser.getUserid()));
|
||||||
|
|
||||||
AgentService service = agentServiceRes.findById(agentUser.getAgentserviceid());
|
AgentService service = agentServiceRes.getReferenceById(agentUser.getAgentserviceid());
|
||||||
if (service != null) {
|
if (service != null) {
|
||||||
view.addObject("tags", tagRes.findByTagtypeAndSkill(MainContext.ModelType.USER.toString(), service.getSkill()));
|
view.addObject("tags", tagRes.findByTagtypeAndSkill(MainContext.ModelType.USER.toString(), service.getSkill()));
|
||||||
}
|
}
|
||||||
@ -370,7 +368,7 @@ public class AgentAuditController extends Handler {
|
|||||||
List<Organ> skillGroups = organRes.findByIdInAndSkill(ownOrgans.keySet(), true);
|
List<Organ> skillGroups = organRes.findByIdInAndSkill(ownOrgans.keySet(), true);
|
||||||
|
|
||||||
// 选择当前用户的默认技能组
|
// 选择当前用户的默认技能组
|
||||||
AgentService agentService = agentServiceRes.findById(agentserviceid);
|
AgentService agentService = agentServiceRes.getReferenceById(agentserviceid);
|
||||||
|
|
||||||
String currentOrgan = agentService.getSkill();
|
String currentOrgan = agentService.getSkill();
|
||||||
|
|
||||||
@ -390,7 +388,7 @@ public class AgentAuditController extends Handler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final List<User> userList = userRes.findAll(userids);
|
final List<User> userList = userRes.findAllById(userids);
|
||||||
for (final User o : userList) {
|
for (final User o : userList) {
|
||||||
o.setAgentStatus(agentStatusMap.get(o.getId()));
|
o.setAgentStatus(agentStatusMap.get(o.getId()));
|
||||||
// find user's skills
|
// find user's skills
|
||||||
@ -403,7 +401,7 @@ public class AgentAuditController extends Handler {
|
|||||||
map.addAttribute("agentuserid", agentuserid);
|
map.addAttribute("agentuserid", agentuserid);
|
||||||
map.addAttribute("agentno", agentnoid);
|
map.addAttribute("agentno", agentnoid);
|
||||||
map.addAttribute("skillGroups", skillGroups);
|
map.addAttribute("skillGroups", skillGroups);
|
||||||
map.addAttribute("agentservice", this.agentServiceRes.findById(agentserviceid));
|
map.addAttribute("agentservice", this.agentServiceRes.getReferenceById(agentserviceid));
|
||||||
map.addAttribute("currentorgan", currentOrgan);
|
map.addAttribute("currentorgan", currentOrgan);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -438,7 +436,7 @@ public class AgentAuditController extends Handler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final List<User> userList = userRes.findAll(userids);
|
final List<User> userList = userRes.findAllById(userids);
|
||||||
for (final User o : userList) {
|
for (final User o : userList) {
|
||||||
o.setAgentStatus(agentStatusMap.get(o.getId()));
|
o.setAgentStatus(agentStatusMap.get(o.getId()));
|
||||||
// find user's skills
|
// find user's skills
|
||||||
@ -478,8 +476,8 @@ public class AgentAuditController extends Handler {
|
|||||||
if (StringUtils.isNotBlank(userid) &&
|
if (StringUtils.isNotBlank(userid) &&
|
||||||
StringUtils.isNotBlank(agentuserid) &&
|
StringUtils.isNotBlank(agentuserid) &&
|
||||||
StringUtils.isNotBlank(agentno)) {
|
StringUtils.isNotBlank(agentno)) {
|
||||||
final User targetAgent = userRes.findOne(agentno);
|
final User targetAgent = userRes.getReferenceById(agentno);
|
||||||
final AgentService agentService = agentServiceRes.findById(agentserviceid);
|
final AgentService agentService = agentServiceRes.getReferenceById(agentserviceid);
|
||||||
/**
|
/**
|
||||||
* 更新AgentUser
|
* 更新AgentUser
|
||||||
*/
|
*/
|
||||||
@ -577,7 +575,7 @@ public class AgentAuditController extends Handler {
|
|||||||
public ModelAndView end(HttpServletRequest request, @Valid String id) {
|
public ModelAndView end(HttpServletRequest request, @Valid String id) {
|
||||||
final User logined = super.getUser(request);
|
final User logined = super.getUser(request);
|
||||||
|
|
||||||
final AgentUser agentUser = agentUserRes.findById(id);
|
final AgentUser agentUser = agentUserRes.getReferenceById(id);
|
||||||
|
|
||||||
if (agentUser != null) {
|
if (agentUser != null) {
|
||||||
if ((StringUtils.equals(
|
if ((StringUtils.equals(
|
||||||
@ -604,7 +602,7 @@ public class AgentAuditController extends Handler {
|
|||||||
map.addAttribute("agentuserid", agentuserid);
|
map.addAttribute("agentuserid", agentuserid);
|
||||||
map.addAttribute("agentserviceid", agentserviceid);
|
map.addAttribute("agentserviceid", agentserviceid);
|
||||||
map.addAttribute("userid", userid);
|
map.addAttribute("userid", userid);
|
||||||
map.addAttribute("agentUser", agentUserRes.findById(userid));
|
map.addAttribute("agentUser", agentUserRes.getReferenceById(userid));
|
||||||
return request(super.createView("/apps/cca/blacklistadd"));
|
return request(super.createView("/apps/cca/blacklistadd"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
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.context.annotation.Lazy;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.PageRequest;
|
import org.springframework.data.domain.PageRequest;
|
||||||
import org.springframework.data.domain.Sort;
|
import org.springframework.data.domain.Sort;
|
||||||
@ -59,9 +60,9 @@
|
|||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
@ -156,6 +157,7 @@
|
|||||||
private String webUploadPath;
|
private String webUploadPath;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@Lazy
|
||||||
private PeerSyncIM peerSyncIM;
|
private PeerSyncIM peerSyncIM;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -259,7 +261,7 @@
|
|||||||
User logined = super.getUser(request);
|
User logined = super.getUser(request);
|
||||||
view.addObject(
|
view.addObject(
|
||||||
"agentUserList", agentUserRes.findByAgentno(logined.getId(),
|
"agentUserList", agentUserRes.findByAgentno(logined.getId(),
|
||||||
new Sort(Direction.DESC, "status")));
|
Sort.by(Direction.DESC, "status")));
|
||||||
List<AgentUser> agentUserList = agentUserRes.findByUserid(userid);
|
List<AgentUser> agentUserList = agentUserRes.findByUserid(userid);
|
||||||
view.addObject(
|
view.addObject(
|
||||||
"curagentuser", agentUserList != null && agentUserList.size() > 0 ? agentUserList.get(0) : null);
|
"curagentuser", agentUserList != null && agentUserList.size() > 0 ? agentUserList.get(0) : null);
|
||||||
@ -277,7 +279,7 @@
|
|||||||
Integer current) throws IOException {
|
Integer current) throws IOException {
|
||||||
String mainagentuserconter = "/apps/agent/mainagentuserconter";
|
String mainagentuserconter = "/apps/agent/mainagentuserconter";
|
||||||
ModelAndView view = request(super.createView(mainagentuserconter));
|
ModelAndView view = request(super.createView(mainagentuserconter));
|
||||||
AgentUser agentUser = agentUserRes.findById(id);
|
AgentUser agentUser = agentUserRes.getReferenceById(id);
|
||||||
if (agentUser != null) {
|
if (agentUser != null) {
|
||||||
view.addObject("curagentuser", agentUser);
|
view.addObject("curagentuser", agentUser);
|
||||||
view.addObject(
|
view.addObject(
|
||||||
@ -294,7 +296,7 @@
|
|||||||
String iconid) throws IOException {
|
String iconid) throws IOException {
|
||||||
String mainagentuserconter = "/apps/agent/mainagentuserconter";
|
String mainagentuserconter = "/apps/agent/mainagentuserconter";
|
||||||
ModelAndView view = request(super.createView(mainagentuserconter));
|
ModelAndView view = request(super.createView(mainagentuserconter));
|
||||||
ChatMessage labelid = this.chatMessageRes.findById(iconid);
|
ChatMessage labelid = this.chatMessageRes.getReferenceById(iconid);
|
||||||
if (labelid != null) {
|
if (labelid != null) {
|
||||||
if (labelid.isIslabel() == false) {
|
if (labelid.isIslabel() == false) {
|
||||||
labelid.setIslabel(true);
|
labelid.setIslabel(true);
|
||||||
@ -317,16 +319,16 @@
|
|||||||
) throws IOException {
|
) throws IOException {
|
||||||
String mainagentuserconter = "/apps/agent/mainagentusersearch";
|
String mainagentuserconter = "/apps/agent/mainagentusersearch";
|
||||||
ModelAndView view = request(super.createView(mainagentuserconter));
|
ModelAndView view = request(super.createView(mainagentuserconter));
|
||||||
AgentUser agentUser = agentUserRes.findById(id);
|
AgentUser agentUser = agentUserRes.getReferenceById(id);
|
||||||
|
|
||||||
if (agentUser != null) {
|
if (agentUser != null) {
|
||||||
Page<ChatMessage> agentUserMessageList = null;
|
Page<ChatMessage> agentUserMessageList = null;
|
||||||
if (condition.equals("label")) {
|
if (condition.equals("label")) {
|
||||||
agentUserMessageList = this.chatMessageRes.findByislabel(
|
agentUserMessageList = this.chatMessageRes.findByislabel(
|
||||||
agentUser.getUserid(), search, new PageRequest(0, 9999, Direction.DESC, "updatetime"));
|
agentUser.getUserid(), search, PageRequest.of(0, 9999, Direction.DESC, "updatetime"));
|
||||||
} else {
|
} else {
|
||||||
agentUserMessageList = this.chatMessageRes.findByUsessionAndMessageContaining(
|
agentUserMessageList = this.chatMessageRes.findByUsessionAndMessageContaining(
|
||||||
agentUser.getUserid(), search, new PageRequest(0, 9999, Direction.DESC, "updatetime"));
|
agentUser.getUserid(), search, PageRequest.of(0, 9999, Direction.DESC, "updatetime"));
|
||||||
}
|
}
|
||||||
view.addObject("agentUserMessageList", agentUserMessageList);
|
view.addObject("agentUserMessageList", agentUserMessageList);
|
||||||
}
|
}
|
||||||
@ -344,7 +346,7 @@
|
|||||||
String thisid) throws IOException, ParseException {
|
String thisid) throws IOException, ParseException {
|
||||||
String mainagentuserconter = "/apps/agent/mainagentuserconter";
|
String mainagentuserconter = "/apps/agent/mainagentuserconter";
|
||||||
ModelAndView view = request(super.createView(mainagentuserconter));
|
ModelAndView view = request(super.createView(mainagentuserconter));
|
||||||
AgentUser agentUser = agentUserRes.findById(id);
|
AgentUser agentUser = agentUserRes.getReferenceById(id);
|
||||||
if (agentUser != null) {
|
if (agentUser != null) {
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
Date date = formatter.parse(createtime);
|
Date date = formatter.parse(createtime);
|
||||||
@ -381,7 +383,7 @@
|
|||||||
|
|
||||||
ModelAndView view = request(super.createView(mainagentuser));
|
ModelAndView view = request(super.createView(mainagentuser));
|
||||||
final User logined = super.getUser(request);
|
final User logined = super.getUser(request);
|
||||||
AgentUser agentUser = agentUserRes.findById(id);
|
AgentUser agentUser = agentUserRes.getReferenceById(id);
|
||||||
|
|
||||||
if (agentUser != null) {
|
if (agentUser != null) {
|
||||||
view.addObject("curagentuser", agentUser);
|
view.addObject("curagentuser", agentUser);
|
||||||
@ -392,12 +394,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
view.addObject("inviteData", OnlineUserProxy.consult(agentUser.getAppid()));
|
view.addObject("inviteData", OnlineUserProxy.consult(agentUser.getAppid()));
|
||||||
List<AgentUserTask> agentUserTaskList = agentUserTaskRes.findById(id);
|
AgentUserTask agentUserTask = agentUserTaskRes.getReferenceById(id);
|
||||||
if (agentUserTaskList.size() > 0) {
|
agentUserTask.setTokenum(0);
|
||||||
AgentUserTask agentUserTask = agentUserTaskList.get(0);
|
agentUserTaskRes.save(agentUserTask);
|
||||||
agentUserTask.setTokenum(0);
|
|
||||||
agentUserTaskRes.save(agentUserTask);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(agentUser.getAgentserviceid())) {
|
if (StringUtils.isNotBlank(agentUser.getAgentserviceid())) {
|
||||||
List<AgentServiceSummary> summarizes = this.serviceSummaryRes.findByAgentserviceid(
|
List<AgentServiceSummary> summarizes = this.serviceSummaryRes.findByAgentserviceid(
|
||||||
@ -410,11 +409,11 @@
|
|||||||
view.addObject(
|
view.addObject(
|
||||||
"agentUserMessageList",
|
"agentUserMessageList",
|
||||||
this.chatMessageRes.findByUsession(agentUser.getUserid(),
|
this.chatMessageRes.findByUsession(agentUser.getUserid(),
|
||||||
new PageRequest(0, 20, Direction.DESC,
|
PageRequest.of(0, 20, Direction.DESC,
|
||||||
"updatetime")));
|
"updatetime")));
|
||||||
AgentService agentService = null;
|
AgentService agentService = null;
|
||||||
if (StringUtils.isNotBlank(agentUser.getAgentserviceid())) {
|
if (StringUtils.isNotBlank(agentUser.getAgentserviceid())) {
|
||||||
agentService = this.agentServiceRes.findOne(agentUser.getAgentserviceid());
|
agentService = this.agentServiceRes.getReferenceById(agentUser.getAgentserviceid());
|
||||||
view.addObject("curAgentService", agentService);
|
view.addObject("curAgentService", agentService);
|
||||||
if (agentService != null) {
|
if (agentService != null) {
|
||||||
/**
|
/**
|
||||||
@ -430,7 +429,7 @@
|
|||||||
view.addObject("weiXinUser", passportWechatUser);
|
view.addObject("weiXinUser", passportWechatUser);
|
||||||
}
|
}
|
||||||
} else if (MainContext.ChannelType.WEBIM.toString().equals(agentUser.getChanneltype())) {
|
} else if (MainContext.ChannelType.WEBIM.toString().equals(agentUser.getChanneltype())) {
|
||||||
PassportWebIMUser passportWebIMUser = onlineUserRes.findOne(agentUser.getUserid());
|
PassportWebIMUser passportWebIMUser = onlineUserRes.getReferenceById(agentUser.getUserid());
|
||||||
if (passportWebIMUser != null) {
|
if (passportWebIMUser != null) {
|
||||||
if (passportWebIMUser.getLogintime() != null) {
|
if (passportWebIMUser.getLogintime() != null) {
|
||||||
if (MainContext.OnlineUserStatusEnum.OFFLINE.toString().equals(passportWebIMUser.getStatus())) {
|
if (MainContext.OnlineUserStatusEnum.OFFLINE.toString().equals(passportWebIMUser.getStatus())) {
|
||||||
@ -445,12 +444,10 @@
|
|||||||
}
|
}
|
||||||
} else if (MainContext.ChannelType.PHONE.toString().equals(agentUser.getChanneltype())) {
|
} else if (MainContext.ChannelType.PHONE.toString().equals(agentUser.getChanneltype())) {
|
||||||
if (agentService != null && StringUtils.isNotBlank(agentService.getOwner())) {
|
if (agentService != null && StringUtils.isNotBlank(agentService.getOwner())) {
|
||||||
StatusEvent statusEvent = this.statusEventRes.findById(agentService.getOwner());
|
StatusEvent statusEvent = this.statusEventRes.getReferenceById(agentService.getOwner());
|
||||||
if (statusEvent != null) {
|
if (statusEvent != null) {
|
||||||
if (StringUtils.isNotBlank(statusEvent.getHostid())) {
|
if (StringUtils.isNotBlank(statusEvent.getHostid())) {
|
||||||
pbxHostRes.findById(statusEvent.getHostid()).ifPresent(p -> {
|
view.addObject("pbxHost", pbxHostRes.getReferenceById(statusEvent.getHostid()));
|
||||||
view.addObject("pbxHost", p);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
view.addObject("statusEvent", statusEvent);
|
view.addObject("statusEvent", statusEvent);
|
||||||
}
|
}
|
||||||
@ -465,7 +462,7 @@
|
|||||||
view.addObject("tagRelationList", tagRelationRes.findByUserid(agentUser.getUserid()));
|
view.addObject("tagRelationList", tagRelationRes.findByUserid(agentUser.getUserid()));
|
||||||
}
|
}
|
||||||
|
|
||||||
AgentService service = agentServiceRes.findById(agentUser.getAgentserviceid());
|
AgentService service = agentServiceRes.getReferenceById(agentUser.getAgentserviceid());
|
||||||
if (service != null) {
|
if (service != null) {
|
||||||
view.addObject("tags", tagRes.findByTagtypeAndSkill(MainContext.ModelType.USER.toString(), service.getSkill()));
|
view.addObject("tags", tagRes.findByTagtypeAndSkill(MainContext.ModelType.USER.toString(), service.getSkill()));
|
||||||
}
|
}
|
||||||
@ -641,14 +638,14 @@
|
|||||||
for (AgentUser agentUser : agentUserList) {
|
for (AgentUser agentUser : agentUserList) {
|
||||||
if (agentUser != null && super.getUser(request).getId().equals(agentUser.getAgentno())) {
|
if (agentUser != null && super.getUser(request).getId().equals(agentUser.getAgentno())) {
|
||||||
acdAgentService.finishAgentUser(agentUser);
|
acdAgentService.finishAgentUser(agentUser);
|
||||||
AgentService agentService = agentServiceRes.findById(agentUser.getAgentserviceid());
|
AgentService agentService = agentServiceRes.getReferenceById(agentUser.getAgentserviceid());
|
||||||
if (agentService != null) {
|
if (agentService != null) {
|
||||||
agentService.setStatus(MainContext.AgentUserStatusEnum.END.toString());
|
agentService.setStatus(MainContext.AgentUserStatusEnum.END.toString());
|
||||||
agentServiceList.add(agentService);
|
agentServiceList.add(agentService);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
agentServiceRes.save(agentServiceList);
|
agentServiceRes.saveAll(agentServiceList);
|
||||||
return request(super
|
return request(super
|
||||||
.createView("redirect:/agent/index.html"));
|
.createView("redirect:/agent/index.html"));
|
||||||
}
|
}
|
||||||
@ -669,7 +666,7 @@
|
|||||||
logger.info("[end] end id {}", id);
|
logger.info("[end] end id {}", id);
|
||||||
final User logined = super.getUser(request);
|
final User logined = super.getUser(request);
|
||||||
|
|
||||||
final AgentUser agentUser = agentUserRes.findById(id);
|
final AgentUser agentUser = agentUserRes.getReferenceById(id);
|
||||||
|
|
||||||
if (agentUser != null) {
|
if (agentUser != null) {
|
||||||
if ((StringUtils.equals(
|
if ((StringUtils.equals(
|
||||||
@ -693,12 +690,10 @@
|
|||||||
@RequestMapping({"/readmsg"})
|
@RequestMapping({"/readmsg"})
|
||||||
@Menu(type = "apps", subtype = "agent")
|
@Menu(type = "apps", subtype = "agent")
|
||||||
public ModelAndView readmsg(HttpServletRequest request, @Valid String userid) {
|
public ModelAndView readmsg(HttpServletRequest request, @Valid String userid) {
|
||||||
List<AgentUserTask> agentUserTaskList = agentUserTaskRes.findById(userid);
|
|
||||||
if (agentUserTaskList.size() > 0) {
|
AgentUserTask agentUserTask = agentUserTaskRes.getReferenceById(userid);
|
||||||
AgentUserTask agentUserTask = agentUserTaskList.get(0);
|
agentUserTask.setTokenum(0);
|
||||||
agentUserTask.setTokenum(0);
|
agentUserTaskRes.save(agentUserTask);
|
||||||
agentUserTaskRes.save(agentUserTask);
|
|
||||||
}
|
|
||||||
return request(super.createView("/public/success"));
|
return request(super.createView("/public/success"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -709,7 +704,7 @@
|
|||||||
map.addAttribute("agentuserid", agentuserid);
|
map.addAttribute("agentuserid", agentuserid);
|
||||||
map.addAttribute("agentserviceid", agentserviceid);
|
map.addAttribute("agentserviceid", agentserviceid);
|
||||||
map.addAttribute("userid", userid);
|
map.addAttribute("userid", userid);
|
||||||
map.addAttribute("agentUser", agentUserRes.findById(userid));
|
map.addAttribute("agentUser", agentUserRes.getReferenceById(userid));
|
||||||
return request(super.createView("/apps/agent/blacklistadd"));
|
return request(super.createView("/apps/agent/blacklistadd"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -788,7 +783,7 @@
|
|||||||
|
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
HttpHeaders headers = RestUtils.header();
|
HttpHeaders headers = RestUtils.header();
|
||||||
final AgentUser agentUser = agentUserRes.findById(id);
|
final AgentUser agentUser = agentUserRes.getReferenceById(id);
|
||||||
|
|
||||||
if (multipart != null && multipart.getOriginalFilename().lastIndexOf(".") > 0) {
|
if (multipart != null && multipart.getOriginalFilename().lastIndexOf(".") > 0) {
|
||||||
try {
|
try {
|
||||||
@ -813,7 +808,7 @@
|
|||||||
@RequestMapping("/message/image")
|
@RequestMapping("/message/image")
|
||||||
@Menu(type = "resouce", subtype = "image", access = true)
|
@Menu(type = "resouce", subtype = "image", access = true)
|
||||||
public ModelAndView messageimage(HttpServletResponse response, ModelMap map, @Valid String id, @Valid String t) throws IOException {
|
public ModelAndView messageimage(HttpServletResponse response, ModelMap map, @Valid String id, @Valid String t) throws IOException {
|
||||||
ChatMessage message = chatMessageRes.findById(id);
|
ChatMessage message = chatMessageRes.getReferenceById(id);
|
||||||
map.addAttribute("chatMessage", message);
|
map.addAttribute("chatMessage", message);
|
||||||
map.addAttribute("agentUser", cache.findOneAgentUserByUserId(message.getUserid()));
|
map.addAttribute("agentUser", cache.findOneAgentUserByUserId(message.getUserid()));
|
||||||
/*if(StringUtils.isNotBlank(t)){
|
/*if(StringUtils.isNotBlank(t)){
|
||||||
@ -842,7 +837,7 @@
|
|||||||
}
|
}
|
||||||
// 写入临时文件
|
// 写入临时文件
|
||||||
FileCopyUtils.copy(image.getBytes(), tempFile);
|
FileCopyUtils.copy(image.getBytes(), tempFile);
|
||||||
ChatMessage chatMessage = chatMessageRes.findById(id);
|
ChatMessage chatMessage = chatMessageRes.getReferenceById(id);
|
||||||
chatMessage.setCooperation(true);
|
chatMessage.setCooperation(true);
|
||||||
chatMessageRes.save(chatMessage);
|
chatMessageRes.save(chatMessage);
|
||||||
|
|
||||||
@ -852,7 +847,7 @@
|
|||||||
MainUtils.scaleImage(imageFile, tempFile, 0.1F);
|
MainUtils.scaleImage(imageFile, tempFile, 0.1F);
|
||||||
|
|
||||||
// 保存到数据库
|
// 保存到数据库
|
||||||
StreamingFile sf = streamingFileRes.findOne(fileid);
|
StreamingFile sf = streamingFileRes.getReferenceById(fileid);
|
||||||
if (sf != null) {
|
if (sf != null) {
|
||||||
sf.setCooperation(jpaBlobHelper.createBlobWithFile(imageFile));
|
sf.setCooperation(jpaBlobHelper.createBlobWithFile(imageFile));
|
||||||
streamingFileRes.save(sf);
|
streamingFileRes.save(sf);
|
||||||
@ -920,7 +915,7 @@
|
|||||||
/**
|
/**
|
||||||
* 获得联系人
|
* 获得联系人
|
||||||
*/
|
*/
|
||||||
Contacts contacts = contactsRes.findOne(contactsid);
|
Contacts contacts = contactsRes.getReferenceById(contactsid);
|
||||||
if (contacts != null) {
|
if (contacts != null) {
|
||||||
map.addAttribute("contacts", contacts);
|
map.addAttribute("contacts", contacts);
|
||||||
}
|
}
|
||||||
@ -928,7 +923,7 @@
|
|||||||
/**
|
/**
|
||||||
* 在关联联系人后,更新AgentUser的显示的名字
|
* 在关联联系人后,更新AgentUser的显示的名字
|
||||||
*/
|
*/
|
||||||
AgentUser agentUser = agentUserRes.findById(agentuserid);
|
AgentUser agentUser = agentUserRes.getReferenceById(agentuserid);
|
||||||
if (agentUser != null) {
|
if (agentUser != null) {
|
||||||
agentUser.setUsername(contacts.getName());
|
agentUser.setUsername(contacts.getName());
|
||||||
agentUser.setNickname(contacts.getName());
|
agentUser.setNickname(contacts.getName());
|
||||||
@ -946,7 +941,7 @@
|
|||||||
onlineUserRes.save(passportWebIMUser);
|
onlineUserRes.save(passportWebIMUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
AgentService agentService = agentServiceRes.findOne(agentserviceid);
|
AgentService agentService = agentServiceRes.getReferenceById(agentserviceid);
|
||||||
if (agentService != null) {
|
if (agentService != null) {
|
||||||
agentService.setContactsid(contactsid);
|
agentService.setContactsid(contactsid);
|
||||||
agentService.setUsername(contacts.getName());
|
agentService.setUsername(contacts.getName());
|
||||||
@ -978,7 +973,7 @@
|
|||||||
public ModelAndView cleanAssociated(ModelMap map, HttpServletRequest request, final @RequestParam String currentAgentUserContactsId) {
|
public ModelAndView cleanAssociated(ModelMap map, HttpServletRequest request, final @RequestParam String currentAgentUserContactsId) {
|
||||||
String contactsid = null;
|
String contactsid = null;
|
||||||
if (StringUtils.isNotEmpty(currentAgentUserContactsId)) {
|
if (StringUtils.isNotEmpty(currentAgentUserContactsId)) {
|
||||||
AgentUserContacts agentUserContacts = agentUserContactsRes.getOne(currentAgentUserContactsId);
|
AgentUserContacts agentUserContacts = agentUserContactsRes.getReferenceById(currentAgentUserContactsId);
|
||||||
if (agentUserContacts != null) {
|
if (agentUserContacts != null) {
|
||||||
agentUserContactsRes.delete(agentUserContacts);
|
agentUserContactsRes.delete(agentUserContacts);
|
||||||
}
|
}
|
||||||
@ -991,7 +986,7 @@
|
|||||||
@RequestMapping(value = "/evaluation")
|
@RequestMapping(value = "/evaluation")
|
||||||
@Menu(type = "apps", subtype = "evaluation")
|
@Menu(type = "apps", subtype = "evaluation")
|
||||||
public String evaluation(HttpServletRequest request, @Valid String agentuserid) {
|
public String evaluation(HttpServletRequest request, @Valid String agentuserid) {
|
||||||
AgentUser agentUser = agentUserRes.findById(agentuserid);
|
AgentUser agentUser = agentUserRes.getReferenceById(agentuserid);
|
||||||
|
|
||||||
Message outMessage = new Message();
|
Message outMessage = new Message();
|
||||||
outMessage.setChannelMessage(agentUser);
|
outMessage.setChannelMessage(agentUser);
|
||||||
@ -1019,7 +1014,7 @@
|
|||||||
@Valid String agentuserid,
|
@Valid String agentuserid,
|
||||||
@Valid String channel) {
|
@Valid String channel) {
|
||||||
if (StringUtils.isNotBlank(userid) && StringUtils.isNotBlank(agentuserid)) {
|
if (StringUtils.isNotBlank(userid) && StringUtils.isNotBlank(agentuserid)) {
|
||||||
AgentUser agentUser = this.agentUserRes.findById(agentuserid);
|
AgentUser agentUser = this.agentUserRes.getReferenceById(agentuserid);
|
||||||
if (agentUser != null && StringUtils.isNotBlank(agentUser.getAgentserviceid())) {
|
if (agentUser != null && StringUtils.isNotBlank(agentUser.getAgentserviceid())) {
|
||||||
List<AgentServiceSummary> summaries = this.serviceSummaryRes.findByAgentserviceid(
|
List<AgentServiceSummary> summaries = this.serviceSummaryRes.findByAgentserviceid(
|
||||||
agentUser.getAgentserviceid());
|
agentUser.getAgentserviceid());
|
||||||
@ -1027,7 +1022,7 @@
|
|||||||
map.addAttribute("summary", summaries.get(0));
|
map.addAttribute("summary", summaries.get(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AgentService service = agentServiceRes.findById(agentserviceid);
|
AgentService service = agentServiceRes.getReferenceById(agentserviceid);
|
||||||
if (service != null) {
|
if (service != null) {
|
||||||
map.addAttribute(
|
map.addAttribute(
|
||||||
"tags", tagRes.findByTagtypeAndSkill(
|
"tags", tagRes.findByTagtypeAndSkill(
|
||||||
@ -1055,7 +1050,7 @@
|
|||||||
if (StringUtils.isNotBlank(userid) && StringUtils.isNotBlank(agentuserid)) {
|
if (StringUtils.isNotBlank(userid) && StringUtils.isNotBlank(agentuserid)) {
|
||||||
summary.setCreater(super.getUser(request).getId());
|
summary.setCreater(super.getUser(request).getId());
|
||||||
summary.setCreatetime(new Date());
|
summary.setCreatetime(new Date());
|
||||||
AgentService service = agentServiceRes.findById(agentserviceid);
|
AgentService service = agentServiceRes.getReferenceById(agentserviceid);
|
||||||
summary.setAgent(service.getAgentno());
|
summary.setAgent(service.getAgentno());
|
||||||
summary.setAgentno(service.getAgentno());
|
summary.setAgentno(service.getAgentno());
|
||||||
summary.setSkill(service.getSkill());
|
summary.setSkill(service.getSkill());
|
||||||
@ -1103,7 +1098,7 @@
|
|||||||
List<Organ> skillGroups = organRes.findByIdInAndSkill(ownOrgans.keySet(), true);
|
List<Organ> skillGroups = organRes.findByIdInAndSkill(ownOrgans.keySet(), true);
|
||||||
|
|
||||||
// 选择当前用户的默认技能组
|
// 选择当前用户的默认技能组
|
||||||
AgentService agentService = agentServiceRes.findById(agentserviceid);
|
AgentService agentService = agentServiceRes.getReferenceById(agentserviceid);
|
||||||
|
|
||||||
String currentOrgan = agentService.getSkill();
|
String currentOrgan = agentService.getSkill();
|
||||||
|
|
||||||
@ -1125,7 +1120,7 @@
|
|||||||
|
|
||||||
logger.info("[transfer] get all userids except mine, {}", StringUtils.join(userids, "\t"));
|
logger.info("[transfer] get all userids except mine, {}", StringUtils.join(userids, "\t"));
|
||||||
|
|
||||||
final List<User> userList = userRes.findAll(userids);
|
final List<User> userList = userRes.findAllById(userids);
|
||||||
for (final User o : userList) {
|
for (final User o : userList) {
|
||||||
o.setAgentStatus(agentStatusMap.get(o.getId()));
|
o.setAgentStatus(agentStatusMap.get(o.getId()));
|
||||||
// find user's skills
|
// find user's skills
|
||||||
@ -1138,7 +1133,7 @@
|
|||||||
map.addAttribute("agentuserid", agentuserid);
|
map.addAttribute("agentuserid", agentuserid);
|
||||||
map.addAttribute("skillGroups", skillGroups);
|
map.addAttribute("skillGroups", skillGroups);
|
||||||
map.addAttribute("agentno", agentService.getAgentno());
|
map.addAttribute("agentno", agentService.getAgentno());
|
||||||
map.addAttribute("agentservice", this.agentServiceRes.findById(agentserviceid));
|
map.addAttribute("agentservice", this.agentServiceRes.getReferenceById(agentserviceid));
|
||||||
map.addAttribute("currentorgan", currentOrgan);
|
map.addAttribute("currentorgan", currentOrgan);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1172,7 +1167,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final List<User> userList = userRes.findAll(userids);
|
final List<User> userList = userRes.findAllById(userids);
|
||||||
for (final User o : userList) {
|
for (final User o : userList) {
|
||||||
o.setAgentStatus(agentStatusMap.get(o.getId()));
|
o.setAgentStatus(agentStatusMap.get(o.getId()));
|
||||||
// find user's skills
|
// find user's skills
|
||||||
@ -1200,7 +1195,7 @@
|
|||||||
@RequestParam(value = "agentuser") String agentuser,
|
@RequestParam(value = "agentuser") String agentuser,
|
||||||
@Valid Contacts contacts) throws CSKefuException {
|
@Valid Contacts contacts) throws CSKefuException {
|
||||||
logger.info("[agent ctrl] calloutcontactsave agentuser [{}]", agentuser);
|
logger.info("[agent ctrl] calloutcontactsave agentuser [{}]", agentuser);
|
||||||
AgentUser au = agentUserRes.findOne(agentuser);
|
AgentUser au = agentUserRes.getReferenceById(agentuser);
|
||||||
if (au == null) {
|
if (au == null) {
|
||||||
throw new CSKefuException("不存在该服务记录");
|
throw new CSKefuException("不存在该服务记录");
|
||||||
}
|
}
|
||||||
@ -1230,7 +1225,7 @@
|
|||||||
@RequestMapping("/calloutcontact/update")
|
@RequestMapping("/calloutcontact/update")
|
||||||
@Menu(type = "apps", subtype = "calloutcontact")
|
@Menu(type = "apps", subtype = "calloutcontact")
|
||||||
public ModelAndView update(HttpServletRequest request, @Valid Contacts contacts) {
|
public ModelAndView update(HttpServletRequest request, @Valid Contacts contacts) {
|
||||||
Contacts data = contactsRes.findOne(contacts.getId());
|
Contacts data = contactsRes.getReferenceById(contacts.getId());
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
List<PropertiesEvent> events = PropertiesEventUtil.processPropertiesModify(
|
List<PropertiesEvent> events = PropertiesEventUtil.processPropertiesModify(
|
||||||
request, contacts, data, "id", "creater", "createtime", "updatetime"); //记录 数据变更 历史
|
request, contacts, data, "id", "creater", "createtime", "updatetime"); //记录 数据变更 历史
|
||||||
|
@ -40,8 +40,8 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -150,7 +150,7 @@ public class AgentSettingsController extends Handler {
|
|||||||
Organ currentOrgan = super.getOrgan(request);
|
Organ currentOrgan = super.getOrgan(request);
|
||||||
Map<String, Organ> organs = organProxy.findAllOrganByParent(currentOrgan);
|
Map<String, Organ> organs = organProxy.findAllOrganByParent(currentOrgan);
|
||||||
|
|
||||||
Page<BlackEntity> blackList = blackListRes.findBySkillIn(organs.keySet(), new PageRequest(super.getP(request), super.getPs(request), Sort.Direction.DESC, "endtime"));
|
Page<BlackEntity> blackList = blackListRes.findBySkillIn(organs.keySet(), PageRequest.of(super.getP(request), super.getPs(request), Sort.Direction.DESC, "endtime"));
|
||||||
|
|
||||||
|
|
||||||
map.put("blackList", blackList);
|
map.put("blackList", blackList);
|
||||||
@ -162,7 +162,7 @@ public class AgentSettingsController extends Handler {
|
|||||||
@Menu(type = "setting", subtype = "tag")
|
@Menu(type = "setting", subtype = "tag")
|
||||||
public ModelAndView blacklistdelete(ModelMap map, HttpServletRequest request, @Valid String id) {
|
public ModelAndView blacklistdelete(ModelMap map, HttpServletRequest request, @Valid String id) {
|
||||||
if (!StringUtils.isBlank(id)) {
|
if (!StringUtils.isBlank(id)) {
|
||||||
BlackEntity tempBlackEntity = blackListRes.findById(id);
|
BlackEntity tempBlackEntity = blackListRes.getReferenceById(id);
|
||||||
if (tempBlackEntity != null) {
|
if (tempBlackEntity != null) {
|
||||||
blackListRes.delete(tempBlackEntity);
|
blackListRes.delete(tempBlackEntity);
|
||||||
cache.deleteSystembyId(tempBlackEntity.getUserid());
|
cache.deleteSystembyId(tempBlackEntity.getUserid());
|
||||||
@ -192,7 +192,7 @@ public class AgentSettingsController extends Handler {
|
|||||||
map.put("tagType", tagType);
|
map.put("tagType", tagType);
|
||||||
}
|
}
|
||||||
if (tagType != null && currentOrgan != null) {
|
if (tagType != null && currentOrgan != null) {
|
||||||
map.put("tagList", tagRes.findByTagtypeAndSkill(tagType.getCode(), currentOrgan.getId(), new PageRequest(super.getP(request), super.getPs(request))));
|
map.put("tagList", tagRes.findByTagtypeAndSkill(tagType.getCode(), currentOrgan.getId(), PageRequest.of(super.getP(request), super.getPs(request))));
|
||||||
}
|
}
|
||||||
map.put("tagTypeList", tagList);
|
map.put("tagTypeList", tagList);
|
||||||
return request(super.createView("/apps/setting/agent/tag"));
|
return request(super.createView("/apps/setting/agent/tag"));
|
||||||
@ -208,7 +208,7 @@ public class AgentSettingsController extends Handler {
|
|||||||
@RequestMapping("/tag/edit")
|
@RequestMapping("/tag/edit")
|
||||||
@Menu(type = "setting", subtype = "tag")
|
@Menu(type = "setting", subtype = "tag")
|
||||||
public ModelAndView tagedit(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String tagtype) {
|
public ModelAndView tagedit(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String tagtype) {
|
||||||
map.put("tag", tagRes.findOne(id));
|
map.put("tag", tagRes.getReferenceById(id));
|
||||||
map.addAttribute("tagtype", tagtype);
|
map.addAttribute("tagtype", tagtype);
|
||||||
return request(super.createView("/apps/setting/agent/tagedit"));
|
return request(super.createView("/apps/setting/agent/tagedit"));
|
||||||
}
|
}
|
||||||
@ -247,7 +247,7 @@ public class AgentSettingsController extends Handler {
|
|||||||
@RequestMapping("/tag/delete")
|
@RequestMapping("/tag/delete")
|
||||||
@Menu(type = "setting", subtype = "tag")
|
@Menu(type = "setting", subtype = "tag")
|
||||||
public ModelAndView tagdelete(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String tagtype) {
|
public ModelAndView tagdelete(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String tagtype) {
|
||||||
tagRes.delete(id);
|
tagRes.deleteById(id);
|
||||||
return request(super.createView("redirect:/setting/tag.html?code=" + tagtype));
|
return request(super.createView("redirect:/setting/tag.html?code=" + tagtype));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,7 +324,7 @@ public class AgentSettingsController extends Handler {
|
|||||||
@Menu(type = "setting", subtype = "adv")
|
@Menu(type = "setting", subtype = "adv")
|
||||||
public ModelAndView advedit(ModelMap map, HttpServletRequest request, @Valid String adpos, @Valid String id) {
|
public ModelAndView advedit(ModelMap map, HttpServletRequest request, @Valid String adpos, @Valid String id) {
|
||||||
map.addAttribute("adpos", adpos);
|
map.addAttribute("adpos", adpos);
|
||||||
map.put("ad", adTypeRes.findById(id));
|
map.put("ad", adTypeRes.getReferenceById(id));
|
||||||
return request(super.createView("/apps/setting/agent/adedit"));
|
return request(super.createView("/apps/setting/agent/adedit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -358,9 +358,9 @@ public class AgentSettingsController extends Handler {
|
|||||||
@RequestMapping("/adv/delete")
|
@RequestMapping("/adv/delete")
|
||||||
@Menu(type = "setting", subtype = "adv")
|
@Menu(type = "setting", subtype = "adv")
|
||||||
public ModelAndView advdelete(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String adpos) {
|
public ModelAndView advdelete(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String adpos) {
|
||||||
AdType adType = adTypeRes.findById(id);
|
AdType adType = adTypeRes.getReferenceById(id);
|
||||||
if (adType != null) {
|
if (adType != null) {
|
||||||
adTypeRes.delete(id);
|
adTypeRes.deleteById(id);
|
||||||
MainUtils.initAdv(adType.getSkill());
|
MainUtils.initAdv(adType.getSkill());
|
||||||
}
|
}
|
||||||
return request(super.createView("redirect:/setting/adv.html?adpos=" + adpos));
|
return request(super.createView("redirect:/setting/adv.html?adpos=" + adpos));
|
||||||
|
@ -38,8 +38,8 @@ import org.springframework.ui.ModelMap;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -96,7 +96,7 @@ public class AppsController extends Handler {
|
|||||||
final Page<PassportWebIMUser> onlineUserList = onlineUserRes.findByStatusAndAppidIn(
|
final Page<PassportWebIMUser> onlineUserList = onlineUserRes.findByStatusAndAppidIn(
|
||||||
MainContext.OnlineUserStatusEnum.ONLINE.toString(),
|
MainContext.OnlineUserStatusEnum.ONLINE.toString(),
|
||||||
appids,
|
appids,
|
||||||
new PageRequest(
|
PageRequest.of(
|
||||||
super.getP(request),
|
super.getP(request),
|
||||||
super.getPs(request),
|
super.getPs(request),
|
||||||
Sort.Direction.DESC,
|
Sort.Direction.DESC,
|
||||||
@ -122,7 +122,7 @@ public class AppsController extends Handler {
|
|||||||
* 获得在线访客与联系人的关联信息
|
* 获得在线访客与联系人的关联信息
|
||||||
*/
|
*/
|
||||||
if (contactIds.size() > 0) {
|
if (contactIds.size() > 0) {
|
||||||
final Iterable<Contacts> contacts = contactsRes.findAll(contactIds);
|
final Iterable<Contacts> contacts = contactsRes.findAllById(contactIds);
|
||||||
for (final PassportWebIMUser passportWebIMUser : onlineUserList.getContent()) {
|
for (final PassportWebIMUser passportWebIMUser : onlineUserList.getContent()) {
|
||||||
if (StringUtils.isNotBlank(passportWebIMUser.getContactsid())) {
|
if (StringUtils.isNotBlank(passportWebIMUser.getContactsid())) {
|
||||||
for (final Contacts contact : contacts) {
|
for (final Contacts contact : contacts) {
|
||||||
@ -206,7 +206,7 @@ public class AppsController extends Handler {
|
|||||||
@Menu(type = "apps", subtype = "onlineuser")
|
@Menu(type = "apps", subtype = "onlineuser")
|
||||||
public ModelAndView onlineuser(ModelMap map, HttpServletRequest request) {
|
public ModelAndView onlineuser(ModelMap map, HttpServletRequest request) {
|
||||||
Page<PassportWebIMUser> onlineUserList = this.onlineUserRes.findByStatus(MainContext.OnlineUserStatusEnum.ONLINE.toString(),
|
Page<PassportWebIMUser> onlineUserList = this.onlineUserRes.findByStatus(MainContext.OnlineUserStatusEnum.ONLINE.toString(),
|
||||||
new PageRequest(super.getP(request), super.getPs(request), Sort.Direction.DESC, "createtime"));
|
PageRequest.of(super.getP(request), super.getPs(request), Sort.Direction.DESC, "createtime"));
|
||||||
List<String> ids = new ArrayList<>();
|
List<String> ids = new ArrayList<>();
|
||||||
for (PassportWebIMUser passportWebIMUser : onlineUserList.getContent()) {
|
for (PassportWebIMUser passportWebIMUser : onlineUserList.getContent()) {
|
||||||
passportWebIMUser.setBetweentime((int) (System.currentTimeMillis() - passportWebIMUser.getLogintime().getTime()));
|
passportWebIMUser.setBetweentime((int) (System.currentTimeMillis() - passportWebIMUser.getLogintime().getTime()));
|
||||||
@ -215,7 +215,7 @@ public class AppsController extends Handler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ids.size() > 0) {
|
if (ids.size() > 0) {
|
||||||
Iterable<Contacts> contactsList = contactsRes.findAll(ids);
|
Iterable<Contacts> contactsList = contactsRes.findAllById(ids);
|
||||||
for (PassportWebIMUser passportWebIMUser : onlineUserList.getContent()) {
|
for (PassportWebIMUser passportWebIMUser : onlineUserList.getContent()) {
|
||||||
if (StringUtils.isNotBlank(passportWebIMUser.getContactsid())) {
|
if (StringUtils.isNotBlank(passportWebIMUser.getContactsid())) {
|
||||||
for (Contacts contacts : contactsList) {
|
for (Contacts contacts : contactsList) {
|
||||||
@ -243,7 +243,7 @@ public class AppsController extends Handler {
|
|||||||
@RequestMapping({"/apps/profile/save"})
|
@RequestMapping({"/apps/profile/save"})
|
||||||
@Menu(type = "apps", subtype = "content")
|
@Menu(type = "apps", subtype = "content")
|
||||||
public ModelAndView profile(ModelMap map, HttpServletRequest request, @Valid User user, @Valid String index) {
|
public ModelAndView profile(ModelMap map, HttpServletRequest request, @Valid User user, @Valid String index) {
|
||||||
User tempUser = userRes.getOne(user.getId());
|
User tempUser = userRes.getReferenceById(user.getId());
|
||||||
final User logined = super.getUser(request);
|
final User logined = super.getUser(request);
|
||||||
// 用户名不可修改
|
// 用户名不可修改
|
||||||
user.setUsername(logined.getUsername());
|
user.setUsername(logined.getUsername());
|
||||||
|
@ -46,9 +46,9 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
@ -117,7 +117,7 @@ public class ContactsController extends Handler {
|
|||||||
|
|
||||||
Page<Contacts> contacts = contactsRes.findByOrganInAndSharesAllAndDatastatusFalse(
|
Page<Contacts> contacts = contactsRes.findByOrganInAndSharesAllAndDatastatusFalse(
|
||||||
super.getMyCurrentAffiliatesFlat(logined),
|
super.getMyCurrentAffiliatesFlat(logined),
|
||||||
new PageRequest(super.getP(request), super.getPs(request)));
|
PageRequest.of(super.getP(request), super.getPs(request)));
|
||||||
|
|
||||||
map.addAttribute("contactsList", contacts);
|
map.addAttribute("contactsList", contacts);
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ public class ContactsController extends Handler {
|
|||||||
Page<Contacts> contacts = contactsRes.findByCreaterAndSharesAndDatastatus(logined.getId(),
|
Page<Contacts> contacts = contactsRes.findByCreaterAndSharesAndDatastatus(logined.getId(),
|
||||||
logined.getId(),
|
logined.getId(),
|
||||||
false,
|
false,
|
||||||
new PageRequest(
|
PageRequest.of(
|
||||||
super.getP(request),
|
super.getP(request),
|
||||||
super.getPs(request)));
|
super.getPs(request)));
|
||||||
|
|
||||||
@ -182,7 +182,7 @@ public class ContactsController extends Handler {
|
|||||||
Page<Contacts> contacts = contactsRes.findByCreaterAndSharesAndDatastatus(logined.getId(),
|
Page<Contacts> contacts = contactsRes.findByCreaterAndSharesAndDatastatus(logined.getId(),
|
||||||
logined.getId(),
|
logined.getId(),
|
||||||
false,
|
false,
|
||||||
new PageRequest(
|
PageRequest.of(
|
||||||
super.getP(request),
|
super.getP(request),
|
||||||
super.getPs(request)));
|
super.getPs(request)));
|
||||||
map.addAttribute(
|
map.addAttribute(
|
||||||
@ -216,7 +216,7 @@ public class ContactsController extends Handler {
|
|||||||
Page<Contacts> contacts = contactsRes.findByCreaterAndSharesAndDatastatus(logined.getId(),
|
Page<Contacts> contacts = contactsRes.findByCreaterAndSharesAndDatastatus(logined.getId(),
|
||||||
logined.getId(),
|
logined.getId(),
|
||||||
false,
|
false,
|
||||||
new PageRequest(
|
PageRequest.of(
|
||||||
super.getP(request),
|
super.getP(request),
|
||||||
super.getPs(request)));
|
super.getPs(request)));
|
||||||
|
|
||||||
@ -231,7 +231,7 @@ public class ContactsController extends Handler {
|
|||||||
@Menu(type = "contacts", subtype = "contacts")
|
@Menu(type = "contacts", subtype = "contacts")
|
||||||
public ModelAndView delete(HttpServletRequest request, @Valid Contacts contacts, @Valid String p, @Valid String ckind) {
|
public ModelAndView delete(HttpServletRequest request, @Valid Contacts contacts, @Valid String p, @Valid String ckind) {
|
||||||
if (contacts != null) {
|
if (contacts != null) {
|
||||||
contacts = contactsRes.findOne(contacts.getId());
|
contacts = contactsRes.getReferenceById(contacts.getId());
|
||||||
contacts.setDatastatus(true); //客户和联系人都是 逻辑删除
|
contacts.setDatastatus(true); //客户和联系人都是 逻辑删除
|
||||||
contactsRes.save(contacts);
|
contactsRes.save(contacts);
|
||||||
}
|
}
|
||||||
@ -288,7 +288,7 @@ public class ContactsController extends Handler {
|
|||||||
@RequestMapping("/edit")
|
@RequestMapping("/edit")
|
||||||
@Menu(type = "contacts", subtype = "contacts")
|
@Menu(type = "contacts", subtype = "contacts")
|
||||||
public ModelAndView edit(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String ckind) {
|
public ModelAndView edit(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String ckind) {
|
||||||
map.addAttribute("contacts", contactsRes.findOne(id));
|
map.addAttribute("contacts", contactsRes.getReferenceById(id));
|
||||||
map.addAttribute("ckindId", ckind);
|
map.addAttribute("ckindId", ckind);
|
||||||
return request(super.createView("/apps/contacts/edit"));
|
return request(super.createView("/apps/contacts/edit"));
|
||||||
}
|
}
|
||||||
@ -299,7 +299,7 @@ public class ContactsController extends Handler {
|
|||||||
if (id == null) {
|
if (id == null) {
|
||||||
return null; // id is required. Block strange requst anyway with g2.min, https://github.com/alibaba/BizCharts/issues/143
|
return null; // id is required. Block strange requst anyway with g2.min, https://github.com/alibaba/BizCharts/issues/143
|
||||||
}
|
}
|
||||||
map.addAttribute("contacts", contactsRes.findOne(id));
|
map.addAttribute("contacts", contactsRes.getReferenceById(id));
|
||||||
|
|
||||||
return request(super.createView("/apps/contacts/detail"));
|
return request(super.createView("/apps/contacts/detail"));
|
||||||
|
|
||||||
@ -344,7 +344,7 @@ public class ContactsController extends Handler {
|
|||||||
@Menu(type = "contacts", subtype = "contacts")
|
@Menu(type = "contacts", subtype = "contacts")
|
||||||
public ModelAndView update(HttpServletRequest request, @Valid Contacts contacts, @Valid String ckindId) {
|
public ModelAndView update(HttpServletRequest request, @Valid Contacts contacts, @Valid String ckindId) {
|
||||||
final User logined = super.getUser(request);
|
final User logined = super.getUser(request);
|
||||||
Contacts data = contactsRes.findOne(contacts.getId());
|
Contacts data = contactsRes.getReferenceById(contacts.getId());
|
||||||
String msg = "";
|
String msg = "";
|
||||||
|
|
||||||
String skypeIDReplace = contactsProxy.sanitizeSkypeId(contacts.getSkypeid());
|
String skypeIDReplace = contactsProxy.sanitizeSkypeId(contacts.getSkypeid());
|
||||||
@ -445,7 +445,7 @@ public class ContactsController extends Handler {
|
|||||||
@Menu(type = "contacts", subtype = "contacts")
|
@Menu(type = "contacts", subtype = "contacts")
|
||||||
public void expids(ModelMap map, HttpServletRequest request, HttpServletResponse response, @Valid String[] ids) throws IOException {
|
public void expids(ModelMap map, HttpServletRequest request, HttpServletResponse response, @Valid String[] ids) throws IOException {
|
||||||
if (ids != null && ids.length > 0) {
|
if (ids != null && ids.length > 0) {
|
||||||
Iterable<Contacts> contactsList = contactsRes.findAll(Arrays.asList(ids));
|
Iterable<Contacts> contactsList = contactsRes.findAllById(Arrays.asList(ids));
|
||||||
MetadataTable table = metadataRes.findByTablename("uk_contacts");
|
MetadataTable table = metadataRes.findByTablename("uk_contacts");
|
||||||
List<Map<String, Object>> values = new ArrayList<>();
|
List<Map<String, Object>> values = new ArrayList<>();
|
||||||
for (Contacts contacts : contactsList) {
|
for (Contacts contacts : contactsList) {
|
||||||
@ -481,7 +481,7 @@ public class ContactsController extends Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Iterable<Contacts> contactsList = contactsRes.findByCreaterAndSharesAndDatastatus(
|
Iterable<Contacts> contactsList = contactsRes.findByCreaterAndSharesAndDatastatus(
|
||||||
logined.getId(), logined.getId(), false, new PageRequest(super.getP(request), super.getPs(request)));
|
logined.getId(), logined.getId(), false, PageRequest.of(super.getP(request), super.getPs(request)));
|
||||||
|
|
||||||
MetadataTable table = metadataRes.findByTablename("uk_contacts");
|
MetadataTable table = metadataRes.findByTablename("uk_contacts");
|
||||||
List<Map<String, Object>> values = new ArrayList<>();
|
List<Map<String, Object>> values = new ArrayList<>();
|
||||||
@ -515,7 +515,7 @@ public class ContactsController extends Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Iterable<Contacts> contactsList = contactsRes.findByCreaterAndSharesAndDatastatus(
|
Iterable<Contacts> contactsList = contactsRes.findByCreaterAndSharesAndDatastatus(
|
||||||
logined.getId(), logined.getId(), false, new PageRequest(super.getP(request), super.getPs(request)));
|
logined.getId(), logined.getId(), false, PageRequest.of(super.getP(request), super.getPs(request)));
|
||||||
MetadataTable table = metadataRes.findByTablename("uk_contacts");
|
MetadataTable table = metadataRes.findByTablename("uk_contacts");
|
||||||
List<Map<String, Object>> values = new ArrayList<>();
|
List<Map<String, Object>> values = new ArrayList<>();
|
||||||
for (Contacts contacts : contactsList) {
|
for (Contacts contacts : contactsList) {
|
||||||
@ -552,11 +552,11 @@ public class ContactsController extends Handler {
|
|||||||
map.put("ckind", ckind);
|
map.put("ckind", ckind);
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(agentserviceid)) {
|
if (StringUtils.isNotBlank(agentserviceid)) {
|
||||||
AgentService service = agentServiceRes.findById(agentserviceid);
|
AgentService service = agentServiceRes.getReferenceById(agentserviceid);
|
||||||
}
|
}
|
||||||
Page<Contacts> contactsList = contactsRes.findByCreaterAndSharesAndDatastatus(
|
Page<Contacts> contactsList = contactsRes.findByCreaterAndSharesAndDatastatus(
|
||||||
logined.getId(), logined.getId(), false,
|
logined.getId(), logined.getId(), false,
|
||||||
new PageRequest(super.getP(request), super.getPs(request)));
|
PageRequest.of(super.getP(request), super.getPs(request)));
|
||||||
|
|
||||||
map.addAttribute("contactsList", contactsList);
|
map.addAttribute("contactsList", contactsList);
|
||||||
|
|
||||||
@ -593,7 +593,7 @@ public class ContactsController extends Handler {
|
|||||||
contacts.setCreater(logined.getId());
|
contacts.setCreater(logined.getId());
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(agentserviceid)) {
|
if (StringUtils.isNotBlank(agentserviceid)) {
|
||||||
AgentService agentService = agentServiceRes.findOne(agentserviceid);
|
AgentService agentService = agentServiceRes.getReferenceById(agentserviceid);
|
||||||
contacts.setOrgan(agentService.getSkill());
|
contacts.setOrgan(agentService.getSkill());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -613,7 +613,7 @@ public class ContactsController extends Handler {
|
|||||||
@RequestMapping("/embed/edit")
|
@RequestMapping("/embed/edit")
|
||||||
@Menu(type = "contacts", subtype = "embededit")
|
@Menu(type = "contacts", subtype = "embededit")
|
||||||
public ModelAndView embededit(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String agentserviceid) {
|
public ModelAndView embededit(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String agentserviceid) {
|
||||||
map.addAttribute("contacts", contactsRes.findOne(id));
|
map.addAttribute("contacts", contactsRes.getReferenceById(id));
|
||||||
if (StringUtils.isNotBlank(agentserviceid)) {
|
if (StringUtils.isNotBlank(agentserviceid)) {
|
||||||
map.addAttribute("agentserviceid", agentserviceid);
|
map.addAttribute("agentserviceid", agentserviceid);
|
||||||
}
|
}
|
||||||
@ -624,7 +624,7 @@ public class ContactsController extends Handler {
|
|||||||
@Menu(type = "contacts", subtype = "embedupdate")
|
@Menu(type = "contacts", subtype = "embedupdate")
|
||||||
public ModelAndView embedupdate(HttpServletRequest request, @Valid Contacts contacts, @Valid String agentserviceid) {
|
public ModelAndView embedupdate(HttpServletRequest request, @Valid Contacts contacts, @Valid String agentserviceid) {
|
||||||
final User logined = super.getUser(request);
|
final User logined = super.getUser(request);
|
||||||
Contacts data = contactsRes.findOne(contacts.getId());
|
Contacts data = contactsRes.getReferenceById(contacts.getId());
|
||||||
String msg = "";
|
String msg = "";
|
||||||
String skypeIDReplace = contactsProxy.sanitizeSkypeId(contacts.getSkypeid());
|
String skypeIDReplace = contactsProxy.sanitizeSkypeId(contacts.getSkypeid());
|
||||||
Contacts theOnlyContact = contactsRes.findByskypeidAndDatastatus(
|
Contacts theOnlyContact = contactsRes.findByskypeidAndDatastatus(
|
||||||
|
@ -50,9 +50,9 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -100,7 +100,7 @@ public class EntIMController extends Handler {
|
|||||||
Map<String, Organ> organs = new HashMap<>();
|
Map<String, Organ> organs = new HashMap<>();
|
||||||
user.getOrgans().values().stream().forEach(o -> {
|
user.getOrgans().values().stream().forEach(o -> {
|
||||||
if (!StringUtils.equals(o.getParent(), "0")) {
|
if (!StringUtils.equals(o.getParent(), "0")) {
|
||||||
Organ parent = organRes.findById(o.getParent());
|
Organ parent = organRes.getReferenceById(o.getParent());
|
||||||
organs.put(parent.getId(), parent);
|
organs.put(parent.getId(), parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ public class EntIMController extends Handler {
|
|||||||
|
|
||||||
user.getAffiliates().stream().forEach(p -> {
|
user.getAffiliates().stream().forEach(p -> {
|
||||||
if (!organs.containsKey(p)) {
|
if (!organs.containsKey(p)) {
|
||||||
Organ organ = organRes.findById(p);
|
Organ organ = organRes.getReferenceById(p);
|
||||||
organs.put(p, organ);
|
organs.put(p, organ);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -177,7 +177,7 @@ public class EntIMController extends Handler {
|
|||||||
@Menu(type = "im", subtype = "entim")
|
@Menu(type = "im", subtype = "entim")
|
||||||
public ModelAndView chat(HttpServletRequest request, HttpServletResponse response, @Valid String userid) {
|
public ModelAndView chat(HttpServletRequest request, HttpServletResponse response, @Valid String userid) {
|
||||||
ModelAndView view = request(super.createView("/apps/entim/chat"));
|
ModelAndView view = request(super.createView("/apps/entim/chat"));
|
||||||
User entImUser = userRes.findById(userid);
|
User entImUser = userRes.getReferenceById(userid);
|
||||||
|
|
||||||
if (entImUser != null) {
|
if (entImUser != null) {
|
||||||
userProxy.attachOrgansPropertiesForUser(entImUser);
|
userProxy.attachOrgansPropertiesForUser(entImUser);
|
||||||
@ -190,7 +190,7 @@ public class EntIMController extends Handler {
|
|||||||
|
|
||||||
Page<ChatMessage> chatMessageList = chatMessageRes.findByContextidAndUserid(userid,
|
Page<ChatMessage> chatMessageList = chatMessageRes.findByContextidAndUserid(userid,
|
||||||
super.getUser(request).getId(),
|
super.getUser(request).getId(),
|
||||||
new PageRequest(0, 20, Sort.Direction.DESC, "createtime")
|
PageRequest.of(0, 20, Sort.Direction.DESC, "createtime")
|
||||||
);
|
);
|
||||||
|
|
||||||
view.addObject("chatMessageList", chatMessageList);
|
view.addObject("chatMessageList", chatMessageList);
|
||||||
@ -233,7 +233,7 @@ public class EntIMController extends Handler {
|
|||||||
|
|
||||||
Page<ChatMessage> chatMessageList = chatMessageRes.findByContextidAndUseridAndCreatetimeLessThan(userid,
|
Page<ChatMessage> chatMessageList = chatMessageRes.findByContextidAndUseridAndCreatetimeLessThan(userid,
|
||||||
super.getUser(request).getId(), createtime,
|
super.getUser(request).getId(), createtime,
|
||||||
new PageRequest(0, 20, Sort.Direction.DESC, "createtime")
|
PageRequest.of(0, 20, Sort.Direction.DESC, "createtime")
|
||||||
);
|
);
|
||||||
view.addObject("chatMessageList", chatMessageList);
|
view.addObject("chatMessageList", chatMessageList);
|
||||||
|
|
||||||
@ -244,12 +244,12 @@ public class EntIMController extends Handler {
|
|||||||
@Menu(type = "im", subtype = "entim")
|
@Menu(type = "im", subtype = "entim")
|
||||||
public ModelAndView groupMore(HttpServletRequest request, HttpServletResponse response, @Valid String id) {
|
public ModelAndView groupMore(HttpServletRequest request, HttpServletResponse response, @Valid String id) {
|
||||||
ModelAndView view = request(super.createView("/apps/entim/group/index"));
|
ModelAndView view = request(super.createView("/apps/entim/group/index"));
|
||||||
IMGroup imGroup = imGroupRes.findById(id);
|
IMGroup imGroup = imGroupRes.getReferenceById(id);
|
||||||
view.addObject("imGroup", imGroup);
|
view.addObject("imGroup", imGroup);
|
||||||
view.addObject("imGroupUserList", imGroupUserRes.findByImgroup(imGroup));
|
view.addObject("imGroupUserList", imGroupUserRes.findByImgroup(imGroup));
|
||||||
view.addObject("contextid", id);
|
view.addObject("contextid", id);
|
||||||
view.addObject("chatMessageList", chatMessageRes.findByContextid(id,
|
view.addObject("chatMessageList", chatMessageRes.findByContextid(id,
|
||||||
new PageRequest(0, 20, Sort.Direction.DESC, "createtime")
|
PageRequest.of(0, 20, Sort.Direction.DESC, "createtime")
|
||||||
));
|
));
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
@ -262,7 +262,7 @@ public class EntIMController extends Handler {
|
|||||||
) {
|
) {
|
||||||
ModelAndView view = request(super.createView("/apps/entim/group/more"));
|
ModelAndView view = request(super.createView("/apps/entim/group/more"));
|
||||||
view.addObject("chatMessageList", chatMessageRes.findByContextidAndCreatetimeLessThan(id,
|
view.addObject("chatMessageList", chatMessageRes.findByContextidAndCreatetimeLessThan(id,
|
||||||
createtime, new PageRequest(0, 20, Sort.Direction.DESC, "createtime")
|
createtime, PageRequest.of(0, 20, Sort.Direction.DESC, "createtime")
|
||||||
));
|
));
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
@ -278,8 +278,8 @@ public class EntIMController extends Handler {
|
|||||||
users.stream().forEach(u -> userProxy.attachOrgansPropertiesForUser(u));
|
users.stream().forEach(u -> userProxy.attachOrgansPropertiesForUser(u));
|
||||||
view.addObject("userList", users);
|
view.addObject("userList", users);
|
||||||
|
|
||||||
IMGroup imGroup = imGroupRes.findById(id);
|
IMGroup imGroup = imGroupRes.getReferenceById(id);
|
||||||
List<Organ> organs = organRes.findAll(affiliates);
|
List<Organ> organs = organRes.findAllById(affiliates);
|
||||||
|
|
||||||
view.addObject("imGroup", imGroup);
|
view.addObject("imGroup", imGroup);
|
||||||
view.addObject("organList", organs);
|
view.addObject("organList", organs);
|
||||||
@ -331,7 +331,7 @@ public class EntIMController extends Handler {
|
|||||||
@Valid String tipmsg
|
@Valid String tipmsg
|
||||||
) {
|
) {
|
||||||
ModelAndView view = request(super.createView("/apps/entim/group/tipmsg"));
|
ModelAndView view = request(super.createView("/apps/entim/group/tipmsg"));
|
||||||
IMGroup imGroup = imGroupRes.findById(id);
|
IMGroup imGroup = imGroupRes.getReferenceById(id);
|
||||||
if (imGroup != null) {
|
if (imGroup != null) {
|
||||||
imGroup.setTipmessage(tipmsg);
|
imGroup.setTipmessage(tipmsg);
|
||||||
imGroupRes.save(imGroup);
|
imGroupRes.save(imGroup);
|
||||||
|
@ -55,11 +55,11 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
import javax.servlet.http.Cookie;
|
import jakarta.servlet.http.Cookie;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URLDecoder;
|
import java.net.URLDecoder;
|
||||||
@ -435,7 +435,7 @@ public class IMController extends Handler {
|
|||||||
sessionMessage.put("uid", uid);
|
sessionMessage.put("uid", uid);
|
||||||
cache.putSystemMapById(sessionid, sessionMessage);
|
cache.putSystemMapById(sessionid, sessionMessage);
|
||||||
|
|
||||||
PassportWebIMUser passportWebIMUser = onlineUserRes.findOne(userid);
|
PassportWebIMUser passportWebIMUser = onlineUserRes.getReferenceById(userid);
|
||||||
String updateusername;
|
String updateusername;
|
||||||
if (passportWebIMUser != null) {
|
if (passportWebIMUser != null) {
|
||||||
updateusername = username + "@" + company_name;
|
updateusername = username + "@" + company_name;
|
||||||
@ -860,7 +860,7 @@ public class IMController extends Handler {
|
|||||||
agentUserRepository.findOneByUserid(userid).ifPresent(p -> {
|
agentUserRepository.findOneByUserid(userid).ifPresent(p -> {
|
||||||
// 关联AgentService的联系人
|
// 关联AgentService的联系人
|
||||||
if (StringUtils.isNotBlank(p.getAgentserviceid())) {
|
if (StringUtils.isNotBlank(p.getAgentserviceid())) {
|
||||||
AgentService agentService = agentServiceRepository.findOne(
|
AgentService agentService = agentServiceRepository.getReferenceById(
|
||||||
p.getAgentserviceid());
|
p.getAgentserviceid());
|
||||||
agentService.setContactsid(contacts1.getId());
|
agentService.setContactsid(contacts1.getId());
|
||||||
}
|
}
|
||||||
@ -920,7 +920,7 @@ public class IMController extends Handler {
|
|||||||
// 是否使用机器人客服
|
// 是否使用机器人客服
|
||||||
if (invite.isAi() && MainContext.hasModule(Constants.CSKEFU_MODULE_CHATBOT)) {
|
if (invite.isAi() && MainContext.hasModule(Constants.CSKEFU_MODULE_CHATBOT)) {
|
||||||
// 查找机器人
|
// 查找机器人
|
||||||
bot = chatbotRes.findOne(invite.getAiid());
|
bot = chatbotRes.getReferenceById(invite.getAiid());
|
||||||
if (bot != null) {
|
if (bot != null) {
|
||||||
// 判断是否接受访客切换坐席类型
|
// 判断是否接受访客切换坐席类型
|
||||||
isEnableExchangeAgentType = !StringUtils.equals(
|
isEnableExchangeAgentType = !StringUtils.equals(
|
||||||
@ -965,7 +965,7 @@ public class IMController extends Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
map.addAttribute(
|
map.addAttribute(
|
||||||
"chatMessageList", chatMessageRes.findByUsession(userid, new PageRequest(0, 20,
|
"chatMessageList", chatMessageRes.findByUsession(userid, PageRequest.of(0, 20,
|
||||||
Direction.DESC,
|
Direction.DESC,
|
||||||
"updatetime")));
|
"updatetime")));
|
||||||
}
|
}
|
||||||
@ -1003,7 +1003,7 @@ public class IMController extends Handler {
|
|||||||
Page<InviteRecord> inviteRecords = inviteRecordRes.findByUseridAndResultAndCreatetimeGreaterThan(
|
Page<InviteRecord> inviteRecords = inviteRecordRes.findByUseridAndResultAndCreatetimeGreaterThan(
|
||||||
userid,
|
userid,
|
||||||
MainContext.OnlineUserInviteStatus.DEFAULT.toString(),
|
MainContext.OnlineUserInviteStatus.DEFAULT.toString(),
|
||||||
threshold, new PageRequest(0, 1, Direction.DESC, "createtime"));
|
threshold, PageRequest.of(0, 1, Direction.DESC, "createtime"));
|
||||||
if (inviteRecords.getContent() != null && inviteRecords.getContent().size() > 0) {
|
if (inviteRecords.getContent() != null && inviteRecords.getContent().size() > 0) {
|
||||||
final InviteRecord record = inviteRecords.getContent().get(0);
|
final InviteRecord record = inviteRecords.getContent().get(0);
|
||||||
record.setUpdatetime(new Date());
|
record.setUpdatetime(new Date());
|
||||||
@ -1249,7 +1249,7 @@ public class IMController extends Handler {
|
|||||||
userid,
|
userid,
|
||||||
MainContext.OnlineUserInviteStatus.DEFAULT.toString(),
|
MainContext.OnlineUserInviteStatus.DEFAULT.toString(),
|
||||||
threshold,
|
threshold,
|
||||||
new PageRequest(
|
PageRequest.of(
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
Direction.DESC,
|
Direction.DESC,
|
||||||
|
@ -24,7 +24,7 @@ import org.springframework.ui.ModelMap;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/message")
|
@RequestMapping("/message")
|
||||||
|
@ -39,10 +39,10 @@ import org.springframework.ui.ModelMap;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.persistence.criteria.*;
|
import jakarta.persistence.criteria.*;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
@ -105,7 +105,7 @@ public class AgentSummaryController extends Handler {
|
|||||||
}
|
}
|
||||||
Predicate[] p = new Predicate[list.size()];
|
Predicate[] p = new Predicate[list.size()];
|
||||||
return cb.and(list.toArray(p));
|
return cb.and(list.toArray(p));
|
||||||
}, new PageRequest(super.getP(request), super.getPs(request), Sort.Direction.DESC, "createtime"));
|
}, PageRequest.of(super.getP(request), super.getPs(request), Sort.Direction.DESC, "createtime"));
|
||||||
map.addAttribute("summaryList", page);
|
map.addAttribute("summaryList", page);
|
||||||
map.addAttribute("begin", begin);
|
map.addAttribute("begin", begin);
|
||||||
map.addAttribute("end", end);
|
map.addAttribute("end", end);
|
||||||
@ -118,14 +118,14 @@ public class AgentSummaryController extends Handler {
|
|||||||
@RequestMapping(value = "/process")
|
@RequestMapping(value = "/process")
|
||||||
@Menu(type = "agent", subtype = "agentsummary")
|
@Menu(type = "agent", subtype = "agentsummary")
|
||||||
public ModelAndView process(ModelMap map, HttpServletRequest request, @Valid final String id) {
|
public ModelAndView process(ModelMap map, HttpServletRequest request, @Valid final String id) {
|
||||||
AgentServiceSummary summary = serviceSummaryRes.findById(id);
|
AgentServiceSummary summary = serviceSummaryRes.getReferenceById(id);
|
||||||
map.addAttribute("summary", summary);
|
map.addAttribute("summary", summary);
|
||||||
map.put("summaryTags", tagRes.findByTagtype(MainContext.ModelType.SUMMARY.toString()));
|
map.put("summaryTags", tagRes.findByTagtype(MainContext.ModelType.SUMMARY.toString()));
|
||||||
if (summary != null && !StringUtils.isBlank(summary.getAgentserviceid())) {
|
if (summary != null && !StringUtils.isBlank(summary.getAgentserviceid())) {
|
||||||
AgentService service = agentServiceRes.findById(summary.getAgentserviceid());
|
AgentService service = agentServiceRes.getReferenceById(summary.getAgentserviceid());
|
||||||
map.addAttribute("service", service);
|
map.addAttribute("service", service);
|
||||||
if (!StringUtils.isBlank(summary.getContactsid())) {
|
if (!StringUtils.isBlank(summary.getContactsid())) {
|
||||||
Contacts contacts = contactsRes.findOne(summary.getContactsid());
|
Contacts contacts = contactsRes.getReferenceById(summary.getContactsid());
|
||||||
map.addAttribute("contacts", contacts);
|
map.addAttribute("contacts", contacts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -136,7 +136,7 @@ public class AgentSummaryController extends Handler {
|
|||||||
@RequestMapping(value = "/save")
|
@RequestMapping(value = "/save")
|
||||||
@Menu(type = "agent", subtype = "agentsummary")
|
@Menu(type = "agent", subtype = "agentsummary")
|
||||||
public ModelAndView save(ModelMap map, HttpServletRequest request, @Valid final AgentServiceSummary summary) {
|
public ModelAndView save(ModelMap map, HttpServletRequest request, @Valid final AgentServiceSummary summary) {
|
||||||
AgentServiceSummary oldSummary = serviceSummaryRes.findById(summary.getId());
|
AgentServiceSummary oldSummary = serviceSummaryRes.getReferenceById(summary.getId());
|
||||||
if (oldSummary != null) {
|
if (oldSummary != null) {
|
||||||
oldSummary.setProcess(true);
|
oldSummary.setProcess(true);
|
||||||
oldSummary.setUpdatetime(new Date());
|
oldSummary.setUpdatetime(new Date());
|
||||||
@ -152,7 +152,7 @@ public class AgentSummaryController extends Handler {
|
|||||||
@Menu(type = "agent", subtype = "agentsummary")
|
@Menu(type = "agent", subtype = "agentsummary")
|
||||||
public void expids(ModelMap map, HttpServletRequest request, HttpServletResponse response, @Valid String[] ids) throws IOException {
|
public void expids(ModelMap map, HttpServletRequest request, HttpServletResponse response, @Valid String[] ids) throws IOException {
|
||||||
if (ids != null && ids.length > 0) {
|
if (ids != null && ids.length > 0) {
|
||||||
Iterable<AgentServiceSummary> statusEventList = serviceSummaryRes.findAll(Arrays.asList(ids));
|
Iterable<AgentServiceSummary> statusEventList = serviceSummaryRes.findAllById(Arrays.asList(ids));
|
||||||
MetadataTable table = metadataRes.findByTablename("uk_servicesummary");
|
MetadataTable table = metadataRes.findByTablename("uk_servicesummary");
|
||||||
List<Map<String, Object>> values = new ArrayList<>();
|
List<Map<String, Object>> values = new ArrayList<>();
|
||||||
for (AgentServiceSummary event : statusEventList) {
|
for (AgentServiceSummary event : statusEventList) {
|
||||||
@ -174,7 +174,7 @@ public class AgentSummaryController extends Handler {
|
|||||||
Organ currentOrgan = super.getOrgan(request);
|
Organ currentOrgan = super.getOrgan(request);
|
||||||
Map<String, Organ> organs = organProxy.findAllOrganByParent(currentOrgan);
|
Map<String, Organ> organs = organProxy.findAllOrganByParent(currentOrgan);
|
||||||
Iterable<AgentServiceSummary> statusEventList = serviceSummaryRes.findByChannelNotAndSkillIn(
|
Iterable<AgentServiceSummary> statusEventList = serviceSummaryRes.findByChannelNotAndSkillIn(
|
||||||
MainContext.ChannelType.PHONE.toString(), organs.keySet(), new PageRequest(0, 10000));
|
MainContext.ChannelType.PHONE.toString(), organs.keySet(), PageRequest.of(0, 10000));
|
||||||
MetadataTable table = metadataRes.findByTablename("uk_servicesummary");
|
MetadataTable table = metadataRes.findByTablename("uk_servicesummary");
|
||||||
List<Map<String, Object>> values = new ArrayList<>();
|
List<Map<String, Object>> values = new ArrayList<>();
|
||||||
for (AgentServiceSummary statusEvent : statusEventList) {
|
for (AgentServiceSummary statusEvent : statusEventList) {
|
||||||
@ -207,7 +207,7 @@ public class AgentSummaryController extends Handler {
|
|||||||
}
|
}
|
||||||
Predicate[] p = new Predicate[list.size()];
|
Predicate[] p = new Predicate[list.size()];
|
||||||
return cb.and(list.toArray(p));
|
return cb.and(list.toArray(p));
|
||||||
}, new PageRequest(0, 10000, Sort.Direction.DESC, "createtime"));
|
}, PageRequest.of(0, 10000, Sort.Direction.DESC, "createtime"));
|
||||||
|
|
||||||
List<Map<String, Object>> values = new ArrayList<>();
|
List<Map<String, Object>> values = new ArrayList<>();
|
||||||
for (AgentServiceSummary summary : page) {
|
for (AgentServiceSummary summary : page) {
|
||||||
|
@ -36,6 +36,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.PageRequest;
|
import org.springframework.data.domain.PageRequest;
|
||||||
import org.springframework.data.domain.Sort.Direction;
|
import org.springframework.data.domain.Sort.Direction;
|
||||||
@ -44,9 +45,9 @@ import org.springframework.ui.ModelMap;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.persistence.criteria.*;
|
import jakarta.persistence.criteria.*;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.nio.charset.CharacterCodingException;
|
import java.nio.charset.CharacterCodingException;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -100,6 +101,7 @@ public class ChatServiceController extends Handler {
|
|||||||
private Cache cache;
|
private Cache cache;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@Lazy
|
||||||
private PeerSyncIM peerSyncIM;
|
private PeerSyncIM peerSyncIM;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -144,7 +146,7 @@ public class ChatServiceController extends Handler {
|
|||||||
}
|
}
|
||||||
Predicate[] p = new Predicate[list.size()];
|
Predicate[] p = new Predicate[list.size()];
|
||||||
return cb.and(list.toArray(p));
|
return cb.and(list.toArray(p));
|
||||||
}, new PageRequest(super.getP(request), super.getPs(request), Direction.DESC, "createtime"));
|
}, PageRequest.of(super.getP(request), super.getPs(request), Direction.DESC, "createtime"));
|
||||||
map.put("agentServiceList", page);
|
map.put("agentServiceList", page);
|
||||||
map.put("username", username);
|
map.put("username", username);
|
||||||
map.put("channel", channel);
|
map.put("channel", channel);
|
||||||
@ -168,7 +170,7 @@ public class ChatServiceController extends Handler {
|
|||||||
"agentServiceList", agentServiceRes.findByStatusAndAgentskillIn(
|
"agentServiceList", agentServiceRes.findByStatusAndAgentskillIn(
|
||||||
MainContext.AgentUserStatusEnum.INSERVICE.toString(),
|
MainContext.AgentUserStatusEnum.INSERVICE.toString(),
|
||||||
organs.keySet(),
|
organs.keySet(),
|
||||||
new PageRequest(
|
PageRequest.of(
|
||||||
super.getP(request),
|
super.getP(request),
|
||||||
super.getPs(request), Direction.DESC,
|
super.getPs(request), Direction.DESC,
|
||||||
"createtime")));
|
"createtime")));
|
||||||
@ -183,7 +185,7 @@ public class ChatServiceController extends Handler {
|
|||||||
Map<String, Organ> ownOrgans = organProxy.findAllOrganByParent(targetOrgan);
|
Map<String, Organ> ownOrgans = organProxy.findAllOrganByParent(targetOrgan);
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(id)) {
|
if (StringUtils.isNotBlank(id)) {
|
||||||
AgentService agentService = agentServiceRes.findById(id);
|
AgentService agentService = agentServiceRes.getReferenceById(id);
|
||||||
List<Organ> skillGroups = organRes.findByIdInAndSkill(ownOrgans.keySet(), true);
|
List<Organ> skillGroups = organRes.findByIdInAndSkill(ownOrgans.keySet(), true);
|
||||||
Set<String> organs = ownOrgans.keySet();
|
Set<String> organs = ownOrgans.keySet();
|
||||||
String currentOrgan = agentService.getSkill();
|
String currentOrgan = agentService.getSkill();
|
||||||
@ -200,7 +202,7 @@ public class ChatServiceController extends Handler {
|
|||||||
usersids.add(o);
|
usersids.add(o);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<User> userList = userRes.findAll(usersids);
|
List<User> userList = userRes.findAllById(usersids);
|
||||||
for (User user : userList) {
|
for (User user : userList) {
|
||||||
user.setAgentStatus(cache.findOneAgentStatusByAgentno(user.getId()));
|
user.setAgentStatus(cache.findOneAgentStatusByAgentno(user.getId()));
|
||||||
userProxy.attachOrgansPropertiesForUser(user);
|
userProxy.attachOrgansPropertiesForUser(user);
|
||||||
@ -221,8 +223,8 @@ public class ChatServiceController extends Handler {
|
|||||||
@Menu(type = "apps", subtype = "transfersave")
|
@Menu(type = "apps", subtype = "transfersave")
|
||||||
public ModelAndView transfersave(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String agentno, @Valid String memo) throws CharacterCodingException {
|
public ModelAndView transfersave(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String agentno, @Valid String memo) throws CharacterCodingException {
|
||||||
if (StringUtils.isNotBlank(id)) {
|
if (StringUtils.isNotBlank(id)) {
|
||||||
AgentService agentService = agentServiceRes.findById(id);
|
AgentService agentService = agentServiceRes.getReferenceById(id);
|
||||||
final User targetAgent = userRes.findOne(agentno);
|
final User targetAgent = userRes.getReferenceById(agentno);
|
||||||
AgentUser agentUser = null;
|
AgentUser agentUser = null;
|
||||||
Optional<AgentUser> agentUserOpt = cache.findOneAgentUserByUserId(
|
Optional<AgentUser> agentUserOpt = cache.findOneAgentUserByUserId(
|
||||||
agentService.getUserid());
|
agentService.getUserid());
|
||||||
@ -288,7 +290,7 @@ public class ChatServiceController extends Handler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
agentUser = agentUserRepository.findById(agentService.getAgentuserid());
|
agentUser = agentUserRepository.getReferenceById(agentService.getAgentuserid());
|
||||||
if (agentUser != null) {
|
if (agentUser != null) {
|
||||||
agentUser.setAgentno(agentno);
|
agentUser.setAgentno(agentno);
|
||||||
agentUser.setAgentname(targetAgent.getUname());
|
agentUser.setAgentname(targetAgent.getUname());
|
||||||
@ -314,10 +316,10 @@ public class ChatServiceController extends Handler {
|
|||||||
@Menu(type = "service", subtype = "current", admin = true)
|
@Menu(type = "service", subtype = "current", admin = true)
|
||||||
public ModelAndView end(ModelMap map, HttpServletRequest request, @Valid String id) throws Exception {
|
public ModelAndView end(ModelMap map, HttpServletRequest request, @Valid String id) throws Exception {
|
||||||
if (StringUtils.isNotBlank(id)) {
|
if (StringUtils.isNotBlank(id)) {
|
||||||
AgentService agentService = agentServiceRes.findById(id);
|
AgentService agentService = agentServiceRes.getReferenceById(id);
|
||||||
if (agentService != null) {
|
if (agentService != null) {
|
||||||
User user = super.getUser(request);
|
User user = super.getUser(request);
|
||||||
AgentUser agentUser = agentUserRepository.findById(
|
AgentUser agentUser = agentUserRepository.getReferenceById(
|
||||||
agentService.getAgentuserid());
|
agentService.getAgentuserid());
|
||||||
if (agentUser != null) {
|
if (agentUser != null) {
|
||||||
acdAgentService.finishAgentUser(agentUser);
|
acdAgentService.finishAgentUser(agentUser);
|
||||||
@ -345,7 +347,7 @@ public class ChatServiceController extends Handler {
|
|||||||
final HttpServletRequest request,
|
final HttpServletRequest request,
|
||||||
final @Valid String id) throws Exception {
|
final @Valid String id) throws Exception {
|
||||||
if (StringUtils.isNotBlank(id)) {
|
if (StringUtils.isNotBlank(id)) {
|
||||||
AgentService agentService = agentServiceRes.findById(id);
|
AgentService agentService = agentServiceRes.getReferenceById(id);
|
||||||
if (agentService != null) {
|
if (agentService != null) {
|
||||||
final User user = super.getUser(request);
|
final User user = super.getUser(request);
|
||||||
if (StringUtils.isBlank(agentService.getAgentno())) {
|
if (StringUtils.isBlank(agentService.getAgentno())) {
|
||||||
@ -394,7 +396,7 @@ public class ChatServiceController extends Handler {
|
|||||||
Organ currentOrgan = super.getOrgan(request);
|
Organ currentOrgan = super.getOrgan(request);
|
||||||
Map<String, Organ> organs = organProxy.findAllOrganByParent(currentOrgan);
|
Map<String, Organ> organs = organProxy.findAllOrganByParent(currentOrgan);
|
||||||
Page<AgentUser> agentUserList = agentUserRes.findByStatusAndSkillIn(MainContext.AgentUserStatusEnum.INQUENE.toString(), organs.keySet(),
|
Page<AgentUser> agentUserList = agentUserRes.findByStatusAndSkillIn(MainContext.AgentUserStatusEnum.INQUENE.toString(), organs.keySet(),
|
||||||
new PageRequest(super.getP(request), super.getPs(request), Direction.DESC, "createtime"));
|
PageRequest.of(super.getP(request), super.getPs(request), Direction.DESC, "createtime"));
|
||||||
List<String> skillGroups = new ArrayList<>();
|
List<String> skillGroups = new ArrayList<>();
|
||||||
for (AgentUser agentUser : agentUserList.getContent()) {
|
for (AgentUser agentUser : agentUserList.getContent()) {
|
||||||
agentUser.setWaittingtime((int) (System.currentTimeMillis() - agentUser.getCreatetime().getTime()));
|
agentUser.setWaittingtime((int) (System.currentTimeMillis() - agentUser.getCreatetime().getTime()));
|
||||||
@ -403,7 +405,7 @@ public class ChatServiceController extends Handler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (skillGroups.size() > 0) {
|
if (skillGroups.size() > 0) {
|
||||||
List<Organ> organList = organRes.findAll(skillGroups);
|
List<Organ> organList = organRes.findAllById(skillGroups);
|
||||||
for (AgentUser agentUser : agentUserList.getContent()) {
|
for (AgentUser agentUser : agentUserList.getContent()) {
|
||||||
if (StringUtils.isNotBlank(agentUser.getSkill())) {
|
if (StringUtils.isNotBlank(agentUser.getSkill())) {
|
||||||
for (Organ organ : organList) {
|
for (Organ organ : organList) {
|
||||||
@ -446,7 +448,7 @@ public class ChatServiceController extends Handler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<User> userList = userRes.findAll(usersids);
|
List<User> userList = userRes.findAllById(usersids);
|
||||||
for (User user : userList) {
|
for (User user : userList) {
|
||||||
user.setAgentStatus(cache.findOneAgentStatusByAgentno(user.getId()));
|
user.setAgentStatus(cache.findOneAgentStatusByAgentno(user.getId()));
|
||||||
userProxy.attachOrgansPropertiesForUser(user);
|
userProxy.attachOrgansPropertiesForUser(user);
|
||||||
@ -463,7 +465,7 @@ public class ChatServiceController extends Handler {
|
|||||||
@RequestMapping("/quene/transfer/save")
|
@RequestMapping("/quene/transfer/save")
|
||||||
@Menu(type = "service", subtype = "quenetransfer", admin = true)
|
@Menu(type = "service", subtype = "quenetransfer", admin = true)
|
||||||
public ModelAndView transferSave(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String skillid) {
|
public ModelAndView transferSave(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String skillid) {
|
||||||
AgentUser agentUser = agentUserRes.findById(id);
|
AgentUser agentUser = agentUserRes.getReferenceById(id);
|
||||||
if (agentUser != null && agentUser.getStatus().equals(MainContext.AgentUserStatusEnum.INQUENE.toString())) {
|
if (agentUser != null && agentUser.getStatus().equals(MainContext.AgentUserStatusEnum.INQUENE.toString())) {
|
||||||
agentUser.setAgentno(null);
|
agentUser.setAgentno(null);
|
||||||
agentUser.setSkill(skillid);
|
agentUser.setSkill(skillid);
|
||||||
@ -479,7 +481,7 @@ public class ChatServiceController extends Handler {
|
|||||||
@Menu(type = "service", subtype = "invite", admin = true)
|
@Menu(type = "service", subtype = "invite", admin = true)
|
||||||
public ModelAndView invite(ModelMap map, HttpServletRequest request, @Valid String id) throws Exception {
|
public ModelAndView invite(ModelMap map, HttpServletRequest request, @Valid String id) throws Exception {
|
||||||
final User logined = super.getUser(request);
|
final User logined = super.getUser(request);
|
||||||
AgentUser agentUser = agentUserRes.findById(id);
|
AgentUser agentUser = agentUserRes.getReferenceById(id);
|
||||||
if (agentUser != null && agentUser.getStatus().equals(MainContext.AgentUserStatusEnum.INQUENE.toString())) {
|
if (agentUser != null && agentUser.getStatus().equals(MainContext.AgentUserStatusEnum.INQUENE.toString())) {
|
||||||
acdAgentService.assignVisitorAsInvite(logined.getId(), agentUser);
|
acdAgentService.assignVisitorAsInvite(logined.getId(), agentUser);
|
||||||
}
|
}
|
||||||
@ -524,7 +526,7 @@ public class ChatServiceController extends Handler {
|
|||||||
@Menu(type = "service", subtype = "offline", admin = true)
|
@Menu(type = "service", subtype = "offline", admin = true)
|
||||||
public ModelAndView offline(ModelMap map, HttpServletRequest request, @Valid String id) {
|
public ModelAndView offline(ModelMap map, HttpServletRequest request, @Valid String id) {
|
||||||
|
|
||||||
AgentStatus agentStatus = agentStatusRepository.findById(id);
|
AgentStatus agentStatus = agentStatusRepository.getReferenceById(id);
|
||||||
if (agentStatus != null) {
|
if (agentStatus != null) {
|
||||||
agentStatusRepository.delete(agentStatus);
|
agentStatusRepository.delete(agentStatus);
|
||||||
}
|
}
|
||||||
@ -547,7 +549,7 @@ public class ChatServiceController extends Handler {
|
|||||||
public ModelAndView user(ModelMap map, HttpServletRequest request) {
|
public ModelAndView user(ModelMap map, HttpServletRequest request) {
|
||||||
Organ currentOrgan = super.getOrgan(request);
|
Organ currentOrgan = super.getOrgan(request);
|
||||||
Map<String, Organ> organs = organProxy.findAllOrganByParent(currentOrgan);
|
Map<String, Organ> organs = organProxy.findAllOrganByParent(currentOrgan);
|
||||||
Page<User> userList = userProxy.findUserInOrgans(organs.keySet(), new PageRequest(super.getP(request), super.getPs(request),
|
Page<User> userList = userProxy.findUserInOrgans(organs.keySet(), PageRequest.of(super.getP(request), super.getPs(request),
|
||||||
Direction.DESC, "createtime"));
|
Direction.DESC, "createtime"));
|
||||||
Map<String, Boolean> onlines = new HashMap<>();
|
Map<String, Boolean> onlines = new HashMap<>();
|
||||||
if (userList != null) {
|
if (userList != null) {
|
||||||
@ -571,7 +573,7 @@ public class ChatServiceController extends Handler {
|
|||||||
Organ currentOrgan = super.getOrgan(request);
|
Organ currentOrgan = super.getOrgan(request);
|
||||||
Map<String, Organ> organs = organProxy.findAllOrganByParent(currentOrgan);
|
Map<String, Organ> organs = organProxy.findAllOrganByParent(currentOrgan);
|
||||||
|
|
||||||
Page<LeaveMsg> leaveMsgs = leaveMsgRes.findBySkill(organs.keySet(), new PageRequest(super.getP(request), super.getPs(request),
|
Page<LeaveMsg> leaveMsgs = leaveMsgRes.findBySkill(organs.keySet(), PageRequest.of(super.getP(request), super.getPs(request),
|
||||||
Direction.DESC, "createtime"));
|
Direction.DESC, "createtime"));
|
||||||
logger.info("[leavemsg] current organ {}, find message size {}", currentOrgan.getId(), leaveMsgs.getSize());
|
logger.info("[leavemsg] current organ {}, find message size {}", currentOrgan.getId(), leaveMsgs.getSize());
|
||||||
for (final LeaveMsg l : leaveMsgs) {
|
for (final LeaveMsg l : leaveMsgs) {
|
||||||
@ -586,7 +588,7 @@ public class ChatServiceController extends Handler {
|
|||||||
@Menu(type = "service", subtype = "leavemsg", admin = true)
|
@Menu(type = "service", subtype = "leavemsg", admin = true)
|
||||||
public ModelAndView leavemsg(ModelMap map, HttpServletRequest request, @Valid String id) {
|
public ModelAndView leavemsg(ModelMap map, HttpServletRequest request, @Valid String id) {
|
||||||
if (StringUtils.isNotBlank(id)) {
|
if (StringUtils.isNotBlank(id)) {
|
||||||
leaveMsgRes.delete(id);
|
leaveMsgRes.deleteById(id);
|
||||||
}
|
}
|
||||||
return request(super.createView("redirect:/service/leavemsg/index"));
|
return request(super.createView("redirect:/service/leavemsg/index"));
|
||||||
}
|
}
|
||||||
|
@ -30,8 +30,8 @@ import org.springframework.ui.ModelMap;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@ -48,7 +48,7 @@ public class CommentController extends Handler {
|
|||||||
public ModelAndView index(ModelMap map, HttpServletRequest request, String userid, String agentservice, @Valid String channel) {
|
public ModelAndView index(ModelMap map, HttpServletRequest request, String userid, String agentservice, @Valid String channel) {
|
||||||
Organ currentOrgan = super.getOrgan(request);
|
Organ currentOrgan = super.getOrgan(request);
|
||||||
Map<String, Organ> organs = organProxy.findAllOrganByParent(currentOrgan);
|
Map<String, Organ> organs = organProxy.findAllOrganByParent(currentOrgan);
|
||||||
Page<AgentService> agentServiceList = agentServiceRes.findBySatisfactionAndSkillIn(true, organs.keySet(), new PageRequest(super.getP(request), super.getPs(request)));
|
Page<AgentService> agentServiceList = agentServiceRes.findBySatisfactionAndSkillIn(true, organs.keySet(), PageRequest.of(super.getP(request), super.getPs(request)));
|
||||||
map.addAttribute("serviceList", agentServiceList);
|
map.addAttribute("serviceList", agentServiceList);
|
||||||
return request(super.createView("/apps/service/comment/index"));
|
return request(super.createView("/apps/service/comment/index"));
|
||||||
}
|
}
|
||||||
|
@ -38,8 +38,8 @@ import org.springframework.ui.ModelMap;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@ -134,9 +134,9 @@ public class OnlineUserController extends Handler {
|
|||||||
|
|
||||||
agentUserContactsRes.findOneByUserid(
|
agentUserContactsRes.findOneByUserid(
|
||||||
userid).ifPresent(p -> {
|
userid).ifPresent(p -> {
|
||||||
map.put("contacts", contactsRes.findOne(p.getContactsid()));
|
map.put("contacts", contactsRes.getReferenceById(p.getContactsid()));
|
||||||
});
|
});
|
||||||
AgentService service = agentServiceRes.findById(agentservice);
|
AgentService service = agentServiceRes.getReferenceById(agentservice);
|
||||||
if (service != null) {
|
if (service != null) {
|
||||||
map.addAttribute(
|
map.addAttribute(
|
||||||
"tags", tagRes.findByTagtypeAndSkill(MainContext.ModelType.USER.toString(), service.getSkill()));
|
"tags", tagRes.findByTagtypeAndSkill(MainContext.ModelType.USER.toString(), service.getSkill()));
|
||||||
@ -150,7 +150,7 @@ public class OnlineUserController extends Handler {
|
|||||||
map.put(
|
map.put(
|
||||||
"agentUserMessageList",
|
"agentUserMessageList",
|
||||||
chatMessageRepository.findByAgentserviceid(agentService.getId(),
|
chatMessageRepository.findByAgentserviceid(agentService.getId(),
|
||||||
new PageRequest(
|
PageRequest.of(
|
||||||
0, 50, Direction.DESC,
|
0, 50, Direction.DESC,
|
||||||
"updatetime")));
|
"updatetime")));
|
||||||
}
|
}
|
||||||
@ -162,7 +162,7 @@ public class OnlineUserController extends Handler {
|
|||||||
map.put("weiXinUser", passportWechatUser);
|
map.put("weiXinUser", passportWechatUser);
|
||||||
}
|
}
|
||||||
} else if (MainContext.ChannelType.WEBIM.toString().equals(channel)) {
|
} else if (MainContext.ChannelType.WEBIM.toString().equals(channel)) {
|
||||||
PassportWebIMUser passportWebIMUser = onlineUserRes.findOne(userid);
|
PassportWebIMUser passportWebIMUser = onlineUserRes.getReferenceById(userid);
|
||||||
if (passportWebIMUser != null) {
|
if (passportWebIMUser != null) {
|
||||||
map.put("onlineUser", passportWebIMUser);
|
map.put("onlineUser", passportWebIMUser);
|
||||||
}
|
}
|
||||||
@ -181,7 +181,7 @@ public class OnlineUserController extends Handler {
|
|||||||
@RequestMapping("/online/chatmsg")
|
@RequestMapping("/online/chatmsg")
|
||||||
@Menu(type = "service", subtype = "chatmsg", admin = true)
|
@Menu(type = "service", subtype = "chatmsg", admin = true)
|
||||||
public ModelAndView onlinechat(ModelMap map, HttpServletRequest request, String id, String title) {
|
public ModelAndView onlinechat(ModelMap map, HttpServletRequest request, String id, String title) {
|
||||||
AgentService agentService = agentServiceRes.getOne(id);
|
AgentService agentService = agentServiceRes.getReferenceById(id);
|
||||||
map.put("curAgentService", agentService);
|
map.put("curAgentService", agentService);
|
||||||
cache.findOneAgentUserByUserId(agentService.getUserid()).ifPresent(p -> {
|
cache.findOneAgentUserByUserId(agentService.getUserid()).ifPresent(p -> {
|
||||||
map.put("curagentuser", p);
|
map.put("curagentuser", p);
|
||||||
@ -207,7 +207,7 @@ public class OnlineUserController extends Handler {
|
|||||||
map.put(
|
map.put(
|
||||||
"agentUserMessageList",
|
"agentUserMessageList",
|
||||||
chatMessageRepository.findByAgentserviceid(agentService.getId(),
|
chatMessageRepository.findByAgentserviceid(agentService.getId(),
|
||||||
new PageRequest(0, 50, Direction.DESC,
|
PageRequest.of(0, 50, Direction.DESC,
|
||||||
"updatetime")));
|
"updatetime")));
|
||||||
|
|
||||||
return request(super.createView("/apps/service/online/chatmsg"));
|
return request(super.createView("/apps/service/online/chatmsg"));
|
||||||
@ -223,7 +223,7 @@ public class OnlineUserController extends Handler {
|
|||||||
if (StringUtils.isNotBlank(sessionid)) {
|
if (StringUtils.isNotBlank(sessionid)) {
|
||||||
map.addAttribute(
|
map.addAttribute(
|
||||||
"traceHisList", userEventRes.findBySessionid(sessionid,
|
"traceHisList", userEventRes.findBySessionid(sessionid,
|
||||||
new PageRequest(0, 100)));
|
PageRequest.of(0, 100)));
|
||||||
}
|
}
|
||||||
return request(super.createView("/apps/service/online/trace"));
|
return request(super.createView("/apps/service/online/trace"));
|
||||||
}
|
}
|
||||||
|
@ -39,10 +39,10 @@ import org.springframework.ui.ModelMap;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.persistence.criteria.*;
|
import jakarta.persistence.criteria.*;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -110,7 +110,7 @@ public class ProcessedSummaryController extends Handler {
|
|||||||
}
|
}
|
||||||
Predicate[] p = new Predicate[list.size()];
|
Predicate[] p = new Predicate[list.size()];
|
||||||
return cb.and(list.toArray(p));
|
return cb.and(list.toArray(p));
|
||||||
}, new PageRequest(super.getP(request), super.getPs(request), Sort.Direction.DESC, "createtime"));
|
}, PageRequest.of(super.getP(request), super.getPs(request), Sort.Direction.DESC, "createtime"));
|
||||||
map.addAttribute("summaryList", page);
|
map.addAttribute("summaryList", page);
|
||||||
map.addAttribute("ani", ani);
|
map.addAttribute("ani", ani);
|
||||||
map.addAttribute("called", called);
|
map.addAttribute("called", called);
|
||||||
@ -126,14 +126,14 @@ public class ProcessedSummaryController extends Handler {
|
|||||||
@RequestMapping(value = "/process")
|
@RequestMapping(value = "/process")
|
||||||
@Menu(type = "agent", subtype = "processed")
|
@Menu(type = "agent", subtype = "processed")
|
||||||
public ModelAndView process(ModelMap map, HttpServletRequest request, @Valid final String id) {
|
public ModelAndView process(ModelMap map, HttpServletRequest request, @Valid final String id) {
|
||||||
AgentServiceSummary summary = serviceSummaryRes.findById(id);
|
AgentServiceSummary summary = serviceSummaryRes.getReferenceById(id);
|
||||||
map.addAttribute("summary", summary);
|
map.addAttribute("summary", summary);
|
||||||
map.put("summaryTags", tagRes.findByTagtype(MainContext.ModelType.SUMMARY.toString()));
|
map.put("summaryTags", tagRes.findByTagtype(MainContext.ModelType.SUMMARY.toString()));
|
||||||
if (summary != null && !StringUtils.isBlank(summary.getAgentserviceid())) {
|
if (summary != null && !StringUtils.isBlank(summary.getAgentserviceid())) {
|
||||||
AgentService service = agentServiceRes.findById(summary.getAgentserviceid());
|
AgentService service = agentServiceRes.getReferenceById(summary.getAgentserviceid());
|
||||||
map.addAttribute("service", service);
|
map.addAttribute("service", service);
|
||||||
if (!StringUtils.isBlank(summary.getContactsid())) {
|
if (!StringUtils.isBlank(summary.getContactsid())) {
|
||||||
Contacts contacts = contactsRes.findOne(summary.getContactsid());
|
Contacts contacts = contactsRes.getReferenceById(summary.getContactsid());
|
||||||
map.addAttribute("contacts", contacts);
|
map.addAttribute("contacts", contacts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -144,7 +144,7 @@ public class ProcessedSummaryController extends Handler {
|
|||||||
@RequestMapping(value = "/save")
|
@RequestMapping(value = "/save")
|
||||||
@Menu(type = "agent", subtype = "processed")
|
@Menu(type = "agent", subtype = "processed")
|
||||||
public ModelAndView save(ModelMap map, HttpServletRequest request, @Valid final AgentServiceSummary summary) {
|
public ModelAndView save(ModelMap map, HttpServletRequest request, @Valid final AgentServiceSummary summary) {
|
||||||
AgentServiceSummary oldSummary = serviceSummaryRes.findById(summary.getId());
|
AgentServiceSummary oldSummary = serviceSummaryRes.getReferenceById(summary.getId());
|
||||||
if (oldSummary != null) {
|
if (oldSummary != null) {
|
||||||
oldSummary.setProcess(true);
|
oldSummary.setProcess(true);
|
||||||
oldSummary.setUpdatetime(new Date());
|
oldSummary.setUpdatetime(new Date());
|
||||||
@ -160,7 +160,7 @@ public class ProcessedSummaryController extends Handler {
|
|||||||
@Menu(type = "agent", subtype = "processed")
|
@Menu(type = "agent", subtype = "processed")
|
||||||
public void expids(ModelMap map, HttpServletRequest request, HttpServletResponse response, @Valid String[] ids) throws IOException {
|
public void expids(ModelMap map, HttpServletRequest request, HttpServletResponse response, @Valid String[] ids) throws IOException {
|
||||||
if (ids != null && ids.length > 0) {
|
if (ids != null && ids.length > 0) {
|
||||||
Iterable<AgentServiceSummary> statusEventList = serviceSummaryRes.findAll(Arrays.asList(ids));
|
Iterable<AgentServiceSummary> statusEventList = serviceSummaryRes.findAllById(Arrays.asList(ids));
|
||||||
MetadataTable table = metadataRes.findByTablename("uk_servicesummary");
|
MetadataTable table = metadataRes.findByTablename("uk_servicesummary");
|
||||||
List<Map<String, Object>> values = new ArrayList<>();
|
List<Map<String, Object>> values = new ArrayList<>();
|
||||||
for (AgentServiceSummary event : statusEventList) {
|
for (AgentServiceSummary event : statusEventList) {
|
||||||
@ -182,7 +182,7 @@ public class ProcessedSummaryController extends Handler {
|
|||||||
Organ currentOrgan = super.getOrgan(request);
|
Organ currentOrgan = super.getOrgan(request);
|
||||||
Map<String, Organ> organs = organProxy.findAllOrganByParent(currentOrgan);
|
Map<String, Organ> organs = organProxy.findAllOrganByParent(currentOrgan);
|
||||||
Iterable<AgentServiceSummary> statusEventList = serviceSummaryRes.findByChannelNotAndProcessTrueAndSkillIn(
|
Iterable<AgentServiceSummary> statusEventList = serviceSummaryRes.findByChannelNotAndProcessTrueAndSkillIn(
|
||||||
MainContext.ChannelType.PHONE.toString(), organs.keySet(), new PageRequest(0, 10000));
|
MainContext.ChannelType.PHONE.toString(), organs.keySet(), PageRequest.of(0, 10000));
|
||||||
|
|
||||||
MetadataTable table = metadataRes.findByTablename("uk_servicesummary");
|
MetadataTable table = metadataRes.findByTablename("uk_servicesummary");
|
||||||
List<Map<String, Object>> values = new ArrayList<>();
|
List<Map<String, Object>> values = new ArrayList<>();
|
||||||
@ -221,7 +221,7 @@ public class ProcessedSummaryController extends Handler {
|
|||||||
}
|
}
|
||||||
Predicate[] p = new Predicate[list.size()];
|
Predicate[] p = new Predicate[list.size()];
|
||||||
return cb.and(list.toArray(p));
|
return cb.and(list.toArray(p));
|
||||||
}, new PageRequest(0, 10000, Sort.Direction.DESC, "createtime"));
|
}, PageRequest.of(0, 10000, Sort.Direction.DESC, "createtime"));
|
||||||
|
|
||||||
List<Map<String, Object>> values = new ArrayList<>();
|
List<Map<String, Object>> values = new ArrayList<>();
|
||||||
for (AgentServiceSummary summary : page) {
|
for (AgentServiceSummary summary : page) {
|
||||||
|
@ -39,9 +39,9 @@ import org.springframework.ui.ModelMap;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
@ -37,10 +37,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.servlet.http.Cookie;
|
import jakarta.servlet.http.Cookie;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Token验证失败
|
* Token验证失败
|
||||||
|
@ -31,13 +31,13 @@ import org.springframework.ui.ModelMap;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
import javax.persistence.criteria.CriteriaBuilder;
|
import jakarta.persistence.criteria.CriteriaBuilder;
|
||||||
import javax.persistence.criteria.CriteriaBuilder.In;
|
import jakarta.persistence.criteria.CriteriaBuilder.In;
|
||||||
import javax.persistence.criteria.CriteriaQuery;
|
import jakarta.persistence.criteria.CriteriaQuery;
|
||||||
import javax.persistence.criteria.Predicate;
|
import jakarta.persistence.criteria.Predicate;
|
||||||
import javax.persistence.criteria.Root;
|
import jakarta.persistence.criteria.Root;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -30,8 +30,8 @@ import org.springframework.ui.ModelMap;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class ContactsResourceController extends Handler {
|
public class ContactsResourceController extends Handler {
|
||||||
@ -46,7 +46,7 @@ public class ContactsResourceController extends Handler {
|
|||||||
if (q == null) {
|
if (q == null) {
|
||||||
q = "";
|
q = "";
|
||||||
}
|
}
|
||||||
Page<Contacts> contactsList = contactsRes.findByCreaterAndSharesAndDatastatus(super.getUser(request).getId(), super.getUser(request).getId(), false, new PageRequest(0, 10));
|
Page<Contacts> contactsList = contactsRes.findByCreaterAndSharesAndDatastatus(super.getUser(request).getId(), super.getUser(request).getId(), false, PageRequest.of(0, 10));
|
||||||
|
|
||||||
JSONArray result = new JSONArray();
|
JSONArray result = new JSONArray();
|
||||||
for (Contacts contact : contactsList.getContent()) {
|
for (Contacts contact : contactsList.getContent()) {
|
||||||
|
@ -19,27 +19,26 @@ package com.cskefu.cc.controller.resource;
|
|||||||
import com.cskefu.cc.controller.Handler;
|
import com.cskefu.cc.controller.Handler;
|
||||||
import com.cskefu.cc.util.Menu;
|
import com.cskefu.cc.util.Menu;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.util.MimeTypeUtils;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class CssResourceController extends Handler{
|
public class CssResourceController extends Handler{
|
||||||
|
|
||||||
@RequestMapping("/res/css")
|
@RequestMapping(value = "/res/css")
|
||||||
@Menu(type = "resouce" , subtype = "css" , access = true)
|
@Menu(type = "resouce" , subtype = "css" , access = true)
|
||||||
public ModelAndView index(HttpServletResponse response, @Valid String id) throws IOException {
|
public ModelAndView index(HttpServletResponse response, @Valid String id) throws IOException {
|
||||||
response.setContentType("text/css ; charset=UTF-8");
|
|
||||||
return request(super.createView("/resource/css/ukefu"));
|
return request(super.createView("/resource/css/ukefu"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/res/css/system")
|
@RequestMapping(value = "/res/css/system")
|
||||||
@Menu(type = "resouce" , subtype = "css" , access = true)
|
@Menu(type = "resouce" , subtype = "css" , access = true)
|
||||||
public ModelAndView system(HttpServletResponse response, @Valid String id) throws IOException {
|
public ModelAndView system(HttpServletResponse response, @Valid String id) throws IOException {
|
||||||
response.setContentType("text/css ; charset=UTF-8");
|
|
||||||
return request(super.createView("/resource/css/system"));
|
return request(super.createView("/resource/css/system"));
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -41,9 +41,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -77,7 +77,7 @@ public class MediaController extends Handler {
|
|||||||
@Valid String id,
|
@Valid String id,
|
||||||
@RequestParam(value = "original", required = false) boolean original,
|
@RequestParam(value = "original", required = false) boolean original,
|
||||||
@RequestParam(value = "cooperation", required = false) boolean cooperation) throws IOException, SQLException {
|
@RequestParam(value = "cooperation", required = false) boolean cooperation) throws IOException, SQLException {
|
||||||
StreamingFile sf = streamingFileRes.findOne(id);
|
StreamingFile sf = streamingFileRes.getReferenceById(id);
|
||||||
if (sf != null) {
|
if (sf != null) {
|
||||||
response.setHeader("Content-Type", sf.getMime());
|
response.setHeader("Content-Type", sf.getMime());
|
||||||
response.setContentType(sf.getMime());
|
response.setContentType(sf.getMime());
|
||||||
@ -149,9 +149,9 @@ public class MediaController extends Handler {
|
|||||||
@Menu(type = "resouce", subtype = "file")
|
@Menu(type = "resouce", subtype = "file")
|
||||||
public void file(HttpServletResponse response, HttpServletRequest request, @Valid String id) throws IOException, SQLException {
|
public void file(HttpServletResponse response, HttpServletRequest request, @Valid String id) throws IOException, SQLException {
|
||||||
if (StringUtils.isNotBlank(id)) {
|
if (StringUtils.isNotBlank(id)) {
|
||||||
AttachmentFile attachmentFile = attachementRes.findById(id);
|
AttachmentFile attachmentFile = attachementRes.getReferenceById(id);
|
||||||
if (attachmentFile != null && attachmentFile.getFileid() != null) {
|
if (attachmentFile != null && attachmentFile.getFileid() != null) {
|
||||||
StreamingFile sf = streamingFileRes.findOne(attachmentFile.getFileid());
|
StreamingFile sf = streamingFileRes.getReferenceById(attachmentFile.getFileid());
|
||||||
if (sf != null) {
|
if (sf != null) {
|
||||||
response.setContentType(attachmentFile.getFiletype());
|
response.setContentType(attachmentFile.getFiletype());
|
||||||
response.setHeader("Content-Disposition", "attachment;filename=" + java.net.URLEncoder.encode(attachmentFile.getTitle(), "UTF-8"));
|
response.setHeader("Content-Disposition", "attachment;filename=" + java.net.URLEncoder.encode(attachmentFile.getTitle(), "UTF-8"));
|
||||||
|
@ -25,8 +25,8 @@ import org.springframework.ui.ModelMap;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -33,8 +33,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@ -99,7 +99,7 @@ public class UsersResourceController extends Handler {
|
|||||||
if (q == null) {
|
if (q == null) {
|
||||||
q = "";
|
q = "";
|
||||||
}
|
}
|
||||||
Page<User> list = userRes.findByDatastatusAndUsernameLike(false, "%" + q + "%", new PageRequest(0, 10));
|
Page<User> list = userRes.findByDatastatusAndUsernameLike(false, "%" + q + "%", PageRequest.of(0, 10));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,12 +18,12 @@ package com.cskefu.cc.interceptor;
|
|||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
|
import org.springframework.web.servlet.HandlerInterceptor;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
public class CrossInterceptorHandler extends HandlerInterceptorAdapter {
|
public class CrossInterceptorHandler implements HandlerInterceptor {
|
||||||
private final static Logger logger = LoggerFactory.getLogger(CrossInterceptorHandler.class);
|
private final static Logger logger = LoggerFactory.getLogger(CrossInterceptorHandler.class);
|
||||||
|
|
||||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
|
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
|
||||||
|
@ -31,8 +31,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.method.HandlerMethod;
|
import org.springframework.web.method.HandlerMethod;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
|
|
||||||
|
@ -21,15 +21,15 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
|
import org.springframework.web.servlet.HandlerInterceptor;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户体验计划
|
* 用户体验计划
|
||||||
*/
|
*/
|
||||||
public class UserExperiencePlanInterceptorHandler extends HandlerInterceptorAdapter {
|
public class UserExperiencePlanInterceptorHandler implements HandlerInterceptor {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(UserExperiencePlanInterceptorHandler.class);
|
private static final Logger logger = LoggerFactory.getLogger(UserExperiencePlanInterceptorHandler.class);
|
||||||
public final static String FLAG_KEY = "cskefu:global:user-experience-plan";
|
public final static String FLAG_KEY = "cskefu:global:user-experience-plan";
|
||||||
private static RedisCommand redis;
|
private static RedisCommand redis;
|
||||||
|
@ -32,15 +32,15 @@ import com.cskefu.cc.util.PugHelper;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.boot.autoconfigure.web.BasicErrorController;
|
import org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController;
|
||||||
import org.springframework.web.method.HandlerMethod;
|
import org.springframework.web.method.HandlerMethod;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
|
import org.springframework.web.servlet.HandlerInterceptor;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
public class UserInterceptorHandler extends HandlerInterceptorAdapter {
|
public class UserInterceptorHandler implements HandlerInterceptor {
|
||||||
private final static Logger logger = LoggerFactory.getLogger(UserInterceptorHandler.class);
|
private final static Logger logger = LoggerFactory.getLogger(UserInterceptorHandler.class);
|
||||||
private static UserProxy userProxy;
|
private static UserProxy userProxy;
|
||||||
private static OrganProxy organProxy;
|
private static OrganProxy organProxy;
|
||||||
|
@ -20,12 +20,12 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
|
import org.springframework.web.servlet.HandlerInterceptor;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
public class ViewsInterceptorHandler extends HandlerInterceptorAdapter {
|
public class ViewsInterceptorHandler implements HandlerInterceptor {
|
||||||
private final static Logger logger = LoggerFactory.getLogger(ViewsInterceptorHandler.class);
|
private final static Logger logger = LoggerFactory.getLogger(ViewsInterceptorHandler.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -20,7 +20,7 @@ package com.cskefu.cc.model;
|
|||||||
import com.cskefu.cc.basic.MainUtils;
|
import com.cskefu.cc.basic.MainUtils;
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
|
@ -18,7 +18,7 @@ package com.cskefu.cc.model;
|
|||||||
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
|
@ -18,7 +18,7 @@ package com.cskefu.cc.model;
|
|||||||
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
|
@ -19,7 +19,7 @@ package com.cskefu.cc.model;
|
|||||||
import com.cskefu.cc.basic.MainUtils;
|
import com.cskefu.cc.basic.MainUtils;
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ import com.cskefu.cc.basic.MainUtils;
|
|||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
import org.hibernate.annotations.Proxy;
|
import org.hibernate.annotations.Proxy;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
@ -19,7 +19,7 @@ package com.cskefu.cc.model;
|
|||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
import org.hibernate.annotations.Proxy;
|
import org.hibernate.annotations.Proxy;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ package com.cskefu.cc.model;
|
|||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
import org.hibernate.annotations.Proxy;
|
import org.hibernate.annotations.Proxy;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ import com.cskefu.cc.acd.ACDServiceRouter;
|
|||||||
import com.cskefu.cc.basic.MainContext;
|
import com.cskefu.cc.basic.MainContext;
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ import com.cskefu.cc.basic.MainUtils;
|
|||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
import org.hibernate.annotations.Proxy;
|
import org.hibernate.annotations.Proxy;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ package com.cskefu.cc.model;
|
|||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
import org.hibernate.annotations.Proxy;
|
import org.hibernate.annotations.Proxy;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ package com.cskefu.cc.model;
|
|||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
import org.hibernate.annotations.Proxy;
|
import org.hibernate.annotations.Proxy;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
|
@ -18,7 +18,7 @@ package com.cskefu.cc.model;
|
|||||||
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user