Commit 90c96d5d authored by 喻训浩's avatar 喻训浩

fix:搜索修改

parent 77b3fca0
...@@ -6,6 +6,7 @@ import net.vtstar.user.search.Search; ...@@ -6,6 +6,7 @@ import net.vtstar.user.search.Search;
import net.vtstar.user.util.ReadAnnotationUtils; import net.vtstar.user.util.ReadAnnotationUtils;
import net.vtstar.zhongtong.avi.global.web.Show; import net.vtstar.zhongtong.avi.global.web.Show;
import net.vtstar.zhongtong.avi.global.web.domain.ShowField; import net.vtstar.zhongtong.avi.global.web.domain.ShowField;
import net.vtstar.zhongtong.avi.global.web.domain.enums.FieldType;
import org.springframework.cache.Cache; import org.springframework.cache.Cache;
import org.springframework.context.ApplicationListener; import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.context.event.ContextRefreshedEvent;
...@@ -57,9 +58,14 @@ public class WebFiledListener implements ApplicationListener<ContextRefreshedEve ...@@ -57,9 +58,14 @@ public class WebFiledListener implements ApplicationListener<ContextRefreshedEve
log.error("{} 类{} 字段 @show 注解 label 属性未赋值", clazz, field.getName()); log.error("{} 类{} 字段 @show 注解 label 属性未赋值", clazz, field.getName());
} }
showFiled.setLabel(label); showFiled.setLabel(label);
FieldType fieldType = annotation.dataType();
if (null == fieldType) {
fieldType = FieldType.STRING;
}
showFiled.setDateType(fieldType.toString());
showFileds.add(showFiled); showFileds.add(showFiled);
} }
showFieldCache.put(clazzAnnotation.code(),showFileds); showFieldCache.put(clazzAnnotation.code(), showFileds);
} }
} }
} }
package net.vtstar.zhongtong.avi.global.web; package net.vtstar.zhongtong.avi.global.web;
import net.vtstar.zhongtong.avi.global.web.domain.enums.FieldType;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
...@@ -23,4 +25,9 @@ public @interface Show { ...@@ -23,4 +25,9 @@ public @interface Show {
* 是否排序 * 是否排序
*/ */
boolean sortable() default false; boolean sortable() default false;
/**
* 数据类型
*/
FieldType dataType() default FieldType.STRING;
} }
...@@ -16,4 +16,7 @@ public class ShowField { ...@@ -16,4 +16,7 @@ public class ShowField {
@ApiModelProperty("是否排序") @ApiModelProperty("是否排序")
private boolean sortable; private boolean sortable;
@ApiModelProperty("数据类型")
private String dateType;
} }
package net.vtstar.zhongtong.avi.global.web.domain.enums;
public enum FieldType {
STRING,
NUMBER,
DATETIME,
ENUMS;
}
...@@ -6,6 +6,7 @@ import lombok.Data; ...@@ -6,6 +6,7 @@ import lombok.Data;
import net.vtstar.scada.base.gather.domain.EquipmentData; import net.vtstar.scada.base.gather.domain.EquipmentData;
import net.vtstar.user.search.Search; import net.vtstar.user.search.Search;
import net.vtstar.zhongtong.avi.global.web.Show; import net.vtstar.zhongtong.avi.global.web.Show;
import net.vtstar.zhongtong.avi.global.web.domain.enums.FieldType;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
...@@ -31,11 +32,9 @@ public class LaserCuttingMachine extends EquipmentData { ...@@ -31,11 +32,9 @@ public class LaserCuttingMachine extends EquipmentData {
private BigDecimal gasPressure; private BigDecimal gasPressure;
@Search @Search
@Show(label = "时间") @Show(label = "时间",dataType = FieldType.DATETIME)
@ApiModelProperty("气体压力") @ApiModelProperty("时间")
private Date createTime; private Date createTime;
private Integer state;
private String state;
} }
package net.vtstar.zhongtong.avi.stamping.job; package net.vtstar.zhongtong.avi.stamping.job;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.vtstar.scada.base.equipmgt.domain.Enum.EquipStatusEnum;
import net.vtstar.scada.base.gather.domain.EquipmentData; import net.vtstar.scada.base.gather.domain.EquipmentData;
import net.vtstar.scada.base.gather.job.GatherJob; import net.vtstar.scada.base.gather.job.GatherJob;
import net.vtstar.zhongtong.avi.stamping.domain.LaserCuttingMachine; import net.vtstar.zhongtong.avi.stamping.domain.LaserCuttingMachine;
...@@ -27,7 +28,22 @@ public class LaserCuttingMachineJob extends GatherJob { ...@@ -27,7 +28,22 @@ public class LaserCuttingMachineJob extends GatherJob {
} }
protected boolean handleObject(EquipmentData equipmentData) { protected boolean handleObject(EquipmentData equipmentData) {
LaserCuttingMachine data = (LaserCuttingMachine) equipmentData; LaserCuttingMachine data = (LaserCuttingMachine) equipmentData;
Integer state = data.getState();
if (state == null) {
return false;
}
switch (state) {
case 0:
equipmentData.setEquipStatus(EquipStatusEnum.SHUTDOWN);
break;
case 1:
equipmentData.setEquipStatus(EquipStatusEnum.RUN);
break;
default:
return false; return false;
} }
return true;
}
} }
...@@ -5,3 +5,8 @@ spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver ...@@ -5,3 +5,8 @@ spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://10.100.172.135:3306/zhongtong_dev?useSSL=false&useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai spring.datasource.url=jdbc:mysql://10.100.172.135:3306/zhongtong_dev?useSSL=false&useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
spring.datasource.username=zhongtongdev spring.datasource.username=zhongtongdev
spring.datasource.password=123456 spring.datasource.password=123456
# redis
#spring.redis.host=172.16.0.252
#spring.redis.port=6379
#spring.redis.password=)OKM1qaz
\ No newline at end of file
# scheduler(Quartz) # scheduler(Quartz)
spring.quartz.job-store-type=jdbc spring.quartz.job-store-type=jdbc
spring.quartz.jdbc.initialize-schema=always spring.quartz.jdbc.initialize-schema=ALWAYS
spring.quartz.jdbc.comment-prefix=-- spring.quartz.jdbc.comment-prefix=--
spring.quartz.startupDelay=2s spring.quartz.startupDelay=2s
spring.quartz.auto-startup=true spring.quartz.auto-startup=true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment