forked from wuweidong/hzims-back-huoshan
walton
6 months ago
commit
6a5a5ec2aa
4537 changed files with 322076 additions and 0 deletions
@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
<parent> |
||||
<artifactId>hzims-back</artifactId> |
||||
<groupId>com.hnac.hzims</groupId> |
||||
<version>4.0.0-SNAPSHOT</version> |
||||
</parent> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<artifactId>hzims-biz-common</artifactId> |
||||
<packaging>jar</packaging> |
||||
|
||||
<dependencies> |
||||
<dependency> |
||||
<groupId>org.springblade</groupId> |
||||
<artifactId>blade-core-launch</artifactId> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>org.springblade</groupId> |
||||
<artifactId>blade-core-auto</artifactId> |
||||
<scope>provided</scope> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>org.springblade</groupId> |
||||
<artifactId>blade-common</artifactId> |
||||
</dependency> |
||||
<!--Json 工具 Start--> |
||||
<dependency> |
||||
<groupId>com.alibaba</groupId> |
||||
<artifactId>fastjson</artifactId> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>org.springblade</groupId> |
||||
<artifactId>blade-user-api</artifactId> |
||||
</dependency> |
||||
<!--Json 工具 End--> |
||||
<dependency> |
||||
<groupId>org.springblade</groupId> |
||||
<artifactId>blade-dict-api</artifactId> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>org.springblade</groupId> |
||||
<artifactId>blade-starter-datascope</artifactId> |
||||
</dependency> |
||||
</dependencies> |
||||
|
||||
<build> |
||||
<plugins> |
||||
<plugin> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-maven-plugin</artifactId> |
||||
<configuration> |
||||
<skip>true</skip> |
||||
<finalName>${project.name}</finalName> |
||||
</configuration> |
||||
</plugin> |
||||
</plugins> |
||||
</build> |
||||
|
||||
</project> |
@ -0,0 +1,28 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package com.hnac.hzims.common.cache; |
||||
|
||||
/** |
||||
* 缓存名 |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
public interface CacheNames { |
||||
|
||||
String NOTICE_ONE = "blade:notice:one"; |
||||
|
||||
} |
@ -0,0 +1,32 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package com.hnac.hzims.common.config; |
||||
|
||||
|
||||
import lombok.AllArgsConstructor; |
||||
import org.springframework.context.annotation.Configuration; |
||||
|
||||
/** |
||||
* 公共封装包配置类 |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@Configuration |
||||
@AllArgsConstructor |
||||
public class BladeCommonConfiguration { |
||||
|
||||
} |
@ -0,0 +1,75 @@
|
||||
package com.hnac.hzims.common.config; |
||||
|
||||
import com.google.common.collect.Lists; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.RequiredArgsConstructor; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.boot.ApplicationArguments; |
||||
import org.springframework.boot.ApplicationRunner; |
||||
import org.springframework.context.ApplicationContext; |
||||
import org.springframework.context.annotation.Bean; |
||||
import org.springframework.context.annotation.Configuration; |
||||
import org.springframework.context.support.GenericApplicationContext; |
||||
import org.springframework.core.annotation.AnnotationUtils; |
||||
import org.springframework.data.redis.connection.RedisConnectionFactory; |
||||
import org.springframework.data.redis.core.RedisTemplate; |
||||
import org.springframework.data.redis.listener.PatternTopic; |
||||
import org.springframework.data.redis.listener.RedisMessageListenerContainer; |
||||
import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; |
||||
import org.springframework.stereotype.Component; |
||||
import org.springframework.util.ReflectionUtils; |
||||
|
||||
import java.lang.reflect.Method; |
||||
import java.util.ArrayList; |
||||
import java.util.Objects; |
||||
import java.util.concurrent.atomic.AtomicLong; |
||||
|
||||
/** |
||||
* @author hx |
||||
* @version 1.0 |
||||
* @date 2023/3/12 15:27 |
||||
*/ |
||||
|
||||
@Component |
||||
public class RedisMessageConfig implements ApplicationRunner { |
||||
|
||||
/**AtomicLong 可以理解为加了synchronized的long类型**/ |
||||
private AtomicLong counter = new AtomicLong(0); |
||||
|
||||
@Autowired |
||||
private ApplicationContext context; |
||||
|
||||
@Bean |
||||
RedisMessageListenerContainer container(RedisConnectionFactory connectionFactory) { |
||||
RedisMessageListenerContainer container = new RedisMessageListenerContainer(); |
||||
container.setConnectionFactory(connectionFactory); |
||||
return container; |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public void run(ApplicationArguments args) throws Exception { |
||||
// 获取Redis的消息监听容器
|
||||
RedisMessageListenerContainer container = context.getBean(RedisMessageListenerContainer.class); |
||||
|
||||
// 扫描注册所有的 @RedisMessageListener 的方法,添加到容器中
|
||||
for (String beanName : context.getBeanNamesForType(Object.class)) { |
||||
ReflectionUtils.doWithMethods(Objects.requireNonNull(context.getType(beanName)), |
||||
method -> { |
||||
ReflectionUtils.makeAccessible(method); |
||||
Object target = context.getBean(beanName); |
||||
RedisMessageListener annotation = AnnotationUtils.findAnnotation(method, RedisMessageListener.class); |
||||
MessageListenerAdapter adapter = registerBean((GenericApplicationContext) context, target, method); |
||||
container.addMessageListener(adapter, new PatternTopic(annotation.topic())); |
||||
}, |
||||
method -> !method.isSynthetic() && method.getParameterTypes().length == 1 |
||||
&& AnnotationUtils.findAnnotation(method, RedisMessageListener.class) != null); |
||||
} |
||||
} |
||||
|
||||
private MessageListenerAdapter registerBean(GenericApplicationContext context, Object target, Method method) { |
||||
String containerBeanName = String.format("%s_%s", MessageListenerAdapter.class.getName(), counter.incrementAndGet()); |
||||
context.registerBean(containerBeanName, MessageListenerAdapter.class, () -> new MessageListenerAdapter(target, method.getName())); |
||||
return context.getBean(containerBeanName, MessageListenerAdapter.class); |
||||
} |
||||
} |
@ -0,0 +1,16 @@
|
||||
package com.hnac.hzims.common.config; |
||||
|
||||
import java.lang.annotation.*; |
||||
|
||||
/** |
||||
* @author hx |
||||
* @version 1.0 |
||||
* @date 2023/3/12 17:01 |
||||
*/ |
||||
@Target({ElementType.METHOD}) |
||||
@Retention(RetentionPolicy.RUNTIME) |
||||
@Documented |
||||
public @interface RedisMessageListener { |
||||
/**事件主题**/ |
||||
String topic(); |
||||
} |
@ -0,0 +1,52 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package com.hnac.hzims.common.constant; |
||||
|
||||
/** |
||||
* 通用常量 |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
public interface CommonConstant { |
||||
|
||||
/** |
||||
* sword 系统名 |
||||
*/ |
||||
String SWORD_NAME = "sword"; |
||||
|
||||
/** |
||||
* saber 系统名 |
||||
*/ |
||||
String SABER_NAME = "saber"; |
||||
|
||||
/** |
||||
* 顶级父节点id |
||||
*/ |
||||
Integer TOP_PARENT_ID = 0; |
||||
|
||||
/** |
||||
* 顶级父节点名称 |
||||
*/ |
||||
String TOP_PARENT_NAME = "顶级"; |
||||
|
||||
|
||||
/** |
||||
* 默认密码 |
||||
*/ |
||||
String DEFAULT_PASSWORD = "123456"; |
||||
|
||||
} |
@ -0,0 +1,36 @@
|
||||
package com.hnac.hzims.common.constant; |
||||
|
||||
import lombok.AllArgsConstructor; |
||||
import lombok.Getter; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.Optional; |
||||
|
||||
/** |
||||
* @author hx |
||||
*/ |
||||
public interface DateConstant { |
||||
|
||||
@AllArgsConstructor |
||||
enum UnitEnum { |
||||
YEAR("year","年"), |
||||
MONTH("month","月"), |
||||
DAY("day","日"), |
||||
HOUR("hour","时"), |
||||
MINUTER("minuter","分"), |
||||
SECOND("second","秒") |
||||
; |
||||
|
||||
@Getter |
||||
private String unit; |
||||
@Getter |
||||
private String describe; |
||||
|
||||
public static UnitEnum getEnumByUnit(String unit) { |
||||
Optional<UnitEnum> optionalUnitEnum = Arrays.stream(UnitEnum.class.getEnumConstants()) |
||||
.filter(unitEnum -> unit.equals(unitEnum.getUnit())).findAny(); |
||||
return optionalUnitEnum.orElse(null); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,206 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package com.hnac.hzims.common.constant; |
||||
|
||||
import org.springblade.core.launch.constant.AppConstant; |
||||
|
||||
import static org.springblade.core.launch.constant.AppConstant.APPLICATION_NAME_PREFIX; |
||||
|
||||
/** |
||||
* 通用常量 |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
public interface LauncherConstant { |
||||
|
||||
/** |
||||
* nacos namespace id |
||||
*/ |
||||
String NACOS_NAMESPACE = "f447a694-519a-4255-95f9-bcbb5a5d6369"; |
||||
|
||||
/** |
||||
* nacos dev 地址 |
||||
*/ |
||||
String NACOS_DEV_ADDR = "192.168.65.152:8848"; |
||||
|
||||
/** |
||||
* nacos prod 地址 |
||||
*/ |
||||
String NACOS_PROD_ADDR = "192.168.65.152:8848"; |
||||
|
||||
/** |
||||
* nacos test 地址 |
||||
*/ |
||||
String NACOS_TEST_ADDR = "192.168.65.152:8848"; |
||||
|
||||
/** |
||||
* sentinel dev 地址 |
||||
*/ |
||||
String SENTINEL_DEV_ADDR = "192.168.65.152:8858"; |
||||
|
||||
/** |
||||
* sentinel prod 地址 |
||||
*/ |
||||
String SENTINEL_PROD_ADDR = "172.30.0.58:8858"; |
||||
|
||||
/** |
||||
* sentinel test 地址 |
||||
*/ |
||||
String SENTINEL_TEST_ADDR = "192.168.65.152:8858"; |
||||
|
||||
/** |
||||
* seata dev 地址 |
||||
*/ |
||||
String SEATA_DEV_ADDR = "192.168.65.152:8091"; |
||||
|
||||
/** |
||||
* seata prod 地址 |
||||
*/ |
||||
String SEATA_PROD_ADDR = "172.30.0.68:8091"; |
||||
|
||||
/** |
||||
* seata test 地址 |
||||
*/ |
||||
String SEATA_TEST_ADDR = "192.168.65.152:8091"; |
||||
|
||||
/** |
||||
* dbuuo提供者 |
||||
*/ |
||||
String APPLICATION_DUBBO_PROVIDER_NAME = APPLICATION_NAME_PREFIX + "dubbo-provider"; |
||||
|
||||
/** |
||||
* dbuuo消费者 |
||||
*/ |
||||
String APPLICATION_DUBBO_CONSUMER_NAME = APPLICATION_NAME_PREFIX + "dubbo-consumer"; |
||||
|
||||
/** |
||||
* seata订单 |
||||
*/ |
||||
String APPLICATION_SEATA_ORDER_NAME = APPLICATION_NAME_PREFIX + "seata-order"; |
||||
|
||||
/** |
||||
* seata库存 |
||||
*/ |
||||
String APPLICATION_SEATA_STORAGE_NAME = APPLICATION_NAME_PREFIX + "seata-storage"; |
||||
|
||||
/** |
||||
* easypoi |
||||
*/ |
||||
String APPLICATION_EASYPOI_NAME = APPLICATION_NAME_PREFIX + "easypoi"; |
||||
|
||||
/** |
||||
* kafka |
||||
*/ |
||||
String APPLICATION_KAFKA_NAME = APPLICATION_NAME_PREFIX + "kafka"; |
||||
|
||||
/** |
||||
* rabbit |
||||
*/ |
||||
String APPLICATION_RABBIT_NAME = APPLICATION_NAME_PREFIX + "rabbit"; |
||||
|
||||
/** |
||||
* stream消费者 |
||||
*/ |
||||
String APPLICATION_STREAM_CONSUMER_NAME = APPLICATION_NAME_PREFIX + "stream-consumer"; |
||||
|
||||
/** |
||||
* stream生产者 |
||||
*/ |
||||
String APPLICATION_STREAM_PROVIDER_NAME = APPLICATION_NAME_PREFIX + "stream-provider"; |
||||
|
||||
/** |
||||
* seata file模式 |
||||
*/ |
||||
String FILE_MODE = "file"; |
||||
|
||||
/** |
||||
* seata nacos模式 |
||||
*/ |
||||
String NACOS_MODE = "nacos"; |
||||
|
||||
/** |
||||
* seata default模式 |
||||
*/ |
||||
String DEFAULT_MODE = "default"; |
||||
|
||||
/** |
||||
* seata group后缀 |
||||
*/ |
||||
String GROUP_NAME = "-group"; |
||||
|
||||
/** |
||||
* seata 服务组格式 |
||||
* |
||||
* @param appName 服务名 |
||||
* @return group |
||||
*/ |
||||
static String seataServiceGroup(String appName) { |
||||
return appName.concat(GROUP_NAME); |
||||
} |
||||
|
||||
/** |
||||
* 动态获取nacos地址 |
||||
* |
||||
* @param profile 环境变量 |
||||
* @return addr |
||||
*/ |
||||
static String nacosAddr(String profile) { |
||||
switch (profile) { |
||||
case (AppConstant.PROD_CODE): |
||||
return NACOS_PROD_ADDR; |
||||
case (AppConstant.TEST_CODE): |
||||
return NACOS_TEST_ADDR; |
||||
default: |
||||
return NACOS_DEV_ADDR; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 动态获取sentinel地址 |
||||
* |
||||
* @param profile 环境变量 |
||||
* @return addr |
||||
*/ |
||||
static String sentinelAddr(String profile) { |
||||
switch (profile) { |
||||
case (AppConstant.PROD_CODE): |
||||
return SENTINEL_PROD_ADDR; |
||||
case (AppConstant.TEST_CODE): |
||||
return SENTINEL_TEST_ADDR; |
||||
default: |
||||
return SENTINEL_DEV_ADDR; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 动态获取seata地址 |
||||
* |
||||
* @param profile 环境变量 |
||||
* @return addr |
||||
*/ |
||||
static String seataAddr(String profile) { |
||||
switch (profile) { |
||||
case (AppConstant.PROD_CODE): |
||||
return SEATA_PROD_ADDR; |
||||
case (AppConstant.TEST_CODE): |
||||
return SEATA_TEST_ADDR; |
||||
default: |
||||
return SEATA_DEV_ADDR; |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,33 @@
|
||||
package com.hnac.hzims.common.invalid; |
||||
|
||||
import javax.validation.Constraint; |
||||
import javax.validation.Payload; |
||||
import java.lang.annotation.*; |
||||
|
||||
/** |
||||
* @author hx |
||||
*/ |
||||
|
||||
@Documented |
||||
@Retention(RetentionPolicy.RUNTIME) |
||||
@Target({ElementType.FIELD, ElementType.ANNOTATION_TYPE,ElementType.PARAMETER}) |
||||
@Constraint(validatedBy = DictInvalidator.class) |
||||
public @interface DictInvalid { |
||||
|
||||
Class<?>[] groups() default { }; |
||||
|
||||
Class<? extends Payload>[] payload() default { }; |
||||
|
||||
String attribute() default ""; |
||||
/** |
||||
* 字典key |
||||
* @return |
||||
*/ |
||||
String dictKey() default ""; |
||||
|
||||
/** |
||||
* 提示信息 |
||||
* @return |
||||
*/ |
||||
String message() default "传入参数不符合字典状态"; |
||||
} |
@ -0,0 +1,64 @@
|
||||
package com.hnac.hzims.common.invalid; |
||||
|
||||
import lombok.SneakyThrows; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.tool.utils.ObjectUtil; |
||||
import org.springblade.core.tool.utils.StringUtil; |
||||
import org.springblade.system.cache.DictCache; |
||||
|
||||
import javax.validation.ConstraintValidator; |
||||
import javax.validation.ConstraintValidatorContext; |
||||
import java.lang.reflect.Field; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author hx |
||||
*/ |
||||
@Slf4j |
||||
public class DictInvalidator implements ConstraintValidator<DictInvalid,Object> { |
||||
|
||||
private String dictKey; |
||||
private String attribute; |
||||
|
||||
@Override |
||||
public void initialize(DictInvalid constraintAnnotation) { |
||||
dictKey = constraintAnnotation.dictKey(); |
||||
attribute = constraintAnnotation.attribute(); |
||||
} |
||||
|
||||
@SneakyThrows |
||||
@Override |
||||
public boolean isValid(Object object, ConstraintValidatorContext context) { |
||||
//直接放行用在controller层上的内容
|
||||
if(StringUtil.isNotBlank(attribute)){ |
||||
return true; |
||||
} |
||||
Integer value = null; |
||||
try{ |
||||
value = Integer.parseInt((String) object); |
||||
} |
||||
catch (Exception e){ |
||||
e.printStackTrace(); |
||||
return false; |
||||
} |
||||
String name = DictCache.getValue(dictKey,value); |
||||
return StringUtil.isNotBlank(name); |
||||
} |
||||
|
||||
public Object getFieldValue(Object object,String fieldName) throws IllegalAccessException { |
||||
Class clazz = object.getClass(); |
||||
if(object instanceof Map){ |
||||
return ((Map) object).get(fieldName); |
||||
} |
||||
while (ObjectUtil.isNotEmpty(clazz.getSuperclass())) { |
||||
for (Field field : clazz.getDeclaredFields()) { |
||||
if(fieldName.equals(field.getName())){ |
||||
field.setAccessible(true); |
||||
return field.get(object); |
||||
} |
||||
} |
||||
clazz = clazz.getSuperclass(); |
||||
} |
||||
return null; |
||||
} |
||||
} |
@ -0,0 +1,27 @@
|
||||
package com.hnac.hzims.common.invalid; |
||||
|
||||
import javax.validation.Constraint; |
||||
import javax.validation.Payload; |
||||
import java.lang.annotation.*; |
||||
|
||||
/** |
||||
* @author hx |
||||
*/ |
||||
@Documented |
||||
@Retention(RetentionPolicy.RUNTIME) |
||||
@Target({ElementType.FIELD, ElementType.ANNOTATION_TYPE,ElementType.PARAMETER}) |
||||
@Constraint(validatedBy = ObjectRequiredInvalidator.class) |
||||
public @interface ObjectRequiredInvalid { |
||||
|
||||
Class<?>[] groups() default { }; |
||||
|
||||
Class<? extends Payload>[] payload() default { }; |
||||
/** |
||||
* 对象属性校验必填 |
||||
* @return |
||||
*/ |
||||
String[] attributes() default {}; |
||||
|
||||
String message() default "传入参数不符合要求"; |
||||
|
||||
} |
@ -0,0 +1,66 @@
|
||||
package com.hnac.hzims.common.invalid; |
||||
|
||||
import lombok.SneakyThrows; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.tool.utils.ObjectUtil; |
||||
|
||||
import javax.validation.ConstraintValidator; |
||||
import javax.validation.ConstraintValidatorContext; |
||||
import java.lang.reflect.Field; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author hx |
||||
*/ |
||||
@Slf4j |
||||
public class ObjectRequiredInvalidator implements ConstraintValidator<ObjectRequiredInvalid,Object> { |
||||
|
||||
private String[] attributes; |
||||
|
||||
@Override |
||||
public void initialize(ObjectRequiredInvalid constraintAnnotation) { |
||||
attributes = constraintAnnotation.attributes(); |
||||
} |
||||
|
||||
@SneakyThrows |
||||
@Override |
||||
public boolean isValid(Object object, ConstraintValidatorContext context) { |
||||
//判断是否有子属性;子属性按.区分
|
||||
for(String attribute : attributes){ |
||||
Object value = object; |
||||
String[] singleAttributes = attribute.split("\\."); |
||||
for(String singleAttribute : singleAttributes) { |
||||
if(value instanceof Map){ |
||||
value = ((Map)value).get(singleAttribute); |
||||
} |
||||
else { |
||||
value = getFieldValue(value,singleAttribute); |
||||
if(ObjectUtil.isEmpty(value)){ |
||||
return false; |
||||
} |
||||
} |
||||
} |
||||
if(ObjectUtil.isEmpty(value)){ |
||||
return false; |
||||
} |
||||
} |
||||
return true; |
||||
} |
||||
|
||||
public Object getFieldValue(Object object,String fieldName) throws IllegalAccessException { |
||||
Class clazz = object.getClass(); |
||||
if(object instanceof Map){ |
||||
return ((Map) object).get(fieldName); |
||||
} |
||||
while (ObjectUtil.isNotEmpty(clazz.getSuperclass())) { |
||||
for (Field field : clazz.getDeclaredFields()) { |
||||
if(fieldName.equals(field.getName())){ |
||||
field.setAccessible(true); |
||||
return field.get(object); |
||||
} |
||||
} |
||||
clazz = clazz.getSuperclass(); |
||||
} |
||||
return null; |
||||
} |
||||
} |
@ -0,0 +1,66 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package com.hnac.hzims.common.launch; |
||||
|
||||
import com.hnac.hzims.common.constant.LauncherConstant; |
||||
import org.springblade.core.auto.service.AutoService; |
||||
import org.springblade.core.launch.constant.AppConstant; |
||||
import org.springblade.core.launch.service.LauncherService; |
||||
import org.springblade.core.launch.utils.PropsUtil; |
||||
import org.springframework.boot.builder.SpringApplicationBuilder; |
||||
|
||||
import java.util.Properties; |
||||
|
||||
/** |
||||
* 启动参数拓展 |
||||
* |
||||
* @author smallchil |
||||
*/ |
||||
@AutoService(LauncherService.class) |
||||
public class LauncherServiceImpl implements LauncherService { |
||||
|
||||
@Override |
||||
public void launcher(SpringApplicationBuilder builder, String appName, String profile, boolean isLocalDev) { |
||||
Properties props = System.getProperties(); |
||||
// 通用注册
|
||||
PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.server-addr", LauncherConstant.nacosAddr(profile)); |
||||
PropsUtil.setProperty(props, "spring.cloud.nacos.config.server-addr", LauncherConstant.nacosAddr(profile)); |
||||
PropsUtil.setProperty(props, "spring.cloud.sentinel.transport.dashboard", LauncherConstant.sentinelAddr(profile)); |
||||
|
||||
// dubbo注册
|
||||
PropsUtil.setProperty(props, "dubbo.application.name", appName); |
||||
PropsUtil.setProperty(props, "dubbo.application.qos.enable", "false"); |
||||
PropsUtil.setProperty(props, "dubbo.protocol.name", "dubbo"); |
||||
PropsUtil.setProperty(props, "dubbo.registry.address", "nacos://" + LauncherConstant.nacosAddr(profile)); |
||||
PropsUtil.setProperty(props, "dubbo.version", AppConstant.APPLICATION_VERSION); |
||||
PropsUtil.setProperty(props, "dubbo.scan.base-packages", AppConstant.BASE_PACKAGES); |
||||
|
||||
// seata注册地址
|
||||
PropsUtil.setProperty(props, "seata.service.grouplist.default", LauncherConstant.seataAddr(profile)); |
||||
// seata注册group格式
|
||||
PropsUtil.setProperty(props, "seata.tx-service-group", LauncherConstant.seataServiceGroup(appName)); |
||||
// seata配置服务group
|
||||
PropsUtil.setProperty(props, "seata.service.vgroup-mapping.".concat(LauncherConstant.seataServiceGroup(appName)), LauncherConstant.DEFAULT_MODE); |
||||
// seata注册模式配置
|
||||
// PropsUtil.setProperty(props, "seata.registry.type", LauncherConstant.NACOS_MODE);
|
||||
// PropsUtil.setProperty(props, "seata.registry.nacos.server-addr", LauncherConstant.nacosAddr(profile));
|
||||
// PropsUtil.setProperty(props, "seata.config.type", LauncherConstant.NACOS_MODE);
|
||||
// PropsUtil.setProperty(props, "seata.config.nacos.server-addr", LauncherConstant.nacosAddr(profile));
|
||||
|
||||
} |
||||
|
||||
} |
@ -0,0 +1,55 @@
|
||||
package com.hnac.hzims.common.logs.annotation; |
||||
|
||||
import com.hnac.hzims.common.logs.enums.BusinessType; |
||||
import com.hnac.hzims.common.logs.enums.OperatorType; |
||||
|
||||
import java.lang.annotation.*; |
||||
|
||||
/** |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/3/29 11:38 |
||||
*/ |
||||
@Documented |
||||
@Retention(RetentionPolicy.RUNTIME) |
||||
@Target({ ElementType.PARAMETER, ElementType.METHOD }) |
||||
public @interface OperationAnnotation { |
||||
|
||||
|
||||
/** |
||||
* 功能模块 |
||||
*/ |
||||
String moduleName() default "功能模块"; |
||||
|
||||
|
||||
/** |
||||
* 操作模块 |
||||
* @return |
||||
*/ |
||||
String title() default "操作模块"; |
||||
|
||||
/** |
||||
* 系统类型(网页端,app端) |
||||
*/ |
||||
OperatorType operatorType() default OperatorType.OTHER; |
||||
|
||||
|
||||
/** |
||||
* 操作类型 |
||||
* @return |
||||
*/ |
||||
BusinessType businessType() default BusinessType.OTHER; |
||||
|
||||
|
||||
/** |
||||
* 是否保存响应的参数 |
||||
*/ |
||||
public boolean isSaveResponseData() default true; |
||||
|
||||
/** |
||||
* 功能说明 |
||||
* @return |
||||
*/ |
||||
String action() default "功能说明"; |
||||
} |
@ -0,0 +1,269 @@
|
||||
package com.hnac.hzims.common.logs.aop; |
||||
|
||||
import com.alibaba.fastjson.JSON; |
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
||||
import com.hnac.hzims.common.logs.annotation.OperationAnnotation; |
||||
import com.hnac.hzims.common.logs.consumer.SysLogQueue; |
||||
import com.hnac.hzims.common.logs.to.SysLogTo; |
||||
import com.hnac.hzims.common.logs.enums.BusinessStatus; |
||||
import com.hnac.hzims.common.logs.utils.StringUtils; |
||||
import com.hnac.hzims.common.logs.utils.WebIpUtils; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.aspectj.lang.JoinPoint; |
||||
import org.aspectj.lang.annotation.*; |
||||
import org.aspectj.lang.reflect.CodeSignature; |
||||
import org.springblade.core.launch.props.BladeProperties; |
||||
import org.springblade.core.launch.server.ServerInfo; |
||||
import org.springblade.core.secure.utils.AuthUtil; |
||||
import org.springblade.core.tool.constant.BladeConstant; |
||||
import org.springblade.core.tool.utils.Func; |
||||
import org.springblade.core.tool.utils.WebUtil; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.core.NamedThreadLocal; |
||||
import org.springframework.stereotype.Component; |
||||
import org.springframework.util.StopWatch; |
||||
import org.springframework.web.context.request.RequestAttributes; |
||||
import org.springframework.web.context.request.RequestContextHolder; |
||||
import org.springframework.web.context.request.ServletRequestAttributes; |
||||
|
||||
import javax.servlet.http.HttpServletRequest; |
||||
import java.lang.reflect.Method; |
||||
import java.time.LocalDateTime; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author dfy |
||||
* @date 2023/3/29 |
||||
* @description: 操作日志切面处理类 |
||||
*/ |
||||
@Aspect |
||||
@Component |
||||
@Slf4j |
||||
public class SysLogAspect { |
||||
|
||||
|
||||
@Autowired |
||||
private ServerInfo serverInfo; |
||||
|
||||
|
||||
@Autowired |
||||
private BladeProperties bladeProperties; |
||||
|
||||
|
||||
@Autowired |
||||
private SysLogQueue sysLogQueue; |
||||
|
||||
|
||||
//private StopWatch stopWatch = new StopWatch();
|
||||
|
||||
|
||||
private static final ThreadLocal<Long> TIME_THREADLOCAL = new NamedThreadLocal<>("Cost Time"); |
||||
|
||||
|
||||
/** |
||||
* 设置操作日志切入点 在注解的位置切入代码 |
||||
*/ |
||||
@Pointcut("@annotation(com.hnac.hzims.common.logs.annotation.OperationAnnotation)") |
||||
public void logPointCut() { |
||||
} |
||||
|
||||
/** |
||||
* @param joinPoint |
||||
* @Description 前置通知 方法调用前触发 记录开始时间,从session中获取操作人 |
||||
*/ |
||||
@Before(value = "logPointCut()") |
||||
public void before(JoinPoint joinPoint) { |
||||
// if (!stopWatch.isRunning()) {
|
||||
// stopWatch.start();
|
||||
// }
|
||||
//startTime = System.currentTimeMillis();
|
||||
TIME_THREADLOCAL.set(System.currentTimeMillis()); |
||||
log.info("前置通知"); |
||||
} |
||||
|
||||
/** |
||||
* @param joinPoint |
||||
* @Description 后置通知 方法调用后触发 记录结束时间 ,操作人 ,入参等 |
||||
*/ |
||||
@AfterReturning(value = "logPointCut()", returning = "jsonResult") |
||||
public void after(JoinPoint joinPoint, Object jsonResult) { |
||||
log.info("=========返回通知=============="); |
||||
try { |
||||
handleLog(joinPoint, jsonResult, null); |
||||
} catch (Exception e) { |
||||
log.error("异常信息:{}", e.getMessage()); |
||||
e.printStackTrace(); |
||||
} finally { |
||||
TIME_THREADLOCAL.remove(); |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* @param joinPoint |
||||
* @return |
||||
* @Description 获取入参方法参数 |
||||
*/ |
||||
public Map<String, Object> getNameAndValue(JoinPoint joinPoint) { |
||||
Map<String, Object> param = new HashMap<>(16); |
||||
Object[] paramValues = joinPoint.getArgs(); |
||||
String[] paramNames = ((CodeSignature) joinPoint.getSignature()).getParameterNames(); |
||||
for (int i = 0; i < paramNames.length; i++) { |
||||
if (paramValues[i] instanceof Integer || paramValues[i] instanceof String) { |
||||
param.put(paramNames[i], paramValues[i]); |
||||
} |
||||
} |
||||
return param; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* @Description: 获取request |
||||
*/ |
||||
public HttpServletRequest getHttpServletRequest() { |
||||
RequestAttributes ra = RequestContextHolder.getRequestAttributes(); |
||||
ServletRequestAttributes sra = (ServletRequestAttributes) ra; |
||||
HttpServletRequest request = sra.getRequest(); |
||||
return request; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* @param joinPoint |
||||
* @Description 异常通知 |
||||
*/ |
||||
@AfterThrowing(pointcut = "logPointCut()", throwing = "e") |
||||
public void throwing(JoinPoint joinPoint, Exception e) { |
||||
log.info("=========异常通知=============="); |
||||
try { |
||||
handleLog(joinPoint, null, e); |
||||
} catch (Exception exception) { |
||||
log.error("异常信息:{}", exception.getMessage()); |
||||
e.printStackTrace(); |
||||
} finally { |
||||
TIME_THREADLOCAL.remove(); |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 转换request 请求参数 |
||||
* |
||||
* @param paramMap request获取的参数数组 |
||||
*/ |
||||
public Map<String, String> converMap(Map<String, String[]> paramMap) { |
||||
Map<String, String> rtnMap = new HashMap<String, String>(); |
||||
for (String key : paramMap.keySet()) { |
||||
rtnMap.put(key, paramMap.get(key)[0]); |
||||
} |
||||
return rtnMap; |
||||
} |
||||
|
||||
/** |
||||
* 转换异常信息为字符串 |
||||
* |
||||
* @param exceptionName 异常名称 |
||||
* @param exceptionMessage 异常信息 |
||||
* @param elements 堆栈信息 |
||||
*/ |
||||
public String stackTraceToString(String exceptionName, String exceptionMessage, StackTraceElement[] elements) { |
||||
StringBuffer strbuff = new StringBuffer(); |
||||
for (StackTraceElement stet : elements) { |
||||
strbuff.append(stet + "\n"); |
||||
} |
||||
String message = exceptionName + ":" + exceptionMessage + "\n\t" + strbuff.toString(); |
||||
return message; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 处理操作日志结果集 |
||||
* |
||||
* @param joinPoint |
||||
* @param jsonResult |
||||
* @param exception |
||||
*/ |
||||
private void handleLog(JoinPoint joinPoint, Object jsonResult, Exception exception) { |
||||
String targetName = joinPoint.getTarget().getClass().getName(); |
||||
String methodName = joinPoint.getSignature().getName(); |
||||
Object[] arguments = joinPoint.getArgs(); |
||||
Class<?> targetClass = null; |
||||
try { |
||||
targetClass = Class.forName(targetName); |
||||
} catch (ClassNotFoundException e) { |
||||
e.printStackTrace(); |
||||
} |
||||
Method[] methods = targetClass.getMethods(); |
||||
String title; |
||||
String action; |
||||
String businessType; |
||||
String operatorType; |
||||
String moduleName; |
||||
Class<?>[] clazzs; |
||||
for (Method method : methods) { |
||||
if (method.getName().equals(methodName)) { |
||||
clazzs = method.getParameterTypes(); |
||||
if (clazzs != null && clazzs.length == arguments.length && method.getAnnotation(OperationAnnotation.class) != null) { |
||||
// 获取请求的类名
|
||||
String className = joinPoint.getTarget().getClass().getName(); |
||||
methodName = className + "." + methodName; |
||||
HttpServletRequest request = getHttpServletRequest(); |
||||
String requestPath = request.getServletPath(); |
||||
OperationAnnotation annotation = method.getAnnotation(OperationAnnotation.class); |
||||
title = annotation.title(); |
||||
action = annotation.action(); |
||||
businessType = annotation.businessType().getValue(); |
||||
operatorType = annotation.operatorType().getValue(); |
||||
moduleName = annotation.moduleName(); |
||||
// 获取当前用户信息
|
||||
String userName = AuthUtil.getUserAccount(request); |
||||
Long userId = AuthUtil.getUserId(request); |
||||
SysLogTo sysLog = new SysLogTo(); |
||||
if (StringUtils.isBlank(userName) && userId == -1) { |
||||
userName = "当前用户未登录"; |
||||
} |
||||
sysLog.setModuleName(moduleName); |
||||
sysLog.setOperationUserName(userName); |
||||
sysLog.setOperationUserId(userId); |
||||
sysLog.setTenantId(Func.toStr(AuthUtil.getTenantId(), BladeConstant.ADMIN_TENANT_ID)); |
||||
sysLog.setLocalIp(WebIpUtils.getIpAddr(request));// 请求IP
|
||||
// if (stopWatch.isRunning()) {
|
||||
// stopWatch.stop();
|
||||
// }
|
||||
long endTime = System.currentTimeMillis(); |
||||
sysLog.setCostTime((endTime - TIME_THREADLOCAL.get()) + "ms"); |
||||
sysLog.setPath(requestPath); |
||||
sysLog.setTitle(title); |
||||
sysLog.setAction(action); |
||||
sysLog.setOperatorType(operatorType); |
||||
sysLog.setBusinessType(businessType); |
||||
sysLog.setParameter(getNameAndValue(joinPoint).toString()); |
||||
sysLog.setMethodClass(className); |
||||
sysLog.setMethodName(methodName); |
||||
sysLog.setServerName(bladeProperties.getName()); |
||||
sysLog.setServerHost(serverInfo.getHostName()); |
||||
sysLog.setServerIp(serverInfo.getIpWithPort()); |
||||
sysLog.setEnv(bladeProperties.getEnv()); |
||||
sysLog.setMethod(request.getMethod()); |
||||
sysLog.setUserAgent(request.getHeader(WebUtil.USER_AGENT_HEADER)); |
||||
sysLog.setOperationTime(LocalDateTime.now()); |
||||
|
||||
//返回结果集
|
||||
if (ObjectUtils.isNotEmpty(jsonResult)) { |
||||
sysLog.setStatus(BusinessStatus.SUCCESS.getKey()); |
||||
sysLog.setJsonResult(StringUtils.substring(JSON.toJSONString(jsonResult), 0, 2000)); |
||||
} |
||||
|
||||
//异常结果集
|
||||
if (exception != null) { |
||||
sysLog.setStatus(BusinessStatus.FAIL.getKey()); |
||||
sysLog.setErrorMsg(StringUtils.substring(exception.getMessage(), 0, 2000)); |
||||
} |
||||
//保存到阻塞队列里
|
||||
sysLogQueue.add(sysLog); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,119 @@
|
||||
package com.hnac.hzims.common.logs.consumer; |
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
||||
import com.hnac.hzims.common.logs.to.SysLogTo; |
||||
import com.hnac.hzims.common.logs.fegin.SysLogFeignService; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
import javax.annotation.PostConstruct; |
||||
import javax.annotation.PreDestroy; |
||||
import javax.annotation.Resource; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 执行异步线程操作 |
||||
* @Author dfy |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/4/3 14:00 |
||||
*/ |
||||
@Slf4j |
||||
@Component |
||||
public class SysLogConsumer implements Runnable { |
||||
|
||||
/** |
||||
* 默认16 |
||||
*/ |
||||
private static final int DEFAULT_BATCH_SIZE = 1000; |
||||
|
||||
@Resource |
||||
private SysLogQueue auditLogQueue; |
||||
/** |
||||
* 批次数 |
||||
*/ |
||||
private int batchSize = DEFAULT_BATCH_SIZE; |
||||
|
||||
@Autowired |
||||
private SysLogFeignService sysLogFeignService; |
||||
|
||||
|
||||
/** |
||||
* 默认为true |
||||
*/ |
||||
private boolean active = true; |
||||
|
||||
private Thread thread; |
||||
|
||||
|
||||
/** |
||||
* 启动线程 |
||||
*/ |
||||
@PostConstruct |
||||
public void init() { |
||||
thread = new Thread(this); |
||||
thread.start(); |
||||
thread.setName("SysLogConsumer"); |
||||
} |
||||
|
||||
/** |
||||
* 使用该注解在项目结束的舒缓关闭 |
||||
*/ |
||||
@PreDestroy |
||||
public void close() { |
||||
active = false; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 执行线程操作 |
||||
*/ |
||||
@Override |
||||
public void run() { |
||||
while (active) { |
||||
execute(); |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 执行业务处理操作,新增日志记录 |
||||
*/ |
||||
public void execute() { |
||||
List<SysLogTo> sysLogs = new ArrayList<>(); |
||||
try { |
||||
int size = 0; |
||||
while (size < batchSize) { |
||||
//从队列中取出一个
|
||||
SysLogTo sysLog = auditLogQueue.poll(); |
||||
if (sysLog == null) { |
||||
break; |
||||
} |
||||
sysLogs.add(sysLog); |
||||
size++; |
||||
} |
||||
} catch (InterruptedException e) { |
||||
e.printStackTrace(); |
||||
log.error(e.toString()); |
||||
} |
||||
//如果当前的日志list不为空
|
||||
if (CollectionUtils.isNotEmpty(sysLogs)) { |
||||
log.info("日志操作数据:" + sysLogs); |
||||
// TODO: 2023/4/4 添加到数据库
|
||||
try { |
||||
// TODO: 2023/4/4 后期采取kafka+elk实现,可以提高效率,操作日志数据越来越大,查询效率变大,提高性能
|
||||
sysLogFeignService.saveBatch(sysLogs); |
||||
} catch (Exception e) { |
||||
// TODO: 2023/4/4 出现异常呢,
|
||||
e.printStackTrace(); |
||||
} |
||||
|
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
} |
@ -0,0 +1,43 @@
|
||||
package com.hnac.hzims.common.logs.consumer; |
||||
|
||||
import com.hnac.hzims.common.logs.to.SysLogTo; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
import java.util.concurrent.BlockingQueue; |
||||
import java.util.concurrent.LinkedBlockingQueue; |
||||
import java.util.concurrent.TimeUnit; |
||||
|
||||
/** |
||||
* 定义队列 |
||||
* @Author dfy |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/4/3 14:01 |
||||
*/ |
||||
@Component |
||||
public class SysLogQueue { |
||||
|
||||
/** |
||||
* BlockingDequeue为双端阻塞队列,blockingQueue阻塞队列 |
||||
*/ |
||||
private BlockingQueue<SysLogTo> blockingQueue = new LinkedBlockingQueue<>(); |
||||
|
||||
/** |
||||
* 存入数据 |
||||
* @param auditLog |
||||
*/ |
||||
public void add(SysLogTo auditLog) { |
||||
blockingQueue.offer(auditLog); |
||||
} |
||||
|
||||
/** |
||||
* poll从队列的头部获取到信息 |
||||
* @return |
||||
* @throws InterruptedException |
||||
*/ |
||||
public SysLogTo poll() throws InterruptedException { |
||||
//每秒钟执行一次
|
||||
return blockingQueue.poll(1, TimeUnit.SECONDS); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,33 @@
|
||||
package com.hnac.hzims.common.logs.enums; |
||||
|
||||
import lombok.Getter; |
||||
|
||||
/** |
||||
* 操作状态 |
||||
* |
||||
* @author ruoyi |
||||
* |
||||
*/ |
||||
public enum BusinessStatus |
||||
{ |
||||
/** |
||||
* 成功 |
||||
*/ |
||||
SUCCESS(0,"执行成功"), |
||||
|
||||
/** |
||||
* 异常 |
||||
*/ |
||||
FAIL(1,"执行异常"); |
||||
|
||||
@Getter |
||||
private Integer key; |
||||
|
||||
@Getter |
||||
private String value; |
||||
|
||||
BusinessStatus(Integer key,String value){ |
||||
this.key = key; |
||||
this.value = value; |
||||
} |
||||
} |
@ -0,0 +1,73 @@
|
||||
package com.hnac.hzims.common.logs.enums; |
||||
|
||||
|
||||
import lombok.Getter; |
||||
|
||||
/** |
||||
* 业务操作类型 |
||||
* |
||||
* @author ruoyi |
||||
*/ |
||||
public enum BusinessType |
||||
{ |
||||
/** |
||||
* 其它 |
||||
*/ |
||||
OTHER("OTHER","其他"), |
||||
|
||||
/** |
||||
* 新增 |
||||
*/ |
||||
INSERT("INSERT","新增"), |
||||
|
||||
/** |
||||
* 修改 |
||||
*/ |
||||
UPDATE("UPDATE","修改"), |
||||
|
||||
/** |
||||
* 删除 |
||||
*/ |
||||
DELETE("DELETE","删除"), |
||||
|
||||
/** |
||||
* 授权 |
||||
*/ |
||||
GRANT("GRANT","授权"), |
||||
|
||||
/** |
||||
* 导出 |
||||
*/ |
||||
EXPORT("EXPORT","导出"), |
||||
|
||||
/** |
||||
* 导入 |
||||
*/ |
||||
IMPORT("IMPORT","导入"), |
||||
|
||||
/** |
||||
* 强退 |
||||
*/ |
||||
FORCE("FORCE","强退"), |
||||
|
||||
/** |
||||
* 查询 |
||||
*/ |
||||
GENCODE("GENCODE","查询"), |
||||
|
||||
/** |
||||
* 清空数据 |
||||
*/ |
||||
CLEAN("CLEAN","清空数据"); |
||||
|
||||
@Getter |
||||
private String key; |
||||
|
||||
@Getter |
||||
private String value; |
||||
|
||||
BusinessType(String key,String value){ |
||||
this.key = key; |
||||
this.value = value; |
||||
} |
||||
} |
@ -0,0 +1,45 @@
|
||||
package com.hnac.hzims.common.logs.enums; |
||||
|
||||
import lombok.Getter; |
||||
|
||||
/** |
||||
* 操作人类别 |
||||
* |
||||
* @author ruoyi |
||||
*/ |
||||
public enum OperatorType |
||||
{ |
||||
/** |
||||
* 其它 |
||||
*/ |
||||
OTHER("OTHER","其它"), |
||||
|
||||
/** |
||||
* 后台用户 |
||||
*/ |
||||
MANAGE("MANAGE","后台用户"), |
||||
|
||||
/** |
||||
* web 端 |
||||
*/ |
||||
MOBILE("MOBILE","web端"), |
||||
/** |
||||
* app 端 |
||||
*/ |
||||
APPSYSTEMS("APPSYSTEMS","app端"); |
||||
|
||||
|
||||
@Getter |
||||
private String key; |
||||
|
||||
@Getter |
||||
private String value; |
||||
|
||||
|
||||
OperatorType(String key,String value){ |
||||
this.key = key; |
||||
this.value = value; |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,29 @@
|
||||
package com.hnac.hzims.common.logs.fegin; |
||||
|
||||
import com.hnac.hzims.common.logs.to.SysLogTo; |
||||
import com.hnac.hzims.common.logs.fegin.fallback.SysLogFeignServiceFallback; |
||||
import org.springframework.cloud.openfeign.FeignClient; |
||||
import org.springframework.stereotype.Repository; |
||||
import org.springframework.web.bind.annotation.PostMapping; |
||||
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/4/3 13:46 |
||||
*/ |
||||
@Repository |
||||
@FeignClient(value = "hzims-middle",fallback = SysLogFeignServiceFallback.class) |
||||
public interface SysLogFeignService { |
||||
|
||||
/** |
||||
* 报存日志操作 |
||||
* |
||||
* @param sysLogs |
||||
*/ |
||||
@PostMapping("/systemlog/sys-log/batchSave") |
||||
void saveBatch(@RequestBody List<SysLogTo> sysLogs); |
||||
} |
@ -0,0 +1,30 @@
|
||||
package com.hnac.hzims.common.logs.fegin.fallback; |
||||
|
||||
import com.hnac.hzims.common.logs.to.SysLogTo; |
||||
import com.hnac.hzims.common.logs.fegin.SysLogFeignService; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/4/4 9:45 |
||||
*/ |
||||
@Slf4j |
||||
@Service |
||||
public class SysLogFeignServiceFallback implements SysLogFeignService { |
||||
/** |
||||
* 报存日志操作 |
||||
* |
||||
* @param sysLogs |
||||
*/ |
||||
@Override |
||||
public void saveBatch(List<SysLogTo> sysLogs) { |
||||
log.error("报存日志操作异常发生,进入fallback方法"); |
||||
log.error("获取异常的数据 {}", sysLogs); |
||||
throw new IllegalArgumentException("报存日志操作异常发生,进入fallback方法"); |
||||
} |
||||
} |
@ -0,0 +1,88 @@
|
||||
package com.hnac.hzims.common.logs.text; |
||||
|
||||
|
||||
import com.hnac.hzims.common.logs.utils.StringUtils; |
||||
|
||||
import java.nio.charset.Charset; |
||||
import java.nio.charset.StandardCharsets; |
||||
|
||||
/** |
||||
* 字符集工具类 |
||||
* |
||||
* @author dfy |
||||
*/ |
||||
public class CharsetKit |
||||
{ |
||||
/** ISO-8859-1 */ |
||||
public static final String ISO_8859_1 = "ISO-8859-1"; |
||||
/** UTF-8 */ |
||||
public static final String UTF_8 = "UTF-8"; |
||||
/** GBK */ |
||||
public static final String GBK = "GBK"; |
||||
|
||||
/** ISO-8859-1 */ |
||||
public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1); |
||||
/** UTF-8 */ |
||||
public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8); |
||||
/** GBK */ |
||||
public static final Charset CHARSET_GBK = Charset.forName(GBK); |
||||
|
||||
/** |
||||
* 转换为Charset对象 |
||||
* |
||||
* @param charset 字符集,为空则返回默认字符集 |
||||
* @return Charset |
||||
*/ |
||||
public static Charset charset(String charset) |
||||
{ |
||||
return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset); |
||||
} |
||||
|
||||
/** |
||||
* 转换字符串的字符集编码 |
||||
* |
||||
* @param source 字符串 |
||||
* @param srcCharset 源字符集,默认ISO-8859-1 |
||||
* @param destCharset 目标字符集,默认UTF-8 |
||||
* @return 转换后的字符集 |
||||
*/ |
||||
public static String convert(String source, String srcCharset, String destCharset) |
||||
{ |
||||
return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset)); |
||||
} |
||||
|
||||
/** |
||||
* 转换字符串的字符集编码 |
||||
* |
||||
* @param source 字符串 |
||||
* @param srcCharset 源字符集,默认ISO-8859-1 |
||||
* @param destCharset 目标字符集,默认UTF-8 |
||||
* @return 转换后的字符集 |
||||
*/ |
||||
public static String convert(String source, Charset srcCharset, Charset destCharset) |
||||
{ |
||||
if (null == srcCharset) |
||||
{ |
||||
srcCharset = StandardCharsets.ISO_8859_1; |
||||
} |
||||
|
||||
if (null == destCharset) |
||||
{ |
||||
destCharset = StandardCharsets.UTF_8; |
||||
} |
||||
|
||||
if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset)) |
||||
{ |
||||
return source; |
||||
} |
||||
return new String(source.getBytes(srcCharset), destCharset); |
||||
} |
||||
|
||||
/** |
||||
* @return 系统字符集编码 |
||||
*/ |
||||
public static String systemCharset() |
||||
{ |
||||
return Charset.defaultCharset().name(); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,93 @@
|
||||
package com.hnac.hzims.common.logs.text; |
||||
|
||||
|
||||
import com.hnac.hzims.common.logs.utils.StringUtils; |
||||
|
||||
/** |
||||
* 字符串格式化 |
||||
* |
||||
* @author ruoyi |
||||
*/ |
||||
public class StrFormatter |
||||
{ |
||||
public static final String EMPTY_JSON = "{}"; |
||||
public static final char C_BACKSLASH = '\\'; |
||||
public static final char C_DELIM_START = '{'; |
||||
public static final char C_DELIM_END = '}'; |
||||
|
||||
/** |
||||
* 格式化字符串<br> |
||||
* 此方法只是简单将占位符 {} 按照顺序替换为参数<br> |
||||
* 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br> |
||||
* 例:<br> |
||||
* 通常使用:format("this is {} for {}", "a", "b") -> this is a for b<br> |
||||
* 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a<br> |
||||
* 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br> |
||||
* |
||||
* @param strPattern 字符串模板 |
||||
* @param argArray 参数列表 |
||||
* @return 结果 |
||||
*/ |
||||
public static String format(final String strPattern, final Object... argArray) |
||||
{ |
||||
if (StringUtils.isEmpty(strPattern) || StringUtils.isEmpty(argArray)) |
||||
{ |
||||
return strPattern; |
||||
} |
||||
final int strPatternLength = strPattern.length(); |
||||
|
||||
// 初始化定义好的长度以获得更好的性能
|
||||
StringBuilder sbuf = new StringBuilder(strPatternLength + 50); |
||||
|
||||
int handledPosition = 0; |
||||
int delimIndex;// 占位符所在位置
|
||||
for (int argIndex = 0; argIndex < argArray.length; argIndex++) |
||||
{ |
||||
delimIndex = strPattern.indexOf(EMPTY_JSON, handledPosition); |
||||
if (delimIndex == -1) |
||||
{ |
||||
if (handledPosition == 0) |
||||
{ |
||||
return strPattern; |
||||
} |
||||
else |
||||
{ // 字符串模板剩余部分不再包含占位符,加入剩余部分后返回结果
|
||||
sbuf.append(strPattern, handledPosition, strPatternLength); |
||||
return sbuf.toString(); |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
if (delimIndex > 0 && strPattern.charAt(delimIndex - 1) == C_BACKSLASH) |
||||
{ |
||||
if (delimIndex > 1 && strPattern.charAt(delimIndex - 2) == C_BACKSLASH) |
||||
{ |
||||
// 转义符之前还有一个转义符,占位符依旧有效
|
||||
sbuf.append(strPattern, handledPosition, delimIndex - 1); |
||||
sbuf.append(Convert.utf8Str(argArray[argIndex])); |
||||
handledPosition = delimIndex + 2; |
||||
} |
||||
else |
||||
{ |
||||
// 占位符被转义
|
||||
argIndex--; |
||||
sbuf.append(strPattern, handledPosition, delimIndex - 1); |
||||
sbuf.append(C_DELIM_START); |
||||
handledPosition = delimIndex + 1; |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
// 正常占位符
|
||||
sbuf.append(strPattern, handledPosition, delimIndex); |
||||
sbuf.append(Convert.utf8Str(argArray[argIndex])); |
||||
handledPosition = delimIndex + 2; |
||||
} |
||||
} |
||||
} |
||||
// 加入最后一个占位符后所有的字符
|
||||
sbuf.append(strPattern, handledPosition, strPattern.length()); |
||||
|
||||
return sbuf.toString(); |
||||
} |
||||
} |
@ -0,0 +1,176 @@
|
||||
package com.hnac.hzims.common.logs.to; |
||||
|
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
||||
import java.time.LocalDateTime; |
||||
|
||||
/** |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/3/29 13:24 |
||||
*/ |
||||
@Data |
||||
public class SysLogTo { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
|
||||
private Long id; |
||||
|
||||
/** |
||||
* 租户ID |
||||
*/ |
||||
@ApiModelProperty("租户ID") |
||||
private String tenantId; |
||||
|
||||
/** |
||||
* 服务器ip |
||||
*/ |
||||
@ApiModelProperty("服务器ip") |
||||
protected String serverIp; |
||||
|
||||
|
||||
/** |
||||
* 服务器地址 |
||||
*/ |
||||
@ApiModelProperty("服务器地址") |
||||
protected String serverHost; |
||||
|
||||
/** |
||||
* 服务名称 |
||||
*/ |
||||
@ApiModelProperty("服务名称") |
||||
protected String serverName; |
||||
|
||||
|
||||
/** |
||||
* 环境 |
||||
*/ |
||||
@ApiModelProperty("环境") |
||||
protected String env; |
||||
|
||||
|
||||
/** |
||||
* 操作人 id |
||||
*/ |
||||
@ApiModelProperty("操作人id") |
||||
private Long operationUserId; |
||||
|
||||
|
||||
/** |
||||
* 操作人 |
||||
*/ |
||||
@ApiModelProperty("操作人") |
||||
private String operationUserName; |
||||
|
||||
/** |
||||
* 请求路径 (操作地址) |
||||
*/ |
||||
@ApiModelProperty(" 请求路径 (操作地址)") |
||||
private String path; |
||||
|
||||
|
||||
/** |
||||
* 用户代理 |
||||
*/ |
||||
@ApiModelProperty("用户代理") |
||||
protected String userAgent; |
||||
|
||||
|
||||
/** |
||||
* 操作方式 |
||||
*/ |
||||
@ApiModelProperty("操作方式") |
||||
protected String method; |
||||
|
||||
/** |
||||
* 方法类 |
||||
*/ |
||||
@ApiModelProperty("方法类") |
||||
protected String methodClass; |
||||
|
||||
/** |
||||
* 方法名 |
||||
*/ |
||||
@ApiModelProperty("方法名") |
||||
protected String methodName; |
||||
|
||||
/** |
||||
* 方法执行时间 消耗时间 毫秒 |
||||
*/ |
||||
@ApiModelProperty("法执行时间 消耗时间 毫秒") |
||||
private String costTime; |
||||
|
||||
/** |
||||
* 方法入参 |
||||
*/ |
||||
@ApiModelProperty("方法入参") |
||||
private String parameter; |
||||
|
||||
/** |
||||
* 操作方法 |
||||
*/ |
||||
@ApiModelProperty("操作方法") |
||||
private String title; |
||||
|
||||
/** |
||||
* 方法描述 |
||||
*/ |
||||
@ApiModelProperty("方法描述") |
||||
private String action; |
||||
|
||||
/** |
||||
* 系统类型 |
||||
*/ |
||||
@ApiModelProperty("系统类型") |
||||
private String operatorType; |
||||
|
||||
/** |
||||
* 操作人类别 |
||||
*/ |
||||
@ApiModelProperty("操作人类别") |
||||
private String businessType; |
||||
|
||||
|
||||
/** |
||||
* 返回结果 |
||||
* |
||||
* @param jsonResult |
||||
*/ |
||||
@ApiModelProperty("返回结果") |
||||
public String jsonResult; |
||||
|
||||
/** |
||||
* 请求的Ip |
||||
*/ |
||||
@ApiModelProperty("请求的Ip") |
||||
private String localIp; |
||||
|
||||
/** |
||||
* 错误消息 |
||||
*/ |
||||
@ApiModelProperty("错误消息") |
||||
private String errorMsg; |
||||
/** |
||||
* 操作时间 |
||||
*/ |
||||
@ApiModelProperty("操作时间") |
||||
private LocalDateTime operationTime; |
||||
|
||||
|
||||
/** |
||||
* 操作状态(0 正常 1 异常) |
||||
*/ |
||||
@ApiModelProperty("操作状态") |
||||
private Integer status; |
||||
|
||||
|
||||
/** |
||||
* 功能模块 |
||||
*/ |
||||
@ApiModelProperty("功能模块") |
||||
private String moduleName; |
||||
|
||||
} |
@ -0,0 +1,130 @@
|
||||
package com.hnac.hzims.common.logs.utils; |
||||
|
||||
/** |
||||
* 通用常量信息 |
||||
* |
||||
* @author ruoyi |
||||
*/ |
||||
public class Constants |
||||
{ |
||||
/** |
||||
* UTF-8 字符集 |
||||
*/ |
||||
public static final String UTF8 = "UTF-8"; |
||||
|
||||
/** |
||||
* GBK 字符集 |
||||
*/ |
||||
public static final String GBK = "GBK"; |
||||
|
||||
/** |
||||
* www主域 |
||||
*/ |
||||
public static final String WWW = "www."; |
||||
|
||||
/** |
||||
* RMI 远程方法调用 |
||||
*/ |
||||
public static final String LOOKUP_RMI = "rmi:"; |
||||
|
||||
/** |
||||
* LDAP 远程方法调用 |
||||
*/ |
||||
public static final String LOOKUP_LDAP = "ldap:"; |
||||
|
||||
/** |
||||
* LDAPS 远程方法调用 |
||||
*/ |
||||
public static final String LOOKUP_LDAPS = "ldaps:"; |
||||
|
||||
/** |
||||
* http请求 |
||||
*/ |
||||
public static final String HTTP = "http://"; |
||||
|
||||
/** |
||||
* https请求 |
||||
*/ |
||||
public static final String HTTPS = "https://"; |
||||
|
||||
/** |
||||
* 成功标记 |
||||
*/ |
||||
public static final Integer SUCCESS = 200; |
||||
|
||||
/** |
||||
* 失败标记 |
||||
*/ |
||||
public static final Integer FAIL = 500; |
||||
|
||||
/** |
||||
* 登录成功状态 |
||||
*/ |
||||
public static final String LOGIN_SUCCESS_STATUS = "0"; |
||||
|
||||
/** |
||||
* 登录失败状态 |
||||
*/ |
||||
public static final String LOGIN_FAIL_STATUS = "1"; |
||||
|
||||
/** |
||||
* 登录成功 |
||||
*/ |
||||
public static final String LOGIN_SUCCESS = "Success"; |
||||
|
||||
/** |
||||
* 注销 |
||||
*/ |
||||
public static final String LOGOUT = "Logout"; |
||||
|
||||
/** |
||||
* 注册 |
||||
*/ |
||||
public static final String REGISTER = "Register"; |
||||
|
||||
/** |
||||
* 登录失败 |
||||
*/ |
||||
public static final String LOGIN_FAIL = "Error"; |
||||
|
||||
/** |
||||
* 当前记录起始索引 |
||||
*/ |
||||
public static final String PAGE_NUM = "pageNum"; |
||||
|
||||
/** |
||||
* 每页显示记录数 |
||||
*/ |
||||
public static final String PAGE_SIZE = "pageSize"; |
||||
|
||||
/** |
||||
* 排序列 |
||||
*/ |
||||
public static final String ORDER_BY_COLUMN = "orderByColumn"; |
||||
|
||||
/** |
||||
* 排序的方向 "desc" 或者 "asc". |
||||
*/ |
||||
public static final String IS_ASC = "isAsc"; |
||||
|
||||
/** |
||||
* 验证码有效期(分钟) |
||||
*/ |
||||
public static final long CAPTCHA_EXPIRATION = 2; |
||||
|
||||
/** |
||||
* 资源映射路径 前缀 |
||||
*/ |
||||
public static final String RESOURCE_PREFIX = "/profile"; |
||||
|
||||
/** |
||||
* 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加) |
||||
*/ |
||||
public static final String[] JOB_WHITELIST_STR = { "com.ruoyi" }; |
||||
|
||||
/** |
||||
* 定时任务违规的字符 |
||||
*/ |
||||
public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml", |
||||
"org.springframework", "org.apache", "com.ruoyi.common.core.utils.file" }; |
||||
} |
@ -0,0 +1,567 @@
|
||||
package com.hnac.hzims.common.logs.utils; |
||||
|
||||
/** |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/3/31 15:43 |
||||
*/ |
||||
|
||||
import java.util.Collection; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
import com.hnac.hzims.common.logs.text.StrFormatter; |
||||
import org.springframework.util.AntPathMatcher; |
||||
|
||||
/** |
||||
* 字符串工具类 |
||||
* |
||||
* @author ruoyi |
||||
*/ |
||||
public class StringUtils extends org.apache.commons.lang3.StringUtils |
||||
{ |
||||
/** 空字符串 */ |
||||
private static final String NULLSTR = ""; |
||||
|
||||
/** 下划线 */ |
||||
private static final char SEPARATOR = '_'; |
||||
|
||||
/** |
||||
* 获取参数不为空值 |
||||
* |
||||
* @param value defaultValue 要判断的value |
||||
* @return value 返回值 |
||||
*/ |
||||
public static <T> T nvl(T value, T defaultValue) |
||||
{ |
||||
return value != null ? value : defaultValue; |
||||
} |
||||
|
||||
/** |
||||
* * 判断一个Collection是否为空, 包含List,Set,Queue |
||||
* |
||||
* @param coll 要判断的Collection |
||||
* @return true:为空 false:非空 |
||||
*/ |
||||
public static boolean isEmpty(Collection<?> coll) |
||||
{ |
||||
return isNull(coll) || coll.isEmpty(); |
||||
} |
||||
|
||||
/** |
||||
* * 判断一个Collection是否非空,包含List,Set,Queue |
||||
* |
||||
* @param coll 要判断的Collection |
||||
* @return true:非空 false:空 |
||||
*/ |
||||
public static boolean isNotEmpty(Collection<?> coll) |
||||
{ |
||||
return !isEmpty(coll); |
||||
} |
||||
|
||||
/** |
||||
* * 判断一个对象数组是否为空 |
||||
* |
||||
* @param objects 要判断的对象数组 |
||||
** @return true:为空 false:非空 |
||||
*/ |
||||
public static boolean isEmpty(Object[] objects) |
||||
{ |
||||
return isNull(objects) || (objects.length == 0); |
||||
} |
||||
|
||||
/** |
||||
* * 判断一个对象数组是否非空 |
||||
* |
||||
* @param objects 要判断的对象数组 |
||||
* @return true:非空 false:空 |
||||
*/ |
||||
public static boolean isNotEmpty(Object[] objects) |
||||
{ |
||||
return !isEmpty(objects); |
||||
} |
||||
|
||||
/** |
||||
* * 判断一个Map是否为空 |
||||
* |
||||
* @param map 要判断的Map |
||||
* @return true:为空 false:非空 |
||||
*/ |
||||
public static boolean isEmpty(Map<?, ?> map) |
||||
{ |
||||
return isNull(map) || map.isEmpty(); |
||||
} |
||||
|
||||
/** |
||||
* * 判断一个Map是否为空 |
||||
* |
||||
* @param map 要判断的Map |
||||
* @return true:非空 false:空 |
||||
*/ |
||||
public static boolean isNotEmpty(Map<?, ?> map) |
||||
{ |
||||
return !isEmpty(map); |
||||
} |
||||
|
||||
/** |
||||
* * 判断一个字符串是否为空串 |
||||
* |
||||
* @param str String |
||||
* @return true:为空 false:非空 |
||||
*/ |
||||
public static boolean isEmpty(String str) |
||||
{ |
||||
return isNull(str) || NULLSTR.equals(str.trim()); |
||||
} |
||||
|
||||
/** |
||||
* * 判断一个字符串是否为非空串 |
||||
* |
||||
* @param str String |
||||
* @return true:非空串 false:空串 |
||||
*/ |
||||
public static boolean isNotEmpty(String str) |
||||
{ |
||||
return !isEmpty(str); |
||||
} |
||||
|
||||
/** |
||||
* * 判断一个对象是否为空 |
||||
* |
||||
* @param object Object |
||||
* @return true:为空 false:非空 |
||||
*/ |
||||
public static boolean isNull(Object object) |
||||
{ |
||||
return object == null; |
||||
} |
||||
|
||||
/** |
||||
* * 判断一个对象是否非空 |
||||
* |
||||
* @param object Object |
||||
* @return true:非空 false:空 |
||||
*/ |
||||
public static boolean isNotNull(Object object) |
||||
{ |
||||
return !isNull(object); |
||||
} |
||||
|
||||
/** |
||||
* * 判断一个对象是否是数组类型(Java基本型别的数组) |
||||
* |
||||
* @param object 对象 |
||||
* @return true:是数组 false:不是数组 |
||||
*/ |
||||
public static boolean isArray(Object object) |
||||
{ |
||||
return isNotNull(object) && object.getClass().isArray(); |
||||
} |
||||
|
||||
/** |
||||
* 去空格 |
||||
*/ |
||||
public static String trim(String str) |
||||
{ |
||||
return (str == null ? "" : str.trim()); |
||||
} |
||||
|
||||
/** |
||||
* 截取字符串 |
||||
* |
||||
* @param str 字符串 |
||||
* @param start 开始 |
||||
* @return 结果 |
||||
*/ |
||||
public static String substring(final String str, int start) |
||||
{ |
||||
if (str == null) |
||||
{ |
||||
return NULLSTR; |
||||
} |
||||
|
||||
if (start < 0) |
||||
{ |
||||
start = str.length() + start; |
||||
} |
||||
|
||||
if (start < 0) |
||||
{ |
||||
start = 0; |
||||
} |
||||
if (start > str.length()) |
||||
{ |
||||
return NULLSTR; |
||||
} |
||||
|
||||
return str.substring(start); |
||||
} |
||||
|
||||
/** |
||||
* 截取字符串 |
||||
* |
||||
* @param str 字符串 |
||||
* @param start 开始 |
||||
* @param end 结束 |
||||
* @return 结果 |
||||
*/ |
||||
public static String substring(final String str, int start, int end) |
||||
{ |
||||
if (str == null) |
||||
{ |
||||
return NULLSTR; |
||||
} |
||||
|
||||
if (end < 0) |
||||
{ |
||||
end = str.length() + end; |
||||
} |
||||
if (start < 0) |
||||
{ |
||||
start = str.length() + start; |
||||
} |
||||
|
||||
if (end > str.length()) |
||||
{ |
||||
end = str.length(); |
||||
} |
||||
|
||||
if (start > end) |
||||
{ |
||||
return NULLSTR; |
||||
} |
||||
|
||||
if (start < 0) |
||||
{ |
||||
start = 0; |
||||
} |
||||
if (end < 0) |
||||
{ |
||||
end = 0; |
||||
} |
||||
|
||||
return str.substring(start, end); |
||||
} |
||||
|
||||
/** |
||||
* 判断是否为空,并且不是空白字符 |
||||
* |
||||
* @param str 要判断的value |
||||
* @return 结果 |
||||
*/ |
||||
public static boolean hasText(String str) |
||||
{ |
||||
return (str != null && !str.isEmpty() && containsText(str)); |
||||
} |
||||
|
||||
private static boolean containsText(CharSequence str) |
||||
{ |
||||
int strLen = str.length(); |
||||
for (int i = 0; i < strLen; i++) |
||||
{ |
||||
if (!Character.isWhitespace(str.charAt(i))) |
||||
{ |
||||
return true; |
||||
} |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
/** |
||||
* 格式化文本, {} 表示占位符<br> |
||||
* 此方法只是简单将占位符 {} 按照顺序替换为参数<br> |
||||
* 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br> |
||||
* 例:<br> |
||||
* 通常使用:format("this is {} for {}", "a", "b") -> this is a for b<br> |
||||
* 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a<br> |
||||
* 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br> |
||||
* |
||||
* @param template 文本模板,被替换的部分用 {} 表示 |
||||
* @param params 参数值 |
||||
* @return 格式化后的文本 |
||||
*/ |
||||
public static String format(String template, Object... params) |
||||
{ |
||||
if (isEmpty(params) || isEmpty(template)) |
||||
{ |
||||
return template; |
||||
} |
||||
return StrFormatter.format(template, params); |
||||
} |
||||
|
||||
/** |
||||
* 是否为http(s)://开头
|
||||
* |
||||
* @param link 链接 |
||||
* @return 结果 |
||||
*/ |
||||
public static boolean ishttp(String link) |
||||
{ |
||||
return startsWithAny(link, Constants.HTTP, Constants.HTTPS); |
||||
} |
||||
|
||||
/** |
||||
* 判断给定的set列表中是否包含数组array 判断给定的数组array中是否包含给定的元素value |
||||
* |
||||
* @param array 给定的数组 |
||||
* @return boolean 结果 |
||||
*/ |
||||
public static boolean containsAny(Collection<String> collection, String... array) |
||||
{ |
||||
if (isEmpty(collection) || isEmpty(array)) |
||||
{ |
||||
return false; |
||||
} |
||||
else |
||||
{ |
||||
for (String str : array) |
||||
{ |
||||
if (collection.contains(str)) |
||||
{ |
||||
return true; |
||||
} |
||||
} |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 驼峰转下划线命名 |
||||
*/ |
||||
public static String toUnderScoreCase(String str) |
||||
{ |
||||
if (str == null) |
||||
{ |
||||
return null; |
||||
} |
||||
StringBuilder sb = new StringBuilder(); |
||||
// 前置字符是否大写
|
||||
boolean preCharIsUpperCase = true; |
||||
// 当前字符是否大写
|
||||
boolean curreCharIsUpperCase = true; |
||||
// 下一字符是否大写
|
||||
boolean nexteCharIsUpperCase = true; |
||||
for (int i = 0; i < str.length(); i++) |
||||
{ |
||||
char c = str.charAt(i); |
||||
if (i > 0) |
||||
{ |
||||
preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1)); |
||||
} |
||||
else |
||||
{ |
||||
preCharIsUpperCase = false; |
||||
} |
||||
|
||||
curreCharIsUpperCase = Character.isUpperCase(c); |
||||
|
||||
if (i < (str.length() - 1)) |
||||
{ |
||||
nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1)); |
||||
} |
||||
|
||||
if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase) |
||||
{ |
||||
sb.append(SEPARATOR); |
||||
} |
||||
else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase) |
||||
{ |
||||
sb.append(SEPARATOR); |
||||
} |
||||
sb.append(Character.toLowerCase(c)); |
||||
} |
||||
|
||||
return sb.toString(); |
||||
} |
||||
|
||||
/** |
||||
* 是否包含字符串 |
||||
* |
||||
* @param str 验证字符串 |
||||
* @param strs 字符串组 |
||||
* @return 包含返回true |
||||
*/ |
||||
public static boolean inStringIgnoreCase(String str, String... strs) |
||||
{ |
||||
if (str != null && strs != null) |
||||
{ |
||||
for (String s : strs) |
||||
{ |
||||
if (str.equalsIgnoreCase(trim(s))) |
||||
{ |
||||
return true; |
||||
} |
||||
} |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
/** |
||||
* 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld |
||||
* |
||||
* @param name 转换前的下划线大写方式命名的字符串 |
||||
* @return 转换后的驼峰式命名的字符串 |
||||
*/ |
||||
public static String convertToCamelCase(String name) |
||||
{ |
||||
StringBuilder result = new StringBuilder(); |
||||
// 快速检查
|
||||
if (name == null || name.isEmpty()) |
||||
{ |
||||
// 没必要转换
|
||||
return ""; |
||||
} |
||||
else if (!name.contains("_")) |
||||
{ |
||||
// 不含下划线,仅将首字母大写
|
||||
return name.substring(0, 1).toUpperCase() + name.substring(1); |
||||
} |
||||
// 用下划线将原始字符串分割
|
||||
String[] camels = name.split("_"); |
||||
for (String camel : camels) |
||||
{ |
||||
// 跳过原始字符串中开头、结尾的下换线或双重下划线
|
||||
if (camel.isEmpty()) |
||||
{ |
||||
continue; |
||||
} |
||||
// 首字母大写
|
||||
result.append(camel.substring(0, 1).toUpperCase()); |
||||
result.append(camel.substring(1).toLowerCase()); |
||||
} |
||||
return result.toString(); |
||||
} |
||||
|
||||
/** |
||||
* 驼峰式命名法 |
||||
* 例如:user_name->userName |
||||
*/ |
||||
public static String toCamelCase(String s) |
||||
{ |
||||
if (s == null) |
||||
{ |
||||
return null; |
||||
} |
||||
if (s.indexOf(SEPARATOR) == -1) |
||||
{ |
||||
return s; |
||||
} |
||||
s = s.toLowerCase(); |
||||
StringBuilder sb = new StringBuilder(s.length()); |
||||
boolean upperCase = false; |
||||
for (int i = 0; i < s.length(); i++) |
||||
{ |
||||
char c = s.charAt(i); |
||||
|
||||
if (c == SEPARATOR) |
||||
{ |
||||
upperCase = true; |
||||
} |
||||
else if (upperCase) |
||||
{ |
||||
sb.append(Character.toUpperCase(c)); |
||||
upperCase = false; |
||||
} |
||||
else |
||||
{ |
||||
sb.append(c); |
||||
} |
||||
} |
||||
return sb.toString(); |
||||
} |
||||
|
||||
/** |
||||
* 查找指定字符串是否匹配指定字符串列表中的任意一个字符串 |
||||
* |
||||
* @param str 指定字符串 |
||||
* @param strs 需要检查的字符串数组 |
||||
* @return 是否匹配 |
||||
*/ |
||||
public static boolean matches(String str, List<String> strs) |
||||
{ |
||||
if (isEmpty(str) || isEmpty(strs)) |
||||
{ |
||||
return false; |
||||
} |
||||
for (String pattern : strs) |
||||
{ |
||||
if (isMatch(pattern, str)) |
||||
{ |
||||
return true; |
||||
} |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
/** |
||||
* 判断url是否与规则配置: |
||||
* ? 表示单个字符; |
||||
* * 表示一层路径内的任意字符串,不可跨层级; |
||||
* ** 表示任意层路径; |
||||
* |
||||
* @param pattern 匹配规则 |
||||
* @param url 需要匹配的url |
||||
* @return |
||||
*/ |
||||
public static boolean isMatch(String pattern, String url) |
||||
{ |
||||
AntPathMatcher matcher = new AntPathMatcher(); |
||||
return matcher.match(pattern, url); |
||||
} |
||||
|
||||
@SuppressWarnings("unchecked") |
||||
public static <T> T cast(Object obj) |
||||
{ |
||||
return (T) obj; |
||||
} |
||||
|
||||
/** |
||||
* 数字左边补齐0,使之达到指定长度。注意,如果数字转换为字符串后,长度大于size,则只保留 最后size个字符。 |
||||
* |
||||
* @param num 数字对象 |
||||
* @param size 字符串指定长度 |
||||
* @return 返回数字的字符串格式,该字符串为指定长度。 |
||||
*/ |
||||
public static final String padl(final Number num, final int size) |
||||
{ |
||||
return padl(num.toString(), size, '0'); |
||||
} |
||||
|
||||
/** |
||||
* 字符串左补齐。如果原始字符串s长度大于size,则只保留最后size个字符。 |
||||
* |
||||
* @param s 原始字符串 |
||||
* @param size 字符串指定长度 |
||||
* @param c 用于补齐的字符 |
||||
* @return 返回指定长度的字符串,由原字符串左补齐或截取得到。 |
||||
*/ |
||||
public static final String padl(final String s, final int size, final char c) |
||||
{ |
||||
final StringBuilder sb = new StringBuilder(size); |
||||
if (s != null) |
||||
{ |
||||
final int len = s.length(); |
||||
if (s.length() <= size) |
||||
{ |
||||
for (int i = size - len; i > 0; i--) |
||||
{ |
||||
sb.append(c); |
||||
} |
||||
sb.append(s); |
||||
} |
||||
else |
||||
{ |
||||
return s.substring(len - size, len); |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
for (int i = size; i > 0; i--) |
||||
{ |
||||
sb.append(c); |
||||
} |
||||
} |
||||
return sb.toString(); |
||||
} |
||||
} |
@ -0,0 +1,29 @@
|
||||
package com.hnac.hzims.common.logs.utils; |
||||
|
||||
import javax.servlet.http.HttpServletRequest; |
||||
|
||||
/** |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/7/26 11:34 |
||||
*/ |
||||
public class WebIpUtils { |
||||
|
||||
public static String getIpAddr(HttpServletRequest request) { |
||||
String ip = request.getHeader("x-forwarded-for"); |
||||
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
||||
ip = request.getHeader("Proxy-Client-IP"); |
||||
} |
||||
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
||||
ip = request.getHeader("WL-Proxy-Client-IP"); |
||||
} |
||||
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
||||
ip = request.getRemoteAddr(); |
||||
} |
||||
if (!(null == ip || "".equals(ip.trim()) || "null".equalsIgnoreCase(ip.trim())) && ip.contains(",")) { |
||||
ip = ip.split(",")[0]; |
||||
} |
||||
return ip; |
||||
} |
||||
} |
@ -0,0 +1,22 @@
|
||||
package com.hnac.hzims.common.pojo; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 基础VO,用于tree结构 |
||||
* |
||||
* @author xiashandong |
||||
* @created 2020/9/9 17:30 |
||||
**/ |
||||
public interface Tree<T extends Tree> { |
||||
|
||||
List<T> getChildren(); |
||||
|
||||
void setChildren(List<T> children); |
||||
|
||||
Long getId(); |
||||
|
||||
Long getParentId(); |
||||
|
||||
String getName(); |
||||
} |
@ -0,0 +1,84 @@
|
||||
package com.hnac.hzims.common.service; |
||||
|
||||
import lombok.AllArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.apache.commons.lang.StringUtils; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springblade.system.user.entity.User; |
||||
import org.springblade.system.user.feign.IUserClient; |
||||
import org.springframework.http.HttpStatus; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
@AllArgsConstructor |
||||
@Slf4j |
||||
@Service |
||||
public class UserAuthDataService { |
||||
|
||||
private final IUserClient userClient; |
||||
|
||||
/** |
||||
* 根据用户ID拼接用户数据权限SQL |
||||
* @param userId |
||||
* @return |
||||
*/ |
||||
public String getUserAuthDataSQL(Long userId) { |
||||
R<User> r = userClient.userInfoById(userId); |
||||
String sqlScript = null; |
||||
if(r.getCode() != HttpStatus.OK.value() || r.getData() == null) { |
||||
return null; |
||||
} |
||||
User user = r.getData(); |
||||
if(StringUtils.isBlank(user.getDataScopeType())) { |
||||
return null; |
||||
} |
||||
switch (user.getDataScopeType()) { |
||||
case "0" : |
||||
//本人
|
||||
sqlScript = " create_user = " + userId; |
||||
break; |
||||
case "1": |
||||
//所属机构
|
||||
if(StringUtils.isNotBlank(user.getDeptId())) { |
||||
sqlScript = " create_dept = " + user.getDeptId(); |
||||
} |
||||
break; |
||||
case "2": |
||||
//本部门及下属
|
||||
if(StringUtils.isNotBlank(user.getDeptId())) { |
||||
sqlScript = " create_dept like '" + user.getDeptId() + "%' "; |
||||
} |
||||
break; |
||||
case "3": |
||||
//从属机构
|
||||
if(StringUtils.isNotBlank(user.getDeptIds())) { |
||||
sqlScript = " create_dept in (" + user.getDeptIds() + ") "; |
||||
} |
||||
break; |
||||
case "4": |
||||
//从属机构及下属
|
||||
if(StringUtils.isNotBlank(user.getDeptIds())) { |
||||
String[] deptIds = user.getDeptIds().split(","); |
||||
sqlScript = " ( "; |
||||
for(int i = 0;i<deptIds.length;i++) { |
||||
sqlScript += " create_dept like '" + deptIds[i] + "%'"; |
||||
if(i < deptIds.length-1) { |
||||
sqlScript += " or "; |
||||
} |
||||
} |
||||
sqlScript += " ) "; |
||||
} |
||||
break; |
||||
case "5": |
||||
//个人及下属机构
|
||||
if(StringUtils.isNotBlank(user.getDeptId())){ |
||||
sqlScript = " (( create_user = " + userId + " or create_dept like '" + user.getDeptId() + "%' ) " + " and create_dept != " + user.getDeptId() + " ) "; |
||||
} else { |
||||
sqlScript = " create_user = " + userId; |
||||
} |
||||
break; |
||||
default: |
||||
break; |
||||
} |
||||
return sqlScript; |
||||
} |
||||
} |
@ -0,0 +1,171 @@
|
||||
package com.hnac.hzims.common.utils; |
||||
|
||||
import com.alibaba.fastjson.JSON; |
||||
import com.alibaba.fastjson.JSONObject; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.tool.utils.Func; |
||||
import org.springblade.core.tool.utils.ObjectUtil; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.dao.DataAccessException; |
||||
import org.springframework.data.redis.core.*; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
import java.util.concurrent.locks.Lock; |
||||
import java.util.concurrent.locks.ReentrantLock; |
||||
|
||||
/** |
||||
* @author hx |
||||
*/ |
||||
@Component |
||||
@Slf4j |
||||
public class CacheUtil { |
||||
/**redis内存储对象容错次数属性名**/ |
||||
private static final String TOLERANCE_COUNT = "toleranceCount"; |
||||
|
||||
@Autowired |
||||
public RedisTemplate redisTemplate; |
||||
@Autowired |
||||
public StringRedisTemplate stringRedisTemplate; |
||||
|
||||
/**String 锁**/ |
||||
private Lock stringLock = new ReentrantLock(); |
||||
/**hash 锁**/ |
||||
private Lock hashLock = new ReentrantLock(); |
||||
/**zSet 锁**/ |
||||
private Lock zSetLock = new ReentrantLock(); |
||||
|
||||
/** |
||||
* redis String类型容错机制处理 超出容错机制自动删除 |
||||
* @param key 缓存键值 |
||||
* @param toleranceCountMax 最高容错次数 |
||||
*/ |
||||
public void toleranceFaultString(String key,int toleranceCountMax) { |
||||
stringLock.lock(); |
||||
try{ |
||||
ValueOperations valueOperations= redisTemplate.opsForValue(); |
||||
Object object = valueOperations.get(key); |
||||
redisTemplate.execute(new SessionCallback() { |
||||
@Override |
||||
public Object execute(RedisOperations operations) throws DataAccessException { |
||||
redisTemplate.multi(); |
||||
if(ObjectUtil.isEmpty(object)) { |
||||
return null; |
||||
} |
||||
//记录错误次数 超出错误阈值删除key值
|
||||
JSONObject jsonObject = addToleranceCount(object); |
||||
if(Integer.parseInt(jsonObject.getString(TOLERANCE_COUNT)) > toleranceCountMax){ |
||||
stringRedisTemplate.delete(key); |
||||
} |
||||
else { |
||||
valueOperations.setIfPresent(key,JSON.toJSONString(jsonObject)); |
||||
} |
||||
operations.exec(); |
||||
return null; |
||||
} |
||||
}); |
||||
} |
||||
finally { |
||||
stringLock.unlock(); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* redis hash类型容错机制处理 超出容错机制自动删除 |
||||
* @param key 缓存键值 |
||||
* @param hashCode hash值 |
||||
* @param toleranceCountMax 最高容错次数 |
||||
*/ |
||||
public void toleranceFaultHash(String key,String hashCode,int toleranceCountMax) { |
||||
hashLock.lock(); |
||||
try{ |
||||
HashOperations hashOperations = redisTemplate.opsForHash(); |
||||
Object object = hashOperations.get(key,hashCode); |
||||
redisTemplate.execute(new SessionCallback() { |
||||
@Override |
||||
public Object execute(RedisOperations operations) throws DataAccessException { |
||||
redisTemplate.multi(); |
||||
if(ObjectUtil.isEmpty(object)) { |
||||
return null; |
||||
} |
||||
//记录错误次数 超出错误阈值删除key值
|
||||
JSONObject jsonObject = addToleranceCount(object); |
||||
if(Integer.parseInt(jsonObject.getString(TOLERANCE_COUNT)) > toleranceCountMax){ |
||||
hashOperations.delete(key,hashCode); |
||||
} |
||||
else { |
||||
hashOperations.put(key,hashCode,JSON.toJSONString(jsonObject)); |
||||
} |
||||
operations.exec(); |
||||
return null; |
||||
} |
||||
}); |
||||
} |
||||
finally { |
||||
hashLock.unlock(); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* redis ZSet类型容错机制处理 超出容错机制自动删除 |
||||
* @param key 键值 |
||||
* @param object 分数 |
||||
* @param toleranceCountMax 容错阈值 |
||||
*/ |
||||
public void toleranceFaultZSet(String key,Object object,int toleranceCountMax) { |
||||
zSetLock.lock(); |
||||
try{ |
||||
ZSetOperations zSetOperations = redisTemplate.opsForZSet(); |
||||
Double score = redisTemplate.opsForZSet().score(key, object); |
||||
if(Func.isEmpty(score)) { |
||||
return; |
||||
} |
||||
log.info("score:{}",score); |
||||
redisTemplate.execute(new SessionCallback() { |
||||
@Override |
||||
public Object execute(RedisOperations operations) throws DataAccessException { |
||||
redisTemplate.multi(); |
||||
if(ObjectUtil.isEmpty(object)) { |
||||
return null; |
||||
} |
||||
//删除object 若未达到容错阈值则重新插入回去 达到修改的效果
|
||||
zSetOperations.remove(key,object); |
||||
JSONObject jsonObject = addToleranceCount(object); |
||||
if(Integer.parseInt(jsonObject.getString(TOLERANCE_COUNT)) < toleranceCountMax){ |
||||
zSetOperations.add(key,JSON.toJSONString(jsonObject),score); |
||||
} |
||||
operations.exec(); |
||||
return null; |
||||
} |
||||
}); |
||||
} |
||||
finally { |
||||
zSetLock.unlock(); |
||||
} |
||||
} |
||||
|
||||
/*** |
||||
* 记录错误次数 |
||||
* @param object redis - value |
||||
* @return |
||||
*/ |
||||
public JSONObject addToleranceCount(Object object) { |
||||
String json = ""; |
||||
if(object instanceof String){ |
||||
json = (String) object; |
||||
} |
||||
else{ |
||||
json = JSON.toJSONString(object); |
||||
} |
||||
JSONObject jsonObject = JSONObject.parseObject(json); |
||||
if(Func.isEmpty(jsonObject.getString(TOLERANCE_COUNT))) { |
||||
jsonObject.put(TOLERANCE_COUNT,1); |
||||
} |
||||
else { |
||||
int toleranceCount = Integer.parseInt(jsonObject.getString(TOLERANCE_COUNT)); |
||||
jsonObject.put(TOLERANCE_COUNT,toleranceCount+1); |
||||
} |
||||
return jsonObject; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,26 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package com.hnac.hzims.common.utils; |
||||
|
||||
/** |
||||
* 通用工具类 |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
public class CommonUtil { |
||||
|
||||
} |
@ -0,0 +1,225 @@
|
||||
package com.hnac.hzims.common.utils; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import org.springblade.core.log.exception.ServiceException; |
||||
import org.springblade.core.mp.support.QueryField; |
||||
import org.springblade.core.mp.support.SqlCondition; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
import org.springblade.core.tool.utils.Func; |
||||
import org.springblade.core.tool.utils.ObjectUtil; |
||||
|
||||
import java.lang.reflect.Field; |
||||
import java.util.ArrayList; |
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
import java.util.Optional; |
||||
|
||||
/** |
||||
* @author ninglong |
||||
* @create 2020-08-25 18:59 |
||||
*/ |
||||
public class Condition extends org.springblade.core.mp.support.Condition { |
||||
|
||||
/** |
||||
* 驼峰转下划线 |
||||
* @param c |
||||
* @return |
||||
*/ |
||||
private static String camel2under(String c) { |
||||
String separator = "_"; |
||||
c = c.replaceAll("([a-z])([A-Z])", "$1" + separator + "$2").toUpperCase(); |
||||
return c; |
||||
} |
||||
|
||||
public static <T> LambdaQueryWrapper<T> getQueryWrapper(Class<T> clazz, Object query) { |
||||
QueryWrapper qw = new QueryWrapper(); |
||||
qw.setEntityClass(clazz); |
||||
Class queryClass = query.getClass(); |
||||
List<Field> fieldList = new ArrayList<>(); |
||||
while (null != queryClass){ |
||||
fieldList.addAll(Arrays.asList(queryClass.getDeclaredFields())); |
||||
queryClass = queryClass.getSuperclass(); |
||||
} |
||||
for(Field field:fieldList){ |
||||
field.setAccessible(true); |
||||
QueryField queryField = field.getAnnotation(QueryField.class); |
||||
if(queryField==null) { |
||||
continue; |
||||
} |
||||
Object value; |
||||
try { |
||||
value = field.get(query); |
||||
} catch (Exception e) { |
||||
throw new ServiceException("获取属性性出错"); |
||||
} |
||||
if(value==null) { |
||||
continue; |
||||
} |
||||
List list = null; |
||||
if(value instanceof List){ |
||||
list = (List)value; |
||||
if(list.size()==0) { |
||||
continue; |
||||
} |
||||
} |
||||
String condition = queryField.condition(); |
||||
if(Func.isBlank(condition)) { |
||||
continue; |
||||
} |
||||
String fileName = camel2under(field.getName()); |
||||
if(SqlCondition.EQUAL.equals(condition)) { |
||||
qw.eq(fileName, value); |
||||
}else if(SqlCondition.LIKE.equals(condition)){ |
||||
qw.like(fileName,value); |
||||
}else if(SqlCondition.LIKE_LEFT.equals(condition)){ |
||||
qw.likeLeft(fileName,value); |
||||
}else if(SqlCondition.LIKE_RIGHT.equals(condition)){ |
||||
qw.likeRight(fileName,value); |
||||
}else if(SqlCondition.NOT_IN.equals(condition)){ |
||||
String columnName = queryField.columnName(); |
||||
if(Func.isBlank(columnName)) { |
||||
throw new ServiceException("查询不包含条件时需要指定列名"); |
||||
} |
||||
qw.notIn(camel2under(columnName),list); |
||||
}else if(SqlCondition.IN.equals(condition)){ |
||||
String columnName = queryField.columnName(); |
||||
if(Func.isBlank(columnName)) { |
||||
throw new ServiceException("查询包含条件时需要指定列名"); |
||||
} |
||||
qw.in(camel2under(columnName),list); |
||||
} |
||||
} |
||||
return qw.lambda(); |
||||
} |
||||
|
||||
/** |
||||
* 支持配置化的模糊查询 |
||||
* @param entity 数据库返回的对象实体 |
||||
* @param query 查询条件实体 |
||||
* @param <T> 数据库返回的对象实体 |
||||
* @return |
||||
*/ |
||||
public static <T> LambdaQueryWrapper<T> getQueryWrapper(T entity, Object query) { |
||||
QueryWrapper qw = new QueryWrapper(); |
||||
qw.setEntityClass(entity.getClass()); |
||||
Class queryClass = query.getClass(); |
||||
List<Field> fieldList = new ArrayList<>(); |
||||
while (null != queryClass){ |
||||
fieldList.addAll(Arrays.asList(queryClass.getDeclaredFields())); |
||||
queryClass = queryClass.getSuperclass(); |
||||
} |
||||
for(Field field:fieldList){ |
||||
field.setAccessible(true); |
||||
QueryField queryField = field.getAnnotation(QueryField.class); |
||||
if(queryField==null) { |
||||
continue; |
||||
} |
||||
Object value; |
||||
try { |
||||
value = field.get(query); |
||||
} catch (Exception e) { |
||||
throw new ServiceException("获取属性性出错"); |
||||
} |
||||
if(value==null) { |
||||
continue; |
||||
} |
||||
List list = null; |
||||
if(value instanceof List){ |
||||
list = (List)value; |
||||
if(list.size()==0) { |
||||
continue; |
||||
} |
||||
} |
||||
String condition = queryField.condition(); |
||||
if(Func.isBlank(condition)) { |
||||
continue; |
||||
} |
||||
String fileName = camel2under(field.getName()); |
||||
if(SqlCondition.EQUAL.equals(condition)) { |
||||
qw.eq(fileName, value); |
||||
}else if(SqlCondition.LIKE.equals(condition)){ |
||||
qw.like(fileName,value); |
||||
}else if(SqlCondition.LIKE_LEFT.equals(condition)){ |
||||
qw.likeLeft(fileName,value); |
||||
}else if(SqlCondition.LIKE_RIGHT.equals(condition)){ |
||||
qw.likeRight(fileName,value); |
||||
}else if(SqlCondition.NOT_IN.equals(condition)){ |
||||
String columnName = queryField.columnName(); |
||||
if(Func.isBlank(columnName)) { |
||||
throw new ServiceException("查询不包含条件时需要指定列名"); |
||||
} |
||||
qw.notIn(camel2under(columnName),list); |
||||
}else if(SqlCondition.IN.equals(condition)){ |
||||
String columnName = queryField.columnName(); |
||||
if(Func.isBlank(columnName)) { |
||||
throw new ServiceException("查询包含条件时需要指定列名"); |
||||
} |
||||
qw.in(camel2under(columnName),list); |
||||
} |
||||
} |
||||
return qw.lambda(); |
||||
} |
||||
|
||||
public static <T> QueryWrapper<T> getQueryWrapper(T entity, Object query, boolean isSearchNull, String alias) { |
||||
QueryWrapper qw = new QueryWrapper(); |
||||
qw.setEntityClass(entity.getClass()); |
||||
Class queryClass = query.getClass(); |
||||
List<Field> fieldList = new ArrayList<>(); |
||||
while (null != queryClass){ |
||||
fieldList.addAll(Arrays.asList(queryClass.getDeclaredFields())); |
||||
queryClass = queryClass.getSuperclass(); |
||||
} |
||||
for(Field field:fieldList){ |
||||
field.setAccessible(true); |
||||
QueryField queryField = field.getAnnotation(QueryField.class); |
||||
if(queryField==null) { |
||||
continue; |
||||
} |
||||
Object value; |
||||
try { |
||||
value = field.get(query); |
||||
} catch (Exception e) { |
||||
throw new ServiceException("获取属性性出错"); |
||||
} |
||||
//处理为空状况
|
||||
if(!isSearchNull && ObjectUtil.isEmpty(value)) { |
||||
continue; |
||||
} |
||||
List list = null; |
||||
if(value instanceof List){ |
||||
list = (List)value; |
||||
if(list.size()==0) { |
||||
continue; |
||||
} |
||||
} |
||||
String condition = queryField.condition(); |
||||
if(Func.isBlank(condition)) { |
||||
continue; |
||||
} |
||||
String fileName = Optional.ofNullable(alias).map(aliasStr -> aliasStr + ".").orElse("") + camel2under(field.getName()); |
||||
if(SqlCondition.EQUAL.equals(condition)) { |
||||
qw.eq(fileName, value); |
||||
}else if(SqlCondition.LIKE.equals(condition)){ |
||||
qw.like(fileName,value); |
||||
}else if(SqlCondition.LIKE_LEFT.equals(condition)){ |
||||
qw.likeLeft(fileName,value); |
||||
}else if(SqlCondition.LIKE_RIGHT.equals(condition)){ |
||||
qw.likeRight(fileName,value); |
||||
}else if(SqlCondition.NOT_IN.equals(condition)){ |
||||
String columnName = queryField.columnName(); |
||||
if(Func.isBlank(columnName)) { |
||||
throw new ServiceException("查询不包含条件时需要指定列名"); |
||||
} |
||||
qw.notIn(fileName,list); |
||||
}else if(SqlCondition.IN.equals(condition)){ |
||||
String columnName = queryField.columnName(); |
||||
if(Func.isBlank(columnName)) { |
||||
throw new ServiceException("查询包含条件时需要指定列名"); |
||||
} |
||||
qw.in(fileName,list); |
||||
} |
||||
} |
||||
return qw; |
||||
} |
||||
} |
@ -0,0 +1,149 @@
|
||||
package com.hnac.hzims.common.utils; |
||||
|
||||
import com.hnac.hzims.common.constant.DateConstant; |
||||
import org.springblade.core.log.exception.ServiceException; |
||||
import org.springblade.core.tool.utils.ObjectUtil; |
||||
import org.springframework.util.Assert; |
||||
|
||||
import java.text.ParseException; |
||||
import java.text.SimpleDateFormat; |
||||
import java.time.*; |
||||
import java.time.temporal.ChronoUnit; |
||||
import java.time.temporal.TemporalAdjusters; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
import java.util.stream.Collectors; |
||||
import java.util.stream.IntStream; |
||||
|
||||
/** |
||||
* @author hx |
||||
*/ |
||||
public class DateUtil { |
||||
|
||||
public static final String yyyy_MM_dd_HH_MM_SS= "yyyy-MM-dd HH:mm:ss"; |
||||
public static final String yyyy_MM_dd= "yyyy-MM-dd"; |
||||
public static final String yyyy_MM= "yyyy-MM"; |
||||
public static final String yyyy= "yyyy"; |
||||
|
||||
public static final String YEAR = "year"; |
||||
public static final String QUARTER = "quarter"; |
||||
public static final String MONTH = "month"; |
||||
public static final String WEEK = "week"; |
||||
public static final String DAY = "day"; |
||||
|
||||
/*** |
||||
* Date 转换为 LocalDateTime |
||||
* @param convertDate 需转换的时间 |
||||
* @return |
||||
*/ |
||||
public static LocalDateTime DateToLocalDateTime(Date convertDate){ |
||||
if(ObjectUtil.isNotEmpty(convertDate)) { |
||||
return convertDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
public static String parseString(Date date, String pattern){ |
||||
SimpleDateFormat sdf= new SimpleDateFormat(pattern); |
||||
return String.format(sdf.format(date), pattern); |
||||
} |
||||
|
||||
public static Date parseDate(String date, String pattern) throws ParseException { |
||||
SimpleDateFormat sdf= new SimpleDateFormat(pattern); |
||||
return sdf.parse(date); |
||||
} |
||||
|
||||
/** |
||||
* 判斷时间是否在某一天之内 |
||||
* @param judgeTime |
||||
* @param samplingDate |
||||
* @return |
||||
*/ |
||||
public static boolean judgeSameDay(LocalDateTime judgeTime, LocalDate samplingDate) { |
||||
//取样日期的第一秒
|
||||
LocalDateTime minSamplingTime = LocalDateTime.of(samplingDate, LocalTime.MIN); |
||||
//取样日期的最后一秒
|
||||
LocalDateTime maxSamplingTime = LocalDateTime.of(samplingDate, LocalTime.MAX); |
||||
return judgeTime.isAfter(minSamplingTime) && judgeTime.isBefore(maxSamplingTime); |
||||
} |
||||
|
||||
/** |
||||
* Java 获取两个日期之间的所有日期 |
||||
* |
||||
* @param startDate |
||||
* @param endDate |
||||
* @return |
||||
*/ |
||||
public static List<LocalDate> getDatesBetween(LocalDate startDate, LocalDate endDate) { |
||||
long numOfDaysBetween = ChronoUnit.DAYS.between(startDate, endDate) + 1; |
||||
return IntStream.iterate(0, i -> i + 1).limit(numOfDaysBetween).mapToObj(i -> startDate.plusDays(i)).collect(Collectors.toList()); |
||||
} |
||||
|
||||
/** |
||||
* 获取年份第一天 |
||||
* @param year |
||||
* @return |
||||
*/ |
||||
public static LocalDate getFirstDayByYear(String year) { |
||||
return LocalDate.of(Integer.parseInt(year),1,1); |
||||
} |
||||
|
||||
/** |
||||
* 获取年份最后一天 |
||||
* @param year |
||||
* @return |
||||
*/ |
||||
public static LocalDate getLastDayByYear(String year) { |
||||
LocalDate lastMonthFirstDay = LocalDate.of(Integer.parseInt(year),12,1); |
||||
return lastMonthFirstDay.with(TemporalAdjusters.lastDayOfYear()); |
||||
} |
||||
|
||||
/** |
||||
* 获取月份第一天 |
||||
* @param yearAndMonth |
||||
* @return |
||||
*/ |
||||
public static LocalDate getFirstDayByYearMonth(String yearAndMonth) { |
||||
YearMonth yearMonth = YearMonth.parse(yearAndMonth); |
||||
return LocalDate.of(yearMonth.getYear(),yearMonth.getMonth(),1); |
||||
} |
||||
|
||||
/** |
||||
* 获取月份最后一天 |
||||
* @param yearAndMonth |
||||
* @return |
||||
*/ |
||||
public static LocalDate getLastDayByYearMonth(String yearAndMonth) { |
||||
return getFirstDayByYearMonth(yearAndMonth).with(TemporalAdjusters.lastDayOfMonth()); |
||||
} |
||||
|
||||
/** |
||||
* 获取某时刻加上某时段后调的时间 |
||||
* @param date 指定时刻 |
||||
* @param duration 时间段 |
||||
* @param timeUnit 时间单位 |
||||
* @return |
||||
*/ |
||||
public static LocalDateTime plus(LocalDateTime date, Integer duration, String timeUnit) { |
||||
DateConstant.UnitEnum enumByUnit = DateConstant.UnitEnum.getEnumByUnit(timeUnit); |
||||
Assert.isTrue(ObjectUtil.isNotEmpty(enumByUnit),() -> { |
||||
throw new ServiceException("DateUtil.plus内传入的时间单位参数在枚举类中未查询到,传入的参数为:" + timeUnit); |
||||
}); |
||||
switch(enumByUnit) { |
||||
case YEAR: |
||||
return date.plusYears(duration); |
||||
case MONTH: |
||||
return date.plusMonths(duration); |
||||
case DAY: |
||||
return date.plusDays(duration); |
||||
case HOUR: |
||||
return date.plusHours(duration); |
||||
case MINUTER: |
||||
return date.plusMinutes(duration); |
||||
case SECOND: |
||||
return date.plusSeconds(duration); |
||||
default: |
||||
return null; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,49 @@
|
||||
package com.hnac.hzims.common.utils; |
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
||||
|
||||
import javax.servlet.http.HttpServletRequest; |
||||
|
||||
/** |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/3/29 11:45 |
||||
*/ |
||||
public class IPUtils { |
||||
|
||||
/** |
||||
* 获取客户端ip地址 |
||||
* @param request |
||||
* @return |
||||
*/ |
||||
public static String getIpAddress(HttpServletRequest request) { |
||||
|
||||
String sourceIp = null; |
||||
|
||||
String ipAddresses = request.getHeader("x-forwarded-for"); |
||||
|
||||
if (ipAddresses == null || ipAddresses.length() == 0 || "unknown".equalsIgnoreCase(ipAddresses)) { |
||||
ipAddresses = request.getHeader("Proxy-Client-IP"); |
||||
} |
||||
if (ipAddresses == null || ipAddresses.length() == 0 || "unknown".equalsIgnoreCase(ipAddresses)) { |
||||
ipAddresses = request.getHeader("WL-Proxy-Client-IP"); |
||||
} |
||||
if (ipAddresses == null || ipAddresses.length() == 0 || "unknown".equalsIgnoreCase(ipAddresses)) { |
||||
ipAddresses = request.getHeader("HTTP_CLIENT_IP"); |
||||
} |
||||
if (ipAddresses == null || ipAddresses.length() == 0 || "unknown".equalsIgnoreCase(ipAddresses)) { |
||||
ipAddresses = request.getHeader("HTTP_X_FORWARDED_FOR"); |
||||
} |
||||
if (ipAddresses == null || ipAddresses.length() == 0 || "unknown".equalsIgnoreCase(ipAddresses)) { |
||||
ipAddresses = request.getRemoteAddr(); |
||||
} |
||||
if (StringUtils.isEmpty(ipAddresses)) { |
||||
sourceIp = ipAddresses.split(",")[0]; |
||||
} |
||||
|
||||
return sourceIp; |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,80 @@
|
||||
package com.hnac.hzims.common.utils; |
||||
|
||||
import com.hnac.hzims.common.pojo.Tree; |
||||
import lombok.Builder; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
|
||||
/** |
||||
* 树结构数据工具类 |
||||
* |
||||
* @author xiashandong |
||||
* @created 2020/9/11 10:49 |
||||
**/ |
||||
@Builder |
||||
public final class TreeUtil { |
||||
|
||||
/** |
||||
* 获取某个节点ID以及节点下所有的子节点ID |
||||
*/ |
||||
public <T extends Tree> List<Long> getChildIds(Long id, List<T> list) { |
||||
Map<Long, List<Tree>> all = list.stream().collect(Collectors.groupingBy(Tree::getParentId)); |
||||
boolean flag = list.stream().filter(o -> o.getId().equals(id)).findFirst().isPresent(); |
||||
if(!flag){ |
||||
return null; |
||||
} |
||||
T node = list.stream().filter(o -> o.getId().equals(id)).findFirst().get(); |
||||
List<Long> ids = new ArrayList<>(); |
||||
this.putChildId(all, node, ids); |
||||
return ids; |
||||
} |
||||
|
||||
/** |
||||
* 构建文件类型树结构数据 |
||||
*/ |
||||
public <T extends Tree> T buildTree(T root, List<T> list, String name) { |
||||
//判空
|
||||
if (list == null || list.size() == 0) { |
||||
return root; |
||||
} |
||||
|
||||
//分类
|
||||
Map<Long, List<Tree>> all = list.stream().collect(Collectors.groupingBy(Tree::getParentId)); |
||||
Map<Long, List<Tree>> display = list.stream().filter(o -> (name == null || name.trim().length() == 0) || o.getName().contains(name)).collect(Collectors.groupingBy(Tree::getId)); |
||||
|
||||
//生成树控件
|
||||
for (Tree item : all.get(-1L)) { |
||||
Tree child = this.buildTree(item, all, display); |
||||
if (null != child) { |
||||
root.setChildren(null == root.getChildren() ? new ArrayList<>() : root.getChildren()); |
||||
root.getChildren().add(child); |
||||
} |
||||
} |
||||
return root; |
||||
} |
||||
|
||||
private void putChildId(Map<Long, List<Tree>> all, Tree node, List<Long> ids) { |
||||
ids.add(node.getId()); |
||||
if (all.containsKey(node.getId())) { |
||||
all.get(node.getId()).forEach(child -> this.putChildId(all, child, ids)); |
||||
} |
||||
} |
||||
|
||||
private Tree buildTree(Tree node, Map<Long, List<Tree>> all, Map<Long, List<Tree>> display) { |
||||
if (all.containsKey(node.getId())) { |
||||
for (Tree item : all.get(node.getId())) { |
||||
Tree child = this.buildTree(item, all, display); |
||||
if (null != child) { |
||||
node.setChildren(null == node.getChildren() ? new ArrayList<>() : node.getChildren()); |
||||
node.getChildren().add(child); |
||||
} |
||||
} |
||||
} |
||||
|
||||
return display.containsKey(node.getId()) || (node.getChildren() != null && node.getChildren().size() > 0) ? node : null; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,8 @@
|
||||
${AnsiColor.BLUE} ______ _ _ ___ ___ |
||||
${AnsiColor.BLUE} | ___ \| | | | \ \ / / |
||||
${AnsiColor.BLUE} | |_/ /| | __ _ __| | ___ \ V / |
||||
${AnsiColor.BLUE} | ___ \| | / _` | / _` | / _ \ > < |
||||
${AnsiColor.BLUE} | |_/ /| || (_| || (_| || __/ / . \ |
||||
${AnsiColor.BLUE} \____/ |_| \__,_| \__,_| \___|/__/ \__\ |
||||
|
||||
${AnsiColor.BLUE}:: BladeX :: ${spring.application.name}:${AnsiColor.RED}${blade.env}${AnsiColor.BLUE} :: Running SpringBoot ${spring-boot.version} :: ${AnsiColor.BRIGHT_BLACK} |
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
<parent> |
||||
<artifactId>hzims-service-api</artifactId> |
||||
<groupId>com.hnac.hzims</groupId> |
||||
<version>4.0.0-SNAPSHOT</version> |
||||
</parent> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
<artifactId>assets-api</artifactId> |
||||
<packaging>jar</packaging> |
||||
|
||||
<dependencies> |
||||
<dependency> |
||||
<groupId>com.hnac.hzims</groupId> |
||||
<artifactId>ticket-api</artifactId> |
||||
</dependency> |
||||
<!--<dependency> |
||||
<groupId>com.hnac.hzinfo.data</groupId> |
||||
<artifactId>hzinfo-data-api</artifactId> |
||||
</dependency>--> |
||||
<dependency> |
||||
<groupId>com.alibaba</groupId> |
||||
<artifactId>easyexcel</artifactId> |
||||
</dependency> |
||||
</dependencies> |
||||
</project> |
@ -0,0 +1,175 @@
|
||||
package com.hnac.hzims; |
||||
|
||||
import lombok.Getter; |
||||
|
||||
public class AssetsConstants { |
||||
public final static String APP_NAME = "hzims-assets"; |
||||
|
||||
public enum TaskTypeEnum{ |
||||
MANUAL("1","手动"), |
||||
AUTO("2","自动") |
||||
; |
||||
@Getter |
||||
private String type; |
||||
@Getter |
||||
private String describe; |
||||
|
||||
|
||||
TaskTypeEnum(String type, String describe) { |
||||
this.type = type; |
||||
this.describe = describe; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 周期类型 |
||||
*/ |
||||
public enum CycleTypeEnum { |
||||
/** |
||||
* 秒 |
||||
*/ |
||||
S_CYCLE(0,"秒"), |
||||
/** |
||||
* 分 |
||||
*/ |
||||
M_CYCLE(1,"分"), |
||||
/** |
||||
* 时 |
||||
*/ |
||||
H_CYCLE(2,"时"), |
||||
/** |
||||
* 天 |
||||
*/ |
||||
DAY_CYCLE(3,"天"), |
||||
/** |
||||
* 周 |
||||
*/ |
||||
WEEK_CYCLE(4,"周"), |
||||
/** |
||||
* 月 |
||||
*/ |
||||
MONTH_CYCLE(5,"月"), |
||||
/** |
||||
* 年 |
||||
*/ |
||||
YEAR_CYCLE(6,"年"); |
||||
@Getter |
||||
private int type; |
||||
@Getter |
||||
private String name; |
||||
private CycleTypeEnum(int type,String name){ |
||||
this.type = type; |
||||
this.name = name; |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 取数规则 |
||||
*/ |
||||
public enum AccessRulesEnum { |
||||
/** |
||||
* 最早值 |
||||
*/ |
||||
EARLY_CYCLE(0,"最早值"), |
||||
/** |
||||
* 最大值 |
||||
*/ |
||||
MAX_CYCLE(1,"最大值"), |
||||
/** |
||||
* 最小值 |
||||
*/ |
||||
MIN_CYCLE(2,"最小值"), |
||||
/** |
||||
* 平均值 |
||||
*/ |
||||
AVG_CYCLE(3,"平均值"), |
||||
/** |
||||
* 和值 |
||||
*/ |
||||
SUM_CYCLE(4,"和值"), |
||||
/** |
||||
* 差值 |
||||
*/ |
||||
DIFF_CYCLE(5,"差值"), |
||||
/** |
||||
* 最后值 |
||||
*/ |
||||
FINAL_CYCLE(6,"最后值"); |
||||
@Getter |
||||
private int type; |
||||
@Getter |
||||
private String name; |
||||
private AccessRulesEnum(int type,String name){ |
||||
this.type = type; |
||||
this.name = name; |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 装机容量 |
||||
*/ |
||||
public enum MainEnum { |
||||
/** |
||||
* 装机容量 |
||||
*/ |
||||
INSTALLED_CAPACITY("installedCapacity","装机容量"); |
||||
|
||||
@Getter |
||||
private String val; |
||||
@Getter |
||||
private String name; |
||||
private MainEnum(String val,String name){ |
||||
this.val = val; |
||||
this.name = name; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 运行状态 |
||||
*/ |
||||
public enum RunStatus { |
||||
run("1","运行中"), |
||||
spare("2","热备用"), |
||||
access("0","检修"), |
||||
; |
||||
@Getter |
||||
private String status; |
||||
@Getter |
||||
private String des; |
||||
|
||||
private RunStatus(String status, String des) { |
||||
this.status = status; |
||||
this.des = des; |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 装机容量 |
||||
*/ |
||||
public enum SignageEnum { |
||||
/** |
||||
* 发电标识 |
||||
*/ |
||||
GENERATION_CAPACITY_SIGNAGE("generation_capacity","发电标识"), |
||||
/** |
||||
* 有功功率标识 |
||||
*/ |
||||
POWER_SIGNAGE_SIGNAGE("active_power","有功功率标识"), |
||||
/** |
||||
* 合位继电器 |
||||
*/ |
||||
JOINT_RELAY_SIGNAGE_SIGNAGE("joint_relay","合位继电器"); |
||||
|
||||
@Getter |
||||
private String val; |
||||
@Getter |
||||
private String name; |
||||
private SignageEnum(String val,String name){ |
||||
this.val = val; |
||||
this.name = name; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,38 @@
|
||||
package com.hnac.hzims.spare.chche; |
||||
|
||||
import com.hnac.hzims.spare.constants.AssetsConstant; |
||||
import org.springblade.core.cache.utils.CacheUtil; |
||||
|
||||
import java.time.LocalDate; |
||||
|
||||
/** |
||||
* @Author: wk |
||||
* @Date 2020/8/18 |
||||
* @Version 1.0 |
||||
*/ |
||||
public class AssetsNumCache { |
||||
private static final String ASSETS_NUM = "ticket:day"; |
||||
//序列号位数
|
||||
private static final Integer SERIAL_NUM = 3; |
||||
|
||||
public static String getCodeNum(){ |
||||
Integer num = (Integer) CacheUtil.get(AssetsConstant.TICKET_DAY_NUM, ASSETS_NUM, LocalDate.now()); |
||||
|
||||
if(num == null || num == 0){ |
||||
num = 1; |
||||
CacheUtil.put(AssetsConstant.TICKET_DAY_NUM, ASSETS_NUM,LocalDate.now(), num); |
||||
} |
||||
return getCodeNum(num); |
||||
} |
||||
|
||||
public static String getCodeNum(int num){ |
||||
String code = String.valueOf(num); |
||||
if(code.length() < SERIAL_NUM){ |
||||
for (int i = code.length(); i < SERIAL_NUM; i++){ |
||||
code = "0".concat(code); |
||||
} |
||||
} |
||||
CacheUtil.put(AssetsConstant.TICKET_DAY_NUM, ASSETS_NUM,LocalDate.now(), num + 1); |
||||
return code; |
||||
} |
||||
} |
@ -0,0 +1,43 @@
|
||||
package com.hnac.hzims.spare.constants; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
/** |
||||
* @Author: wk |
||||
* @Date 2020/8/6 |
||||
* @Version 1.0 |
||||
*/ |
||||
public interface AssetsConstant { |
||||
/** |
||||
* 工单记录生成使用系统名称 |
||||
*/ |
||||
final String TICKET_SYSTEM_USE_NAME = "系统"; |
||||
|
||||
/** |
||||
* 工单记录生成使用系统名称 |
||||
*/ |
||||
final BigDecimal TICKET_INITIAL_COEFFICIENT = new BigDecimal("1.0"); |
||||
|
||||
/** |
||||
* 常量1 |
||||
*/ |
||||
final String TICKET_ONE = "1"; |
||||
|
||||
/** |
||||
* 常量2 |
||||
*/ |
||||
final String TICKET_ZRE = "0"; |
||||
/** |
||||
* 常量4 |
||||
*/ |
||||
final String TICKET_FOR = "4"; |
||||
/** |
||||
* 常量 |
||||
*/ |
||||
final String YES = "YES"; |
||||
|
||||
/** |
||||
* 工单数量缓存 |
||||
*/ |
||||
final String TICKET_DAY_NUM = "hzims:assets"; |
||||
} |
@ -0,0 +1,10 @@
|
||||
package com.hnac.hzims.spare.constants; |
||||
|
||||
/** |
||||
* 定时任务处理常量 |
||||
*/ |
||||
public interface ScheduledConstant { |
||||
|
||||
//首页分类
|
||||
String PUSH_HSTOCK_ALERT_MESSAGE_HANDLE = "pushStockAlertMessagehHandle"; |
||||
} |
@ -0,0 +1,58 @@
|
||||
package com.hnac.hzims.spare.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
import java.util.List; |
||||
|
||||
|
||||
/** |
||||
* 实体类 |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@Data |
||||
@TableName("wt_sp_allocation") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "SpAllocation对象", description = "") |
||||
public class SpAllocationEntity extends TenantEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 单据号 |
||||
*/ |
||||
@ApiModelProperty(value = "单据号") |
||||
private String code; |
||||
/** |
||||
* 工作流实例ID |
||||
*/ |
||||
@ApiModelProperty(value = "工作流实例ID") |
||||
private String rpocInsId; |
||||
/** |
||||
* 入库仓库 |
||||
*/ |
||||
@ApiModelProperty(value = "入库仓库") |
||||
private Long inWarehouseId; |
||||
/** |
||||
* 出库仓库 |
||||
*/ |
||||
@ApiModelProperty(value = "出库仓库") |
||||
private Long outWarehouseId; |
||||
/** |
||||
* 备注 |
||||
*/ |
||||
@ApiModelProperty(value = "备注") |
||||
private String remarks; |
||||
|
||||
/** |
||||
*备品备件列表 |
||||
*/ |
||||
@ApiModelProperty(value = "备品备件列表") |
||||
private transient List<SpRecordEntity> basicList; |
||||
|
||||
} |
@ -0,0 +1,56 @@
|
||||
package com.hnac.hzims.spare.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
import java.util.List; |
||||
|
||||
|
||||
/** |
||||
* 实体类 |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@Data |
||||
@TableName("wt_sp_receive") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "SpReceive对象", description = "") |
||||
public class SpReceiveEntity extends TenantEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
/** |
||||
* 单据号 |
||||
*/ |
||||
@ApiModelProperty(value = "单据号") |
||||
private String code; |
||||
/** |
||||
* 关联工单 |
||||
*/ |
||||
@ApiModelProperty(value = "关联工单") |
||||
private String ticketCode; |
||||
/** |
||||
* 工作流实例ID |
||||
*/ |
||||
@ApiModelProperty(value = "工作流实例ID") |
||||
private String rpocInsId; |
||||
/** |
||||
* 仓库库房 |
||||
*/ |
||||
@ApiModelProperty(value = "仓库库房") |
||||
private Long storageRoom; |
||||
/** |
||||
* 备注 |
||||
*/ |
||||
@ApiModelProperty(value = "备注") |
||||
private String remarks; |
||||
/** |
||||
*备品备件列表 |
||||
*/ |
||||
@ApiModelProperty(value = "备品备件列表") |
||||
private transient List<SpRecordEntity> basicList; |
||||
|
||||
} |
@ -0,0 +1,59 @@
|
||||
package com.hnac.hzims.spare.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import org.springblade.core.mp.base.BaseEntity; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
import java.util.Date; |
||||
import java.time.LocalDateTime; |
||||
|
||||
|
||||
/** |
||||
* 实体类 |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@Data |
||||
@TableName("wt_sp_receives") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "SpReceives对象", description = "") |
||||
public class SpReceivesEntity extends TenantEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 单据号 |
||||
*/ |
||||
@ApiModelProperty(value = "单据号") |
||||
private String code; |
||||
/** |
||||
* 工单ID |
||||
*/ |
||||
@ApiModelProperty(value = "工单ID") |
||||
private String ticketCode; |
||||
/** |
||||
* 工作流实例ID |
||||
*/ |
||||
@ApiModelProperty(value = "工作流实例ID") |
||||
private String rpocInsId; |
||||
/** |
||||
* 仓库库房 |
||||
*/ |
||||
@ApiModelProperty(value = "仓库库房") |
||||
private Long storageRoom; |
||||
/** |
||||
* 备注 |
||||
*/ |
||||
@ApiModelProperty(value = "备注") |
||||
private String remarks; |
||||
/** |
||||
* 工具领用单ID |
||||
*/ |
||||
@ApiModelProperty(value = "工具领用单ID") |
||||
private Long veceiveId; |
||||
|
||||
} |
@ -0,0 +1,55 @@
|
||||
package com.hnac.hzims.spare.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
@Data |
||||
@TableName("wt_sp_record") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "SpRecord对象", description = "") |
||||
public class SpRecordEntity extends TenantEntity { |
||||
|
||||
/** |
||||
* 业务表ID |
||||
*/ |
||||
@ApiModelProperty(value = "业务表ID") |
||||
private Long businessId; |
||||
|
||||
/** |
||||
* 备品备件ID |
||||
*/ |
||||
@ApiModelProperty(value = "备品备件ID") |
||||
private Long spBasicId; |
||||
/** |
||||
* 数量 |
||||
*/ |
||||
@ApiModelProperty(value = "数量") |
||||
private Integer amount; |
||||
/** |
||||
* 数量 |
||||
*/ |
||||
@ApiModelProperty(value = "价格") |
||||
private BigDecimal price; |
||||
/** |
||||
* 仓库ID |
||||
*/ |
||||
@ApiModelProperty(value = "仓库ID") |
||||
private Long warehouseId; |
||||
|
||||
/** |
||||
* 类型 |
||||
*/ |
||||
@ApiModelProperty(value = "类型") |
||||
private Integer type; |
||||
/** |
||||
*备品备件列表 |
||||
*/ |
||||
@ApiModelProperty(value = "领用人") |
||||
private transient Long handler; |
||||
} |
@ -0,0 +1,67 @@
|
||||
package com.hnac.hzims.spare.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import org.springblade.core.mp.base.BaseEntity; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import java.util.Date; |
||||
import java.time.LocalDateTime; |
||||
|
||||
|
||||
/** |
||||
* 实体类 |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@Data |
||||
@TableName("wt_sp_revert") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "SpRevert对象", description = "") |
||||
public class SpRevertEntity extends BaseEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 单据号 |
||||
*/ |
||||
@ApiModelProperty(value = "单据号") |
||||
private String code; |
||||
/** |
||||
* 工作流实例ID |
||||
*/ |
||||
@ApiModelProperty(value = "工作流实例ID") |
||||
private String rpocInsId; |
||||
/** |
||||
* 仓库库房 |
||||
*/ |
||||
@ApiModelProperty(value = "仓库库房") |
||||
private Long storageRoom; |
||||
/** |
||||
* 数量 |
||||
*/ |
||||
@ApiModelProperty(value = "数量") |
||||
private Integer amount; |
||||
/** |
||||
* 对应备件ID |
||||
*/ |
||||
@ApiModelProperty(value = "对应备件ID") |
||||
private Long spBasicId; |
||||
/** |
||||
* 备品备件名称 |
||||
*/ |
||||
@ApiModelProperty(value = "备品备件名称") |
||||
private String name; |
||||
/** |
||||
* 备注 |
||||
*/ |
||||
@ApiModelProperty(value = "备注") |
||||
private String remarks; |
||||
/** |
||||
* 当前处理人 |
||||
*/ |
||||
@ApiModelProperty(value = "当前处理人") |
||||
private Long currentOperator; |
||||
|
||||
} |
@ -0,0 +1,29 @@
|
||||
package com.hnac.hzims.spare.entity; |
||||
|
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
@Data |
||||
public class SpTemporaryStockDetailEntity implements Serializable { |
||||
|
||||
|
||||
@ApiModelProperty(value = "名称") |
||||
private String name; |
||||
|
||||
@ApiModelProperty(value = "类型") |
||||
private String type; |
||||
|
||||
@ApiModelProperty(value = "单位") |
||||
private String unit; |
||||
|
||||
@ApiModelProperty(value = "数量") |
||||
private Integer amount; |
||||
|
||||
@ApiModelProperty(value = "关联单号") |
||||
private String code; |
||||
|
||||
@ApiModelProperty(value = "时间") |
||||
private String createDate; |
||||
|
||||
} |
@ -0,0 +1,70 @@
|
||||
package com.hnac.hzims.spare.entity; |
||||
|
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* 临时库存台账 |
||||
*/ |
||||
@Data |
||||
public class SpTemporaryStockEntity implements Serializable { |
||||
|
||||
|
||||
@ApiModelProperty("id") |
||||
private Long id; |
||||
|
||||
@ApiModelProperty(value = "类型ID") |
||||
private Long managementId; |
||||
|
||||
@ApiModelProperty(value = "类型名称") |
||||
private String SparePartsName; |
||||
/** |
||||
* 名称 |
||||
*/ |
||||
@ApiModelProperty(value = "名称") |
||||
private String name; |
||||
/** |
||||
* 编码 |
||||
*/ |
||||
@ApiModelProperty(value = "编码") |
||||
private String code; |
||||
/** |
||||
* 规格 |
||||
*/ |
||||
@ApiModelProperty(value = "规格") |
||||
private String specifications; |
||||
/** |
||||
* 单位 |
||||
*/ |
||||
@ApiModelProperty(value = "单位") |
||||
private String unit; |
||||
|
||||
@ApiModelProperty(value = "库存数量") |
||||
private Integer quantity; |
||||
|
||||
@ApiModelProperty(value = "出库数量") |
||||
private Integer DeliveryQuantity; |
||||
|
||||
@ApiModelProperty(value = "归还数量") |
||||
private Integer returnedQuantity; |
||||
|
||||
@ApiModelProperty(value = "消耗数量") |
||||
private Integer consumedQuantity; |
||||
|
||||
@ApiModelProperty(value = "临时库存数量") |
||||
private Integer stockQuantity; |
||||
|
||||
@ApiModelProperty("所在水厂ID") |
||||
private Long waterPlantId; |
||||
|
||||
@ApiModelProperty(value = "水厂名") |
||||
private String waterPlantName; |
||||
|
||||
@ApiModelProperty("仓库ID") |
||||
private Long warehouseId; |
||||
|
||||
@ApiModelProperty("仓库名称") |
||||
private String warehouseName; |
||||
} |
@ -0,0 +1,40 @@
|
||||
package com.hnac.hzims.spare.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
@Data |
||||
@TableName("wt_sp_ticket_relation") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "SpTicketRelation对象", description = "") |
||||
public class SpTicketRelationEntity extends TenantEntity { |
||||
/** |
||||
* 出库单ID |
||||
*/ |
||||
@ApiModelProperty(value = "出库单ID") |
||||
private Long orderId; |
||||
/** |
||||
* 备件ID |
||||
*/ |
||||
@ApiModelProperty(value = "备件ID") |
||||
private Long spBasicId; |
||||
|
||||
/** |
||||
* 工单号 |
||||
*/ |
||||
@ApiModelProperty(value = "工单号") |
||||
private String ticket; |
||||
/** |
||||
* 数量 |
||||
*/ |
||||
@ApiModelProperty(value = "数量") |
||||
private Integer amount; |
||||
/** |
||||
* 备注 |
||||
*/ |
||||
@ApiModelProperty(value = "备注") |
||||
private String remarks; |
||||
} |
@ -0,0 +1,63 @@
|
||||
package com.hnac.hzims.spare.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
import java.util.List; |
||||
|
||||
|
||||
/** |
||||
* 实体类 |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@Data |
||||
@TableName("wt_sp_warehouse_in") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "SpWarehouseIn对象", description = "SpWarehouseIn对象") |
||||
public class SpWarehouseInEntity extends TenantEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 单据号 |
||||
*/ |
||||
@ApiModelProperty(value = "单据号") |
||||
private String code; |
||||
|
||||
/** |
||||
* 入库类型 |
||||
*/ |
||||
@ApiModelProperty(value = "入库类型") |
||||
private Long type; |
||||
/** |
||||
* 工作流实例ID |
||||
*/ |
||||
@ApiModelProperty(value = "工作流实例ID") |
||||
private String rpocInsId; |
||||
/** |
||||
* 仓库库房 |
||||
*/ |
||||
@ApiModelProperty(value = "仓库库房") |
||||
private Long storageRoom; |
||||
/** |
||||
* 当前处理人 |
||||
*/ |
||||
@ApiModelProperty(value = "当前处理人") |
||||
private Long currentOperator; |
||||
/** |
||||
* 备注 |
||||
*/ |
||||
@ApiModelProperty(value = "备注") |
||||
private String remarks; |
||||
/** |
||||
*备品备件列表 |
||||
*/ |
||||
@ApiModelProperty(value = "备品备件列表") |
||||
private transient List<SpRecordEntity> basicList; |
||||
|
||||
} |
@ -0,0 +1,63 @@
|
||||
package com.hnac.hzims.spare.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
import java.util.List; |
||||
|
||||
|
||||
/** |
||||
* 实体类 |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@Data |
||||
@TableName("wt_sp_warehouse_out") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "SpWarehouseOut对象", description = "") |
||||
public class SpWarehouseOutEntity extends TenantEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 单据号 |
||||
*/ |
||||
@ApiModelProperty(value = "单据号") |
||||
private String code; |
||||
/** |
||||
* 工作流实例ID |
||||
*/ |
||||
@ApiModelProperty(value = "工作流实例ID") |
||||
private String rpocInsId; |
||||
/** |
||||
* 仓库库房 |
||||
*/ |
||||
@ApiModelProperty(value = "仓库库房") |
||||
private Long storageRoom; |
||||
/** |
||||
* 仓库库房 |
||||
*/ |
||||
@ApiModelProperty(value = "仓库库房") |
||||
private Long handler; |
||||
|
||||
/** |
||||
* 备注 |
||||
*/ |
||||
@ApiModelProperty(value = "备注") |
||||
private String remarks; |
||||
|
||||
/** |
||||
* 出库类型 |
||||
*/ |
||||
@ApiModelProperty(value = "出库类型") |
||||
private Long type; |
||||
/** |
||||
*备品备件列表 |
||||
*/ |
||||
@ApiModelProperty(value = "备品备件列表") |
||||
private transient List<SpRecordEntity> basicList; |
||||
} |
@ -0,0 +1,111 @@
|
||||
package com.hnac.hzims.spare.entity; |
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
||||
import com.alibaba.excel.annotation.ExcelProperty; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||
import com.fasterxml.jackson.databind.ser.std.NullSerializer; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
|
||||
/** |
||||
* 实体类 |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@Data |
||||
@TableName("WT_SP_BASIC") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ExcelIgnoreUnannotated |
||||
@ApiModel(value = "WtSpBasic对象", description = "") |
||||
public class WtSpBasicEntity extends TenantEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 对应分类编号 |
||||
*/ |
||||
@ApiModelProperty(value = "对应分类ID") |
||||
private Long managementId; |
||||
/** |
||||
* 名称 |
||||
*/ |
||||
@ExcelProperty(value = "物品名称(必填)",index = 1 ) |
||||
@ApiModelProperty(value = "名称") |
||||
private String name; |
||||
/** |
||||
* 编码 |
||||
*/ |
||||
@ExcelProperty(value = "物品编码(必填)",index = 0 ) |
||||
@ApiModelProperty(value = "编码") |
||||
private String code; |
||||
/** |
||||
* 规格 |
||||
*/ |
||||
@ExcelProperty(value = "规格型号",index = 2 ) |
||||
@ApiModelProperty(value = "规格") |
||||
private String specifications; |
||||
/** |
||||
* 品牌 |
||||
*/ |
||||
@ExcelProperty(value = "物品品牌(必填)",index = 3 ) |
||||
@ApiModelProperty(value = "品牌") |
||||
private String brand; |
||||
/** |
||||
* 单位 |
||||
*/ |
||||
@ExcelProperty(value = "物品单位(必填)",index = 5 ) |
||||
@ApiModelProperty(value = "单位") |
||||
private String unit; |
||||
/** |
||||
* 单价 |
||||
*/ |
||||
@ExcelProperty(value = "单价(元)(必填)",index = 10) |
||||
@ApiModelProperty(value = "单价") |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
private BigDecimal price; |
||||
|
||||
@ExcelProperty(value = "重量(kg)",index = 6 ) |
||||
@ApiModelProperty(value = "重量") |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
private BigDecimal weight; |
||||
|
||||
@ExcelProperty(value = "库存上限(必填)",index = 7 ) |
||||
@ApiModelProperty(value = "库存上限") |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
private Integer upperLimit; |
||||
|
||||
@ExcelProperty(value = "库存下限(必填)",index = 8 ) |
||||
@ApiModelProperty(value = "库存下限") |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
private Integer lowerLimit; |
||||
|
||||
@ExcelProperty(value = "是否回收废品(必填)",index = 9 ) |
||||
@ApiModelProperty(value = "是否回收废品") |
||||
private String isWaste; |
||||
/** |
||||
* 主要参数 |
||||
*/ |
||||
@ExcelProperty(value = "物品类别(必填)",index = 4 ) |
||||
@ApiModelProperty(value = "主要参数") |
||||
private String parameter; |
||||
/** |
||||
* 备注 |
||||
*/ |
||||
@ApiModelProperty(value = "备注") |
||||
private String remarks; |
||||
|
||||
/** |
||||
* 序列号 |
||||
*/ |
||||
@ApiModelProperty(value = "序列号") |
||||
private Long codeNumber; |
||||
|
||||
private transient String nameQuery; |
||||
} |
@ -0,0 +1,64 @@
|
||||
package com.hnac.hzims.spare.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
|
||||
/** |
||||
* 实体类 |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@Data |
||||
@TableName("WT_SP_MANAGEMENT") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "WtSpManagement对象", description = "") |
||||
public class WtSpManagementEntity extends TenantEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 分类名称 |
||||
*/ |
||||
@ApiModelProperty(value = "分类名称") |
||||
private String name; |
||||
/** |
||||
* 所属父级 |
||||
*/ |
||||
@ApiModelProperty(value = "所属父级") |
||||
private Long parentId; |
||||
/** |
||||
* 祖级机构主键 |
||||
*/ |
||||
@ApiModelProperty(value = "祖级机构主键") |
||||
private String ancestors; |
||||
/** |
||||
* 节点等级 |
||||
*/ |
||||
@ApiModelProperty(value = "节点等级") |
||||
private Integer grade; |
||||
/** |
||||
* 分类编码 |
||||
*/ |
||||
@ApiModelProperty(value = "分类编码") |
||||
private String code; |
||||
/** |
||||
* 备品备件:1,工具:2 |
||||
*/ |
||||
@ApiModelProperty(value = "备品备件:1,工具:2") |
||||
private String type; |
||||
/** |
||||
* 备注 |
||||
*/ |
||||
@ApiModelProperty(value = "备注") |
||||
private String remarks; |
||||
/** |
||||
* 序列号 |
||||
*/ |
||||
@ApiModelProperty(value = "序列号") |
||||
private Long codeNumber; |
||||
} |
@ -0,0 +1,35 @@
|
||||
package com.hnac.hzims.spare.entity; |
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty; |
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth; |
||||
import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
||||
import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
||||
import lombok.Data; |
||||
|
||||
@Data |
||||
@ColumnWidth(25) |
||||
@HeadRowHeight(20) |
||||
@ContentRowHeight(18) |
||||
public class WtSpManagementeExcelEntity { |
||||
@ColumnWidth(25) |
||||
@ExcelProperty("一级分类名称") |
||||
private String oneName; |
||||
|
||||
@ExcelProperty("一级分类代码") |
||||
private String oneCode; |
||||
|
||||
@ColumnWidth(25) |
||||
@ExcelProperty("一级分类供应商类别") |
||||
private String firstRemarks; |
||||
|
||||
@ColumnWidth(25) |
||||
@ExcelProperty("二级分类名称") |
||||
private String twoName; |
||||
@ColumnWidth(25) |
||||
@ExcelProperty("二级分类代码") |
||||
private String twoCode; |
||||
@ColumnWidth(25) |
||||
@ExcelProperty("二级分类供应商类别") |
||||
private String secondRemarks; |
||||
|
||||
} |
@ -0,0 +1,101 @@
|
||||
package com.hnac.hzims.spare.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
|
||||
/** |
||||
* 实体类 |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@Data |
||||
@TableName("WT_SP_PROVIDER") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "WtSpProvider对象", description = "") |
||||
public class WtSpProviderEntity extends TenantEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
/** |
||||
* 机构ID |
||||
*/ |
||||
@ApiModelProperty(value = "机构ID") |
||||
private String organizationId; |
||||
/** |
||||
* 供应商编码 |
||||
*/ |
||||
@ApiModelProperty(value = "供应商编码") |
||||
private String organizationCode; |
||||
|
||||
/** |
||||
* 供应商名称 |
||||
*/ |
||||
@ApiModelProperty(value = "供应商名称") |
||||
private String name; |
||||
/** |
||||
* 供货范围 |
||||
*/ |
||||
@ApiModelProperty(value = "供货范围") |
||||
private String scopeOfSupply; |
||||
/** |
||||
* 供货周期 |
||||
*/ |
||||
@ApiModelProperty(value = "供货周期") |
||||
private String supplyCycle; |
||||
/** |
||||
* 名称缩写 |
||||
*/ |
||||
@ApiModelProperty(value = "名称缩写") |
||||
private String logogram; |
||||
/** |
||||
* 业务联系人 |
||||
*/ |
||||
@ApiModelProperty(value = "业务联系人") |
||||
private String salesman; |
||||
/** |
||||
* 法人代表 |
||||
*/ |
||||
@ApiModelProperty(value = "法人代表") |
||||
private String legalPerson; |
||||
/** |
||||
* 电话 |
||||
*/ |
||||
@ApiModelProperty(value = "电话") |
||||
private String phone; |
||||
/** |
||||
* 手机 |
||||
*/ |
||||
@ApiModelProperty(value = "手机") |
||||
private String mobilePhone; |
||||
/** |
||||
* 网址 |
||||
*/ |
||||
@ApiModelProperty(value = "网址") |
||||
private String website; |
||||
/** |
||||
* 地址 |
||||
*/ |
||||
@ApiModelProperty(value = "地址") |
||||
private String address; |
||||
/** |
||||
* 是否合格(0:否,1:是) |
||||
*/ |
||||
@ApiModelProperty(value = "是否合格(0:否,1:是)") |
||||
private Integer qualifiedFlag; |
||||
/** |
||||
* 备注 |
||||
*/ |
||||
@ApiModelProperty(value = "备注") |
||||
private String remark; |
||||
|
||||
/** |
||||
* 供应商名称 |
||||
*/ |
||||
@ApiModelProperty(value = "供应商名称") |
||||
private transient String providerName; |
||||
|
||||
} |
@ -0,0 +1,55 @@
|
||||
package com.hnac.hzims.spare.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
import java.util.Date; |
||||
|
||||
|
||||
/** |
||||
* 实体类 |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@Data |
||||
@TableName("WT_SP_TOOL_BASIC") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "WtSpToolBasic对象", description = "") |
||||
public class WtSpToolBasicEntity extends TenantEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 工具分类 |
||||
*/ |
||||
@ApiModelProperty(value = "工具分类") |
||||
private Long spBasicId; |
||||
/** |
||||
* 保质期 |
||||
*/ |
||||
@ApiModelProperty(value = "保质期") |
||||
private String qualityGuaranteePeriod; |
||||
/** |
||||
* 生产日期 |
||||
*/ |
||||
@ApiModelProperty(value = "生产日期") |
||||
@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8") |
||||
private Date productionPeriod; |
||||
/** |
||||
* 领用数量 |
||||
*/ |
||||
@ApiModelProperty(value = "领用数量") |
||||
private Long quantityReceived; |
||||
/** |
||||
* 所属仓库 |
||||
*/ |
||||
@ApiModelProperty(value = "所属仓库") |
||||
private Long warehouseId; |
||||
|
||||
private transient String nameQuery; |
||||
} |
@ -0,0 +1,96 @@
|
||||
package com.hnac.hzims.spare.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||
import com.fasterxml.jackson.databind.ser.std.NullSerializer; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
|
||||
/** |
||||
* 实体类 |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@Data |
||||
@TableName("WT_SP_TOTAL") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "WtSpTotal对象", description = "") |
||||
public class WtSpTotalEntity extends TenantEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 对应备件ID |
||||
*/ |
||||
@ApiModelProperty(value = "对应备件ID") |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
private Long spBasicId; |
||||
/** |
||||
* 最低储备量 |
||||
*/ |
||||
@ApiModelProperty(value = "最低储备量") |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
private Long minStock; |
||||
/** |
||||
* 最高储备量 |
||||
*/ |
||||
@ApiModelProperty(value = "最高储备量") |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
private Long maxStock; |
||||
/** |
||||
* 库存 |
||||
*/ |
||||
@ApiModelProperty(value = "库存") |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
private Long stock; |
||||
/** |
||||
* 最新入库单价 |
||||
*/ |
||||
@ApiModelProperty(value = "最新入库单价") |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
private BigDecimal inPrice; |
||||
/** |
||||
* 最新出库单价 |
||||
*/ |
||||
@ApiModelProperty(value = "最新出库单价") |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
private BigDecimal outPrice; |
||||
/** |
||||
* 出库暂存 |
||||
*/ |
||||
@ApiModelProperty(value = "出库暂存") |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
private Long outStock; |
||||
/** |
||||
* 警戒百分 |
||||
*/ |
||||
@ApiModelProperty(value = "警戒百分") |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
private Long warningStock; |
||||
/** |
||||
* 所属仓库 |
||||
*/ |
||||
@ApiModelProperty(value = "所属仓库") |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
private Long warehouseId; |
||||
|
||||
/** |
||||
* 备件名称 |
||||
*/ |
||||
@ApiModelProperty(value = "备件名称") |
||||
private transient String name; |
||||
/** |
||||
* 编码 |
||||
*/ |
||||
@ApiModelProperty(value = "备件编码") |
||||
private transient String code; |
||||
|
||||
|
||||
|
||||
} |
@ -0,0 +1,87 @@
|
||||
package com.hnac.hzims.spare.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
|
||||
/** |
||||
* 实体类 |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@Data |
||||
@TableName("WT_SP_WAREHOUSE") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "WtSpWarehouse对象", description = "") |
||||
public class WtSpWarehouseEntity extends TenantEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 地址 |
||||
*/ |
||||
@ApiModelProperty(value = "地址") |
||||
private String address; |
||||
/** |
||||
* 编码 |
||||
*/ |
||||
@ApiModelProperty(value = "编码") |
||||
private String code; |
||||
/** |
||||
* 名称 |
||||
*/ |
||||
@ApiModelProperty(value = "名称") |
||||
private String name; |
||||
/** |
||||
* 负责人 |
||||
*/ |
||||
@ApiModelProperty(value = "负责人") |
||||
private Long manager; |
||||
/** |
||||
* 当前存量 |
||||
*/ |
||||
@ApiModelProperty(value = "当前存量") |
||||
private Long stock; |
||||
/** |
||||
* 库存上限 |
||||
*/ |
||||
@ApiModelProperty(value = "库存上限") |
||||
private Long maxStock; |
||||
/** |
||||
* 库存下限 |
||||
*/ |
||||
@ApiModelProperty(value = "库存下限") |
||||
private Long minStock; |
||||
/** |
||||
* 警戒百分比 |
||||
*/ |
||||
@ApiModelProperty(value = "警戒百分比") |
||||
private Long warningStock; |
||||
/** |
||||
* 备注 |
||||
*/ |
||||
@ApiModelProperty(value = "备注") |
||||
private String remark; |
||||
|
||||
/** |
||||
* 所属单位 |
||||
*/ |
||||
@ApiModelProperty(value = "所属单位") |
||||
private Long affiliatedUnit; |
||||
/** |
||||
* 所属单位名称 |
||||
*/ |
||||
@ApiModelProperty(value = "所属单位名称") |
||||
private String affiliatedName; |
||||
|
||||
/** |
||||
* 机构ID |
||||
*/ |
||||
@ApiModelProperty(value = "机构ID") |
||||
private transient Long deptId; |
||||
|
||||
} |
@ -0,0 +1,32 @@
|
||||
package com.hnac.hzims.spare.enume; |
||||
|
||||
/** |
||||
* 单据类型 |
||||
*/ |
||||
public enum BusinessType { |
||||
IN(1, "入库"), OUT(2, "出库"), ALLOT(3, "调拨"), RECEIVE(4, "领用"), RETURNED(5, "归还"),RETURN(6,"退回"); |
||||
|
||||
private int type; |
||||
private String name; |
||||
|
||||
public int getType() { |
||||
return type; |
||||
} |
||||
|
||||
public void setType(int type) { |
||||
this.type = type; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
|
||||
BusinessType(int type, String name) { |
||||
this.type = type; |
||||
this.name = name; |
||||
} |
||||
} |
@ -0,0 +1,46 @@
|
||||
package com.hnac.hzims.spare.enume; |
||||
|
||||
/** |
||||
* 入库类型 |
||||
*/ |
||||
public enum WarehouseInType { |
||||
BUY(1,"购买入库"),BACK(2,"退回入库"),ALLOT(3,"调拨入库"),OLD(4,"旧品入库"); |
||||
|
||||
private int type; |
||||
private String name; |
||||
|
||||
public int getType() { |
||||
return type; |
||||
} |
||||
|
||||
public void setType(int type) { |
||||
this.type = type; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
|
||||
WarehouseInType(int type, String name) { |
||||
this.type = type; |
||||
this.name = name; |
||||
} |
||||
|
||||
/** |
||||
* 根据值获取枚举 |
||||
* @param value |
||||
* @return |
||||
*/ |
||||
public static WarehouseInType getTypeName(Integer value){ |
||||
for (WarehouseInType type:WarehouseInType.values()) { |
||||
if(type.getType() == value){ |
||||
return type; |
||||
} |
||||
} |
||||
return BUY; |
||||
} |
||||
} |
@ -0,0 +1,46 @@
|
||||
package com.hnac.hzims.spare.enume; |
||||
|
||||
/** |
||||
* 出库类型 |
||||
*/ |
||||
public enum WarehouseOutType { |
||||
MAINTENANCE(1,"维保出库"),REPAIR(2,"维修出库"),ALLOT(3,"调拨出库"),OTHER(4,"其他"); |
||||
|
||||
private int type; |
||||
private String name; |
||||
|
||||
public int getType() { |
||||
return type; |
||||
} |
||||
|
||||
public void setType(int type) { |
||||
this.type = type; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
|
||||
WarehouseOutType(int type, String name) { |
||||
this.type = type; |
||||
this.name = name; |
||||
} |
||||
|
||||
/** |
||||
* 根据值获取枚举 |
||||
* @param value |
||||
* @return |
||||
*/ |
||||
public static WarehouseOutType getTypeName(Integer value){ |
||||
for (WarehouseOutType type:WarehouseOutType.values()) { |
||||
if(type.getType() == value){ |
||||
return type; |
||||
} |
||||
} |
||||
return MAINTENANCE; |
||||
} |
||||
} |
@ -0,0 +1,38 @@
|
||||
package com.hnac.hzims.spare.feign; |
||||
|
||||
import com.hnac.hzims.operational.huosan.vo.AreaTimelyVo; |
||||
import com.hnac.hzims.spare.entity.*; |
||||
import com.hnac.hzims.spare.vo.AssetTypeVo; |
||||
import org.springframework.cloud.openfeign.FeignClient; |
||||
import org.springframework.web.bind.annotation.PostMapping; |
||||
import org.springframework.web.bind.annotation.RequestBody; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
||||
import java.util.List; |
||||
|
||||
@FeignClient( |
||||
value = "hzims-assets",fallback = ISpareClientFallback.class |
||||
) |
||||
public interface ISpareClient { |
||||
String API_PREFIX = "/client"; |
||||
String WAREHOUSEOUT = API_PREFIX+"/warehouseOut"; |
||||
|
||||
String EXCEED_LIMIT = API_PREFIX + "/exceedLimit" ; |
||||
|
||||
String ASSET_DEVICE_TREND = API_PREFIX + "/assetDeviceTrend" ; |
||||
|
||||
/** |
||||
* 保存工单与出库单关联信息 |
||||
* @param recordEntity |
||||
* @return |
||||
*/ |
||||
@PostMapping(WAREHOUSEOUT) |
||||
Boolean warehouseOut(@RequestBody SpRecordEntity recordEntity); |
||||
|
||||
@PostMapping(EXCEED_LIMIT) |
||||
List<AreaTimelyVo> exceedLimit(@RequestParam("deptId") Long deptId); |
||||
|
||||
@PostMapping(ASSET_DEVICE_TREND) |
||||
List<AssetTypeVo> assetDeviceTrend(@RequestParam("deptId") Long deptId); |
||||
|
||||
} |
@ -0,0 +1,28 @@
|
||||
package com.hnac.hzims.spare.feign; |
||||
|
||||
import com.hnac.hzims.operational.huosan.vo.AreaTimelyVo; |
||||
import com.hnac.hzims.spare.entity.*; |
||||
import com.hnac.hzims.spare.vo.AssetTypeVo; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
@Component |
||||
public class ISpareClientFallback implements ISpareClient { |
||||
|
||||
@Override |
||||
public Boolean warehouseOut(SpRecordEntity recordEntity) { |
||||
return false; |
||||
} |
||||
|
||||
@Override |
||||
public List<AreaTimelyVo> exceedLimit(Long deptId) { |
||||
return new ArrayList<>(); |
||||
} |
||||
|
||||
@Override |
||||
public List<AssetTypeVo> assetDeviceTrend(Long deptId) { |
||||
return new ArrayList<>(); |
||||
} |
||||
} |
@ -0,0 +1,35 @@
|
||||
package com.hnac.hzims.spare.feign; |
||||
|
||||
import com.hnac.hzims.spare.vo.WtSpToolVO; |
||||
import org.springblade.core.mp.support.BladePage; |
||||
import org.springframework.cloud.openfeign.FeignClient; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
||||
@FeignClient( |
||||
value = "hzims-assets",fallback = ISpareOutServiceFallback.class |
||||
) |
||||
public interface ISpareOutServiceClient { |
||||
|
||||
String API_PREFIX = "/spare"; |
||||
String SPTOOLLIST = API_PREFIX +"/spTooLList"; |
||||
|
||||
@GetMapping(SPTOOLLIST) |
||||
BladePage<WtSpToolVO> spTooLList(@RequestParam("waterPlanId") Long waterPlanId, |
||||
@RequestParam("tenantId") Long tenantId, |
||||
@RequestParam("current") Integer current, |
||||
@RequestParam("size") Integer size); |
||||
|
||||
// @GetMapping(SPTOOLLIST)
|
||||
// BladePage<WtSpToolVO> spTooLList(@RequestParam Long waterPlanId,
|
||||
// @RequestParam Long tenantId,
|
||||
// @RequestParam Integer current,
|
||||
// @RequestParam Integer size,
|
||||
// @RequestParam String code,
|
||||
// @RequestParam Long deptId,
|
||||
// @RequestParam Long warehouseId,
|
||||
// @RequestParam Long typeId,
|
||||
// @RequestParam String nameQuery);
|
||||
|
||||
|
||||
} |
@ -0,0 +1,33 @@
|
||||
package com.hnac.hzims.spare.feign; |
||||
|
||||
import com.hnac.hzims.spare.vo.WtSpToolVO; |
||||
import org.springblade.core.mp.support.BladePage; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
@Component |
||||
public class ISpareOutServiceFallback implements ISpareOutServiceClient { |
||||
|
||||
@Override |
||||
public BladePage<WtSpToolVO> spTooLList(Long waterPlanId, |
||||
Long tenantId, |
||||
Integer current, |
||||
Integer size){ |
||||
System.out.println("熔断了"); |
||||
return null; |
||||
} |
||||
|
||||
// @Override
|
||||
// public BladePage<WtSpToolVO> spTooLList(Long waterPlanId,
|
||||
// Long tenantId,
|
||||
// Integer current,
|
||||
// Integer size,
|
||||
// String code,
|
||||
// Long deptId,
|
||||
// Long warehouseId,
|
||||
// Long typeId,
|
||||
// String nameQuery){
|
||||
// System.out.println("熔断了");
|
||||
// return null;
|
||||
// }
|
||||
|
||||
} |
@ -0,0 +1,17 @@
|
||||
package com.hnac.hzims.spare.vo; |
||||
|
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@Data |
||||
public class AssetTypeVo { |
||||
|
||||
@ApiModelProperty(value = "资产类型编码") |
||||
private String code; |
||||
|
||||
@ApiModelProperty(value = "资产类型名称") |
||||
private String name; |
||||
} |
@ -0,0 +1,26 @@
|
||||
package com.hnac.hzims.spare.vo; |
||||
|
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@Data |
||||
public class ExceedVo { |
||||
|
||||
@ApiModelProperty(value = "机构名称") |
||||
private String deptName; |
||||
|
||||
@ApiModelProperty(value = "事件Id") |
||||
private String eventId; |
||||
|
||||
@ApiModelProperty(value = "事件内容") |
||||
private String content; |
||||
|
||||
@ApiModelProperty(value = "事件time") |
||||
private String time; |
||||
|
||||
@ApiModelProperty(value = "提醒数量") |
||||
private Integer sum; |
||||
} |
@ -0,0 +1,54 @@
|
||||
package com.hnac.hzims.spare.vo; |
||||
|
||||
import com.hnac.hzims.spare.entity.SpAllocationEntity; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 模型VO |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class SpAllocationVO extends SpAllocationEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
/** |
||||
* 拨入库房 |
||||
*/ |
||||
@ApiModelProperty(value = "拨入库房") |
||||
private String inWarehouseName; |
||||
/** |
||||
* 拨出库房 |
||||
*/ |
||||
@ApiModelProperty(value = "拨出库房") |
||||
private String outWarehouseName; |
||||
/** |
||||
* 用户名称 |
||||
*/ |
||||
@ApiModelProperty(value = "用户名称") |
||||
private String userName; |
||||
/** |
||||
* 单位名称 |
||||
*/ |
||||
@ApiModelProperty(value = "单位名称") |
||||
private String affiliatedName; |
||||
|
||||
@ApiModelProperty(value = "机构ID") |
||||
private Long deptId; |
||||
|
||||
@ApiModelProperty(value = "开始时间") |
||||
private String startDate; |
||||
|
||||
@ApiModelProperty(value = "结束时间") |
||||
private String endDate; |
||||
/** |
||||
* 备品备件列表 |
||||
*/ |
||||
private List<WtSpBasicVO> basicVOList; |
||||
|
||||
} |
@ -0,0 +1,50 @@
|
||||
package com.hnac.hzims.spare.vo; |
||||
|
||||
import com.hnac.hzims.spare.entity.SpReceiveEntity; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 模型VO |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class SpReceiveVO extends SpReceiveEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
/** |
||||
* 仓库名称 |
||||
*/ |
||||
@ApiModelProperty(value = "仓库名称") |
||||
private String warehouseName; |
||||
/** |
||||
* 用户名称 |
||||
*/ |
||||
@ApiModelProperty(value = "用户名称") |
||||
private String userName; |
||||
/** |
||||
* 单位名称 |
||||
*/ |
||||
@ApiModelProperty(value = "单位名称") |
||||
private String affiliatedName; |
||||
|
||||
@ApiModelProperty(value = "机构ID") |
||||
private Long deptId; |
||||
|
||||
@ApiModelProperty(value = "开始时间") |
||||
private String startDate; |
||||
|
||||
@ApiModelProperty(value = "结束时间") |
||||
private String endDate; |
||||
|
||||
private Long sign; |
||||
/** |
||||
* 备品备件列表 |
||||
*/ |
||||
private List<WtSpBasicVO> basicVOList; |
||||
} |
@ -0,0 +1,50 @@
|
||||
package com.hnac.hzims.spare.vo; |
||||
|
||||
import com.hnac.hzims.spare.entity.SpReceivesEntity; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 模型VO |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class SpReceivesVO extends SpReceivesEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 仓库名称 |
||||
*/ |
||||
@ApiModelProperty(value = "仓库名称") |
||||
private String warehouseName; |
||||
/** |
||||
* 用户名称 |
||||
*/ |
||||
@ApiModelProperty(value = "用户名称") |
||||
private String userName; |
||||
/** |
||||
* 单位名称 |
||||
*/ |
||||
@ApiModelProperty(value = "单位名称") |
||||
private String affiliatedName; |
||||
|
||||
@ApiModelProperty(value = "机构ID") |
||||
private Long deptId; |
||||
|
||||
@ApiModelProperty(value = "开始时间") |
||||
private String startDate; |
||||
|
||||
@ApiModelProperty(value = "结束时间") |
||||
private String endDate; |
||||
/** |
||||
* 备品备件列表 |
||||
*/ |
||||
private List<WtSpBasicVO> basicVOList; |
||||
|
||||
} |
@ -0,0 +1,18 @@
|
||||
package com.hnac.hzims.spare.vo; |
||||
|
||||
import com.hnac.hzims.spare.entity.SpRevertEntity; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
/** |
||||
* 模型VO |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class SpRevertVO extends SpRevertEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
@ -0,0 +1,53 @@
|
||||
package com.hnac.hzims.spare.vo; |
||||
|
||||
import com.hnac.hzims.spare.entity.SpWarehouseInEntity; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 模型VO |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class SpWarehouseInVO extends SpWarehouseInEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
/** |
||||
* 仓库名称 |
||||
*/ |
||||
@ApiModelProperty(value = "仓库名称") |
||||
private String warehouseName; |
||||
/** |
||||
* 入库类型名称 |
||||
*/ |
||||
@ApiModelProperty(value = "入库类型名称") |
||||
private String typeName; |
||||
/** |
||||
* 入库人 |
||||
*/ |
||||
@ApiModelProperty(value = "入库人") |
||||
private String userName; |
||||
/** |
||||
* 单位名称 |
||||
*/ |
||||
@ApiModelProperty(value = "单位名称") |
||||
private String affiliatedName; |
||||
|
||||
@ApiModelProperty(value = "机构ID") |
||||
private Long deptId; |
||||
|
||||
@ApiModelProperty(value = "开始时间") |
||||
private String startDate; |
||||
|
||||
@ApiModelProperty(value = "结束时间") |
||||
private String endDate; |
||||
/** |
||||
* 备品备件列表 |
||||
*/ |
||||
private List<WtSpBasicVO> basicVOList; |
||||
} |
@ -0,0 +1,57 @@
|
||||
package com.hnac.hzims.spare.vo; |
||||
|
||||
import com.hnac.hzims.spare.entity.SpWarehouseOutEntity; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 模型VO |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class SpWarehouseOutVO extends SpWarehouseOutEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
/** |
||||
* 仓库名称 |
||||
*/ |
||||
@ApiModelProperty(value = "仓库名称") |
||||
private String warehouseName; |
||||
/** |
||||
* 出库类型名称 |
||||
*/ |
||||
@ApiModelProperty(value = "出库类型名称") |
||||
private String typeName; |
||||
/** |
||||
* 用户名称 |
||||
*/ |
||||
@ApiModelProperty(value = "用户名称") |
||||
private String userName; |
||||
/** |
||||
* 单位名称 |
||||
*/ |
||||
@ApiModelProperty(value = "单位名称") |
||||
private String affiliatedName; |
||||
|
||||
@ApiModelProperty(value = "机构ID") |
||||
private Long deptId; |
||||
|
||||
@ApiModelProperty(value = "开始时间") |
||||
private String startDate; |
||||
|
||||
@ApiModelProperty(value = "结束时间") |
||||
private String endDate; |
||||
|
||||
@ApiModelProperty(value = "关联工单") |
||||
private String ticket; |
||||
|
||||
/** |
||||
* 备品备件列表 |
||||
*/ |
||||
private List<WtSpBasicVO> basicVOList; |
||||
} |
@ -0,0 +1,34 @@
|
||||
package com.hnac.hzims.spare.vo; |
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||
import com.fasterxml.jackson.databind.ser.std.NullSerializer; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
||||
@Data |
||||
public class StockVo{ |
||||
|
||||
@ApiModelProperty(value = "名称") |
||||
private String name; |
||||
|
||||
@ApiModelProperty(value = "单位") |
||||
private String unit; |
||||
|
||||
@ApiModelProperty(value = "品牌") |
||||
private String brand; |
||||
|
||||
@ApiModelProperty(value = "库存数量") |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
private Integer stock; |
||||
|
||||
@ApiModelProperty(value = "库存上限") |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
private Integer upperLimit; |
||||
|
||||
@ApiModelProperty(value = "库存下限") |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
private Integer lowerLimit; |
||||
|
||||
@ApiModelProperty(value = "仓库Id") |
||||
private Long warehouseId; |
||||
} |
@ -0,0 +1,60 @@
|
||||
package com.hnac.hzims.spare.vo; |
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
||||
import com.hnac.hzims.spare.entity.WtSpBasicEntity; |
||||
import com.hnac.hzims.ticket.allTicket.vo.TicketInfoStatisticVO; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 模型VO |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class WtSpBasicVO extends WtSpBasicEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
/** |
||||
* 分类名称 |
||||
*/ |
||||
@ApiModelProperty(value = "分类名称") |
||||
private String sparePartsName; |
||||
/** |
||||
* 仓库名称 |
||||
*/ |
||||
@ApiModelProperty(value = "仓库名称") |
||||
private String warehouseName; |
||||
/** |
||||
* 库存 |
||||
*/ |
||||
@ApiModelProperty(value = "库存") |
||||
@JsonSerialize(using = ToStringSerializer.class) |
||||
private Long stock; |
||||
/** |
||||
* 库存下限 |
||||
*/ |
||||
@ApiModelProperty(value = "库存下限") |
||||
@JsonSerialize(using = ToStringSerializer.class) |
||||
private Long minStock; |
||||
/** |
||||
* 库存上限 |
||||
*/ |
||||
@ApiModelProperty(value = "库存上限") |
||||
@JsonSerialize(using = ToStringSerializer.class) |
||||
private Long maxStock; |
||||
/** |
||||
* 警戒百分 |
||||
*/ |
||||
@ApiModelProperty(value = "警戒百分") |
||||
private Long warningStock; |
||||
|
||||
|
||||
@ApiModelProperty("缺陷") |
||||
private List<TicketInfoStatisticVO> ticketInfoStatisticVOList; |
||||
} |
@ -0,0 +1,58 @@
|
||||
package com.hnac.hzims.spare.vo; |
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude; |
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
||||
import com.hnac.hzims.spare.entity.WtSpManagementEntity; |
||||
import io.swagger.annotations.ApiModel; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.tool.node.INode; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 模型VO |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "WtSpManagementVO对象", description = "WtSpManagementVO对象") |
||||
public class WtSpManagementVO extends WtSpManagementEntity implements INode<WtSpManagementVO> { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 主键ID |
||||
*/ |
||||
@JsonSerialize(using = ToStringSerializer.class) |
||||
private Long id; |
||||
|
||||
/** |
||||
* 父节点ID |
||||
*/ |
||||
@JsonSerialize(using = ToStringSerializer.class) |
||||
private Long parentId; |
||||
|
||||
/** |
||||
* 子孙节点 |
||||
*/ |
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY) |
||||
private List<WtSpManagementVO> children = new ArrayList<>(); |
||||
|
||||
/** |
||||
* 是否有子孙节点 |
||||
*/ |
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY) |
||||
private Boolean hasChildren; |
||||
|
||||
@Override |
||||
public List<WtSpManagementVO> getChildren() { |
||||
if (this.children == null) { |
||||
this.children = new ArrayList<>(); |
||||
} |
||||
return this.children; |
||||
} |
||||
} |
@ -0,0 +1,82 @@
|
||||
package com.hnac.hzims.spare.vo; |
||||
|
||||
import com.hnac.hzims.spare.entity.WtSpToolBasicEntity; |
||||
import com.hnac.hzims.spare.vo.WtSpBasicVO; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
import java.util.List; |
||||
|
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class WtSpToolBasicVO extends WtSpToolBasicEntity { |
||||
|
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 名称 |
||||
*/ |
||||
@ApiModelProperty(value = "名称") |
||||
private String name; |
||||
/** |
||||
* 编码 |
||||
*/ |
||||
@ApiModelProperty(value = "编码") |
||||
private String code; |
||||
/** |
||||
* 规格 |
||||
*/ |
||||
@ApiModelProperty(value = "规格") |
||||
private String specifications; |
||||
/** |
||||
* 单位 |
||||
*/ |
||||
@ApiModelProperty(value = "单位") |
||||
private String unit; |
||||
/** |
||||
* 总数量 |
||||
*/ |
||||
@ApiModelProperty(value = "总数量") |
||||
private Long totalAmount; |
||||
/** |
||||
* 在库数量 |
||||
*/ |
||||
@ApiModelProperty(value = "在库数量") |
||||
private Integer notUseAmount; |
||||
/** |
||||
* 已领数量 |
||||
*/ |
||||
@ApiModelProperty(value = "已领数量") |
||||
private Integer useAmount; |
||||
/** |
||||
* 所属仓库 |
||||
*/ |
||||
@ApiModelProperty(value = "所属仓库") |
||||
private String warehouseName; |
||||
/** |
||||
* 入库人 |
||||
*/ |
||||
@ApiModelProperty(value = "入库人") |
||||
private String userName; |
||||
/** |
||||
* 单位名称 |
||||
*/ |
||||
@ApiModelProperty(value = "单位名称") |
||||
private String affiliatedName; |
||||
|
||||
@ApiModelProperty(value = "机构ID") |
||||
private Long deptId; |
||||
|
||||
@ApiModelProperty(value = "开始时间") |
||||
private String startDate; |
||||
|
||||
@ApiModelProperty(value = "结束时间") |
||||
private String endDate; |
||||
|
||||
/** |
||||
* 备品备件列表 |
||||
*/ |
||||
private List<WtSpBasicVO> basicVOList; |
||||
} |
@ -0,0 +1,72 @@
|
||||
package com.hnac.hzims.spare.vo; |
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||
import com.fasterxml.jackson.databind.ser.std.NullSerializer; |
||||
import com.hnac.hzims.spare.entity.WtSpTotalEntity; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class WtSpToolVO extends WtSpTotalEntity { |
||||
/** |
||||
* 规格 |
||||
*/ |
||||
@ApiModelProperty(value = "规格") |
||||
private String specifications; |
||||
/** |
||||
* 单位 |
||||
*/ |
||||
@ApiModelProperty(value = "单位") |
||||
private String unit; |
||||
/** |
||||
* 单位 |
||||
*/ |
||||
@ApiModelProperty(value = "品牌") |
||||
private String brand; |
||||
/** |
||||
* 单价 |
||||
*/ |
||||
@ApiModelProperty(value = "单价") |
||||
private BigDecimal price; |
||||
/** |
||||
* 所属仓库 |
||||
*/ |
||||
@ApiModelProperty(value = "所属仓库") |
||||
private String warehouseName; |
||||
/** |
||||
* 机构 |
||||
*/ |
||||
@ApiModelProperty(value = "单位名称") |
||||
private String affiliatedName; |
||||
/** |
||||
* 机构ID |
||||
*/ |
||||
@ApiModelProperty(value = "机构ID") |
||||
private Long deptId; |
||||
/** |
||||
* 分类ID |
||||
*/ |
||||
@ApiModelProperty(value = "分类ID") |
||||
private Long typeId; |
||||
|
||||
/** |
||||
* 分类ID |
||||
*/ |
||||
@ApiModelProperty(value = "备品类型") |
||||
private String typeName; |
||||
|
||||
|
||||
@ApiModelProperty(value = "库存上限") |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
private Integer upperLimit; |
||||
|
||||
@ApiModelProperty(value = "库存下限") |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
private Integer lowerLimit; |
||||
|
||||
private String nameQuery; |
||||
} |
@ -0,0 +1,25 @@
|
||||
package com.hnac.hzims.spare.vo; |
||||
|
||||
import com.hnac.hzims.spare.entity.WtSpWarehouseEntity; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
/** |
||||
* 模型VO |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class WtSpWarehouseVO extends WtSpWarehouseEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 负责人 |
||||
*/ |
||||
@ApiModelProperty(value = "负责人") |
||||
private String managerName; |
||||
|
||||
} |
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
<parent> |
||||
<groupId>com.hnac.hzims</groupId> |
||||
<artifactId>hzims-service-api</artifactId> |
||||
<version>4.0.0-SNAPSHOT</version> |
||||
</parent> |
||||
|
||||
|
||||
<artifactId>base-info-api</artifactId> |
||||
<version>${hzims.project.version}</version> |
||||
<packaging>jar</packaging> |
||||
|
||||
<properties> |
||||
<maven.compiler.source>8</maven.compiler.source> |
||||
<maven.compiler.target>8</maven.compiler.target> |
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
||||
</properties> |
||||
|
||||
</project> |
@ -0,0 +1,9 @@
|
||||
package com.hnac.hzims.baseinfo.constants; |
||||
|
||||
/** |
||||
* @author YSJ |
||||
*/ |
||||
public interface BaseInfoConstant { |
||||
|
||||
String APP_NAME = "base-info"; |
||||
} |
@ -0,0 +1,21 @@
|
||||
package com.hnac.hzims.baseinfo.dto; |
||||
|
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
@Data |
||||
public class OverLimitLevelDTO implements Serializable { |
||||
|
||||
//测量站点编号
|
||||
private String code; |
||||
|
||||
//站点名称
|
||||
private String name; |
||||
|
||||
//站点汛限水位
|
||||
private Float mjflsscnwl; |
||||
|
||||
//超过时长
|
||||
private Integer time; |
||||
} |
@ -0,0 +1,39 @@
|
||||
package com.hnac.hzims.baseinfo.dto; |
||||
|
||||
import com.hnac.hzims.baseinfo.entity.PreviewSchemeContent; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
import java.math.BigDecimal; |
||||
|
||||
/** |
||||
* <p> |
||||
* 预演方案内容 |
||||
* </p> |
||||
* |
||||
* @author zhaiqm |
||||
* @since 2023-09-01 |
||||
*/ |
||||
@Data |
||||
public class PreviewSchemeContentDTO extends PreviewSchemeContent implements Serializable { |
||||
|
||||
private static final long serialVersionUID=1L; |
||||
|
||||
|
||||
private Float mjflsscnwl; //主汛期限制水位
|
||||
|
||||
private Float designedfloodlevel; // 设计洪水位 m
|
||||
|
||||
private Float checkedfloodlevel;// 校核洪水位
|
||||
|
||||
private Float designedmaxflow;// 设计最大泄量 m³/s
|
||||
|
||||
private Float checkedmaxflow;// 校核最大泄量m³/s
|
||||
|
||||
private BigDecimal damHeight;//坝高
|
||||
|
||||
private BigDecimal damTopElev;//坝顶高程
|
||||
|
||||
private BigDecimal maxLoad; //机组最大负荷
|
||||
|
||||
} |
@ -0,0 +1,69 @@
|
||||
package com.hnac.hzims.baseinfo.entity; |
||||
|
||||
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 com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
import java.io.Serializable; |
||||
import java.time.LocalDateTime; |
||||
|
||||
@Data |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@Accessors(chain = true) |
||||
@TableName("announce_info") |
||||
public class AnnounceInfo implements Serializable { |
||||
private static final long serialVersionUID=1L; |
||||
|
||||
@JsonSerialize( |
||||
using = ToStringSerializer.class |
||||
) |
||||
@ApiModelProperty("主键id") |
||||
@TableId( |
||||
value = "id", |
||||
type = IdType.ASSIGN_ID |
||||
) |
||||
private Long id; |
||||
|
||||
/** |
||||
* 标题 |
||||
*/ |
||||
@TableField("title") |
||||
private String title; |
||||
|
||||
/** |
||||
* 内容 |
||||
*/ |
||||
@TableField("content") |
||||
private String content; |
||||
|
||||
/** |
||||
* 文件地址 |
||||
*/ |
||||
@TableField("file_path") |
||||
private String filePath; |
||||
|
||||
/** |
||||
* 文件类型 |
||||
*/ |
||||
@TableField("file_type") |
||||
private String fileType; |
||||
|
||||
/** |
||||
* 文件名称 |
||||
*/ |
||||
@TableField("file_name") |
||||
private String fileName; |
||||
|
||||
/** |
||||
* 时间 |
||||
*/ |
||||
@TableField("time") |
||||
private LocalDateTime time; |
||||
} |
@ -0,0 +1,62 @@
|
||||
package com.hnac.hzims.baseinfo.entity; |
||||
|
||||
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 com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* <p> |
||||
* 河流信息表 |
||||
* </p> |
||||
* |
||||
* @author zhaiqm |
||||
* @since 2023-09-01 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@Accessors(chain = true) |
||||
@TableName("basin_info") |
||||
public class BasinInfo implements Serializable { |
||||
|
||||
private static final long serialVersionUID=1L; |
||||
|
||||
@JsonSerialize( |
||||
using = ToStringSerializer.class |
||||
) |
||||
@ApiModelProperty("主键id") |
||||
@TableId( |
||||
value = "id", |
||||
type = IdType.ASSIGN_ID |
||||
) |
||||
private Long id; |
||||
|
||||
/** |
||||
* 河流名称 |
||||
*/ |
||||
@TableField("basin_name") |
||||
private String basinName; |
||||
|
||||
/** |
||||
* GIS范围 |
||||
*/ |
||||
@TableField("basin_gis") |
||||
private String basinGis; |
||||
|
||||
/** |
||||
* 简介 |
||||
*/ |
||||
@TableField("basin_snapshot") |
||||
private String basinSnapshot; |
||||
|
||||
@ApiModelProperty("流域编码") |
||||
private String bscd; |
||||
} |
@ -0,0 +1,64 @@
|
||||
package com.hnac.hzims.baseinfo.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import java.io.Serializable; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
/** |
||||
* <p> |
||||
* 流域水库-大坝-电站-测站关联表 |
||||
* </p> |
||||
* |
||||
* @author dfy |
||||
* @since 2023-10-23 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@Accessors(chain = true) |
||||
@TableName("basin_join") |
||||
public class BasinJoin implements Serializable { |
||||
|
||||
private static final long serialVersionUID=1L; |
||||
|
||||
/** |
||||
* id |
||||
*/ |
||||
@TableId("id") |
||||
private Long id; |
||||
|
||||
/** |
||||
* 水库编码 |
||||
*/ |
||||
@TableField("stcd") |
||||
private String stcd; |
||||
|
||||
/** |
||||
* 测站编码 |
||||
*/ |
||||
@TableField("sscd") |
||||
private String sscd; |
||||
|
||||
/** |
||||
* 流域编码 |
||||
*/ |
||||
@TableField("bscd") |
||||
private String bscd; |
||||
|
||||
/** |
||||
* 大坝编码 |
||||
*/ |
||||
@TableField("dmcd") |
||||
private String dmcd; |
||||
|
||||
/** |
||||
* 电站id |
||||
*/ |
||||
@TableField("station_id") |
||||
private Long stationId; |
||||
|
||||
|
||||
} |
@ -0,0 +1,65 @@
|
||||
package com.hnac.hzims.baseinfo.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableLogic; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
import java.io.Serializable; |
||||
import java.time.LocalDateTime; |
||||
|
||||
/** |
||||
* 文件 |
||||
* |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/8/8 16:01 |
||||
*/ |
||||
@Data |
||||
@Accessors(chain = true) |
||||
@TableName("file_reservoir_info") |
||||
public class FileReservoirInfo implements Serializable { |
||||
|
||||
|
||||
/** |
||||
* 视频Id |
||||
*/ |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
private Long id; |
||||
|
||||
|
||||
/** |
||||
* '视频地址' |
||||
*/ |
||||
private String file; |
||||
|
||||
|
||||
/** |
||||
* 站点Id |
||||
*/ |
||||
private String reservoirInfoId; |
||||
|
||||
|
||||
|
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private LocalDateTime createTime; |
||||
|
||||
|
||||
/** |
||||
* 更新时间 |
||||
*/ |
||||
private LocalDateTime updateTime; |
||||
|
||||
|
||||
/** |
||||
* 逻辑删除0 正常 1 删除 |
||||
*/ |
||||
@TableLogic |
||||
private int isDeleted; |
||||
} |
@ -0,0 +1,62 @@
|
||||
package com.hnac.hzims.baseinfo.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableLogic; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
import java.io.Serializable; |
||||
import java.time.LocalDateTime; |
||||
|
||||
/** |
||||
* 文件 |
||||
* |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/8/8 16:01 |
||||
*/ |
||||
@Data |
||||
@Accessors(chain = true) |
||||
@TableName("image_reservoir_info") |
||||
public class ImageReservoirInfo implements Serializable { |
||||
|
||||
|
||||
/** |
||||
* 视频Id |
||||
*/ |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
private Long id; |
||||
|
||||
|
||||
/** |
||||
* '视频地址' |
||||
*/ |
||||
private String image; |
||||
|
||||
|
||||
/** |
||||
* 站点Id |
||||
*/ |
||||
private String reservoirInfoId; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private LocalDateTime createTime; |
||||
|
||||
|
||||
/** |
||||
* 更新时间 |
||||
*/ |
||||
private LocalDateTime updateTime; |
||||
|
||||
|
||||
/** |
||||
* 逻辑删除0 正常 1 删除 |
||||
*/ |
||||
@TableLogic |
||||
private int isDeleted; |
||||
} |
@ -0,0 +1,62 @@
|
||||
package com.hnac.hzims.baseinfo.entity; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
/** |
||||
* 河流 <国标> |
||||
* |
||||
* @author moze |
||||
* |
||||
*/ |
||||
public class IrrBIReach { |
||||
private String riverCode; // 河流代码
|
||||
|
||||
private String riverName; // 河流名称
|
||||
|
||||
private BigDecimal riverWidth; // 河槽平均宽度(米)
|
||||
|
||||
private BigDecimal riverFlux; // 河槽平均流量(立方米/秒)
|
||||
|
||||
private String coordinateset; // 经纬集合
|
||||
|
||||
public String getCoordinateset() { |
||||
return coordinateset; |
||||
} |
||||
|
||||
public void setCoordinateset(String coordinateset) { |
||||
this.coordinateset = coordinateset; |
||||
} |
||||
|
||||
public String getRiverCode() { |
||||
return riverCode; |
||||
} |
||||
|
||||
public void setRiverCode(String riverCode) { |
||||
this.riverCode = riverCode; |
||||
} |
||||
|
||||
public String getRiverName() { |
||||
return riverName; |
||||
} |
||||
|
||||
public void setRiverName(String riverName) { |
||||
this.riverName = riverName; |
||||
} |
||||
|
||||
public BigDecimal getRiverWidth() { |
||||
return riverWidth; |
||||
} |
||||
|
||||
public void setRiverWidth(BigDecimal riverWidth) { |
||||
this.riverWidth = riverWidth; |
||||
} |
||||
|
||||
public BigDecimal getRiverFlux() { |
||||
return riverFlux; |
||||
} |
||||
|
||||
public void setRiverFlux(BigDecimal riverFlux) { |
||||
this.riverFlux = riverFlux; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,531 @@
|
||||
package com.hnac.hzims.baseinfo.entity; |
||||
|
||||
import java.math.BigDecimal; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
public class IrrBIReachExample { |
||||
protected String orderByClause; |
||||
|
||||
protected boolean distinct; |
||||
|
||||
protected List<Criteria> oredCriteria; |
||||
|
||||
public IrrBIReachExample() { |
||||
oredCriteria = new ArrayList<Criteria>(); |
||||
} |
||||
|
||||
public void setOrderByClause(String orderByClause) { |
||||
this.orderByClause = orderByClause; |
||||
} |
||||
|
||||
public String getOrderByClause() { |
||||
return orderByClause; |
||||
} |
||||
|
||||
public void setDistinct(boolean distinct) { |
||||
this.distinct = distinct; |
||||
} |
||||
|
||||
public boolean isDistinct() { |
||||
return distinct; |
||||
} |
||||
|
||||
public List<Criteria> getOredCriteria() { |
||||
return oredCriteria; |
||||
} |
||||
|
||||
public void or(Criteria criteria) { |
||||
oredCriteria.add(criteria); |
||||
} |
||||
|
||||
public Criteria or() { |
||||
Criteria criteria = createCriteriaInternal(); |
||||
oredCriteria.add(criteria); |
||||
return criteria; |
||||
} |
||||
|
||||
public Criteria createCriteria() { |
||||
Criteria criteria = createCriteriaInternal(); |
||||
if (oredCriteria.size() == 0) { |
||||
oredCriteria.add(criteria); |
||||
} |
||||
return criteria; |
||||
} |
||||
|
||||
protected Criteria createCriteriaInternal() { |
||||
Criteria criteria = new Criteria(); |
||||
return criteria; |
||||
} |
||||
|
||||
public void clear() { |
||||
oredCriteria.clear(); |
||||
orderByClause = null; |
||||
distinct = false; |
||||
} |
||||
|
||||
protected abstract static class GeneratedCriteria { |
||||
protected List<Criterion> criteria; |
||||
|
||||
protected GeneratedCriteria() { |
||||
super(); |
||||
criteria = new ArrayList<Criterion>(); |
||||
} |
||||
|
||||
public boolean isValid() { |
||||
return criteria.size() > 0; |
||||
} |
||||
|
||||
public List<Criterion> getAllCriteria() { |
||||
return criteria; |
||||
} |
||||
|
||||
public List<Criterion> getCriteria() { |
||||
return criteria; |
||||
} |
||||
|
||||
protected void addCriterion(String condition) { |
||||
if (condition == null) { |
||||
throw new RuntimeException("Value for condition cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition)); |
||||
} |
||||
|
||||
protected void addCriterion(String condition, Object value, String property) { |
||||
if (value == null) { |
||||
throw new RuntimeException("Value for " + property + " cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition, value)); |
||||
} |
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) { |
||||
if (value1 == null || value2 == null) { |
||||
throw new RuntimeException("Between values for " + property + " cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition, value1, value2)); |
||||
} |
||||
|
||||
public Criteria andRiverCodeIsNull() { |
||||
addCriterion("RIVER_CODE is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverCodeIsNotNull() { |
||||
addCriterion("RIVER_CODE is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverCodeEqualTo(String value) { |
||||
addCriterion("RIVER_CODE =", value, "riverCode"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverCodeNotEqualTo(String value) { |
||||
addCriterion("RIVER_CODE <>", value, "riverCode"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverCodeGreaterThan(String value) { |
||||
addCriterion("RIVER_CODE >", value, "riverCode"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverCodeGreaterThanOrEqualTo(String value) { |
||||
addCriterion("RIVER_CODE >=", value, "riverCode"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverCodeLessThan(String value) { |
||||
addCriterion("RIVER_CODE <", value, "riverCode"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverCodeLessThanOrEqualTo(String value) { |
||||
addCriterion("RIVER_CODE <=", value, "riverCode"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverCodeLike(String value) { |
||||
addCriterion("RIVER_CODE like", value, "riverCode"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverCodeNotLike(String value) { |
||||
addCriterion("RIVER_CODE not like", value, "riverCode"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverCodeIn(List<String> values) { |
||||
addCriterion("RIVER_CODE in", values, "riverCode"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverCodeNotIn(List<String> values) { |
||||
addCriterion("RIVER_CODE not in", values, "riverCode"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverCodeBetween(String value1, String value2) { |
||||
addCriterion("RIVER_CODE between", value1, value2, "riverCode"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverCodeNotBetween(String value1, String value2) { |
||||
addCriterion("RIVER_CODE not between", value1, value2, "riverCode"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverNameIsNull() { |
||||
addCriterion("RIVER_NAME is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverNameIsNotNull() { |
||||
addCriterion("RIVER_NAME is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverNameEqualTo(String value) { |
||||
addCriterion("RIVER_NAME =", value, "riverName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverNameNotEqualTo(String value) { |
||||
addCriterion("RIVER_NAME <>", value, "riverName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverNameGreaterThan(String value) { |
||||
addCriterion("RIVER_NAME >", value, "riverName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverNameGreaterThanOrEqualTo(String value) { |
||||
addCriterion("RIVER_NAME >=", value, "riverName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverNameLessThan(String value) { |
||||
addCriterion("RIVER_NAME <", value, "riverName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverNameLessThanOrEqualTo(String value) { |
||||
addCriterion("RIVER_NAME <=", value, "riverName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverNameLike(String value) { |
||||
addCriterion("RIVER_NAME like", value, "riverName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverNameNotLike(String value) { |
||||
addCriterion("RIVER_NAME not like", value, "riverName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverNameIn(List<String> values) { |
||||
addCriterion("RIVER_NAME in", values, "riverName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverNameNotIn(List<String> values) { |
||||
addCriterion("RIVER_NAME not in", values, "riverName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverNameBetween(String value1, String value2) { |
||||
addCriterion("RIVER_NAME between", value1, value2, "riverName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverNameNotBetween(String value1, String value2) { |
||||
addCriterion("RIVER_NAME not between", value1, value2, "riverName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverWidthIsNull() { |
||||
addCriterion("RIVER_WIDTH is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverWidthIsNotNull() { |
||||
addCriterion("RIVER_WIDTH is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverWidthEqualTo(BigDecimal value) { |
||||
addCriterion("RIVER_WIDTH =", value, "riverWidth"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverWidthNotEqualTo(BigDecimal value) { |
||||
addCriterion("RIVER_WIDTH <>", value, "riverWidth"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverWidthGreaterThan(BigDecimal value) { |
||||
addCriterion("RIVER_WIDTH >", value, "riverWidth"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverWidthGreaterThanOrEqualTo(BigDecimal value) { |
||||
addCriterion("RIVER_WIDTH >=", value, "riverWidth"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverWidthLessThan(BigDecimal value) { |
||||
addCriterion("RIVER_WIDTH <", value, "riverWidth"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverWidthLessThanOrEqualTo(BigDecimal value) { |
||||
addCriterion("RIVER_WIDTH <=", value, "riverWidth"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverWidthIn(List<BigDecimal> values) { |
||||
addCriterion("RIVER_WIDTH in", values, "riverWidth"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverWidthNotIn(List<BigDecimal> values) { |
||||
addCriterion("RIVER_WIDTH not in", values, "riverWidth"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverWidthBetween(BigDecimal value1, BigDecimal value2) { |
||||
addCriterion("RIVER_WIDTH between", value1, value2, "riverWidth"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverWidthNotBetween(BigDecimal value1, BigDecimal value2) { |
||||
addCriterion("RIVER_WIDTH not between", value1, value2, "riverWidth"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverFluxIsNull() { |
||||
addCriterion("RIVER_FLUX is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverFluxIsNotNull() { |
||||
addCriterion("RIVER_FLUX is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverFluxEqualTo(BigDecimal value) { |
||||
addCriterion("RIVER_FLUX =", value, "riverFlux"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverFluxNotEqualTo(BigDecimal value) { |
||||
addCriterion("RIVER_FLUX <>", value, "riverFlux"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverFluxGreaterThan(BigDecimal value) { |
||||
addCriterion("RIVER_FLUX >", value, "riverFlux"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverFluxGreaterThanOrEqualTo(BigDecimal value) { |
||||
addCriterion("RIVER_FLUX >=", value, "riverFlux"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverFluxLessThan(BigDecimal value) { |
||||
addCriterion("RIVER_FLUX <", value, "riverFlux"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverFluxLessThanOrEqualTo(BigDecimal value) { |
||||
addCriterion("RIVER_FLUX <=", value, "riverFlux"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverFluxIn(List<BigDecimal> values) { |
||||
addCriterion("RIVER_FLUX in", values, "riverFlux"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverFluxNotIn(List<BigDecimal> values) { |
||||
addCriterion("RIVER_FLUX not in", values, "riverFlux"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverFluxBetween(BigDecimal value1, BigDecimal value2) { |
||||
addCriterion("RIVER_FLUX between", value1, value2, "riverFlux"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andRiverFluxNotBetween(BigDecimal value1, BigDecimal value2) { |
||||
addCriterion("RIVER_FLUX not between", value1, value2, "riverFlux"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCoordinatesetIsNull() { |
||||
addCriterion("COORDINATESET is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCoordinatesetIsNotNull() { |
||||
addCriterion("COORDINATESET is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCoordinatesetEqualTo(String value) { |
||||
addCriterion("COORDINATESET =", value, "coordinateset"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCoordinatesetNotEqualTo(String value) { |
||||
addCriterion("COORDINATESET <>", value, "coordinateset"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCoordinatesetGreaterThan(String value) { |
||||
addCriterion("COORDINATESET >", value, "coordinateset"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCoordinatesetGreaterThanOrEqualTo(String value) { |
||||
addCriterion("COORDINATESET >=", value, "coordinateset"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCoordinatesetLessThan(String value) { |
||||
addCriterion("COORDINATESET <", value, "coordinateset"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCoordinatesetLessThanOrEqualTo(String value) { |
||||
addCriterion("COORDINATESET <=", value, "coordinateset"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCoordinatesetLike(String value) { |
||||
addCriterion("COORDINATESET like", value, "coordinateset"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCoordinatesetNotLike(String value) { |
||||
addCriterion("COORDINATESET not like", value, "coordinateset"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCoordinatesetIn(List<String> values) { |
||||
addCriterion("COORDINATESET in", values, "coordinateset"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCoordinatesetNotIn(List<String> values) { |
||||
addCriterion("COORDINATESET not in", values, "coordinateset"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCoordinatesetBetween(String value1, String value2) { |
||||
addCriterion("COORDINATESET between", value1, value2, "coordinateset"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCoordinatesetNotBetween(String value1, String value2) { |
||||
addCriterion("COORDINATESET not between", value1, value2, "coordinateset"); |
||||
return (Criteria) this; |
||||
} |
||||
} |
||||
|
||||
public static class Criteria extends GeneratedCriteria { |
||||
|
||||
protected Criteria() { |
||||
super(); |
||||
} |
||||
} |
||||
|
||||
public static class Criterion { |
||||
private String condition; |
||||
|
||||
private Object value; |
||||
|
||||
private Object secondValue; |
||||
|
||||
private boolean noValue; |
||||
|
||||
private boolean singleValue; |
||||
|
||||
private boolean betweenValue; |
||||
|
||||
private boolean listValue; |
||||
|
||||
private String typeHandler; |
||||
|
||||
public String getCondition() { |
||||
return condition; |
||||
} |
||||
|
||||
public Object getValue() { |
||||
return value; |
||||
} |
||||
|
||||
public Object getSecondValue() { |
||||
return secondValue; |
||||
} |
||||
|
||||
public boolean isNoValue() { |
||||
return noValue; |
||||
} |
||||
|
||||
public boolean isSingleValue() { |
||||
return singleValue; |
||||
} |
||||
|
||||
public boolean isBetweenValue() { |
||||
return betweenValue; |
||||
} |
||||
|
||||
public boolean isListValue() { |
||||
return listValue; |
||||
} |
||||
|
||||
public String getTypeHandler() { |
||||
return typeHandler; |
||||
} |
||||
|
||||
protected Criterion(String condition) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.typeHandler = null; |
||||
this.noValue = true; |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.value = value; |
||||
this.typeHandler = typeHandler; |
||||
if (value instanceof List<?>) { |
||||
this.listValue = true; |
||||
} else { |
||||
this.singleValue = true; |
||||
} |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value) { |
||||
this(condition, value, null); |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.value = value; |
||||
this.secondValue = secondValue; |
||||
this.typeHandler = typeHandler; |
||||
this.betweenValue = true; |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) { |
||||
this(condition, value, secondValue, null); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,77 @@
|
||||
package com.hnac.hzims.baseinfo.entity; |
||||
|
||||
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 com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
import java.io.Serializable; |
||||
import java.time.LocalDateTime; |
||||
|
||||
@Data |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@Accessors(chain = true) |
||||
@TableName("preview_info") |
||||
public class PreviewInfo implements Serializable { |
||||
|
||||
private static final long serialVersionUID=1L; |
||||
|
||||
@JsonSerialize( |
||||
using = ToStringSerializer.class |
||||
) |
||||
@ApiModelProperty("主键id") |
||||
@TableId( |
||||
value = "id", |
||||
type = IdType.ASSIGN_ID |
||||
) |
||||
private Long id; |
||||
|
||||
/** |
||||
* 预演消息 |
||||
*/ |
||||
@TableField("preview_message") |
||||
private String previewMessage; |
||||
|
||||
/** |
||||
* 水库编码 |
||||
*/ |
||||
@TableField("stcd") |
||||
private String stcd; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
@TableField("create_time") |
||||
private LocalDateTime createTime; |
||||
|
||||
|
||||
/** |
||||
* 修改时间 |
||||
*/ |
||||
@TableField("update_time") |
||||
private LocalDateTime updateTime; |
||||
|
||||
/** |
||||
* 告警类型 |
||||
*/ |
||||
@TableField("type") |
||||
private String type; |
||||
/** |
||||
* 水库名称 |
||||
*/ |
||||
@TableField(exist = false) |
||||
private String name; |
||||
|
||||
@TableField(exist = false) |
||||
private String stnm; |
||||
|
||||
@TableField(exist = false) |
||||
private String createTimeStr; |
||||
|
||||
} |
@ -0,0 +1,91 @@
|
||||
package com.hnac.hzims.baseinfo.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* <p> |
||||
* 预演方案内容表 |
||||
* </p> |
||||
* |
||||
* @author zhaiqm |
||||
* @since 2023-09-01 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@Accessors(chain = true) |
||||
@TableName("preview_scheme_content") |
||||
public class PreviewSchemeContent extends TenantEntity implements Serializable { |
||||
|
||||
private static final long serialVersionUID=1L; |
||||
|
||||
|
||||
/** |
||||
* 方案id |
||||
*/ |
||||
@TableField("scheme_id") |
||||
private String schemeId; |
||||
|
||||
/** |
||||
* 预演时间点 |
||||
*/ |
||||
@TableField("preview_time") |
||||
private Date previewTime; |
||||
|
||||
/** |
||||
* 降雨量(mm) |
||||
*/ |
||||
@TableField("rain_capacity") |
||||
private BigDecimal rainCapacity; |
||||
|
||||
/** |
||||
* 来水量 |
||||
*/ |
||||
@TableField("inflow") |
||||
private BigDecimal inflow; |
||||
|
||||
/** |
||||
* 水库水位(m) |
||||
*/ |
||||
@TableField("reservoir_level") |
||||
private BigDecimal reservoirLevel; |
||||
|
||||
/** |
||||
* 机组出力(kW) |
||||
*/ |
||||
@TableField("unit_output") |
||||
private BigDecimal unitOutput; |
||||
|
||||
/** |
||||
* 下游水位(m) |
||||
*/ |
||||
@TableField("tail_water_level") |
||||
private BigDecimal tailWaterLevel; |
||||
|
||||
/** |
||||
* 发电量(kWh) |
||||
*/ |
||||
@TableField("elec_gen_capacity") |
||||
private BigDecimal elecGenCapacity; |
||||
|
||||
/** |
||||
* 累计发电量(kWh) |
||||
*/ |
||||
@TableField("total_elec_gen_capacity") |
||||
private BigDecimal totalelecGenCapacity; |
||||
|
||||
private String remark; |
||||
|
||||
private String stcd; |
||||
|
||||
private String dmcd; |
||||
|
||||
} |
@ -0,0 +1,59 @@
|
||||
package com.hnac.hzims.baseinfo.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* <p> |
||||
* 预演方案对象表 |
||||
* </p> |
||||
* |
||||
* @author zhaiqm |
||||
* @since 2023-09-01 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@Accessors(chain = true) |
||||
@TableName("preview_scheme_info") |
||||
public class PreviewSchemeInfo extends TenantEntity implements Serializable { |
||||
|
||||
private static final long serialVersionUID=1L; |
||||
|
||||
/** |
||||
* 方案名称 |
||||
*/ |
||||
@TableField("scheme_name") |
||||
private String schemeName; |
||||
|
||||
/** |
||||
* 水库编码 |
||||
*/ |
||||
@TableField("stcd") |
||||
private String stcd; |
||||
|
||||
/** |
||||
* 流域编码 |
||||
*/ |
||||
@TableField("bscd") |
||||
private String bscd; |
||||
|
||||
/** |
||||
* 大坝编码 |
||||
*/ |
||||
@TableField("dmcd") |
||||
private String dmcd; |
||||
|
||||
|
||||
/** |
||||
* 电站id,多个英文逗号分隔 |
||||
*/ |
||||
@TableField("station_id") |
||||
private String stationId; |
||||
|
||||
} |
@ -0,0 +1,107 @@
|
||||
package com.hnac.hzims.baseinfo.entity; |
||||
|
||||
/** |
||||
* 封装一个key,value键值对象 |
||||
* 可能是数据库返回查询数据 |
||||
* 也可能是使用的对象由于数据需要置为- |
||||
* 所以采用String存储处理 |
||||
* |
||||
* @Author: liugang |
||||
* @Date: 2019/7/8 16:02 |
||||
*/ |
||||
public class ReportDataBase { |
||||
|
||||
private String keyStr; |
||||
|
||||
private String keyDate; |
||||
|
||||
private String val; |
||||
//测站 或 属性
|
||||
private String stcd; |
||||
//属性名
|
||||
private String name; |
||||
|
||||
private Double value; |
||||
|
||||
private int month=-1; |
||||
|
||||
private String day; |
||||
|
||||
public String getDay() { |
||||
return day; |
||||
} |
||||
|
||||
public void setDay(String day) { |
||||
this.day = day; |
||||
} |
||||
|
||||
public int getMonth() { |
||||
return month; |
||||
} |
||||
|
||||
public void setMonth(int month) { |
||||
this.month = month; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
|
||||
public String getStcd() { |
||||
return stcd; |
||||
} |
||||
|
||||
public void setStcd(String stcd) { |
||||
this.stcd = stcd; |
||||
} |
||||
|
||||
public ReportDataBase() { |
||||
} |
||||
|
||||
public String getKeyDate() { |
||||
return keyDate; |
||||
} |
||||
|
||||
public void setKeyDate(String keyDate) { |
||||
this.keyDate = keyDate; |
||||
} |
||||
|
||||
public ReportDataBase(String keyStr, String val) { |
||||
this.keyStr = keyStr; |
||||
this.val = val; |
||||
} |
||||
|
||||
public String getKeyStr() { |
||||
return keyStr; |
||||
} |
||||
|
||||
public void setKeyStr(String keyStr) { |
||||
this.keyStr = keyStr; |
||||
} |
||||
|
||||
public String getVal() { |
||||
return val; |
||||
} |
||||
|
||||
public void setVal(String val) { |
||||
this.val = val; |
||||
} |
||||
|
||||
public Double getValue() { |
||||
if(val!=null && !"".equals(val.trim())) { |
||||
if(val.indexOf("-")==-1) { |
||||
return Double.valueOf(val); |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
public void setValue(Double value) { |
||||
this.value = value; |
||||
} |
||||
} |
||||
|
@ -0,0 +1,599 @@
|
||||
package com.hnac.hzims.baseinfo.entity; |
||||
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.hnac.hzims.baseinfo.vo.ReservoirInfoVo; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
|
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 水库基本信息表 《参照国标自行设计》 |
||||
* |
||||
* @author moze |
||||
* |
||||
*/ |
||||
public class ReservoirInfo { |
||||
private String stcd; // 水库编号
|
||||
|
||||
private String stationid; // 站点ID
|
||||
|
||||
private Float discharge; // 水库核定下泄流量 m³/s
|
||||
|
||||
private String name; // 水库名称
|
||||
|
||||
private String location; // 水库地址
|
||||
|
||||
private String village; // 所在乡镇村
|
||||
|
||||
private Float roadlength; // 防汛公路长度 m
|
||||
|
||||
private String roadconditiion;// 防汛公路状况
|
||||
|
||||
private Date builddate;// 建设时间
|
||||
|
||||
private Date completeddate;// 竣工时间
|
||||
|
||||
private Float rainarea;// 积雨面积km²
|
||||
|
||||
private Float designedfloodflow;// 设计洪水流量m³/s
|
||||
|
||||
private Float chedkedfloodflow;// 校核洪水流量m³/s
|
||||
|
||||
private Float designedfillarea;// 设计灌面km²
|
||||
|
||||
private Float designedtotalflow;// 设计洪水总量 万m³
|
||||
|
||||
private Float checdedtotalflow;// 校核洪水总量 万m³
|
||||
|
||||
private Float averagerainfall;// 平均降雨量 mm
|
||||
|
||||
private Float designedmaxflow;// 设计最大泄量 m³/s
|
||||
|
||||
private Float checkedmaxflow;// 校核最大泄量m³/s
|
||||
|
||||
private Float volume;// 总库容 万m³
|
||||
|
||||
private Float checkedfloodlevel;// 校核洪水位
|
||||
|
||||
private Float historicalmaxlevel;// 历史最高水位
|
||||
|
||||
private Float floodcontrolvolume;// 防洪库容 万m³
|
||||
|
||||
private Float designedfloodlevel; // 设计洪水位 m
|
||||
|
||||
private Date maxleveltime; // 最高水位发生时间
|
||||
|
||||
private Float utilizablevolume; // 兴利库容万m³
|
||||
|
||||
private Float norrmallevel; // 正常蓄水位 m
|
||||
|
||||
private Float flooddetentionvolume; // 滞洪库容 万m³
|
||||
|
||||
private Float deadlevel; // 死水位 m
|
||||
|
||||
private String areaCode; // 行政区划Code
|
||||
|
||||
private String lrcd; // 湖库代码
|
||||
|
||||
private String szhldm; // 所在河流代码
|
||||
|
||||
private Float dongj; // 东经
|
||||
|
||||
private Float beiw; // 北纬
|
||||
|
||||
private Float mjflsscnwl; //主汛期限制水位
|
||||
|
||||
private String adminPersonName;// 行政责任人
|
||||
|
||||
private String adminPersonFunction;// 行政责任人职务
|
||||
|
||||
private String adminPersonPhone;// 行政责任人电话
|
||||
|
||||
private String technicalPersonName;// 技术责任人
|
||||
|
||||
private String technicalPersonFunction;// 技术责任人职务
|
||||
|
||||
private String technicalPersonPhone;// 技术责任人电话
|
||||
|
||||
private String patrolPersonName;// 巡查责任人
|
||||
|
||||
private String patrolPersonFunction;// 巡查责任人职务
|
||||
|
||||
private String patrolPersonPhone;// 巡查责任人电话
|
||||
|
||||
private String spillwayType;// 溢洪道型式
|
||||
|
||||
private Float overflowSectionLen;// 正常溢洪道-溢流段长或堰顶宽(m)
|
||||
|
||||
private Float weirTopElev;// 正常溢洪道-堰(槛)顶高程(m)
|
||||
|
||||
private Float maxFloodDischarge;// 最大泄洪流量(m³/s)
|
||||
|
||||
private String bscd;//流域编码
|
||||
|
||||
@ApiModelProperty("是否已删除") |
||||
private Integer isDeleted; |
||||
|
||||
private Integer sort; |
||||
|
||||
@TableField(exist = false) |
||||
private List<ThreeDuty> threeDutyList;//三个责任人
|
||||
|
||||
public Integer getIsDeleted() { |
||||
return isDeleted; |
||||
} |
||||
|
||||
public void setIsDeleted(Integer isDeleted) { |
||||
this.isDeleted = isDeleted; |
||||
} |
||||
|
||||
public String getAdminPersonName() { |
||||
return adminPersonName; |
||||
} |
||||
|
||||
public void setAdminPersonName(String adminPersonName) { |
||||
this.adminPersonName = adminPersonName; |
||||
} |
||||
|
||||
public String getAdminPersonFunction() { |
||||
return adminPersonFunction; |
||||
} |
||||
|
||||
public void setAdminPersonFunction(String adminPersonFunction) { |
||||
this.adminPersonFunction = adminPersonFunction; |
||||
} |
||||
|
||||
public String getAdminPersonPhone() { |
||||
return adminPersonPhone; |
||||
} |
||||
|
||||
public void setAdminPersonPhone(String adminPersonPhone) { |
||||
this.adminPersonPhone = adminPersonPhone; |
||||
} |
||||
|
||||
public String getTechnicalPersonName() { |
||||
return technicalPersonName; |
||||
} |
||||
|
||||
public void setTechnicalPersonName(String technicalPersonName) { |
||||
this.technicalPersonName = technicalPersonName; |
||||
} |
||||
|
||||
public String getTechnicalPersonFunction() { |
||||
return technicalPersonFunction; |
||||
} |
||||
|
||||
public void setTechnicalPersonFunction(String technicalPersonFunction) { |
||||
this.technicalPersonFunction = technicalPersonFunction; |
||||
} |
||||
|
||||
public String getTechnicalPersonPhone() { |
||||
return technicalPersonPhone; |
||||
} |
||||
|
||||
public void setTechnicalPersonPhone(String technicalPersonPhone) { |
||||
this.technicalPersonPhone = technicalPersonPhone; |
||||
} |
||||
|
||||
public String getPatrolPersonName() { |
||||
return patrolPersonName; |
||||
} |
||||
|
||||
public void setPatrolPersonName(String patrolPersonName) { |
||||
this.patrolPersonName = patrolPersonName; |
||||
} |
||||
|
||||
public String getPatrolPersonFunction() { |
||||
return patrolPersonFunction; |
||||
} |
||||
|
||||
public void setPatrolPersonFunction(String patrolPersonFunction) { |
||||
this.patrolPersonFunction = patrolPersonFunction; |
||||
} |
||||
|
||||
public String getPatrolPersonPhone() { |
||||
return patrolPersonPhone; |
||||
} |
||||
|
||||
public void setPatrolPersonPhone(String patrolPersonPhone) { |
||||
this.patrolPersonPhone = patrolPersonPhone; |
||||
} |
||||
|
||||
public Float getMjflsscnwl() { |
||||
return mjflsscnwl; |
||||
} |
||||
|
||||
public void setMjflsscnwl(Float mjflsscnwl) { |
||||
this.mjflsscnwl = mjflsscnwl; |
||||
} |
||||
|
||||
public String getAreaCode() { |
||||
return areaCode; |
||||
} |
||||
|
||||
public void setAreaCode(String areaCode) { |
||||
this.areaCode = areaCode; |
||||
} |
||||
|
||||
public String getLrcd() { |
||||
return lrcd; |
||||
} |
||||
|
||||
public void setLrcd(String lrcd) { |
||||
this.lrcd = lrcd; |
||||
} |
||||
|
||||
public String getSzhldm() { |
||||
return szhldm; |
||||
} |
||||
|
||||
public void setSzhldm(String szhldm) { |
||||
this.szhldm = szhldm; |
||||
} |
||||
|
||||
public Float getDongj() { |
||||
return dongj; |
||||
} |
||||
|
||||
public void setDongj(Float dongj) { |
||||
this.dongj = dongj; |
||||
} |
||||
|
||||
public Float getBeiw() { |
||||
return beiw; |
||||
} |
||||
|
||||
public void setBeiw(Float beiw) { |
||||
this.beiw = beiw; |
||||
} |
||||
|
||||
public ReservoirInfo() { |
||||
} |
||||
|
||||
public ReservoirInfo(ReservoirInfoVo vo) { |
||||
this.averagerainfall = vo.getAveragerainfall(); |
||||
this.builddate = vo.getBuilddate(); |
||||
this.checdedtotalflow = vo.getChecdedtotalflow(); |
||||
this.checkedfloodlevel = vo.getCheckedfloodlevel(); |
||||
this.checkedmaxflow = vo.getCheckedmaxflow(); |
||||
this.chedkedfloodflow = vo.getChedkedfloodflow(); |
||||
this.completeddate = vo.getCompleteddate(); |
||||
this.deadlevel = vo.getDeadlevel(); |
||||
this.designedfillarea = vo.getDesignedfillarea(); |
||||
this.designedfloodflow = vo.getDesignedfloodflow(); |
||||
this.designedfloodlevel = vo.getDesignedfloodlevel(); |
||||
this.designedmaxflow = vo.getDesignedmaxflow(); |
||||
this.designedtotalflow = vo.getDesignedtotalflow(); |
||||
this.discharge = vo.getDischarge(); |
||||
this.floodcontrolvolume = vo.getFloodcontrolvolume(); |
||||
this.flooddetentionvolume = vo.getFlooddetentionvolume(); |
||||
this.historicalmaxlevel = vo.getHistoricalmaxlevel(); |
||||
this.location = vo.getLocation(); |
||||
this.maxleveltime = vo.getMaxleveltime(); |
||||
this.name = vo.getName(); |
||||
this.norrmallevel = vo.getNorrmallevel(); |
||||
this.rainarea = vo.getRainarea(); |
||||
this.roadconditiion = vo.getRoadconditiion(); |
||||
this.roadlength = vo.getRoadlength(); |
||||
this.stationid = vo.getStationid(); |
||||
this.stcd = vo.getStcd(); |
||||
this.utilizablevolume = vo.getUtilizablevolume(); |
||||
this.village = vo.getVillage(); |
||||
this.volume = vo.getVolume(); |
||||
this.areaCode = vo.getAreaCode(); |
||||
this.beiw = vo.getBeiw(); |
||||
this.dongj = vo.getDongj(); |
||||
this.lrcd = vo.getLrcd(); |
||||
this.szhldm = vo.getSzhldm(); |
||||
this.areaCode = vo.getAreaCode(); |
||||
this.mjflsscnwl = vo.getMjflsscnwl(); |
||||
this.adminPersonName = vo.getAdminPersonName(); |
||||
this.adminPersonFunction = vo.getAdminPersonFunction(); |
||||
this.adminPersonPhone = vo.getAdminPersonPhone(); |
||||
this.technicalPersonName = vo.getTechnicalPersonName(); |
||||
this.technicalPersonFunction = vo.getTechnicalPersonFunction(); |
||||
this.technicalPersonPhone = vo.getTechnicalPersonPhone(); |
||||
this.patrolPersonName = vo.getPatrolPersonName(); |
||||
this.patrolPersonFunction = vo.getPatrolPersonFunction(); |
||||
this.patrolPersonPhone = vo.getPatrolPersonPhone(); |
||||
this.spillwayType = vo.getSpillwayType(); |
||||
this.overflowSectionLen = vo.getOverflowSectionLen(); |
||||
this.weirTopElev = vo.getWeirTopElev(); |
||||
this.maxFloodDischarge = vo.getMaxFloodDischarge(); |
||||
this.threeDutyList = vo.getThreeDutyList(); |
||||
this.bscd = vo.getBscd(); |
||||
this.sort = vo.getSort(); |
||||
} |
||||
|
||||
public String getStcd() { |
||||
return stcd; |
||||
} |
||||
|
||||
public void setStcd(String stcd) { |
||||
this.stcd = stcd; |
||||
} |
||||
|
||||
public String getStationid() { |
||||
return stationid; |
||||
} |
||||
|
||||
public void setStationid(String stationid) { |
||||
this.stationid = stationid; |
||||
} |
||||
|
||||
public Float getDischarge() { |
||||
return discharge; |
||||
} |
||||
|
||||
public void setDischarge(Float discharge) { |
||||
this.discharge = discharge; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
|
||||
public String getLocation() { |
||||
return location; |
||||
} |
||||
|
||||
public void setLocation(String location) { |
||||
this.location = location; |
||||
} |
||||
|
||||
public String getVillage() { |
||||
return village; |
||||
} |
||||
|
||||
public void setVillage(String village) { |
||||
this.village = village; |
||||
} |
||||
|
||||
public Float getRoadlength() { |
||||
return roadlength; |
||||
} |
||||
|
||||
public void setRoadlength(Float roadlength) { |
||||
this.roadlength = roadlength; |
||||
} |
||||
|
||||
public String getRoadconditiion() { |
||||
return roadconditiion; |
||||
} |
||||
|
||||
public void setRoadconditiion(String roadconditiion) { |
||||
this.roadconditiion = roadconditiion; |
||||
} |
||||
|
||||
public Date getBuilddate() { |
||||
return builddate; |
||||
} |
||||
|
||||
public void setBuilddate(Date builddate) { |
||||
this.builddate = builddate; |
||||
} |
||||
|
||||
public Date getCompleteddate() { |
||||
return completeddate; |
||||
} |
||||
|
||||
public void setCompleteddate(Date completeddate) { |
||||
this.completeddate = completeddate; |
||||
} |
||||
|
||||
public Float getRainarea() { |
||||
return rainarea; |
||||
} |
||||
|
||||
public void setRainarea(Float rainarea) { |
||||
this.rainarea = rainarea; |
||||
} |
||||
|
||||
public Float getDesignedfloodflow() { |
||||
return designedfloodflow; |
||||
} |
||||
|
||||
public void setDesignedfloodflow(Float designedfloodflow) { |
||||
this.designedfloodflow = designedfloodflow; |
||||
} |
||||
|
||||
public Float getChedkedfloodflow() { |
||||
return chedkedfloodflow; |
||||
} |
||||
|
||||
public void setChedkedfloodflow(Float chedkedfloodflow) { |
||||
this.chedkedfloodflow = chedkedfloodflow; |
||||
} |
||||
|
||||
public Float getDesignedfillarea() { |
||||
return designedfillarea; |
||||
} |
||||
|
||||
public void setDesignedfillarea(Float designedfillarea) { |
||||
this.designedfillarea = designedfillarea; |
||||
} |
||||
|
||||
public Float getDesignedtotalflow() { |
||||
return designedtotalflow; |
||||
} |
||||
|
||||
public void setDesignedtotalflow(Float designedtotalflow) { |
||||
this.designedtotalflow = designedtotalflow; |
||||
} |
||||
|
||||
public Float getChecdedtotalflow() { |
||||
return checdedtotalflow; |
||||
} |
||||
|
||||
public void setChecdedtotalflow(Float checdedtotalflow) { |
||||
this.checdedtotalflow = checdedtotalflow; |
||||
} |
||||
|
||||
public Float getAveragerainfall() { |
||||
return averagerainfall; |
||||
} |
||||
|
||||
public void setAveragerainfall(Float averagerainfall) { |
||||
this.averagerainfall = averagerainfall; |
||||
} |
||||
|
||||
public Float getDesignedmaxflow() { |
||||
return designedmaxflow; |
||||
} |
||||
|
||||
public void setDesignedmaxflow(Float designedmaxflow) { |
||||
this.designedmaxflow = designedmaxflow; |
||||
} |
||||
|
||||
public Float getCheckedmaxflow() { |
||||
return checkedmaxflow; |
||||
} |
||||
|
||||
public void setCheckedmaxflow(Float checkedmaxflow) { |
||||
this.checkedmaxflow = checkedmaxflow; |
||||
} |
||||
|
||||
public Float getVolume() { |
||||
return volume; |
||||
} |
||||
|
||||
public void setVolume(Float volume) { |
||||
this.volume = volume; |
||||
} |
||||
|
||||
public Float getCheckedfloodlevel() { |
||||
return checkedfloodlevel; |
||||
} |
||||
|
||||
public void setCheckedfloodlevel(Float checkedfloodlevel) { |
||||
this.checkedfloodlevel = checkedfloodlevel; |
||||
} |
||||
|
||||
public Float getHistoricalmaxlevel() { |
||||
return historicalmaxlevel; |
||||
} |
||||
|
||||
public void setHistoricalmaxlevel(Float historicalmaxlevel) { |
||||
this.historicalmaxlevel = historicalmaxlevel; |
||||
} |
||||
|
||||
public Float getFloodcontrolvolume() { |
||||
return floodcontrolvolume; |
||||
} |
||||
|
||||
public void setFloodcontrolvolume(Float floodcontrolvolume) { |
||||
this.floodcontrolvolume = floodcontrolvolume; |
||||
} |
||||
|
||||
public Float getDesignedfloodlevel() { |
||||
return designedfloodlevel; |
||||
} |
||||
|
||||
public void setDesignedfloodlevel(Float designedfloodlevel) { |
||||
this.designedfloodlevel = designedfloodlevel; |
||||
} |
||||
|
||||
public Date getMaxleveltime() { |
||||
return maxleveltime; |
||||
} |
||||
|
||||
public void setMaxleveltime(Date maxleveltime) { |
||||
this.maxleveltime = maxleveltime; |
||||
} |
||||
|
||||
public Float getUtilizablevolume() { |
||||
return utilizablevolume; |
||||
} |
||||
|
||||
public void setUtilizablevolume(Float utilizablevolume) { |
||||
this.utilizablevolume = utilizablevolume; |
||||
} |
||||
|
||||
public Float getNorrmallevel() { |
||||
return norrmallevel; |
||||
} |
||||
|
||||
public void setNorrmallevel(Float norrmallevel) { |
||||
this.norrmallevel = norrmallevel; |
||||
} |
||||
|
||||
public Float getFlooddetentionvolume() { |
||||
return flooddetentionvolume; |
||||
} |
||||
|
||||
public void setFlooddetentionvolume(Float flooddetentionvolume) { |
||||
this.flooddetentionvolume = flooddetentionvolume; |
||||
} |
||||
|
||||
public Float getDeadlevel() { |
||||
return deadlevel; |
||||
} |
||||
|
||||
public void setDeadlevel(Float deadlevel) { |
||||
this.deadlevel = deadlevel; |
||||
} |
||||
|
||||
public String getSpillwayType() { |
||||
return spillwayType; |
||||
} |
||||
|
||||
public void setSpillwayType(String spillwayType) { |
||||
this.spillwayType = spillwayType; |
||||
} |
||||
|
||||
public Float getOverflowSectionLen() { |
||||
return overflowSectionLen; |
||||
} |
||||
|
||||
public void setOverflowSectionLen(Float overflowSectionLen) { |
||||
this.overflowSectionLen = overflowSectionLen; |
||||
} |
||||
|
||||
public Float getWeirTopElev() { |
||||
return weirTopElev; |
||||
} |
||||
|
||||
public void setWeirTopElev(Float weirTopElev) { |
||||
this.weirTopElev = weirTopElev; |
||||
} |
||||
|
||||
public Float getMaxFloodDischarge() { |
||||
return maxFloodDischarge; |
||||
} |
||||
|
||||
public void setMaxFloodDischarge(Float maxFloodDischarge) { |
||||
this.maxFloodDischarge = maxFloodDischarge; |
||||
} |
||||
|
||||
public List<ThreeDuty> getThreeDutyList() { |
||||
return threeDutyList; |
||||
} |
||||
|
||||
public void setThreeDutyList(List<ThreeDuty> threeDutyList) { |
||||
this.threeDutyList = threeDutyList; |
||||
} |
||||
|
||||
public String getBscd() { |
||||
return bscd; |
||||
} |
||||
|
||||
public void setBscd(String bscd) { |
||||
this.bscd = bscd; |
||||
} |
||||
|
||||
public Integer getSort() { |
||||
return sort; |
||||
} |
||||
|
||||
public void setSort(Integer sort) { |
||||
this.sort = sort; |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,50 @@
|
||||
package com.hnac.hzims.baseinfo.entity; |
||||
|
||||
/** |
||||
* 水库数据扩展表 |
||||
* |
||||
* @author moze |
||||
* |
||||
*/ |
||||
public class ReservoirRefdata { |
||||
private String stcd; // 水库编号
|
||||
|
||||
private String refstcd; // 关联测站
|
||||
|
||||
private String refqpoint; // 关联流量数据点
|
||||
|
||||
private String refzpoint; // 关联水位数据点
|
||||
|
||||
public String getStcd() { |
||||
return stcd; |
||||
} |
||||
|
||||
public void setStcd(String stcd) { |
||||
this.stcd = stcd; |
||||
} |
||||
|
||||
public String getRefstcd() { |
||||
return refstcd; |
||||
} |
||||
|
||||
public void setRefstcd(String refstcd) { |
||||
this.refstcd = refstcd; |
||||
} |
||||
|
||||
public String getRefqpoint() { |
||||
return refqpoint; |
||||
} |
||||
|
||||
public void setRefqpoint(String refqpoint) { |
||||
this.refqpoint = refqpoint; |
||||
} |
||||
|
||||
public String getRefzpoint() { |
||||
return refzpoint; |
||||
} |
||||
|
||||
public void setRefzpoint(String refzpoint) { |
||||
this.refzpoint = refzpoint; |
||||
} |
||||
|
||||
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue