diff --git a/stwzhj-api/stwzhj-api-system/src/main/java/org/dromara/system/api/RemoteDeviceService.java b/stwzhj-api/stwzhj-api-system/src/main/java/org/dromara/system/api/RemoteDeviceService.java index 13ae3840..8483387f 100644 --- a/stwzhj-api/stwzhj-api-system/src/main/java/org/dromara/system/api/RemoteDeviceService.java +++ b/stwzhj-api/stwzhj-api-system/src/main/java/org/dromara/system/api/RemoteDeviceService.java @@ -17,4 +17,6 @@ public interface RemoteDeviceService { R saveDeviceToSt(String infoSource, List list); + RemoteDeviceVo getDeviceInfo(String deviceCode,String deviceType); + } diff --git a/stwzhj-api/stwzhj-api-system/src/main/java/org/dromara/system/api/domain/bo/RemoteDeviceBo.java b/stwzhj-api/stwzhj-api-system/src/main/java/org/dromara/system/api/domain/bo/RemoteDeviceBo.java index ccabe023..eead2ac0 100644 --- a/stwzhj-api/stwzhj-api-system/src/main/java/org/dromara/system/api/domain/bo/RemoteDeviceBo.java +++ b/stwzhj-api/stwzhj-api-system/src/main/java/org/dromara/system/api/domain/bo/RemoteDeviceBo.java @@ -33,6 +33,10 @@ public class RemoteDeviceBo implements Serializable { @NotBlank(message = "设备类型不能为空", groups = { AddGroup.class, EditGroup.class }) private String deviceType; + private String sbpp; + + private String sbxh; + private String infoSource; /** @@ -67,6 +71,8 @@ public class RemoteDeviceBo implements Serializable { */ private String carNum; + private String cardNum; + /** * 0无效,1有效 */ @@ -82,6 +88,22 @@ public class RemoteDeviceBo implements Serializable { */ private String remark2; + private String lrdwdm; + + private String lrdwmc; + + private String lrrxm; + + private String lrrsfzh; + + private String xgdwdm; + + private String xgdwmc; + + private String xgrxm; + + private String xgrsfzh; + private String beginTime; private String endTime; diff --git a/stwzhj-api/stwzhj-api-system/src/main/java/org/dromara/system/api/domain/vo/RemoteDeviceVo.java b/stwzhj-api/stwzhj-api-system/src/main/java/org/dromara/system/api/domain/vo/RemoteDeviceVo.java index ee8e6deb..fe8fbb81 100644 --- a/stwzhj-api/stwzhj-api-system/src/main/java/org/dromara/system/api/domain/vo/RemoteDeviceVo.java +++ b/stwzhj-api/stwzhj-api-system/src/main/java/org/dromara/system/api/domain/vo/RemoteDeviceVo.java @@ -32,6 +32,10 @@ public class RemoteDeviceVo implements Serializable { */ private String deviceType; + private String sbpp; + + private String sbxh; + private String infoSource; /** @@ -64,6 +68,8 @@ public class RemoteDeviceVo implements Serializable { */ private String carNum; + private String cardNum; + /** * 0无效,1有效 */ @@ -82,4 +88,20 @@ public class RemoteDeviceVo implements Serializable { private String createTime; private String updateTime; + + private String lrdwdm; + + private String lrdwmc; + + private String lrrxm; + + private String lrrsfzh; + + private String xgdwdm; + + private String xgdwmc; + + private String xgrxm; + + private String xgrsfzh; } diff --git a/stwzhj-auth/src/main/java/org/dromara/auth/controller/TokenController.java b/stwzhj-auth/src/main/java/org/dromara/auth/controller/TokenController.java index 5efbffbc..3ac3bfdb 100644 --- a/stwzhj-auth/src/main/java/org/dromara/auth/controller/TokenController.java +++ b/stwzhj-auth/src/main/java/org/dromara/auth/controller/TokenController.java @@ -4,6 +4,8 @@ import cn.dev33.satoken.exception.NotLoginException; import cn.hutool.core.codec.Base64; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjectUtil; +import cn.hutool.json.JSONObject; +import cn.hutool.json.JSONUtil; import jakarta.servlet.http.HttpServletRequest; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -37,6 +39,7 @@ import org.dromara.system.api.RemoteSocialService; import org.dromara.system.api.RemoteTenantService; import org.dromara.system.api.domain.vo.RemoteClientVo; import org.dromara.system.api.domain.vo.RemoteTenantVo; +import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.web.bind.annotation.*; import java.net.URL; @@ -113,10 +116,11 @@ public class TokenController { * @param body 登录信息 * @return 结果 */ - @ApiEncrypt @PostMapping("/getToken") public R getToken(@RequestBody String body) { LoginBody loginBody = JsonUtils.parseObject(body, LoginBody.class); + JSONObject obj = JSONUtil.parseObj(body); + obj.set("userType","third"); ValidatorUtils.validate(loginBody); // 授权类型和客户端id String clientId = "e5cd7e4891bf95d1d19206ce24a7b32e"; @@ -124,7 +128,7 @@ public class TokenController { RemoteClientVo clientVo = remoteClientService.queryByClientId(clientId); // 登录 - LoginVo loginVo = IAuthStrategy.login(body, clientVo, grantType); + LoginVo loginVo = IAuthStrategy.login(obj.toString(), clientVo, grantType); return R.ok(loginVo); } diff --git a/stwzhj-auth/src/main/java/org/dromara/auth/service/impl/PasswordAuthStrategy.java b/stwzhj-auth/src/main/java/org/dromara/auth/service/impl/PasswordAuthStrategy.java index 0071ea4e..ea59443c 100644 --- a/stwzhj-auth/src/main/java/org/dromara/auth/service/impl/PasswordAuthStrategy.java +++ b/stwzhj-auth/src/main/java/org/dromara/auth/service/impl/PasswordAuthStrategy.java @@ -54,16 +54,20 @@ public class PasswordAuthStrategy implements IAuthStrategy { String password = loginBody.getPassword(); String code = loginBody.getCode(); String uuid = loginBody.getUuid(); + String userType = loginBody.getUserType(); // 验证码开关 - if (captchaProperties.getEnabled()) { - validateCaptcha(tenantId, username, code, uuid); + if (!"third".equals(userType)){ + if (captchaProperties.getEnabled()) { + validateCaptcha(tenantId, username, code, uuid); + } } LoginUser loginUser = TenantHelper.dynamic(tenantId, () -> { LoginUser user = remoteUserService.getUserInfo(username, tenantId); loginService.checkLogin(LoginType.PASSWORD, tenantId, username, () -> !BCrypt.checkpw(password, user.getPassword())); return user; }); + loginUser.setClientKey(client.getClientKey()); loginUser.setDeviceType(client.getDeviceType()); SaLoginModel model = new SaLoginModel(); diff --git a/stwzhj-common/stwzhj-common-core/src/main/java/org/dromara/common/core/domain/model/LoginBody.java b/stwzhj-common/stwzhj-common-core/src/main/java/org/dromara/common/core/domain/model/LoginBody.java index ee612fdb..03be8c77 100644 --- a/stwzhj-common/stwzhj-common-core/src/main/java/org/dromara/common/core/domain/model/LoginBody.java +++ b/stwzhj-common/stwzhj-common-core/src/main/java/org/dromara/common/core/domain/model/LoginBody.java @@ -16,13 +16,11 @@ public class LoginBody { /** * 客户端id */ - @NotBlank(message = "{auth.clientid.not.blank}") private String clientId; /** * 授权类型 */ - @NotBlank(message = "{auth.grant.type.not.blank}") private String grantType; /** @@ -40,4 +38,9 @@ public class LoginBody { */ private String uuid; + /* + * 用来判断是否为第三方授权用户 默认为空 即系统用户 + * */ + private String userType; + } diff --git a/stwzhj-modules/stwzhj-data2es/src/main/java/org/dromara/data2es/config/KafkaConfig.java b/stwzhj-modules/stwzhj-data2es/src/main/java/org/dromara/data2es/config/KafkaConfig.java index d2e119c6..9ccb8af0 100644 --- a/stwzhj-modules/stwzhj-data2es/src/main/java/org/dromara/data2es/config/KafkaConfig.java +++ b/stwzhj-modules/stwzhj-data2es/src/main/java/org/dromara/data2es/config/KafkaConfig.java @@ -27,8 +27,8 @@ public class KafkaConfig { // private String kafkaServers = "140.168.2.31:21007,140.168.2.32:21007,140.168.2.33:21007"; // private String kafkaServers = "53.208.61.105:6667,53.208.61.106:6667,53.208.61.107:6667";//六安GA网 // private String kafkaServers = "34.72.62.93:9092";//六安视频网 - private String kafkaServers = "127.0.0.1:9092";//本地 -// private String kafkaServers = "eurekahost1:9090,eurekahost2:9090,eurekahost3:9090";//省厅 +// private String kafkaServers = "127.0.0.1:9092";//本地 + private String kafkaServers = "53.207.8.71:9092,53.193.3.15:9092,53.160.0.237:9092,53.104.56.58:9092,53.128.22.61:9092";//省厅 马伟提供 private String groupId = "ruansiProducer"; @@ -128,6 +128,9 @@ public class KafkaConfig { // props.put(kerberosDomainName, "hadoop.hadoop.com"); //设置自定义的分区策略类,默认不传key,是粘性分区,尽量往一个分区中发消息。如果key不为null,则默认是按照key的hashcode与 partition的取余来决定哪个partition //props.put("partitioner.class","com.kafka.myparitioner.CidPartitioner"); + props.put(securityProtocol, "SASL_PLAINTEXT"); + props.put("sasl.jaas.config", "org.apache.kafka.common.security.scram.ScramLoginModule required username=\"zkxc\" password=\"zkxcKafka07252023\";"); + props.put("sasl.mechanism", "SCRAM-SHA-256"); KafkaProducer producer = new KafkaProducer<>(props); // KafkaProducer producer = new KafkaProducer<>(props); @@ -140,51 +143,6 @@ public class KafkaConfig { admin.setFatalIfBrokerNotAvailable(true); return admin; } - @Bean - public NewTopic topic5() { - return new NewTopic("topic.send.5", 1, (short) 1); - } - @Bean - public NewTopic topic1() { - return new NewTopic("topic.send.1", 1, (short) 1); - } - @Bean - public NewTopic topic2() { - return new NewTopic("topic.send.2", 1, (short) 1); - } - @Bean - public NewTopic topic3() { - return new NewTopic("topic.send.3", 1, (short) 1); - } - @Bean - public NewTopic topic4() { - return new NewTopic("topic.send.4", 1, (short) 1); - } - @Bean - public NewTopic topic6() { - return new NewTopic("topic.send.6", 1, (short) 1); - } - @Bean - public NewTopic topic_zfjly() { - return new NewTopic("topic_gps_zfjly", 1, (short) 1); - } - - - @Bean - public NewTopic topic_gps_car() { - return new NewTopic("topic_gps_car", 1, (short) 1); - } - - @Bean - public NewTopic topic_zfjly2() { - return new NewTopic("topic_gps_zfjly2", 3, (short) 1); - } - - - @Bean - public NewTopic topic_gps_car2() { - return new NewTopic("topic_gps_car2", 3, (short) 1); - } } diff --git a/stwzhj-modules/stwzhj-data2es/src/main/java/org/dromara/data2es/service/impl/GpsServiceImpl.java b/stwzhj-modules/stwzhj-data2es/src/main/java/org/dromara/data2es/service/impl/GpsServiceImpl.java index 91ca1efe..9def2bf2 100644 --- a/stwzhj-modules/stwzhj-data2es/src/main/java/org/dromara/data2es/service/impl/GpsServiceImpl.java +++ b/stwzhj-modules/stwzhj-data2es/src/main/java/org/dromara/data2es/service/impl/GpsServiceImpl.java @@ -7,6 +7,7 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.json.JSONUtil; import lombok.RequiredArgsConstructor; import org.apache.commons.lang.StringUtils; +import org.apache.dubbo.config.annotation.DubboReference; import org.dromara.common.core.domain.R; import org.dromara.common.core.utils.RedisConstants; import org.dromara.data2es.domain.EsGpsInfo; @@ -15,6 +16,8 @@ import org.dromara.data2es.domain.entity.GpsInfoEntity; import org.dromara.data2es.exception.MyBusinessException; import org.dromara.data2es.handler.RequestHandler; import org.dromara.data2es.service.IGpsService; +import org.dromara.system.api.RemoteDeviceService; +import org.dromara.system.api.domain.vo.RemoteDeviceVo; import org.elasticsearch.action.bulk.BulkRequest; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.index.IndexResponse; @@ -45,6 +48,9 @@ public class GpsServiceImpl implements IGpsService { @Autowired private RestHighLevelClient restHighLevelClient; + @DubboReference + private RemoteDeviceService deviceService; + private final RequestHandler requestHandler; private Logger logger = LoggerFactory.getLogger(GpsServiceImpl.class); @@ -133,9 +139,32 @@ public class GpsServiceImpl implements IGpsService { EsGpsInfoVO2 esGpsInfoVO2 = new EsGpsInfoVO2(); BeanUtil.copyProperties(esGpsInfo,esGpsInfoVO2); if(null == esGpsInfoVO2.getZzjgdm() || "".equals(esGpsInfoVO2.getZzjgdm())){ - esGpsInfoVO2.setZzjgdm(esGpsInfo.getInfoSource()+"00000000"); + RemoteDeviceVo vo = deviceService.getDeviceInfo(esGpsInfoVO2.getDeviceCode(),esGpsInfoVO2.getDeviceType()); + if (null != vo){ + esGpsInfoVO2.setZzjgdm(vo.getZzjgdm()); + esGpsInfoVO2.setZzjgmc(vo.getZzjgmc()); + esGpsInfoVO2.setPoliceName(vo.getPoliceName()); + esGpsInfoVO2.setPoliceNo(vo.getPoliceNo()); + esGpsInfoVO2.setCarNum(vo.getCarNum()); + String deviceType = vo.getDeviceType(); + if(StringUtils.isNotBlank(deviceType)){ + deviceType = deviceType.replaceAll("\"", ""); + if(deviceType.charAt(0) == '0' && deviceType.length() > 1){ + deviceType = deviceType.substring(1); + if(deviceType.equals("1")){ + deviceType = "2"; + } + } + } + esGpsInfoVO2.setDeviceType(deviceType); + }else { + esGpsInfoVO2.setDeviceType("99"); + esGpsInfoVO2.setZzjgdm(esGpsInfo.getInfoSource()+"00000000"); + } + } + return esGpsInfoVO2; } @@ -149,7 +178,7 @@ public class GpsServiceImpl implements IGpsService { * @param */ private String checkIndexExist() { - String todayIndexName = "gpsinfo"+ LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); + String todayIndexName = "rs_gpsinfo"+ LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); CreateIndexRequest createIndexRequest ; if(!existsIndex(todayIndexName)){ logger.error("进入了exist"); diff --git a/stwzhj-modules/stwzhj-data2es/src/main/java/org/dromara/data2es/util/ConfigConstants.java b/stwzhj-modules/stwzhj-data2es/src/main/java/org/dromara/data2es/util/ConfigConstants.java index 867ad32a..52f2b634 100644 --- a/stwzhj-modules/stwzhj-data2es/src/main/java/org/dromara/data2es/util/ConfigConstants.java +++ b/stwzhj-modules/stwzhj-data2es/src/main/java/org/dromara/data2es/util/ConfigConstants.java @@ -3,5 +3,5 @@ package org.dromara.data2es.util; public class ConfigConstants { public static final String HTTP_HEADER_AUTH_TOKEN = "Auth-Token"; - public static final String KAFKA_TOPIC_SEND_PRE = "topic.send"; + public static final String KAFKA_TOPIC_SEND_PRE = "rs_topic.send"; } diff --git a/stwzhj-modules/stwzhj-dataToGas/pom.xml b/stwzhj-modules/stwzhj-dataToGas/pom.xml new file mode 100644 index 00000000..71ebcd84 --- /dev/null +++ b/stwzhj-modules/stwzhj-dataToGas/pom.xml @@ -0,0 +1,98 @@ + + + + org.dromara + stwzhj-modules + ${revision} + + 4.0.0 + + stwzhj-dataToGas + + + stwzhj-dataToGas 数据上传到高斯库 + + + + + + + + org.dromara + stwzhj-common-log + + + + org.dromara + stwzhj-common-dict + + + + org.dromara + stwzhj-common-doc + + + + org.dromara + stwzhj-common-web + + + + org.dromara + stwzhj-common-mybatis + + + + + org.dromara + stwzhj-common-idempotent + + + + org.dromara + stwzhj-common-tenant + + + + org.dromara + stwzhj-common-security + + + + org.dromara + stwzhj-common-translation + + + + org.dromara + stwzhj-common-sensitive + + + + org.dromara + stwzhj-common-encrypt + + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + + repackage + + + + + + + + diff --git a/stwzhj-modules/stwzhj-dataToGas/src/main/java/org/dromara/data2gs/Data2GASApplication.java b/stwzhj-modules/stwzhj-dataToGas/src/main/java/org/dromara/data2gs/Data2GASApplication.java new file mode 100644 index 00000000..1b782833 --- /dev/null +++ b/stwzhj-modules/stwzhj-dataToGas/src/main/java/org/dromara/data2gs/Data2GASApplication.java @@ -0,0 +1,24 @@ +package org.dromara.data2gs; + +import org.apache.dubbo.config.spring.context.annotation.EnableDubbo; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup; +import org.springframework.scheduling.annotation.EnableScheduling; + +/** + * 系统模块 + * + * @author ruoyi + */ +@EnableDubbo +@EnableScheduling +@SpringBootApplication +public class Data2GASApplication { + public static void main(String[] args) { + SpringApplication application = new SpringApplication(Data2GASApplication.class); + application.setApplicationStartup(new BufferingApplicationStartup(2048)); + application.run(args); + System.out.println("(♥◠‿◠)ノ゙ 系统模块启动成功 ლ(´ڡ`ლ)゙ "); + } +} diff --git a/stwzhj-modules/stwzhj-dataToGas/src/main/resources/application.yml b/stwzhj-modules/stwzhj-dataToGas/src/main/resources/application.yml new file mode 100644 index 00000000..685078d5 --- /dev/null +++ b/stwzhj-modules/stwzhj-dataToGas/src/main/resources/application.yml @@ -0,0 +1,52 @@ +# Tomcat +server: + port: 9201 + +# Spring +spring: + datasource: + dynamic: + # 设置默认的数据源或者数据源组,默认值即为 master + primary: master + datasource: + # 主库数据源 + master: + type: ${spring.datasource.type} + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://localhost:3306/rs_doris_db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true + username: root + password: ycgis + slave: + type: ${spring.datasource.type} + driver-class-name: org.postgresql.Driver + url: jdbc:postgresql://53.1.213.131:25308/st_zazdr?currentSchema=public&useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true + username: ahrs + password: Ycgis!2509 + application: + # 应用名称 + name: stwzhj-system + profiles: + # 环境配置 + active: @profiles.active@ + +--- # nacos 配置 +spring: + cloud: + nacos: + # nacos 服务地址 + server-addr: @nacos.server@ + username: @nacos.username@ + password: @nacos.password@ + discovery: + # 注册组 + group: @nacos.discovery.group@ + namespace: ${spring.profiles.active} + config: + # 配置组 + group: @nacos.config.group@ + namespace: ${spring.profiles.active} + config: + import: + - optional:nacos:application-common.yml + - optional:nacos:datasource.yml + - optional:nacos:${spring.application.name}.yml diff --git a/stwzhj-modules/stwzhj-dataToGas/src/main/resources/banner.txt b/stwzhj-modules/stwzhj-dataToGas/src/main/resources/banner.txt new file mode 100644 index 00000000..fbd45f53 --- /dev/null +++ b/stwzhj-modules/stwzhj-dataToGas/src/main/resources/banner.txt @@ -0,0 +1,10 @@ +Spring Boot Version: ${spring-boot.version} +Spring Application Name: ${spring.application.name} + _ _ + (_) | | + _ __ _ _ ___ _ _ _ ______ ___ _ _ ___ | |_ ___ _ __ ___ +| '__|| | | | / _ \ | | | || ||______|/ __|| | | |/ __|| __| / _ \| '_ ` _ \ +| | | |_| || (_) || |_| || | \__ \| |_| |\__ \| |_ | __/| | | | | | +|_| \__,_| \___/ \__, ||_| |___/ \__, ||___/ \__| \___||_| |_| |_| + __/ | __/ | + |___/ |___/ \ No newline at end of file diff --git a/stwzhj-modules/stwzhj-dataToGas/src/main/resources/logback-plus.xml b/stwzhj-modules/stwzhj-dataToGas/src/main/resources/logback-plus.xml new file mode 100644 index 00000000..caaa3455 --- /dev/null +++ b/stwzhj-modules/stwzhj-dataToGas/src/main/resources/logback-plus.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + ${console.log.pattern} + utf-8 + + + + + + + + + + + + + + + diff --git a/stwzhj-modules/stwzhj-location/src/main/java/org/dromara/location/service/impl/SearchServiceImpl.java b/stwzhj-modules/stwzhj-location/src/main/java/org/dromara/location/service/impl/SearchServiceImpl.java index 972be5fb..2e60d742 100644 --- a/stwzhj-modules/stwzhj-location/src/main/java/org/dromara/location/service/impl/SearchServiceImpl.java +++ b/stwzhj-modules/stwzhj-location/src/main/java/org/dromara/location/service/impl/SearchServiceImpl.java @@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUtil; import lombok.RequiredArgsConstructor; import org.dromara.location.service.ISearchService; import org.elasticsearch.action.search.*; +import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.RequestOptions; import org.elasticsearch.client.RestHighLevelClient; import org.elasticsearch.core.TimeValue; @@ -64,9 +65,12 @@ public class SearchServiceImpl implements ISearchService { SearchSourceBuilder sourceBuilder = new SearchSourceBuilder(); sourceBuilder.query(boolBuilder).sort("gpsTime",SortOrder.ASC).size(5000); SearchRequest rq = new SearchRequest(); +// boolBuilder.withIndicesOptions(IndicesOptions.lenientExpandOpen()); rq.scroll(scroll); rq.source(sourceBuilder); rq.indices(esIndexByTime.toArray(new String[0])); + // 忽略因索引不存在导致的错误 + rq.indicesOptions(IndicesOptions.lenientExpandOpen()); // SearchResponse rp = null; try { SearchResponse rp = restHighLevelClient.search(rq,RequestOptions.DEFAULT); diff --git a/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/domain/TDevice.java b/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/domain/TDevice.java index c361169c..a87818ec 100644 --- a/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/domain/TDevice.java +++ b/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/domain/TDevice.java @@ -38,6 +38,10 @@ public class TDevice { */ private String deviceType; + private String sbpp; + + private String sbxh; + @MppMultiId private String infoSource; @@ -71,6 +75,8 @@ public class TDevice { */ private String carNum; + private String cardNum; + /** * 0无效,1有效 */ @@ -92,5 +98,21 @@ public class TDevice { @TableField(fill = FieldFill.INSERT_UPDATE) private String updateTime; + private String lrdwdm; + + private String lrdwmc; + + private String lrrxm; + + private String lrrsfzh; + + private String xgdwdm; + + private String xgdwmc; + + private String xgrxm; + + private String xgrsfzh; + } diff --git a/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/domain/bo/TDeviceBo.java b/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/domain/bo/TDeviceBo.java index 7befa14f..4f697e88 100644 --- a/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/domain/bo/TDeviceBo.java +++ b/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/domain/bo/TDeviceBo.java @@ -40,6 +40,10 @@ public class TDeviceBo extends BaseEntity { @NotBlank(message = "设备类型不能为空", groups = { AddGroup.class, EditGroup.class }) private String deviceType; + private String sbpp; + + private String sbxh; + /** * 组织机构代码 */ @@ -72,6 +76,8 @@ public class TDeviceBo extends BaseEntity { */ private String carNum; + private String cardNum; + /** * 0无效,1有效 */ @@ -87,5 +93,21 @@ public class TDeviceBo extends BaseEntity { */ private String remark2; + private String lrdwdm; + + private String lrdwmc; + + private String lrrxm; + + private String lrrsfzh; + + private String xgdwdm; + + private String xgdwmc; + + private String xgrxm; + + private String xgrsfzh; + } diff --git a/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/domain/vo/TDeviceVo.java b/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/domain/vo/TDeviceVo.java index a5ad6a17..38215862 100644 --- a/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/domain/vo/TDeviceVo.java +++ b/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/domain/vo/TDeviceVo.java @@ -40,12 +40,20 @@ public class TDeviceVo implements Serializable { @ExcelProperty(value = "外部系统设备编号建议21位") private String deviceCode; + // 警号、姓名、车牌号组合字段 + private String deviceName; + /** * 设备类型 */ @ExcelProperty(value = "设备类型") private String deviceType; + + private String sbpp; + + private String sbxh; + private String infoSource; /** @@ -88,6 +96,8 @@ public class TDeviceVo implements Serializable { @ExcelDictFormat(readConverterExp = "若=有") private String carNum; + private String cardNum; + /** * 0无效,1有效 */ @@ -111,5 +121,21 @@ public class TDeviceVo implements Serializable { private String updateTime; + private String lrdwdm; + + private String lrdwmc; + + private String lrrxm; + + private String lrrsfzh; + + private String xgdwdm; + + private String xgdwmc; + + private String xgrxm; + + private String xgrsfzh; + } diff --git a/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/dubbo/RemoteDeviceImpl.java b/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/dubbo/RemoteDeviceImpl.java index 9f25f05e..ed7b2b20 100644 --- a/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/dubbo/RemoteDeviceImpl.java +++ b/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/dubbo/RemoteDeviceImpl.java @@ -55,4 +55,12 @@ public class RemoteDeviceImpl implements RemoteDeviceService { public R saveDeviceToSt(String infoSource, List list) { return deviceService.saveDeviceToSt(infoSource,BeanUtil.copyToList(list,TDevice.class)); } + + @Override + public RemoteDeviceVo getDeviceInfo(String deviceCode, String deviceType) { + TDeviceBo bo = new TDeviceBo(); + bo.setDeviceCode(deviceCode); + bo.setDeviceType(deviceType); + return BeanUtil.toBean(deviceService.queryOne(bo), RemoteDeviceVo.class) ; + } } diff --git a/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/service/ITDeviceService.java b/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/service/ITDeviceService.java index b8849915..8cc93964 100644 --- a/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/service/ITDeviceService.java +++ b/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/service/ITDeviceService.java @@ -44,6 +44,8 @@ public interface ITDeviceService { */ List queryList(TDeviceBo bo); + TDeviceVo queryOne(TDeviceBo bo); + /** * 新增device * diff --git a/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java b/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java index 93d97bfb..82227e78 100644 --- a/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java +++ b/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java @@ -81,6 +81,7 @@ public class SysUserServiceImpl implements ISysUserService { .eq(ObjectUtil.isNotNull(user.getUserId()), "u.user_id", user.getUserId()) .like(StringUtils.isNotBlank(user.getUserName()), "u.user_name", user.getUserName()) .eq(StringUtils.isNotBlank(user.getStatus()), "u.status", user.getStatus()) + .eq(StringUtils.isNotBlank(user.getUserType()), "u.user_type", user.getUserType()) .like(StringUtils.isNotBlank(user.getPhonenumber()), "u.phonenumber", user.getPhonenumber()) .between(params.get("beginTime") != null && params.get("endTime") != null, "u.create_time", params.get("beginTime"), params.get("endTime")) diff --git a/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/service/impl/TDeviceServiceImpl.java b/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/service/impl/TDeviceServiceImpl.java index a660196f..607c9f1b 100644 --- a/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/service/impl/TDeviceServiceImpl.java +++ b/stwzhj-modules/stwzhj-system/src/main/java/org/dromara/system/service/impl/TDeviceServiceImpl.java @@ -63,6 +63,21 @@ public class TDeviceServiceImpl implements ITDeviceService { public TableDataInfo queryPageList(TDeviceBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + List list = result.getRecords(); + for (TDeviceVo vo : list) { + if ("".equals(vo.getPoliceName()) || null == vo.getPoliceName()){ + vo.setDeviceName(vo.getCarNum()); + } + if("".equals(vo.getCarNum()) || null == vo.getCarNum()){ + if (!"".equals(vo.getPoliceNo()) && null != vo.getPoliceNo()){ + vo.setDeviceName(vo.getPoliceNo()+"-"+vo.getPoliceName()); + }else { + vo.setDeviceName(vo.getPoliceName()); + } + + } + + } return TableDataInfo.build(result); } @@ -78,6 +93,12 @@ public class TDeviceServiceImpl implements ITDeviceService { return baseMapper.selectVoList(lqw); } + @Override + public TDeviceVo queryOne(TDeviceBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoOne(lqw); + } + private LambdaQueryWrapper buildQueryWrapper(TDeviceBo bo) { Map params = bo.getParams(); LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); diff --git a/stwzhj-modules/stwzhj-system/src/main/resources/mapper/system/SysUserMapper.xml b/stwzhj-modules/stwzhj-system/src/main/resources/mapper/system/SysUserMapper.xml index bb3c53da..332fc58b 100644 --- a/stwzhj-modules/stwzhj-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/stwzhj-modules/stwzhj-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -17,7 +17,7 @@ ${ew.getSqlSelect} - u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, + u.user_id, u.dept_id, u.nick_name, u.user_name, u.user_type, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark from sys_user u @@ -30,7 +30,7 @@ ${ew.getSqlSelect} - u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, + u.user_id, u.dept_id, u.nick_name, u.user_name, u.user_type, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark from sys_user u @@ -38,7 +38,7 @@