Merge branch 'master' of http://192.168.0.56:3000/haozq/ah_jjzhgd_service
This commit is contained in:
commit
309b559896
|
|
@ -1,39 +0,0 @@
|
|||
package com.securitycontrol.system.api.domain.background;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author lit@epsoft.com.cn
|
||||
* @version 1.0
|
||||
* @Description 统一文件下载vo
|
||||
* @date Apr 8, 2022
|
||||
*/
|
||||
@Data
|
||||
public class FileExportVo {
|
||||
|
||||
private String fileId;
|
||||
|
||||
private String fileName;
|
||||
|
||||
private String contentType;
|
||||
|
||||
private String suffix;
|
||||
|
||||
private long fileSize;
|
||||
|
||||
@JsonIgnore
|
||||
private byte[] data;
|
||||
|
||||
public FileExportVo(MongoFile mongoFile) {
|
||||
BeanUtil.copyProperties(mongoFile, this);
|
||||
if (Objects.nonNull(mongoFile.getContent())) {
|
||||
this.data = mongoFile.getContent().getData();
|
||||
}
|
||||
this.fileId = mongoFile.getId();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
package com.securitycontrol.system.api.domain.background;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import org.bson.types.Binary;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
/**
|
||||
* @author coisini
|
||||
* @version 1.0
|
||||
* @Description MongoDB文件实体
|
||||
* @date Apr 17, 2022
|
||||
*/
|
||||
@Document
|
||||
@Builder
|
||||
@Data
|
||||
public class MongoFile {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@Id
|
||||
public String id;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
public String fileName;
|
||||
|
||||
/**
|
||||
* 文件大小
|
||||
*/
|
||||
public long fileSize;
|
||||
|
||||
/**
|
||||
* 上传时间
|
||||
*/
|
||||
public String uploadDate;
|
||||
|
||||
/**
|
||||
* MD5值
|
||||
*/
|
||||
public String md5;
|
||||
|
||||
/**
|
||||
* 文件内容
|
||||
*/
|
||||
private Binary content;
|
||||
|
||||
/**
|
||||
* 文件类型
|
||||
*/
|
||||
public String contentType;
|
||||
|
||||
/**
|
||||
* 文件后缀名
|
||||
*/
|
||||
public String suffix;
|
||||
|
||||
/**
|
||||
* 文件描述
|
||||
*/
|
||||
public String description;
|
||||
|
||||
/**
|
||||
* 大文件管理GridFS的ID
|
||||
*/
|
||||
private String gridFsId;
|
||||
|
||||
}
|
||||
|
|
@ -17,10 +17,7 @@ import io.jsonwebtoken.Claims;
|
|||
import io.swagger.annotations.Api;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
|
@ -56,7 +53,6 @@ public class TokenController {
|
|||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 本地推出登录
|
||||
* @param request
|
||||
|
|
|
|||
|
|
@ -19,10 +19,14 @@ spring:
|
|||
server-addr: 127.0.0.1:8848
|
||||
# server-addr: 27.196.164.56:8848
|
||||
namespace: jjzhgd
|
||||
username: nacos
|
||||
password: Jjsp@nacos2023
|
||||
config:
|
||||
# server-addr: 27.196.164.56:8848
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: jjzhgd
|
||||
username: nacos
|
||||
password: Jjsp@nacos2023
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -0,0 +1,52 @@
|
|||
package com.securitycontrol.common.core.utils;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import org.springframework.core.io.buffer.DataBuffer;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.server.reactive.ServerHttpResponse;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
/**
|
||||
* @Author: meng
|
||||
* @Description: 常用变量
|
||||
* @Date: 2023/3/30 10:29
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Component
|
||||
public class CommonConstant {
|
||||
|
||||
//JWT密钥
|
||||
public static final String JWT_TOKEN = "jwt-token";
|
||||
|
||||
//请求头中的token
|
||||
public static final String X_TOKEN = "X-TOKEN";
|
||||
|
||||
//请求头中的sign
|
||||
public static final String X_SIGN = "X-SIGN";
|
||||
|
||||
public static final String X_APPID = "X-APPID";
|
||||
|
||||
public static final String CODE = "code";
|
||||
|
||||
public static final String MESSAGE = "message";
|
||||
|
||||
public static final String UTF8 = "UTF-8";
|
||||
|
||||
public static final String RSA_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDFJIl4il6nDBlF/3byWB/KXRqfEXkviz7ZvO7TU7JBfh7sFqfgLtJFDSA33+qTHOtYTCjCrwl6oWWX7Aff39HiFW1IBnhKjYdSK5/8ruQY+Y2xbpBMgslA0m2euOv3XPJUXWh0JGBqPllgzvtbtUA1iBELAHVYBACuQPYP2VcPeQIDAQAB";
|
||||
public static final String RSA_PRIVATE_KEY = "MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAMUkiXiKXqcMGUX/dvJYH8pdGp8ReS+LPtm87tNTskF+HuwWp+Au0kUNIDff6pMc61hMKMKvCXqhZZfsB9/f0eIVbUgGeEqNh1Irn/yu5Bj5jbFukEyCyUDSbZ646/dc8lRdaHQkYGo+WWDO+1u1QDWIEQsAdVgEAK5A9g/ZVw95AgMBAAECgYABvRrBR2ciTgcDCQfBh2lwXXXYpUzOUIoTXYk1r+1IipY3OtPsND2CgmUgWQc2mPCybKmHXgfVXwsIVfqTzOOK+PEMVGYNflUdXgV3hNffRzl/nfPdpqhb2ALu8ftPwiGq5QN2PqaRgY9kM67Ye/cCjFzm/kLIqsNuXLKiQc1ioQJBAO7g4ZBcG/D0IxtiR4RdXYtr4wQc+cmscSKj5RPNBwn0bh9psOSg2loS/wWUmCnYSncsLGgMzPl+yPkTLwGryH0CQQDTRduiOzu6bFdOw6tI6eOxHB5h0kfcim4VT/Huh5RyP+GC7kLBmknbBO/tQXxSDVaG81Pkr+INHxJmctfKik+tAkEAtBIrl0IIAhRXnp3wYXRsPtxeLkyVc5SdWEqKNen5Y2Sx2tY2dbJXx0zIl3FTXz/fqoRPGUSFA5Kydygh6DWRlQJBAMmOfOHB9tJ8Z7LJ85AFKucdt1KFpW8eVbVZZqq0iAeTMBaULfW7tzgO9sJ3Vh6FgQYP//pNXbA883XvnDUrTKUCQQDgLO7mThmy7iqqo0be4a2ycy9fvORFYzSq1t6mTd+gr73CMCy2bTmyv/Qp4QsuPIKea0iE+HA/la5zlM8eAxOq";
|
||||
//公共返回方法
|
||||
public static Mono<Void> buildResponse(ServerWebExchange exchange, int code, String message) {
|
||||
ServerHttpResponse response = exchange.getResponse();
|
||||
response.setStatusCode(HttpStatus.OK);
|
||||
response.getHeaders().add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_UTF8_VALUE);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put(CODE, code);
|
||||
jsonObject.put(MESSAGE, message);
|
||||
DataBuffer bodyDataBuffer = response.bufferFactory().wrap(jsonObject.toJSONString().getBytes());
|
||||
return response.writeWith(Mono.just(bodyDataBuffer));
|
||||
}
|
||||
}
|
||||
|
|
@ -38,7 +38,7 @@ public class AesCbcUtils {
|
|||
/**
|
||||
* AES要求密钥长度为128位或192位或256位,java默认限制AES密钥长度最多128位
|
||||
*/
|
||||
public static String sKey = "zhst@bonus@zhst@bonus@1234567890";
|
||||
public static String sKey = "zhgd@bonus@zhgd@bonus@1234567890";
|
||||
|
||||
/**
|
||||
* 编码格式导出
|
||||
|
|
@ -58,26 +58,44 @@ public class AesCbcUtils {
|
|||
* @throws Exception
|
||||
* @return 加密后的密文
|
||||
*/
|
||||
public static String encrypt(String source, String key) throws Exception {
|
||||
byte[] sourceBytes = source.getBytes(ENCODING);
|
||||
byte[] keyBytes = key.getBytes(ENCODING);
|
||||
Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM, "BC");
|
||||
IvParameterSpec iv = new IvParameterSpec(IV_PARAMETER.getBytes(ENCODING));
|
||||
cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(keyBytes, KEY_ALGORITHM), iv);
|
||||
byte[] decrypted = cipher.doFinal(sourceBytes);
|
||||
return Base64.encodeBase64String(decrypted);
|
||||
public static String encrypt(String source ) {
|
||||
try{
|
||||
String key=sKey;
|
||||
byte[] sourceBytes = source.getBytes(ENCODING);
|
||||
byte[] keyBytes = key.getBytes(ENCODING);
|
||||
Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM, "BC");
|
||||
IvParameterSpec iv = new IvParameterSpec(IV_PARAMETER.getBytes(ENCODING));
|
||||
cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(keyBytes, KEY_ALGORITHM), iv);
|
||||
byte[] decrypted = cipher.doFinal(sourceBytes);
|
||||
return Base64.encodeBase64String(decrypted);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// String json="username=guest&password=admin@123";
|
||||
|
||||
String json="{\"username\":\"guest\",\"password\":\"admin@123\"}";
|
||||
String data=encrypt(json);
|
||||
System.err.println(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* AES解密
|
||||
*(CBC模式)
|
||||
* @param encryptStr 加密后的密文
|
||||
* @param data 加密后的密文
|
||||
* @param
|
||||
* @throws Exception
|
||||
* @return 源字符串
|
||||
*/
|
||||
public static String decrypt(String encryptStr) {
|
||||
public static String decrypt(String data) {
|
||||
try{
|
||||
String encryptStr="";
|
||||
if(StringHelper.isNotEmpty(data)){
|
||||
encryptStr=data.replace(" ","+");
|
||||
}
|
||||
String key=sKey;
|
||||
byte[] sourceBytes = Base64.decodeBase64(encryptStr);
|
||||
byte[] keyBytes = key.getBytes(ENCODING);
|
||||
|
|
@ -87,9 +105,10 @@ public class AesCbcUtils {
|
|||
byte[] decoded = cipher.doFinal(sourceBytes);
|
||||
return new String(decoded, ENCODING);
|
||||
}catch (Exception e){
|
||||
log.info("------------------->请求加密参数不正确");
|
||||
log.error(e.toString(),e);
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
package com.securitycontrol.common.core.utils.aes;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import org.springframework.core.io.buffer.DataBuffer;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.server.reactive.ServerHttpResponse;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
/**
|
||||
* @author 黑子
|
||||
*/
|
||||
public final class MonoUtils {
|
||||
|
||||
private MonoUtils() {
|
||||
|
||||
}
|
||||
public static Mono<Void> invalidUrl(ServerWebExchange exchange){
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("code", 400);
|
||||
json.put("msg", "无效的请求");
|
||||
return buildReturnMono(json, exchange);
|
||||
}
|
||||
|
||||
|
||||
public static Mono<Void> buildReturnMono(JSONObject json, ServerWebExchange exchange) {
|
||||
ServerHttpResponse response = exchange.getResponse();
|
||||
byte[] bits = json.toJSONString().getBytes(StandardCharsets.UTF_8);
|
||||
DataBuffer buffer = response.bufferFactory().wrap(bits);
|
||||
response.setStatusCode(HttpStatus.UNAUTHORIZED);
|
||||
//指定编码,否则在浏览器中会中文乱码
|
||||
response.getHeaders().add("Content-Type", "text/plain;charset=UTF-8");
|
||||
return response.writeWith(Mono.just(buffer));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -38,4 +38,10 @@ public class ParamDto {
|
|||
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
private String endTime;
|
||||
|
||||
@ApiModelProperty(value = "绑定班组人员")
|
||||
private String bandingUsers;
|
||||
|
||||
@ApiModelProperty(value = "未绑定班组人员")
|
||||
private String unBandingUsers;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,43 @@
|
|||
package com.securitycontrol.gateway.filter;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
|
||||
/**
|
||||
* @Author: meng
|
||||
* @Description: 网关上下文
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Data
|
||||
public class GatewayContext {
|
||||
|
||||
public static final String CACHE_GATEWAY_CONTEXT = "cacheGatewayContext";
|
||||
|
||||
/**
|
||||
* cache headers
|
||||
*/
|
||||
private HttpHeaders headers;
|
||||
|
||||
/**
|
||||
* cache json body
|
||||
*/
|
||||
private String cacheBody;
|
||||
|
||||
/**
|
||||
* cache formdata
|
||||
*/
|
||||
private MultiValueMap<String, String> formData = new LinkedMultiValueMap<>();
|
||||
|
||||
/**
|
||||
* ipAddress
|
||||
*/
|
||||
private String ipAddress;
|
||||
|
||||
/**
|
||||
* path
|
||||
*/
|
||||
private String path;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,236 @@
|
|||
package com.securitycontrol.gateway.filter;
|
||||
|
||||
import io.netty.buffer.ByteBufAllocator;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
|
||||
import org.springframework.cloud.gateway.filter.GlobalFilter;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.io.ByteArrayResource;
|
||||
import org.springframework.core.io.buffer.DataBuffer;
|
||||
import org.springframework.core.io.buffer.DataBufferUtils;
|
||||
import org.springframework.core.io.buffer.NettyDataBufferFactory;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.codec.HttpMessageReader;
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest;
|
||||
import org.springframework.http.server.reactive.ServerHttpRequestDecorator;
|
||||
import org.springframework.http.server.reactive.ServerHttpResponse;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.reactive.function.server.HandlerStrategies;
|
||||
import org.springframework.web.reactive.function.server.ServerRequest;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: https://blog.csdn.net/zx156955/article/details/115004910
|
||||
* @Description: 请求内容存储 处理请求内容 内容放在gatewayContext中
|
||||
* @Date: 2023/3/30 10:11
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class RequestCoverFilter implements GlobalFilter, Ordered {
|
||||
|
||||
/**
|
||||
* default HttpMessageReader
|
||||
*/
|
||||
private static final List<HttpMessageReader<?>> messageReaders = HandlerStrategies.withDefaults().messageReaders();
|
||||
|
||||
/**
|
||||
* ReadFormData
|
||||
*
|
||||
* @param exchange
|
||||
* @param chain
|
||||
* @return
|
||||
*/
|
||||
private Mono<Void> readFormData(ServerWebExchange exchange, GatewayFilterChain chain,
|
||||
GatewayContext gatewayContext) {
|
||||
final ServerHttpRequest request = exchange.getRequest();
|
||||
HttpHeaders headers = request.getHeaders();
|
||||
|
||||
return exchange.getFormData().doOnNext(multiValueMap -> {
|
||||
gatewayContext.setFormData(multiValueMap);
|
||||
log.debug("[GatewayContext]Read FormData:{}", multiValueMap);
|
||||
}).then(Mono.defer(() -> {
|
||||
Charset charset = headers.getContentType().getCharset();
|
||||
charset = charset == null ? StandardCharsets.UTF_8 : charset;
|
||||
String charsetName = charset.name();
|
||||
MultiValueMap<String, String> formData = gatewayContext.getFormData();
|
||||
/**
|
||||
* formData is empty just return
|
||||
*/
|
||||
if (null == formData || formData.isEmpty()) {
|
||||
return chain.filter(exchange);
|
||||
}
|
||||
StringBuilder formDataBodyBuilder = new StringBuilder();
|
||||
String entryKey;
|
||||
List<String> entryValue;
|
||||
try {
|
||||
/**
|
||||
* repackage form data
|
||||
*/
|
||||
for (Map.Entry<String, List<String>> entry : formData.entrySet()) {
|
||||
entryKey = entry.getKey();
|
||||
entryValue = entry.getValue();
|
||||
if (entryValue.size() > 1) {
|
||||
for (String value : entryValue) {
|
||||
formDataBodyBuilder.append(entryKey).append("=")
|
||||
.append(URLEncoder.encode(value, charsetName)).append("&");
|
||||
}
|
||||
} else {
|
||||
formDataBodyBuilder.append(entryKey).append("=")
|
||||
.append(URLEncoder.encode(entryValue.get(0), charsetName)).append("&");
|
||||
}
|
||||
}
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// ignore URLEncode Exception
|
||||
}
|
||||
/**
|
||||
* substring with the last char '&'
|
||||
*/
|
||||
String formDataBodyString = "";
|
||||
if (formDataBodyBuilder.length() > 0) {
|
||||
formDataBodyString = formDataBodyBuilder.substring(0, formDataBodyBuilder.length() - 1);
|
||||
}
|
||||
/**
|
||||
* get data bytes
|
||||
*/
|
||||
byte[] bodyBytes = formDataBodyString.getBytes(charset);
|
||||
int contentLength = bodyBytes.length;
|
||||
ServerHttpRequestDecorator decorator = new ServerHttpRequestDecorator(request) {
|
||||
/**
|
||||
* change content-length
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public HttpHeaders getHeaders() {
|
||||
HttpHeaders httpHeaders = new HttpHeaders();
|
||||
httpHeaders.putAll(super.getHeaders());
|
||||
if (contentLength > 0) {
|
||||
httpHeaders.setContentLength(contentLength);
|
||||
} else {
|
||||
httpHeaders.set(HttpHeaders.TRANSFER_ENCODING, "chunked");
|
||||
}
|
||||
return httpHeaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* read bytes to Flux<Databuffer>
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Flux<DataBuffer> getBody() {
|
||||
return DataBufferUtils.read(new ByteArrayResource(bodyBytes),
|
||||
new NettyDataBufferFactory(ByteBufAllocator.DEFAULT), contentLength);
|
||||
}
|
||||
};
|
||||
ServerWebExchange mutateExchange = exchange.mutate().request(decorator).build();
|
||||
log.info("[GatewayContext]Rewrite Form Data :{}", formDataBodyString);
|
||||
|
||||
return chain.filter(mutateExchange);
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* ReadJsonBody
|
||||
*
|
||||
* @param exchange
|
||||
* @param chain
|
||||
* @return
|
||||
*/
|
||||
private Mono<Void> readBody(ServerWebExchange exchange, GatewayFilterChain chain, GatewayContext gatewayContext) {
|
||||
/**
|
||||
* join the body
|
||||
*/
|
||||
return DataBufferUtils.join(exchange.getRequest().getBody()).flatMap(dataBuffer -> {
|
||||
/*
|
||||
* read the body Flux<DataBuffer>, and release the buffer
|
||||
* see PR https://github.com/spring-cloud/spring-cloud-gateway/pull/1095
|
||||
*/
|
||||
byte[] bytes = new byte[dataBuffer.readableByteCount()];
|
||||
dataBuffer.read(bytes);
|
||||
DataBufferUtils.release(dataBuffer);
|
||||
Flux<DataBuffer> cachedFlux = Flux.defer(() -> {
|
||||
DataBuffer buffer = exchange.getResponse().bufferFactory().wrap(bytes);
|
||||
DataBufferUtils.retain(buffer);
|
||||
return Mono.just(buffer);
|
||||
});
|
||||
/**
|
||||
* repackage ServerHttpRequest
|
||||
*/
|
||||
ServerHttpRequest mutatedRequest = new ServerHttpRequestDecorator(exchange.getRequest()) {
|
||||
@Override
|
||||
public Flux<DataBuffer> getBody() {
|
||||
return cachedFlux;
|
||||
}
|
||||
};
|
||||
/**
|
||||
* mutate exchage with new ServerHttpRequest
|
||||
*/
|
||||
ServerWebExchange mutatedExchange = exchange.mutate().request(mutatedRequest).build();
|
||||
/**
|
||||
* read body string with default messageReaders
|
||||
*/
|
||||
return ServerRequest.create(mutatedExchange, messageReaders).bodyToMono(String.class)
|
||||
.doOnNext(objectValue -> {
|
||||
gatewayContext.setCacheBody(objectValue);
|
||||
log.debug("[GatewayContext]Read JsonBody:{}", objectValue);
|
||||
}).then(chain.filter(mutatedExchange));
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return HIGHEST_PRECEDENCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
|
||||
/**
|
||||
* save request path and serviceId into gateway context
|
||||
*/
|
||||
ServerHttpRequest request = exchange.getRequest();
|
||||
ServerHttpResponse response = exchange.getResponse();
|
||||
|
||||
GatewayContext gatewayContext = new GatewayContext();
|
||||
String path = request.getPath().pathWithinApplication().value();
|
||||
gatewayContext.setPath(path);
|
||||
gatewayContext.getFormData().addAll(request.getQueryParams());
|
||||
gatewayContext.setIpAddress(String.valueOf(request.getRemoteAddress()));
|
||||
HttpHeaders headers = request.getHeaders();
|
||||
gatewayContext.setHeaders(headers);
|
||||
log.debug("HttpMethod:{},Url:{}", request.getMethod(), request.getURI().getRawPath());
|
||||
|
||||
/// 注意,因为webflux的响应式编程 不能再采取原先的编码方式 即应该先将gatewayContext放入exchange中,否则其他地方可能取不到
|
||||
/**
|
||||
* save gateway context into exchange
|
||||
*/
|
||||
exchange.getAttributes().put(GatewayContext.CACHE_GATEWAY_CONTEXT, gatewayContext);
|
||||
|
||||
// 处理参数
|
||||
MediaType contentType = headers.getContentType();
|
||||
long contentLength = headers.getContentLength();
|
||||
if (contentLength > 0) {
|
||||
if (MediaType.APPLICATION_JSON.equals(contentType) || MediaType.APPLICATION_JSON_UTF8.equals(contentType)) {
|
||||
return readBody(exchange, chain, gatewayContext);
|
||||
}
|
||||
if (MediaType.APPLICATION_FORM_URLENCODED.equals(contentType)) {
|
||||
return readFormData(exchange, chain, gatewayContext);
|
||||
}
|
||||
}
|
||||
|
||||
log.debug("[GatewayContext]ContentType:{},Gateway context is set with {}", contentType, gatewayContext);
|
||||
return chain.filter(exchange);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
package com.securitycontrol.gateway.filter;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.CryptoException;
|
||||
import com.securitycontrol.common.core.utils.CommonConstant;
|
||||
import com.securitycontrol.common.core.utils.StringUtils;
|
||||
import com.securitycontrol.common.core.utils.aes.AesCbcUtils;
|
||||
import com.securitycontrol.common.core.utils.aes.MonoUtils;
|
||||
import com.securitycontrol.common.core.utils.aes.StringHelper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.cloud.gateway.filter.GatewayFilter;
|
||||
import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory;
|
||||
import org.springframework.core.io.buffer.DataBuffer;
|
||||
import org.springframework.core.io.buffer.DataBufferFactory;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest;
|
||||
import org.springframework.http.server.reactive.ServerHttpRequestDecorator;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
import org.springframework.web.util.UriComponentsBuilder;
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.net.URI;
|
||||
import java.security.interfaces.RSAPrivateKey;
|
||||
|
||||
/**
|
||||
* @Author: meng
|
||||
* @Description: RSA实现对请求参数解密
|
||||
* @Date: 2023/4/6 15:20
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
class RsaDecryptResponseGatewayFilterFactory extends AbstractGatewayFilterFactory {
|
||||
|
||||
@Value("${system.jm}")
|
||||
public boolean AQ_JM;
|
||||
|
||||
|
||||
@Override
|
||||
public GatewayFilter apply(Object config) {
|
||||
return (exchange, chain) -> {
|
||||
ServerHttpRequest serverHttpRequest = exchange.getRequest();
|
||||
if(!AQ_JM){
|
||||
return chain.filter(exchange);
|
||||
}
|
||||
//get请求 默认
|
||||
if(HttpMethod.GET.matches(serverHttpRequest.getMethodValue())){//如果是get
|
||||
if(exchange.getRequest().getQueryParams().isEmpty()){//如果参数是空的
|
||||
return chain.filter(exchange);
|
||||
}else{
|
||||
try{
|
||||
updateRequestParam(exchange);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return CommonConstant.buildResponse(exchange, HttpStatus.BAD_REQUEST.value(), "请求参数异常");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!HttpMethod.POST.matches(serverHttpRequest.getMethodValue())) {//非 post请求
|
||||
return chain.filter(exchange);
|
||||
}
|
||||
byte[] decrypBytes;
|
||||
GatewayContext gatewayContext = exchange.getAttribute(GatewayContext.CACHE_GATEWAY_CONTEXT);
|
||||
if(StrUtil.isBlank(gatewayContext.getCacheBody())){
|
||||
if(!exchange.getRequest().getQueryParams().isEmpty()){
|
||||
try{
|
||||
updateRequestParam(exchange);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return CommonConstant.buildResponse(exchange, HttpStatus.BAD_REQUEST.value(), "请求参数异常");
|
||||
}
|
||||
}
|
||||
//未强制加密
|
||||
return chain.filter(exchange);
|
||||
|
||||
// return CommonConstant.buildResponse(exchange, HttpStatus.BAD_REQUEST.value(), "请求参数不能为空");
|
||||
|
||||
}
|
||||
try {
|
||||
// 获取request body
|
||||
String requestBody = gatewayContext.getCacheBody();
|
||||
String decryptMsg= AesCbcUtils.decrypt(requestBody);
|
||||
gatewayContext.setCacheBody(decryptMsg);
|
||||
decrypBytes = decryptMsg.getBytes();
|
||||
} catch (Exception e) {
|
||||
log.error("数据 解密失败:{}", e);
|
||||
return CommonConstant.buildResponse(exchange, HttpStatus.BAD_REQUEST.value(), "数据解密失败");
|
||||
}
|
||||
// 根据解密后的参数重新构建请求
|
||||
DataBufferFactory dataBufferFactory = exchange.getResponse().bufferFactory();
|
||||
Flux<DataBuffer> bodyFlux = Flux.just(dataBufferFactory.wrap(decrypBytes));
|
||||
ServerHttpRequest newRequest = serverHttpRequest.mutate().uri(serverHttpRequest.getURI()).build();
|
||||
newRequest = new ServerHttpRequestDecorator(newRequest) {
|
||||
@Override
|
||||
public Flux<DataBuffer> getBody() {
|
||||
return bodyFlux;
|
||||
}
|
||||
};
|
||||
// 构建新的请求头
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.putAll(exchange.getRequest().getHeaders());
|
||||
// 由于修改了传递参数,需要重新设置CONTENT_LENGTH,长度是字节长度,不是字符串长度
|
||||
int length = decrypBytes.length;
|
||||
headers.remove(HttpHeaders.CONTENT_LENGTH);
|
||||
headers.setContentLength(length);
|
||||
newRequest = new ServerHttpRequestDecorator(newRequest) {
|
||||
@Override
|
||||
public HttpHeaders getHeaders() {
|
||||
return headers;
|
||||
}
|
||||
};
|
||||
// 把解密后的数据重置到exchange自定义属性中,在之后的日志GlobalLogFilter从此处获取请求参数打印日志
|
||||
exchange.getAttributes().put(GatewayContext.CACHE_GATEWAY_CONTEXT, gatewayContext);
|
||||
return chain.filter(exchange.mutate().request(newRequest).build());
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改前端传的参数
|
||||
*/
|
||||
private void updateRequestParam(ServerWebExchange exchange) throws NoSuchFieldException, IllegalAccessException {
|
||||
ServerHttpRequest request = exchange.getRequest();
|
||||
URI uri = request.getURI();
|
||||
//请求参数
|
||||
String query = uri.getQuery();
|
||||
//判断是否有加密的参数 这里的约定是 param
|
||||
if (StringUtils.isNotBlank(query) && query.contains("params")) {
|
||||
String[] split = query.split("=");
|
||||
String paramValue = split[1];
|
||||
//解密请求参数
|
||||
String param =AesCbcUtils.decrypt(paramValue);
|
||||
//使用反射强行拿出 URI 的 query
|
||||
Field targetQuery = uri.getClass().getDeclaredField("query");
|
||||
//授权
|
||||
targetQuery.setAccessible(true);
|
||||
//重新设置参数
|
||||
targetQuery.set(uri, param);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -17,7 +17,7 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
username: nacos
|
||||
password: nacos
|
||||
password: Jjsp@nacos2023
|
||||
namespace: jjzhgd
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
|
|
@ -32,7 +32,7 @@ spring:
|
|||
shared-configs:
|
||||
- vsc-dev.yml
|
||||
username: nacos
|
||||
password: nacos
|
||||
password: Jjsp@nacos2023
|
||||
namespace: jjzhgd
|
||||
# server-addr: 10.138.132.188:18848
|
||||
management:
|
||||
|
|
@ -48,4 +48,6 @@ management:
|
|||
endpoints:
|
||||
env:
|
||||
enable: false
|
||||
system:
|
||||
jm: false
|
||||
|
||||
|
|
|
|||
|
|
@ -131,6 +131,36 @@
|
|||
<version>2.3.30</version>
|
||||
<!-- <scope>provided</scope>-->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.afterturn</groupId>
|
||||
<artifactId>easypoi-base</artifactId>
|
||||
<version>4.2.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.afterturn</groupId>
|
||||
<artifactId>easypoi-base</artifactId>
|
||||
<version>4.2.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.securitycontrol</groupId>
|
||||
<artifactId>securitycontrol-system</artifactId>
|
||||
<version>3.6.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.docker-java</groupId>
|
||||
<artifactId>docker-java</artifactId>
|
||||
<version>3.2.12</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,75 @@
|
|||
package com.securitycontrol.background.constructionQuality.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
|
||||
import com.securitycontrol.background.constructionQuality.service.EarlyWarningsRecordService;
|
||||
import com.securitycontrol.background.constructionQuality.vo.EarlyWarningsRecordVo;
|
||||
import com.securitycontrol.common.core.web.controller.BaseController;
|
||||
import com.securitycontrol.common.core.web.page.TableDataInfo;
|
||||
import com.securitycontrol.common.log.annotation.Log;
|
||||
import com.securitycontrol.common.log.enums.OperationType;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
|
||||
import com.securitycontrol.system.export.util.ExcelStyleUtil;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 施工质量 - 预警记录
|
||||
* @author lsun
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/constructionQuality/earlyWarningRecord/")
|
||||
@Slf4j
|
||||
public class EarlyWarningsRecordController extends BaseController {
|
||||
|
||||
@Resource(name = "EarlyWarningsRecordService")
|
||||
private EarlyWarningsRecordService service;
|
||||
|
||||
@ApiOperation(value = "获取信息列表")
|
||||
@GetMapping("getEarlyWarningRecordLists")
|
||||
@Log(title = "施工质量", menu = "施工质量->预警记录", grade = OperationType.QUERY_BUSINESS, details = "查询列表", type = "业务日志")
|
||||
public TableDataInfo getEarlyWarningRecordLists(EarlyWarningsRecordVo dto) {
|
||||
startPage();
|
||||
List<EarlyWarningsRecordVo> list = service.getEarlyWarningRecordLists(dto);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("exportProData")
|
||||
@Log(title = "施工质量", menu = "施工质量->预警记录", grade = OperationType.EXPORT_BUSINESS, details = "导出列表", type = "业务日志")
|
||||
public void exportData(HttpServletRequest request, HttpServletResponse response, EarlyWarningsRecordVo dto) {
|
||||
try {
|
||||
List<EarlyWarningsRecordVo> proExportVoList = new ArrayList<>();
|
||||
List<EarlyWarningsRecordVo> proLists = service.getEarlyWarningRecordLists(dto);
|
||||
for (int i = 0; i < proLists.size(); i++) {
|
||||
proLists.get(i).setProId((i + 1) + "");
|
||||
EarlyWarningsRecordVo exportVo = new EarlyWarningsRecordVo();
|
||||
BeanUtils.copyProperties(proLists.get(i), exportVo);
|
||||
proExportVoList.add(exportVo);
|
||||
}
|
||||
ExportParams exportParams = new ExportParams("预警记录", "预警记录", ExcelType.XSSF);
|
||||
exportParams.setStyle(ExcelStyleUtil.class);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, EarlyWarningsRecordVo.class, proExportVoList);
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("预警记录" + ".xlsx", "UTF-8"));
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
workbook.write(outputStream);
|
||||
outputStream.close();
|
||||
workbook.close();
|
||||
} catch (Exception e) {
|
||||
log.error("导出预警记录", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
package com.securitycontrol.background.constructionQuality.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import com.securitycontrol.background.constructionQuality.service.QualityRecordService;
|
||||
import com.securitycontrol.background.constructionQuality.vo.QualityRecordVo;
|
||||
import com.securitycontrol.common.core.web.controller.BaseController;
|
||||
import com.securitycontrol.common.core.web.page.TableDataInfo;
|
||||
import com.securitycontrol.common.log.annotation.Log;
|
||||
import com.securitycontrol.common.log.enums.OperationType;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
|
||||
import com.securitycontrol.system.export.util.ExcelStyleUtil;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 施工质量 - 质量检测记录
|
||||
* @author lsun
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/constructionQuality/qualityRecord/")
|
||||
@Slf4j
|
||||
public class QualityRecordController extends BaseController {
|
||||
|
||||
@Resource(name = "QualityRecordService")
|
||||
private QualityRecordService service;
|
||||
|
||||
@ApiOperation(value = "获取信息列表")
|
||||
@GetMapping("getQualityRecordLists")
|
||||
@Log(title = "施工质量", menu = "施工质量->质量检测记录", grade = OperationType.QUERY_BUSINESS, details = "查询列表", type = "业务日志")
|
||||
public TableDataInfo getQualityRecordLists(QualityRecordVo dto) {
|
||||
startPage();
|
||||
List<QualityRecordVo> list = service.getQualityRecordLists(dto);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("exportProData")
|
||||
@Log(title = "施工质量", menu = "施工质量->质量检测记录", grade = OperationType.EXPORT_BUSINESS, details = "导出列表", type = "业务日志")
|
||||
public void exportData(HttpServletRequest request, HttpServletResponse response, QualityRecordVo dto) {
|
||||
try {
|
||||
List<QualityRecordVo> proExportVoList = new ArrayList<>();
|
||||
List<QualityRecordVo> proLists = service.getQualityRecordLists(dto);
|
||||
for (int i = 0; i < proLists.size(); i++) {
|
||||
proLists.get(i).setProId((i + 1) + "");
|
||||
QualityRecordVo exportVo = new QualityRecordVo();
|
||||
BeanUtils.copyProperties(proLists.get(i), exportVo);
|
||||
proExportVoList.add(exportVo);
|
||||
}
|
||||
ExportParams exportParams = new ExportParams("质量检测记录", "质量检测记录", ExcelType.XSSF);
|
||||
exportParams.setStyle(ExcelStyleUtil.class);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, QualityRecordVo.class, proExportVoList);
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("质量检测记录" + ".xlsx", "UTF-8"));
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
workbook.write(outputStream);
|
||||
outputStream.close();
|
||||
workbook.close();
|
||||
} catch (Exception e) {
|
||||
log.error("导出质量检测记录", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.securitycontrol.background.constructionQuality.mapper;
|
||||
|
||||
import com.securitycontrol.background.constructionQuality.vo.EarlyWarningsRecordVo;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 施工质量 - 预警记录
|
||||
* @author lsun
|
||||
*/
|
||||
@Repository(value = "EarlyWarningsRecordMapper")
|
||||
public interface EarlyWarningsRecordMapper {
|
||||
|
||||
/**
|
||||
* 获取信息列表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<EarlyWarningsRecordVo> getEarlyWarningsRecordLists(EarlyWarningsRecordVo dto);
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.securitycontrol.background.constructionQuality.mapper;
|
||||
|
||||
import com.securitycontrol.background.constructionQuality.vo.QualityRecordVo;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 施工质量 - 质量检测记录
|
||||
* @author lsun
|
||||
*/
|
||||
@Repository(value = "QualityRecordMapper")
|
||||
public interface QualityRecordMapper {
|
||||
|
||||
/**
|
||||
* 获取信息列表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<QualityRecordVo> getQualityRecordLists(QualityRecordVo dto);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.securitycontrol.background.constructionQuality.service;
|
||||
|
||||
|
||||
import com.securitycontrol.background.constructionQuality.vo.EarlyWarningsRecordVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 施工质量 - 预警记录
|
||||
* @author lsun
|
||||
*/
|
||||
public interface EarlyWarningsRecordService {
|
||||
|
||||
/**
|
||||
* 获取信息列表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<EarlyWarningsRecordVo> getEarlyWarningRecordLists(EarlyWarningsRecordVo dto);
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.securitycontrol.background.constructionQuality.service;
|
||||
|
||||
import com.securitycontrol.background.constructionQuality.vo.QualityRecordVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 施工质量 - 质量检测记录
|
||||
* @author lsun
|
||||
*/
|
||||
public interface QualityRecordService {
|
||||
|
||||
/**
|
||||
* 获取信息列表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<QualityRecordVo> getQualityRecordLists(QualityRecordVo dto);
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.securitycontrol.background.constructionQuality.service.impl;
|
||||
|
||||
import com.securitycontrol.background.constructionQuality.mapper.EarlyWarningsRecordMapper;
|
||||
import com.securitycontrol.background.constructionQuality.service.EarlyWarningsRecordService;
|
||||
import com.securitycontrol.background.constructionQuality.vo.EarlyWarningsRecordVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 施工质量 - 预警记录
|
||||
* @author lsun
|
||||
*/
|
||||
@Service(value = "EarlyWarningsRecordService")
|
||||
@Slf4j
|
||||
public class EarlyWarningsRecordServiceImpl implements EarlyWarningsRecordService {
|
||||
|
||||
@Resource(name = "EarlyWarningsRecordMapper")
|
||||
private EarlyWarningsRecordMapper mapper;
|
||||
|
||||
@Override
|
||||
public List<EarlyWarningsRecordVo> getEarlyWarningRecordLists(EarlyWarningsRecordVo dto) {
|
||||
List<EarlyWarningsRecordVo> list = new ArrayList<>();
|
||||
list = mapper.getEarlyWarningsRecordLists(dto);
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.securitycontrol.background.constructionQuality.service.impl;
|
||||
|
||||
|
||||
import com.securitycontrol.background.constructionQuality.mapper.QualityRecordMapper;
|
||||
import com.securitycontrol.background.constructionQuality.service.QualityRecordService;
|
||||
import com.securitycontrol.background.constructionQuality.vo.QualityRecordVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 施工质量 - 质量检测记录
|
||||
* @author lsun
|
||||
*/
|
||||
@Service(value = "QualityRecordService")
|
||||
@Slf4j
|
||||
public class QualityRecordServiceImpl implements QualityRecordService {
|
||||
|
||||
@Resource(name = "QualityRecordMapper")
|
||||
private QualityRecordMapper mapper;
|
||||
|
||||
@Override
|
||||
public List<QualityRecordVo> getQualityRecordLists(QualityRecordVo dto) {
|
||||
List<QualityRecordVo> list = new ArrayList<>();
|
||||
list = mapper.getQualityRecordLists(dto);
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.securitycontrol.background.constructionQuality.vo;
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author lsun
|
||||
*/
|
||||
@Data
|
||||
public class EarlyWarningsRecordVo {
|
||||
|
||||
@Excel(name = "序号", width = 10.0, orderNum = "0")
|
||||
private String proId;
|
||||
|
||||
@ApiModelProperty(value = "告警内容")
|
||||
@Excel(name = "告警内容", width = 10.0, orderNum = "1")
|
||||
private String warnContent;
|
||||
|
||||
@ApiModelProperty(value = "告警时间")
|
||||
@Excel(name = "告警时间", width = 10.0, orderNum = "2")
|
||||
private String warnTime;
|
||||
|
||||
@ApiModelProperty(value = "告警类型")
|
||||
private String warnType;
|
||||
|
||||
@ApiModelProperty(value = "监测时间")
|
||||
private String createTime;
|
||||
|
||||
private String keyWord;
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.securitycontrol.background.constructionQuality.vo;
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author lsun
|
||||
*/
|
||||
@Data
|
||||
public class QualityRecordVo {
|
||||
|
||||
@ApiModelProperty(value = "工程ID")
|
||||
@Excel(name = "序号", width = 10.0, orderNum = "0")
|
||||
private String proId;
|
||||
|
||||
@ApiModelProperty(value = "设备名称")
|
||||
@Excel(name = "设备名称", width = 10.0, orderNum = "1")
|
||||
private String deviceName;
|
||||
|
||||
@ApiModelProperty(value = "区域名称")
|
||||
@Excel(name = "区域名称", width = 10.0, orderNum = "2")
|
||||
private String areaName;
|
||||
|
||||
@ApiModelProperty(value = "监测点名称")
|
||||
@Excel(name = "监测点名称", width = 10.0, orderNum = "3")
|
||||
private String modeName;
|
||||
|
||||
@ApiModelProperty(value = "检测值")
|
||||
@Excel(name = "检测值", width = 10.0, orderNum = "4")
|
||||
private String val;
|
||||
|
||||
@ApiModelProperty(value = "累计变化")
|
||||
@Excel(name = "累计变化", width = 10.0, orderNum = "5")
|
||||
private String changeVal;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
@Excel(name = "状态", width = 10.0, orderNum = "6")
|
||||
private String isWarn;
|
||||
|
||||
@ApiModelProperty(value = "监测时间")
|
||||
@Excel(name = "监测时间", width = 10.0, orderNum = "7")
|
||||
private String createTime;
|
||||
|
||||
private String keyWord;
|
||||
}
|
||||
|
|
@ -7,6 +7,7 @@ import com.securitycontrol.common.core.web.page.TableDataInfo;
|
|||
import com.securitycontrol.common.log.annotation.Log;
|
||||
import com.securitycontrol.common.log.enums.OperationType;
|
||||
import com.securitycontrol.entity.background.dto.ParamDto;
|
||||
import com.securitycontrol.entity.background.vo.HumanManageVo;
|
||||
import com.securitycontrol.entity.background.vo.TeamManageVo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -62,4 +63,32 @@ public class TeamManageController extends BaseController {
|
|||
return service.delTeam(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取班组人员列表")
|
||||
@GetMapping("getTeamUserLists")
|
||||
@Log(title = "人员管理", menu = "人员管理->班组管理", grade = OperationType.QUERY_BUSINESS, details = "查询班组人员", type = "业务日志")
|
||||
public TableDataInfo getTeamUserLists(ParamDto dto) {
|
||||
startPage();
|
||||
List<HumanManageVo> list = service.getTeamUserLists(dto);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "移出班组人员")
|
||||
@PostMapping("removeTeamUser")
|
||||
@Log(title = "人员管理", menu = "人员管理->班组管理", grade = OperationType.UPDATE_BUSINESS, details = "移出班组人员", type = "业务日志")
|
||||
public AjaxResult removeTeamUser(@RequestBody ParamDto dto) {
|
||||
return service.removeTeamUser(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取班组组员和未加入班组人员")
|
||||
@GetMapping("getTeamUserAndNoBandingUser")
|
||||
public AjaxResult getTeamUserAndNoBandingUser(ParamDto dto) {
|
||||
return service.getTeamUserAndNoBandingUser(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "添加班组人员")
|
||||
@PostMapping("addTeamUser")
|
||||
@Log(title = "人员管理", menu = "人员管理->班组管理", grade = OperationType.ADD_BUSINESS, details = "添加班组人员", type = "业务日志")
|
||||
public AjaxResult addTeamUser(@RequestBody ParamDto dto) {
|
||||
return service.addTeamUser(dto);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,21 +18,6 @@ import java.util.Map;
|
|||
@Repository(value = "HumanManageMapper")
|
||||
public interface HumanManageMapper {
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
int addHuman(HumanManageVo vo);
|
||||
|
||||
/**
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
int updateHuman(HumanManageVo vo);
|
||||
|
||||
/**
|
||||
* 获取人员列表
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
package com.securitycontrol.background.mapper;
|
||||
|
||||
import com.securitycontrol.entity.background.dto.ParamDto;
|
||||
import com.securitycontrol.entity.background.vo.HumanManageVo;
|
||||
import com.securitycontrol.entity.background.vo.TeamManageVo;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -89,6 +91,7 @@ public interface TeamManageMapper {
|
|||
|
||||
/**
|
||||
* 班组是否存在班组人员
|
||||
*
|
||||
* @param dto
|
||||
* @return int
|
||||
* @description
|
||||
|
|
@ -96,4 +99,59 @@ public interface TeamManageMapper {
|
|||
* @date 2024/3/21 10:48
|
||||
*/
|
||||
int isPeopleByTeam(ParamDto dto);
|
||||
|
||||
/**
|
||||
* 班组人员数量
|
||||
*
|
||||
* @param teamId
|
||||
* @return int
|
||||
* @description
|
||||
* @author cwchen
|
||||
* @date 2024/3/22 9:59
|
||||
*/
|
||||
int getTeamUserNum(String teamId);
|
||||
|
||||
/**
|
||||
* 获取班组人员列表
|
||||
*
|
||||
* @param dto
|
||||
* @return List<HumanManageVo>
|
||||
* @description
|
||||
* @author cwchen
|
||||
* @date 2024/3/22 10:04
|
||||
*/
|
||||
List<HumanManageVo> getTeamUserLists(ParamDto dto);
|
||||
|
||||
/**
|
||||
* 移出班组人员
|
||||
*
|
||||
* @param dto
|
||||
* @description
|
||||
* @author cwchen
|
||||
* @date 2024/3/22 10:13
|
||||
*/
|
||||
void removeTeamUser(ParamDto dto);
|
||||
|
||||
/**
|
||||
* 获取班组组员和未加入班组人员
|
||||
*
|
||||
* @param dto
|
||||
* @return List<Map < String>>
|
||||
* @description
|
||||
* @author cwchen
|
||||
* @date 2024/3/22 10:35
|
||||
*/
|
||||
@MapKey("id")
|
||||
List<Map<String, String>> getTeamUserAndNoBandingUser(ParamDto dto);
|
||||
|
||||
/**
|
||||
* 添加班组人员
|
||||
* @param userId
|
||||
* @param teamId
|
||||
* @param type
|
||||
* @description
|
||||
* @author cwchen
|
||||
* @date 2024/3/22 10:52
|
||||
*/
|
||||
void addTeamUser(@Param("userId") String userId, @Param("teamId") String teamId, @Param("type") int type);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.securitycontrol.background.service;
|
|||
|
||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||
import com.securitycontrol.entity.background.dto.ParamDto;
|
||||
import com.securitycontrol.entity.background.vo.HumanManageVo;
|
||||
import com.securitycontrol.entity.background.vo.TeamManageVo;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -24,6 +25,7 @@ public interface TeamService {
|
|||
|
||||
/**
|
||||
* 删除班组
|
||||
*
|
||||
* @param vo
|
||||
* @return AjaxResult
|
||||
* @description
|
||||
|
|
@ -53,4 +55,47 @@ public interface TeamService {
|
|||
* @date 2024/3/21 10:40
|
||||
*/
|
||||
AjaxResult getTeamDetailById(ParamDto dto);
|
||||
|
||||
/**
|
||||
* 获取班组人员列表
|
||||
*
|
||||
* @param dto
|
||||
* @return List<HumanManageVo>
|
||||
* @description
|
||||
* @author cwchen
|
||||
* @date 2024/3/22 10:02
|
||||
*/
|
||||
List<HumanManageVo> getTeamUserLists(ParamDto dto);
|
||||
|
||||
/**
|
||||
* 移出班组人员
|
||||
*
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @description
|
||||
* @author cwchen
|
||||
* @date 2024/3/22 10:10
|
||||
*/
|
||||
AjaxResult removeTeamUser(ParamDto dto);
|
||||
|
||||
/**
|
||||
* 获取班组组员和未加入班组人员
|
||||
*
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @description
|
||||
* @author cwchen
|
||||
* @date 2024/3/22 10:31
|
||||
*/
|
||||
AjaxResult getTeamUserAndNoBandingUser(ParamDto dto);
|
||||
|
||||
/**
|
||||
* 添加班组人员
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @description
|
||||
* @author cwchen
|
||||
* @date 2024/3/22 10:44
|
||||
*/
|
||||
AjaxResult addTeamUser(ParamDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,11 @@ public class DeviceOfBdServiceImpl implements IDeviceOfBdService {
|
|||
@Override
|
||||
public List<DeviceBdVo> getDeviceBdList(DeviceBdDto dto) {
|
||||
List<DeviceBdVo> list = new ArrayList<>();
|
||||
list = mapper.getDeviceBdList(dto);
|
||||
try {
|
||||
list = mapper.getDeviceBdList(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("获取边带列表",e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
|
@ -81,7 +85,11 @@ public class DeviceOfBdServiceImpl implements IDeviceOfBdService {
|
|||
@Override
|
||||
public AjaxResult getDeviceBdById(DeviceBdDto dto) {
|
||||
DeviceBdVo vo = new DeviceBdVo();
|
||||
vo = mapper.getDeviceBdById(dto);
|
||||
try {
|
||||
vo = mapper.getDeviceBdById(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("边带设备详情",e);
|
||||
}
|
||||
return AjaxResult.success(vo);
|
||||
}
|
||||
|
||||
|
|
@ -109,7 +117,11 @@ public class DeviceOfBdServiceImpl implements IDeviceOfBdService {
|
|||
@Override
|
||||
public List<DeviceBdChildVo> getDeviceBdChildList(DeviceBdDto dto) {
|
||||
List<DeviceBdChildVo> list = new ArrayList<>();
|
||||
list = mapper.getDeviceBdChildList(dto);
|
||||
try {
|
||||
list = mapper.getDeviceBdChildList(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("获取边带子设备列表",e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
|
@ -146,7 +158,11 @@ public class DeviceOfBdServiceImpl implements IDeviceOfBdService {
|
|||
@Override
|
||||
public AjaxResult getDeviceBdChildById(DeviceBdDto dto) {
|
||||
DeviceBdChildVo vo = new DeviceBdChildVo();
|
||||
vo = mapper.getDeviceBdChildById(dto);
|
||||
try {
|
||||
vo = mapper.getDeviceBdChildById(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("边带子设备详情",e);
|
||||
}
|
||||
return AjaxResult.success(vo);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ import com.securitycontrol.system.api.RemoteFileService;
|
|||
import com.securitycontrol.system.api.domain.SysFile;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||
|
|
@ -39,7 +38,7 @@ public class HumanServiceImpl implements HumanService {
|
|||
@Resource(name = "HumanManageMapper")
|
||||
private HumanManageMapper mapper;
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private RemoteFileService remoteFileService;
|
||||
|
||||
@Resource(name = "ValidatorsUtils")
|
||||
|
|
@ -48,7 +47,11 @@ public class HumanServiceImpl implements HumanService {
|
|||
@Override
|
||||
public List<HumanManageVo> getHumanLists(ParamDto dto) {
|
||||
List<HumanManageVo> list = new ArrayList<>();
|
||||
list = mapper.getHumanLists(dto);
|
||||
try {
|
||||
list = mapper.getHumanLists(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("获取人员列表",e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
|
@ -111,7 +114,7 @@ public class HumanServiceImpl implements HumanService {
|
|||
}
|
||||
}
|
||||
}
|
||||
vo.setIdNumber(AesCbcUtils.encrypt(vo.getIdNumber(),AesCbcUtils.sKey));
|
||||
vo.setIdNumber(AesCbcUtils.encrypt(vo.getIdNumber()));
|
||||
// 保存人员数据
|
||||
mapper.addOrUpdatePersonnel(vo);
|
||||
} catch (Exception e) {
|
||||
|
|
@ -156,28 +159,32 @@ public class HumanServiceImpl implements HumanService {
|
|||
@Override
|
||||
public AjaxResult getPersonnelById(ParamDto dto) {
|
||||
HumanManageVo vo = new HumanManageVo();
|
||||
vo = mapper.getPersonnelById(dto);
|
||||
String decryptIdNumber = AesCbcUtils.decrypt(vo.getIdNumber());
|
||||
if(decryptIdNumber != null){
|
||||
vo.setIdNumber(decryptIdNumber);
|
||||
}
|
||||
List<ResourceFileVo> resourceFileVos = mapper.getFiles(vo.getUserId());
|
||||
if (CollectionUtils.isNotEmpty(resourceFileVos)) {
|
||||
List<HumanManageVo.FileData> list = new ArrayList<>();
|
||||
for (ResourceFileVo fileVo : resourceFileVos) {
|
||||
String base64 = null;
|
||||
Result<SysFile> result = remoteFileService.getImgBase64(fileVo.getFileId(), SecurityConstants.INNER);
|
||||
if (result != null && result.getCode() == HttpStatus.SUCCESS && result.getData() != null) {
|
||||
String jsonString = JSON.toJSONString(result.getData());
|
||||
JSONObject item = JSON.parseObject(jsonString);
|
||||
base64 = item.getString("url");
|
||||
}
|
||||
HumanManageVo.FileData fileData = new HumanManageVo.FileData();
|
||||
fileData.setFileId(fileVo.getFileId());
|
||||
fileData.setBase64Url(base64);
|
||||
list.add(fileData);
|
||||
try {
|
||||
vo = mapper.getPersonnelById(dto);
|
||||
String decryptIdNumber = AesCbcUtils.decrypt(vo.getIdNumber());
|
||||
if(decryptIdNumber != null){
|
||||
vo.setIdNumber(decryptIdNumber);
|
||||
}
|
||||
vo.setFileData(list);
|
||||
List<ResourceFileVo> resourceFileVos = mapper.getFiles(vo.getUserId());
|
||||
if (CollectionUtils.isNotEmpty(resourceFileVos)) {
|
||||
List<HumanManageVo.FileData> list = new ArrayList<>();
|
||||
for (ResourceFileVo fileVo : resourceFileVos) {
|
||||
String base64 = null;
|
||||
Result<SysFile> result = remoteFileService.getImgBase64(fileVo.getFileId(), SecurityConstants.INNER);
|
||||
if (result != null && result.getCode() == HttpStatus.SUCCESS && result.getData() != null) {
|
||||
String jsonString = JSON.toJSONString(result.getData());
|
||||
JSONObject item = JSON.parseObject(jsonString);
|
||||
base64 = item.getString("url");
|
||||
}
|
||||
HumanManageVo.FileData fileData = new HumanManageVo.FileData();
|
||||
fileData.setFileId(fileVo.getFileId());
|
||||
fileData.setBase64Url(base64);
|
||||
list.add(fileData);
|
||||
}
|
||||
vo.setFileData(list);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("人员详情",e);
|
||||
}
|
||||
return AjaxResult.success(vo);
|
||||
}
|
||||
|
|
@ -212,21 +219,25 @@ public class HumanServiceImpl implements HumanService {
|
|||
@Override
|
||||
public AjaxResult viewPersonnelFile(ParamDto dto) {
|
||||
List<HumanManageVo.FileData> list = new ArrayList<>();
|
||||
List<ResourceFileVo> resourceFileVos = mapper.getFiles(dto.getId());
|
||||
if (CollectionUtils.isNotEmpty(resourceFileVos)) {
|
||||
for (ResourceFileVo fileVo : resourceFileVos) {
|
||||
String base64 = null;
|
||||
Result<SysFile> result = remoteFileService.getImgBase64(fileVo.getFileId(), SecurityConstants.INNER);
|
||||
if (result != null && result.getCode() == HttpStatus.SUCCESS && result.getData() != null) {
|
||||
String jsonString = JSON.toJSONString(result.getData());
|
||||
JSONObject item = JSON.parseObject(jsonString);
|
||||
base64 = item.getString("url");
|
||||
try {
|
||||
List<ResourceFileVo> resourceFileVos = mapper.getFiles(dto.getId());
|
||||
if (CollectionUtils.isNotEmpty(resourceFileVos)) {
|
||||
for (ResourceFileVo fileVo : resourceFileVos) {
|
||||
String base64 = null;
|
||||
Result<SysFile> result = remoteFileService.getImgBase64(fileVo.getFileId(), SecurityConstants.INNER);
|
||||
if (result != null && result.getCode() == HttpStatus.SUCCESS && result.getData() != null) {
|
||||
String jsonString = JSON.toJSONString(result.getData());
|
||||
JSONObject item = JSON.parseObject(jsonString);
|
||||
base64 = item.getString("url");
|
||||
}
|
||||
HumanManageVo.FileData fileData = new HumanManageVo.FileData();
|
||||
fileData.setFileId(fileVo.getFileId());
|
||||
fileData.setBase64Url(base64);
|
||||
list.add(fileData);
|
||||
}
|
||||
HumanManageVo.FileData fileData = new HumanManageVo.FileData();
|
||||
fileData.setFileId(fileVo.getFileId());
|
||||
fileData.setBase64Url(base64);
|
||||
list.add(fileData);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("人员照片预览",e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
|
@ -234,7 +245,11 @@ public class HumanServiceImpl implements HumanService {
|
|||
@Override
|
||||
public List<UserAccessVo> getPersonnelAccessLists(ParamDto dto) {
|
||||
List<UserAccessVo> list = new ArrayList<>();
|
||||
list = mapper.getPersonnelAccessLists(dto);
|
||||
try {
|
||||
list = mapper.getPersonnelAccessLists(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("获取人员出入记录",e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,15 +7,21 @@ import com.securitycontrol.common.core.utils.aes.AesCbcUtils;
|
|||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||
import com.securitycontrol.common.security.utils.ValidatorsUtils;
|
||||
import com.securitycontrol.entity.background.dto.ParamDto;
|
||||
import com.securitycontrol.entity.background.vo.HumanManageVo;
|
||||
import com.securitycontrol.entity.background.vo.TeamManageVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 班组-业务逻辑层
|
||||
* @author 10488
|
||||
*/
|
||||
@Service(value = "TeamService")
|
||||
@Slf4j
|
||||
public class TeamServiceImpl implements TeamService {
|
||||
|
|
@ -29,7 +35,15 @@ public class TeamServiceImpl implements TeamService {
|
|||
@Override
|
||||
public List<TeamManageVo> getTeamLists(ParamDto dto) {
|
||||
List<TeamManageVo> list = new ArrayList<>();
|
||||
list = mapper.getTeamLists(dto);
|
||||
try {
|
||||
list = mapper.getTeamLists(dto);
|
||||
for (TeamManageVo vo : list) {
|
||||
int num = mapper.getTeamUserNum(vo.getTeamId());
|
||||
vo.setTeamNum(String.valueOf(num));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("获取班组列表",e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
|
@ -55,10 +69,12 @@ public class TeamServiceImpl implements TeamService {
|
|||
} else {
|
||||
vo.setType(2);
|
||||
}
|
||||
vo.setIdNumber(AesCbcUtils.encrypt(vo.getIdNumber(),AesCbcUtils.sKey));
|
||||
vo.setIdNumber(AesCbcUtils.encrypt(vo.getIdNumber()));
|
||||
mapper.addOrUpdateTeam(vo);
|
||||
} catch (Exception e) {
|
||||
log.error("新增/修改班组", e);
|
||||
//手动回滚异常
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return AjaxResult.error();
|
||||
}
|
||||
return AjaxResult.success();
|
||||
|
|
@ -108,11 +124,92 @@ public class TeamServiceImpl implements TeamService {
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult delTeam(ParamDto dto) {
|
||||
int result = mapper.isPeopleByTeam(dto);
|
||||
if(result > 0){
|
||||
return AjaxResult.error("班组存在人员");
|
||||
try {
|
||||
int result = mapper.isPeopleByTeam(dto);
|
||||
if(result > 0){
|
||||
return AjaxResult.error("班组存在人员");
|
||||
}
|
||||
mapper.delTeam(dto);
|
||||
return AjaxResult.success();
|
||||
} catch (Exception e) {
|
||||
log.error("删除班组",e);
|
||||
//手动回滚异常
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HumanManageVo> getTeamUserLists(ParamDto dto) {
|
||||
List<HumanManageVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getTeamUserLists(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("获取班组人员列表",e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult removeTeamUser(ParamDto dto) {
|
||||
try {
|
||||
mapper.removeTeamUser(dto);
|
||||
return AjaxResult.success();
|
||||
} catch (Exception e) {
|
||||
log.error("移出班组人员");
|
||||
//手动回滚异常
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getTeamUserAndNoBandingUser(ParamDto dto) {
|
||||
Map<String, Object> map = new HashMap<>(16);
|
||||
List<Map<String, String>> teamUsers = new ArrayList<>();
|
||||
List<Map<String, String>> noBandingUsers = new ArrayList<>();
|
||||
try {
|
||||
List<Map<String, String>> list = mapper.getTeamUserAndNoBandingUser(dto);
|
||||
if(CollectionUtils.isNotEmpty(list)){
|
||||
for (Map<String, String> stringMap : list) {
|
||||
if(Objects.equals(stringMap.get("type"),"1")){
|
||||
teamUsers.add(stringMap);
|
||||
}else if(Objects.equals(stringMap.get("type"),"2")){
|
||||
noBandingUsers.add(stringMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("获取班组组员和未加入班组人员",e);
|
||||
}
|
||||
map.put("teamUsers",teamUsers);
|
||||
map.put("noBandingUsers",noBandingUsers);
|
||||
return AjaxResult.success(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult addTeamUser(ParamDto dto) {
|
||||
try {
|
||||
if(StringUtils.isNotEmpty(dto.getBandingUsers())){
|
||||
String[] bandingUserArr = dto.getBandingUsers().split(",");
|
||||
for (String bandingUser : bandingUserArr) {
|
||||
mapper.addTeamUser(bandingUser,dto.getId(),1);
|
||||
}
|
||||
}
|
||||
if(StringUtils.isNotEmpty(dto.getUnBandingUsers())){
|
||||
String[] unBandingUserArr = dto.getUnBandingUsers().split(",");
|
||||
for (String unBandingUser : unBandingUserArr) {
|
||||
mapper.addTeamUser(unBandingUser,null,2);
|
||||
}
|
||||
}
|
||||
return AjaxResult.success();
|
||||
} catch (Exception e) {
|
||||
log.error("添加班组人员");
|
||||
//手动回滚异常
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return AjaxResult.error();
|
||||
}
|
||||
mapper.delTeam(dto);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,76 @@
|
|||
package com.securitycontrol.background.towerDetection.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import com.securitycontrol.background.towerDetection.service.EarlyWarningRecordService;
|
||||
|
||||
|
||||
import com.securitycontrol.background.towerDetection.vo.EarlyWarningRecordVo;
|
||||
import com.securitycontrol.common.core.web.controller.BaseController;
|
||||
import com.securitycontrol.common.core.web.page.TableDataInfo;
|
||||
import com.securitycontrol.common.log.annotation.Log;
|
||||
import com.securitycontrol.common.log.enums.OperationType;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
|
||||
import com.securitycontrol.system.export.util.ExcelStyleUtil;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 组塔检测 - 预警记录
|
||||
* @author lsun
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/towerDetection/earlyWarningRecord/")
|
||||
@Slf4j
|
||||
public class EarlyWarningRecordController extends BaseController {
|
||||
|
||||
@Resource(name = "EarlyWarningRecordService")
|
||||
private EarlyWarningRecordService service;
|
||||
|
||||
@ApiOperation(value = "获取信息列表")
|
||||
@GetMapping("getEarlyWarningRecordLists")
|
||||
@Log(title = "组塔检测", menu = "组塔检测->预警记录", grade = OperationType.QUERY_BUSINESS, details = "查询列表", type = "业务日志")
|
||||
public TableDataInfo getEarlyWarningRecordLists(EarlyWarningRecordVo dto) {
|
||||
startPage();
|
||||
List<EarlyWarningRecordVo> list = service.getEarlyWarningRecordLists(dto);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("exportProData")
|
||||
@Log(title = "组塔检测", menu = "组塔检测->预警记录", grade = OperationType.EXPORT_BUSINESS, details = "导出列表", type = "业务日志")
|
||||
public void exportData(HttpServletRequest request, HttpServletResponse response, EarlyWarningRecordVo dto) {
|
||||
try {
|
||||
List<EarlyWarningRecordVo> proExportVoList = new ArrayList<>();
|
||||
List<EarlyWarningRecordVo> proLists = service.getEarlyWarningRecordLists(dto);
|
||||
for (int i = 0; i < proLists.size(); i++) {
|
||||
proLists.get(i).setProId((i + 1) + "");
|
||||
EarlyWarningRecordVo exportVo = new EarlyWarningRecordVo();
|
||||
BeanUtils.copyProperties(proLists.get(i), exportVo);
|
||||
proExportVoList.add(exportVo);
|
||||
}
|
||||
ExportParams exportParams = new ExportParams("预警记录", "预警记录", ExcelType.XSSF);
|
||||
exportParams.setStyle(ExcelStyleUtil.class);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, EarlyWarningRecordVo.class, proExportVoList);
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("预警记录" + ".xlsx", "UTF-8"));
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
workbook.write(outputStream);
|
||||
outputStream.close();
|
||||
workbook.close();
|
||||
} catch (Exception e) {
|
||||
log.error("导出预警记录", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
package com.securitycontrol.background.towerDetection.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import com.securitycontrol.background.towerDetection.service.TowerRecordService;
|
||||
import com.securitycontrol.background.towerDetection.vo.TowerRecordVo;
|
||||
import com.securitycontrol.common.core.web.controller.BaseController;
|
||||
import com.securitycontrol.common.core.web.page.TableDataInfo;
|
||||
import com.securitycontrol.common.log.annotation.Log;
|
||||
import com.securitycontrol.common.log.enums.OperationType;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
|
||||
import com.securitycontrol.system.export.util.ExcelStyleUtil;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 组塔检测 - 检测记录
|
||||
* @author lsun
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/towerDetection/towerRecord/")
|
||||
@Slf4j
|
||||
public class TowerRecordController extends BaseController {
|
||||
|
||||
@Resource(name = "TowerRecordService")
|
||||
private TowerRecordService service;
|
||||
|
||||
@ApiOperation(value = "获取信息列表")
|
||||
@GetMapping("getTowerRecordLists")
|
||||
@Log(title = "组塔检测", menu = "组塔检测->检测记录", grade = OperationType.QUERY_BUSINESS, details = "查询列表", type = "业务日志")
|
||||
public TableDataInfo getTowerRecordLists(TowerRecordVo dto) {
|
||||
startPage();
|
||||
List<TowerRecordVo> list = service.getTowerRecordLists(dto);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("exportProData")
|
||||
@Log(title = "组塔检测", menu = "组塔检测->检测记录", grade = OperationType.EXPORT_BUSINESS, details = "导出列表", type = "业务日志")
|
||||
public void exportData(HttpServletRequest request, HttpServletResponse response, TowerRecordVo dto) {
|
||||
try {
|
||||
List<TowerRecordVo> proExportVoList = new ArrayList<>();
|
||||
List<TowerRecordVo> proLists = service.getTowerRecordLists(dto);
|
||||
for (int i = 0; i < proLists.size(); i++) {
|
||||
proLists.get(i).setProId((i + 1) + "");
|
||||
TowerRecordVo exportVo = new TowerRecordVo();
|
||||
BeanUtils.copyProperties(proLists.get(i), exportVo);
|
||||
proExportVoList.add(exportVo);
|
||||
}
|
||||
ExportParams exportParams = new ExportParams("检测记录", "检测记录", ExcelType.XSSF);
|
||||
exportParams.setStyle(ExcelStyleUtil.class);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, TowerRecordVo.class, proExportVoList);
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("检测记录" + ".xlsx", "UTF-8"));
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
workbook.write(outputStream);
|
||||
outputStream.close();
|
||||
workbook.close();
|
||||
} catch (Exception e) {
|
||||
log.error("导出检测记录", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.securitycontrol.background.towerDetection.mapper;
|
||||
|
||||
import com.securitycontrol.background.towerDetection.vo.EarlyWarningRecordVo;
|
||||
import com.securitycontrol.background.towerDetection.vo.TowerRecordVo;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 组塔检测 - 预警记录
|
||||
* @author lsun
|
||||
*/
|
||||
@Repository(value = "EarlyWarningRecordMapper")
|
||||
public interface EarlyWarningRecordMapper {
|
||||
|
||||
/**
|
||||
* 获取信息列表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<EarlyWarningRecordVo> getEarlyWarningRecordLists(EarlyWarningRecordVo dto);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.securitycontrol.background.towerDetection.mapper;
|
||||
|
||||
import com.securitycontrol.background.towerDetection.vo.TowerRecordVo;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 组塔检测 - 检测记录
|
||||
* @author lsun
|
||||
*/
|
||||
@Repository(value = "TowerRecordMapper")
|
||||
public interface TowerRecordMapper {
|
||||
|
||||
/**
|
||||
* 获取信息列表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<TowerRecordVo> getTowerRecordLists(TowerRecordVo dto);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.securitycontrol.background.towerDetection.service;
|
||||
|
||||
import com.securitycontrol.background.towerDetection.vo.EarlyWarningRecordVo;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 组塔检测 - 预警记录
|
||||
* @author lsun
|
||||
*/
|
||||
public interface EarlyWarningRecordService {
|
||||
|
||||
/**
|
||||
* 获取信息列表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<EarlyWarningRecordVo> getEarlyWarningRecordLists(EarlyWarningRecordVo dto);
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.securitycontrol.background.towerDetection.service;
|
||||
|
||||
import com.securitycontrol.background.towerDetection.vo.TowerRecordVo;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 组塔检测 - 检测记录
|
||||
* @author lsun
|
||||
*/
|
||||
public interface TowerRecordService {
|
||||
|
||||
/**
|
||||
* 获取信息列表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<TowerRecordVo> getTowerRecordLists(TowerRecordVo dto);
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.securitycontrol.background.towerDetection.service.impl;
|
||||
|
||||
|
||||
import com.securitycontrol.background.towerDetection.mapper.EarlyWarningRecordMapper;
|
||||
import com.securitycontrol.background.towerDetection.service.EarlyWarningRecordService;
|
||||
import com.securitycontrol.background.towerDetection.vo.EarlyWarningRecordVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 组塔检测 - 预警记录
|
||||
* @author lsun
|
||||
*/
|
||||
@Service(value = "EarlyWarningRecordService")
|
||||
@Slf4j
|
||||
public class EarlyWarningRecordServiceImpl implements EarlyWarningRecordService {
|
||||
|
||||
@Resource(name = "EarlyWarningRecordMapper")
|
||||
private EarlyWarningRecordMapper mapper;
|
||||
|
||||
@Override
|
||||
public List<EarlyWarningRecordVo> getEarlyWarningRecordLists(EarlyWarningRecordVo dto) {
|
||||
List<EarlyWarningRecordVo> list = new ArrayList<>();
|
||||
list = mapper.getEarlyWarningRecordLists(dto);
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.securitycontrol.background.towerDetection.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.securitycontrol.background.towerDetection.mapper.TowerRecordMapper;
|
||||
import com.securitycontrol.background.towerDetection.service.TowerRecordService;
|
||||
import com.securitycontrol.background.towerDetection.vo.TowerRecordVo;
|
||||
import com.securitycontrol.common.core.constant.Constant;
|
||||
import com.securitycontrol.common.core.utils.ImportExcelUtils;
|
||||
import com.securitycontrol.common.core.utils.StringUtils;
|
||||
import com.securitycontrol.common.core.utils.aes.DateTimeHelper;
|
||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||
import com.securitycontrol.common.security.utils.ValidatorsUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 组塔检测 - 检测记录
|
||||
* @author lsun
|
||||
*/
|
||||
@Service(value = "TowerRecordService")
|
||||
@Slf4j
|
||||
public class TowerRecordServiceImpl implements TowerRecordService {
|
||||
|
||||
@Resource(name = "TowerRecordMapper")
|
||||
private TowerRecordMapper mapper;
|
||||
|
||||
@Override
|
||||
public List<TowerRecordVo> getTowerRecordLists(TowerRecordVo dto) {
|
||||
List<TowerRecordVo> list = new ArrayList<>();
|
||||
list = mapper.getTowerRecordLists(dto);
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.securitycontrol.background.towerDetection.vo;
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class EarlyWarningRecordVo {
|
||||
|
||||
@Excel(name = "序号", width = 10.0, orderNum = "0")
|
||||
private String proId;
|
||||
|
||||
@ApiModelProperty(value = "告警内容")
|
||||
@Excel(name = "告警内容", width = 10.0, orderNum = "1")
|
||||
private String warnContent;
|
||||
|
||||
@ApiModelProperty(value = "告警时间")
|
||||
@Excel(name = "告警时间", width = 10.0, orderNum = "2")
|
||||
private String warnTime;
|
||||
|
||||
@ApiModelProperty(value = "告警类型")
|
||||
private String warnType;
|
||||
|
||||
@ApiModelProperty(value = "监测时间")
|
||||
private String createTime;
|
||||
|
||||
private String keyWord;
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package com.securitycontrol.background.towerDetection.vo;
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class TowerRecordVo {
|
||||
|
||||
@ApiModelProperty(value = "工程ID")
|
||||
@Excel(name = "序号", width = 10.0, orderNum = "0")
|
||||
private String proId;
|
||||
|
||||
@ApiModelProperty(value = "设备名称")
|
||||
@Excel(name = "设备名称", width = 10.0, orderNum = "1")
|
||||
private String deviceName;
|
||||
|
||||
@ApiModelProperty(value = "区域名称")
|
||||
@Excel(name = "区域名称", width = 10.0, orderNum = "2")
|
||||
private String areaName;
|
||||
|
||||
@ApiModelProperty(value = "监测点名称")
|
||||
@Excel(name = "监测点名称", width = 10.0, orderNum = "3")
|
||||
private String modeName;
|
||||
|
||||
@ApiModelProperty(value = "检测值")
|
||||
@Excel(name = "检测值", width = 10.0, orderNum = "4")
|
||||
private String val;
|
||||
|
||||
@ApiModelProperty(value = "累计变化")
|
||||
@Excel(name = "累计变化", width = 10.0, orderNum = "5")
|
||||
private String changeVal;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
@Excel(name = "状态", width = 10.0, orderNum = "6")
|
||||
private String isWarn;
|
||||
|
||||
@ApiModelProperty(value = "监测时间")
|
||||
@Excel(name = "监测时间", width = 10.0, orderNum = "7")
|
||||
private String createTime;
|
||||
|
||||
private String keyWord;
|
||||
}
|
||||
|
|
@ -38,6 +38,19 @@
|
|||
WHERE team_id = #{teamId}
|
||||
</if>
|
||||
</insert>
|
||||
<!--添加班组人员-->
|
||||
<insert id="addTeamUser">
|
||||
<if test="type == 1">
|
||||
UPDATE t_team_people SET team_id = #{teamId} WHERE user_id = #{userId}
|
||||
</if>
|
||||
<if test="type == 2">
|
||||
UPDATE t_team_people SET team_id = NULL WHERE user_id = #{userId}
|
||||
</if>
|
||||
</insert>
|
||||
<!--移出班组人员-->
|
||||
<update id="removeTeamUser">
|
||||
UPDATE t_team_people SET team_id = NULL WHERE user_id = #{id}
|
||||
</update>
|
||||
<!--删除班组-->
|
||||
<delete id="delTeam">
|
||||
DELETE FROM tb_work_team WHERE team_id = #{id}
|
||||
|
|
@ -92,4 +105,29 @@
|
|||
<select id="isPeopleByTeam" resultType="java.lang.Integer">
|
||||
SELECT COUNT(*) FROM t_team_people WHERE team_id = #{id}
|
||||
</select>
|
||||
<!--班组人员数量-->
|
||||
<select id="getTeamUserNum" resultType="java.lang.Integer">
|
||||
SELECT COUNT(*) FROM t_team_people WHERE team_id = #{teamId}
|
||||
</select>
|
||||
<!--获取班组人员列表-->
|
||||
<select id="getTeamUserLists" resultType="com.securitycontrol.entity.background.vo.HumanManageVo">
|
||||
SELECT
|
||||
ttp.user_id AS userId,
|
||||
ttp.user_name AS userName,
|
||||
sd.dict_name AS userType
|
||||
FROM t_team_people ttp
|
||||
LEFT JOIN sys_dict sd ON ttp.user_type = sd.dict_code
|
||||
<where>
|
||||
ttp.team_id = #{id}
|
||||
<if test="userName!=null and userName !=''">
|
||||
AND INSTR(ttp.user_name,#{userName}) > 0
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<!--获取班组组员和未加入班组人员-->
|
||||
<select id="getTeamUserAndNoBandingUser" resultType="java.util.Map">
|
||||
SELECT user_id AS id,user_name AS userName,'1' AS type FROM t_team_people WHERE team_id = #{id}
|
||||
UNION ALL
|
||||
SELECT user_id AS id,user_name AS userName,'2' AS type FROM t_team_people WHERE team_id IS NULL OR team_id = ''
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.securitycontrol.background.constructionQuality.mapper.EarlyWarningsRecordMapper">
|
||||
<!--获取信息列表-->
|
||||
<select id="getEarlyWarningsRecordLists" resultType="com.securitycontrol.background.constructionQuality.vo.EarlyWarningsRecordVo">
|
||||
SELECT tw.warn_content as warnContent, tw.warn_time as warnTime
|
||||
FROM tb_warn tw
|
||||
LEFT JOIN tb_device_detail tdd ON tw.device_id = tdd.device_id
|
||||
LEFT JOIN tb_bd_device tbd ON tdd.device_id = tbd.device_id
|
||||
LEFT JOIN sys_dict sd ON sd.dict_id = tbd.devic_type
|
||||
WHERE sd.dict_code ='6664'
|
||||
<if test="keyWord !=null and keyWord!=''">
|
||||
AND (
|
||||
INSTR(tp.pro_name,#{keyWord}) > 0 OR
|
||||
INSTR(tp.jl_unit,#{keyWord}) > 0 OR
|
||||
INSTR(tp.sg_unit,#{keyWord}) > 0 OR
|
||||
INSTR(tp.manager,#{keyWord}) > 0
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.securitycontrol.background.constructionQuality.mapper.QualityRecordMapper">
|
||||
<!--获取信息列表-->
|
||||
<select id="getQualityRecordLists" resultType="com.securitycontrol.background.constructionQuality.vo.QualityRecordVo">
|
||||
SELECT tbd.device_name as deviceName, ta.area_name as areaName, tdd.mode_name as modeName,a.val,
|
||||
a.change_val as changeVal,a.is_warn as isWarn,a.create_time as createTime
|
||||
FROM tb_his_device_value a
|
||||
LEFT JOIN tb_device_detail tdd ON a.attribute_id = tdd.id
|
||||
LEFT JOIN tb_bd_device tbd ON tdd.device_id = tbd.device_id
|
||||
LEFT JOIN tb_area ta ON tbd.area_id = ta.area_id
|
||||
LEFT JOIN sys_dict sd ON sd.dict_id = tbd.devic_type
|
||||
WHERE sd.dict_code ='6662'
|
||||
<if test="keyWord !=null and keyWord!=''">
|
||||
AND (
|
||||
INSTR(tp.pro_name,#{keyWord}) > 0 OR
|
||||
INSTR(tp.jl_unit,#{keyWord}) > 0 OR
|
||||
INSTR(tp.sg_unit,#{keyWord}) > 0 OR
|
||||
INSTR(tp.manager,#{keyWord}) > 0
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.securitycontrol.background.towerDetection.mapper.EarlyWarningRecordMapper">
|
||||
<!--获取信息列表-->
|
||||
<select id="getEarlyWarningRecordLists" resultType="com.securitycontrol.background.towerDetection.vo.EarlyWarningRecordVo">
|
||||
SELECT tw.warn_content as warnContent, tw.warn_time as warnTime
|
||||
FROM tb_warn tw
|
||||
LEFT JOIN tb_device_detail tdd ON tw.device_id = tdd.device_id
|
||||
LEFT JOIN tb_bd_device tbd ON tdd.device_id = tbd.device_id
|
||||
LEFT JOIN sys_dict sd ON sd.dict_id = tbd.devic_type
|
||||
WHERE sd.dict_code ='6663'
|
||||
<if test="keyWord !=null and keyWord!=''">
|
||||
AND (
|
||||
INSTR(tp.pro_name,#{keyWord}) > 0 OR
|
||||
INSTR(tp.jl_unit,#{keyWord}) > 0 OR
|
||||
INSTR(tp.sg_unit,#{keyWord}) > 0 OR
|
||||
INSTR(tp.manager,#{keyWord}) > 0
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.securitycontrol.background.towerDetection.mapper.TowerRecordMapper">
|
||||
<!--获取信息列表-->
|
||||
<select id="getTowerRecordLists" resultType="com.securitycontrol.background.towerDetection.vo.TowerRecordVo">
|
||||
SELECT tbd.device_name as deviceName, ta.area_name as areaName, tdd.mode_name as modeName,a.val,
|
||||
a.change_val as changeVal,a.is_warn as isWarn,a.create_time as createTime
|
||||
FROM tb_his_device_value a
|
||||
LEFT JOIN tb_device_detail tdd ON a.attribute_id = tdd.id
|
||||
LEFT JOIN tb_bd_device tbd ON tdd.device_id = tbd.device_id
|
||||
LEFT JOIN tb_area ta ON tbd.area_id = ta.area_id
|
||||
LEFT JOIN sys_dict sd ON sd.dict_id = tbd.devic_type
|
||||
WHERE sd.dict_code ='6661'
|
||||
<if test="keyWord !=null and keyWord!=''">
|
||||
AND (
|
||||
INSTR(tp.pro_name,#{keyWord}) > 0 OR
|
||||
INSTR(tp.jl_unit,#{keyWord}) > 0 OR
|
||||
INSTR(tp.sg_unit,#{keyWord}) > 0 OR
|
||||
INSTR(tp.manager,#{keyWord}) > 0
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -111,6 +111,7 @@ public interface ISelectMapper {
|
|||
List<SelectVo> getProLists(SelectDto dto);
|
||||
|
||||
/**
|
||||
* 区域下拉选
|
||||
* @param dto
|
||||
* @return List<SelectVo>
|
||||
* @description
|
||||
|
|
|
|||
|
|
@ -42,28 +42,44 @@ public class ProScheduleServiceImpl implements IProScheduleService {
|
|||
@Override
|
||||
public List<ProScheduleVo> getProScheduleLists(ProScheduleDto dto) {
|
||||
List<ProScheduleVo> list = new ArrayList<>();
|
||||
list = mapper.getProScheduleLists(dto);
|
||||
try {
|
||||
list = mapper.getProScheduleLists(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("获取工程进度列表",e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GxPlanVo> getGxPlanLists(GxPlanDto dto) {
|
||||
List<GxPlanVo> list = new ArrayList<>();
|
||||
list = mapper.getGxPlanLists(dto);
|
||||
try {
|
||||
list = mapper.getGxPlanLists(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("获取工序计划列表",e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getGxPlansIsDela(ProScheduleDto dto) {
|
||||
List<String> list = new ArrayList<>();
|
||||
list = mapper.getGxPlansIsDela(dto);
|
||||
try {
|
||||
list = mapper.getGxPlansIsDela(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("工序计划延期提醒",e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GxPlanProgressVo> getGxPlanProgressLists(ProScheduleDto dto) {
|
||||
List<GxPlanProgressVo> list = new ArrayList<>();
|
||||
list = mapper.getGxPlanProgressLists(dto);
|
||||
try {
|
||||
list = mapper.getGxPlanProgressLists(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("获取工序计划进度列表",e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -66,12 +66,16 @@ public class ProServiceImpl implements IProService {
|
|||
@Override
|
||||
public List<ProVo> getProLists(ProDto dto) {
|
||||
List<ProVo> list = new ArrayList<>();
|
||||
list = mapper.getProLists(dto);
|
||||
list.forEach(item -> {
|
||||
List<Integer> fileNums = mapper.getProFiles(item.getProId());
|
||||
item.setProImgFileNum(fileNums.get(0));
|
||||
item.setProFileNum(fileNums.get(1));
|
||||
});
|
||||
try {
|
||||
list = mapper.getProLists(dto);
|
||||
list.forEach(item -> {
|
||||
List<Integer> fileNums = mapper.getProFiles(item.getProId());
|
||||
item.setProImgFileNum(fileNums.get(0));
|
||||
item.setProFileNum(fileNums.get(1));
|
||||
});
|
||||
} catch (Exception e) {
|
||||
log.error("获取工程列表",e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
|
@ -156,25 +160,29 @@ public class ProServiceImpl implements IProService {
|
|||
@Override
|
||||
public AjaxResult getProById(ProDto dto) {
|
||||
ProVo vo = new ProVo();
|
||||
vo = mapper.getProById(dto);
|
||||
List<ResourceFileVo> resourceFileVos = mapper.getFiles(vo.getProId());
|
||||
if (CollectionUtils.isNotEmpty(resourceFileVos)) {
|
||||
List<ProVo.FileData> list = new ArrayList<>();
|
||||
for (ResourceFileVo fileVo : resourceFileVos) {
|
||||
String base64 = null;
|
||||
Result<SysFile> result = remoteFileService.getImgBase64(fileVo.getFileId(), SecurityConstants.INNER);
|
||||
if (result != null && result.getCode() == HttpStatus.SUCCESS && result.getData() != null) {
|
||||
String jsonString = JSON.toJSONString(result.getData());
|
||||
JSONObject item = JSON.parseObject(jsonString);
|
||||
base64 = item.getString("url");
|
||||
try {
|
||||
vo = mapper.getProById(dto);
|
||||
List<ResourceFileVo> resourceFileVos = mapper.getFiles(vo.getProId());
|
||||
if (CollectionUtils.isNotEmpty(resourceFileVos)) {
|
||||
List<ProVo.FileData> list = new ArrayList<>();
|
||||
for (ResourceFileVo fileVo : resourceFileVos) {
|
||||
String base64 = null;
|
||||
Result<SysFile> result = remoteFileService.getImgBase64(fileVo.getFileId(), SecurityConstants.INNER);
|
||||
if (result != null && result.getCode() == HttpStatus.SUCCESS && result.getData() != null) {
|
||||
String jsonString = JSON.toJSONString(result.getData());
|
||||
JSONObject item = JSON.parseObject(jsonString);
|
||||
base64 = item.getString("url");
|
||||
}
|
||||
ProVo.FileData fileData = new ProVo.FileData();
|
||||
fileData.setFileId(fileVo.getFileId());
|
||||
fileData.setBase64Url(base64);
|
||||
fileData.setFileSourceType(fileVo.getSourceType());
|
||||
list.add(fileData);
|
||||
}
|
||||
ProVo.FileData fileData = new ProVo.FileData();
|
||||
fileData.setFileId(fileVo.getFileId());
|
||||
fileData.setBase64Url(base64);
|
||||
fileData.setFileSourceType(fileVo.getSourceType());
|
||||
list.add(fileData);
|
||||
vo.setFileData(list);
|
||||
}
|
||||
vo.setFileData(list);
|
||||
} catch (Exception e) {
|
||||
log.error("工程详情",e);
|
||||
}
|
||||
return AjaxResult.success(vo);
|
||||
}
|
||||
|
|
@ -225,24 +233,28 @@ public class ProServiceImpl implements IProService {
|
|||
@Override
|
||||
public AjaxResult viewProFile(ProDto dto) {
|
||||
List<ProVo.FileData> list = new ArrayList<>();
|
||||
List<ResourceFileVo> resourceFileVos = mapper.getFiles(dto.getProId());
|
||||
if (CollectionUtils.isNotEmpty(resourceFileVos)) {
|
||||
for (ResourceFileVo fileVo : resourceFileVos) {
|
||||
if (Objects.equals(dto.getFileType(), fileVo.getSourceType())) {
|
||||
String base64 = null;
|
||||
Result<SysFile> result = remoteFileService.getImgBase64(fileVo.getFileId(), SecurityConstants.INNER);
|
||||
if (result != null && result.getCode() == HttpStatus.SUCCESS && result.getData() != null) {
|
||||
String jsonString = JSON.toJSONString(result.getData());
|
||||
JSONObject item = JSON.parseObject(jsonString);
|
||||
base64 = item.getString("url");
|
||||
try {
|
||||
List<ResourceFileVo> resourceFileVos = mapper.getFiles(dto.getProId());
|
||||
if (CollectionUtils.isNotEmpty(resourceFileVos)) {
|
||||
for (ResourceFileVo fileVo : resourceFileVos) {
|
||||
if (Objects.equals(dto.getFileType(), fileVo.getSourceType())) {
|
||||
String base64 = null;
|
||||
Result<SysFile> result = remoteFileService.getImgBase64(fileVo.getFileId(), SecurityConstants.INNER);
|
||||
if (result != null && result.getCode() == HttpStatus.SUCCESS && result.getData() != null) {
|
||||
String jsonString = JSON.toJSONString(result.getData());
|
||||
JSONObject item = JSON.parseObject(jsonString);
|
||||
base64 = item.getString("url");
|
||||
}
|
||||
ProVo.FileData fileData = new ProVo.FileData();
|
||||
fileData.setFileId(fileVo.getFileId());
|
||||
fileData.setBase64Url(base64);
|
||||
fileData.setFileSourceType(fileVo.getSourceType());
|
||||
list.add(fileData);
|
||||
}
|
||||
ProVo.FileData fileData = new ProVo.FileData();
|
||||
fileData.setFileId(fileVo.getFileId());
|
||||
fileData.setBase64Url(base64);
|
||||
fileData.setFileSourceType(fileVo.getSourceType());
|
||||
list.add(fileData);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("工程图片/平面图预览",e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
|
@ -511,7 +523,11 @@ public class ProServiceImpl implements IProService {
|
|||
@Override
|
||||
public List<GxPlanVo> getGxPlanLists(GxPlanDto dto) {
|
||||
List<GxPlanVo> list = new ArrayList<>();
|
||||
list = mapper.getGxPlanLists(dto);
|
||||
try {
|
||||
list = mapper.getGxPlanLists(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("获取工序列表",e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
|
@ -603,7 +619,11 @@ public class ProServiceImpl implements IProService {
|
|||
@Override
|
||||
public AjaxResult getGxPlanById(GxPlanDto dto) {
|
||||
GxPlanVo vo = new GxPlanVo();
|
||||
vo = mapper.getGxPlanById(dto);
|
||||
try {
|
||||
vo = mapper.getGxPlanById(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("工序计划详情",e);
|
||||
}
|
||||
return AjaxResult.success(vo);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,11 @@ public class RoleServiceImpl implements IRoleService {
|
|||
@Override
|
||||
public List<RoleVo> getRoleLists(RoleDto dto) {
|
||||
List<RoleVo> list = new ArrayList<>();
|
||||
list = mapper.getRoleLists(dto);
|
||||
try {
|
||||
list = mapper.getRoleLists(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("获取角色列表",e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
|
@ -67,7 +71,11 @@ public class RoleServiceImpl implements IRoleService {
|
|||
@Override
|
||||
public AjaxResult getRoleById(RoleDto dto) {
|
||||
RoleVo vo = new RoleVo();
|
||||
vo = mapper.getRoleById(dto);
|
||||
try {
|
||||
vo = mapper.getRoleById(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("角色详情",e);
|
||||
}
|
||||
return AjaxResult.success(vo);
|
||||
}
|
||||
|
||||
|
|
@ -96,7 +104,11 @@ public class RoleServiceImpl implements IRoleService {
|
|||
@Override
|
||||
public AjaxResult getAuthMenu(RoleDto dto) {
|
||||
List<String> list = new ArrayList<>();
|
||||
list = mapper.getAuthMenu(dto);
|
||||
try {
|
||||
list = mapper.getAuthMenu(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("获取角色授权的菜单",e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,11 @@ public class SelectServiceImpl implements ISelectService {
|
|||
@Override
|
||||
public AjaxResult getRoleLists() {
|
||||
List<SelectVo> list = new ArrayList<>();
|
||||
list = mapper.getRoleLists();
|
||||
try {
|
||||
list = mapper.getRoleLists();
|
||||
} catch (Exception e) {
|
||||
log.error("角色下拉选",e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
|
|
@ -100,42 +104,66 @@ public class SelectServiceImpl implements ISelectService {
|
|||
@Override
|
||||
public AjaxResult getBuildLists() {
|
||||
List<SelectVo> list = new ArrayList<>();
|
||||
list = mapper.getBuildLists();
|
||||
try {
|
||||
list = mapper.getBuildLists();
|
||||
} catch (Exception e) {
|
||||
log.error("建管单位下拉选",e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getDictLists(SelectDto dto) {
|
||||
List<SelectVo> list = new ArrayList<>();
|
||||
list = mapper.getDictLists(dto);
|
||||
try {
|
||||
list = mapper.getDictLists(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("字典表下拉选",e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getTowerLists(SelectDto dto) {
|
||||
List<SelectVo> list = new ArrayList<>();
|
||||
list = mapper.getTowerLists(dto);
|
||||
try {
|
||||
list = mapper.getTowerLists(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("杆塔下拉选",e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getTeamLists(SelectDto dto) {
|
||||
List<SelectVo> list = new ArrayList<>();
|
||||
list = mapper.getTeamLists(dto);
|
||||
try {
|
||||
list = mapper.getTeamLists(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("班组下拉选",e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getProLists(SelectDto dto) {
|
||||
List<SelectVo> list = new ArrayList<>();
|
||||
list = mapper.getProLists(dto);
|
||||
try {
|
||||
list = mapper.getProLists(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("工程下拉选",e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getAreaLists(SelectDto dto) {
|
||||
List<SelectVo> list = new ArrayList<>();
|
||||
list = mapper.getAreaLists(dto);
|
||||
try {
|
||||
list = mapper.getAreaLists(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("区域下拉选");
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,11 @@ public class TeamQuEvalServiceImpl implements ITeamQuEvalService {
|
|||
@Override
|
||||
public List<TeamQuEvalVo> getTeamQuEvalLists(TeamQuEvalDto dto) {
|
||||
List<TeamQuEvalVo> list = new ArrayList<>();
|
||||
list = mapper.getTeamQuEvalLists(dto);
|
||||
try {
|
||||
list = mapper.getTeamQuEvalLists(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("获取班组质量评价列表",e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
|
@ -64,7 +68,11 @@ public class TeamQuEvalServiceImpl implements ITeamQuEvalService {
|
|||
@Override
|
||||
public AjaxResult getTeamEvalById(TeamQuEvalDto dto) {
|
||||
TeamQuEvalVo vo = new TeamQuEvalVo();
|
||||
vo = mapper.getTeamEvalById(dto);
|
||||
try {
|
||||
vo = mapper.getTeamEvalById(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("班组质量评价详情",e);
|
||||
}
|
||||
return AjaxResult.success(vo);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,11 @@ public class UserServiceImpl implements IUserService {
|
|||
@Override
|
||||
public List<UserVo> getUserLists(UserDto dto) {
|
||||
List<UserVo> list = new ArrayList<>();
|
||||
list = mapper.getUserLists(dto);
|
||||
try {
|
||||
list = mapper.getUserLists(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("获取用户列表",e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
|
@ -69,14 +73,25 @@ public class UserServiceImpl implements IUserService {
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult delUser(UserDto dto) {
|
||||
mapper.delUser(dto);
|
||||
try {
|
||||
mapper.delUser(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("删除用户",e);
|
||||
//手动回滚异常
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return AjaxResult.error();
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getUserById(UserDto dto) {
|
||||
UserVo vo = new UserVo();
|
||||
vo = mapper.getUserById(dto);
|
||||
try {
|
||||
vo = mapper.getUserById(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("用户详情",e);
|
||||
}
|
||||
return AjaxResult.success(vo);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue