commit
26b103987a
866 changed files with 97378 additions and 0 deletions
@ -0,0 +1,10 @@ |
||||
#windows |
||||
.idea |
||||
target |
||||
*.iml |
||||
*.log |
||||
ccic-apprunner/ |
||||
#屏蔽配置文件 |
||||
#mac |
||||
.DS_Store |
||||
|
@ -0,0 +1,13 @@ |
||||
#windows |
||||
.idea |
||||
target |
||||
ccic-api.iml |
||||
*.log |
||||
#屏蔽配置文件 |
||||
src/test/java/demo/CodeGenerator.java |
||||
src/main/resources/dev.application.yml |
||||
src/main/resources/application.yml.txt |
||||
src/main/java/com/ccic/safeliab/web/dom4jTest.java |
||||
#mac |
||||
.DS_Store |
||||
|
@ -0,0 +1,351 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<artifactId>ccic-api</artifactId> |
||||
<version>1.0-SNAPSHOT</version> |
||||
|
||||
<parent> |
||||
<groupId>com.ccic.safeliab</groupId> |
||||
<artifactId>cloud-dependencies</artifactId> |
||||
<version>1.0</version> |
||||
<relativePath/> <!-- lookup parent from repository --> |
||||
</parent> |
||||
|
||||
<dependencies> |
||||
|
||||
<dependency> |
||||
<groupId>org.yaml</groupId> |
||||
<artifactId>snakeyaml</artifactId> |
||||
<version>2.3-ccic</version> |
||||
</dependency> |
||||
<!--nacos-config--> |
||||
<dependency> |
||||
<groupId>com.alibaba.cloud</groupId> |
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> |
||||
</dependency> |
||||
<!--nacos-discovery--> |
||||
<dependency> |
||||
<groupId>com.alibaba.cloud</groupId> |
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>com.ccic.safeliab</groupId> |
||||
<artifactId>cloud-starter</artifactId> |
||||
<version>1.0</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.ccic.safeliab</groupId> |
||||
<artifactId>ccic-entity</artifactId> |
||||
<version>1.0-SNAPSHOT</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-starter</artifactId> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-configuration-processor</artifactId> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-starter-web</artifactId> |
||||
<exclusions> |
||||
<exclusion> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-starter-tomcat</artifactId> |
||||
</exclusion> |
||||
</exclusions> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-starter-undertow</artifactId> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>io.undertow</groupId> |
||||
<artifactId>undertow-servlet</artifactId> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>org.projectlombok</groupId> |
||||
<artifactId>lombok</artifactId> |
||||
<scope>provided</scope> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>ch.qos.logback</groupId> |
||||
<artifactId>logback-core</artifactId> |
||||
|
||||
</dependency> |
||||
<dependency> |
||||
<groupId>ch.qos.logback</groupId> |
||||
<artifactId>logback-classic</artifactId> |
||||
|
||||
</dependency> |
||||
|
||||
<!--base项目依赖--> |
||||
<!--<dependency> |
||||
<groupId>org.mybatis.spring.boot</groupId> |
||||
<artifactId>mybatis-spring-boot-starter</artifactId> |
||||
<version>1.1.1</version> |
||||
</dependency>--> |
||||
|
||||
<!--<dependency> |
||||
<groupId>com.baomidou</groupId> |
||||
<artifactId>mybatis-plus-boot-starter</artifactId> |
||||
</dependency>--> |
||||
|
||||
<!-- velocity 模板引擎, Mybatis Plus 代码生成器需要 --> |
||||
<dependency> |
||||
<groupId>org.apache.velocity</groupId> |
||||
<artifactId>velocity-engine-core</artifactId> |
||||
</dependency> |
||||
|
||||
<!-- dependency> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-starter-data-redis</artifactId> |
||||
</dependency --> |
||||
|
||||
<!--<dependency> |
||||
<groupId>com.github.pagehelper</groupId> |
||||
<artifactId>pagehelper</artifactId> |
||||
<version>4.1.6</version> |
||||
</dependency>--> |
||||
|
||||
<dependency> |
||||
<groupId>com.zaxxer</groupId> |
||||
<artifactId>HikariCP</artifactId> |
||||
<scope>runtime</scope> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>mysql</groupId> |
||||
<artifactId>mysql-connector-java</artifactId> |
||||
<scope>runtime</scope> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>com.alibaba</groupId> |
||||
<artifactId>fastjson</artifactId> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>junit</groupId> |
||||
<artifactId>junit</artifactId> |
||||
<scope>test</scope> |
||||
</dependency> |
||||
<!-- 人大金仓数据驱动 --> |
||||
<dependency> |
||||
<groupId>com.kingbase8</groupId> |
||||
<artifactId>kingbase8</artifactId> |
||||
<version>8.6.0</version> |
||||
</dependency> |
||||
|
||||
<!-- dataBus 数据推送依赖 start --> |
||||
<dependency> |
||||
<groupId>com.ccic.databus</groupId> |
||||
<artifactId>DataBus-Client</artifactId> |
||||
<version>5.3.2</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>com.ccic.databus</groupId> |
||||
<artifactId>DataBus-Common</artifactId> |
||||
<version>5.3</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>org.mongodb</groupId> |
||||
<artifactId>mongodb-driver</artifactId> |
||||
<version>3.4.2</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>org.mongodb</groupId> |
||||
<artifactId>mongodb-driver-core</artifactId> |
||||
<version>3.4.2</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>org.mongodb</groupId> |
||||
<artifactId>mongo-java-driver</artifactId> |
||||
<version>3.4.2</version> |
||||
</dependency> |
||||
<!-- dataBus 数据推送依赖 end --> |
||||
|
||||
<!-- 云影像批量上传 start--> |
||||
<dependency> |
||||
<groupId>com.sinosoft.image</groupId> |
||||
<artifactId>h5img-wsc-client</artifactId> |
||||
<version>1.2.0</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>commons-logging</groupId> |
||||
<artifactId>commons-logging</artifactId> |
||||
<version>1.2</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>org.apache.httpcomponents</groupId> |
||||
<artifactId>httpclient</artifactId> |
||||
<version>4.4</version> |
||||
</dependency> |
||||
<!-- 云影像批量上传 end--> |
||||
|
||||
<!-- 云影像服务器上传 start--> |
||||
<dependency> |
||||
<groupId>com.aliyun.oss</groupId> |
||||
<artifactId>aliyun-sdk-oss</artifactId> |
||||
<version>2.3.0</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.aliyun</groupId> |
||||
<artifactId>aliyun-java-sdk-sts</artifactId> |
||||
<version>2.1.6</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.aliyun</groupId> |
||||
<artifactId>aliyun-java-sdk-core</artifactId> |
||||
<version>2.1.7</version> |
||||
</dependency> |
||||
|
||||
<!-- 云影像服务器上传 end--> |
||||
|
||||
<!-- https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils --> |
||||
<dependency> |
||||
<groupId>commons-beanutils</groupId> |
||||
<artifactId>commons-beanutils</artifactId> |
||||
<version>1.9.3</version> |
||||
</dependency> |
||||
|
||||
<!--<!–阿里巴巴druid连接池–>--> |
||||
<!-- <dependency>--> |
||||
<!-- <groupId>com.alibaba</groupId>--> |
||||
<!-- <artifactId>druid-spring-boot-starter</artifactId>--> |
||||
<!-- <version>1.1.21</version>--> |
||||
<!-- </dependency>--> |
||||
<!--阿里巴巴druid连接池--> |
||||
<dependency> |
||||
<groupId>com.alibaba</groupId> |
||||
<artifactId>druid-spring-boot-starter</artifactId> |
||||
<version>1.1.21</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>org.bouncycastle</groupId> |
||||
<artifactId>bcprov-jdk15on</artifactId> |
||||
<version>1.54</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>cn.hutool</groupId> |
||||
<artifactId>hutool-all</artifactId> |
||||
<version>5.7.16</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>org.apache.cxf</groupId> |
||||
<artifactId>cxf-spring-boot-starter-jaxws</artifactId> |
||||
<version>3.2.4</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>org.hibernate</groupId> |
||||
<artifactId>hibernate-validator</artifactId> |
||||
<version>5.4.1.Final</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-starter-aop</artifactId> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>dom4j</groupId> |
||||
<artifactId>dom4j</artifactId> |
||||
<version>1.6.1</version> |
||||
</dependency> |
||||
|
||||
<!--<dependency> |
||||
<groupId>org.apache.commons</groupId> |
||||
<artifactId>commons-text</artifactId> |
||||
<version>1.6</version> |
||||
</dependency>--> |
||||
<!--<dependency> |
||||
<groupId>org.owasp.esapi</groupId> |
||||
<artifactId>esapi</artifactId> |
||||
<version>2.2.0.0</version> |
||||
</dependency>--> |
||||
|
||||
<dependency> |
||||
<groupId>org.owasp.esapi</groupId> |
||||
<artifactId>esapi</artifactId> |
||||
<version>2.2.0.0</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>org.jsoup</groupId> |
||||
<artifactId>jsoup</artifactId> |
||||
<version>1.9.2</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>xml-apis</groupId> |
||||
<artifactId>xml-apis</artifactId> |
||||
<version>1.4.01</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>commons-fileupload</groupId> |
||||
<artifactId>commons-fileupload</artifactId> |
||||
<version>1.3</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>com.bes.appserv-web</groupId> |
||||
<artifactId>bes-lite-spring-boot-2.x-starter</artifactId> |
||||
<version>9.5.2.008</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>com.github.ulisesbocchio</groupId> |
||||
<artifactId>jasypt-spring-boot-starter</artifactId> |
||||
<version>2.1.2</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>org.apache.tika</groupId> |
||||
<artifactId>tika-parsers</artifactId> |
||||
<version>1.22</version> |
||||
</dependency> |
||||
<!--redis 所需依赖--> |
||||
<dependency> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-starter-data-redis</artifactId> |
||||
</dependency> |
||||
|
||||
<!--redis 一主二从哨兵模式需要 连接池依赖--> |
||||
<dependency> |
||||
<groupId>org.apache.commons</groupId> |
||||
<artifactId>commons-pool2</artifactId> |
||||
</dependency> |
||||
|
||||
<!--pdf检测--> |
||||
<dependency> |
||||
<groupId>org.apache.pdfbox</groupId> |
||||
<artifactId>pdfbox</artifactId> |
||||
<version>2.0.28</version> |
||||
</dependency> |
||||
</dependencies> |
||||
<build> |
||||
<plugins> |
||||
<plugin> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-maven-plugin</artifactId> |
||||
</plugin> |
||||
</plugins> |
||||
</build> |
||||
|
||||
</project> |
@ -0,0 +1,30 @@ |
||||
package com.ccic.safeliab; |
||||
|
||||
import org.springframework.boot.SpringApplication; |
||||
import org.springframework.boot.autoconfigure.SpringBootApplication; |
||||
//import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
|
||||
|
||||
//@ComponentScan("com.cs")
|
||||
//@MapperScan("com.cs.dao")
|
||||
@SpringBootApplication |
||||
//@EnableDiscoveryClient
|
||||
//@ServletComponentScan
|
||||
public class ServerApplication { |
||||
public static void main(String[] args) { |
||||
SpringApplication.run(ServerApplication.class, args); |
||||
} |
||||
|
||||
/*@Bean |
||||
MultipartConfigElement multipartConfigElement() { |
||||
MultipartConfigFactory factory = new MultipartConfigFactory(); |
||||
String tmpPath = System.getProperty("user.dir") + "/tmpPath"; |
||||
File file = new File(tmpPath); |
||||
if (!file.exists()) { |
||||
file.mkdir(); |
||||
} |
||||
factory.setLocation(tmpPath); |
||||
return factory.createMultipartConfig(); |
||||
}*/ |
||||
|
||||
} |
@ -0,0 +1,254 @@ |
||||
package com.ccic.safeliab.aspect; |
||||
|
||||
|
||||
import com.alibaba.fastjson.JSON; |
||||
import com.ccic.safeliab.annotation.Log; |
||||
import com.ccic.safeliab.constant.OrganType; |
||||
import com.ccic.safeliab.dao.SysOperLogMapper; |
||||
import com.ccic.safeliab.entity.SysOperLog; |
||||
import com.ccic.safeliab.enums.BusinessStatus; |
||||
import com.ccic.safeliab.util.*; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.aspectj.lang.JoinPoint; |
||||
import org.aspectj.lang.annotation.AfterReturning; |
||||
import org.aspectj.lang.annotation.AfterThrowing; |
||||
import org.aspectj.lang.annotation.Aspect; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.http.HttpMethod; |
||||
import org.springframework.stereotype.Component; |
||||
import org.springframework.validation.BindingResult; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
|
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import java.util.*; |
||||
|
||||
/** |
||||
* 操作日志记录处理 |
||||
* |
||||
* @author ruoyi |
||||
*/ |
||||
@Aspect |
||||
@Component |
||||
public class LogAspect |
||||
{ |
||||
@Autowired |
||||
private SysOperLogMapper sysOperLogMapper; |
||||
|
||||
@Autowired |
||||
public HttpServletRequest request; |
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(LogAspect.class); |
||||
|
||||
/** |
||||
* 处理完请求后执行 |
||||
* |
||||
* @param joinPoint 切点 |
||||
*/ |
||||
@AfterReturning(pointcut = "@annotation(controllerLog)", returning = "jsonResult") |
||||
public void doAfterReturning(JoinPoint joinPoint, Log controllerLog, Object jsonResult) |
||||
{ |
||||
handleLog(joinPoint, controllerLog, null, jsonResult); |
||||
} |
||||
|
||||
/** |
||||
* 拦截异常操作 |
||||
* |
||||
* @param joinPoint 切点 |
||||
* @param e 异常 |
||||
*/ |
||||
@AfterThrowing(value = "@annotation(controllerLog)", throwing = "e") |
||||
public void doAfterThrowing(JoinPoint joinPoint, Log controllerLog, Exception e) |
||||
{ |
||||
handleLog(joinPoint, controllerLog, e, null); |
||||
} |
||||
|
||||
protected void handleLog(final JoinPoint joinPoint, Log controllerLog, final Exception e, Object jsonResult) |
||||
{ |
||||
try |
||||
{ |
||||
// *========数据库日志=========*//
|
||||
SysOperLog operLog = new SysOperLog(); |
||||
operLog.setStatus(BusinessStatus.SUCCESS.ordinal()); |
||||
// 请求的地址
|
||||
String ip = IpUtils.getIpAddr(ServletUtils.getRequest()); |
||||
operLog.setOperIp(ip); |
||||
operLog.setOperUrl(ServletUtils.getRequest().getRequestURI()); |
||||
|
||||
if (e != null) |
||||
{ |
||||
operLog.setStatus(BusinessStatus.FAIL.ordinal()); |
||||
operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000)); |
||||
} |
||||
// 设置方法名称
|
||||
String className = joinPoint.getTarget().getClass().getName(); |
||||
String methodName = joinPoint.getSignature().getName(); |
||||
operLog.setMethod(className + "." + methodName + "()"); |
||||
// 设置请求方式
|
||||
operLog.setRequestMethod(ServletUtils.getRequest().getMethod()); |
||||
// 处理设置注解上的参数
|
||||
getControllerMethodDescription(joinPoint, controllerLog, operLog, jsonResult); |
||||
|
||||
String organType = JwtUtils.getMemberIdByJwtToken(request, "organType"); |
||||
if(StringUtils.isEmpty(organType) ){ |
||||
organType = "1";//
|
||||
} |
||||
operLog.setOperatorOrganType(Integer.parseInt(organType)); |
||||
operLog.setCreatedAt(new Date()); // 记录时间
|
||||
|
||||
|
||||
// 保存数据库
|
||||
sysOperLogMapper.insert(operLog); |
||||
log.info(operLog.toString()); |
||||
} |
||||
catch (Exception exp) |
||||
{ |
||||
// 记录本地异常日志
|
||||
log.error("==前置通知异常=="); |
||||
log.error("异常信息:{}", exp.getMessage()); |
||||
exp.printStackTrace(); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 获取注解中对方法的描述信息 用于Controller层注解 |
||||
* |
||||
* @param controllerLog 日志 |
||||
* @param operLog 操作日志 |
||||
* @throws Exception |
||||
*/ |
||||
public void getControllerMethodDescription(JoinPoint joinPoint, Log controllerLog, SysOperLog operLog, Object jsonResult) throws Exception |
||||
{ |
||||
|
||||
// 设置action动作
|
||||
operLog.setBusinessType(controllerLog.businessType().ordinal()); |
||||
// 设置标题
|
||||
operLog.setTitle(controllerLog.title()); |
||||
// 设置描述
|
||||
operLog.setOperatorDesc(controllerLog.operatorDesc()); |
||||
// 设置操作人类别
|
||||
operLog.setOperatorType(controllerLog.operatorType().ordinal()); |
||||
// 是否需要保存request,参数和值
|
||||
if (controllerLog.isSaveRequestData()) |
||||
{ |
||||
// 获取参数的信息,传入到数据库中。
|
||||
setRequestValue(joinPoint, operLog); |
||||
} |
||||
//判断是否是登录日志
|
||||
if(operLog.getOperUrl().contains("/login")||operLog.getOperUrl().contains("/auth")|| |
||||
operLog.getOperUrl().contains("/userLogin")||operLog.getOperUrl().contains("/userMiniLogin")){ |
||||
R r = (R) jsonResult; |
||||
Map<String,Object> map = (Map<String, Object>) r.getData(); |
||||
String token = CcicUtill.checkStr(map.get("token")); |
||||
log.info(token); |
||||
if(!StringUtils.isEmpty(token)){ |
||||
String userName = JwtUtils.getMsgByJwtToken(token, "userName"); |
||||
String userId = JwtUtils.getMsgByJwtToken(token, "id"); |
||||
String organId = JwtUtils.getMsgByJwtToken(token, "organId"); |
||||
String organName = JwtUtils.getMsgByJwtToken(token, "organName"); |
||||
String userNo = JwtUtils.getMsgByJwtToken(token, "userNo"); |
||||
operLog.setCreateOrganId(Long.parseLong(organId)); |
||||
operLog.setCreateOrganName(organName); |
||||
operLog.setCreateUserId(Long.parseLong(userId)); |
||||
operLog.setCreateUserName(userName); |
||||
operLog.setUserNo(userNo); |
||||
}else{ |
||||
String userNo = JwtUtils.getMemberIdByJwtToken(request, "userNo"); |
||||
operLog.setUserNo(userNo); |
||||
} |
||||
}else{ |
||||
String userNo = JwtUtils.getMemberIdByJwtToken(request, "userNo"); |
||||
operLog.setUserNo(userNo); |
||||
} |
||||
// 是否需要保存response,参数和值
|
||||
if (controllerLog.isSaveResponseData() && jsonResult!=null) |
||||
{ |
||||
|
||||
operLog.setJsonResult(StringUtils.substring(JSON.toJSONString(jsonResult), 0, 2000)); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 获取请求的参数,放到log中 |
||||
* |
||||
* @param operLog 操作日志 |
||||
* @throws Exception 异常 |
||||
*/ |
||||
private void setRequestValue(JoinPoint joinPoint, SysOperLog operLog) throws Exception |
||||
{ |
||||
String requestMethod = operLog.getRequestMethod(); |
||||
if (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod)) |
||||
{ |
||||
String params = argsArrayToString(joinPoint.getArgs()); |
||||
if(params.length()>2001){ |
||||
operLog.setOperParam(StringUtils.substring(params, 0, 2000)+"}"); |
||||
}else{ |
||||
operLog.setOperParam(params); |
||||
} |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 参数拼装 |
||||
*/ |
||||
private String argsArrayToString(Object[] paramsArray) |
||||
{ |
||||
String params = ""; |
||||
if (paramsArray != null && paramsArray.length > 0) |
||||
{ |
||||
for (Object o : paramsArray) |
||||
{ |
||||
if (o!=null && !isFilterObject(o)) |
||||
{ |
||||
try |
||||
{ |
||||
Object jsonObj = JSON.toJSON(o); |
||||
params += jsonObj.toString() + " "; |
||||
} |
||||
catch (Exception e) |
||||
{ |
||||
} |
||||
} |
||||
} |
||||
} |
||||
return params.trim(); |
||||
} |
||||
|
||||
/** |
||||
* 判断是否需要过滤的对象。 |
||||
* |
||||
* @param o 对象信息。 |
||||
* @return 如果是需要过滤的对象,则返回true;否则返回false。 |
||||
*/ |
||||
@SuppressWarnings("rawtypes") |
||||
public boolean isFilterObject(final Object o) |
||||
{ |
||||
Class<?> clazz = o.getClass(); |
||||
if (clazz.isArray()) |
||||
{ |
||||
return clazz.getComponentType().isAssignableFrom(MultipartFile.class); |
||||
} |
||||
else if (Collection.class.isAssignableFrom(clazz)) |
||||
{ |
||||
Collection collection = (Collection) o; |
||||
for (Object value : collection) |
||||
{ |
||||
return value instanceof MultipartFile; |
||||
} |
||||
} |
||||
else if (Map.class.isAssignableFrom(clazz)) |
||||
{ |
||||
Map map = (Map) o; |
||||
for (Object value : map.entrySet()) |
||||
{ |
||||
Map.Entry entry = (Map.Entry) value; |
||||
return entry.getValue() instanceof MultipartFile; |
||||
} |
||||
} |
||||
return o instanceof MultipartFile || o instanceof HttpServletRequest || o instanceof HttpServletResponse |
||||
|| o instanceof BindingResult; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,35 @@ |
||||
package com.ccic.safeliab.constant; |
||||
|
||||
/** |
||||
* 审核操作类型常量 |
||||
*/ |
||||
public class AuditOperateType { |
||||
|
||||
//审核成功
|
||||
public static final String SUCCESS = "success"; |
||||
//审核驳回
|
||||
public static final String REJECT = "reject"; |
||||
//新增
|
||||
public static final String ADD = "add"; |
||||
//修改
|
||||
public static final String EDIT = "edit"; |
||||
//上级审核中
|
||||
public static final String SUP_AUDIT = "sup_audit"; |
||||
//被上级退回
|
||||
public static final String SUP_RETURNED = "sup_returned"; |
||||
//专家认证
|
||||
public static final String CERTIFICATION = "certification"; |
||||
|
||||
//专家&机构审核状态
|
||||
//审核 1.待审核;2.审核中(上级审核);3.审核成功;4.审核失败 -1:未认证(未审核)
|
||||
public final static int UNAUTHORIZED = -1; |
||||
public final static int NOTASSESS = 1;//待审核
|
||||
public final static int STATUS_SUP_NOTASSESS = 2; |
||||
public final static int STATUS_ASSESS = 3; |
||||
public final static int STATUS_REJECT = 4; |
||||
public final static int STATUS_GRADUALLY_REJECT = 5;//退回下级/逐层退回
|
||||
public final static int STATUS_RETURNED = 6;//审核记录 被上级退回(被退回的数据与待审核处理逻辑相同,增加新状态方便区分)
|
||||
//STATUS_SUP_NOTASSESS审核中 STATUS_ASSESS :审核通过 STATUS_REJECT:审核驳回
|
||||
|
||||
|
||||
} |
@ -0,0 +1,12 @@ |
||||
package com.ccic.safeliab.constant; |
||||
|
||||
public class OrganType { |
||||
public static final int type_company = 1;//企业
|
||||
public static final int type_insurance = 3;//保险公司
|
||||
public static final int type_thirdparty = 5;//第三方服务机构
|
||||
public static final int type_gov = 7;//政府端
|
||||
|
||||
|
||||
public final static int STATUS_TS = -1;//暂存
|
||||
public static final int STATUS_DEL = 999; |
||||
} |
@ -0,0 +1,25 @@ |
||||
package com.ccic.safeliab.constant; |
||||
|
||||
public class UserType { |
||||
|
||||
public static final int status_enable = 1;//可用用户状态
|
||||
public static final int status_disable = 2;//禁用用户状态
|
||||
|
||||
public static final int type_company = 1;//企业
|
||||
public static final int type_insurance = 3;//保险公司
|
||||
public static final int type_thirdparty = 5;//第三方服务机构
|
||||
public static final int type_gov = 7;//政府端
|
||||
|
||||
//认证状态 1.待认证;2.认证中);3.认证成功;4.认证失败
|
||||
public final static int UNAUTHORIZED = 1; |
||||
public final static int AUTHORING = 2; |
||||
public final static int AUTHOR_SUCCESS = 3; |
||||
public final static int AUTHOR_FAILURE = 4; |
||||
|
||||
//企业用户角色
|
||||
public final static long QIYE_ADMIN = 20000000001L;//企业管理员
|
||||
public final static long QIYE_SAFETY_CHARGE = 20000000002L;//企业安全负责人
|
||||
public final static long QIYE_SAFETY_PERSONNEL = 20000000003L;//企业安全员
|
||||
|
||||
|
||||
} |
@ -0,0 +1,26 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.ccic.safeliab.entity.Account; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* <p> |
||||
* 用户账户表,登录 Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-08-09 |
||||
*/ |
||||
@Mapper |
||||
public interface AccountMapper extends BaseMapper<Account> { |
||||
|
||||
List<Account> findOpenIdByCompanyIds(@Param("map") Map<String, Object> map); |
||||
|
||||
List<Account> findOpenIdByCompanyId(@Param("map") Map<String, Object> map); |
||||
|
||||
} |
@ -0,0 +1,18 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.ccic.safeliab.entity.AuditOperateRecord; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
/** |
||||
* <p> |
||||
* Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-08-08 |
||||
*/ |
||||
@Mapper |
||||
public interface AuditOperateRecordMapper extends BaseMapper<AuditOperateRecord> { |
||||
|
||||
} |
@ -0,0 +1,24 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.ccic.safeliab.entity.CheckTemplateItem; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* <p> |
||||
* 考评项(考评模版的考评项) Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author cqw |
||||
* @since 2022-08-05 |
||||
*/ |
||||
@Mapper |
||||
public interface CheckTemplateItemMapper extends BaseMapper<CheckTemplateItem> { |
||||
public List<CheckTemplateItem> findItem(@Param("param") Map<String, Object> param); |
||||
|
||||
} |
@ -0,0 +1,34 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.ccic.safeliab.entity.CheckTemplate; |
||||
|
||||
|
||||
import com.ccic.safeliab.entity.UserAudit; |
||||
import com.ccic.safeliab.entity.ReCheckTemplate; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* <p> |
||||
* 考评模版 Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-08-02 |
||||
*/ |
||||
@Mapper |
||||
public interface CheckTemplateMapper extends BaseMapper<CheckTemplate> { |
||||
Page<ReCheckTemplate> find(Page<ReCheckTemplate> page, @Param("map") Map<String, Object> map); |
||||
|
||||
ReCheckTemplate getTemplateShow(@Param("templateId") Long templateId); |
||||
|
||||
public int insert(UserAudit userAudit); |
||||
|
||||
List<ReCheckTemplate> getList(@Param("map") Map<String, Object> map); |
||||
|
||||
} |
@ -0,0 +1,33 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.ccic.safeliab.entity.Config; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
@Mapper |
||||
public interface ConfigDao extends BaseMapper<Config> { |
||||
/** |
||||
* 根据码表type查询数据 |
||||
* NewOrRenewalMark 续保标志 |
||||
* BusinessSource3Code 业务来源 |
||||
* PolicyStatus 保单状态 |
||||
* IdTypes 关系人证件类型 |
||||
* JudicalScopeCode 司法管辖 |
||||
* ContractDisputeResolution 合同争议解决方式 |
||||
* IndustryTypeLarge 行业类型大 |
||||
* IndustryTypeMiddle 行业类型中 |
||||
* IndustryTypeDetail 行业类型细分 |
||||
* IndustryTypeFour 行业类型四级 |
||||
* BuilderLevelCode 建筑工程企业资质等级 |
||||
* BuildingInstitutionCode 工程状态 |
||||
* EngineeringType 工程类型 |
||||
* CoInsuranceType 共保标志 |
||||
* InternalCoInsuranceType 联保标志 |
||||
* @param type |
||||
* @return |
||||
*/ |
||||
public List<Config> findByType(String type); |
||||
} |
@ -0,0 +1,9 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.ccic.safeliab.entity.Customer; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
@Mapper |
||||
public interface CustomerMapper extends BaseMapper<Customer> { |
||||
} |
@ -0,0 +1,21 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.ccic.safeliab.entity.Device; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
/** |
||||
* <p> |
||||
* 设备(烟感)表 Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2023-01-06 |
||||
*/ |
||||
@Mapper |
||||
public interface DeviceMapper extends BaseMapper<Device> { |
||||
|
||||
int updateStatus(@Param("organId") String organId); |
||||
|
||||
} |
@ -0,0 +1,13 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.ccic.safeliab.entity.Dict; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
|
||||
@Mapper |
||||
public interface DictDao { |
||||
|
||||
public List<Dict> find(); |
||||
} |
@ -0,0 +1,15 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.ccic.safeliab.entity.DictVal; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
@Mapper |
||||
public interface DictValDao extends BaseMapper<DictVal> { |
||||
|
||||
public List<DictVal> find(DictVal dictId); |
||||
|
||||
} |
@ -0,0 +1,11 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.ccic.safeliab.entity.DockingData; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
@Mapper |
||||
public interface DockingDataMapper extends BaseMapper<DockingData> { |
||||
|
||||
|
||||
} |
@ -0,0 +1,23 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.ccic.safeliab.entity.EarlyWarningMessage; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* 灾难预警 |
||||
* @author Lim |
||||
* @since 2022-11-24 |
||||
*/ |
||||
@Mapper |
||||
public interface EarlyWarningMessageMapper extends BaseMapper<EarlyWarningMessage> { |
||||
|
||||
Page<EarlyWarningMessage> getList(Page<EarlyWarningMessage> page, @Param("map") Map<String, Object> map); |
||||
|
||||
} |
@ -0,0 +1,9 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.ccic.safeliab.entity.Event; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
@Mapper |
||||
public interface EventMapper extends BaseMapper<Event> { |
||||
} |
@ -0,0 +1,26 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.ccic.safeliab.entity.Grid; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
@Mapper |
||||
public interface GridDao extends BaseMapper<Grid> { |
||||
public Grid getByID(long gridId); |
||||
|
||||
public List<Grid> getByFeature(Map<String, Object> params); |
||||
|
||||
public List<Grid> getByFeatureSimple(Map<String, Object> params); |
||||
|
||||
public List<Grid> getRoot(); |
||||
|
||||
public List<Grid> find(Map<String, Object> params); |
||||
|
||||
List<Grid> getList(); |
||||
|
||||
List<Grid> getGridMapByIds(@Param("gridIds") String gridIds); |
||||
} |
@ -0,0 +1,15 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.ccic.safeliab.entity.HrOrg; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
/** |
||||
* 大地hr系统保险机构表(机构+部门) |
||||
* @author lim |
||||
* @since 2022-09-24 |
||||
*/ |
||||
@Mapper |
||||
public interface HrOrgMapper extends BaseMapper<HrOrg> { |
||||
|
||||
} |
@ -0,0 +1,18 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.ccic.safeliab.entity.Industry; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
/** |
||||
* <p> |
||||
* 行业分类父表 Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-08-19 |
||||
*/ |
||||
@Mapper |
||||
public interface IndustryMapper extends BaseMapper<Industry> { |
||||
|
||||
} |
@ -0,0 +1,18 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.ccic.safeliab.entity.IndustryType; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
/** |
||||
* <p> |
||||
* 行业分类子表 Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-08-19 |
||||
*/ |
||||
@Mapper |
||||
public interface IndustryTypeMapper extends BaseMapper<IndustryType> { |
||||
|
||||
} |
@ -0,0 +1,22 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.ccic.safeliab.entity.InsOrgan; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* <p> |
||||
* Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-08-02 |
||||
*/ |
||||
@Mapper |
||||
public interface InsOrganMapper extends BaseMapper<InsOrgan> { |
||||
|
||||
List<InsOrgan> queryOrganIds(@Param("vestOrgan") String vestOrgan); |
||||
} |
@ -0,0 +1,30 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.ccic.safeliab.entity.Menu; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* <p> |
||||
* 菜单表 Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-07-29 |
||||
*/ |
||||
@Mapper |
||||
public interface MenuMapper extends BaseMapper<Menu> { |
||||
|
||||
/** |
||||
* 根据用户ID获取用户菜单 |
||||
* |
||||
* @param userId |
||||
* @return |
||||
*/ |
||||
List<Menu> getMenuByUserId(Long userId); |
||||
|
||||
void pageList(String roleMenu, Page<Menu> page); |
||||
} |
@ -0,0 +1,27 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.ccic.safeliab.entity.OrganAudit; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* <p> |
||||
* Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-08-03 |
||||
*/ |
||||
@Mapper |
||||
public interface OrganAuditMapper extends BaseMapper<OrganAudit> { |
||||
|
||||
/** |
||||
* 根据服务机构获取最新的数据 |
||||
* @return |
||||
*/ |
||||
List<OrganAudit> queryList(); |
||||
|
||||
OrganAudit queryOneByOrganId(long organId); |
||||
} |
@ -0,0 +1,51 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.ccic.safeliab.entity.Organ; |
||||
import com.ccic.safeliab.entity.ReCustomer; |
||||
import com.ccic.safeliab.entity.ReInsuranceOrgan; |
||||
import com.ccic.safeliab.entity.ReOrgan; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* <p> |
||||
* 机构表 Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-07-28 |
||||
*/ |
||||
@Mapper |
||||
public interface OrganMapper extends BaseMapper<Organ> { |
||||
public Organ findNameByOrganID(Long organId); |
||||
|
||||
public List<Organ> find(Map<String, Object> param); |
||||
|
||||
List<Organ> getOrganByUserId(@Param("organId") Long organId); |
||||
|
||||
IPage<ReOrgan> pageList(Page<ReOrgan> pageOrgan, @Param("map") Map<String, Object> map); |
||||
|
||||
ReOrgan getReOrganById(Long organId); |
||||
|
||||
List<Organ> getOrganByParam(@Param("map") Map<String, Object> map); |
||||
|
||||
List<Organ> queryOrganByMap(@Param("map") Map<String, Object> map); |
||||
|
||||
IPage<ReOrgan> pageCheckList(Page<ReOrgan> pageOrgan, @Param("map") Map<String, Object> map); |
||||
|
||||
List<Organ> getOrganAllChildLevel(@Param("organId") Long organId); |
||||
|
||||
List<ReOrgan> getOrganByParentId(@Param("map") Map<String, Object> map); |
||||
|
||||
ReOrgan getCustomerByOrganId(Long organId); |
||||
|
||||
IPage<ReInsuranceOrgan> pageCustomerList(Page<ReInsuranceOrgan> pageCustomer, @Param("map") Map<String, Object> map); |
||||
|
||||
List<Organ> getServiceOrganNum(@Param("param") Map<String, Object> param); |
||||
} |
@ -0,0 +1,14 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.ccic.safeliab.entity.OrganVisit; |
||||
import com.ccic.safeliab.entity.ReOrganVisit; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
|
||||
@Mapper |
||||
public interface OrganVisitMapper extends BaseMapper<OrganVisit> { |
||||
List<ReOrganVisit> queryByOrganId(@Param("organId") Long organId, @Param("loginOrganId") Long loginOrganId); |
||||
} |
@ -0,0 +1,9 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.ccic.safeliab.entity.OrganVisitRecord; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
@Mapper |
||||
public interface OrganVisitRecordMapper extends BaseMapper<OrganVisitRecord> { |
||||
} |
@ -0,0 +1,18 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.ccic.safeliab.entity.Policy; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
/** |
||||
* <p> |
||||
* 保单表 Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-08-16 |
||||
*/ |
||||
@Mapper |
||||
public interface PolicyMapper extends BaseMapper<Policy> { |
||||
|
||||
} |
@ -0,0 +1,22 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.ccic.safeliab.entity.Role; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* <p> |
||||
* 用户角色表 Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-07-28 |
||||
*/ |
||||
@Mapper |
||||
public interface RoleMapper extends BaseMapper<Role> { |
||||
|
||||
List<Role> find(); |
||||
} |
@ -0,0 +1,18 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.ccic.safeliab.entity.ServiceOrganAddon; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
/** |
||||
* <p> |
||||
* 服务机构附属信息表 Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-07-29 |
||||
*/ |
||||
@Mapper |
||||
public interface ServiceOrganAddonMapper extends BaseMapper<ServiceOrganAddon> { |
||||
|
||||
} |
@ -0,0 +1,9 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.ccic.safeliab.entity.SmartReaction; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
@Mapper |
||||
public interface SmartReactionMapper extends BaseMapper<SmartReaction> { |
||||
} |
@ -0,0 +1,18 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.ccic.safeliab.entity.SysOperLog; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
/** |
||||
* <p> |
||||
* Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-08-25 |
||||
*/ |
||||
@Mapper |
||||
public interface SysOperLogMapper extends BaseMapper<SysOperLog> { |
||||
|
||||
} |
@ -0,0 +1,22 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.ccic.safeliab.entity.TemplateOrgan; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* <p> |
||||
* 考评模版关联保险机构表 Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-08-02 |
||||
*/ |
||||
@Mapper |
||||
public interface TemplateOrganMapper extends BaseMapper<TemplateOrgan> { |
||||
public List<TemplateOrgan> findInsurance(@Param("param") Map<String, Object> param); |
||||
} |
@ -0,0 +1,31 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.ccic.safeliab.entity.UserAudit; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* <p> |
||||
* 专家用户审核表 Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-08-03 |
||||
*/ |
||||
@Mapper |
||||
public interface UserAuditMapper extends BaseMapper<UserAudit> { |
||||
|
||||
//创建审核数据,更改审核状态,审核记录(审核列表记录)
|
||||
public List<UserAudit> findListByUserID(Long userId); |
||||
|
||||
public UserAudit findLatestByUserID(Long userId); |
||||
|
||||
|
||||
public int insert(UserAudit userAudit); |
||||
|
||||
public void update(UserAudit userAudit); |
||||
|
||||
} |
@ -0,0 +1,18 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.ccic.safeliab.entity.UserCertification; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
/** |
||||
* <p> |
||||
* 专家资格证书表 Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-07-29 |
||||
*/ |
||||
@Mapper |
||||
public interface UserCertificationMapper extends BaseMapper<UserCertification> { |
||||
|
||||
} |
@ -0,0 +1,34 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.ccic.safeliab.entity.ReUserIdentificationSafety; |
||||
import com.ccic.safeliab.entity.UserIdentificationSafety; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* <p> |
||||
* 安责险专家认证表 Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-07-29 |
||||
*/ |
||||
@Mapper |
||||
public interface UserIdentificationSafetyMapper extends BaseMapper<UserIdentificationSafety> { |
||||
|
||||
//public void insert(UserIdentificationSafety safety);
|
||||
|
||||
void update(UserIdentificationSafety safety); |
||||
|
||||
ReUserIdentificationSafety getByID(Long userID); |
||||
|
||||
public List<UserIdentificationSafety> findExpert(Map<String, Object> params); |
||||
|
||||
Page<ReUserIdentificationSafety> expertListByInsur(Page<ReUserIdentificationSafety> page, @Param("map") Map<String, Object> map); |
||||
|
||||
} |
@ -0,0 +1,45 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.ccic.safeliab.entity.ReUser; |
||||
import com.ccic.safeliab.entity.User; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* <p> |
||||
* 用户表 Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-07-29 |
||||
*/ |
||||
@Mapper |
||||
public interface UserMapper extends BaseMapper<User> { |
||||
|
||||
Page<ReUser> find(Page<ReUser> page, @Param("map") Map<String, Object> map); |
||||
|
||||
List<User> findAll(@Param("map") Map<String, Object> map); |
||||
|
||||
public int insert(User user); |
||||
|
||||
public List<User> queryList(User user); |
||||
|
||||
public void insureUpdate(User user); |
||||
|
||||
public ReUser findUserDetail(Long userId); |
||||
|
||||
Page<ReUser> findThirdPartyUserList(Page<ReUser> page, @Param("map") Map<String, Object> map); |
||||
|
||||
public List<ReUser> insureFindListByServiceOrgan(@Param("map") Map<String, Object> map); |
||||
|
||||
public User getByPhone(@Param("phone") String phone, @Param("status") int status); |
||||
|
||||
public List<User> expertList(@Param("map") Map<String, Object> map); |
||||
|
||||
List<ReUser> findThirdPartyUserListNoPage(@Param("map") Map<String, Object> map); |
||||
} |
@ -0,0 +1,26 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.ccic.safeliab.entity.UserOrganAuth; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* <p> |
||||
* Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-07-29 |
||||
*/ |
||||
@Mapper |
||||
public interface UserOrganAuthMapper extends BaseMapper<UserOrganAuth> { |
||||
public List<UserOrganAuth> find(Map<String, Object> param); |
||||
|
||||
public void deleteAuthOrganByUserID(Long userId); |
||||
|
||||
// public int insert(UserOrganAuth userOrganAuth);
|
||||
|
||||
} |
@ -0,0 +1,18 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.ccic.safeliab.entity.UserOrgan; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
/** |
||||
* <p> |
||||
* Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-08-10 |
||||
*/ |
||||
@Mapper |
||||
public interface UserOrganMapper extends BaseMapper<UserOrgan> { |
||||
|
||||
} |
@ -0,0 +1,23 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.ccic.safeliab.entity.UserRole; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* <p> |
||||
* Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-10-21 |
||||
*/ |
||||
@Mapper |
||||
public interface UserRoleMapper extends BaseMapper<UserRole> { |
||||
|
||||
List<Long> queryUserId(@Param("map") Map<String, Object> map); |
||||
} |
@ -0,0 +1,9 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.ccic.safeliab.entity.UserToken; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
@Mapper |
||||
public interface UserTokenMapper extends BaseMapper<UserToken> { |
||||
} |
@ -0,0 +1,9 @@ |
||||
package com.ccic.safeliab.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.ccic.safeliab.entity.Warning; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
@Mapper |
||||
public interface WarningMapper extends BaseMapper<Warning> { |
||||
} |
@ -0,0 +1,24 @@ |
||||
package com.ccic.safeliab.entity; |
||||
|
||||
import lombok.Data; |
||||
|
||||
import java.time.LocalDate; |
||||
|
||||
@Data |
||||
public class IdCardInfo { |
||||
|
||||
/** |
||||
* 年龄 |
||||
*/ |
||||
private Integer age; |
||||
|
||||
/** |
||||
* 联系人性别1 -男,2-女 |
||||
*/ |
||||
private Integer sex; |
||||
|
||||
/** |
||||
* 生日 |
||||
*/ |
||||
private LocalDate birthday; |
||||
} |
@ -0,0 +1,18 @@ |
||||
package com.ccic.safeliab.entity; |
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude; |
||||
import lombok.Data; |
||||
|
||||
import java.util.List; |
||||
|
||||
@Data |
||||
public class ReCheckTemplate extends CheckTemplate { |
||||
//拼接的归属机构名称
|
||||
private String insuranceNames; |
||||
|
||||
//适用归属机构
|
||||
private List insuranceName; |
||||
|
||||
//考评项
|
||||
private List checkItem; |
||||
} |
@ -0,0 +1,11 @@ |
||||
package com.ccic.safeliab.entity; |
||||
|
||||
import lombok.Data; |
||||
|
||||
import java.util.List; |
||||
|
||||
@Data |
||||
public class ReCustomer extends Customer { |
||||
private List<User> safetyUserList; |
||||
|
||||
} |
@ -0,0 +1,11 @@ |
||||
package com.ccic.safeliab.entity; |
||||
|
||||
import lombok.Data; |
||||
|
||||
import java.util.List; |
||||
|
||||
@Data |
||||
public class ReInsuranceOrgan extends InsuranceOrgan { |
||||
private List<User> safetyUserList; |
||||
private String customerNo; |
||||
} |
@ -0,0 +1,8 @@ |
||||
package com.ccic.safeliab.entity; |
||||
|
||||
import lombok.Data; |
||||
|
||||
@Data |
||||
public class ReMenu extends Menu { |
||||
private String test; |
||||
} |
@ -0,0 +1,60 @@ |
||||
package com.ccic.safeliab.entity; |
||||
|
||||
import lombok.Data; |
||||
|
||||
import java.util.List; |
||||
|
||||
@Data |
||||
public class ReOrgan extends Organ { |
||||
|
||||
//所在地区名称
|
||||
private String gridName; |
||||
|
||||
//服务地区名称
|
||||
private String gridNames; |
||||
|
||||
//服务机构关联数据
|
||||
private ServiceOrganAddon addon; |
||||
|
||||
/** |
||||
* 可服务机构名称 |
||||
*/ |
||||
private String insOrganName; |
||||
|
||||
/** |
||||
* 可服务机构Id |
||||
*/ |
||||
private String insOrganId; |
||||
|
||||
/** |
||||
* 企业账号管理关联数据 |
||||
*/ |
||||
private List<UserOrgan> UserOrgans; |
||||
|
||||
|
||||
//脱敏手机号
|
||||
private String desensitizationContactPhone; |
||||
|
||||
private String desensitizationLegalPhone; |
||||
|
||||
//初始账号/密码
|
||||
private String account; |
||||
private String password; |
||||
|
||||
private String code;//网格code码
|
||||
|
||||
private String sonOrganIds; |
||||
|
||||
private Customer customer; |
||||
|
||||
//企业相关用户
|
||||
private List<User> customerUsers; |
||||
|
||||
|
||||
//是否允许编辑
|
||||
private Integer isEdit; |
||||
|
||||
//是否显示下级退回按钮
|
||||
private Integer visibleReturnedBtn; |
||||
|
||||
} |
@ -0,0 +1,12 @@ |
||||
package com.ccic.safeliab.entity; |
||||
|
||||
import lombok.Data; |
||||
|
||||
import java.util.List; |
||||
|
||||
@Data |
||||
public class ReOrganVisit extends OrganVisit { |
||||
|
||||
private List<OrganVisitRecord> organVisitRecords; |
||||
|
||||
} |
@ -0,0 +1,60 @@ |
||||
package com.ccic.safeliab.entity; |
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import com.fasterxml.jackson.annotation.JsonInclude; |
||||
import lombok.Data; |
||||
|
||||
import java.util.List; |
||||
|
||||
@Data |
||||
public class ReUser extends User { |
||||
|
||||
private String authOrganNames; |
||||
|
||||
private String authOrganIds; |
||||
|
||||
private String gridName; |
||||
|
||||
private Long gridId; |
||||
|
||||
//认证状态
|
||||
private Integer certificationStatus; |
||||
|
||||
//专家认证信息
|
||||
private ReUserIdentificationSafety identification; |
||||
|
||||
//安全生产资质信息
|
||||
private List<UserCertification> certifications; |
||||
|
||||
private String roleName; |
||||
|
||||
private Integer sex; |
||||
|
||||
private Integer age; |
||||
private String skilledWorkName; |
||||
private String scopeGridName; |
||||
|
||||
private String rejectReason; |
||||
|
||||
private String feature; |
||||
|
||||
private Integer isSup; |
||||
|
||||
private Integer reportCollection; |
||||
//角色菜单数据
|
||||
private String roleMenu; |
||||
//机构父级ID
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING) |
||||
private Long parentId; |
||||
|
||||
|
||||
//脱敏手机号
|
||||
private String desensitizationPhone; |
||||
|
||||
//脱敏身份证号
|
||||
private String desensitizationIdNumber; |
||||
|
||||
//用户角色
|
||||
private String roleIds; |
||||
|
||||
} |
@ -0,0 +1,34 @@ |
||||
package com.ccic.safeliab.entity; |
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude; |
||||
import lombok.Data; |
||||
|
||||
@Data |
||||
public class ReUserIdentificationSafety extends UserIdentificationSafety { |
||||
|
||||
private String gridName; |
||||
|
||||
private String scopeGridName; |
||||
|
||||
//用户工号,姓名,所属机构,所属地区,账号状态,审核方,擅长领域,主要服务行业,认证状态
|
||||
|
||||
private String userName; |
||||
|
||||
private String organName; |
||||
|
||||
private Integer userStatus;//用户状态
|
||||
|
||||
private String auditOrganName; |
||||
|
||||
private Integer certificationStatus; |
||||
|
||||
private String userNo; |
||||
|
||||
private Integer auditStatus; |
||||
|
||||
private String phone; |
||||
|
||||
private Long roleId; |
||||
|
||||
private String roleName; |
||||
} |
@ -0,0 +1,16 @@ |
||||
package com.ccic.safeliab.entity; |
||||
|
||||
import lombok.Data; |
||||
|
||||
@Data |
||||
public class TestEntityVO { |
||||
|
||||
private String wechatOpenId; |
||||
|
||||
private String sessionKey; |
||||
|
||||
private String encryptedData; |
||||
|
||||
private String iv; |
||||
|
||||
} |
@ -0,0 +1,42 @@ |
||||
package com.ccic.safeliab.entity; |
||||
|
||||
import java.util.Map; |
||||
|
||||
public class WxMessageTemplate { |
||||
private String touser;//用户openid
|
||||
private String template_id;//订阅消息模版id
|
||||
private String page = "pages/index/index";//默认跳到小程序首页
|
||||
private Map<String, WxTemplateData> data;//推送文字
|
||||
|
||||
public String getTouser() { |
||||
return touser; |
||||
} |
||||
|
||||
public void setTouser(String touser) { |
||||
this.touser = touser; |
||||
} |
||||
|
||||
public String getTemplate_id() { |
||||
return template_id; |
||||
} |
||||
|
||||
public void setTemplate_id(String template_id) { |
||||
this.template_id = template_id; |
||||
} |
||||
|
||||
public String getPage() { |
||||
return page; |
||||
} |
||||
|
||||
public void setPage(String page) { |
||||
this.page = page; |
||||
} |
||||
|
||||
public Map<String, WxTemplateData> getData() { |
||||
return data; |
||||
} |
||||
|
||||
public void setData(Map<String, WxTemplateData> data) { |
||||
this.data = data; |
||||
} |
||||
} |
@ -0,0 +1,17 @@ |
||||
package com.ccic.safeliab.entity; |
||||
|
||||
public class WxTemplateData { |
||||
private String value;//
|
||||
|
||||
public WxTemplateData(String value) { |
||||
this.value = value; |
||||
} |
||||
|
||||
public String getValue() { |
||||
return value; |
||||
} |
||||
|
||||
public void setValue(String value) { |
||||
this.value = value; |
||||
} |
||||
} |
@ -0,0 +1,102 @@ |
||||
package com.ccic.safeliab.filter; |
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect; |
||||
import com.fasterxml.jackson.annotation.PropertyAccessor; |
||||
import com.fasterxml.jackson.databind.ObjectMapper; |
||||
import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator; |
||||
import io.lettuce.core.ReadFrom; |
||||
import org.springframework.boot.autoconfigure.data.redis.RedisProperties; |
||||
import org.springframework.context.annotation.Bean; |
||||
import org.springframework.context.annotation.Configuration; |
||||
import org.springframework.context.annotation.Primary; |
||||
import org.springframework.data.redis.connection.RedisConnectionFactory; |
||||
import org.springframework.data.redis.connection.RedisSentinelConfiguration; |
||||
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; |
||||
import org.springframework.data.redis.connection.lettuce.LettucePoolingClientConfiguration; |
||||
import org.springframework.data.redis.core.RedisTemplate; |
||||
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; |
||||
import org.springframework.data.redis.serializer.StringRedisSerializer; |
||||
|
||||
import java.text.SimpleDateFormat; |
||||
import java.util.HashSet; |
||||
|
||||
/** |
||||
* @author 89524 |
||||
* @ClassName RedisConfiguration |
||||
* @description: TODO redis哨兵配置 |
||||
* @date 2023年09月18日 |
||||
* @version: 1.0 |
||||
*/ |
||||
@Configuration |
||||
public class RedisConfiguration { |
||||
|
||||
/** |
||||
* |
||||
* 配置redis序列化json |
||||
* @param redisConnectionFactory |
||||
* @return |
||||
*/ |
||||
@Bean |
||||
@Primary //若有相同类型的Bean时,优先使用此注解标注的Bean
|
||||
public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) { |
||||
// 为了开发方便,一般直接使用<String, Object>
|
||||
RedisTemplate<String, Object> template = new RedisTemplate<>(); |
||||
template.setConnectionFactory(redisConnectionFactory); |
||||
|
||||
// 配置具体的序列化方式
|
||||
// JSON解析任意对象
|
||||
Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class); |
||||
ObjectMapper om = new ObjectMapper(); |
||||
// 指定要序列化的域,field,get和set,以及修饰符范围,ANY是都有包括private和public
|
||||
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); |
||||
// 指定序列化输入的类型,类必须是非final修饰的,final修饰的类,比如String,Integer等会跑出异常
|
||||
om.activateDefaultTyping(LaissezFaireSubTypeValidator.instance, ObjectMapper.DefaultTyping.NON_FINAL); |
||||
// 设置日期格式
|
||||
om.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")); |
||||
jackson2JsonRedisSerializer.setObjectMapper(om); |
||||
// String的序列化
|
||||
StringRedisSerializer stringRedisSerializer = new StringRedisSerializer(); |
||||
|
||||
|
||||
//key采用String的序列化
|
||||
template.setKeySerializer(stringRedisSerializer); |
||||
//hash的key也采用String的序列化
|
||||
template.setHashKeySerializer(stringRedisSerializer); |
||||
//value的序列化方式采用jackson
|
||||
template.setValueSerializer(jackson2JsonRedisSerializer); |
||||
//hash的value序列化方式采用jackson
|
||||
template.setHashValueSerializer(jackson2JsonRedisSerializer); |
||||
//设置所有配置
|
||||
template.afterPropertiesSet(); |
||||
|
||||
return template; |
||||
} |
||||
|
||||
/** |
||||
* 配置读写分离 redis没有放开集群配置,没用,会报错! |
||||
* @param redisProperties |
||||
* @return |
||||
*/ |
||||
/*@Bean |
||||
public RedisConnectionFactory lettuceConnectionFactory(RedisProperties redisProperties) { |
||||
// 配置哨兵节点以及主节点
|
||||
RedisSentinelConfiguration redisSentinelConfiguration = new RedisSentinelConfiguration( |
||||
redisProperties.getSentinel().getMaster(), new HashSet<>(redisProperties.getSentinel().getNodes()) |
||||
); |
||||
|
||||
// 配置读写分离
|
||||
LettucePoolingClientConfiguration lettuceClientConfiguration = LettucePoolingClientConfiguration.builder() |
||||
// 读写分离,这里的ReadFrom是配置Redis的读取策略,是一个枚举,包括下面选择
|
||||
// MASTER 仅读取主节点
|
||||
// MASTER_PREFERRED 优先读取主节点,如果主节点不可用,则读取从节点
|
||||
// REPLICA_PREFERRED 优先读取从节点,如果从节点不可用,则读取主节点
|
||||
// REPLICA 仅读取从节点
|
||||
// NEAREST 从最近节点读取
|
||||
// ANY 从任意一个从节点读取
|
||||
.readFrom(ReadFrom.REPLICA_PREFERRED) |
||||
.build(); |
||||
|
||||
return new LettuceConnectionFactory(redisSentinelConfiguration, lettuceClientConfiguration); |
||||
}*/ |
||||
|
||||
} |
@ -0,0 +1,596 @@ |
||||
package com.ccic.safeliab.filter; |
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.data.redis.core.RedisTemplate; |
||||
import org.springframework.stereotype.Component; |
||||
import org.springframework.util.CollectionUtils; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.Set; |
||||
import java.util.concurrent.TimeUnit; |
||||
|
||||
@Component |
||||
public final class RedisUtil { |
||||
|
||||
@Autowired |
||||
private RedisTemplate<String, Object> redisTemplate; |
||||
|
||||
// =============================common============================
|
||||
|
||||
/** |
||||
* 指定缓存失效时间 |
||||
* |
||||
* @param key 键 |
||||
* @param time 时间(秒) |
||||
*/ |
||||
public boolean expire(String key, long time) { |
||||
try { |
||||
if (time > 0) { |
||||
redisTemplate.expire(key, time, TimeUnit.SECONDS); |
||||
} |
||||
return true; |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 根据key 获取过期时间 |
||||
* |
||||
* @param key 键 不能为null |
||||
* @return 时间(秒) 返回0代表为永久有效 |
||||
*/ |
||||
public long getExpire(String key) { |
||||
return redisTemplate.getExpire(key, TimeUnit.SECONDS); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 判断key是否存在 |
||||
* |
||||
* @param key 键 |
||||
* @return true 存在 false不存在 |
||||
*/ |
||||
public boolean hasKey(String key) { |
||||
try { |
||||
return redisTemplate.hasKey(key); |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 删除缓存 |
||||
* |
||||
* @param key 可以传一个值 或多个 |
||||
*/ |
||||
@SuppressWarnings("unchecked") |
||||
public void del(String... key) { |
||||
if (key != null && key.length > 0) { |
||||
if (key.length == 1) { |
||||
redisTemplate.delete(key[0]); |
||||
} else { |
||||
redisTemplate.delete(CollectionUtils.arrayToList(key)); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
// ============================String=============================
|
||||
|
||||
/** |
||||
* 普通缓存获取 |
||||
* |
||||
* @param key 键 |
||||
* @return 值 |
||||
*/ |
||||
public Object get(String key) { |
||||
try { |
||||
redisTemplate.opsForValue().get(key); |
||||
return redisTemplate.opsForValue().get(key); |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return null; |
||||
} |
||||
|
||||
//return key == null ? null : redisTemplate.opsForValue().get(key);
|
||||
} |
||||
|
||||
/** |
||||
* 普通缓存放入 |
||||
* |
||||
* @param key 键 |
||||
* @param value 值 |
||||
* @return true成功 false失败 |
||||
*/ |
||||
|
||||
public boolean set(String key, Object value) { |
||||
try { |
||||
redisTemplate.opsForValue().set(key, value); |
||||
return true; |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 普通缓存放入并设置时间 |
||||
* |
||||
* @param key 键 |
||||
* @param value 值 |
||||
* @param time 时间(秒) time要大于0 如果time小于等于0 将设置无限期 |
||||
* @return true成功 false 失败 |
||||
*/ |
||||
|
||||
public boolean set(String key, Object value, long time) { |
||||
try { |
||||
if (time > 0) { |
||||
redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS); |
||||
} else { |
||||
set(key, value); |
||||
} |
||||
return true; |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 递增 |
||||
* |
||||
* @param key 键 |
||||
* @param delta 要增加几(大于0) |
||||
*/ |
||||
public long incr(String key, long delta) { |
||||
if (delta < 0) { |
||||
throw new RuntimeException("递增因子必须大于0"); |
||||
} |
||||
return redisTemplate.opsForValue().increment(key, delta); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 递减 |
||||
* |
||||
* @param key 键 |
||||
* @param delta 要减少几(小于0) |
||||
*/ |
||||
public long decr(String key, long delta) { |
||||
if (delta < 0) { |
||||
throw new RuntimeException("递减因子必须大于0"); |
||||
} |
||||
return redisTemplate.opsForValue().increment(key, -delta); |
||||
} |
||||
|
||||
|
||||
// ================================Map=================================
|
||||
|
||||
/** |
||||
* HashGet |
||||
* |
||||
* @param key 键 不能为null |
||||
* @param item 项 不能为null |
||||
*/ |
||||
public Object hget(String key, String item) { |
||||
return redisTemplate.opsForHash().get(key, item); |
||||
} |
||||
|
||||
/** |
||||
* 获取hashKey对应的所有键值 |
||||
* |
||||
* @param key 键 |
||||
* @return 对应的多个键值 |
||||
*/ |
||||
public Map<Object, Object> hmget(String key) { |
||||
return redisTemplate.opsForHash().entries(key); |
||||
} |
||||
|
||||
/** |
||||
* HashSet |
||||
* |
||||
* @param key 键 |
||||
* @param map 对应多个键值 |
||||
*/ |
||||
public boolean hmset(String key, Map<String, Object> map) { |
||||
try { |
||||
redisTemplate.opsForHash().putAll(key, map); |
||||
return true; |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* HashSet 并设置时间 |
||||
* |
||||
* @param key 键 |
||||
* @param map 对应多个键值 |
||||
* @param time 时间(秒) |
||||
* @return true成功 false失败 |
||||
*/ |
||||
public boolean hmset(String key, Map<String, Object> map, long time) { |
||||
try { |
||||
redisTemplate.opsForHash().putAll(key, map); |
||||
if (time > 0) { |
||||
expire(key, time); |
||||
} |
||||
return true; |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 向一张hash表中放入数据,如果不存在将创建 |
||||
* |
||||
* @param key 键 |
||||
* @param item 项 |
||||
* @param value 值 |
||||
* @return true 成功 false失败 |
||||
*/ |
||||
public boolean hset(String key, String item, Object value) { |
||||
try { |
||||
redisTemplate.opsForHash().put(key, item, value); |
||||
return true; |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 向一张hash表中放入数据,如果不存在将创建 |
||||
* |
||||
* @param key 键 |
||||
* @param item 项 |
||||
* @param value 值 |
||||
* @param time 时间(秒) 注意:如果已存在的hash表有时间,这里将会替换原有的时间 |
||||
* @return true 成功 false失败 |
||||
*/ |
||||
public boolean hset(String key, String item, Object value, long time) { |
||||
try { |
||||
redisTemplate.opsForHash().put(key, item, value); |
||||
if (time > 0) { |
||||
expire(key, time); |
||||
} |
||||
return true; |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 删除hash表中的值 |
||||
* |
||||
* @param key 键 不能为null |
||||
* @param item 项 可以使多个 不能为null |
||||
*/ |
||||
public void hdel(String key, Object... item) { |
||||
redisTemplate.opsForHash().delete(key, item); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 判断hash表中是否有该项的值 |
||||
* |
||||
* @param key 键 不能为null |
||||
* @param item 项 不能为null |
||||
* @return true 存在 false不存在 |
||||
*/ |
||||
public boolean hHasKey(String key, String item) { |
||||
return redisTemplate.opsForHash().hasKey(key, item); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* hash递增 如果不存在,就会创建一个 并把新增后的值返回 |
||||
* |
||||
* @param key 键 |
||||
* @param item 项 |
||||
* @param by 要增加几(大于0) |
||||
*/ |
||||
public double hincr(String key, String item, double by) { |
||||
return redisTemplate.opsForHash().increment(key, item, by); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* hash递减 |
||||
* |
||||
* @param key 键 |
||||
* @param item 项 |
||||
* @param by 要减少记(小于0) |
||||
*/ |
||||
public double hdecr(String key, String item, double by) { |
||||
return redisTemplate.opsForHash().increment(key, item, -by); |
||||
} |
||||
|
||||
|
||||
// ============================set=============================
|
||||
|
||||
/** |
||||
* 根据key获取Set中的所有值 |
||||
* |
||||
* @param key 键 |
||||
*/ |
||||
public Set<Object> sGet(String key) { |
||||
try { |
||||
return redisTemplate.opsForSet().members(key); |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return null; |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 根据value从一个set中查询,是否存在 |
||||
* |
||||
* @param key 键 |
||||
* @param value 值 |
||||
* @return true 存在 false不存在 |
||||
*/ |
||||
public boolean sHasKey(String key, Object value) { |
||||
try { |
||||
return redisTemplate.opsForSet().isMember(key, value); |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 将数据放入set缓存 |
||||
* |
||||
* @param key 键 |
||||
* @param values 值 可以是多个 |
||||
* @return 成功个数 |
||||
*/ |
||||
public long sSet(String key, Object... values) { |
||||
try { |
||||
return redisTemplate.opsForSet().add(key, values); |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return 0; |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 将set数据放入缓存 |
||||
* |
||||
* @param key 键 |
||||
* @param time 时间(秒) |
||||
* @param values 值 可以是多个 |
||||
* @return 成功个数 |
||||
*/ |
||||
public long sSetAndTime(String key, long time, Object... values) { |
||||
try { |
||||
Long count = redisTemplate.opsForSet().add(key, values); |
||||
if (time > 0) |
||||
expire(key, time); |
||||
return count; |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return 0; |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 获取set缓存的长度 |
||||
* |
||||
* @param key 键 |
||||
*/ |
||||
public long sGetSetSize(String key) { |
||||
try { |
||||
return redisTemplate.opsForSet().size(key); |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return 0; |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 移除值为value的 |
||||
* |
||||
* @param key 键 |
||||
* @param values 值 可以是多个 |
||||
* @return 移除的个数 |
||||
*/ |
||||
|
||||
public long setRemove(String key, Object... values) { |
||||
try { |
||||
Long count = redisTemplate.opsForSet().remove(key, values); |
||||
return count; |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return 0; |
||||
} |
||||
} |
||||
|
||||
// ===============================list=================================
|
||||
|
||||
/** |
||||
* 获取list缓存的内容 |
||||
* |
||||
* @param key 键 |
||||
* @param start 开始 |
||||
* @param end 结束 0 到 -1代表所有值 |
||||
*/ |
||||
public List<Object> lGet(String key, long start, long end) { |
||||
try { |
||||
return redisTemplate.opsForList().range(key, start, end); |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return null; |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 获取list缓存的长度 |
||||
* |
||||
* @param key 键 |
||||
*/ |
||||
public long lGetListSize(String key) { |
||||
try { |
||||
return redisTemplate.opsForList().size(key); |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return 0; |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 通过索引 获取list中的值 |
||||
* |
||||
* @param key 键 |
||||
* @param index 索引 index>=0时, 0 表头,1 第二个元素,依次类推;index<0时,-1,表尾,-2倒数第二个元素,依次类推 |
||||
*/ |
||||
public Object lGetIndex(String key, long index) { |
||||
try { |
||||
return redisTemplate.opsForList().index(key, index); |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return null; |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 将list放入缓存 |
||||
* |
||||
* @param key 键 |
||||
* @param value 值 |
||||
*/ |
||||
public boolean lSet(String key, Object value) { |
||||
try { |
||||
redisTemplate.opsForList().rightPush(key, value); |
||||
return true; |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 将list放入缓存 |
||||
* |
||||
* @param key 键 |
||||
* @param value 值 |
||||
* @param time 时间(秒) |
||||
*/ |
||||
public boolean lSet(String key, Object value, long time) { |
||||
try { |
||||
redisTemplate.opsForList().rightPush(key, value); |
||||
if (time > 0) |
||||
expire(key, time); |
||||
return true; |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return false; |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
/** |
||||
* 将list放入缓存 |
||||
* |
||||
* @param key 键 |
||||
* @param value 值 |
||||
* @return |
||||
*/ |
||||
public boolean lSet(String key, List<Object> value) { |
||||
try { |
||||
redisTemplate.opsForList().rightPushAll(key, value); |
||||
return true; |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return false; |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
/** |
||||
* 将list放入缓存 |
||||
* |
||||
* @param key 键 |
||||
* @param value 值 |
||||
* @param time 时间(秒) |
||||
* @return |
||||
*/ |
||||
public boolean lSet(String key, List<Object> value, long time) { |
||||
try { |
||||
redisTemplate.opsForList().rightPushAll(key, value); |
||||
if (time > 0) |
||||
expire(key, time); |
||||
return true; |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 根据索引修改list中的某条数据 |
||||
* |
||||
* @param key 键 |
||||
* @param index 索引 |
||||
* @param value 值 |
||||
* @return |
||||
*/ |
||||
|
||||
public boolean lUpdateIndex(String key, long index, Object value) { |
||||
try { |
||||
redisTemplate.opsForList().set(key, index, value); |
||||
return true; |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 移除N个值为value |
||||
* |
||||
* @param key 键 |
||||
* @param count 移除多少个 |
||||
* @param value 值 |
||||
* @return 移除的个数 |
||||
*/ |
||||
|
||||
public long lRemove(String key, long count, Object value) { |
||||
try { |
||||
Long remove = redisTemplate.opsForList().remove(key, count, value); |
||||
return remove; |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return 0; |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
@ -0,0 +1,64 @@ |
||||
package com.ccic.safeliab.filter; |
||||
|
||||
import com.ccic.safeliab.util.CcicUtill; |
||||
import com.ccic.safeliab.util.JwtUtils; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Component; |
||||
import org.springframework.util.StringUtils; |
||||
import org.springframework.web.filter.OncePerRequestFilter; |
||||
|
||||
import javax.servlet.FilterChain; |
||||
import javax.servlet.ServletException; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import java.io.IOException; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
@Component |
||||
@Slf4j |
||||
public class TokenAuthenticationFilter extends OncePerRequestFilter { |
||||
|
||||
@Autowired |
||||
private RedisUtil redisUtil; |
||||
|
||||
@Override |
||||
protected void doFilterInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, FilterChain filterChain) throws ServletException, IOException { |
||||
//加入支持token的请求头
|
||||
/*HeaderMapRequestWrapper requestWrapper = new HeaderMapRequestWrapper(httpServletRequest); |
||||
requestWrapper.addHeader("Access-Control-Allow-Headers", "content-type,token");*/ |
||||
//System.out.println("经过了此过滤器");
|
||||
String uri = httpServletRequest.getRequestURI(); |
||||
if (uri.indexOf("login") > 0 || uri.indexOf("userLogin") > 0 || uri.indexOf("userMiniLogin") > 0 |
||||
|| uri.indexOf("getSmsCode") > 0 || uri.indexOf("userPhoneLogin") > 0 || uri.indexOf("getHrOrgan") > 0 || uri.indexOf("getHrUser") > 0 |
||||
|| uri.indexOf("auth") > 0 || uri.indexOf("h5login") > 0 || uri.indexOf("warning") > 0 || uri.indexOf("test") > 0 |
||||
|| uri.indexOf("subMessage") > 0 || uri.indexOf("pushSmartReaction") > 0 || uri.indexOf("deleteUserByExcel") > 0 |
||||
|| uri.indexOf("getGraphVerifyCode") > 0 || uri.indexOf("getOpenAuthToken") > 0) { |
||||
filterChain.doFilter(httpServletRequest, httpServletResponse); |
||||
return; |
||||
} |
||||
String token = httpServletRequest.getHeader("token"); |
||||
if (token == null || token == "") { |
||||
httpServletResponse.sendError(5000); |
||||
return; |
||||
} |
||||
//判断token是否失效
|
||||
if (!JwtUtils.checkToken(token)) { |
||||
httpServletResponse.sendError(5001); |
||||
return; |
||||
} |
||||
|
||||
//判断token是否注销
|
||||
String organType = JwtUtils.getMemberIdByJwtToken(httpServletRequest, "organType"); |
||||
if (!StringUtils.isEmpty(organType) && "1".equals(organType)) { |
||||
String userId = JwtUtils.getMemberIdByJwtToken(httpServletRequest, "id"); |
||||
if (!redisUtil.hasKey(userId)) { |
||||
httpServletResponse.sendError(5001); |
||||
return; |
||||
} |
||||
} |
||||
|
||||
filterChain.doFilter(httpServletRequest, httpServletResponse); |
||||
} |
||||
} |
@ -0,0 +1,19 @@ |
||||
package com.ccic.safeliab.service; |
||||
|
||||
import com.ccic.safeliab.dao.DictDao; |
||||
import com.ccic.safeliab.entity.Dict; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
|
||||
@Service |
||||
public class DictService { |
||||
@Autowired |
||||
private DictDao dictDao; |
||||
|
||||
public List<Dict> find() { |
||||
List<Dict> list = dictDao.find(); |
||||
return list; |
||||
} |
||||
} |
@ -0,0 +1,27 @@ |
||||
package com.ccic.safeliab.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.ccic.safeliab.dao.DictValDao; |
||||
import com.ccic.safeliab.dao.OrganMapper; |
||||
import com.ccic.safeliab.entity.DictVal; |
||||
import com.ccic.safeliab.entity.Organ; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
|
||||
@Service |
||||
public class DictValService extends ServiceImpl<DictValDao, DictVal> { |
||||
@Autowired |
||||
DictValDao dictValDao; |
||||
|
||||
public List<DictVal> find(DictVal dictId) { |
||||
//List<DictVal> list = dictValDao.find(dictId);
|
||||
QueryWrapper<DictVal> wrapper = new QueryWrapper<>(); |
||||
wrapper.eq("dict_id",dictId.getDictId()); |
||||
wrapper.orderByAsc("order_val"); |
||||
List<DictVal> list = dictValDao.selectList(wrapper); |
||||
return list; |
||||
} |
||||
} |
@ -0,0 +1,24 @@ |
||||
package com.ccic.safeliab.service; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.ccic.safeliab.entity.EarlyWarningMessage; |
||||
import com.ccic.safeliab.entity.User; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* 巨灾预警 |
||||
* |
||||
* @author Lim |
||||
* @since 2022-11-24 |
||||
*/ |
||||
public interface EarlyWarningMessageService { |
||||
|
||||
Page<EarlyWarningMessage> getList(Integer pageNum, Integer pageSize, Map<String, Object> params, User userMsg); |
||||
|
||||
EarlyWarningMessage show(Long Id); |
||||
|
||||
boolean edit(Long Id); |
||||
} |
@ -0,0 +1,180 @@ |
||||
package com.ccic.safeliab.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.ccic.safeliab.dao.GridDao; |
||||
import com.ccic.safeliab.entity.Grid; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.util.StringUtils; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.HashMap; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
|
||||
@Service |
||||
public class GridService extends ServiceImpl<GridDao,Grid> { |
||||
|
||||
@Autowired |
||||
private GridDao gridDao; |
||||
|
||||
public String getName(Long gridID) { |
||||
StringBuilder name = new StringBuilder(""); |
||||
|
||||
//Grid grid = gridDao.getByID(gridID);
|
||||
QueryWrapper<Grid> wrapper = new QueryWrapper<>(); |
||||
wrapper.eq("grid_id",gridID); |
||||
Grid grid = gridDao.selectOne(wrapper); |
||||
if (grid == null) { |
||||
return ""; |
||||
} else { |
||||
String feature = grid.getFeature(); |
||||
String[] ids = StringUtils.delimitedListToStringArray(feature, ","); |
||||
for (String s : ids) { |
||||
Long id = Long.parseLong(s.trim()); |
||||
Grid g = gridDao.getByID(id); |
||||
name.append(g.getGridName()); |
||||
} |
||||
} |
||||
|
||||
return name.toString(); |
||||
} |
||||
|
||||
/** |
||||
* 获取map,gridId为键 |
||||
* |
||||
* @return |
||||
*/ |
||||
public Map<Long, Grid> getGridMap() { |
||||
List<Grid> list = gridDao.getList(); |
||||
Map<Long, Grid> gridMap = list.stream().collect(Collectors.toMap(Grid::getGridId, grid -> grid)); |
||||
return gridMap; |
||||
} |
||||
|
||||
|
||||
public List<Grid> gridList() { |
||||
List<Grid> list = gridDao.getList(); |
||||
return list; |
||||
} |
||||
|
||||
public List<Grid> getRoot() { |
||||
List<Grid> list = gridDao.getRoot(); |
||||
for (Grid grid : list) { |
||||
Map<String, Object> map = new HashMap<>(); |
||||
map.put("parentId", grid.getGridId()); |
||||
//List<Grid> grids = gridDao.find(map);
|
||||
QueryWrapper<Grid> wrapper = new QueryWrapper<>(); |
||||
wrapper.eq("parent_id",grid.getGridId()); |
||||
List<Grid> grids = baseMapper.selectList(wrapper); |
||||
if (grids != null && grids.size() > 0) { |
||||
grid.setHasChildren(true); |
||||
} else { |
||||
grid.setHasChildren(false); |
||||
} |
||||
} |
||||
|
||||
return list; |
||||
} |
||||
|
||||
public List<Grid> show(Long[] gridId) { |
||||
List<Grid> list = new ArrayList<>(); |
||||
|
||||
for (int i = 0; i < gridId.length; i++) { |
||||
if (gridId[i] != null) { |
||||
//Grid grid = gridDao.getByID(gridId[i]);
|
||||
QueryWrapper<Grid> wrapper = new QueryWrapper<>(); |
||||
wrapper.eq("grid_id",gridId[i]); |
||||
Grid grid = baseMapper.selectOne(wrapper); |
||||
if (grid != null) { |
||||
list.add(grid); |
||||
} |
||||
} |
||||
} |
||||
|
||||
return list; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 获得gridID代表的网格的子网格,oneLevel为true则只取直接子网格,为false则为全部 |
||||
* |
||||
* @param gridId |
||||
* @param oneLevel |
||||
* @return |
||||
*/ |
||||
public List<Grid> sub(Long gridId, Boolean oneLevel) { |
||||
/*Map<String, Object> params = new HashMap<>(); |
||||
params.put("parentId", gridId); |
||||
params.put("oneLevel", oneLevel); |
||||
List<Grid> list = gridDao.getByFeature(params);*/ |
||||
QueryWrapper<Grid> wrapper = new QueryWrapper<>(); |
||||
wrapper.eq("parent_id",gridId); |
||||
if(!oneLevel){ |
||||
wrapper.apply("position(CONCAT(',',{0},',') IN CONCAT(',',feature,',') ) > 0",gridId); |
||||
} |
||||
List<Grid> list = baseMapper.selectList(wrapper); |
||||
for (Grid grid : list) { |
||||
/*Map<String, Object> map = new HashMap<>(); |
||||
map.put("parentId", grid.getGridId()); |
||||
List<Grid> grids = gridDao.find(map);*/ |
||||
QueryWrapper<Grid> queryWrapper = new QueryWrapper<>(); |
||||
queryWrapper.eq("parent_id",grid.getGridId()); |
||||
List<Grid> grids = baseMapper.selectList(queryWrapper); |
||||
if (grids != null && grids.size() > 0) { |
||||
grid.setHasChildren(true); |
||||
} else { |
||||
grid.setHasChildren(false); |
||||
} |
||||
} |
||||
return list; |
||||
} |
||||
|
||||
|
||||
public Grid getGridDetail(Long gridID) { |
||||
//Grid grid = gridDao.getByID(gridID);
|
||||
QueryWrapper<Grid> wrapper = new QueryWrapper<>(); |
||||
wrapper.eq("grid_id",gridID); |
||||
Grid grid = gridDao.selectOne(wrapper); |
||||
if (grid == null) { |
||||
return null; |
||||
} |
||||
return grid; |
||||
} |
||||
|
||||
|
||||
public List<Grid> getGridByParent(Long gridId) { |
||||
//Grid selfGrid = gridDao.getByID(gridId);
|
||||
Grid selfGrid = baseMapper.getByID(gridId); |
||||
Map<String, Object> parentMap = new HashMap<>(); |
||||
parentMap.put("parentId", gridId); |
||||
//List<Grid> list = gridDao.find(parentMap);
|
||||
QueryWrapper<Grid> queryWrapper = new QueryWrapper<>(); |
||||
queryWrapper.eq("parent_id",gridId); |
||||
List<Grid> list = baseMapper.selectList(queryWrapper); |
||||
list.add(0, selfGrid); |
||||
for (Grid grid : list) { |
||||
Map<String, Object> map = new HashMap<>(); |
||||
map.put("parentId", grid.getGridId()); |
||||
//List<Grid> grids = gridDao.find(map);
|
||||
QueryWrapper<Grid> wrapper = new QueryWrapper<>(); |
||||
wrapper.eq("parent_id",grid.getGridId()); |
||||
List<Grid> grids = baseMapper.selectList(wrapper); |
||||
if (grids != null && grids.size() > 0) { |
||||
grid.setHasChildren(true); |
||||
} else { |
||||
grid.setHasChildren(false); |
||||
} |
||||
} |
||||
|
||||
return list; |
||||
} |
||||
|
||||
|
||||
public Map<Long, Grid> getGridMapByIds(String gridIds) { |
||||
List<Grid> list = gridDao.getGridMapByIds(gridIds); |
||||
Map<Long, Grid> gridMap = list.stream().collect(Collectors.toMap(Grid::getGridId, grid -> grid)); |
||||
return gridMap; |
||||
} |
||||
} |
@ -0,0 +1,20 @@ |
||||
package com.ccic.safeliab.service; |
||||
|
||||
import com.ccic.safeliab.entity.AuditOperateRecord; |
||||
import com.ccic.safeliab.entity.AuditOperateRecord; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* <p> |
||||
* 服务类 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-08-08 |
||||
*/ |
||||
public interface IAuditOperateRecordService extends IService<AuditOperateRecord> { |
||||
|
||||
List<AuditOperateRecord> recordList(Long businessId, String businessType); |
||||
} |
@ -0,0 +1,15 @@ |
||||
package com.ccic.safeliab.service; |
||||
import com.ccic.safeliab.entity.CheckTemplateItem; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* <p> |
||||
* 考评项(考评模版的考评项) 服务类 |
||||
* </p> |
||||
* |
||||
* @author cqw |
||||
* @since 2022-08-05 |
||||
*/ |
||||
public interface ICheckTemplateItemService extends IService<CheckTemplateItem> { |
||||
|
||||
} |
@ -0,0 +1,35 @@ |
||||
package com.ccic.safeliab.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.ccic.safeliab.entity.CheckTemplate; |
||||
import com.ccic.safeliab.entity.ReCheckTemplate; |
||||
import com.ccic.safeliab.entity.User; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* <p> |
||||
* 考评模版 服务类 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-08-02 |
||||
*/ |
||||
public interface ICheckTemplateService extends IService<CheckTemplate> { |
||||
|
||||
Page<ReCheckTemplate> findTemplateList(Integer pageNum, Integer pageSize, Map<String, Object> map); |
||||
|
||||
ReCheckTemplate getCheckTemplate(Long templateId); |
||||
|
||||
boolean deleteTemplate(@RequestParam Long templateId,User userMsg); |
||||
|
||||
boolean addTemplate(@RequestParam Map<String, Object> map, User loginUser) throws Exception; |
||||
|
||||
boolean editTemplate(@RequestParam Map<String, Object> map, User loginUser, Long templateId) throws Exception; |
||||
|
||||
|
||||
List<ReCheckTemplate> getList(Map<String, Object> map); |
||||
} |
@ -0,0 +1,14 @@ |
||||
package com.ccic.safeliab.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.ccic.safeliab.entity.Account; |
||||
import com.ccic.safeliab.entity.User; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
public interface ICompanyUserService extends IService<User> { |
||||
|
||||
List<Account> findOpenIdByCompanyIds(Map<String, Object> params); |
||||
|
||||
} |
@ -0,0 +1,35 @@ |
||||
package com.ccic.safeliab.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.ccic.safeliab.entity.Device; |
||||
import com.ccic.safeliab.entity.SmartReaction; |
||||
import com.ccic.safeliab.entity.User; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* <p> |
||||
* 设备(烟感)表 服务类 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2023-01-06 |
||||
*/ |
||||
public interface IDeviceService extends IService<Device> { |
||||
|
||||
boolean deviceBinding(Map<String, Object> map, User user); |
||||
|
||||
Page<Device> pageList(Integer pageNum, Integer pageSize, Map<String, Object> map); |
||||
|
||||
Device getDeviceById(String deviceCode); |
||||
|
||||
List<Device> deviceShowList(String deviceCodes); |
||||
|
||||
Page<Device> deviceMapMaker(Integer pageNum, Integer pageSize, Map<String, Object> map); |
||||
|
||||
Page<SmartReaction> smartPageList(Integer pageNum, Integer pageSize, Map<String, Object> map); |
||||
|
||||
|
||||
} |
@ -0,0 +1,60 @@ |
||||
package com.ccic.safeliab.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.ccic.safeliab.entity.DockingData; |
||||
import com.ccic.safeliab.entity.Organ; |
||||
import com.ccic.safeliab.entity.User; |
||||
import com.ccic.safeliab.entity.*; |
||||
import com.ccic.safeliab.entity.res.*; |
||||
import com.ccic.safeliab.entity.res.RequestBody; |
||||
|
||||
import javax.servlet.http.HttpServletRequest; |
||||
import java.util.Map; |
||||
|
||||
public interface IDockingDataService extends IService<DockingData> { |
||||
|
||||
/** |
||||
* 同步用户信息 |
||||
* @param map |
||||
* @return |
||||
*/ |
||||
boolean synchUser(Map<String,Object> map, HttpServletRequest request); |
||||
boolean synchInsurOrgan(Map<String,Object> map, HttpServletRequest request); |
||||
|
||||
/** |
||||
* 与理赔app人员权限同步接口 |
||||
* @param user |
||||
* @param request |
||||
* @return 0:成功 1:参数错误 2:同步失败 |
||||
*/ |
||||
Map<String, Object> synUserAuth(User user, HttpServletRequest request) throws Exception; |
||||
|
||||
boolean syncUserAuth(User user, HttpServletRequest request); |
||||
|
||||
ResponseHead sendMsg(SendMsgParam sendMsgParam); |
||||
|
||||
/** |
||||
* 向大地同步第三方机构信息 |
||||
* @param requestBody |
||||
* @return |
||||
*/ |
||||
Map<String, Object> syncThirdOrgan(RequestBody requestBody); |
||||
|
||||
/** |
||||
* 向大地同步第三方用户信息 |
||||
* @param requestBody |
||||
* @return |
||||
*/ |
||||
Map<String, Object> syncThirdUser(RequestBody requestBody); |
||||
|
||||
boolean syncTodoTask(TodoTask todoTask, HttpServletRequest request); |
||||
|
||||
/** |
||||
* 同步巨灾预警数据 |
||||
* @param map |
||||
* @return |
||||
*/ |
||||
boolean synchWarning(Map<String,Object> map, HttpServletRequest request); |
||||
|
||||
boolean pushSmartReaction(Map<String, Object> param); |
||||
} |
@ -0,0 +1,24 @@ |
||||
package com.ccic.safeliab.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.ccic.safeliab.entity.User; |
||||
import com.ccic.safeliab.entity.ReUser; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
public interface IExpertService extends IService<User> { |
||||
Page<ReUser> userList(Integer pageNum, Integer pageSize, Map<String, Object> map); |
||||
|
||||
ReUser userInfo(Long userID); |
||||
|
||||
Page<ReUser> userAuditList(Integer pageNum, Integer pageSize, Map<String, Object> map); |
||||
|
||||
List<ReUser> insureExpertListByServiceOrgan(Map<String, Object> map); |
||||
|
||||
Page<ReUser> expertListByServiceOrgan(Integer pageNum, Integer pageSize, Map<String, Object> map); |
||||
|
||||
ReUser findExpertCertificationStatus(Long userId); |
||||
|
||||
} |
@ -0,0 +1,17 @@ |
||||
package com.ccic.safeliab.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.ccic.safeliab.entity.Industry; |
||||
|
||||
|
||||
/** |
||||
* <p> |
||||
* 行业分类父表 服务类 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-08-19 |
||||
*/ |
||||
public interface IIndustryService extends IService<Industry> { |
||||
|
||||
} |
@ -0,0 +1,17 @@ |
||||
package com.ccic.safeliab.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.ccic.safeliab.entity.IndustryType; |
||||
|
||||
|
||||
/** |
||||
* <p> |
||||
* 行业分类子表 服务类 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-08-19 |
||||
*/ |
||||
public interface IIndustryTypeService extends IService<IndustryType> { |
||||
|
||||
} |
@ -0,0 +1,29 @@ |
||||
package com.ccic.safeliab.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.ccic.safeliab.entity.Menu; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* <p> |
||||
* 菜单表 服务类 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-07-29 |
||||
*/ |
||||
public interface IMenuService extends IService<Menu> { |
||||
|
||||
List<Menu> getMenuByUserId(Long userId); |
||||
|
||||
boolean addMenu(Map<String, Object> map); |
||||
|
||||
Page<Menu> pageList(Integer pageNum, Integer pageSize, Map<String,Object> map); |
||||
|
||||
List<Menu> queryMenuByRoleId(Long roleId); |
||||
|
||||
String queryMenuByUserId(Long userId); |
||||
} |
@ -0,0 +1,69 @@ |
||||
package com.ccic.safeliab.service; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.ccic.safeliab.entity.*; |
||||
import com.ccic.safeliab.service.impl.OrganServiceImpl; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* <p> |
||||
* 机构表 服务类 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-07-28 |
||||
*/ |
||||
public interface IOrganService extends IService<Organ> { |
||||
|
||||
Page<ReOrgan> pageList(Integer pageNum, Integer pageSize, Map<String, Object> map); |
||||
|
||||
List<Organ> getOrganByUserId(Long userId); |
||||
|
||||
List<Organ> getOrganByOrganId(Long organId); |
||||
|
||||
Account addOrgan(Map<String, Object> map, Long workId, User user) throws Exception; |
||||
|
||||
Page<ReOrgan> pageCheckList(Integer pageNum, Integer pageSize, Map<String, Object> map); |
||||
|
||||
ReOrgan getReOrganById(Long organId, User userMsg); |
||||
|
||||
boolean editOrganById(Map<String, Object> map, User user) throws Exception; |
||||
|
||||
Map<String, Object> auditOrgan(Map<String, Object> map, User user); |
||||
|
||||
Page<ReOrgan> getFirmAccountPageList(Integer pageNum, Integer pageSize, Map<String, Object> map); |
||||
|
||||
UserOrgan untiePhone(Map<String, Object> map); |
||||
|
||||
List<Organ> queryListByUser(User userMsg, Map<String, Object> map); |
||||
|
||||
UserOrgan getCompanySafetyPeople(Long organId); |
||||
|
||||
Map<String, Object> getParentOrgan(Long organId); |
||||
|
||||
List<Organ> getSubOrgans(Map<String, Object> map, User userMsg); |
||||
|
||||
List<Organ> getOrganByParam(Map<String, Object> param); |
||||
|
||||
OrganServiceImpl.WaitHandle getServiceAgencyReviewNum(Long organId, Long userId); |
||||
|
||||
boolean tsOrgan(Map<String, Object> map, Long workId, User user); |
||||
|
||||
List<User> getBillUserByOrganId(Long organId); |
||||
|
||||
int getOrganBlocklogCount(Long organId); |
||||
|
||||
boolean tsOrganDel(Long organId, User user); |
||||
|
||||
List<ReOrgan> getOrganAllChildLevel(Map<String, Object> param); |
||||
|
||||
ReOrgan getCustomerByOrganId(Long organId, User user); |
||||
|
||||
Page<ReInsuranceOrgan> getCustomerPageList(Integer pageNum, Integer pageSize, Map<String, Object> map); |
||||
|
||||
Map<String, Object> getServiceOrganNum(Map<String, Object> param); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.ccic.safeliab.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.ccic.safeliab.entity.OrganVisitRecord; |
||||
|
||||
public interface IOrganVisitRecordService extends IService<OrganVisitRecord> { |
||||
} |
@ -0,0 +1,15 @@ |
||||
package com.ccic.safeliab.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.ccic.safeliab.entity.OrganVisit; |
||||
import com.ccic.safeliab.entity.ReOrganVisit; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
public interface IOrganVisitService extends IService<OrganVisit> { |
||||
|
||||
boolean addVisit(Map<String, Object> param); |
||||
|
||||
List<ReOrganVisit> getVisitByOrganId(Long organId, Long loginOrganId); |
||||
} |
@ -0,0 +1,22 @@ |
||||
package com.ccic.safeliab.service; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.ccic.safeliab.entity.Role; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* <p> |
||||
* 用户角色表 服务类 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-07-28 |
||||
*/ |
||||
public interface IRoleService extends IService<Role> { |
||||
|
||||
List<Role> find(); |
||||
|
||||
boolean deleteRole(Long roleId); |
||||
} |
@ -0,0 +1,16 @@ |
||||
package com.ccic.safeliab.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.ccic.safeliab.entity.TemplateOrgan; |
||||
|
||||
/** |
||||
* <p> |
||||
* 考评模版关联保险机构表 服务类 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-08-02 |
||||
*/ |
||||
public interface ITemplateOrganService extends IService<TemplateOrgan> { |
||||
|
||||
} |
@ -0,0 +1,26 @@ |
||||
package com.ccic.safeliab.service; |
||||
|
||||
import com.ccic.safeliab.entity.UserAudit; |
||||
import com.ccic.safeliab.entity.Organ; |
||||
import com.ccic.safeliab.entity.User; |
||||
import com.ccic.safeliab.entity.UserAudit; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* <p> |
||||
* 专家用户审核表 服务类 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-08-03 |
||||
*/ |
||||
public interface IUserAuditService extends IService<UserAudit> { |
||||
|
||||
List<UserAudit> userAuditRecord(Long userId); |
||||
|
||||
boolean userAudit(@RequestParam Map<String, Object> map, User loginUser) throws Exception; |
||||
} |
@ -0,0 +1,18 @@ |
||||
package com.ccic.safeliab.service; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.ccic.safeliab.entity.User; |
||||
import com.ccic.safeliab.entity.UserIdentificationSafety; |
||||
import com.ccic.safeliab.entity.ReUserIdentificationSafety; |
||||
|
||||
import java.util.Map; |
||||
|
||||
public interface IUserIdentificationSafetyService extends IService<UserIdentificationSafety> { |
||||
|
||||
Page<ReUserIdentificationSafety> userList(Integer pageNum, Integer pageSize, Map<String, Object> map, User userMsg); |
||||
|
||||
ReUserIdentificationSafety show(Long userId); |
||||
|
||||
} |
@ -0,0 +1,16 @@ |
||||
package com.ccic.safeliab.service; |
||||
|
||||
import com.ccic.safeliab.entity.UserOrganAuth; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* <p> |
||||
* 服务类 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-07-29 |
||||
*/ |
||||
public interface IUserOrganAuthService extends IService<UserOrganAuth> { |
||||
|
||||
} |
@ -0,0 +1,16 @@ |
||||
package com.ccic.safeliab.service; |
||||
|
||||
import com.ccic.safeliab.entity.UserRole; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* <p> |
||||
* 服务类 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-10-21 |
||||
*/ |
||||
public interface IUserRoleService extends IService<UserRole> { |
||||
|
||||
} |
@ -0,0 +1,81 @@ |
||||
package com.ccic.safeliab.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.ccic.safeliab.entity.ReUser; |
||||
import com.ccic.safeliab.entity.User; |
||||
import com.ccic.safeliab.entity.res.ResponseHead; |
||||
|
||||
import javax.servlet.http.HttpServletRequest; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
public interface IUserService extends IService<User> { |
||||
|
||||
List<User> queryList(User user); |
||||
|
||||
Map<String, Object> login(User user); |
||||
|
||||
List<User> findAll(Map<String, Object> map, User loginUser); |
||||
|
||||
User queryUserById(Long userId); |
||||
|
||||
User updateUserInfo(Map<String, Object> map, User userMsg); |
||||
|
||||
Page<ReUser> findUserList(Integer pageNum, Integer pageSize, Map<String, Object> map, User loginUser); |
||||
|
||||
boolean expertDisable(Long userId, Integer status); |
||||
|
||||
boolean expertAdd(Map<String, Object> map); |
||||
|
||||
boolean expertEdit(Long userId, Map<String, Object> map, User loginUser); |
||||
|
||||
boolean expertCertification(Long userId, Map<String, Object> map, User loginUser); |
||||
|
||||
Map<String, Object> userLogin(Map<String, Object> param); |
||||
|
||||
Map<String, Object> userBindCompanyAccount(Map<String, Object> map, User loginUser); |
||||
|
||||
Map<String, Object> userWxLogin(Map<String, Object> param); |
||||
|
||||
Map<String, Object> userPhoneLogin(Map<String, Object> param, HttpServletRequest request); |
||||
|
||||
List<User> findRiskUserList(Map<String, Object> map, User loginUser); |
||||
|
||||
boolean userSubscribeMsg(Map<String, Object> param); |
||||
|
||||
Map<String, Object> getPhone(String code); |
||||
|
||||
ResponseHead getSmsCode(String phone, String code, String graphVerifyCode); |
||||
|
||||
boolean unBindUser(User user, Map<String, Object> param); |
||||
|
||||
List<User> getUserByOrganId(Map<String, Object> param); |
||||
|
||||
/** |
||||
* 获取企业用户列表 |
||||
* |
||||
* @param pageNum |
||||
* @param pageSize |
||||
* @param map |
||||
* @param loginUser |
||||
* @return |
||||
*/ |
||||
Page<ReUser> findEnterpriseUserList(Integer pageNum, Integer pageSize, Map<String, Object> map, User loginUser); |
||||
|
||||
boolean userBindCustomerNo(Map<String, Object> map, User loginUser); |
||||
|
||||
|
||||
boolean deleteUserByExcel(List<String> userNoList); |
||||
|
||||
boolean appLoginOut(Long userId); |
||||
|
||||
|
||||
Map<String, String> getSmsUUID(); |
||||
|
||||
boolean thirdUserRenewal(Long userId); |
||||
|
||||
Map<String, Object> openAuthToken(String userCode, String secretKey); |
||||
|
||||
|
||||
} |
@ -0,0 +1,18 @@ |
||||
package com.ccic.safeliab.service; |
||||
|
||||
|
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* 大地单点登录服务 |
||||
* @author Lim |
||||
* @since 2022-09-09 |
||||
*/ |
||||
public interface SingleLoginService { |
||||
|
||||
Map<String, Object> singleLoginForCcic(Map<String, Object> params); |
||||
|
||||
Map<String, Object> h5login(Map<String, Object> params); |
||||
|
||||
Map<String, Object> getTokenByUserCode(String userCode); |
||||
} |
@ -0,0 +1,20 @@ |
||||
package com.ccic.safeliab.service; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.ccic.safeliab.entity.SysOperLog; |
||||
import com.ccic.safeliab.entity.User; |
||||
|
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* 系统日志 |
||||
* @author Lim |
||||
* @since 2022-12-07 |
||||
*/ |
||||
public interface SysOperLogService { |
||||
|
||||
Page<SysOperLog> getList(Integer pageNum, Integer pageSize, Map<String, Object> params); |
||||
|
||||
SysOperLog show(Long Id); |
||||
} |
@ -0,0 +1,41 @@ |
||||
package com.ccic.safeliab.service; |
||||
|
||||
|
||||
import com.ccic.safeliab.entity.User; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
|
||||
import javax.servlet.http.HttpServletRequest; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* 附件上传 |
||||
* |
||||
* @author Lim |
||||
* @since 2022-09-24 |
||||
*/ |
||||
public interface UploadService { |
||||
|
||||
Map<String, Object> batchUpload(MultipartFile multipartFile, |
||||
String imgType, String imgTypeName, String comCode, String bizNo, String operator, String operatorName); |
||||
|
||||
Map<String, Object> upload(MultipartFile multipartFile, |
||||
String imgType, String imgTypeName, String comCode, String bizNo, String operator, String operatorName); |
||||
|
||||
Map<String, Object> completeMultipartUpload(MultipartFile multipartFile, |
||||
String imgType, String imgTypeName, String comCode, String bizNo, String operator, String operatorName); |
||||
|
||||
Map<String, Object> download(Map<String, Object> params); |
||||
|
||||
Map<String, Object> completeMultipartUpload(MultipartFile multipartFile, |
||||
String imgType, String imgTypeName, String comCode, String bizNo, String operator, String operatorName, List<String> fileTypes); |
||||
|
||||
|
||||
String completeMultipartDownload(HttpServletRequest request, User user); |
||||
|
||||
Map<String, Object> commonFileDownload(Map<String, Object> params, User user); |
||||
|
||||
Map<String, Object> commonFileDownload(Map<String, Object> params); |
||||
|
||||
|
||||
} |
@ -0,0 +1,37 @@ |
||||
package com.ccic.safeliab.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.ccic.safeliab.dao.AuditOperateRecordMapper; |
||||
import com.ccic.safeliab.entity.AuditOperateRecord; |
||||
import com.ccic.safeliab.service.IAuditOperateRecordService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* <p> |
||||
* 服务实现类 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-08-08 |
||||
*/ |
||||
@Service |
||||
public class AuditOperateRecordServiceImpl extends ServiceImpl<AuditOperateRecordMapper, AuditOperateRecord> implements IAuditOperateRecordService { |
||||
|
||||
@Override |
||||
public List<AuditOperateRecord> recordList(Long businessId, String businessType) { |
||||
|
||||
QueryWrapper<AuditOperateRecord> wrapper = new QueryWrapper<>(); |
||||
|
||||
wrapper.eq("business_id", businessId); |
||||
wrapper.eq("business_type", businessType); |
||||
|
||||
wrapper.orderByDesc("operate_at"); |
||||
|
||||
return baseMapper.selectList(wrapper); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,20 @@ |
||||
package com.ccic.safeliab.service.impl; |
||||
|
||||
import com.ccic.safeliab.dao.CheckTemplateItemMapper; |
||||
import com.ccic.safeliab.entity.CheckTemplateItem; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.ccic.safeliab.service.ICheckTemplateItemService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* <p> |
||||
* 考评项(考评模版的考评项) 服务实现类 |
||||
* </p> |
||||
* |
||||
* @author cqw |
||||
* @since 2022-08-05 |
||||
*/ |
||||
@Service |
||||
public class CheckTemplateItemServiceImpl extends ServiceImpl<CheckTemplateItemMapper, CheckTemplateItem> implements ICheckTemplateItemService { |
||||
|
||||
} |
@ -0,0 +1,312 @@ |
||||
package com.ccic.safeliab.service.impl; |
||||
|
||||
import com.alibaba.fastjson.JSON; |
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.ccic.safeliab.dao.CheckTemplateMapper; |
||||
import com.ccic.safeliab.dao.OrganMapper; |
||||
import com.ccic.safeliab.entity.*; |
||||
import com.ccic.safeliab.dao.CheckTemplateItemMapper; |
||||
import com.ccic.safeliab.entity.ReCheckTemplate; |
||||
import com.ccic.safeliab.dao.TemplateOrganMapper; |
||||
import com.ccic.safeliab.config.SnowflakeIDWorker; |
||||
import com.ccic.safeliab.exceptionhandler.CcicException; |
||||
import com.ccic.safeliab.service.ICheckTemplateService; |
||||
import com.ccic.safeliab.util.CcicUtill; |
||||
import org.springframework.beans.BeanUtils; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.transaction.annotation.Propagation; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
import org.springframework.util.StringUtils; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
||||
import java.util.HashMap; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* <p> |
||||
* 考评模版 服务实现类 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-08-02 |
||||
*/ |
||||
@Service |
||||
public class CheckTemplateServiceImpl extends ServiceImpl<CheckTemplateMapper, CheckTemplate> implements ICheckTemplateService { |
||||
@Autowired |
||||
private CheckTemplateMapper checkTemplateMapper; |
||||
|
||||
@Autowired |
||||
private TemplateOrganMapper templateOrganMapper; |
||||
|
||||
@Autowired |
||||
private CheckTemplateItemMapper checkTemplateItemMapper; |
||||
|
||||
@Autowired |
||||
public SnowflakeIDWorker snowflakeIDWorker; |
||||
|
||||
|
||||
@Autowired |
||||
private OrganMapper organMapper; |
||||
|
||||
/** |
||||
* 考评模版列表 |
||||
*/ |
||||
@Override |
||||
public Page<ReCheckTemplate> findTemplateList(Integer pageNum, Integer pageSize, Map<String, Object> map) { |
||||
//创建page对象
|
||||
Page<ReCheckTemplate> pageTemplate = new Page<>(pageNum, pageSize); |
||||
|
||||
ReCheckTemplate reCheckTemplate = new ReCheckTemplate(); |
||||
|
||||
try { |
||||
CcicUtill.autoBeanToMap(reCheckTemplate.getClass(), map); |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
} |
||||
baseMapper.find(pageTemplate, map); |
||||
|
||||
if (pageTemplate.getRecords() == null) return null; |
||||
|
||||
pageTemplate.getRecords().forEach(e -> { |
||||
if(e.getCreatedInsuranceId().equals(map.get("createdInsuranceId"))){ |
||||
e.setIsDel(1); |
||||
}else{ |
||||
e.setIsDel(2); |
||||
} |
||||
}); |
||||
|
||||
// if (pageTemplate.getRecords() != null) {
|
||||
// for (ReCheckTemplate checkTemplate : pageTemplate.getRecords()) {
|
||||
// Map<String, Object> where = new HashMap<>();
|
||||
// where.put("templateId", checkTemplate.getTemplateId());
|
||||
// List<TemplateOrgan> templateOrgans = templateOrganMapper.findInsurance(where);
|
||||
// if (templateOrgans != null) {
|
||||
// StringBuffer sb = new StringBuffer();
|
||||
// for (int i = 0; i <= templateOrgans.size() - 1; i++) {
|
||||
// if (i < templateOrgans.size() - 1) {
|
||||
// sb.append(templateOrgans.get(i).getInsuranceName() + ",");
|
||||
// } else {
|
||||
// sb.append(templateOrgans.get(i).getInsuranceName());
|
||||
// }
|
||||
// }
|
||||
// checkTemplate.setInsuranceNames(sb.toString());
|
||||
// } else {
|
||||
// checkTemplate.setInsuranceNames("");
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// return null;
|
||||
// }
|
||||
return pageTemplate; |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public List<ReCheckTemplate> getList(Map<String, Object> map) { |
||||
List<ReCheckTemplate> list = baseMapper.getList(map); |
||||
list.forEach(e -> { |
||||
if(e.getCreatedInsuranceId().equals(map.get("createdInsuranceId"))){ |
||||
e.setIsDel(1); |
||||
}else{ |
||||
e.setIsDel(2); |
||||
} |
||||
}); |
||||
return list; |
||||
} |
||||
|
||||
/** |
||||
* 考评模版详情 |
||||
*/ |
||||
@Override |
||||
public ReCheckTemplate getCheckTemplate(Long templateId) { |
||||
//ReCheckTemplate reCheckTemplate = checkTemplateMapper.getTemplateShow(templateId);
|
||||
CheckTemplate checkTemplate = checkTemplateMapper.selectById(templateId); |
||||
ReCheckTemplate reCheckTemplate = new ReCheckTemplate(); |
||||
BeanUtils.copyProperties(checkTemplate,reCheckTemplate); |
||||
if (reCheckTemplate != null) { |
||||
//查询适用保险机构
|
||||
/*Map<String, Object> where = new HashMap<>(); |
||||
where.put("templateId", reCheckTemplate.getTemplateId()); |
||||
List<TemplateOrgan> templateOrgans = templateOrganMapper.findInsurance(where);*/ |
||||
QueryWrapper<TemplateOrgan> wrapper = new QueryWrapper<>(); |
||||
wrapper.eq("template_id",reCheckTemplate.getTemplateId()); |
||||
wrapper.orderByAsc("changed_at"); |
||||
wrapper.select("insurance_id","insurance_name"); |
||||
List<TemplateOrgan> templateOrgans = templateOrganMapper.selectList(wrapper); |
||||
reCheckTemplate.setInsuranceName(templateOrgans); |
||||
//查询关联考评项
|
||||
/*Map<String, Object> itemWhere = new HashMap<>(); |
||||
itemWhere.put("templateId", reCheckTemplate.getTemplateId()); |
||||
List<CheckTemplateItem> checkTemplateItems = checkTemplateItemMapper.findItem(itemWhere);*/ |
||||
QueryWrapper<CheckTemplateItem> queryWrapper = new QueryWrapper<>(); |
||||
queryWrapper.select("item_id","item_name","item_type","tag"); |
||||
queryWrapper.eq("template_id",reCheckTemplate.getTemplateId()); |
||||
queryWrapper.orderByDesc("changed_at"); |
||||
List<CheckTemplateItem> checkTemplateItems = checkTemplateItemMapper.selectList(queryWrapper); |
||||
reCheckTemplate.setCheckItem(checkTemplateItems); |
||||
} else { |
||||
return null; |
||||
} |
||||
return reCheckTemplate; |
||||
|
||||
} |
||||
|
||||
@Override |
||||
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) |
||||
public boolean deleteTemplate(Long templateId,User userMsg) { |
||||
//删除模版
|
||||
QueryWrapper<CheckTemplate> checkTemplateQueryWrapper = new QueryWrapper<>(); |
||||
checkTemplateQueryWrapper.eq("template_id", templateId); |
||||
checkTemplateQueryWrapper.eq("created_insurance_id",userMsg.getOrganId()); |
||||
int delete = checkTemplateMapper.delete(checkTemplateQueryWrapper); |
||||
if(delete<1){ |
||||
return false; |
||||
} |
||||
|
||||
//删除适用机构
|
||||
QueryWrapper<TemplateOrgan> templateOrganQueryWrapper = new QueryWrapper<>(); |
||||
templateOrganQueryWrapper.eq("template_id", templateId); |
||||
templateOrganMapper.delete(templateOrganQueryWrapper); |
||||
|
||||
//删除考评项
|
||||
QueryWrapper<CheckTemplateItem> checkTemplateItemQueryWrapper = new QueryWrapper<>(); |
||||
checkTemplateItemQueryWrapper.eq("template_id", templateId); |
||||
checkTemplateItemMapper.delete(checkTemplateItemQueryWrapper); |
||||
|
||||
return true; |
||||
} |
||||
|
||||
/** |
||||
* 创建考评模版 |
||||
* |
||||
* @param map |
||||
* @return |
||||
*/ |
||||
@Override |
||||
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) |
||||
public boolean addTemplate(Map<String, Object> map, User loginUser) throws Exception { |
||||
Long templateId = snowflakeIDWorker.nextID(); |
||||
Long organId = Long.parseLong(loginUser.getOrganId().toString()); |
||||
|
||||
//查询当前机构
|
||||
Organ organ = organMapper.selectById(organId); |
||||
if (organ == null) throw new CcicException(70006, "没有此机构"); |
||||
|
||||
//模版内容
|
||||
String templateName = CcicUtill.checkStr(map.get("templateName")); |
||||
CheckTemplate checkTemplate = new CheckTemplate(); |
||||
checkTemplate.setTemplateId(templateId); |
||||
checkTemplate.setTemplateName(templateName); |
||||
checkTemplate.setCreatedUserId(loginUser.getUserId()); |
||||
checkTemplate.setCreatedUserName(loginUser.getUserName()); |
||||
checkTemplate.setCreatedInsuranceId(organId); |
||||
checkTemplate.setCreatedInsuranceName(organ.getOrganName()); |
||||
checkTemplate.setOperateUserId(loginUser.getUserId()); |
||||
checkTemplate.setOperateUserName(loginUser.getUserName()); |
||||
|
||||
String branchOrganIds = map.get("branchOrganIds").toString(); |
||||
if (!StringUtils.isEmpty(branchOrganIds)) { |
||||
checkTemplate.setBranchOrganIds(branchOrganIds); |
||||
} |
||||
|
||||
|
||||
String branchOrganNames = map.get("branchOrganNames").toString(); |
||||
if (!StringUtils.isEmpty(branchOrganNames)) { |
||||
checkTemplate.setBranchOrganNames(branchOrganNames); |
||||
} |
||||
|
||||
|
||||
int ct = checkTemplateMapper.insert(checkTemplate); |
||||
if (ct <= 0) throw new CcicException(70006, "考评模版添加失败"); |
||||
|
||||
//适用保险机构
|
||||
TemplateOrgan templateOrgan = new TemplateOrgan(); |
||||
String fitOrgan = map.get("fitOrgan").toString(); |
||||
String[] fitOrganIds = StringUtils.delimitedListToStringArray(fitOrgan, ","); |
||||
for (String s : fitOrganIds) { |
||||
Organ fit = organMapper.selectById(s); |
||||
templateOrgan.setTemplateId(templateId); |
||||
templateOrgan.setInsuranceId(fit.getOrganId()); |
||||
templateOrgan.setInsuranceName(fit.getOrganName()); |
||||
int to = templateOrganMapper.insert(templateOrgan); |
||||
if (to <= 0) throw new CcicException(70006, "考评模版适用机构添加失败"); |
||||
} |
||||
|
||||
|
||||
//关联考核项
|
||||
String item = map.get("item").toString(); |
||||
List<CheckTemplateItem> checkTemplateItems = JSON.parseArray(item, CheckTemplateItem.class); |
||||
for (CheckTemplateItem checkTemplateItem : checkTemplateItems) { |
||||
checkTemplateItem.setItemId(snowflakeIDWorker.nextID()); |
||||
checkTemplateItem.setTemplateId(templateId); |
||||
|
||||
int to = checkTemplateItemMapper.insert(checkTemplateItem); |
||||
if (to <= 0) throw new CcicException(70006, "考评项添加失败"); |
||||
} |
||||
|
||||
return true; |
||||
} |
||||
|
||||
@Override |
||||
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) |
||||
public boolean editTemplate(@RequestParam Map<String, Object> map, User loginUser, Long templateId) throws Exception { |
||||
//判断当前机构是否是模板的创建机构
|
||||
QueryWrapper<CheckTemplate> wrapper = new QueryWrapper<>(); |
||||
wrapper.eq("template_id", templateId); |
||||
wrapper.eq("created_insurance_id",loginUser.getOrganId()); |
||||
int count = this.count(wrapper); |
||||
if(count<1){ |
||||
return false; |
||||
} |
||||
//删除原有考评项
|
||||
QueryWrapper<CheckTemplateItem> checkTemplateItemQueryWrapper = new QueryWrapper<>(); |
||||
checkTemplateItemQueryWrapper.eq("template_id", templateId); |
||||
checkTemplateItemMapper.delete(checkTemplateItemQueryWrapper); |
||||
//添加新的考评项
|
||||
String item = map.get("item").toString(); |
||||
List<CheckTemplateItem> checkTemplateItems = JSON.parseArray(item, CheckTemplateItem.class); |
||||
for (CheckTemplateItem checkTemplateItem : checkTemplateItems) { |
||||
checkTemplateItem.setItemId(snowflakeIDWorker.nextID()); |
||||
checkTemplateItem.setTemplateId(templateId); |
||||
int to = checkTemplateItemMapper.insert(checkTemplateItem); |
||||
if (to <= 0) throw new CcicException(70006, "考评项修改失败"); |
||||
} |
||||
//删除原有适用机构
|
||||
QueryWrapper<TemplateOrgan> templateOrganQueryWrapper = new QueryWrapper<>(); |
||||
templateOrganQueryWrapper.eq("template_id", templateId); |
||||
templateOrganMapper.delete(templateOrganQueryWrapper); |
||||
//添加新的适用机构
|
||||
TemplateOrgan templateOrgan = new TemplateOrgan(); |
||||
String fitOrgan = map.get("fitOrgan").toString(); |
||||
String[] fitOrganIds = StringUtils.delimitedListToStringArray(fitOrgan, ","); |
||||
for (String s : fitOrganIds) { |
||||
Organ fit = organMapper.selectById(s); |
||||
templateOrgan.setTemplateId(templateId); |
||||
templateOrgan.setInsuranceId(fit.getOrganId()); |
||||
templateOrgan.setInsuranceName(fit.getOrganName()); |
||||
int to = templateOrganMapper.insert(templateOrgan); |
||||
if (to <= 0) throw new CcicException(70006, "考评模版适用机构修改失败"); |
||||
} |
||||
|
||||
//修改模版内容
|
||||
String templateName = CcicUtill.checkStr(map.get("templateName")); |
||||
CheckTemplate checkTemplate = new CheckTemplate(); |
||||
checkTemplate.setTemplateName(templateName); |
||||
checkTemplate.setOperateUserId(loginUser.getUserId()); |
||||
checkTemplate.setOperateUserName(loginUser.getUserName()); |
||||
String branchOrganIds = CcicUtill.checkStr(map.get("branchOrganIds")); |
||||
String branchOrganNames = CcicUtill.checkStr(map.get("branchOrganNames")); |
||||
checkTemplate.setBranchOrganIds(branchOrganIds); |
||||
checkTemplate.setBranchOrganNames(branchOrganNames); |
||||
QueryWrapper<CheckTemplate> checkTemplateQueryWrapper = new QueryWrapper<>(); |
||||
checkTemplateQueryWrapper.eq("template_id", templateId); |
||||
int ct = checkTemplateMapper.update(checkTemplate, checkTemplateQueryWrapper); |
||||
if (ct <= 0) throw new CcicException(70006, "修改失败"); |
||||
return true; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,44 @@ |
||||
package com.ccic.safeliab.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.ccic.safeliab.dao.AccountMapper; |
||||
import com.ccic.safeliab.dao.UserMapper; |
||||
import com.ccic.safeliab.entity.Account; |
||||
import com.ccic.safeliab.entity.Organ; |
||||
import com.ccic.safeliab.entity.User; |
||||
import com.ccic.safeliab.service.ICompanyUserService; |
||||
import com.ccic.safeliab.util.CcicUtill; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* <p> |
||||
* 企业用户服务类 |
||||
* </p> |
||||
* |
||||
* @author Lim |
||||
* @since 2022-11-27 |
||||
*/ |
||||
@Service |
||||
public class CompanyUserServiceImpl extends ServiceImpl<UserMapper, User> implements ICompanyUserService { |
||||
|
||||
@Autowired |
||||
private AccountMapper accountMapper; |
||||
|
||||
@Override |
||||
public List<Account> findOpenIdByCompanyIds(Map<String, Object> params) { |
||||
if(params.get("organIds") ==null){ |
||||
return null; |
||||
} |
||||
String ids = params.get("organIds").toString(); |
||||
String [] idArray = ids.split(","); |
||||
params.put("organIds", idArray); |
||||
|
||||
return accountMapper.findOpenIdByCompanyIds(params); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,230 @@ |
||||
package com.ccic.safeliab.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.ccic.safeliab.dao.DeviceMapper; |
||||
import com.ccic.safeliab.dao.OrganMapper; |
||||
import com.ccic.safeliab.dao.PolicyMapper; |
||||
import com.ccic.safeliab.dao.SmartReactionMapper; |
||||
import com.ccic.safeliab.entity.Device; |
||||
import com.ccic.safeliab.entity.Policy; |
||||
import com.ccic.safeliab.entity.SmartReaction; |
||||
import com.ccic.safeliab.entity.User; |
||||
import com.ccic.safeliab.entity.*; |
||||
import com.ccic.safeliab.exceptionhandler.CcicException; |
||||
import com.ccic.safeliab.service.IDeviceService; |
||||
import com.ccic.safeliab.util.CcicUtill; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.util.StringUtils; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
|
||||
/** |
||||
* <p> |
||||
* 设备(烟感)表 服务实现类 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2023-01-06 |
||||
*/ |
||||
@Service |
||||
public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> implements IDeviceService { |
||||
|
||||
@Autowired |
||||
private DeviceMapper deviceMapper; |
||||
|
||||
@Autowired |
||||
private PolicyMapper policyMapper; |
||||
|
||||
@Autowired |
||||
private SmartReactionMapper smartReactionMapper; |
||||
|
||||
@Autowired |
||||
private OrganMapper organMapper; |
||||
|
||||
@Override |
||||
public boolean deviceBinding(Map<String, Object> map, User user){ |
||||
Device device = CcicUtill.mapToEntity(map, Device.class); |
||||
//根据设备码查询是否被绑定
|
||||
QueryWrapper<Device> deviceQueryWrapper = new QueryWrapper<>(); |
||||
deviceQueryWrapper.eq("device_code", device.getDeviceCode()); |
||||
Device deviceRow = deviceMapper.selectOne(deviceQueryWrapper); |
||||
if (deviceRow != null){ |
||||
throw new CcicException(500, "该设备已经绑定"); |
||||
} |
||||
|
||||
//查询保单信息
|
||||
QueryWrapper<Policy> policyQueryWrapper = new QueryWrapper<>(); |
||||
policyQueryWrapper.eq("policy_number", device.getPolicyNumber()); |
||||
Policy policy = policyMapper.selectOne(policyQueryWrapper); |
||||
if (policy == null){ |
||||
throw new CcicException(500, "保单不存在"); |
||||
} |
||||
//写入设备表
|
||||
device.setEarlyWarningNum(0); |
||||
device.setDeviceStatus(1); |
||||
device.setBindingAt(new Date()); |
||||
device.setInstallAt(new Date()); |
||||
device.setCustomerId(Long.toString(policy.getCustomerId())); |
||||
device.setCustomerName(policy.getCustomerName()); |
||||
device.setInsuranceId(policy.getInsuranceId()); |
||||
device.setInsuranceName(policy.getInsuranceName()); |
||||
device.setCreateUserId(user.getUserId()); |
||||
device.setCreateUserName(user.getUserName()); |
||||
|
||||
deviceMapper.insert(device); |
||||
return true; |
||||
} |
||||
|
||||
@Override |
||||
public Page<Device> pageList(Integer pageNum, Integer pageSize, Map<String, Object> map) { |
||||
Page<Device> page = new Page(pageNum, pageSize); |
||||
QueryWrapper<Device> wrapper = new QueryWrapper<>(); |
||||
String organId = CcicUtill.checkStr(map.get("organId")); |
||||
User user = (User) map.get("user"); |
||||
if(StringUtils.isEmpty(organId)){ |
||||
organId = user.getOrganId()+""; |
||||
} |
||||
wrapper.apply("insurance_id IN (select organ_id from tbl_organ where position({0} in feature)>0)",Long.parseLong(organId)); |
||||
String keyword = CcicUtill.checkStr(map.get("keyword")); |
||||
if(!StringUtils.isEmpty(keyword)){ |
||||
wrapper.and(e->e.like("device_code",keyword).or().like("customer_name",keyword)); |
||||
} |
||||
String deviceStatus = CcicUtill.checkStr(map.get("deviceStatus")); |
||||
if(!StringUtils.isEmpty(deviceStatus)){ |
||||
wrapper.eq("device_status",Integer.parseInt(deviceStatus)); |
||||
} |
||||
String startDate = CcicUtill.checkStr(map.get("startDate")); |
||||
if(!StringUtils.isEmpty(startDate)){ |
||||
wrapper.ge("install_at",startDate); |
||||
} |
||||
String endDate = CcicUtill.checkStr(map.get("endDate")); |
||||
if(!StringUtils.isEmpty(endDate)){ |
||||
wrapper.le("install_at",endDate); |
||||
} |
||||
if(StringUtils.isEmpty(keyword)&&StringUtils.isEmpty(deviceStatus)&& |
||||
StringUtils.isEmpty(startDate)&&pageNum==1&&StringUtils.isEmpty(CcicUtill.checkStr(map.get("organId")))){ |
||||
int i = baseMapper.updateStatus(organId); |
||||
} |
||||
wrapper.orderByDesc("changed_at"); |
||||
this.page(page,wrapper); |
||||
return page; |
||||
} |
||||
|
||||
@Override |
||||
public Device getDeviceById(String deviceCode) { |
||||
Device device = this.getById(deviceCode); |
||||
QueryWrapper<SmartReaction> wrapper = new QueryWrapper<>(); |
||||
wrapper.eq("imei",deviceCode); |
||||
wrapper.orderByDesc("changed_at"); |
||||
List<SmartReaction> smartReactions = smartReactionMapper.selectList(wrapper); |
||||
device.setList(smartReactions); |
||||
return device; |
||||
} |
||||
|
||||
@Override |
||||
public List<Device> deviceShowList(String deviceCodes){ |
||||
//拆分设备码
|
||||
String[] deviceCodeArr = deviceCodes.split(","); |
||||
List<String> deviceCodeList = Arrays.asList(deviceCodeArr); |
||||
QueryWrapper<Device> deviceQueryWrapper = new QueryWrapper<>(); |
||||
deviceQueryWrapper.in("device_code", deviceCodeList); |
||||
List<Device> deviceList = deviceMapper.selectList(deviceQueryWrapper); |
||||
if (deviceList == null || deviceList.size() == 0){ |
||||
return null; |
||||
} |
||||
//处理设设备状态
|
||||
// for (Device device : deviceList) {
|
||||
// Date heartbeatAt = device.getHeartbeatAt();
|
||||
// if(heartbeatAt==null){
|
||||
// continue;
|
||||
// }
|
||||
// Date faultAt = device.getFaultAt();
|
||||
// long diffDay = System.currentTimeMillis() - heartbeatAt.getTime();
|
||||
// long day = 3*24*60*60*1000;
|
||||
// if(faultAt!=null){
|
||||
// if(faultAt.after(heartbeatAt)){
|
||||
// device.setDeviceStatus(3);
|
||||
// }else if(heartbeatAt.after(faultAt)&&diffDay>day){
|
||||
// device.setDeviceStatus(2);
|
||||
// }
|
||||
// }else{
|
||||
// if(diffDay>day){
|
||||
// device.setDeviceStatus(2);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
return deviceList; |
||||
} |
||||
|
||||
@Override |
||||
public Page<Device> deviceMapMaker(Integer pageNum, Integer pageSize, Map<String, Object> map){ |
||||
Page<Device> page = new Page<>(pageNum, pageSize); |
||||
QueryWrapper<Device> wrapper = new QueryWrapper<>(); |
||||
//获取机构条件
|
||||
String insuranceId = CcicUtill.checkStr(map.get("insuranceId")); |
||||
if (!StringUtils.isEmpty(insuranceId)) { |
||||
List<Organ> organList = organMapper.getOrganByUserId(Long.parseLong(insuranceId)); |
||||
List<Long> ids = organList.stream().map(Organ::getOrganId).collect(Collectors.toList()); |
||||
if (!StringUtils.isEmpty(insuranceId)) { |
||||
wrapper.in("insurance_id", ids); |
||||
} |
||||
} |
||||
//开始日期
|
||||
String startDate = CcicUtill.checkStr(map.get("startDate")); |
||||
if (!StringUtils.isEmpty(startDate)) { |
||||
wrapper.ge("binding_at", startDate); |
||||
} |
||||
String endDate = CcicUtill.checkStr(map.get("endDate")); |
||||
if (!StringUtils.isEmpty(endDate)) { |
||||
wrapper.le("binding_at", endDate); |
||||
} |
||||
baseMapper.selectPage(page, wrapper); |
||||
return page; |
||||
} |
||||
|
||||
@Override |
||||
public Page<SmartReaction> smartPageList(Integer pageNum, Integer pageSize, Map<String, Object> map){ |
||||
//查询符合条件的设备
|
||||
QueryWrapper<Device> wrapper = new QueryWrapper<>(); |
||||
wrapper.select("device_code"); |
||||
//获取机构条件
|
||||
String insuranceId = CcicUtill.checkStr(map.get("insuranceId")); |
||||
if (!StringUtils.isEmpty(insuranceId)) { |
||||
List<Organ> organList = organMapper.getOrganByUserId(Long.parseLong(insuranceId)); |
||||
List<Long> ids = organList.stream().map(Organ::getOrganId).collect(Collectors.toList()); |
||||
if (!StringUtils.isEmpty(insuranceId)) { |
||||
wrapper.in("insurance_id", ids); |
||||
} |
||||
} |
||||
//开始日期
|
||||
String startDate = CcicUtill.checkStr(map.get("startDate")); |
||||
if (!StringUtils.isEmpty(startDate)) { |
||||
wrapper.ge("binding_at", startDate); |
||||
} |
||||
String endDate = CcicUtill.checkStr(map.get("endDate")); |
||||
if (!StringUtils.isEmpty(endDate)) { |
||||
wrapper.le("binding_at", endDate); |
||||
} |
||||
List<Device> deviceList = baseMapper.selectList(wrapper); |
||||
if (deviceList == null || deviceList.size() == 0){ |
||||
return null; |
||||
} |
||||
List<String> deviceCodes = deviceList.stream().map(Device::getDeviceCode).collect(Collectors.toList()); |
||||
|
||||
Page<SmartReaction> page = new Page<>(pageNum, pageSize); |
||||
QueryWrapper<SmartReaction> smartQueryWrapper = new QueryWrapper<>(); |
||||
smartQueryWrapper.select("imei, service_id, timestamp, created_at"); |
||||
smartQueryWrapper.in("imei", deviceCodes); |
||||
smartQueryWrapper.eq("service_id", 1002); |
||||
smartQueryWrapper.orderByDesc("created_at"); |
||||
smartReactionMapper.selectPage(page, smartQueryWrapper); |
||||
return page; |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,141 @@ |
||||
package com.ccic.safeliab.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.ccic.safeliab.constant.OrganType; |
||||
import com.ccic.safeliab.dao.EarlyWarningMessageMapper; |
||||
import com.ccic.safeliab.entity.DictVal; |
||||
import com.ccic.safeliab.entity.EarlyWarningMessage; |
||||
import com.ccic.safeliab.entity.Organ; |
||||
import com.ccic.safeliab.entity.User; |
||||
import com.ccic.safeliab.exceptionhandler.CcicException; |
||||
import com.ccic.safeliab.service.DictValService; |
||||
import com.ccic.safeliab.service.EarlyWarningMessageService; |
||||
import com.ccic.safeliab.service.IOrganService; |
||||
import com.ccic.safeliab.util.CcicUtill; |
||||
import com.ccic.safeliab.util.R; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.HashMap; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
|
||||
/** |
||||
* 灾难预警 |
||||
* |
||||
* @author Lim |
||||
* @since 2022-11-24 |
||||
*/ |
||||
@Service |
||||
public class EarlyWarningMessageServiceImpl extends ServiceImpl<EarlyWarningMessageMapper, EarlyWarningMessage> implements EarlyWarningMessageService { |
||||
|
||||
@Autowired |
||||
private EarlyWarningMessageMapper earlyWarningMessageMapper; |
||||
|
||||
@Autowired |
||||
private IOrganService iOrganService; |
||||
|
||||
@Autowired |
||||
private DictValService dictValService; |
||||
|
||||
@Override |
||||
public Page<EarlyWarningMessage> getList(Integer pageNum, Integer pageSize, Map<String, Object> params, User userMsg) { |
||||
long organId = userMsg.getOrganId(); |
||||
if (Integer.parseInt(userMsg.getOrganType()) == OrganType.type_insurance) { |
||||
if (params.get("organId") != null) { |
||||
organId = Long.parseLong(params.get("organId").toString()); |
||||
} |
||||
List<Organ> organs = iOrganService.getOrganByOrganId(organId); |
||||
String organIds = organs.stream().map(e -> CcicUtill.checkStr(e.getOrganId())).collect(Collectors.joining(",")); |
||||
params.put("organIds", organIds); |
||||
} else if (Integer.parseInt(userMsg.getOrganType()) == OrganType.type_company) { |
||||
//企业用后只能查看自己机构内数据
|
||||
params.put("customerId", organId); |
||||
} else { |
||||
throw new CcicException(70006, "暂不支持其他机构查看灾难预警数据"); |
||||
} |
||||
|
||||
Page<EarlyWarningMessage> list = new Page<>(pageNum, pageSize); |
||||
earlyWarningMessageMapper.getList(list, params); |
||||
|
||||
if (list.getRecords() != null) { |
||||
//获取等级字典
|
||||
Map<String, String> levelKV = this.dictKV(25L); |
||||
//获取类型字典
|
||||
Map<String, String> warningTypeKV = this.dictKV(26L); |
||||
for (EarlyWarningMessage obj : list.getRecords()) { |
||||
if (levelKV != null && levelKV.size() > 0 && obj.getCatastropheLevel() != null) { |
||||
obj.setLevelValue(levelKV.get(obj.getCatastropheLevel())); |
||||
} |
||||
if (warningTypeKV != null && warningTypeKV.size() > 0 && obj.getCatastropheType() != null) { |
||||
obj.setCatastropheTypeValue(warningTypeKV.get(obj.getCatastropheType())); |
||||
} |
||||
} |
||||
return list; |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public EarlyWarningMessage show(Long Id) { |
||||
if (Id == null) { |
||||
throw new CcicException(20001, "参数错误"); |
||||
} |
||||
EarlyWarningMessage obj = earlyWarningMessageMapper.selectById(Id); |
||||
if (obj == null) { |
||||
return null; |
||||
} |
||||
//获取等级字典
|
||||
Map<String, String> levelKV = this.dictKV(25L); |
||||
//获取类型字典
|
||||
Map<String, String> warningTypeKV = this.dictKV(26L); |
||||
if (levelKV != null && levelKV.size() > 0 && obj.getCatastropheLevel() != null) { |
||||
obj.setLevelValue(levelKV.get(obj.getCatastropheLevel())); |
||||
} |
||||
if (warningTypeKV != null && warningTypeKV.size() > 0 && obj.getCatastropheType() != null) { |
||||
obj.setCatastropheTypeValue(warningTypeKV.get(obj.getCatastropheType())); |
||||
} |
||||
|
||||
return obj; |
||||
} |
||||
|
||||
private Map<String, String> dictKV(Long dictId) { |
||||
DictVal dictVal = new DictVal(); |
||||
dictVal.setDictId(dictId); |
||||
List<DictVal> list = dictValService.find(dictVal); |
||||
if (list == null || list.size() <= 0) { |
||||
return null; |
||||
} |
||||
Map<String, String> dictKV = new HashMap<>(); |
||||
for (DictVal val : list) { |
||||
if (val.getValue() != null && val.getDictValName() != null) { |
||||
dictKV.putIfAbsent(val.getValue(), val.getDictValName()); |
||||
} |
||||
} |
||||
return dictKV; |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public boolean edit(Long Id) { |
||||
if (Id == null) { |
||||
throw new CcicException(20001, "参数错误"); |
||||
} |
||||
|
||||
UpdateWrapper<EarlyWarningMessage> updateWrapper = new UpdateWrapper<>(); |
||||
updateWrapper.eq("id", Id); |
||||
|
||||
EarlyWarningMessage earlyWarningMessage = new EarlyWarningMessage(); |
||||
earlyWarningMessage.setStatus(2);//已接收
|
||||
|
||||
int i = earlyWarningMessageMapper.update(earlyWarningMessage, updateWrapper); |
||||
if (i <= 0) return false; |
||||
|
||||
return true; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,532 @@ |
||||
package com.ccic.safeliab.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.ccic.safeliab.constant.AuditOperateType; |
||||
import com.ccic.safeliab.dao.*; |
||||
import com.ccic.safeliab.entity.*; |
||||
import com.ccic.safeliab.entity.ReUser; |
||||
import com.ccic.safeliab.entity.ReUserIdentificationSafety; |
||||
import com.ccic.safeliab.config.SnowflakeIDWorker; |
||||
import com.ccic.safeliab.exceptionhandler.CcicException; |
||||
import com.ccic.safeliab.service.GridService; |
||||
import com.ccic.safeliab.service.IExpertService; |
||||
import com.ccic.safeliab.service.IUserService; |
||||
import com.ccic.safeliab.util.CcicUtill; |
||||
import com.ccic.safeliab.util.IdCardNumberUtils; |
||||
import com.ccic.safeliab.util.IdCardUtil; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import lombok.Data; |
||||
import org.springframework.beans.BeanUtils; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.util.StringUtils; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
|
||||
@Service |
||||
public class ExpertServicelmpl extends ServiceImpl<UserMapper, User> implements IExpertService { |
||||
//认证(审核)状态 1.未认证;2.认证中;3.认证成功;4.认证失败
|
||||
//审核 1.待审核;2.审核中(上级审核);3.审核成功;4.审核失败
|
||||
|
||||
@Autowired |
||||
private UserMapper userDao; |
||||
|
||||
@Autowired |
||||
private GridService gridService; |
||||
|
||||
@Autowired |
||||
private UserIdentificationSafetyMapper safetyDao; |
||||
|
||||
@Autowired |
||||
private OrganMapper organDao; |
||||
|
||||
@Autowired |
||||
private InsOrganMapper insOrganMapper; |
||||
|
||||
@Autowired |
||||
private UserAuditMapper userAuditMapper; |
||||
|
||||
@Autowired |
||||
private UserCertificationMapper userCertificationMapper; |
||||
|
||||
@Autowired |
||||
private UserMapper userMapper; |
||||
|
||||
@Autowired |
||||
private SnowflakeIDWorker snowflakeIDWorker; |
||||
|
||||
@Override |
||||
public Page<ReUser> userList(Integer pageNum, Integer pageSize, Map<String, Object> map) { |
||||
//创建page对象
|
||||
Page<ReUser> pageUser = new Page<>(pageNum, pageSize); |
||||
|
||||
if (map.get("serviceOrganId") != null) { |
||||
baseMapper.findThirdPartyUserList(pageUser, map); |
||||
} else { |
||||
//TODO 根据保险机构关联的服务机构获取相关专家,后续增加条件
|
||||
List<InsOrgan> list = insOrganMapper.queryOrganIds(map.get("organId").toString()); |
||||
if (list != null) { |
||||
//List<Long> serviceOrganIds = list.stream().map(InsOrgan::getOrganId).collect(Collectors.toList());
|
||||
Long[] serviceOrganIds = list.stream().map(InsOrgan::getOrganId).toArray(Long[]::new); |
||||
if (serviceOrganIds.length > 0) { |
||||
map.put("serviceOrganIds", serviceOrganIds); |
||||
//调用方法实现条件查询分页
|
||||
baseMapper.findThirdPartyUserList(pageUser, map); |
||||
} else { |
||||
return null; |
||||
} |
||||
} else { |
||||
return null; |
||||
} |
||||
} |
||||
|
||||
baseMapper.findThirdPartyUserList(pageUser, map); |
||||
if (pageUser.getRecords() != null) { |
||||
//查询返回信息所属机构名称,所属地区,审核方,审核时间,审核状态,认证状态
|
||||
for (ReUser user : pageUser.getRecords()) { |
||||
//查询机构名称
|
||||
Organ organ = organDao.findNameByOrganID(user.getOrganId()); |
||||
if (organ != null) { |
||||
user.setOrganName(organ.getOrganName()); |
||||
} |
||||
//查询所在区域 ps:专家详细信息在附属信息表
|
||||
UserIdentificationSafety identificationSafety = safetyDao.getByID(user.getUserId()); |
||||
if (identificationSafety != null) { |
||||
if (identificationSafety.getGridId() != null) { |
||||
user.setGridName(gridService.getName(identificationSafety.getGridId())); |
||||
} |
||||
//查询认证状态
|
||||
user.setCertificationStatus(identificationSafety.getStatus()); |
||||
} |
||||
} |
||||
} else { |
||||
return null; |
||||
} |
||||
return pageUser; |
||||
} |
||||
|
||||
//userInfo
|
||||
|
||||
|
||||
@Override |
||||
public ReUser userInfo(Long userId) { |
||||
|
||||
//查询用户信息
|
||||
//ReUser user = userDao.findUserDetail(userId);
|
||||
User us = baseMapper.selectById(userId); |
||||
ReUser user = new ReUser(); |
||||
BeanUtils.copyProperties(us, user); |
||||
if (user != null) { |
||||
user.setDesensitizationPhone(""); |
||||
user.setDesensitizationIdNumber(""); |
||||
//查询用户数据
|
||||
//ReUserIdentificationSafety userIdentificationSafety = safetyDao.getByID(userId);
|
||||
UserIdentificationSafety identificationSafety = safetyDao.selectById(userId); |
||||
ReUserIdentificationSafety userIdentificationSafety = new ReUserIdentificationSafety(); |
||||
BeanUtils.copyProperties(identificationSafety, userIdentificationSafety); |
||||
if (userIdentificationSafety != null) { |
||||
Map<Long, Grid> gridMap = gridService.getGridMap(); |
||||
if (userIdentificationSafety.getScopeGrid() != null) { |
||||
//获取服务地区数据
|
||||
String[] split = userIdentificationSafety.getScopeGrid().split(","); |
||||
try { |
||||
String gridNames = Arrays.asList(split).stream().map(e -> gridMap.get(Long.parseLong(e)) |
||||
.getGridName()).collect(Collectors.joining(",")); |
||||
userIdentificationSafety.setScopeGridName(gridNames); |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
//throw new CcicException(500,"服务地区数据不对应");
|
||||
} |
||||
} else { |
||||
userIdentificationSafety.setScopeGridName(""); |
||||
} |
||||
if (userIdentificationSafety.getGridId() != null) { |
||||
Grid grid1 = gridMap.get(userIdentificationSafety.getGridId()); |
||||
if (grid1 != null) { |
||||
user.setGridName(grid1.getGridName()); |
||||
user.setFeature(grid1.getFeature()); |
||||
} else { |
||||
user.setGridName(null); |
||||
user.setFeature(null); |
||||
} |
||||
} else { |
||||
user.setGridName(null); |
||||
user.setFeature(null); |
||||
} |
||||
user.setIdentification(userIdentificationSafety); |
||||
//查询认证状态
|
||||
user.setCertificationStatus(userIdentificationSafety.getStatus()); |
||||
|
||||
if (userIdentificationSafety.getIdNumber() != null) { |
||||
IdCardInfo idCardInfo = IdCardUtil.getBirAgeSex(userIdentificationSafety.getIdNumber()); |
||||
if (idCardInfo != null) { |
||||
userIdentificationSafety.setAge(idCardInfo.getAge()); |
||||
userIdentificationSafety.setSex(idCardInfo.getSex()); |
||||
user.setAge(idCardInfo.getAge()); |
||||
user.setSex(idCardInfo.getSex()); |
||||
} |
||||
// //根据身份证号获取年龄
|
||||
// if (userIdentificationSafety.getAge() == null) {
|
||||
// int age = IdCardNumberUtils.getAgeFromIdCard(userIdentificationSafety.getIdNumber());
|
||||
// if (age > 0) {
|
||||
// userIdentificationSafety.setAge(age);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// //根据身份证号获取性别
|
||||
// if (userIdentificationSafety.getSex() == null) {
|
||||
// Map<String, Object> sexMap = IdCardNumberUtils.getSexFromIdCard(userIdentificationSafety.getIdNumber());
|
||||
// if (sexMap.size() > 0) {
|
||||
// userIdentificationSafety.setSex(Integer.parseInt(sexMap.get("sex_by_int").toString()));
|
||||
// }
|
||||
// }
|
||||
|
||||
} |
||||
|
||||
if (!StringUtils.isEmpty(userIdentificationSafety.getIdNumber())) { |
||||
user.setDesensitizationIdNumber(CcicUtill.desensitizationIdNumber(userIdentificationSafety.getIdNumber())); |
||||
} |
||||
} else { |
||||
user.setCertificationStatus(null);//无状态
|
||||
user.setIdentification(null); |
||||
user.setGridName(null); |
||||
user.setFeature(null); |
||||
} |
||||
|
||||
//查询用户安全证书
|
||||
QueryWrapper<UserCertification> wrapper = new QueryWrapper<>(); |
||||
wrapper.eq("user_id", userId); |
||||
List<UserCertification> certifications = userCertificationMapper.selectList(wrapper); |
||||
if (certifications != null) { |
||||
user.setCertifications(certifications); |
||||
} else { |
||||
user.setCertifications(null); |
||||
} |
||||
|
||||
//身份证号和手机号脱敏处理
|
||||
if (!StringUtils.isEmpty(user.getPhone())) { |
||||
user.setDesensitizationPhone(CcicUtill.desensitizationPhone(user.getPhone())); |
||||
|
||||
} |
||||
|
||||
} |
||||
|
||||
return user; |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public Page<ReUser> userAuditList(Integer pageNum, Integer pageSize, Map<String, Object> map) { |
||||
//创建page对象
|
||||
Page<ReUser> pageUser = new Page<>(pageNum, pageSize); |
||||
|
||||
ReUser reUser = new ReUser(); |
||||
try { |
||||
CcicUtill.autoBeanToMap(reUser.getClass(), map); |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
} |
||||
|
||||
//根据状态查询列表
|
||||
//审核 1.待审核;2.审核中(上级审核);3.审核成功;4.审核失败
|
||||
String labelStatus = map.get("labelStatus").toString(); |
||||
QueryWrapper<UserAudit> wrapper = new QueryWrapper<>(); |
||||
wrapper.eq("organ_id", Long.parseLong(map.get("organId").toString())); |
||||
if (labelStatus.equals("unaudit")) { |
||||
wrapper.eq("audit_status", 1); |
||||
} else if (labelStatus.equals("audited")) { |
||||
wrapper.in("audit_status", Arrays.asList(2, 3, 4)); |
||||
} else { |
||||
throw new CcicException(500, "获取的机构审核状态异常"); |
||||
} |
||||
|
||||
List<UserAudit> userAudits = userAuditMapper.selectList(wrapper); |
||||
if (userAudits.size() <= 0) return null; |
||||
// //拆分相关审核数据ids
|
||||
Long[] userIds = userAudits.stream().map(UserAudit::getUserId).toArray(Long[]::new); |
||||
|
||||
map.put("userIds", userIds); |
||||
//调用方法实现条件查询分页
|
||||
baseMapper.findThirdPartyUserList(pageUser, map); |
||||
|
||||
if (pageUser.getRecords() != null) { |
||||
//查询返回信息所属机构名称,所属地区,审核方,审核时间,审核状态,认证状态
|
||||
for (ReUser user : pageUser.getRecords()) { |
||||
//查询机构名称
|
||||
if (user.getOrganName() == null) { |
||||
Organ organ = organDao.findNameByOrganID(user.getOrganId()); |
||||
if (organ != null) { |
||||
user.setOrganName(organ.getOrganName()); |
||||
} |
||||
} |
||||
|
||||
//查询所在区域 ps:专家详细信息在附属信息表
|
||||
UserIdentificationSafety identificationSafety = safetyDao.getByID(user.getUserId()); |
||||
if (identificationSafety != null) { |
||||
if (identificationSafety.getGridId() != null) { |
||||
user.setGridName(gridService.getName(identificationSafety.getGridId())); |
||||
} else { |
||||
user.setGridName(""); |
||||
} |
||||
//查询认证状态
|
||||
user.setCertificationStatus(identificationSafety.getStatus()); |
||||
} |
||||
|
||||
//手机号脱敏处理
|
||||
if (!StringUtils.isEmpty(user.getPhone())) { |
||||
user.setDesensitizationPhone(CcicUtill.desensitizationPhone(user.getPhone())); |
||||
} else { |
||||
user.setDesensitizationPhone(""); |
||||
} |
||||
|
||||
|
||||
} |
||||
} else { |
||||
return null; |
||||
} |
||||
return pageUser; |
||||
} |
||||
|
||||
//待办-服务人员审核数
|
||||
public WaitHandle getServicePersonnelReviewNum(Long organId) { |
||||
QueryWrapper<UserAudit> wrapper = new QueryWrapper<>(); |
||||
wrapper.eq("organ_id", organId); |
||||
wrapper.eq("audit_status", 1); |
||||
wrapper.isNotNull("user_id"); |
||||
Integer num = userAuditMapper.selectCount(wrapper); |
||||
WaitHandle waitHandle = new WaitHandle(); |
||||
waitHandle.setTotal(num); |
||||
return waitHandle; |
||||
} |
||||
|
||||
|
||||
@Data |
||||
public class WaitHandle { |
||||
@JsonFormat(shape = JsonFormat.Shape.STRING) |
||||
private Integer total; |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public List<ReUser> insureExpertListByServiceOrgan(Map<String, Object> map) { |
||||
if (map.get("serviceOrganId").equals("")) throw new CcicException(20001, "服务机构id不能为空"); |
||||
|
||||
//List<ReUser> userList = userMapper.insureFindListByServiceOrgan(map);
|
||||
QueryWrapper<User> wrapper = new QueryWrapper<>(); |
||||
wrapper.eq("user_type", 5); |
||||
String serviceOrganId = CcicUtill.checkStr(map.get("serviceOrganId")); |
||||
if (!StringUtils.isEmpty(serviceOrganId)) { |
||||
wrapper.eq("organ_id", Long.parseLong(serviceOrganId)); |
||||
} |
||||
String userName = CcicUtill.checkStr(map.get("userName")); |
||||
if (!StringUtils.isEmpty(userName)) { |
||||
wrapper.like("user_name", userName); |
||||
} |
||||
String keyword = CcicUtill.checkStr(map.get("keyword")); |
||||
if (!StringUtils.isEmpty(keyword)) { |
||||
wrapper.and(e -> e.like("user_name", keyword).or().like("user_no", keyword)); |
||||
} |
||||
wrapper.orderByDesc("changed_at"); |
||||
List<User> users = userMapper.selectList(wrapper); |
||||
List<ReUser> userList = users.stream().map(e -> { |
||||
ReUser reUser = new ReUser(); |
||||
BeanUtils.copyProperties(e, reUser); |
||||
return reUser; |
||||
}).collect(Collectors.toList()); |
||||
|
||||
if (userList.size() <= 0) return null; |
||||
|
||||
|
||||
for (ReUser user : userList) { |
||||
//查询附属信息
|
||||
//UserIdentificationSafety userIdentificationSafety = safetyDao.getByID(user.getUserId());
|
||||
UserIdentificationSafety identificationSafety = safetyDao.selectById(user.getUserId()); |
||||
ReUserIdentificationSafety userIdentificationSafety = new ReUserIdentificationSafety(); |
||||
BeanUtils.copyProperties(identificationSafety, userIdentificationSafety); |
||||
if (userIdentificationSafety != null) { |
||||
user.setSkilledWorkName(userIdentificationSafety.getSkilledWorkName()); |
||||
if (userIdentificationSafety.getScopeGrid() != null) { |
||||
//获取服务地区数据
|
||||
Map<Long, Grid> gridMap = gridService.getGridMap(); |
||||
String[] split = userIdentificationSafety.getScopeGrid().split(","); |
||||
try { |
||||
String gridNames = Arrays.asList(split).stream().map(e -> gridMap.get(Long.parseLong(e)) |
||||
.getGridName()).collect(Collectors.joining(",")); |
||||
user.setScopeGridName(gridNames); |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
//throw new CcicException(500,"服务地区数据不对应");
|
||||
} |
||||
} else { |
||||
user.setScopeGridName(""); |
||||
} |
||||
|
||||
//身份证信息
|
||||
|
||||
if (userIdentificationSafety.getIdNumber() != null) { |
||||
|
||||
//根据身份证号获取年龄
|
||||
if (userIdentificationSafety.getAge() == null) { |
||||
// int age = IdCardNumberUtils.getAgeFromIdCard(userIdentificationSafety.getIdNumber());
|
||||
// if (age > 0) {
|
||||
// user.setAge(age);
|
||||
// }
|
||||
IdCardInfo idCardInfo = IdCardUtil.getBirAgeSex(userIdentificationSafety.getIdNumber()); |
||||
if (idCardInfo != null) { |
||||
user.setAge(idCardInfo.getAge()); |
||||
} |
||||
|
||||
} else { |
||||
user.setAge(userIdentificationSafety.getAge()); |
||||
} |
||||
|
||||
//根据身份证号获取性别
|
||||
if (userIdentificationSafety.getSex() == null) { |
||||
// Map<String, Object> sexMap = IdCardNumberUtils.getSexFromIdCard(userIdentificationSafety.getIdNumber());
|
||||
// if (sexMap.size() > 0) {
|
||||
// user.setSex(Integer.parseInt(sexMap.get("sex_by_int").toString()));
|
||||
// }
|
||||
IdCardInfo idCardInfo = IdCardUtil.getBirAgeSex(userIdentificationSafety.getIdNumber()); |
||||
if (idCardInfo != null) { |
||||
user.setSex(idCardInfo.getSex()); |
||||
} |
||||
|
||||
} else { |
||||
user.setSex(userIdentificationSafety.getSex()); |
||||
} |
||||
|
||||
} |
||||
} |
||||
|
||||
//身份证号和手机号脱敏处理
|
||||
if (!StringUtils.isEmpty(user.getPhone())) { |
||||
user.setDesensitizationPhone(CcicUtill.desensitizationPhone(user.getPhone())); |
||||
user.setPhone(CcicUtill.desensitizationPhone(user.getPhone())); |
||||
} |
||||
} |
||||
|
||||
return userList; |
||||
} |
||||
|
||||
@Autowired |
||||
private IUserService userService; |
||||
|
||||
public List<ReUser> expertNoPageList(Map<String, Object> map) { |
||||
List<ReUser> list = baseMapper.findThirdPartyUserListNoPage(map); |
||||
return list; |
||||
} |
||||
|
||||
@Override |
||||
public Page<ReUser> expertListByServiceOrgan(Integer pageNum, Integer pageSize, Map<String, Object> map) { |
||||
//创建page对象
|
||||
Page<ReUser> pageUser = new Page<>(pageNum, pageSize); |
||||
|
||||
ReUser reUser = new ReUser(); |
||||
try { |
||||
CcicUtill.autoBeanToMap(reUser.getClass(), map); |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
} |
||||
|
||||
//根据状态查询列表
|
||||
//审核 1.待审核;2.审核中(上级审核);3.审核成功;4.审核失败 -1:新创建未审核
|
||||
// String labelStatus = map.get("labelStatus").toString();
|
||||
// if (labelStatus.equals("unaudit")) {
|
||||
// Integer[] auditStatus = {AuditOperateType.NOTASSESS, AuditOperateType.UNAUTHORIZED};
|
||||
// map.put("auditStatusInts", auditStatus);//待审核
|
||||
// } else if (labelStatus.equals("audited")) {
|
||||
// Integer[] auditStatus = {AuditOperateType.STATUS_SUP_NOTASSESS, AuditOperateType.STATUS_ASSESS, AuditOperateType.STATUS_REJECT};
|
||||
// map.put("auditStatusInts", auditStatus);
|
||||
// } else {
|
||||
// throw new CcicException(500, "获取的机构审核状态异常");
|
||||
// }
|
||||
|
||||
//调用方法实现条件查询分页
|
||||
baseMapper.findThirdPartyUserList(pageUser, map); |
||||
if (pageUser.getRecords() != null) { |
||||
Map<Long, Grid> gridMap = gridService.getGridMap(); |
||||
//查询返回信息所属机构名称,所属地区,审核方,审核时间,审核状态,认证状态
|
||||
for (ReUser user : pageUser.getRecords()) { |
||||
//查询机构名称,不需要获取最新机构名称
|
||||
/*Organ organ = organDao.findNameByOrganID(user.getOrganId()); |
||||
if (organ != null) { |
||||
user.setOrganName(organ.getOrganName()); |
||||
}*/ |
||||
//查询所在区域 ps:专家详细信息在附属信息表
|
||||
UserIdentificationSafety identificationSafety = safetyDao.getByID(user.getUserId()); |
||||
if (identificationSafety != null) { |
||||
if (identificationSafety.getGridId() != null) { |
||||
Grid grid1 = gridMap.get(identificationSafety.getGridId()); |
||||
user.setGridName(grid1.getGridName()); |
||||
} else { |
||||
user.setGridName(""); |
||||
} |
||||
//查询认证状态
|
||||
user.setCertificationStatus(identificationSafety.getStatus()); |
||||
|
||||
if (identificationSafety.getChangedAt() != null) { |
||||
user.setChangedAt(identificationSafety.getChangedAt()); |
||||
} else { |
||||
user.setChangedAt(null); |
||||
} |
||||
|
||||
if (identificationSafety.getScopeGrid() != null) { |
||||
//获取服务地区数据
|
||||
String[] split = identificationSafety.getScopeGrid().split(","); |
||||
try { |
||||
String gridNames = Arrays.asList(split).stream().map(e -> gridMap.get(Long.parseLong(e)) |
||||
.getGridName()).collect(Collectors.joining(",")); |
||||
user.setScopeGridName(gridNames); |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
//throw new CcicException(500,"服务地区数据不对应");
|
||||
} |
||||
} else { |
||||
user.setScopeGridName(""); |
||||
} |
||||
} |
||||
|
||||
if (!StringUtils.isEmpty(user.getPhone())) { |
||||
user.setDesensitizationPhone(CcicUtill.desensitizationPhone(user.getPhone())); |
||||
} else { |
||||
user.setDesensitizationPhone(""); |
||||
} |
||||
|
||||
|
||||
} |
||||
} else { |
||||
return null; |
||||
} |
||||
return pageUser; |
||||
} |
||||
|
||||
|
||||
|
||||
@Override |
||||
public ReUser findExpertCertificationStatus(Long userId) { |
||||
if (userId == null) { |
||||
throw new CcicException(20001, "用户id不能为空"); |
||||
} |
||||
|
||||
ReUser user = new ReUser(); |
||||
//UserIdentificationSafety identificationSafety = safetyDao.getByID(userId);
|
||||
UserIdentificationSafety identificationSafety = safetyDao.selectById(userId); |
||||
if (identificationSafety != null) { |
||||
//查询认证状态
|
||||
user.setCertificationStatus(identificationSafety.getStatus()); |
||||
user.setRejectReason(identificationSafety.getFailReason()); |
||||
|
||||
} else { |
||||
return null; |
||||
} |
||||
|
||||
return user; |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,21 @@ |
||||
package com.ccic.safeliab.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.ccic.safeliab.dao.IndustryMapper; |
||||
import com.ccic.safeliab.entity.Industry; |
||||
import com.ccic.safeliab.service.IIndustryService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
|
||||
/** |
||||
* <p> |
||||
* 行业分类父表 服务实现类 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-08-19 |
||||
*/ |
||||
@Service |
||||
public class IndustryServiceImpl extends ServiceImpl<IndustryMapper, Industry> implements IIndustryService { |
||||
|
||||
} |
@ -0,0 +1,20 @@ |
||||
package com.ccic.safeliab.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.ccic.safeliab.entity.IndustryType; |
||||
import com.ccic.safeliab.dao.IndustryTypeMapper; |
||||
import com.ccic.safeliab.service.IIndustryTypeService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* <p> |
||||
* 行业分类子表 服务实现类 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-08-19 |
||||
*/ |
||||
@Service |
||||
public class IndustryTypeServiceImpl extends ServiceImpl<IndustryTypeMapper, IndustryType> implements IIndustryTypeService { |
||||
|
||||
} |
@ -0,0 +1,19 @@ |
||||
package com.ccic.safeliab.service.impl; |
||||
|
||||
import com.ccic.safeliab.dao.InsOrganMapper; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.ccic.safeliab.entity.InsOrgan; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* <p> |
||||
* 服务实现类 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-08-02 |
||||
*/ |
||||
@Service |
||||
public class InsOrganServiceImpl extends ServiceImpl<InsOrganMapper, InsOrgan> { |
||||
|
||||
} |
@ -0,0 +1,101 @@ |
||||
package com.ccic.safeliab.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.ccic.safeliab.dao.MenuMapper; |
||||
import com.ccic.safeliab.dao.RoleMapper; |
||||
import com.ccic.safeliab.entity.Menu; |
||||
import com.ccic.safeliab.entity.Role; |
||||
import com.ccic.safeliab.entity.UserRole; |
||||
import com.ccic.safeliab.service.IMenuService; |
||||
import com.ccic.safeliab.service.IUserRoleService; |
||||
import com.ccic.safeliab.util.CcicUtill; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
import org.springframework.util.StringUtils; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
|
||||
/** |
||||
* <p> |
||||
* 菜单表 服务实现类 |
||||
* </p> |
||||
* |
||||
* @author testjava |
||||
* @since 2022-07-29 |
||||
*/ |
||||
@Service |
||||
public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements IMenuService { |
||||
|
||||
@Autowired |
||||
private RoleMapper roleMapper; |
||||
@Autowired |
||||
private IUserRoleService userRoleService; |
||||
|
||||
@Override |
||||
public List<Menu> getMenuByUserId(Long userId) { |
||||
return baseMapper.getMenuByUserId(userId); |
||||
} |
||||
|
||||
@Transactional |
||||
@Override |
||||
public boolean addMenu(Map<String, Object> map) { |
||||
Menu menu = new Menu(); |
||||
String parentId = CcicUtill.checkStr(map.get("parentId")); |
||||
if(!StringUtils.isEmpty(parentId)){ |
||||
map.put("parentId",Long.parseLong(parentId)); |
||||
} |
||||
String sequence = CcicUtill.checkStr(map.get("sequence")); |
||||
if(!StringUtils.isEmpty(sequence)){ |
||||
map.put("sequence",Integer.parseInt(sequence)); |
||||
} |
||||
try { |
||||
menu = CcicUtill.autoBeanToMap(menu.getClass(),map); |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
} |
||||
int i = baseMapper.insert(menu); |
||||
return i>0?true:false; |
||||
} |
||||
|
||||
@Override |
||||
public Page<Menu> pageList(Integer pageNum, Integer pageSize, Map<String,Object> map) { |
||||
Page<Menu> page = new Page<>(pageNum,pageSize); |
||||
String roleMenu = CcicUtill.checkStr(map.get("roleMenu")); |
||||
|
||||
baseMapper.pageList(roleMenu,page); |
||||
return page; |
||||
} |
||||
|
||||
@Override |
||||
public List<Menu> queryMenuByRoleId(Long roleId) { |
||||
Role role = roleMapper.selectById(roleId); |
||||
String roleMenu = role.getRoleMenu(); |
||||
//构建条件
|
||||
QueryWrapper<Menu> wrapper = new QueryWrapper<>(); |
||||
if(!StringUtils.isEmpty(roleMenu)){ |
||||
wrapper.in("menu_id",roleMenu.split(",")); |
||||
} |
||||
List<Menu> menus = baseMapper.selectList(wrapper); |
||||
return menus; |
||||
} |
||||
|
||||
@Override |
||||
public String queryMenuByUserId(Long userId) { |
||||
QueryWrapper<UserRole> wrapper = new QueryWrapper<>(); |
||||
wrapper.eq("user_id",userId); |
||||
List<UserRole> list = userRoleService.list(wrapper); |
||||
List<Long> roles = list.stream().map(UserRole::getRoleId).collect(Collectors.toList()); |
||||
QueryWrapper<Role> queryWrapper = new QueryWrapper<>(); |
||||
queryWrapper.select("role_menu"); |
||||
queryWrapper.in("role_id",roles); |
||||
List<Role> roleList = roleMapper.selectList(queryWrapper); |
||||
String menuStr = roleList.stream().map(Role::getRoleMenu).filter(e -> e != null).collect(Collectors.joining(",")); |
||||
return menuStr; |
||||
} |
||||
|
||||
} |
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue