1. 任务巡检单配置, 配置详情, 任务客户经理签名, 业务员签名
This commit is contained in:
parent
f9d0c564b9
commit
e4977022ba
|
|
@ -27,9 +27,5 @@ public @interface SysLog {
|
||||||
* 操作类型
|
* 操作类型
|
||||||
*/
|
*/
|
||||||
BusinessType businessType() default BusinessType.OTHER;
|
BusinessType businessType() default BusinessType.OTHER;
|
||||||
/**
|
|
||||||
* 是否 入库
|
|
||||||
*/
|
|
||||||
boolean isDatabase() default true;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -124,6 +124,9 @@ public class SysLogAspect {
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
sysLogEntity.setParams(JSON.toJSONString(argList));
|
sysLogEntity.setParams(JSON.toJSONString(argList));
|
||||||
}
|
}
|
||||||
|
}else if (null != ex){
|
||||||
|
sysLogEntity.setOperation("异常日志");
|
||||||
|
sysLogEntity.setOperationType(BusinessType.ERROR.getCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取request
|
//获取request
|
||||||
|
|
@ -168,15 +171,16 @@ public class SysLogAspect {
|
||||||
// 日志类型
|
// 日志类型
|
||||||
sysLogEntity.setType(type);
|
sysLogEntity.setType(type);
|
||||||
sysLogEntity.setException(ex);
|
sysLogEntity.setException(ex);
|
||||||
|
// sysLog 不一定未空, 如果为 需要入库时, 必定不为空
|
||||||
assert syslog != null;
|
assert syslog != null;
|
||||||
if (syslog.isDatabase()){
|
// if (null != ex){
|
||||||
// 入队列, 方便在system 统一查询
|
// 入队列, 方便在system 统一查询
|
||||||
RList<SysLogEntity> list = redissonClient.getList(ServiceConstant.QUEUE_NAME);
|
RList<SysLogEntity> list = redissonClient.getList(ServiceConstant.QUEUE_NAME);
|
||||||
list.add(sysLogEntity);
|
list.add(sysLogEntity);
|
||||||
// sysLogService.save(sysLogEntity);
|
//// sysLogService.save(sysLogEntity);
|
||||||
}else {
|
// }else {
|
||||||
log.info("log {}", JSONObject.toJSONString(sysLogEntity));
|
// log.info("log {}", JSONObject.toJSONString(sysLogEntity));
|
||||||
}
|
// }
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
HttpServletRequest request = ServletUtils.getRequest();
|
HttpServletRequest request = ServletUtils.getRequest();
|
||||||
// 保存日志失败 不应当影响 正常的操作
|
// 保存日志失败 不应当影响 正常的操作
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,10 @@ public enum BusinessType
|
||||||
* 清空数据
|
* 清空数据
|
||||||
*/
|
*/
|
||||||
CLEAR(10,"清空数据"),
|
CLEAR(10,"清空数据"),
|
||||||
|
/**
|
||||||
|
* 异常日志
|
||||||
|
*/
|
||||||
|
ERROR(11, "异常日志"),
|
||||||
;
|
;
|
||||||
private final Integer code;
|
private final Integer code;
|
||||||
private final String desc;
|
private final String desc;
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@ public @interface Condition {
|
||||||
|
|
||||||
ConditionType[] type() default {eq};
|
ConditionType[] type() default {eq};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
enum ConditionType {
|
enum ConditionType {
|
||||||
ge,
|
ge,
|
||||||
le,
|
le,
|
||||||
|
|
|
||||||
|
|
@ -16,5 +16,10 @@
|
||||||
<groupId>org.redisson</groupId>
|
<groupId>org.redisson</groupId>
|
||||||
<artifactId>redisson-spring-boot-starter</artifactId>
|
<artifactId>redisson-spring-boot-starter</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- 配合redis做缓存 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-cache</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
||||||
|
|
@ -1,88 +0,0 @@
|
||||||
//package com.chushang.gateway.filter;
|
|
||||||
//
|
|
||||||
//import cn.hutool.json.JSONObject;
|
|
||||||
//import cn.hutool.json.JSONUtil;
|
|
||||||
//import com.chushang.common.core.web.Result;
|
|
||||||
//import lombok.extern.slf4j.Slf4j;
|
|
||||||
//import org.reactivestreams.Publisher;
|
|
||||||
//import org.springframework.cloud.gateway.filter.GatewayFilterChain;
|
|
||||||
//import org.springframework.cloud.gateway.filter.GlobalFilter;
|
|
||||||
//import org.springframework.cloud.gateway.filter.factory.rewrite.CachedBodyOutputMessage;
|
|
||||||
//import org.springframework.cloud.gateway.support.BodyInserterContext;
|
|
||||||
//import org.springframework.cloud.gateway.support.ServerWebExchangeUtils;
|
|
||||||
//import org.springframework.context.annotation.Configuration;
|
|
||||||
//import org.springframework.core.Ordered;
|
|
||||||
//import org.springframework.core.io.buffer.DataBuffer;
|
|
||||||
//import org.springframework.core.io.buffer.DataBufferUtils;
|
|
||||||
//import org.springframework.http.HttpHeaders;
|
|
||||||
//import org.springframework.http.HttpStatus;
|
|
||||||
//import org.springframework.http.server.reactive.ServerHttpResponse;
|
|
||||||
//import org.springframework.http.server.reactive.ServerHttpResponseDecorator;
|
|
||||||
//import org.springframework.web.reactive.function.BodyInserter;
|
|
||||||
//import org.springframework.web.reactive.function.BodyInserters;
|
|
||||||
//import org.springframework.web.reactive.function.client.ClientResponse;
|
|
||||||
//import org.springframework.web.server.ServerWebExchange;
|
|
||||||
//import reactor.core.publisher.Flux;
|
|
||||||
//import reactor.core.publisher.Mono;
|
|
||||||
//
|
|
||||||
//@Slf4j
|
|
||||||
//@Configuration
|
|
||||||
//public class SanyiResponseGlobalFilter implements GlobalFilter, Ordered {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
|
|
||||||
// ServerHttpResponse originalResponse = exchange.getResponse();
|
|
||||||
// ServerHttpResponseDecorator decoratedResponse = new ServerHttpResponseDecorator(originalResponse) {
|
|
||||||
// @Override
|
|
||||||
// public Mono<Void> writeWith(Publisher<? extends DataBuffer> body) {
|
|
||||||
// String originalResponseContentType = exchange.getAttribute(ServerWebExchangeUtils.ORIGINAL_RESPONSE_CONTENT_TYPE_ATTR);
|
|
||||||
// HttpHeaders httpHeaders = new HttpHeaders();
|
|
||||||
// // explicitly add it in this way instead of
|
|
||||||
// // 'httpHeaders.setContentType(originalResponseContentType)'
|
|
||||||
// // this will prevent exception in case of using non-standard media
|
|
||||||
// // types like "Content-Type: image"
|
|
||||||
// httpHeaders.add(HttpHeaders.CONTENT_TYPE, originalResponseContentType);
|
|
||||||
// ClientResponse clientResponse =
|
|
||||||
// prepareClientResponse(exchange.getResponse().getStatusCode(),body,httpHeaders);
|
|
||||||
// Mono<String> modifiedBody = clientResponse.bodyToMono(String.class).flatMap(responseBody -> {
|
|
||||||
// JSONObject jsonObject = JSONUtil.parseObj(responseBody);
|
|
||||||
// log.info("error : {}", jsonObject);
|
|
||||||
// if (jsonObject.containsKey("timestamp")) {
|
|
||||||
// return Mono.just(JSONUtil.toJsonStr(Result.restResult(jsonObject.getStr("path"),
|
|
||||||
// jsonObject.getInt("status"),
|
|
||||||
// jsonObject.getStr("error"))));
|
|
||||||
// }
|
|
||||||
// return Mono.just(responseBody);
|
|
||||||
// });
|
|
||||||
// BodyInserter bodyInserter = BodyInserters.fromPublisher(modifiedBody, String.class);
|
|
||||||
// HttpHeaders headers = new HttpHeaders();
|
|
||||||
// headers.putAll(exchange.getResponse().getHeaders());
|
|
||||||
// headers.remove(HttpHeaders.CONTENT_LENGTH);
|
|
||||||
// CachedBodyOutputMessage outputMessage = new CachedBodyOutputMessage(exchange, headers);
|
|
||||||
// return bodyInserter.insert(outputMessage, new BodyInserterContext()).then(Mono.defer(() -> {
|
|
||||||
// Mono<DataBuffer> messageBody = DataBufferUtils.join(outputMessage.getBody());
|
|
||||||
// if (!headers.containsKey(HttpHeaders.TRANSFER_ENCODING)
|
|
||||||
// || headers.containsKey(HttpHeaders.CONTENT_LENGTH)) {
|
|
||||||
// messageBody = messageBody.doOnNext(data -> headers.setContentLength(data.readableByteCount()));
|
|
||||||
// }
|
|
||||||
// // TODO: fail if isStreamingMediaType?
|
|
||||||
// return getDelegate().writeWith(messageBody);
|
|
||||||
// }));
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
// // replace response with decorator
|
|
||||||
// return chain.filter(exchange.mutate().response(decoratedResponse).build());
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public int getOrder() {
|
|
||||||
// // -1 is response write filter, must be called before that
|
|
||||||
// return -2;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// private ClientResponse prepareClientResponse(HttpStatus httpStatus, Publisher<? extends DataBuffer> body, HttpHeaders httpHeaders) {
|
|
||||||
// ClientResponse.Builder builder;
|
|
||||||
// builder = ClientResponse.create(httpStatus);
|
|
||||||
// return builder.headers(headers -> headers.putAll(httpHeaders)).body(Flux.from(body)).build();
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.chushang.inspection.project.entity.dto;
|
||||||
|
|
||||||
|
import com.chushang.common.core.validator.Create;
|
||||||
|
import com.chushang.common.core.validator.Update;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class TaskGraphDTO {
|
||||||
|
|
||||||
|
@NotNull(message = "任务id不能为空", groups = Create.class)
|
||||||
|
@NotNull(message = "任务id不能为空", groups = Update.class)
|
||||||
|
private Long taskId;
|
||||||
|
|
||||||
|
@NotBlank(message = "签名名称不能为空", groups = Create.class)
|
||||||
|
@NotBlank(message = "签名名称不能为空", groups = Update.class)
|
||||||
|
private String graphName;
|
||||||
|
|
||||||
|
@NotBlank(message = "签名图片不能为空", groups = Create.class)
|
||||||
|
@NotBlank(message = "签名图片不能为空", groups = Update.class)
|
||||||
|
private String imgUrl;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.chushang.inspection.project.entity.dto;
|
||||||
|
|
||||||
|
import com.chushang.common.core.validator.Create;
|
||||||
|
import com.chushang.common.core.validator.Update;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @auther: zhao
|
||||||
|
* @date: 2024/6/14 11:04
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserAutographDTO {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对应所属的任务id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "用户Id不能为空", groups = {Create.class, Update.class})
|
||||||
|
private Long userId;
|
||||||
|
/**
|
||||||
|
* 对应的签名图片
|
||||||
|
*/
|
||||||
|
@NotNull(message = "用户Id不能为空", groups = {Create.class, Update.class})
|
||||||
|
private String imgUrl;
|
||||||
|
/**
|
||||||
|
* 签名人
|
||||||
|
*/
|
||||||
|
private String userName;
|
||||||
|
/**
|
||||||
|
* 昵称
|
||||||
|
*/
|
||||||
|
private String nickName;
|
||||||
|
}
|
||||||
|
|
@ -4,12 +4,18 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.chushang.common.core.validator.Create;
|
||||||
|
import com.chushang.common.core.validator.Update;
|
||||||
|
import com.chushang.common.mybatis.annotation.Condition;
|
||||||
import com.chushang.common.mybatis.base.BaseEntity;
|
import com.chushang.common.mybatis.base.BaseEntity;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @auther: zhao
|
* @auther: zhao
|
||||||
* @date: 2024/6/18 15:39
|
* @date: 2024/6/18 15:39
|
||||||
|
|
@ -24,12 +30,16 @@ public class InspectionConfig extends BaseEntity {
|
||||||
* 配置id 主键
|
* 配置id 主键
|
||||||
*/
|
*/
|
||||||
@TableId(value = "config_id", type = IdType.ASSIGN_ID)
|
@TableId(value = "config_id", type = IdType.ASSIGN_ID)
|
||||||
|
@NotNull(message = "配置id 不能为空", groups = Update.class)
|
||||||
|
@Null(message = "配置id 必须为空", groups = Create.class)
|
||||||
private Long configId;
|
private Long configId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务id
|
* 任务id
|
||||||
*/
|
*/
|
||||||
@TableField(value = "task_id")
|
@TableField(value = "task_id")
|
||||||
|
@Condition(name = "task_id", type = Condition.ConditionType.eq)
|
||||||
|
@NotNull(message = "所属任务不能为空", groups = Create.class)
|
||||||
private Long taskId;
|
private Long taskId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -42,17 +52,22 @@ public class InspectionConfig extends BaseEntity {
|
||||||
* 配置名称 name
|
* 配置名称 name
|
||||||
*/
|
*/
|
||||||
@TableField(value = "config_name")
|
@TableField(value = "config_name")
|
||||||
|
@Condition(name = "config_name", type = Condition.ConditionType.eq)
|
||||||
private String configName;
|
private String configName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 配置别名
|
* 配置别名
|
||||||
*/
|
*/
|
||||||
@TableField(value = "`alias`")
|
@TableField(value = "`alias`")
|
||||||
|
@Condition(name = "`alias`", type = Condition.ConditionType.eq)
|
||||||
|
@NotNull(message = "巡检单别名不能为空", groups = {Update.class,Create.class})
|
||||||
private String alias;
|
private String alias;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 模板名称
|
* 模板名称
|
||||||
*/
|
*/
|
||||||
@TableField(value = "`template`")
|
@TableField(value = "`template`")
|
||||||
|
@Condition(name = "`template`", type = Condition.ConditionType.eq)
|
||||||
|
@NotNull(message = "巡检单模板名称不能为空", groups = {Update.class,Create.class})
|
||||||
private String template;
|
private String template;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,16 @@ public class InspectionData extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
@TableField(value = "config_id")
|
@TableField(value = "config_id")
|
||||||
private Long configId;
|
private Long configId;
|
||||||
|
/**
|
||||||
|
* 详情id
|
||||||
|
*/
|
||||||
|
@TableField(value = "detail_id")
|
||||||
|
private Long detailId;
|
||||||
|
/**
|
||||||
|
* 对应工单id
|
||||||
|
*/
|
||||||
|
@TableField(value = "ins_id")
|
||||||
|
private Long insId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对应部门Id
|
* 对应部门Id
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,17 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.chushang.common.core.validator.Create;
|
||||||
|
import com.chushang.common.core.validator.Update;
|
||||||
import com.chushang.common.mybatis.base.BaseEntity;
|
import com.chushang.common.mybatis.base.BaseEntity;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @auther: zhao
|
* @auther: zhao
|
||||||
* @date: 2024/6/18 15:39
|
* @date: 2024/6/18 15:39
|
||||||
|
|
@ -21,16 +26,17 @@ import lombok.NoArgsConstructor;
|
||||||
@TableName(value = "inspection_detail")
|
@TableName(value = "inspection_detail")
|
||||||
public class InspectionDetail extends BaseEntity {
|
public class InspectionDetail extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 配置id 主键
|
* 详情id
|
||||||
*/
|
*/
|
||||||
@TableId(value = "config_id", type = IdType.ASSIGN_ID)
|
@TableId(value = "detail_id", type = IdType.ASSIGN_ID)
|
||||||
private Long configId;
|
@NotNull(message = "detail_id 不能为空", groups = {Update.class})
|
||||||
|
private Long detailId;
|
||||||
/**
|
/**
|
||||||
* 任务id
|
* 配置id
|
||||||
*/
|
*/
|
||||||
@TableField(value = "inspection_id")
|
@TableField(value = "config_id")
|
||||||
private Long inspectionId;
|
@NotNull(message = "config_id 不能为空", groups = {Create.class, Update.class})
|
||||||
|
private Long configId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对应部门Id
|
* 对应部门Id
|
||||||
|
|
@ -48,11 +54,13 @@ public class InspectionDetail extends BaseEntity {
|
||||||
* 配置对应key
|
* 配置对应key
|
||||||
*/
|
*/
|
||||||
@TableField(value = "config_key")
|
@TableField(value = "config_key")
|
||||||
|
@NotNull(message = "config_key 不能为空", groups = {Create.class, Update.class})
|
||||||
private String configKey;
|
private String configKey;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* key 对应类型
|
* key 对应类型
|
||||||
*/
|
*/
|
||||||
@TableField(value = "config_type")
|
@TableField(value = "config_type")
|
||||||
|
@NotNull(message = "config_type 不能为空", groups = {Create.class, Update.class})
|
||||||
private Short configType;
|
private Short configType;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,15 +15,14 @@ import lombok.NoArgsConstructor;
|
||||||
* @date: 2024/6/18 15:39
|
* @date: 2024/6/18 15:39
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper=true)
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@TableName(value = "polling_task_autograph")
|
@TableName(value = "polling_task_autograph")
|
||||||
public class PollingTaskAutograph extends BaseEntity {
|
public class PollingTaskAutograph {
|
||||||
/**
|
/**
|
||||||
* 签名所属任务
|
* 签名所属任务
|
||||||
*/
|
*/
|
||||||
@TableId(value = "task_id", type = IdType.ASSIGN_ID)
|
@TableId(value = "task_id", type = IdType.INPUT)
|
||||||
private Long taskId;
|
private Long taskId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
package com.chushang.inspection.project.entity.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @auther: zhao
|
||||||
|
* @date: 2024/6/14 11:04
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@TableName(value = "user_autograph")
|
||||||
|
public class UserAutograph {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对应所属的任务id
|
||||||
|
*/
|
||||||
|
@TableId(value = "user_id", type = IdType.INPUT)
|
||||||
|
private Long userId;
|
||||||
|
/**
|
||||||
|
* 对应的签名图片
|
||||||
|
*/
|
||||||
|
@TableField(value = "img_url")
|
||||||
|
private String imgUrl;
|
||||||
|
/**
|
||||||
|
* 签名人
|
||||||
|
*/
|
||||||
|
@TableField(value = "user_name")
|
||||||
|
private String userName;
|
||||||
|
/**
|
||||||
|
* 昵称
|
||||||
|
*/
|
||||||
|
@TableField(value = "nick_name")
|
||||||
|
private String nickName;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.chushang.inspection.project.entity.query;
|
||||||
|
|
||||||
|
import com.chushang.common.mybatis.annotation.Condition;
|
||||||
|
import com.chushang.common.mybatis.page.CommonParam;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @auther: zhao
|
||||||
|
* @date: 2024/6/20 9:59
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class InsConfigQuery extends CommonParam {
|
||||||
|
|
||||||
|
@Size(max = 128, message = "名称或别名不能超过128字符")
|
||||||
|
@Condition(name = "name,alias", type = Condition.ConditionType.or_like)
|
||||||
|
private String blurry;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.chushang.inspection.project.entity.query;
|
||||||
|
|
||||||
|
import com.chushang.common.mybatis.page.CommonParam;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @auther: zhao
|
||||||
|
* @date: 2024/6/20 17:29
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class InsDetailQuery extends CommonParam {
|
||||||
|
/** 配置id */
|
||||||
|
@NotNull(message = "配置id不能为空")
|
||||||
|
private Long configId;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.chushang.inspection.project.entity.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class DetailsVO implements Serializable {
|
||||||
|
/**
|
||||||
|
* 详情id
|
||||||
|
*/
|
||||||
|
private Long detailId;
|
||||||
|
/**
|
||||||
|
* 配置id 主键
|
||||||
|
*/
|
||||||
|
private Long configId;
|
||||||
|
/**
|
||||||
|
* 配置对应label
|
||||||
|
*/
|
||||||
|
private String configLabel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置对应key
|
||||||
|
*/
|
||||||
|
private String configKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* key 对应类型
|
||||||
|
*/
|
||||||
|
private Short configType;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
package com.chushang.inspection.project.entity.vo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class InsConfigVO implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置id
|
||||||
|
*/
|
||||||
|
private Long configId;
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String configName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 别名
|
||||||
|
*/
|
||||||
|
private String alias;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模板路径
|
||||||
|
*/
|
||||||
|
private String template;
|
||||||
|
/**
|
||||||
|
* 所属任务id
|
||||||
|
*/
|
||||||
|
private Long taskId;
|
||||||
|
/**
|
||||||
|
* 所属 部门id
|
||||||
|
*/
|
||||||
|
private Long deptId;
|
||||||
|
/**
|
||||||
|
* 配置详情
|
||||||
|
*/
|
||||||
|
private List<DetailsVO> details;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,107 @@
|
||||||
|
package com.chushang.inspection.project.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.chushang.common.core.exception.utils.AssertUtil;
|
||||||
|
import com.chushang.common.core.validator.Create;
|
||||||
|
import com.chushang.common.core.validator.Update;
|
||||||
|
import com.chushang.common.core.web.AjaxResult;
|
||||||
|
import com.chushang.common.log.annotation.SysLog;
|
||||||
|
import com.chushang.common.log.enums.BusinessType;
|
||||||
|
import com.chushang.common.mybatis.utils.WrapperUtils;
|
||||||
|
import com.chushang.inspection.project.entity.po.InspectionConfig;
|
||||||
|
import com.chushang.inspection.project.entity.query.InsConfigQuery;
|
||||||
|
import com.chushang.inspection.project.service.InspectionConfigService;
|
||||||
|
import com.chushang.security.annotation.RequiresPermissions;
|
||||||
|
import com.chushang.security.utils.SecurityUtils;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电子巡检单配置
|
||||||
|
* @auther: zhao
|
||||||
|
* @date: 2024/6/20 9:57
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/ins/config")
|
||||||
|
public class InsConfigController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
InspectionConfigService configService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param query 条件
|
||||||
|
* @return 分页信息
|
||||||
|
*/
|
||||||
|
@PostMapping("/page")
|
||||||
|
@RequiresPermissions("ins:config:page")
|
||||||
|
public AjaxResult findPage(@RequestBody @Validated InsConfigQuery query) {
|
||||||
|
return AjaxResult.success(configService.pageList(query));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取巡检单类型详细信息
|
||||||
|
*
|
||||||
|
* @param configId 字典类型id
|
||||||
|
* @return 详细信息
|
||||||
|
*/
|
||||||
|
@PostMapping("/info/{configId}")
|
||||||
|
@RequiresPermissions("ins:config:info")
|
||||||
|
public AjaxResult get(@PathVariable Long configId) {
|
||||||
|
return AjaxResult.success(configService.getById(configId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 别名查询巡检单信息
|
||||||
|
*
|
||||||
|
* @return 详细信息
|
||||||
|
*/
|
||||||
|
@PostMapping("/alias/{alias}")
|
||||||
|
@RequiresPermissions("ins:config:info")
|
||||||
|
public AjaxResult get(@PathVariable String alias) {
|
||||||
|
return AjaxResult.success(configService.getByAlias(alias));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
@SysLog(value = "巡检单配置", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("wrk:config:save")
|
||||||
|
public AjaxResult save(@RequestBody@Validated(Create.class) InspectionConfig config) {
|
||||||
|
config.setConfigId(null);
|
||||||
|
config.setDeptId(SecurityUtils.getDeptId());
|
||||||
|
String alias = config.getAlias();
|
||||||
|
LambdaQueryWrapper<InspectionConfig> configSql = WrapperUtils.builder();
|
||||||
|
configSql.eq(InspectionConfig::getAlias, alias);
|
||||||
|
long count = configService.count(configSql);
|
||||||
|
AssertUtil.invalidate(count > 0 , "巡检单别名重复");
|
||||||
|
configService.saveEntity(config);
|
||||||
|
return AjaxResult.success(config.getConfigId());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*/
|
||||||
|
@SysLog(value = "巡检单配置", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/update")
|
||||||
|
@RequiresPermissions("wrk:config:update")
|
||||||
|
public AjaxResult update(@RequestBody @Validated(Update.class) InspectionConfig config) {
|
||||||
|
Long configId = config.getConfigId();
|
||||||
|
AssertUtil.invalidate(null == configId, "未找寻到对应的巡检单配置");
|
||||||
|
String alias = config.getAlias();
|
||||||
|
LambdaQueryWrapper<InspectionConfig> configSql = WrapperUtils.builder();
|
||||||
|
configSql.eq(InspectionConfig::getAlias, alias)
|
||||||
|
.ne(InspectionConfig::getConfigId, configId);
|
||||||
|
long count = configService.count(configSql);
|
||||||
|
AssertUtil.invalidate(count > 0 , "巡检单别名重复");
|
||||||
|
|
||||||
|
configService.updateByEntityId(config);
|
||||||
|
return AjaxResult.success(config.getConfigId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,121 @@
|
||||||
|
package com.chushang.inspection.project.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.chushang.common.core.exception.utils.AssertUtil;
|
||||||
|
import com.chushang.common.core.validator.Create;
|
||||||
|
import com.chushang.common.core.validator.Update;
|
||||||
|
import com.chushang.common.core.web.AjaxResult;
|
||||||
|
import com.chushang.common.log.annotation.SysLog;
|
||||||
|
import com.chushang.common.log.enums.BusinessType;
|
||||||
|
import com.chushang.common.mybatis.utils.WrapperUtils;
|
||||||
|
import com.chushang.inspection.project.entity.dto.Delete;
|
||||||
|
import com.chushang.inspection.project.entity.po.InspectionDetail;
|
||||||
|
import com.chushang.inspection.project.entity.query.InsDetailQuery;
|
||||||
|
import com.chushang.inspection.project.service.InspectionDetailService;
|
||||||
|
import com.chushang.security.annotation.RequiresPermissions;
|
||||||
|
import com.chushang.security.utils.SecurityUtils;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @auther: zhao
|
||||||
|
* @date: 2024/6/20 17:27
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/ins/detail")
|
||||||
|
public class InsDetailController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
InspectionDetailService detailService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param query 条件
|
||||||
|
* @return 分页信息
|
||||||
|
*/
|
||||||
|
@PostMapping("/page")
|
||||||
|
@RequiresPermissions("ins:detail:page")
|
||||||
|
public AjaxResult findPage(@RequestBody @Validated InsDetailQuery query) {
|
||||||
|
return AjaxResult.success(detailService.findPage(query));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取字典类型详细信息
|
||||||
|
*
|
||||||
|
* @return 详细信息
|
||||||
|
*/
|
||||||
|
@PostMapping("/info/{detailId}")
|
||||||
|
@RequiresPermissions("ins:details:info")
|
||||||
|
public AjaxResult get(@PathVariable Long detailId) {
|
||||||
|
return AjaxResult.success(detailService.getById(detailId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@SysLog(value = "巡检单配置详情", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("ins:details:save")
|
||||||
|
public AjaxResult save(@RequestBody @Validated(Create.class) InspectionDetail detail) {
|
||||||
|
detail.setDetailId(null);
|
||||||
|
Long configId = detail.getConfigId();
|
||||||
|
AssertUtil.invalidate(null == configId, "巡检单配置id 不能为空");
|
||||||
|
|
||||||
|
detail.setDeptId(SecurityUtils.getDeptId());
|
||||||
|
|
||||||
|
String configKey = detail.getConfigKey();
|
||||||
|
AssertUtil.invalidate(null == configKey, "巡检单配置key 不能为空");
|
||||||
|
|
||||||
|
LambdaQueryWrapper<InspectionDetail> detailSql = WrapperUtils.builder();
|
||||||
|
detailSql.eq(InspectionDetail::getConfigId, configId)
|
||||||
|
.eq(InspectionDetail::getConfigKey, configKey);
|
||||||
|
long count = detailService.count(detailSql);
|
||||||
|
AssertUtil.invalidate(count > 0, "巡检单配置key 重复");
|
||||||
|
|
||||||
|
detailService.saveEntity(detail);
|
||||||
|
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@SysLog(value = "巡检单配置详情", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/update")
|
||||||
|
@RequiresPermissions("ins:details:update")
|
||||||
|
public AjaxResult update(@RequestBody @Validated(Update.class) InspectionDetail detail) {
|
||||||
|
Long detailId = detail.getDetailId();
|
||||||
|
AssertUtil.invalidate(null == detailId, "detail_id 不能为空");
|
||||||
|
Long configId = detail.getConfigId();
|
||||||
|
AssertUtil.invalidate(null == configId, "configId 不能为空");
|
||||||
|
String configKey = detail.getConfigKey();
|
||||||
|
AssertUtil.invalidate(null == configKey, "巡检单配置key 不能为空");
|
||||||
|
LambdaQueryWrapper<InspectionDetail> detailSql = WrapperUtils.builder();
|
||||||
|
detailSql.eq(InspectionDetail::getConfigId, configId)
|
||||||
|
.eq(InspectionDetail::getConfigKey, configKey)
|
||||||
|
.ne(InspectionDetail::getDetailId, detailId);
|
||||||
|
long count = detailService.count(detailSql);
|
||||||
|
AssertUtil.invalidate(count > 0, "巡检单配置key 重复");
|
||||||
|
|
||||||
|
detailService.updateByEntityId(detail);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@SysLog(value = "巡检单配置详情", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping("/delete")
|
||||||
|
@RequiresPermissions("ins:details:delete")
|
||||||
|
public AjaxResult delete(@RequestBody @Validated Delete delete) {
|
||||||
|
detailService.removeByEntityIds(delete.getIds());
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
package com.chushang.inspection.project.controller;
|
||||||
|
|
||||||
|
import com.chushang.common.core.validator.Create;
|
||||||
|
import com.chushang.common.core.validator.Update;
|
||||||
|
import com.chushang.common.core.web.AjaxResult;
|
||||||
|
import com.chushang.common.log.annotation.SysLog;
|
||||||
|
import com.chushang.common.log.enums.BusinessType;
|
||||||
|
import com.chushang.inspection.project.entity.dto.TaskGraphDTO;
|
||||||
|
import com.chushang.inspection.project.service.PollingTaskAutographService;
|
||||||
|
import com.chushang.security.annotation.RequiresPermissions;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支行签名
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RequestMapping("/graph/task")
|
||||||
|
public class PollingTaskAutographController {
|
||||||
|
|
||||||
|
private final PollingTaskAutographService taskAutographService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询 客户经理签名
|
||||||
|
*/
|
||||||
|
@GetMapping("/{taskId}")
|
||||||
|
@RequiresPermissions("task:graph:query")
|
||||||
|
public AjaxResult get(@PathVariable Long taskId) {
|
||||||
|
return AjaxResult.success(taskAutographService.getById(taskId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("task:graph:save")
|
||||||
|
@SysLog(value = "任务签名", businessType = BusinessType.INSERT)
|
||||||
|
public AjaxResult save(@RequestBody @Validated(Create.class) TaskGraphDTO task) {
|
||||||
|
taskAutographService.save(task);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/update")
|
||||||
|
@RequiresPermissions("task:graph:update")
|
||||||
|
@SysLog(value = "任务签名", businessType = BusinessType.UPDATE)
|
||||||
|
public AjaxResult update(@RequestBody @Validated(Update.class) TaskGraphDTO task) {
|
||||||
|
taskAutographService.update(task);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,86 @@
|
||||||
|
package com.chushang.inspection.project.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.chushang.common.core.exception.utils.AssertUtil;
|
||||||
|
import com.chushang.common.core.validator.Create;
|
||||||
|
import com.chushang.common.core.validator.Update;
|
||||||
|
import com.chushang.common.core.web.AjaxResult;
|
||||||
|
import com.chushang.common.log.annotation.SysLog;
|
||||||
|
import com.chushang.common.log.enums.BusinessType;
|
||||||
|
import com.chushang.inspection.project.entity.dto.Delete;
|
||||||
|
import com.chushang.inspection.project.entity.dto.UserAutographDTO;
|
||||||
|
import com.chushang.inspection.project.entity.po.UserAutograph;
|
||||||
|
import com.chushang.inspection.project.service.UserAutographService;
|
||||||
|
import com.chushang.security.annotation.RequiresPermissions;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.java.Log;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @auther: zhao
|
||||||
|
* @date: 2024/6/14 11:07
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RequestMapping("/graph/user")
|
||||||
|
public class UserAutographController {
|
||||||
|
|
||||||
|
private final UserAutographService userAutographService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户签名
|
||||||
|
* 业务员--> 即维修人员
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@RequiresPermissions("user:graph:update")
|
||||||
|
@SysLog(value = "用户签名",businessType = BusinessType.UPDATE)
|
||||||
|
public AjaxResult update(@RequestBody @Validated({Create.class, Update.class}) UserAutographDTO autographDTO) {
|
||||||
|
userAutographService.updateById(BeanUtil.copyProperties(autographDTO, UserAutograph.class));
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增用户签名
|
||||||
|
*/
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("user:graph:save")
|
||||||
|
@SysLog(value = "用户签名",businessType = BusinessType.INSERT)
|
||||||
|
public AjaxResult save(@RequestBody @Validated({Create.class, Update.class}) UserAutographDTO autographDTO) {
|
||||||
|
userAutographService.save(BeanUtil.copyProperties(autographDTO, UserAutograph.class));
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户签名
|
||||||
|
*/
|
||||||
|
@PostMapping("/delete")
|
||||||
|
@RequiresPermissions("user:graph:del")
|
||||||
|
@SysLog(value = "用户签名",businessType = BusinessType.DELETE)
|
||||||
|
public AjaxResult delete(@RequestBody @Validated Delete delete) {
|
||||||
|
userAutographService.removeByIds(delete.getIds());
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 查询用户签名
|
||||||
|
*/
|
||||||
|
@GetMapping("/{userId}")
|
||||||
|
@RequiresPermissions("user:graph:query")
|
||||||
|
public AjaxResult query(@PathVariable Long userId) {
|
||||||
|
return AjaxResult.success(userAutographService.getById(userId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/test")
|
||||||
|
public void test(){
|
||||||
|
log.info("test");
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/error")
|
||||||
|
public void error(){
|
||||||
|
AssertUtil.invalidate(false, "水水水水");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.chushang.inspection.project.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.chushang.inspection.project.entity.po.UserAutograph;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @auther: zhao
|
||||||
|
* @date: 2024/6/20 9:39
|
||||||
|
*/
|
||||||
|
public interface UserAutographMapper extends BaseMapper<UserAutograph> {
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,18 @@
|
||||||
package com.chushang.inspection.project.service;
|
package com.chushang.inspection.project.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.chushang.common.mybatis.page.CommonParam;
|
||||||
|
import com.chushang.common.mybatis.utils.PageResult;
|
||||||
|
import com.chushang.common.mybatis.utils.WrapperUtils;
|
||||||
import com.chushang.inspection.project.entity.po.InspectionConfig;
|
import com.chushang.inspection.project.entity.po.InspectionConfig;
|
||||||
|
import com.chushang.inspection.project.entity.po.WrkProjectContract;
|
||||||
|
import com.chushang.inspection.project.entity.query.InsConfigQuery;
|
||||||
|
import com.chushang.inspection.project.entity.vo.InsConfigVO;
|
||||||
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @auther: zhao
|
* @auther: zhao
|
||||||
|
|
@ -10,4 +21,20 @@ import com.chushang.inspection.project.entity.po.InspectionConfig;
|
||||||
public interface InspectionConfigService extends IService<InspectionConfig>{
|
public interface InspectionConfigService extends IService<InspectionConfig>{
|
||||||
|
|
||||||
|
|
||||||
|
default PageResult pageList(InsConfigQuery query){
|
||||||
|
CommonParam commonParam = CommonParam.buildPageRequest();
|
||||||
|
LambdaQueryWrapper<InspectionConfig> configSql = WrapperUtils.builder(query, commonParam);
|
||||||
|
IPage<InspectionConfig> page = this.page(
|
||||||
|
new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(commonParam.getPage(), commonParam.getLimit()),
|
||||||
|
configSql
|
||||||
|
);
|
||||||
|
return new PageResult(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
InsConfigVO getByAlias(String alias);
|
||||||
|
|
||||||
|
|
||||||
|
void updateByEntityId(InspectionConfig config);
|
||||||
|
|
||||||
|
void saveEntity(InspectionConfig config);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,17 @@
|
||||||
package com.chushang.inspection.project.service;
|
package com.chushang.inspection.project.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.chushang.common.mybatis.page.CommonParam;
|
||||||
|
import com.chushang.common.mybatis.utils.PageResult;
|
||||||
|
import com.chushang.common.mybatis.utils.WrapperUtils;
|
||||||
|
import com.chushang.datascope.annotation.DataScope;
|
||||||
|
import com.chushang.inspection.project.entity.po.InspectionConfig;
|
||||||
import com.chushang.inspection.project.entity.po.InspectionDetail;
|
import com.chushang.inspection.project.entity.po.InspectionDetail;
|
||||||
|
import com.chushang.inspection.project.entity.query.InsDetailQuery;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @auther: zhao
|
* @auther: zhao
|
||||||
|
|
@ -10,4 +20,20 @@ import com.chushang.inspection.project.entity.po.InspectionDetail;
|
||||||
public interface InspectionDetailService extends IService<InspectionDetail>{
|
public interface InspectionDetailService extends IService<InspectionDetail>{
|
||||||
|
|
||||||
|
|
||||||
|
@DataScope
|
||||||
|
default PageResult findPage(InsDetailQuery query){
|
||||||
|
CommonParam commonParam = CommonParam.buildPageRequest();
|
||||||
|
LambdaQueryWrapper<InspectionDetail> detailSql = WrapperUtils.builder(query, commonParam);
|
||||||
|
IPage<InspectionDetail> page = this.page(
|
||||||
|
new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(commonParam.getPage(), commonParam.getLimit()),
|
||||||
|
detailSql
|
||||||
|
);
|
||||||
|
return new PageResult(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
void saveEntity(InspectionDetail detail);
|
||||||
|
|
||||||
|
void updateByEntityId(InspectionDetail detail);
|
||||||
|
|
||||||
|
void removeByEntityIds(List<Long> ids);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.chushang.inspection.project.service;
|
package com.chushang.inspection.project.service;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.chushang.inspection.project.entity.dto.TaskGraphDTO;
|
||||||
import com.chushang.inspection.project.entity.po.PollingTaskAutograph;
|
import com.chushang.inspection.project.entity.po.PollingTaskAutograph;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -10,4 +12,13 @@ import com.chushang.inspection.project.entity.po.PollingTaskAutograph;
|
||||||
public interface PollingTaskAutographService extends IService<PollingTaskAutograph>{
|
public interface PollingTaskAutographService extends IService<PollingTaskAutograph>{
|
||||||
|
|
||||||
|
|
||||||
|
default void save(TaskGraphDTO task){
|
||||||
|
PollingTaskAutograph pollingTaskAutograph = BeanUtil.copyProperties(task, PollingTaskAutograph.class);
|
||||||
|
save(pollingTaskAutograph);
|
||||||
|
}
|
||||||
|
|
||||||
|
default void update(TaskGraphDTO task){
|
||||||
|
PollingTaskAutograph pollingTaskAutograph = BeanUtil.copyProperties(task, PollingTaskAutograph.class);
|
||||||
|
updateById(pollingTaskAutograph);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.chushang.inspection.project.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.chushang.inspection.project.entity.po.UserAutograph;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @auther: zhao
|
||||||
|
* @date: 2024/6/20 9:38
|
||||||
|
*/
|
||||||
|
public interface UserAutographService extends IService<UserAutograph> {
|
||||||
|
}
|
||||||
|
|
@ -1,15 +1,77 @@
|
||||||
package com.chushang.inspection.project.service.impl;
|
package com.chushang.inspection.project.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.chushang.common.mybatis.enums.Operator;
|
||||||
|
import com.chushang.common.mybatis.page.CommonParam;
|
||||||
|
import com.chushang.common.mybatis.utils.WrapperUtils;
|
||||||
|
import com.chushang.inspection.project.entity.po.InspectionDetail;
|
||||||
|
import com.chushang.inspection.project.entity.vo.DetailsVO;
|
||||||
|
import com.chushang.inspection.project.entity.vo.InsConfigVO;
|
||||||
import com.chushang.inspection.project.service.InspectionConfigService;
|
import com.chushang.inspection.project.service.InspectionConfigService;
|
||||||
|
import com.chushang.inspection.project.service.InspectionDetailService;
|
||||||
|
import org.springframework.cache.annotation.CacheConfig;
|
||||||
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
|
import org.springframework.cache.annotation.CachePut;
|
||||||
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.chushang.inspection.project.entity.po.InspectionConfig;
|
import com.chushang.inspection.project.entity.po.InspectionConfig;
|
||||||
import com.chushang.inspection.project.mapper.InspectionConfigMapper;
|
import com.chushang.inspection.project.mapper.InspectionConfigMapper;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @auther: zhao
|
* @auther: zhao
|
||||||
* @date: 2024/6/18 15:39
|
* @date: 2024/6/18 15:39
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@CacheConfig(cacheNames = "inspection_config")
|
||||||
public class InspectionConfigServiceImpl extends ServiceImpl<InspectionConfigMapper, InspectionConfig> implements InspectionConfigService {
|
public class InspectionConfigServiceImpl extends ServiceImpl<InspectionConfigMapper, InspectionConfig> implements InspectionConfigService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
InspectionDetailService detailService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@CachePut(key = "#alias")
|
||||||
|
public InsConfigVO getByAlias(String alias) {
|
||||||
|
LambdaQueryWrapper<InspectionConfig> configSql = WrapperUtils.builder();
|
||||||
|
configSql.eq(InspectionConfig::getAlias, alias).last(Operator.LIMIT_ONE.getCharacter());
|
||||||
|
InspectionConfig insConfig = getOne(configSql);
|
||||||
|
InsConfigVO insConfigVO = BeanUtil.copyProperties(insConfig, InsConfigVO.class);
|
||||||
|
if (ObjectUtil.isNotEmpty(insConfigVO)){
|
||||||
|
LambdaQueryWrapper<InspectionDetail> detailSql = WrapperUtils.builder();
|
||||||
|
detailSql.eq(InspectionDetail::getConfigId, insConfigVO.getConfigId());
|
||||||
|
List<InspectionDetail> list = detailService.list(detailSql);
|
||||||
|
if (CollectionUtil.isNotEmpty(list)){
|
||||||
|
List<DetailsVO> detailsList = BeanUtil.copyToList(list, DetailsVO.class);
|
||||||
|
insConfigVO.setDetails(detailsList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return insConfigVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CacheEvict 需要 allEntries = true 才能 删除成功, 同时必须 为void 方法, 等以后有机会在改吧
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@CacheEvict(allEntries = true)
|
||||||
|
@Transactional
|
||||||
|
public void updateByEntityId(InspectionConfig config) {
|
||||||
|
removeById(config);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CacheEvict 需要 allEntries = true 才能 删除成功, 同时必须 为void 方法, 等以后有机会在改吧
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@CacheEvict(allEntries = true)
|
||||||
|
@Transactional
|
||||||
|
public void saveEntity(InspectionConfig config) {
|
||||||
|
save(config);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,45 @@
|
||||||
package com.chushang.inspection.project.service.impl;
|
package com.chushang.inspection.project.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.chushang.common.mybatis.page.CommonParam;
|
||||||
|
import com.chushang.common.mybatis.utils.WrapperUtils;
|
||||||
|
import com.chushang.datascope.annotation.DataScope;
|
||||||
|
import com.chushang.inspection.project.entity.query.InsDetailQuery;
|
||||||
import com.chushang.inspection.project.service.InspectionDetailService;
|
import com.chushang.inspection.project.service.InspectionDetailService;
|
||||||
|
import org.springframework.cache.annotation.CacheConfig;
|
||||||
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.chushang.inspection.project.entity.po.InspectionDetail;
|
import com.chushang.inspection.project.entity.po.InspectionDetail;
|
||||||
import com.chushang.inspection.project.mapper.InspectionDetailMapper;
|
import com.chushang.inspection.project.mapper.InspectionDetailMapper;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @auther: zhao
|
* @auther: zhao
|
||||||
* @date: 2024/6/18 15:39
|
* @date: 2024/6/18 15:39
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@CacheConfig(cacheNames = "inspection_config")
|
||||||
public class InspectionDetailServiceImpl extends ServiceImpl<InspectionDetailMapper, InspectionDetail> implements InspectionDetailService {
|
public class InspectionDetailServiceImpl extends ServiceImpl<InspectionDetailMapper, InspectionDetail> implements InspectionDetailService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@CacheEvict(allEntries = true)
|
||||||
|
public void saveEntity(InspectionDetail detail) {
|
||||||
|
save(detail);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@CacheEvict(allEntries = true)
|
||||||
|
public void updateByEntityId(InspectionDetail detail) {
|
||||||
|
updateById(detail);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@CacheEvict(allEntries = true)
|
||||||
|
@Transactional
|
||||||
|
public void removeByEntityIds(List<Long> ids) {
|
||||||
|
removeByIds(ids);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.chushang.inspection.project.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.chushang.inspection.project.entity.po.UserAutograph;
|
||||||
|
import com.chushang.inspection.project.mapper.UserAutographMapper;
|
||||||
|
import com.chushang.inspection.project.service.UserAutographService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @auther: zhao
|
||||||
|
* @date: 2024/6/20 9:39
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class UserAutographServiceImpl extends ServiceImpl<UserAutographMapper, UserAutograph> implements UserAutographService {
|
||||||
|
}
|
||||||
|
|
@ -21,6 +21,7 @@ import java.util.List;
|
||||||
* @author mybatis-flex-helper automatic generation
|
* @author mybatis-flex-helper automatic generation
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue