parent
2855993386
commit
1c630fa960
|
|
@ -1,8 +1,8 @@
|
|||
spring:
|
||||
config:
|
||||
import:
|
||||
# - classpath:nacos-prod.yml
|
||||
- classpath:nacos.yml
|
||||
- classpath:nacos-prod.yml
|
||||
# - classpath:nacos.yml
|
||||
- classpath:kafka.yml
|
||||
- classpath:sdk.yml
|
||||
- classpath:swagger.yml
|
||||
|
|
|
|||
|
|
@ -19,7 +19,14 @@ spring:
|
|||
personnel-positioning:
|
||||
kafka:
|
||||
location:
|
||||
enabled: ${PERSONNEL_POSITIONING_KAFKA_LOCATION_ENABLED:false}
|
||||
enabled: ${PERSONNEL_POSITIONING_KAFKA_LOCATION_ENABLED:true}
|
||||
topic: ${PERSONNEL_POSITIONING_KAFKA_LOCATION_TOPIC:point_push}
|
||||
group-id: ${PERSONNEL_POSITIONING_KAFKA_LOCATION_GROUP_ID:personnel-position-location-probe}
|
||||
# Each WebSocket-serving instance must consume every point so it can notify its own clients.
|
||||
group-id: ${PERSONNEL_POSITIONING_KAFKA_LOCATION_GROUP_ID:personnel-position-location-${HOSTNAME:standalone}}
|
||||
max-log-bytes: ${PERSONNEL_POSITIONING_KAFKA_LOCATION_MAX_LOG_BYTES:16384}
|
||||
websocket:
|
||||
location:
|
||||
enabled: ${PERSONNEL_POSITIONING_WEBSOCKET_LOCATION_ENABLED:true}
|
||||
allowed-origins: ${PERSONNEL_POSITIONING_WEBSOCKET_LOCATION_ALLOWED_ORIGINS:*}
|
||||
send-time-limit-ms: ${PERSONNEL_POSITIONING_WEBSOCKET_LOCATION_SEND_TIME_LIMIT_MS:10000}
|
||||
buffer-size-limit-bytes: ${PERSONNEL_POSITIONING_WEBSOCKET_LOCATION_BUFFER_SIZE_LIMIT_BYTES:524288}
|
||||
|
|
|
|||
|
|
@ -30,5 +30,9 @@
|
|||
<groupId>com.zcloud.personnel.positioning</groupId>
|
||||
<artifactId>web-client</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-websocket</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -88,14 +88,14 @@ public class AlarmDisposeRecordController {
|
|||
private void fillCorpinfo(AlarmDisposeRecordAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void fillCorpinfo(AlarmDisposeRecordUpdateCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,14 +101,14 @@ public class AlarmRecordController {
|
|||
private void fillCorpinfo(AlarmRecordAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void fillCorpinfo(AlarmRecordUpdateCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,14 +88,14 @@ public class AlarmRecordTargetController {
|
|||
private void fillCorpinfo(AlarmRecordTargetAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void fillCorpinfo(AlarmRecordTargetUpdateCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,14 +117,14 @@ public class AlarmRuleController {
|
|||
private void fillCorpinfo(AlarmRuleAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (cmd.getCorpinfoId() == null && ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void fillCorpinfo(AlarmRuleUpdateCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (cmd.getCorpinfoId() == null && ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,14 +88,14 @@ public class AlarmRuleFenceRelController {
|
|||
private void fillCorpinfo(AlarmRuleFenceRelAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void fillCorpinfo(AlarmRuleFenceRelUpdateCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,14 +88,14 @@ public class AlarmRuleItemController {
|
|||
private void fillCorpinfo(AlarmRuleItemAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void fillCorpinfo(AlarmRuleItemUpdateCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public class AreaController {
|
|||
|
||||
@ApiOperation("可选区域选项")
|
||||
@GetMapping("/options")
|
||||
public MultiResponse<OptionCO> options(@RequestParam(required = false) Long corpinfoId,
|
||||
public MultiResponse<OptionCO> options(@RequestParam(required = false) String corpinfoId,
|
||||
@RequestParam(required = false) String keyword) {
|
||||
return MultiResponse.of(areaService.listOptions(corpinfoId, keyword));
|
||||
}
|
||||
|
|
@ -96,14 +96,14 @@ public class AreaController {
|
|||
private void fillCorpinfo(AreaAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void fillCorpinfo(AreaUpdateCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,11 +53,11 @@ public class FenceController {
|
|||
|
||||
@ApiOperation("公司区域详情")
|
||||
@GetMapping("/company-area")
|
||||
public SingleResponse<FenceCompanyAreaCO> getCompanyArea(@RequestParam(required = false) Long corpinfoId,
|
||||
public SingleResponse<FenceCompanyAreaCO> getCompanyArea(@RequestParam(required = false) String corpinfoId,
|
||||
@RequestParam(required = false) String corpinfoName) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (corpinfoId == null && ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
corpinfoId = ssoUser.getCompanyId();
|
||||
corpinfoId = String.valueOf(ssoUser.getCompanyId());
|
||||
}
|
||||
return SingleResponse.of(fenceService.queryCompanyArea(corpinfoId, corpinfoName));
|
||||
}
|
||||
|
|
@ -139,21 +139,21 @@ public class FenceController {
|
|||
private void fillCorpinfo(FenceAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (cmd.getCorpinfoId() == null && ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void fillCorpinfo(FenceUpdateCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (cmd.getCorpinfoId() == null && ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void fillCorpinfo(FenceCompanyAreaSaveCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (cmd.getCorpinfoId() == null && ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,14 +88,14 @@ public class FencePointController {
|
|||
private void fillCorpinfo(FencePointAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void fillCorpinfo(FencePointUpdateCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,14 +88,14 @@ public class OpenapiConfigController {
|
|||
private void fillCorpinfo(OpenapiConfigAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void fillCorpinfo(OpenapiConfigUpdateCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.PathVariable;
|
|||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
|
|
@ -42,10 +43,11 @@ public class PersonnelPositioningBiController {
|
|||
return SingleResponse.of(personnelPositioningBiService.queryOverview());
|
||||
}
|
||||
|
||||
@ApiOperation("公司定位点")
|
||||
@ApiOperation("公司定位点,可按港区过滤")
|
||||
@GetMapping("/companyLocation/list")
|
||||
public MultiResponse<BiCompanyLocationCO> listCompanyLocation() {
|
||||
return MultiResponse.of(personnelPositioningBiService.listCompanyLocation());
|
||||
public MultiResponse<BiCompanyLocationCO> listCompanyLocation(
|
||||
@RequestParam(value = "portArea", required = false) Integer portArea) {
|
||||
return MultiResponse.of(personnelPositioningBiService.listCompanyLocation(portArea));
|
||||
}
|
||||
|
||||
@ApiOperation("公司围栏分页")
|
||||
|
|
|
|||
|
|
@ -88,14 +88,14 @@ public class SyncLogController {
|
|||
private void fillCorpinfo(SyncLogAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void fillCorpinfo(SyncLogUpdateCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,14 +88,14 @@ public class SyncTaskController {
|
|||
private void fillCorpinfo(SyncTaskAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void fillCorpinfo(SyncTaskUpdateCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,14 +88,14 @@ public class TerminalBindController {
|
|||
private void fillCorpinfo(TerminalBindAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void fillCorpinfo(TerminalBindUpdateCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -208,28 +208,28 @@ public class TerminalController {
|
|||
private void fillCorpinfo(TerminalAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void fillCorpinfo(TerminalUpdateCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void fillCorpinfo(TerminalCardSaveCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (cmd.getCorpinfoId() == null && ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void fillCorpinfo(TerminalAppSaveCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (cmd.getCorpinfoId() == null && ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
cmd.setCorpinfoId(ssoUser.getCompanyId());
|
||||
cmd.setCorpinfoId(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,62 @@
|
|||
package com.zcloud.personnel.positioning.websocket;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.socket.config.annotation.EnableWebSocket;
|
||||
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
|
||||
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Configuration
|
||||
@EnableWebSocket
|
||||
@RequiredArgsConstructor
|
||||
@ConditionalOnProperty(
|
||||
prefix = "personnel-positioning.websocket.location",
|
||||
name = "enabled",
|
||||
havingValue = "true",
|
||||
matchIfMissing = true
|
||||
)
|
||||
public class PersonLocationWebSocketConfiguration implements WebSocketConfigurer {
|
||||
private final PersonLocationWebSocketHandler handler;
|
||||
|
||||
@Value("${application.gateway:personnelPosition}")
|
||||
private String gateway;
|
||||
|
||||
@Value("${personnel-positioning.websocket.location.allowed-origins:*}")
|
||||
private String allowedOrigins;
|
||||
|
||||
@Override
|
||||
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
|
||||
registry.addHandler(handler, endpointPath())
|
||||
.setAllowedOrigins(originValues());
|
||||
}
|
||||
|
||||
private String endpointPath() {
|
||||
String value = gateway == null ? "" : gateway.trim();
|
||||
while (value.startsWith("/")) {
|
||||
value = value.substring(1);
|
||||
}
|
||||
while (value.endsWith("/")) {
|
||||
value = value.substring(0, value.length() - 1);
|
||||
}
|
||||
return StringUtils.hasText(value) ? "/" + value + "/ws/location" : "/ws/location";
|
||||
}
|
||||
|
||||
private String[] originValues() {
|
||||
List<String> values = new ArrayList<>();
|
||||
for (String origin : StringUtils.commaDelimitedListToStringArray(allowedOrigins)) {
|
||||
if (StringUtils.hasText(origin)) {
|
||||
values.add(origin.trim());
|
||||
}
|
||||
}
|
||||
if (values.isEmpty()) {
|
||||
values.add("*");
|
||||
}
|
||||
return values.toArray(new String[0]);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
package com.zcloud.personnel.positioning.websocket;
|
||||
|
||||
import com.zcloud.personnel.positioning.integration.realtime.RealtimeLocationPublisher;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.socket.CloseStatus;
|
||||
import org.springframework.web.socket.TextMessage;
|
||||
import org.springframework.web.socket.WebSocketSession;
|
||||
import org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator;
|
||||
import org.springframework.web.socket.handler.TextWebSocketHandler;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@Component
|
||||
public class PersonLocationWebSocketHandler extends TextWebSocketHandler implements RealtimeLocationPublisher {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(PersonLocationWebSocketHandler.class);
|
||||
|
||||
private final Map<String, WebSocketSession> sessions = new ConcurrentHashMap<>();
|
||||
private final int sendTimeLimitMs;
|
||||
private final int bufferSizeLimitBytes;
|
||||
|
||||
public PersonLocationWebSocketHandler(
|
||||
@Value("${personnel-positioning.websocket.location.send-time-limit-ms:10000}") int sendTimeLimitMs,
|
||||
@Value("${personnel-positioning.websocket.location.buffer-size-limit-bytes:524288}")
|
||||
int bufferSizeLimitBytes) {
|
||||
this.sendTimeLimitMs = Math.max(1, sendTimeLimitMs);
|
||||
this.bufferSizeLimitBytes = Math.max(1024, bufferSizeLimitBytes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterConnectionEstablished(WebSocketSession session) {
|
||||
WebSocketSession concurrentSession = new ConcurrentWebSocketSessionDecorator(
|
||||
session, sendTimeLimitMs, bufferSizeLimitBytes);
|
||||
sessions.put(session.getId(), concurrentSession);
|
||||
LOGGER.info("Personnel location WebSocket connected, sessionId={}, connectionCount={}",
|
||||
session.getId(), sessions.size());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterConnectionClosed(WebSocketSession session, CloseStatus status) {
|
||||
sessions.remove(session.getId());
|
||||
LOGGER.info("Personnel location WebSocket disconnected, sessionId={}, status={}, connectionCount={}",
|
||||
session.getId(), status, sessions.size());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleTransportError(WebSocketSession session, Throwable exception) {
|
||||
removeAndClose(session.getId());
|
||||
LOGGER.warn("Personnel location WebSocket transport error, sessionId={}, connectionCount={}",
|
||||
session.getId(), sessions.size(), exception);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int publish(String payload) {
|
||||
TextMessage message = new TextMessage(payload);
|
||||
int delivered = 0;
|
||||
for (Map.Entry<String, WebSocketSession> entry : sessions.entrySet()) {
|
||||
WebSocketSession session = entry.getValue();
|
||||
if (!session.isOpen()) {
|
||||
sessions.remove(entry.getKey(), session);
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
session.sendMessage(message);
|
||||
delivered++;
|
||||
} catch (Exception e) {
|
||||
removeAndClose(entry.getKey());
|
||||
LOGGER.warn("Failed to send personnel location, sessionId={}", entry.getKey(), e);
|
||||
}
|
||||
}
|
||||
return delivered;
|
||||
}
|
||||
|
||||
int connectionCount() {
|
||||
return sessions.size();
|
||||
}
|
||||
|
||||
private void removeAndClose(String sessionId) {
|
||||
WebSocketSession session = sessions.remove(sessionId);
|
||||
if (session == null || !session.isOpen()) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
session.close(CloseStatus.SERVER_ERROR);
|
||||
} catch (IOException e) {
|
||||
LOGGER.debug("Failed to close personnel location WebSocket, sessionId={}", sessionId, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -223,7 +223,7 @@ public class AlarmRecordFindsPullService {
|
|||
record.setStartFencesJson(jsonValue(row.path("startFences")));
|
||||
record.setEndFencesJson(jsonValue(row.path("endFences")));
|
||||
fillLocation(record, row.path("location"));
|
||||
record.setCorpinfoId(config.getCorpinfoId() == null ? 0L : config.getCorpinfoId());
|
||||
record.setCorpinfoId(config.getCorpinfoId() == null ? "0" : config.getCorpinfoId());
|
||||
record.setCorpinfoName(defaultIfBlank(config.getCorpinfoName(), resolveCorpinfoName(config.getCorpinfoId())));
|
||||
fillFirstTrack(record, row.path("trackInfoList"));
|
||||
record.setTerminalNoListJson(jsonValue(row.path("terminalNoList")));
|
||||
|
|
@ -333,7 +333,7 @@ public class AlarmRecordFindsPullService {
|
|||
task.setTaskCode(taskCode);
|
||||
task.setTaskName("FindS告警增量拉取-" + configIdentity(config));
|
||||
task.setBizType("ALARM");
|
||||
task.setCorpinfoId(config.getCorpinfoId() == null ? 0L : config.getCorpinfoId());
|
||||
task.setCorpinfoId(config.getCorpinfoId() == null ? "0" : config.getCorpinfoId());
|
||||
task.setCorpinfoName(config.getCorpinfoName());
|
||||
task.setSyncDirection("PULL");
|
||||
task.setCronExpr(TASK_CRON);
|
||||
|
|
@ -546,7 +546,7 @@ public class AlarmRecordFindsPullService {
|
|||
return terminalNoList.asText();
|
||||
}
|
||||
|
||||
private String resolveCorpinfoName(Long corpinfoId) {
|
||||
private String resolveCorpinfoName(String corpinfoId) {
|
||||
if (corpinfoId == null) {
|
||||
return null;
|
||||
}
|
||||
|
|
@ -554,7 +554,7 @@ public class AlarmRecordFindsPullService {
|
|||
List<String> names = jdbcTemplate.queryForList(
|
||||
"SELECT corp_name FROM corp_info WHERE CAST(corpinfo_id AS CHAR) = ? "
|
||||
+ "AND (delete_enum IS NULL OR delete_enum = 'FALSE') LIMIT 1",
|
||||
String.class, String.valueOf(corpinfoId));
|
||||
String.class, corpinfoId);
|
||||
return names.isEmpty() ? null : names.get(0);
|
||||
} catch (Exception ignored) {
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ public class AlarmRuleConfigPersistence {
|
|||
AlarmRuleFenceRelDO rel = new AlarmRuleFenceRelDO();
|
||||
BeanUtils.copyProperties(relCmd, rel);
|
||||
rel.setRuleId(rule.getId());
|
||||
rel.setCorpinfoId(defaultLong(rel.getCorpinfoId(), rule.getCorpinfoId()));
|
||||
rel.setCorpinfoId(defaultString(rel.getCorpinfoId(), rule.getCorpinfoId()));
|
||||
rel.setCorpinfoName(defaultIfBlank(rel.getCorpinfoName(), rule.getCorpinfoName()));
|
||||
rel.setRelType(defaultIfBlank(rel.getRelType(), REL_EFFECTIVE));
|
||||
fillFenceSnapshot(rel);
|
||||
|
|
@ -126,7 +126,7 @@ public class AlarmRuleConfigPersistence {
|
|||
AlarmRuleItemDO item = new AlarmRuleItemDO();
|
||||
BeanUtils.copyProperties(itemCmd, item);
|
||||
item.setRuleId(rule.getId());
|
||||
item.setCorpinfoId(defaultLong(item.getCorpinfoId(), rule.getCorpinfoId()));
|
||||
item.setCorpinfoId(defaultString(item.getCorpinfoId(), rule.getCorpinfoId()));
|
||||
item.setCorpinfoName(defaultIfBlank(item.getCorpinfoName(), rule.getCorpinfoName()));
|
||||
if (item.getLevel() == null) {
|
||||
item.setLevel(1);
|
||||
|
|
@ -171,7 +171,7 @@ public class AlarmRuleConfigPersistence {
|
|||
rel.setFenceName(fence.getFenceName());
|
||||
rel.setFindsFenceId(fence.getFindsFenceId());
|
||||
rel.setRelType(REL_EFFECTIVE);
|
||||
rel.setCorpinfoId(defaultLong(rule.getCorpinfoId(), fence.getCorpinfoId()));
|
||||
rel.setCorpinfoId(defaultString(rule.getCorpinfoId(), fence.getCorpinfoId()));
|
||||
rel.setCorpinfoName(defaultIfBlank(rule.getCorpinfoName(), fence.getCorpinfoName()));
|
||||
alarmRuleFenceRelRepository.save(rel);
|
||||
}
|
||||
|
|
@ -187,7 +187,7 @@ public class AlarmRuleConfigPersistence {
|
|||
}
|
||||
rel.setFenceName(defaultIfBlank(rel.getFenceName(), fence.getFenceName()));
|
||||
rel.setFindsFenceId(defaultLong(rel.getFindsFenceId(), fence.getFindsFenceId()));
|
||||
rel.setCorpinfoId(defaultLong(rel.getCorpinfoId(), fence.getCorpinfoId()));
|
||||
rel.setCorpinfoId(defaultString(rel.getCorpinfoId(), fence.getCorpinfoId()));
|
||||
rel.setCorpinfoName(defaultIfBlank(rel.getCorpinfoName(), fence.getCorpinfoName()));
|
||||
}
|
||||
|
||||
|
|
@ -265,4 +265,8 @@ public class AlarmRuleConfigPersistence {
|
|||
private Long defaultLong(Long value, Long defaultValue) {
|
||||
return value == null ? defaultValue : value;
|
||||
}
|
||||
|
||||
private String defaultString(String value, String defaultValue) {
|
||||
return StringUtils.hasText(value) ? value : defaultValue;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,12 +61,12 @@ public class AlarmRuleFindsPullService {
|
|||
private final ObjectMapper objectMapper;
|
||||
|
||||
public void refreshForCompanyStats(AlarmRuleCompanyPageQry qry) {
|
||||
Long companyId = qry == null ? null : qry.getEqCorpinfoId();
|
||||
String companyId = qry == null ? null : qry.getEqCorpinfoId();
|
||||
refreshConfigs(resolveConfigs(companyId), null);
|
||||
}
|
||||
|
||||
public void refreshForList(AlarmRulePageQry qry) {
|
||||
Long companyId = qry == null ? null : qry.getEqCorpinfoId();
|
||||
String companyId = qry == null ? null : qry.getEqCorpinfoId();
|
||||
String alarmCode = qry == null ? null : qry.getEqAlarmCode();
|
||||
refreshConfigs(resolveConfigs(companyId), alarmCode);
|
||||
}
|
||||
|
|
@ -174,7 +174,7 @@ public class AlarmRuleFindsPullService {
|
|||
rule.setTrackTypes(defaultIfBlank(rule.getTrackTypes(), "STAFF"));
|
||||
rule.setCrashType(firstText(row.path("crashType"), rule.getCrashType()));
|
||||
FenceDO scopeFence = findFirstScopeFence(scope);
|
||||
Long corpinfoId = config.getCorpinfoId() != null
|
||||
String corpinfoId = config.getCorpinfoId() != null
|
||||
? config.getCorpinfoId()
|
||||
: (scopeFence == null ? rule.getCorpinfoId() : scopeFence.getCorpinfoId());
|
||||
String corpinfoName = defaultIfBlank(config.getCorpinfoName(),
|
||||
|
|
@ -315,11 +315,12 @@ public class AlarmRuleFindsPullService {
|
|||
}
|
||||
}
|
||||
|
||||
private List<OpenapiConfigDO> resolveConfigs(Long requestedCorpinfoId) {
|
||||
private List<OpenapiConfigDO> resolveConfigs(String requestedCorpinfoId) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
Long corpinfoId = requestedCorpinfoId != null
|
||||
String corpinfoId = requestedCorpinfoId != null
|
||||
? requestedCorpinfoId
|
||||
: (ssoUser == null ? null : ssoUser.getCompanyId());
|
||||
: (ssoUser == null || ssoUser.getCompanyId() == null
|
||||
? null : String.valueOf(ssoUser.getCompanyId()));
|
||||
QueryWrapper<OpenapiConfigDO> queryWrapper = baseConfigQuery();
|
||||
if (corpinfoId != null) {
|
||||
queryWrapper.eq("corpinfo_id", corpinfoId);
|
||||
|
|
@ -327,7 +328,7 @@ public class AlarmRuleFindsPullService {
|
|||
List<OpenapiConfigDO> configs = openapiConfigRepository.list(queryWrapper);
|
||||
if ((configs == null || configs.isEmpty()) && corpinfoId != null) {
|
||||
QueryWrapper<OpenapiConfigDO> defaultWrapper = baseConfigQuery();
|
||||
defaultWrapper.and(wrapper -> wrapper.isNull("corpinfo_id").or().eq("corpinfo_id", 0));
|
||||
defaultWrapper.and(wrapper -> wrapper.isNull("corpinfo_id").or().eq("corpinfo_id", "0"));
|
||||
configs = openapiConfigRepository.list(defaultWrapper);
|
||||
if (configs != null) {
|
||||
for (OpenapiConfigDO config : configs) {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public class FenceCompanyAreaSaveExe {
|
|||
return map(area, fence);
|
||||
}
|
||||
|
||||
public FenceCompanyAreaCO query(Long corpinfoId, String corpinfoName) {
|
||||
public FenceCompanyAreaCO query(String corpinfoId, String corpinfoName) {
|
||||
AreaDO area = queryArea(null, corpinfoId, corpinfoName);
|
||||
FenceDO fence = null;
|
||||
if (area != null && area.getBindFenceId() != null) {
|
||||
|
|
@ -142,7 +142,7 @@ public class FenceCompanyAreaSaveExe {
|
|||
return fence;
|
||||
}
|
||||
|
||||
private AreaDO queryArea(Long areaId, Long corpinfoId, String corpinfoName) {
|
||||
private AreaDO queryArea(Long areaId, String corpinfoId, String corpinfoName) {
|
||||
if (areaId != null) {
|
||||
return areaRepository.getById(areaId);
|
||||
}
|
||||
|
|
@ -155,7 +155,7 @@ public class FenceCompanyAreaSaveExe {
|
|||
return areaRepository.getOne(queryWrapper, false);
|
||||
}
|
||||
|
||||
private FenceDO queryFence(Long fenceId, Long corpinfoId, String corpinfoName) {
|
||||
private FenceDO queryFence(Long fenceId, String corpinfoId, String corpinfoName) {
|
||||
if (fenceId != null) {
|
||||
return fenceRepository.getById(fenceId);
|
||||
}
|
||||
|
|
@ -168,7 +168,7 @@ public class FenceCompanyAreaSaveExe {
|
|||
return fenceRepository.getOne(queryWrapper, false);
|
||||
}
|
||||
|
||||
private <T> void applyCompany(QueryWrapper<T> queryWrapper, Long corpinfoId, String corpinfoName) {
|
||||
private <T> void applyCompany(QueryWrapper<T> queryWrapper, String corpinfoId, String corpinfoName) {
|
||||
if (corpinfoId != null) {
|
||||
queryWrapper.eq("corpinfo_id", corpinfoId);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public class FenceFindsPullService {
|
|||
|
||||
public FenceSyncCO sync(FenceSyncCmd cmd) {
|
||||
FenceSyncCmd command = cmd == null ? new FenceSyncCmd() : cmd;
|
||||
Long companyId = command.getCorpinfoId() == null ? currentCompanyId() : command.getCorpinfoId();
|
||||
String companyId = command.getCorpinfoId() == null ? currentCompanyId() : command.getCorpinfoId();
|
||||
if (command.getCorpinfoId() == null && companyId != null) {
|
||||
command.setCorpinfoId(companyId);
|
||||
}
|
||||
|
|
@ -339,7 +339,7 @@ public class FenceFindsPullService {
|
|||
|
||||
private CorpInfo mapCorpInfo(ResultSet rs, int rowNum) throws SQLException {
|
||||
CorpInfo corpInfo = new CorpInfo();
|
||||
long id = rs.getLong("corpinfo_id");
|
||||
String id = rs.getString("corpinfo_id");
|
||||
corpInfo.corpinfoId = rs.wasNull() ? null : id;
|
||||
corpInfo.corpName = rs.getString("corp_name");
|
||||
corpInfo.orgCode = rs.getString("code");
|
||||
|
|
@ -510,13 +510,14 @@ public class FenceFindsPullService {
|
|||
return value == null || value < 1 ? defaultValue : value;
|
||||
}
|
||||
|
||||
private Long currentCompanyId() {
|
||||
private String currentCompanyId() {
|
||||
SSOUser currentUser = AuthContext.getCurrentUser();
|
||||
return currentUser == null ? null : currentUser.getCompanyId();
|
||||
return currentUser == null || currentUser.getCompanyId() == null
|
||||
? null : String.valueOf(currentUser.getCompanyId());
|
||||
}
|
||||
|
||||
private static class CorpInfo {
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
private String corpName;
|
||||
private String orgCode;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -340,12 +340,12 @@ public class TerminalAppExe {
|
|||
sql.append(" AND COALESCE(tb.id_card_no, t.bind_id_card_no) = ?");
|
||||
args.add(qry.getIdCardNo().trim());
|
||||
}
|
||||
Long requestedCorpinfoId = qry.getEqCorpinfoId();
|
||||
String requestedCorpinfoId = qry.getEqCorpinfoId();
|
||||
boolean hasEqCorpinfoName = StringUtils.hasText(qry.getEqCorpinfoName());
|
||||
boolean hasLikeCorpinfoName = StringUtils.hasText(qry.getLikeCorpinfoName());
|
||||
boolean hasExplicitCorpinfoFilter = requestedCorpinfoId != null
|
||||
|| hasEqCorpinfoName || hasLikeCorpinfoName;
|
||||
Long corpinfoId = hasExplicitCorpinfoFilter ? requestedCorpinfoId : currentCompanyId();
|
||||
String corpinfoId = hasExplicitCorpinfoFilter ? requestedCorpinfoId : currentCompanyId();
|
||||
if (requestedCorpinfoId != null && hasEqCorpinfoName) {
|
||||
String corpinfoName = qry.getEqCorpinfoName().trim();
|
||||
sql.append(" AND (t.corpinfo_id = ? OR (t.corpinfo_id IS NULL"
|
||||
|
|
@ -444,7 +444,7 @@ public class TerminalAppExe {
|
|||
terminal.getTerminalName(), appAccount));
|
||||
terminal.setDeviceType(DEVICE_TYPE_APP);
|
||||
terminal.setAppAccount(appAccount);
|
||||
terminal.setCorpinfoId(corpInfo == null ? firstLong(cmd.getCorpinfoId(), terminal.getCorpinfoId()) : corpInfo.corpinfoId);
|
||||
terminal.setCorpinfoId(corpInfo == null ? firstText(cmd.getCorpinfoId(), terminal.getCorpinfoId()) : corpInfo.corpinfoId);
|
||||
terminal.setCorpinfoName(firstText(cmd.getCorpinfoName(), corpInfo == null ? null : corpInfo.corpName,
|
||||
textValue(child(row, "corpinfoName")), textValue(child(row, "corpName")),
|
||||
textValue(child(row, "orgName")), terminal.getCorpinfoName()));
|
||||
|
|
@ -686,7 +686,7 @@ public class TerminalAppExe {
|
|||
return rows.isEmpty() ? fallback : mergePerson(rows.get(0), fallback);
|
||||
}
|
||||
|
||||
private CorpInfo resolveCorpInfo(Long corpinfoId, String corpinfoName, String orgCode, String orgName) {
|
||||
private CorpInfo resolveCorpInfo(String corpinfoId, String corpinfoName, String orgCode, String orgName) {
|
||||
List<Object> args = new ArrayList<>();
|
||||
StringBuilder sql = new StringBuilder("SELECT corpinfo_id, corp_name, code, contacts, lr_name FROM corp_info "
|
||||
+ "WHERE (delete_enum IS NULL OR delete_enum = 'FALSE')");
|
||||
|
|
@ -709,7 +709,7 @@ public class TerminalAppExe {
|
|||
|
||||
private TerminalAppCompanyCO mapCompany(ResultSet rs, int rowNum) throws SQLException {
|
||||
TerminalAppCompanyCO co = new TerminalAppCompanyCO();
|
||||
long corpinfoId = rs.getLong("corpinfo_id");
|
||||
String corpinfoId = rs.getString("corpinfo_id");
|
||||
co.setCorpinfoId(rs.wasNull() ? null : corpinfoId);
|
||||
co.setCorpinfoName(rs.getString("corpinfo_name"));
|
||||
co.setOrgCode(rs.getString("org_code"));
|
||||
|
|
@ -727,7 +727,7 @@ public class TerminalAppExe {
|
|||
co.setAppAccount(rs.getString("app_account"));
|
||||
co.setTerminalNo(rs.getString("terminal_no"));
|
||||
co.setTerminalName(rs.getString("terminal_name"));
|
||||
long corpinfoId = rs.getLong("corpinfo_id");
|
||||
String corpinfoId = rs.getString("corpinfo_id");
|
||||
co.setCorpinfoId(rs.wasNull() ? null : corpinfoId);
|
||||
co.setCorpinfoName(rs.getString("corpinfo_name"));
|
||||
co.setOrgCode(rs.getString("org_code"));
|
||||
|
|
@ -757,7 +757,7 @@ public class TerminalAppExe {
|
|||
person.staffName = rs.getString("staff_name");
|
||||
person.idCardNo = rs.getString("id_card_no");
|
||||
person.mobileNo = rs.getString("mobile_no");
|
||||
long corpinfoId = rs.getLong("corpinfo_id");
|
||||
String corpinfoId = rs.getString("corpinfo_id");
|
||||
person.corpinfoId = rs.wasNull() ? null : corpinfoId;
|
||||
person.corpinfoName = rs.getString("corpinfo_name");
|
||||
return person;
|
||||
|
|
@ -765,7 +765,7 @@ public class TerminalAppExe {
|
|||
|
||||
private CorpInfo mapCorpInfo(ResultSet rs, int rowNum) throws SQLException {
|
||||
CorpInfo corpInfo = new CorpInfo();
|
||||
long corpinfoId = rs.getLong("corpinfo_id");
|
||||
String corpinfoId = rs.getString("corpinfo_id");
|
||||
corpInfo.corpinfoId = rs.wasNull() ? null : corpinfoId;
|
||||
corpInfo.corpName = rs.getString("corp_name");
|
||||
corpInfo.creditCode = rs.getString("code");
|
||||
|
|
@ -872,7 +872,7 @@ public class TerminalAppExe {
|
|||
first.staffNo = firstText(first.staffNo, second.staffNo);
|
||||
first.staffName = firstText(first.staffName, second.staffName);
|
||||
first.mobileNo = firstText(first.mobileNo, second.mobileNo);
|
||||
first.corpinfoId = firstLong(first.corpinfoId, second.corpinfoId);
|
||||
first.corpinfoId = firstText(first.corpinfoId, second.corpinfoId);
|
||||
first.corpinfoName = firstText(first.corpinfoName, second.corpinfoName);
|
||||
first.findsTrackId = firstLong(first.findsTrackId, second.findsTrackId);
|
||||
return first;
|
||||
|
|
@ -1128,9 +1128,10 @@ public class TerminalAppExe {
|
|||
}
|
||||
}
|
||||
|
||||
private Long currentCompanyId() {
|
||||
private String currentCompanyId() {
|
||||
SSOUser currentUser = AuthContext.getCurrentUser();
|
||||
return currentUser == null ? null : currentUser.getCompanyId();
|
||||
return currentUser == null || currentUser.getCompanyId() == null
|
||||
? null : String.valueOf(currentUser.getCompanyId());
|
||||
}
|
||||
|
||||
private static class SyncRowResult {
|
||||
|
|
@ -1144,13 +1145,13 @@ public class TerminalAppExe {
|
|||
private String staffNo;
|
||||
private String staffName;
|
||||
private String mobileNo;
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
private String corpinfoName;
|
||||
private Long findsTrackId;
|
||||
}
|
||||
|
||||
private static class CorpInfo {
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
private String corpName;
|
||||
private String creditCode;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -365,12 +365,12 @@ public class TerminalCardExe {
|
|||
sql.append(" AND COALESCE(tb.id_card_no, t.bind_id_card_no) = ?");
|
||||
args.add(qry.getIdCardNo().trim());
|
||||
}
|
||||
Long requestedCorpinfoId = qry.getEqCorpinfoId();
|
||||
String requestedCorpinfoId = qry.getEqCorpinfoId();
|
||||
boolean hasEqCorpinfoName = StringUtils.hasText(qry.getEqCorpinfoName());
|
||||
boolean hasLikeCorpinfoName = StringUtils.hasText(qry.getLikeCorpinfoName());
|
||||
boolean hasExplicitCorpinfoFilter = requestedCorpinfoId != null
|
||||
|| hasEqCorpinfoName || hasLikeCorpinfoName;
|
||||
Long corpinfoId = hasExplicitCorpinfoFilter ? requestedCorpinfoId : currentCompanyId();
|
||||
String corpinfoId = hasExplicitCorpinfoFilter ? requestedCorpinfoId : currentCompanyId();
|
||||
if (requestedCorpinfoId != null && hasEqCorpinfoName) {
|
||||
String corpinfoName = qry.getEqCorpinfoName().trim();
|
||||
sql.append(" AND (t.corpinfo_id = ? OR (t.corpinfo_id IS NULL"
|
||||
|
|
@ -439,7 +439,7 @@ public class TerminalCardExe {
|
|||
sql.append(" AND u.user_id_card = ?");
|
||||
args.add(qry.getIdCardNo().trim());
|
||||
}
|
||||
Long corpinfoId = firstLong(qry.getCorpinfoId(), currentCompanyId());
|
||||
String corpinfoId = firstText(qry.getCorpinfoId(), currentCompanyId());
|
||||
if (corpinfoId != null) {
|
||||
sql.append(" AND u.corpinfo_id = ?");
|
||||
args.add(corpinfoId);
|
||||
|
|
@ -497,7 +497,7 @@ public class TerminalCardExe {
|
|||
terminal.setDeviceType(DEVICE_TYPE_CARD);
|
||||
terminal.setSimCardNo(firstText(textValue(child(row, "simCardNo")), textValue(child(row, "simNo")),
|
||||
terminal.getSimCardNo()));
|
||||
terminal.setCorpinfoId(corpInfo == null ? firstLong(cmd.getCorpinfoId(), terminal.getCorpinfoId()) : corpInfo.corpinfoId);
|
||||
terminal.setCorpinfoId(corpInfo == null ? firstText(cmd.getCorpinfoId(), terminal.getCorpinfoId()) : corpInfo.corpinfoId);
|
||||
terminal.setCorpinfoName(firstText(cmd.getCorpinfoName(), corpInfo == null ? null : corpInfo.corpName,
|
||||
textValue(child(row, "corpinfoName")), textValue(child(row, "corpName")),
|
||||
textValue(child(row, "orgName")), terminal.getCorpinfoName()));
|
||||
|
|
@ -733,7 +733,7 @@ public class TerminalCardExe {
|
|||
return rows.isEmpty() ? fallback : mergePerson(rows.get(0), fallback);
|
||||
}
|
||||
|
||||
private CorpInfo resolveCorpInfo(Long corpinfoId, String corpinfoName, String orgCode, String orgName) {
|
||||
private CorpInfo resolveCorpInfo(String corpinfoId, String corpinfoName, String orgCode, String orgName) {
|
||||
List<Object> args = new ArrayList<>();
|
||||
StringBuilder sql = new StringBuilder("SELECT corpinfo_id, corp_name, code, contacts, lr_name FROM corp_info "
|
||||
+ "WHERE (delete_enum IS NULL OR delete_enum = 'FALSE')");
|
||||
|
|
@ -756,7 +756,7 @@ public class TerminalCardExe {
|
|||
|
||||
private TerminalCardCompanyCO mapCompany(ResultSet rs, int rowNum) throws SQLException {
|
||||
TerminalCardCompanyCO co = new TerminalCardCompanyCO();
|
||||
long corpinfoId = rs.getLong("corpinfo_id");
|
||||
String corpinfoId = rs.getString("corpinfo_id");
|
||||
co.setCorpinfoId(rs.wasNull() ? null : corpinfoId);
|
||||
co.setCorpinfoName(rs.getString("corpinfo_name"));
|
||||
co.setOrgCode(rs.getString("org_code"));
|
||||
|
|
@ -776,7 +776,7 @@ public class TerminalCardExe {
|
|||
co.setTerminalName(rs.getString("terminal_name"));
|
||||
co.setTerminalModel(rs.getString("terminal_model"));
|
||||
co.setSimCardNo(rs.getString("sim_card_no"));
|
||||
long corpinfoId = rs.getLong("corpinfo_id");
|
||||
String corpinfoId = rs.getString("corpinfo_id");
|
||||
co.setCorpinfoId(rs.wasNull() ? null : corpinfoId);
|
||||
co.setCorpinfoName(rs.getString("corpinfo_name"));
|
||||
co.setOrgCode(rs.getString("org_code"));
|
||||
|
|
@ -808,7 +808,7 @@ public class TerminalCardExe {
|
|||
co.setStaffName(rs.getString("staff_name"));
|
||||
co.setIdCardNo(rs.getString("id_card_no"));
|
||||
co.setMobileNo(rs.getString("mobile_no"));
|
||||
long corpinfoId = rs.getLong("corpinfo_id");
|
||||
String corpinfoId = rs.getString("corpinfo_id");
|
||||
co.setCorpinfoId(rs.wasNull() ? null : corpinfoId);
|
||||
co.setCorpinfoName(rs.getString("corpinfo_name"));
|
||||
long departmentId = rs.getLong("department_id");
|
||||
|
|
@ -819,7 +819,7 @@ public class TerminalCardExe {
|
|||
|
||||
private TerminalCardCompanyOptionCO mapCompanyOption(ResultSet rs, int rowNum) throws SQLException {
|
||||
TerminalCardCompanyOptionCO co = new TerminalCardCompanyOptionCO();
|
||||
long corpinfoId = rs.getLong("corpinfo_id");
|
||||
String corpinfoId = rs.getString("corpinfo_id");
|
||||
co.setCorpinfoId(rs.wasNull() ? null : corpinfoId);
|
||||
co.setCorpinfoName(rs.getString("corp_name"));
|
||||
co.setCreditCode(rs.getString("code"));
|
||||
|
|
@ -833,7 +833,7 @@ public class TerminalCardExe {
|
|||
person.staffName = rs.getString("staff_name");
|
||||
person.idCardNo = rs.getString("id_card_no");
|
||||
person.mobileNo = rs.getString("mobile_no");
|
||||
long corpinfoId = rs.getLong("corpinfo_id");
|
||||
String corpinfoId = rs.getString("corpinfo_id");
|
||||
person.corpinfoId = rs.wasNull() ? null : corpinfoId;
|
||||
person.corpinfoName = rs.getString("corpinfo_name");
|
||||
return person;
|
||||
|
|
@ -841,7 +841,7 @@ public class TerminalCardExe {
|
|||
|
||||
private CorpInfo mapCorpInfo(ResultSet rs, int rowNum) throws SQLException {
|
||||
CorpInfo corpInfo = new CorpInfo();
|
||||
long corpinfoId = rs.getLong("corpinfo_id");
|
||||
String corpinfoId = rs.getString("corpinfo_id");
|
||||
corpInfo.corpinfoId = rs.wasNull() ? null : corpinfoId;
|
||||
corpInfo.corpName = rs.getString("corp_name");
|
||||
corpInfo.creditCode = rs.getString("code");
|
||||
|
|
@ -929,7 +929,7 @@ public class TerminalCardExe {
|
|||
first.staffNo = firstText(first.staffNo, second.staffNo);
|
||||
first.staffName = firstText(first.staffName, second.staffName);
|
||||
first.mobileNo = firstText(first.mobileNo, second.mobileNo);
|
||||
first.corpinfoId = firstLong(first.corpinfoId, second.corpinfoId);
|
||||
first.corpinfoId = firstText(first.corpinfoId, second.corpinfoId);
|
||||
first.corpinfoName = firstText(first.corpinfoName, second.corpinfoName);
|
||||
first.findsTrackId = firstLong(first.findsTrackId, second.findsTrackId);
|
||||
return first;
|
||||
|
|
@ -1177,9 +1177,10 @@ public class TerminalCardExe {
|
|||
}
|
||||
}
|
||||
|
||||
private Long currentCompanyId() {
|
||||
private String currentCompanyId() {
|
||||
SSOUser currentUser = AuthContext.getCurrentUser();
|
||||
return currentUser == null ? null : currentUser.getCompanyId();
|
||||
return currentUser == null || currentUser.getCompanyId() == null
|
||||
? null : String.valueOf(currentUser.getCompanyId());
|
||||
}
|
||||
|
||||
private static class SyncRowResult {
|
||||
|
|
@ -1193,13 +1194,13 @@ public class TerminalCardExe {
|
|||
private String staffNo;
|
||||
private String staffName;
|
||||
private String mobileNo;
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
private String corpinfoName;
|
||||
private Long findsTrackId;
|
||||
}
|
||||
|
||||
private static class CorpInfo {
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
private String corpName;
|
||||
private String creditCode;
|
||||
private String contactName;
|
||||
|
|
|
|||
|
|
@ -53,14 +53,14 @@ public class AlarmDisposeRecordQueryExe {
|
|||
private void fillCorpinfo(Map<String, Object> params) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
params.put("eqCorpinfoId", ssoUser.getCompanyId());
|
||||
params.put("eqCorpinfoId", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void applyCorpinfo(QueryWrapper<AlarmDisposeRecordDO> queryWrapper) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
queryWrapper.eq("corpinfo_id", ssoUser.getCompanyId());
|
||||
queryWrapper.eq("corpinfo_id", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ public class AlarmRecordQueryExe {
|
|||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
sql.append(" AND corpinfo_id = ?");
|
||||
args.add(ssoUser.getCompanyId());
|
||||
args.add(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
sql.append(" ORDER BY corp_name ASC LIMIT 200");
|
||||
return jdbcTemplate.query(sql.toString(), args.toArray(), this::mapCompanyOption);
|
||||
|
|
@ -114,8 +114,8 @@ public class AlarmRecordQueryExe {
|
|||
}
|
||||
|
||||
private OptionCO mapCompanyOption(ResultSet rs, int rowNum) throws SQLException {
|
||||
Long corpinfoId = rs.getLong("corpinfo_id");
|
||||
return new OptionCO(rs.getString("corp_name"), rs.wasNull() ? null : String.valueOf(corpinfoId));
|
||||
String corpinfoId = rs.getString("corpinfo_id");
|
||||
return new OptionCO(rs.getString("corp_name"), corpinfoId);
|
||||
}
|
||||
|
||||
private void fillTargetsAndDisplayFields(List<AlarmRecordCO> rows) {
|
||||
|
|
@ -186,14 +186,14 @@ public class AlarmRecordQueryExe {
|
|||
}
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
params.put("eqCorpinfoId", ssoUser.getCompanyId());
|
||||
params.put("eqCorpinfoId", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void applyCorpinfo(QueryWrapper<AlarmRecordDO> queryWrapper) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
queryWrapper.eq("corpinfo_id", ssoUser.getCompanyId());
|
||||
queryWrapper.eq("corpinfo_id", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,14 +53,14 @@ public class AlarmRecordTargetQueryExe {
|
|||
private void fillCorpinfo(Map<String, Object> params) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
params.put("eqCorpinfoId", ssoUser.getCompanyId());
|
||||
params.put("eqCorpinfoId", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void applyCorpinfo(QueryWrapper<AlarmRecordTargetDO> queryWrapper) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
queryWrapper.eq("corpinfo_id", ssoUser.getCompanyId());
|
||||
queryWrapper.eq("corpinfo_id", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,14 +53,14 @@ public class AlarmRuleFenceRelQueryExe {
|
|||
private void fillCorpinfo(Map<String, Object> params) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
params.put("eqCorpinfoId", ssoUser.getCompanyId());
|
||||
params.put("eqCorpinfoId", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void applyCorpinfo(QueryWrapper<AlarmRuleFenceRelDO> queryWrapper) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
queryWrapper.eq("corpinfo_id", ssoUser.getCompanyId());
|
||||
queryWrapper.eq("corpinfo_id", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,14 +53,14 @@ public class AlarmRuleItemQueryExe {
|
|||
private void fillCorpinfo(Map<String, Object> params) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
params.put("eqCorpinfoId", ssoUser.getCompanyId());
|
||||
params.put("eqCorpinfoId", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void applyCorpinfo(QueryWrapper<AlarmRuleItemDO> queryWrapper) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
queryWrapper.eq("corpinfo_id", ssoUser.getCompanyId());
|
||||
queryWrapper.eq("corpinfo_id", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ public class AlarmRuleQueryExe {
|
|||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
sql.append(" AND corpinfo_id = ?");
|
||||
args.add(ssoUser.getCompanyId());
|
||||
args.add(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
if (StringUtils.hasText(keyword)) {
|
||||
sql.append(" AND (corp_name LIKE ? OR code LIKE ? OR contacts LIKE ? OR lr_name LIKE ?)");
|
||||
|
|
@ -169,7 +169,7 @@ public class AlarmRuleQueryExe {
|
|||
|
||||
private AlarmRuleCompanyStatCO mapCompanyStat(ResultSet rs, int rowNum) throws SQLException {
|
||||
AlarmRuleCompanyStatCO co = new AlarmRuleCompanyStatCO();
|
||||
long corpinfoId = rs.getLong("corpinfo_id");
|
||||
String corpinfoId = rs.getString("corpinfo_id");
|
||||
co.setCorpinfoId(rs.wasNull() ? null : corpinfoId);
|
||||
co.setCorpinfoName(rs.getString("corpinfo_name"));
|
||||
co.setConfigCount(rs.getInt("config_count"));
|
||||
|
|
@ -180,8 +180,8 @@ public class AlarmRuleQueryExe {
|
|||
}
|
||||
|
||||
private OptionCO mapCompanyOption(ResultSet rs, int rowNum) throws SQLException {
|
||||
long corpinfoId = rs.getLong("corpinfo_id");
|
||||
return new OptionCO(rs.getString("corp_name"), rs.wasNull() ? null : String.valueOf(corpinfoId));
|
||||
String corpinfoId = rs.getString("corpinfo_id");
|
||||
return new OptionCO(rs.getString("corp_name"), corpinfoId);
|
||||
}
|
||||
|
||||
private void fillFenceRelations(List<AlarmRuleCO> rows) {
|
||||
|
|
@ -236,12 +236,12 @@ public class AlarmRuleQueryExe {
|
|||
}
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
params.put("eqCorpinfoId", ssoUser.getCompanyId());
|
||||
params.put("eqCorpinfoId", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void prepareCorpinfoFallback(Map<String, Object> params) {
|
||||
Object corpinfoId = params.get("eqCorpinfoId");
|
||||
String corpinfoId = (String) params.get("eqCorpinfoId");
|
||||
String corpinfoName = (String) params.get("eqCorpinfoName");
|
||||
if (corpinfoId == null || !StringUtils.hasText(corpinfoName)) {
|
||||
return;
|
||||
|
|
@ -255,7 +255,7 @@ public class AlarmRuleQueryExe {
|
|||
private void applyCorpinfo(QueryWrapper<AlarmRuleDO> queryWrapper) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
queryWrapper.eq("corpinfo_id", ssoUser.getCompanyId());
|
||||
queryWrapper.eq("corpinfo_id", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class AreaQueryExe {
|
|||
return areaCoConvertor.converDOsToCOs(areaRepository.list(queryWrapper));
|
||||
}
|
||||
|
||||
public List<OptionCO> listOptions(Long corpinfoId, String keyword) {
|
||||
public List<OptionCO> listOptions(String corpinfoId, String keyword) {
|
||||
QueryWrapper<AreaDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.and(wrapper -> wrapper.isNull("delete_enum").or().eq("delete_enum", "FALSE"));
|
||||
queryWrapper.and(wrapper -> wrapper.isNull("status").or().eq("status", "ENABLED"));
|
||||
|
|
@ -79,18 +79,18 @@ public class AreaQueryExe {
|
|||
}
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
params.put("eqCorpinfoId", ssoUser.getCompanyId());
|
||||
params.put("eqCorpinfoId", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void applyCorpinfo(QueryWrapper<AreaDO> queryWrapper, Long corpinfoId) {
|
||||
private void applyCorpinfo(QueryWrapper<AreaDO> queryWrapper, String corpinfoId) {
|
||||
if (corpinfoId != null) {
|
||||
queryWrapper.eq("corpinfo_id", corpinfoId);
|
||||
return;
|
||||
}
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
queryWrapper.eq("corpinfo_id", ssoUser.getCompanyId());
|
||||
queryWrapper.eq("corpinfo_id", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,14 +53,14 @@ public class FencePointQueryExe {
|
|||
private void fillCorpinfo(Map<String, Object> params) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
params.put("eqCorpinfoId", ssoUser.getCompanyId());
|
||||
params.put("eqCorpinfoId", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void applyCorpinfo(QueryWrapper<FencePointDO> queryWrapper) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
queryWrapper.eq("corpinfo_id", ssoUser.getCompanyId());
|
||||
queryWrapper.eq("corpinfo_id", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class FenceQueryExe {
|
|||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
sql.append(" AND corpinfo_id = ?");
|
||||
args.add(ssoUser.getCompanyId());
|
||||
args.add(String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
if (StringUtils.hasText(keyword)) {
|
||||
sql.append(" AND (corp_name LIKE ? OR code LIKE ? OR contacts LIKE ? OR lr_name LIKE ?)");
|
||||
|
|
@ -136,7 +136,7 @@ public class FenceQueryExe {
|
|||
|
||||
private FenceCompanyStatCO mapCompanyStat(ResultSet rs, int rowNum) throws SQLException {
|
||||
FenceCompanyStatCO co = new FenceCompanyStatCO();
|
||||
long corpinfoId = rs.getLong("corpinfo_id");
|
||||
String corpinfoId = rs.getString("corpinfo_id");
|
||||
co.setCorpinfoId(rs.wasNull() ? null : corpinfoId);
|
||||
co.setCorpinfoName(rs.getString("corpinfo_name"));
|
||||
co.setFenceCount(rs.getInt("fence_count"));
|
||||
|
|
@ -147,8 +147,7 @@ public class FenceQueryExe {
|
|||
}
|
||||
|
||||
private OptionCO mapCompanyOption(ResultSet rs, int rowNum) throws SQLException {
|
||||
long corpinfoId = rs.getLong("corpinfo_id");
|
||||
return new OptionCO(rs.getString("corp_name"), rs.wasNull() ? null : String.valueOf(corpinfoId));
|
||||
return new OptionCO(rs.getString("corp_name"), rs.getString("corpinfo_id"));
|
||||
}
|
||||
|
||||
private void fillCorpinfo(Map<String, Object> params) {
|
||||
|
|
@ -159,12 +158,12 @@ public class FenceQueryExe {
|
|||
}
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
params.put("eqCorpinfoId", ssoUser.getCompanyId());
|
||||
params.put("eqCorpinfoId", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void prepareCorpinfoFallback(Map<String, Object> params) {
|
||||
Object corpinfoId = params.get("eqCorpinfoId");
|
||||
String corpinfoId = (String) params.get("eqCorpinfoId");
|
||||
String corpinfoName = (String) params.get("eqCorpinfoName");
|
||||
if (corpinfoId == null || !StringUtils.hasText(corpinfoName)) {
|
||||
return;
|
||||
|
|
@ -178,7 +177,7 @@ public class FenceQueryExe {
|
|||
private void applyCorpinfo(QueryWrapper<FenceDO> queryWrapper) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
queryWrapper.eq("corpinfo_id", ssoUser.getCompanyId());
|
||||
queryWrapper.eq("corpinfo_id", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,14 +53,14 @@ public class OpenapiConfigQueryExe {
|
|||
private void fillCorpinfo(Map<String, Object> params) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
params.put("eqCorpinfoId", ssoUser.getCompanyId());
|
||||
params.put("eqCorpinfoId", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void applyCorpinfo(QueryWrapper<OpenapiConfigDO> queryWrapper) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
queryWrapper.eq("corpinfo_id", ssoUser.getCompanyId());
|
||||
queryWrapper.eq("corpinfo_id", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ import java.util.ArrayList;
|
|||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
|
|
@ -55,7 +56,7 @@ public class PersonnelPositioningBiQueryExe {
|
|||
private static final String POINT_TRACE_API = "finds.point.trace";
|
||||
private static final String CORP_INFO_SELECT = "SELECT corpinfo_id, corp_name, code, address, address_business, "
|
||||
+ "address_office, contacts, lr_name, corp_type_name, corp_type2_name, corp_type3_name, corp_type4_name, "
|
||||
+ "longitude, latitude FROM corp_info WHERE (delete_enum IS NULL OR delete_enum = 'FALSE')";
|
||||
+ "longitude, latitude, port_area FROM corp_info WHERE (delete_enum IS NULL OR delete_enum = 'FALSE')";
|
||||
private static final String OPEN_ALARM_WHERE = "(delete_enum IS NULL OR delete_enum = 'FALSE') "
|
||||
+ "AND (dispose_status IS NULL OR dispose_status <> 'CLOSE')";
|
||||
private static final int DEFAULT_LIST_ALL_PAGE_SIZE = 200;
|
||||
|
|
@ -79,7 +80,7 @@ public class PersonnelPositioningBiQueryExe {
|
|||
return cached;
|
||||
}
|
||||
List<BiPersonLocationCO> personList = loadMatchedPersonLocations(new BiPersonLocationQry());
|
||||
List<BiCompanyLocationCO> companyList = listCompanyLocation(personList);
|
||||
List<BiCompanyLocationCO> companyList = listCompanyLocation(personList, null);
|
||||
List<BiPortStatCO> portList = buildPortStats(companyList);
|
||||
BiOverviewCO co = new BiOverviewCO();
|
||||
co.setCompanyList(companyList);
|
||||
|
|
@ -101,11 +102,12 @@ public class PersonnelPositioningBiQueryExe {
|
|||
return co;
|
||||
}
|
||||
|
||||
public List<BiCompanyLocationCO> listCompanyLocation() {
|
||||
return listCompanyLocation(loadMatchedPersonLocations(new BiPersonLocationQry()));
|
||||
public List<BiCompanyLocationCO> listCompanyLocation(Integer portArea) {
|
||||
validatePortArea(portArea);
|
||||
return listCompanyLocation(loadMatchedPersonLocations(new BiPersonLocationQry()), portArea);
|
||||
}
|
||||
|
||||
private List<BiCompanyLocationCO> listCompanyLocation(List<BiPersonLocationCO> personList) {
|
||||
private List<BiCompanyLocationCO> listCompanyLocation(List<BiPersonLocationCO> personList, Integer portArea) {
|
||||
Map<String, CompanyMarkerAccumulator> accumulatorMap = new LinkedHashMap<>();
|
||||
for (BiAreaFenceCO fence : listAllAreaFence()) {
|
||||
String companyName = firstText(fence.getCorpinfoName(), fence.getOrgName(), "未归属组织");
|
||||
|
|
@ -115,16 +117,101 @@ public class PersonnelPositioningBiQueryExe {
|
|||
key -> new CompanyMarkerAccumulator(companyName));
|
||||
accumulator.addFence(fence);
|
||||
}
|
||||
List<BiCompanyLocationCO> result = new ArrayList<>();
|
||||
List<BiCompanyLocationCO> fenceCompanies = new ArrayList<>();
|
||||
for (CompanyMarkerAccumulator accumulator : accumulatorMap.values()) {
|
||||
result.add(accumulator.toCO());
|
||||
fenceCompanies.add(accumulator.toCO());
|
||||
}
|
||||
fillCompanyInfo(result);
|
||||
List<BiCompanyLocationCO> result = mergeCorpInfoCompanies(fenceCompanies, portArea);
|
||||
fillCompanyAlarmCounts(result);
|
||||
fillCompanyOnlineCounts(result, personList);
|
||||
return result;
|
||||
}
|
||||
|
||||
private void validatePortArea(Integer portArea) {
|
||||
if (portArea != null && (portArea < 1 || portArea > 3)) {
|
||||
throw new BizException("portArea只支持1、2、3");
|
||||
}
|
||||
}
|
||||
|
||||
private List<BiCompanyLocationCO> mergeCorpInfoCompanies(List<BiCompanyLocationCO> fenceCompanies,
|
||||
Integer portArea) {
|
||||
Map<String, BiCompanyLocationCO> companiesById = new LinkedHashMap<>();
|
||||
Map<String, BiCompanyLocationCO> companiesByName = new LinkedHashMap<>();
|
||||
for (BiCompanyLocationCO company : fenceCompanies) {
|
||||
if (StringUtils.hasText(company.getCorpinfoId())) {
|
||||
companiesById.putIfAbsent(company.getCorpinfoId(), company);
|
||||
}
|
||||
String companyName = firstText(company.getCorpinfoName(), company.getCompanyName());
|
||||
if (StringUtils.hasText(companyName)) {
|
||||
companiesByName.putIfAbsent(companyName, company);
|
||||
}
|
||||
}
|
||||
|
||||
Set<BiCompanyLocationCO> mergedFenceCompanies = Collections.newSetFromMap(new IdentityHashMap<>());
|
||||
List<BiCompanyLocationCO> result = new ArrayList<>();
|
||||
for (CorpInfoView corpInfo : listCorpInfos(portArea)) {
|
||||
BiCompanyLocationCO company = companiesById.get(corpInfo.corpinfoId);
|
||||
if (company == null) {
|
||||
company = companiesByName.get(corpInfo.corpName);
|
||||
}
|
||||
if (company == null || mergedFenceCompanies.contains(company)) {
|
||||
company = emptyCompanyLocation();
|
||||
} else {
|
||||
mergedFenceCompanies.add(company);
|
||||
}
|
||||
applyCorpInfo(company, corpInfo);
|
||||
applyPortArea(company, corpInfo.portArea);
|
||||
result.add(company);
|
||||
}
|
||||
|
||||
if (portArea == null) {
|
||||
for (BiCompanyLocationCO company : fenceCompanies) {
|
||||
if (!mergedFenceCompanies.contains(company)) {
|
||||
result.add(company);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<CorpInfoView> listCorpInfos(Integer portArea) {
|
||||
StringBuilder sql = new StringBuilder(CORP_INFO_SELECT);
|
||||
List<Object> args = new ArrayList<>();
|
||||
if (portArea != null) {
|
||||
sql.append(" AND port_area = ?");
|
||||
args.add(portArea);
|
||||
}
|
||||
sql.append(" ORDER BY corp_name, corpinfo_id");
|
||||
return jdbcTemplate.query(sql.toString(), this::mapCorpInfo, args.toArray());
|
||||
}
|
||||
|
||||
private BiCompanyLocationCO emptyCompanyLocation() {
|
||||
BiCompanyLocationCO company = new BiCompanyLocationCO();
|
||||
company.setFenceCount(0);
|
||||
company.setCompanyAreaCount(0);
|
||||
company.setWorkFenceCount(0);
|
||||
company.setAlarmCount(0);
|
||||
company.setOnlineCount(0);
|
||||
return company;
|
||||
}
|
||||
|
||||
private void applyPortArea(BiCompanyLocationCO company, Integer portArea) {
|
||||
company.setPortArea(portArea);
|
||||
if (portArea == null) {
|
||||
return;
|
||||
}
|
||||
if (portArea == 1) {
|
||||
company.setPortCode("QHD");
|
||||
company.setPortName("秦皇岛港区");
|
||||
} else if (portArea == 2) {
|
||||
company.setPortCode("EAST");
|
||||
company.setPortName("东港区");
|
||||
} else if (portArea == 3) {
|
||||
company.setPortCode("WEST");
|
||||
company.setPortName("西港区");
|
||||
}
|
||||
}
|
||||
|
||||
public PageResponse<BiAreaFenceCO> listCompanyFence(BiCompanyFenceQry qry) {
|
||||
BiCompanyFenceQry query = qry == null ? new BiCompanyFenceQry() : qry;
|
||||
List<BiAreaFenceCO> matched = new ArrayList<>();
|
||||
|
|
@ -360,7 +447,7 @@ public class PersonnelPositioningBiQueryExe {
|
|||
long parentId = rs.getLong("parent_id");
|
||||
area.parentId = rs.wasNull() ? null : parentId;
|
||||
area.parentCode = rs.getString("parent_code");
|
||||
long corpinfoId = rs.getLong("corpinfo_id");
|
||||
String corpinfoId = rs.getString("corpinfo_id");
|
||||
area.corpinfoId = rs.wasNull() ? null : corpinfoId;
|
||||
area.corpinfoName = rs.getString("corpinfo_name");
|
||||
area.centerLon = rs.getBigDecimal("center_lon");
|
||||
|
|
@ -597,9 +684,12 @@ public class PersonnelPositioningBiQueryExe {
|
|||
co.setCompanyName(local.getCorpinfoName());
|
||||
co.setCorpinfoName(local.getCorpinfoName());
|
||||
co.setCorpinfoId(local.getCorpinfoId() == null ? null : String.valueOf(local.getCorpinfoId()));
|
||||
co.setPortArea(local.getPortArea());
|
||||
co.setCreditCode(local.getCreditCode());
|
||||
CorpInfoView corpInfo = queryCorpInfoById(local.getCorpinfoId());
|
||||
if (corpInfo != null) {
|
||||
co.setCreditCode(corpInfo.code);
|
||||
co.setPortArea(corpInfo.portArea);
|
||||
}
|
||||
co.setPositionMode(positionMode(terminal, terminalNo));
|
||||
co.setLon(decimalValue(firstPresentAny(child(location, "lon"), child(location, "lng"),
|
||||
|
|
@ -817,15 +907,18 @@ public class PersonnelPositioningBiQueryExe {
|
|||
private List<BiPortStatCO> buildPortStats(List<BiCompanyLocationCO> companyList) {
|
||||
Map<String, BiPortStatCO> portMap = new LinkedHashMap<>();
|
||||
for (BiCompanyLocationCO company : companyList) {
|
||||
if (company.getPortId() == null && !StringUtils.hasText(company.getPortCode())
|
||||
if (company.getPortArea() == null && company.getPortId() == null
|
||||
&& !StringUtils.hasText(company.getPortCode())
|
||||
&& !StringUtils.hasText(company.getPortName())) {
|
||||
continue;
|
||||
}
|
||||
String portKey = company.getPortId() != null ? "ID:" + company.getPortId()
|
||||
String portKey = company.getPortArea() != null ? "AREA:" + company.getPortArea()
|
||||
: (company.getPortId() != null ? "ID:" + company.getPortId()
|
||||
: (StringUtils.hasText(company.getPortCode())
|
||||
? "CODE:" + company.getPortCode() : "NAME:" + company.getPortName());
|
||||
? "CODE:" + company.getPortCode() : "NAME:" + company.getPortName()));
|
||||
BiPortStatCO port = portMap.computeIfAbsent(portKey, key -> {
|
||||
BiPortStatCO value = new BiPortStatCO();
|
||||
value.setPortArea(company.getPortArea());
|
||||
value.setPortId(company.getPortId());
|
||||
value.setPortCode(company.getPortCode());
|
||||
value.setPortName(company.getPortName());
|
||||
|
|
@ -837,6 +930,9 @@ public class PersonnelPositioningBiQueryExe {
|
|||
value.setCompanyList(new ArrayList<>());
|
||||
return value;
|
||||
});
|
||||
if (port.getPortId() == null && company.getPortId() != null) {
|
||||
port.setPortId(company.getPortId());
|
||||
}
|
||||
port.setCompanyCount(port.getCompanyCount() + 1);
|
||||
port.setCompanyAreaCount(port.getCompanyAreaCount() + safeInt(company.getCompanyAreaCount()));
|
||||
port.setWorkFenceCount(port.getWorkFenceCount() + safeInt(company.getWorkFenceCount()));
|
||||
|
|
@ -1115,18 +1211,6 @@ public class PersonnelPositioningBiQueryExe {
|
|||
return value > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) Math.max(value, 0);
|
||||
}
|
||||
|
||||
private void fillCompanyInfo(List<BiCompanyLocationCO> rows) {
|
||||
for (BiCompanyLocationCO row : rows) {
|
||||
CorpInfoView corpInfo = queryCorpInfo(row.getCreditCode(), row.getOrgCode(), row.getCompanyName());
|
||||
if (corpInfo == null && !row.getCompanyName().equals(row.getCorpinfoName())) {
|
||||
corpInfo = queryCorpInfo(row.getCreditCode(), row.getOrgCode(), row.getCorpinfoName());
|
||||
}
|
||||
if (corpInfo != null) {
|
||||
applyCorpInfo(row, corpInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private CorpInfoView queryCorpInfo(String creditCode, String orgCode, String companyName) {
|
||||
CorpInfoView exactByCreditCode = queryCorpInfoByCreditCode(creditCode);
|
||||
if (exactByCreditCode != null) {
|
||||
|
|
@ -1156,7 +1240,7 @@ public class PersonnelPositioningBiQueryExe {
|
|||
return queryFirstCorpInfo(CORP_INFO_SELECT + " AND code = ? LIMIT 1", creditCode);
|
||||
}
|
||||
|
||||
private CorpInfoView queryCorpInfoById(Long corpinfoId) {
|
||||
private CorpInfoView queryCorpInfoById(String corpinfoId) {
|
||||
if (corpinfoId == null) {
|
||||
return null;
|
||||
}
|
||||
|
|
@ -1185,6 +1269,8 @@ public class PersonnelPositioningBiQueryExe {
|
|||
corpInfo.corpType4Name = rs.getString("corp_type4_name");
|
||||
corpInfo.longitude = rs.getString("longitude");
|
||||
corpInfo.latitude = rs.getString("latitude");
|
||||
int portArea = rs.getInt("port_area");
|
||||
corpInfo.portArea = rs.wasNull() ? null : portArea;
|
||||
return corpInfo;
|
||||
}
|
||||
|
||||
|
|
@ -1359,7 +1445,7 @@ public class PersonnelPositioningBiQueryExe {
|
|||
private String areaType;
|
||||
private Long parentId;
|
||||
private String parentCode;
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
private String corpinfoName;
|
||||
private BigDecimal centerLon;
|
||||
private BigDecimal centerLat;
|
||||
|
|
@ -1381,6 +1467,7 @@ public class PersonnelPositioningBiQueryExe {
|
|||
private String corpType4Name;
|
||||
private String longitude;
|
||||
private String latitude;
|
||||
private Integer portArea;
|
||||
}
|
||||
|
||||
private class CompanyMarkerAccumulator {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,8 @@ class PositionPersonLocalLookupService {
|
|||
String placeholders = String.join(",", Collections.nCopies(batch.size(), "?"));
|
||||
String sql = "SELECT u.id AS user_id, u.username AS local_staff_no, u.name AS staff_name, "
|
||||
+ "TRIM(u.phone) AS mobile_no, u.user_id_card AS id_card_no, u.corpinfo_id, "
|
||||
+ "ci.corp_name AS corpinfo_name, u.department_id, d.name AS department_name "
|
||||
+ "ci.corp_name AS corpinfo_name, ci.code AS credit_code, ci.port_area, "
|
||||
+ "u.department_id, d.name AS department_name "
|
||||
+ "FROM user_scope_v u "
|
||||
+ "LEFT JOIN corp_info ci ON CAST(ci.corpinfo_id AS CHAR) = CAST(u.corpinfo_id AS CHAR) "
|
||||
+ "LEFT JOIN department d ON d.id = u.department_id "
|
||||
|
|
@ -43,8 +44,11 @@ class PositionPersonLocalLookupService {
|
|||
person.setStaffName(rs.getString("staff_name"));
|
||||
person.setMobileNo(normalize(rs.getString("mobile_no")));
|
||||
person.setIdCardNo(rs.getString("id_card_no"));
|
||||
person.setCorpinfoId(nullableLong(rs.getLong("corpinfo_id"), rs.wasNull()));
|
||||
person.setCorpinfoId(rs.getString("corpinfo_id"));
|
||||
person.setCorpinfoName(rs.getString("corpinfo_name"));
|
||||
person.setCreditCode(rs.getString("credit_code"));
|
||||
int portArea = rs.getInt("port_area");
|
||||
person.setPortArea(rs.wasNull() ? null : portArea);
|
||||
person.setDepartmentId(nullableLong(rs.getLong("department_id"), rs.wasNull()));
|
||||
person.setDepartmentName(rs.getString("department_name"));
|
||||
return person;
|
||||
|
|
@ -66,7 +70,8 @@ class PositionPersonLocalLookupService {
|
|||
String placeholders = String.join(",", Collections.nCopies(batch.size(), "?"));
|
||||
String sql = "SELECT DISTINCT t.terminal_no, u.id AS user_id, u.username AS local_staff_no, "
|
||||
+ "u.name AS staff_name, TRIM(u.phone) AS mobile_no, u.user_id_card AS id_card_no, "
|
||||
+ "u.corpinfo_id, ci.corp_name AS corpinfo_name, u.department_id, d.name AS department_name "
|
||||
+ "u.corpinfo_id, ci.corp_name AS corpinfo_name, ci.code AS credit_code, ci.port_area, "
|
||||
+ "u.department_id, d.name AS department_name "
|
||||
+ "FROM terminal t LEFT JOIN terminal_bind tb ON tb.terminal_id = t.id "
|
||||
+ "AND tb.bind_status = 'BOUND' "
|
||||
+ "AND (tb.delete_enum IS NULL OR tb.delete_enum = 'FALSE') "
|
||||
|
|
@ -85,8 +90,11 @@ class PositionPersonLocalLookupService {
|
|||
person.setStaffName(rs.getString("staff_name"));
|
||||
person.setMobileNo(normalize(rs.getString("mobile_no")));
|
||||
person.setIdCardNo(rs.getString("id_card_no"));
|
||||
person.setCorpinfoId(nullableLong(rs.getLong("corpinfo_id"), rs.wasNull()));
|
||||
person.setCorpinfoId(rs.getString("corpinfo_id"));
|
||||
person.setCorpinfoName(rs.getString("corpinfo_name"));
|
||||
person.setCreditCode(rs.getString("credit_code"));
|
||||
int portArea = rs.getInt("port_area");
|
||||
person.setPortArea(rs.wasNull() ? null : portArea);
|
||||
person.setDepartmentId(nullableLong(rs.getLong("department_id"), rs.wasNull()));
|
||||
person.setDepartmentName(rs.getString("department_name"));
|
||||
return new TerminalPerson(rs.getString("terminal_no"), person);
|
||||
|
|
@ -154,8 +162,10 @@ class PositionPersonLocalLookupService {
|
|||
private String staffName;
|
||||
private String mobileNo;
|
||||
private String idCardNo;
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
private String corpinfoName;
|
||||
private String creditCode;
|
||||
private Integer portArea;
|
||||
private Long departmentId;
|
||||
private String departmentName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
package com.zcloud.personnel.positioning.command.query;
|
||||
|
||||
public class RealtimeLocationPayloadException extends RuntimeException {
|
||||
public RealtimeLocationPayloadException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public RealtimeLocationPayloadException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,312 @@
|
|||
package com.zcloud.personnel.positioning.command.query;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.zcloud.personnel.positioning.dto.clientobject.BiPersonLocationCO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class RealtimePersonLocationMatcher {
|
||||
private static final String[] ROW_COLLECTION_FIELDS = {"records", "rows", "list", "points"};
|
||||
private static final String[] ENVELOPE_FIELDS = {"data", "payload", "message", "body"};
|
||||
|
||||
private final ObjectMapper objectMapper;
|
||||
private final PositionPersonLocalLookupService localLookupService;
|
||||
|
||||
public List<BiPersonLocationCO> match(byte[] payload) {
|
||||
JsonNode root = parse(payload);
|
||||
List<LocationCandidate> candidates = new ArrayList<>();
|
||||
Set<String> staffNos = new LinkedHashSet<>();
|
||||
for (JsonNode row : extractRows(root)) {
|
||||
String staffNo = staffNo(row);
|
||||
if (!StringUtils.hasText(staffNo)) {
|
||||
continue;
|
||||
}
|
||||
candidates.add(new LocationCandidate(row, staffNo));
|
||||
staffNos.add(staffNo);
|
||||
}
|
||||
if (staffNos.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
Map<String, PositionPersonLocalLookupService.LocalPerson> localPeople =
|
||||
localLookupService.findUniquePeopleByPhones(staffNos);
|
||||
if (localPeople.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
Set<String> terminalNos = new LinkedHashSet<>();
|
||||
for (LocationCandidate candidate : candidates) {
|
||||
if (!localPeople.containsKey(candidate.staffNo)) {
|
||||
continue;
|
||||
}
|
||||
candidate.terminalNo = terminalNo(candidate.row);
|
||||
if (StringUtils.hasText(candidate.terminalNo)) {
|
||||
terminalNos.add(candidate.terminalNo);
|
||||
}
|
||||
}
|
||||
Map<String, PositionPersonLocalLookupService.TerminalSnapshot> terminals =
|
||||
localLookupService.findTerminals(terminalNos);
|
||||
|
||||
List<BiPersonLocationCO> result = new ArrayList<>();
|
||||
for (LocationCandidate candidate : candidates) {
|
||||
PositionPersonLocalLookupService.LocalPerson local = localPeople.get(candidate.staffNo);
|
||||
if (local != null) {
|
||||
result.add(toClientObject(candidate, local, terminals.get(candidate.terminalNo)));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private JsonNode parse(byte[] payload) {
|
||||
if (payload == null || payload.length == 0) {
|
||||
throw new RealtimeLocationPayloadException("Kafka location payload is empty");
|
||||
}
|
||||
try {
|
||||
JsonNode root = objectMapper.readTree(payload);
|
||||
if (root == null || root.isNull()) {
|
||||
throw new RealtimeLocationPayloadException("Kafka location payload is empty JSON");
|
||||
}
|
||||
return root;
|
||||
} catch (IOException e) {
|
||||
throw new RealtimeLocationPayloadException("Kafka location payload is not valid JSON", e);
|
||||
}
|
||||
}
|
||||
|
||||
private List<JsonNode> extractRows(JsonNode root) {
|
||||
if (root.isArray()) {
|
||||
return arrayValues(root);
|
||||
}
|
||||
JsonNode collection = firstArray(root, ROW_COLLECTION_FIELDS);
|
||||
if (collection != null) {
|
||||
return arrayValues(collection);
|
||||
}
|
||||
for (String envelopeField : ENVELOPE_FIELDS) {
|
||||
JsonNode nested = parsedNode(root.get(envelopeField));
|
||||
if (nested == null) {
|
||||
continue;
|
||||
}
|
||||
if (nested.isArray()) {
|
||||
return arrayValues(nested);
|
||||
}
|
||||
JsonNode nestedCollection = firstArray(nested, ROW_COLLECTION_FIELDS);
|
||||
if (nestedCollection != null) {
|
||||
return arrayValues(nestedCollection);
|
||||
}
|
||||
if (!StringUtils.hasText(staffNo(root)) && nested.isObject()) {
|
||||
return Collections.singletonList(nested);
|
||||
}
|
||||
}
|
||||
return Collections.singletonList(root);
|
||||
}
|
||||
|
||||
private JsonNode parsedNode(JsonNode node) {
|
||||
if (node == null || node.isNull()) {
|
||||
return null;
|
||||
}
|
||||
if (!node.isTextual()) {
|
||||
return node;
|
||||
}
|
||||
String value = node.asText();
|
||||
if (!StringUtils.hasText(value)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return objectMapper.readTree(value);
|
||||
} catch (IOException ignored) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private JsonNode firstArray(JsonNode node, String... fieldNames) {
|
||||
if (node == null || !node.isObject()) {
|
||||
return null;
|
||||
}
|
||||
for (String fieldName : fieldNames) {
|
||||
JsonNode value = node.get(fieldName);
|
||||
if (value != null && value.isArray()) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private List<JsonNode> arrayValues(JsonNode array) {
|
||||
List<JsonNode> result = new ArrayList<>();
|
||||
array.forEach(result::add);
|
||||
return result;
|
||||
}
|
||||
|
||||
private String staffNo(JsonNode row) {
|
||||
return firstText(
|
||||
directText(row, "staffNo", "code", "employeeNo", "workNo", "trackNo"),
|
||||
directText(child(row, "terminalInfo"), "trackNo", "staffNo"),
|
||||
directText(child(row, "staff"), "staffNo", "code", "employeeNo", "workNo", "trackNo"),
|
||||
directText(child(row, "person"), "staffNo", "code", "employeeNo", "workNo", "trackNo"),
|
||||
directText(child(row, "personInfo"), "staffNo", "code", "employeeNo", "workNo", "trackNo"),
|
||||
directText(locationNode(row), "staffNo", "trackNo"));
|
||||
}
|
||||
|
||||
private String terminalNo(JsonNode row) {
|
||||
return firstText(
|
||||
directText(row, "terminalNo"),
|
||||
directText(child(row, "terminalInfo"), "terminalNo"),
|
||||
directText(child(row, "terminal"), "terminalNo"),
|
||||
directText(child(row, "bindTerminal"), "terminalNo"),
|
||||
directText(locationNode(row), "terminalNo"));
|
||||
}
|
||||
|
||||
private BiPersonLocationCO toClientObject(LocationCandidate candidate,
|
||||
PositionPersonLocalLookupService.LocalPerson local,
|
||||
PositionPersonLocalLookupService.TerminalSnapshot terminal) {
|
||||
JsonNode row = candidate.row;
|
||||
JsonNode location = locationNode(row);
|
||||
BiPersonLocationCO co = new BiPersonLocationCO();
|
||||
co.setUserId(local.getUserId());
|
||||
co.setStaffName(local.getStaffName());
|
||||
co.setLocalStaffNo(local.getLocalStaffNo());
|
||||
co.setStaffNo(candidate.staffNo);
|
||||
co.setIdCardNo(local.getIdCardNo());
|
||||
co.setMobileNo(local.getMobileNo());
|
||||
co.setDepartmentId(local.getDepartmentId());
|
||||
co.setDepartmentName(local.getDepartmentName());
|
||||
co.setCompanyName(local.getCorpinfoName());
|
||||
co.setCorpinfoId(local.getCorpinfoId());
|
||||
co.setCorpinfoName(local.getCorpinfoName());
|
||||
co.setCreditCode(local.getCreditCode());
|
||||
co.setPortArea(local.getPortArea());
|
||||
co.setOrgName(directText(row, "orgName", "companyName", "corpName", "enterpriseName"));
|
||||
co.setOrgCode(directText(row, "orgCode", "companyCode", "corpCode", "enterpriseCode"));
|
||||
co.setTerminalNo(candidate.terminalNo);
|
||||
co.setPositionMode(positionMode(terminal));
|
||||
co.setLon(decimalValue(firstValue(location, row, "lon", "lng", "longitude")));
|
||||
co.setLat(decimalValue(firstValue(location, row, "lat", "latitude")));
|
||||
co.setAlt(decimalValue(firstValue(location, row, "alt", "altitude")));
|
||||
co.setSpeed(decimalValue(firstValue(location, row, "spd", "speed")));
|
||||
co.setDirection(decimalValue(firstValue(location, row, "dir", "direction")));
|
||||
co.setLastLocationTime(longValue(firstValue(location, row, "gt", "time", "locateTime",
|
||||
"locationTime", "timestamp")));
|
||||
co.setCurrentLocation(firstText(
|
||||
directText(location, "fenceName", "areaName", "positionName", "location", "address"),
|
||||
directText(row, "fenceName", "areaName", "positionName", "locationName", "address")));
|
||||
co.setOnline(co.getLon() != null && co.getLat() != null);
|
||||
co.setLocationRawJson(row.toString());
|
||||
return co;
|
||||
}
|
||||
|
||||
private JsonNode locationNode(JsonNode row) {
|
||||
JsonNode nested = firstObject(row, "location", "point", "position", "locationInfo", "data");
|
||||
return nested == null ? row : nested;
|
||||
}
|
||||
|
||||
private JsonNode firstObject(JsonNode node, String... fieldNames) {
|
||||
if (node == null || !node.isObject()) {
|
||||
return null;
|
||||
}
|
||||
for (String fieldName : fieldNames) {
|
||||
JsonNode value = node.get(fieldName);
|
||||
if (value != null && value.isObject()) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private JsonNode firstValue(JsonNode first, JsonNode second, String... fieldNames) {
|
||||
JsonNode value = directValue(first, fieldNames);
|
||||
return value == null ? directValue(second, fieldNames) : value;
|
||||
}
|
||||
|
||||
private JsonNode directValue(JsonNode node, String... fieldNames) {
|
||||
if (node == null || !node.isObject()) {
|
||||
return null;
|
||||
}
|
||||
for (String fieldName : fieldNames) {
|
||||
JsonNode value = node.get(fieldName);
|
||||
if (value != null && !value.isNull()) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private String directText(JsonNode node, String... fieldNames) {
|
||||
JsonNode value = directValue(node, fieldNames);
|
||||
if (value == null || value.isContainerNode()) {
|
||||
return null;
|
||||
}
|
||||
String text = value.asText();
|
||||
return StringUtils.hasText(text) ? text.trim() : null;
|
||||
}
|
||||
|
||||
private BigDecimal decimalValue(JsonNode node) {
|
||||
if (node == null || node.isNull()) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return node.isNumber() ? node.decimalValue() : new BigDecimal(node.asText());
|
||||
} catch (NumberFormatException ignored) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private Long longValue(JsonNode node) {
|
||||
if (node == null || node.isNull()) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return node.isNumber() ? node.asLong() : Long.valueOf(node.asText());
|
||||
} catch (NumberFormatException ignored) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private String positionMode(PositionPersonLocalLookupService.TerminalSnapshot terminal) {
|
||||
String deviceType = terminal == null ? null : terminal.getDeviceType();
|
||||
if ("CARD".equalsIgnoreCase(deviceType)) {
|
||||
return "\u5b9a\u4f4d\u5361";
|
||||
}
|
||||
if ("APP".equalsIgnoreCase(deviceType)) {
|
||||
return "\u624b\u673aAPP";
|
||||
}
|
||||
if ("OTHER".equalsIgnoreCase(deviceType)) {
|
||||
return "\u5176\u4ed6";
|
||||
}
|
||||
return StringUtils.hasText(deviceType) ? deviceType : "\u5b9a\u4f4d\u7ec8\u7aef";
|
||||
}
|
||||
|
||||
private JsonNode child(JsonNode node, String fieldName) {
|
||||
return node == null || !node.isObject() ? null : node.get(fieldName);
|
||||
}
|
||||
|
||||
private String firstText(String... values) {
|
||||
for (String value : values) {
|
||||
if (StringUtils.hasText(value)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static class LocationCandidate {
|
||||
private final JsonNode row;
|
||||
private final String staffNo;
|
||||
private String terminalNo;
|
||||
|
||||
private LocationCandidate(JsonNode row, String staffNo) {
|
||||
this.row = row;
|
||||
this.staffNo = staffNo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -53,14 +53,14 @@ public class SyncLogQueryExe {
|
|||
private void fillCorpinfo(Map<String, Object> params) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
params.put("eqCorpinfoId", ssoUser.getCompanyId());
|
||||
params.put("eqCorpinfoId", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void applyCorpinfo(QueryWrapper<SyncLogDO> queryWrapper) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
queryWrapper.eq("corpinfo_id", ssoUser.getCompanyId());
|
||||
queryWrapper.eq("corpinfo_id", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,14 +53,14 @@ public class SyncTaskQueryExe {
|
|||
private void fillCorpinfo(Map<String, Object> params) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
params.put("eqCorpinfoId", ssoUser.getCompanyId());
|
||||
params.put("eqCorpinfoId", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void applyCorpinfo(QueryWrapper<SyncTaskDO> queryWrapper) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
queryWrapper.eq("corpinfo_id", ssoUser.getCompanyId());
|
||||
queryWrapper.eq("corpinfo_id", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,14 +53,14 @@ public class TerminalBindQueryExe {
|
|||
private void fillCorpinfo(Map<String, Object> params) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
params.put("eqCorpinfoId", ssoUser.getCompanyId());
|
||||
params.put("eqCorpinfoId", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void applyCorpinfo(QueryWrapper<TerminalBindDO> queryWrapper) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
queryWrapper.eq("corpinfo_id", ssoUser.getCompanyId());
|
||||
queryWrapper.eq("corpinfo_id", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,14 +53,14 @@ public class TerminalQueryExe {
|
|||
private void fillCorpinfo(Map<String, Object> params) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
params.put("eqCorpinfoId", ssoUser.getCompanyId());
|
||||
params.put("eqCorpinfoId", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void applyCorpinfo(QueryWrapper<TerminalDO> queryWrapper) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
if (ssoUser != null && ssoUser.getCompanyId() != null) {
|
||||
queryWrapper.eq("corpinfo_id", ssoUser.getCompanyId());
|
||||
queryWrapper.eq("corpinfo_id", String.valueOf(ssoUser.getCompanyId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,8 @@ public class FindsOpenApiClient {
|
|||
|
||||
private OpenapiConfigDO loadEnabledConfig() {
|
||||
SSOUser currentUser = AuthContext.getCurrentUser();
|
||||
Long companyId = currentUser == null ? null : currentUser.getCompanyId();
|
||||
String companyId = currentUser == null || currentUser.getCompanyId() == null
|
||||
? null : String.valueOf(currentUser.getCompanyId());
|
||||
OpenapiConfigDO config = openapiConfigCache.getEnabledConfig(companyId);
|
||||
if (config == null) {
|
||||
throw new BizException("未配置启用的FindS OpenAPI配置");
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class OpenapiConfigCache {
|
|||
this.stringRedisTemplate = stringRedisTemplateProvider.getIfAvailable();
|
||||
}
|
||||
|
||||
public OpenapiConfigDO getEnabledConfig(Long companyId) {
|
||||
public OpenapiConfigDO getEnabledConfig(String companyId) {
|
||||
OpenapiConfigDO companyConfig = companyId == null ? null
|
||||
: getOrLoad(companyKey(companyId), () -> queryConfigByCorpinfo(companyId));
|
||||
if (companyConfig != null) {
|
||||
|
|
@ -111,7 +111,7 @@ public class OpenapiConfigCache {
|
|||
return dbConfig;
|
||||
}
|
||||
|
||||
private OpenapiConfigDO queryConfigByCorpinfo(Long companyId) {
|
||||
private OpenapiConfigDO queryConfigByCorpinfo(String companyId) {
|
||||
QueryWrapper<OpenapiConfigDO> queryWrapper = baseConfigQuery();
|
||||
queryWrapper.eq("corpinfo_id", companyId);
|
||||
queryWrapper.last("LIMIT 1");
|
||||
|
|
@ -181,7 +181,7 @@ public class OpenapiConfigCache {
|
|||
localCache.put(key, new CacheEntry(config, System.currentTimeMillis() + LOCAL_TTL_MILLIS));
|
||||
}
|
||||
|
||||
private String companyKey(Long companyId) {
|
||||
private String companyKey(String companyId) {
|
||||
return "corp:" + companyId;
|
||||
}
|
||||
|
||||
|
|
@ -206,7 +206,7 @@ public class OpenapiConfigCache {
|
|||
config.setSik(text(map.get("sik")));
|
||||
config.setSisCipherText(text(map.get("sisCipherText")));
|
||||
config.setEnabled(integer(map.get("enabled")));
|
||||
config.setCorpinfoId(longValue(map.get("corpinfoId")));
|
||||
config.setCorpinfoId(text(map.get("corpinfoId")));
|
||||
config.setCorpinfoName(text(map.get("corpinfoName")));
|
||||
return config;
|
||||
}
|
||||
|
|
@ -255,7 +255,7 @@ public class OpenapiConfigCache {
|
|||
private final String sik;
|
||||
private final String sisCipherText;
|
||||
private final Integer enabled;
|
||||
private final Long corpinfoId;
|
||||
private final String corpinfoId;
|
||||
private final String corpinfoName;
|
||||
|
||||
private CachedOpenapiConfig(OpenapiConfigDO config) {
|
||||
|
|
@ -308,7 +308,7 @@ public class OpenapiConfigCache {
|
|||
return enabled;
|
||||
}
|
||||
|
||||
public Long getCorpinfoId() {
|
||||
public String getCorpinfoId() {
|
||||
return corpinfoId;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,28 @@
|
|||
package com.zcloud.personnel.positioning.integration.kafka;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.zcloud.personnel.positioning.command.query.RealtimeLocationPayloadException;
|
||||
import com.zcloud.personnel.positioning.command.query.RealtimePersonLocationMatcher;
|
||||
import com.zcloud.personnel.positioning.dto.clientobject.BiPersonLocationCO;
|
||||
import com.zcloud.personnel.positioning.integration.realtime.RealtimeLocationPublisher;
|
||||
import org.apache.kafka.clients.consumer.ConsumerRecord;
|
||||
import org.apache.kafka.common.header.Header;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.kafka.annotation.KafkaListener;
|
||||
import org.springframework.kafka.support.Acknowledgment;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
@Component
|
||||
|
|
@ -21,10 +35,19 @@ public class LocationKafkaProbeListener {
|
|||
private static final Logger LOGGER = LoggerFactory.getLogger(LocationKafkaProbeListener.class);
|
||||
|
||||
private final int maxLogBytes;
|
||||
private final RealtimePersonLocationMatcher locationMatcher;
|
||||
private final ObjectMapper objectMapper;
|
||||
private final ObjectProvider<RealtimeLocationPublisher> publishers;
|
||||
|
||||
public LocationKafkaProbeListener(
|
||||
@Value("${personnel-positioning.kafka.location.max-log-bytes:16384}") int maxLogBytes) {
|
||||
@Value("${personnel-positioning.kafka.location.max-log-bytes:16384}") int maxLogBytes,
|
||||
RealtimePersonLocationMatcher locationMatcher,
|
||||
ObjectMapper objectMapper,
|
||||
ObjectProvider<RealtimeLocationPublisher> publishers) {
|
||||
this.maxLogBytes = Math.max(1, maxLogBytes);
|
||||
this.locationMatcher = locationMatcher;
|
||||
this.objectMapper = objectMapper;
|
||||
this.publishers = publishers;
|
||||
}
|
||||
|
||||
@KafkaListener(
|
||||
|
|
@ -32,7 +55,7 @@ public class LocationKafkaProbeListener {
|
|||
topics = "${personnel-positioning.kafka.location.topic:point_push}",
|
||||
groupId = "${personnel-positioning.kafka.location.group-id:personnel-position-location-probe}"
|
||||
)
|
||||
public void onMessage(ConsumerRecord<byte[], byte[]> record) {
|
||||
public void onMessage(ConsumerRecord<byte[], byte[]> record, Acknowledgment acknowledgment) {
|
||||
LOGGER.info(
|
||||
"收到Kafka定位原始消息,topic={}, partition={}, offset={}, timestamp={}, "
|
||||
+ "timestampType={}, keyBytes={}, valueBytes={}, key={}, headers={}, value={}",
|
||||
|
|
@ -47,6 +70,43 @@ public class LocationKafkaProbeListener {
|
|||
renderHeaders(record),
|
||||
LocationKafkaPayloadPreview.render(record.value(), maxLogBytes)
|
||||
);
|
||||
|
||||
try {
|
||||
List<BiPersonLocationCO> matchedLocations = locationMatcher.match(record.value());
|
||||
int deliveries = 0;
|
||||
for (BiPersonLocationCO location : matchedLocations) {
|
||||
String payload = serialize(location);
|
||||
for (RealtimeLocationPublisher publisher : publishers) {
|
||||
deliveries += publisher.publish(payload);
|
||||
}
|
||||
}
|
||||
acknowledgment.acknowledge();
|
||||
LOGGER.info("Kafka location message processed, topic={}, partition={}, offset={}, matched={}, "
|
||||
+ "websocketDeliveries={}",
|
||||
record.topic(), record.partition(), record.offset(), matchedLocations.size(), deliveries);
|
||||
} catch (RealtimeLocationPayloadException e) {
|
||||
acknowledgment.acknowledge();
|
||||
LOGGER.warn("Ignored invalid Kafka location message, topic={}, partition={}, offset={}, reason={}",
|
||||
record.topic(), record.partition(), record.offset(), e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private String serialize(BiPersonLocationCO location) {
|
||||
try {
|
||||
ObjectNode payload = objectMapper.valueToTree(location);
|
||||
List<String> nullFields = new ArrayList<>();
|
||||
Iterator<Map.Entry<String, JsonNode>> fields = payload.fields();
|
||||
while (fields.hasNext()) {
|
||||
Map.Entry<String, JsonNode> field = fields.next();
|
||||
if (field.getValue().isNull()) {
|
||||
nullFields.add(field.getKey());
|
||||
}
|
||||
}
|
||||
payload.remove(nullFields);
|
||||
return objectMapper.writeValueAsString(payload);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new IllegalStateException("Failed to serialize matched personnel location", e);
|
||||
}
|
||||
}
|
||||
|
||||
private int length(byte[] value) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
package com.zcloud.personnel.positioning.integration.realtime;
|
||||
|
||||
public interface RealtimeLocationPublisher {
|
||||
int publish(String payload);
|
||||
}
|
||||
|
|
@ -42,7 +42,7 @@ public class AreaServiceImpl implements AreaServiceI {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<OptionCO> listOptions(Long corpinfoId, String keyword) {
|
||||
public List<OptionCO> listOptions(String corpinfoId, String keyword) {
|
||||
return areaQueryExe.listOptions(corpinfoId, keyword);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ public class FenceServiceImpl implements FenceServiceI {
|
|||
}
|
||||
|
||||
@Override
|
||||
public FenceCompanyAreaCO queryCompanyArea(Long corpinfoId, String corpinfoName) {
|
||||
public FenceCompanyAreaCO queryCompanyArea(String corpinfoId, String corpinfoName) {
|
||||
return fenceCompanyAreaSaveExe.query(corpinfoId, corpinfoName);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ public class PersonnelPositioningBiServiceImpl implements PersonnelPositioningBi
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<BiCompanyLocationCO> listCompanyLocation() {
|
||||
return personnelPositioningBiQueryExe.listCompanyLocation();
|
||||
public List<BiCompanyLocationCO> listCompanyLocation(Integer portArea) {
|
||||
return personnelPositioningBiQueryExe.listCompanyLocation(portArea);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ public interface AreaServiceI {
|
|||
|
||||
List<AreaCO> listAll();
|
||||
|
||||
List<OptionCO> listOptions(Long corpinfoId, String keyword);
|
||||
List<OptionCO> listOptions(String corpinfoId, String keyword);
|
||||
|
||||
AreaCO queryById(Long id);
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public interface FenceServiceI {
|
|||
|
||||
FenceCO queryById(Long id);
|
||||
|
||||
FenceCompanyAreaCO queryCompanyArea(Long corpinfoId, String corpinfoName);
|
||||
FenceCompanyAreaCO queryCompanyArea(String corpinfoId, String corpinfoName);
|
||||
|
||||
SingleResponse<FenceCO> add(FenceAddCmd cmd);
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import java.util.List;
|
|||
public interface PersonnelPositioningBiServiceI {
|
||||
BiOverviewCO queryOverview();
|
||||
|
||||
List<BiCompanyLocationCO> listCompanyLocation();
|
||||
List<BiCompanyLocationCO> listCompanyLocation(Integer portArea);
|
||||
|
||||
PageResponse<BiAreaFenceCO> listCompanyFence(BiCompanyFenceQry qry);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public class AlarmDisposeRecordAddCmd extends Command {
|
|||
private Long alarmRecordId;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public class AlarmDisposeRecordPageQry extends PageQuery {
|
|||
private Long eqAlarmRecordId;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "eqCorpinfoId")
|
||||
private Long eqCorpinfoId;
|
||||
private String eqCorpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "likeCorpinfoName")
|
||||
private String likeCorpinfoName;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public class AlarmDisposeRecordUpdateCmd extends Command {
|
|||
private Long alarmRecordId;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public class AlarmRecordAddCmd extends Command {
|
|||
private LocalDateTime gt;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ public class AlarmRecordPageQry extends PageQuery {
|
|||
private LocalDateTime leGt;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "eqCorpinfoId")
|
||||
private Long eqCorpinfoId;
|
||||
private String eqCorpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "likeCorpinfoName")
|
||||
private String likeCorpinfoName;
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class AlarmRecordTargetAddCmd extends Command {
|
|||
private Long alarmRecordId;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public class AlarmRecordTargetPageQry extends PageQuery {
|
|||
private Long eqAlarmRecordId;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "eqCorpinfoId")
|
||||
private Long eqCorpinfoId;
|
||||
private String eqCorpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "likeCorpinfoName")
|
||||
private String likeCorpinfoName;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public class AlarmRecordTargetUpdateCmd extends Command {
|
|||
private Long alarmRecordId;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ public class AlarmRecordUpdateCmd extends Command {
|
|||
private LocalDateTime gt;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public class AlarmRuleAddCmd extends Command {
|
|||
private String ruleStatus;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import lombok.Data;
|
|||
@Data
|
||||
public class AlarmRuleCompanyPageQry extends PageQuery {
|
||||
@ApiModelProperty(value = "企业id/公司id", name = "eqCorpinfoId")
|
||||
private Long eqCorpinfoId;
|
||||
private String eqCorpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "公司名称", name = "likeCorpinfoName")
|
||||
private String likeCorpinfoName;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public class AlarmRuleFenceRelAddCmd extends Command {
|
|||
private String relType;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public class AlarmRuleFenceRelPageQry extends PageQuery {
|
|||
private String eqRelType;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "eqCorpinfoId")
|
||||
private Long eqCorpinfoId;
|
||||
private String eqCorpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "likeCorpinfoName")
|
||||
private String likeCorpinfoName;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public class AlarmRuleFenceRelUpdateCmd extends Command {
|
|||
private String relType;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public class AlarmRuleItemAddCmd extends Command {
|
|||
private Long ruleId;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public class AlarmRuleItemPageQry extends PageQuery {
|
|||
private Long eqRuleId;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "eqCorpinfoId")
|
||||
private Long eqCorpinfoId;
|
||||
private String eqCorpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "likeCorpinfoName")
|
||||
private String likeCorpinfoName;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public class AlarmRuleItemUpdateCmd extends Command {
|
|||
private Long ruleId;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class AlarmRulePageQry extends PageQuery {
|
|||
private String eqRuleStatus;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "eqCorpinfoId")
|
||||
private Long eqCorpinfoId;
|
||||
private String eqCorpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称(精确查询)", name = "eqCorpinfoName")
|
||||
private String eqCorpinfoName;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public class AlarmRuleUpdateCmd extends Command {
|
|||
private String ruleStatus;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class AreaAddCmd extends Command {
|
|||
private String orgName;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public class AreaPageQry extends PageQuery {
|
|||
private String likeOrgName;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "eqCorpinfoId")
|
||||
private Long eqCorpinfoId;
|
||||
private String eqCorpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "likeCorpinfoName")
|
||||
private String likeCorpinfoName;
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public class AreaUpdateCmd extends Command {
|
|||
private String orgName;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import lombok.Data;
|
|||
@Data
|
||||
public class BiCompanyFenceQry extends PageQuery {
|
||||
@ApiModelProperty(value = "公司ID", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "公司名称", name = "companyName")
|
||||
private String companyName;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import lombok.Data;
|
|||
@Data
|
||||
public class BiPersonLocationQry extends PageQuery {
|
||||
@ApiModelProperty(value = "本平台公司ID", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "公司名称", name = "companyName")
|
||||
private String companyName;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class FenceAddCmd extends Command {
|
|||
private String fenceBizName;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ public class FenceCompanyAreaSaveCmd extends Command {
|
|||
private Long fenceId;
|
||||
|
||||
@ApiModelProperty(value = "公司ID", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import lombok.Data;
|
|||
@Data
|
||||
public class FenceCompanyPageQry extends PageQuery {
|
||||
@ApiModelProperty(value = "公司ID", name = "eqCorpinfoId")
|
||||
private Long eqCorpinfoId;
|
||||
private String eqCorpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "公司名称", name = "likeCorpinfoName")
|
||||
private String likeCorpinfoName;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class FencePageQry extends PageQuery {
|
|||
private String likeFenceBizName;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "eqCorpinfoId")
|
||||
private Long eqCorpinfoId;
|
||||
private String eqCorpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称(精确查询)", name = "eqCorpinfoName")
|
||||
private String eqCorpinfoName;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public class FencePointAddCmd extends Command {
|
|||
private BigDecimal alt;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public class FencePointPageQry extends PageQuery {
|
|||
private BigDecimal eqAlt;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "eqCorpinfoId")
|
||||
private Long eqCorpinfoId;
|
||||
private String eqCorpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "likeCorpinfoName")
|
||||
private String likeCorpinfoName;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class FencePointUpdateCmd extends Command {
|
|||
private BigDecimal alt;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import lombok.EqualsAndHashCode;
|
|||
@Data
|
||||
public class FenceSyncCmd extends Command {
|
||||
@ApiModelProperty(value = "FindS组织无法匹配时使用的默认公司ID", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "FindS组织无法匹配时使用的默认公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public class FenceUpdateCmd extends Command {
|
|||
private String fenceBizName;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class OpenapiConfigAddCmd extends Command {
|
|||
private LocalDateTime lastCheckTime;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public class OpenapiConfigPageQry extends PageQuery {
|
|||
private LocalDateTime leLastCheckTime;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "eqCorpinfoId")
|
||||
private Long eqCorpinfoId;
|
||||
private String eqCorpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "likeCorpinfoName")
|
||||
private String likeCorpinfoName;
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public class OpenapiConfigUpdateCmd extends Command {
|
|||
private LocalDateTime lastCheckTime;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ public class PositionPersonPageQry extends PageQuery {
|
|||
private String staffName;
|
||||
|
||||
@ApiModelProperty(value = "本平台公司ID", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "本平台公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ public class PositionVehiclePageQry extends PageQuery {
|
|||
private String plateNo;
|
||||
|
||||
@ApiModelProperty(value = "本平台公司ID", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "本平台公司名称,模糊查询", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class SyncLogAddCmd extends Command {
|
|||
private String bizId;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class SyncLogPageQry extends PageQuery {
|
|||
private String eqBizId;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "eqCorpinfoId")
|
||||
private Long eqCorpinfoId;
|
||||
private String eqCorpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "likeCorpinfoName")
|
||||
private String likeCorpinfoName;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public class SyncLogUpdateCmd extends Command {
|
|||
private String bizId;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public class SyncTaskAddCmd extends Command {
|
|||
private String bizType;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public class SyncTaskPageQry extends PageQuery {
|
|||
private String eqBizType;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "eqCorpinfoId")
|
||||
private Long eqCorpinfoId;
|
||||
private String eqCorpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "likeCorpinfoName")
|
||||
private String likeCorpinfoName;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class SyncTaskUpdateCmd extends Command {
|
|||
private String bizType;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class TerminalAddCmd extends Command {
|
|||
private String checkCode;
|
||||
|
||||
@ApiModelProperty(value = "企业id/公司id(公司及子公司数据隔离)", name = "corpinfoId")
|
||||
private Long corpinfoId;
|
||||
private String corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称/公司名称", name = "corpinfoName")
|
||||
private String corpinfoName;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue