localizer
parent
4f13fb3365
commit
086ec04309
|
|
@ -0,0 +1,28 @@
|
||||||
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.njzscloud</groupId>
|
||||||
|
<artifactId>njzscloud-common</artifactId>
|
||||||
|
<version>0.0.1</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>njzscloud-common-sshtunnel</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<name>njzscloud-common-sshtunnel</name>
|
||||||
|
<url>http://maven.apache.org</url>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
<version>3.8.1</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.njzscloud.common.ws.support;
|
package com.njzscloud.common.ws.support;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.njzscloud.common.core.tuple.Tuple2;
|
import com.njzscloud.common.core.tuple.Tuple2;
|
||||||
import com.njzscloud.common.security.support.Token;
|
import com.njzscloud.common.security.support.Token;
|
||||||
|
|
@ -40,7 +41,7 @@ public class TokenHandshakeInterceptor implements HandshakeInterceptor {
|
||||||
if (resolved == null) return false;
|
if (resolved == null) return false;
|
||||||
Long uid = resolved.get_0();
|
Long uid = resolved.get_0();
|
||||||
String cid = resolved.get_1();
|
String cid = resolved.get_1();
|
||||||
attributes.put(Constants.SESSION_ATTRIBUTE_TOKEN, authorization);
|
attributes.put(Constants.SESSION_ATTRIBUTE_TOKEN, StrUtil.isBlank(authorization) ? cid : authorization);
|
||||||
attributes.put(Constants.SESSION_ATTRIBUTE_CID, cid);
|
attributes.put(Constants.SESSION_ATTRIBUTE_CID, cid);
|
||||||
attributes.put(Constants.SESSION_ATTRIBUTE_UID, uid);
|
attributes.put(Constants.SESSION_ATTRIBUTE_UID, uid);
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -65,6 +66,7 @@ public class TokenHandshakeInterceptor implements HandshakeInterceptor {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Tuple2<Long, String> resolve(String tokenStr) {
|
private Tuple2<Long, String> resolve(String tokenStr) {
|
||||||
|
if (StrUtil.isBlank(tokenStr)) return Tuple2.create(0L, IdUtil.fastSimpleUUID());
|
||||||
UserDetail userDetail = SecurityUtil.parseToken(tokenStr);
|
UserDetail userDetail = SecurityUtil.parseToken(tokenStr);
|
||||||
if (userDetail == null) return null;
|
if (userDetail == null) return null;
|
||||||
Token token = userDetail.getToken();
|
Token token = userDetail.getToken();
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@
|
||||||
<module>njzscloud-common-wechat</module>
|
<module>njzscloud-common-wechat</module>
|
||||||
<module>njzscloud-common-localizer</module>
|
<module>njzscloud-common-localizer</module>
|
||||||
<module>njzscloud-common-ws</module>
|
<module>njzscloud-common-ws</module>
|
||||||
|
<module>njzscloud-common-sshtunnel</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,8 @@ public class BizCompanyService extends ServiceImpl<BizCompanyMapper, BizCompanyE
|
||||||
.setProvince(defaultPlace.getProvince())
|
.setProvince(defaultPlace.getProvince())
|
||||||
.setCity(defaultPlace.getCity())
|
.setCity(defaultPlace.getCity())
|
||||||
.setProvinceName(defaultPlace.getProvinceName())
|
.setProvinceName(defaultPlace.getProvinceName())
|
||||||
|
.setAuditStatus(oldData.getAuditStatus() == AuditStatus.TongGuo ? AuditStatus.TongGuo : AuditStatus.DaiShenHe)
|
||||||
|
.setAuditMemo("")
|
||||||
.setCityName(defaultPlace.getCityName());
|
.setCityName(defaultPlace.getCityName());
|
||||||
this.updateById(bizCompanyEntity);
|
this.updateById(bizCompanyEntity);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -575,8 +575,8 @@ public class TruckLocationTrackService extends ServiceImpl<TruckLocationTrackMap
|
||||||
|
|
||||||
List<TruckLocationTrackEntity> records = resultPage.getRecords();
|
List<TruckLocationTrackEntity> records = resultPage.getRecords();
|
||||||
if (records.isEmpty()) {
|
if (records.isEmpty()) {
|
||||||
if (errCount >= 20) {
|
if (errCount >= 200) {
|
||||||
log.error("查询历史轨迹异常, 订单ID: {}, 时间: {}", orderId, startTime);
|
log.error("暂无实时数据, 订单ID: {}, 时间: {}", orderId, startTime);
|
||||||
Websocket.publish(new WsMsg()
|
Websocket.publish(new WsMsg()
|
||||||
.setEvent("down/truck_location_track/realtime")
|
.setEvent("down/truck_location_track/realtime")
|
||||||
.setData(R.failed(ExceptionMsg.SYS_ERR_MSG, "暂无实时数据"))
|
.setData(R.failed(ExceptionMsg.SYS_ERR_MSG, "暂无实时数据"))
|
||||||
|
|
|
||||||
|
|
@ -189,6 +189,12 @@ public class OrderInfoController {
|
||||||
return R.success();
|
return R.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/gps_test")
|
||||||
|
public R<?> gpsTest(@RequestParam("sn") String sn, @RequestParam(value = "count", required = false, defaultValue = "1000") int count) {
|
||||||
|
orderInfoService.gpsTest(sn, count);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 取消订单
|
* 取消订单
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ public class OrderPagingResult {
|
||||||
private String sn;
|
private String sn;
|
||||||
private String projectName;
|
private String projectName;
|
||||||
private LocalDateTime checkTime;
|
private LocalDateTime checkTime;
|
||||||
|
private LocalDateTime transTime;
|
||||||
private LocalDateTime assignmentTransTime;
|
private LocalDateTime assignmentTransTime;
|
||||||
private LocalDateTime assignmentDriverTime;
|
private LocalDateTime assignmentDriverTime;
|
||||||
private LocalDateTime driverConfirmTime;
|
private LocalDateTime driverConfirmTime;
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.img.ImgUtil;
|
import cn.hutool.core.img.ImgUtil;
|
||||||
import cn.hutool.core.lang.Assert;
|
import cn.hutool.core.lang.Assert;
|
||||||
import cn.hutool.core.map.MapUtil;
|
import cn.hutool.core.map.MapUtil;
|
||||||
|
import cn.hutool.core.thread.ThreadUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.extra.qrcode.QrCodeUtil;
|
import cn.hutool.extra.qrcode.QrCodeUtil;
|
||||||
import cn.hutool.extra.qrcode.QrConfig;
|
import cn.hutool.extra.qrcode.QrConfig;
|
||||||
|
|
@ -68,6 +69,7 @@ import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static com.njzscloud.supervisory.constant.Constant.CERTIFICATE_SN_CODE;
|
import static com.njzscloud.supervisory.constant.Constant.CERTIFICATE_SN_CODE;
|
||||||
|
|
@ -93,7 +95,8 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
private final CloudVoiceboxService cloudVoiceboxService;
|
private final CloudVoiceboxService cloudVoiceboxService;
|
||||||
private final MoneyAccountService moneyAccountService;
|
private final MoneyAccountService moneyAccountService;
|
||||||
private final MoneyChangeDetailService moneyChangeDetailService;
|
private final MoneyChangeDetailService moneyChangeDetailService;
|
||||||
|
private final AtomicBoolean test_thread_running = new AtomicBoolean(false);
|
||||||
|
Thread test_thread = null;
|
||||||
@Value("${app.check-gps:false}")
|
@Value("${app.check-gps:false}")
|
||||||
private boolean checkGps;
|
private boolean checkGps;
|
||||||
|
|
||||||
|
|
@ -239,9 +242,8 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
Set<String> roles = userDetail.getRoles();
|
Set<String> roles = userDetail.getRoles();
|
||||||
if (SecurityUtil.isAdmin() || roles.contains(Constant.ROLE_STATION_MANAGE)) {
|
if (SecurityUtil.isAdmin() || roles.contains(Constant.ROLE_STATION_MANAGE)) {
|
||||||
Long stationId = orderPagingSearchParam.getStationId();
|
Long stationId = orderPagingSearchParam.getStationId();
|
||||||
Assert.notNull(stationId, () -> Exceptions.clierr("请选择站点"));
|
|
||||||
ew
|
ew
|
||||||
.eq("a.station_id", stationId)
|
.eq(stationId != null && stationId > 0, "a.station_id", stationId)
|
||||||
.eq("a.order_status", OrderStatus.YiYuYue)
|
.eq("a.order_status", OrderStatus.YiYuYue)
|
||||||
.isNull("a.trans_company_id ")
|
.isNull("a.trans_company_id ")
|
||||||
;
|
;
|
||||||
|
|
@ -266,9 +268,8 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
Set<String> roles = userDetail.getRoles();
|
Set<String> roles = userDetail.getRoles();
|
||||||
if (SecurityUtil.isAdmin() || roles.contains(Constant.ROLE_STATION_MANAGE)) {
|
if (SecurityUtil.isAdmin() || roles.contains(Constant.ROLE_STATION_MANAGE)) {
|
||||||
Long stationId = orderPagingSearchParam.getStationId();
|
Long stationId = orderPagingSearchParam.getStationId();
|
||||||
Assert.notNull(stationId, () -> Exceptions.clierr("请选择站点"));
|
|
||||||
ew
|
ew
|
||||||
.eq("a.station_id", stationId)
|
.eq(stationId != null && stationId > 0, "a.station_id", stationId)
|
||||||
.in("a.order_status", OrderStatus.DaiPaiDan, OrderStatus.DaiJieDan, OrderStatus.YiJieDan)
|
.in("a.order_status", OrderStatus.DaiPaiDan, OrderStatus.DaiJieDan, OrderStatus.YiJieDan)
|
||||||
;
|
;
|
||||||
return;
|
return;
|
||||||
|
|
@ -306,9 +307,8 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
Set<String> roles = userDetail.getRoles();
|
Set<String> roles = userDetail.getRoles();
|
||||||
if (SecurityUtil.isAdmin() || roles.contains(Constant.ROLE_STATION_MANAGE)) {
|
if (SecurityUtil.isAdmin() || roles.contains(Constant.ROLE_STATION_MANAGE)) {
|
||||||
Long stationId = orderPagingSearchParam.getStationId();
|
Long stationId = orderPagingSearchParam.getStationId();
|
||||||
Assert.notNull(stationId, () -> Exceptions.clierr("请选择站点"));
|
|
||||||
ew
|
ew
|
||||||
.eq("a.station_id", stationId)
|
.eq(stationId != null && stationId > 0, "a.station_id", stationId)
|
||||||
.in("a.order_status", OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang)
|
.in("a.order_status", OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang)
|
||||||
;
|
;
|
||||||
return;
|
return;
|
||||||
|
|
@ -349,9 +349,8 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
Set<String> roles = userDetail.getRoles();
|
Set<String> roles = userDetail.getRoles();
|
||||||
if (SecurityUtil.isAdmin() || roles.contains(Constant.ROLE_STATION_MANAGE)) {
|
if (SecurityUtil.isAdmin() || roles.contains(Constant.ROLE_STATION_MANAGE)) {
|
||||||
Long stationId = orderPagingSearchParam.getStationId();
|
Long stationId = orderPagingSearchParam.getStationId();
|
||||||
Assert.notNull(stationId, () -> Exceptions.clierr("请选择站点"));
|
|
||||||
ew
|
ew
|
||||||
.eq("a.station_id", stationId)
|
.eq(stationId != null && stationId > 0, "a.station_id", stationId)
|
||||||
.eq("a.order_status", OrderStatus.YiWanCheng)
|
.eq("a.order_status", OrderStatus.YiWanCheng)
|
||||||
;
|
;
|
||||||
return;
|
return;
|
||||||
|
|
@ -374,9 +373,8 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
Set<String> roles = userDetail.getRoles();
|
Set<String> roles = userDetail.getRoles();
|
||||||
if (SecurityUtil.isAdmin() || roles.contains(Constant.ROLE_STATION_MANAGE)) {
|
if (SecurityUtil.isAdmin() || roles.contains(Constant.ROLE_STATION_MANAGE)) {
|
||||||
Long stationId = orderPagingSearchParam.getStationId();
|
Long stationId = orderPagingSearchParam.getStationId();
|
||||||
Assert.notNull(stationId, () -> Exceptions.clierr("请选择站点"));
|
|
||||||
ew
|
ew
|
||||||
.eq("a.station_id", stationId)
|
.eq(stationId != null && stationId > 0, "a.station_id", stationId)
|
||||||
.eq("a.order_status", OrderStatus.YiQuXiao)
|
.eq("a.order_status", OrderStatus.YiQuXiao)
|
||||||
;
|
;
|
||||||
return;
|
return;
|
||||||
|
|
@ -388,9 +386,8 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
Set<String> roles = userDetail.getRoles();
|
Set<String> roles = userDetail.getRoles();
|
||||||
if (SecurityUtil.isAdmin() || roles.contains(Constant.ROLE_STATION_MANAGE)) {
|
if (SecurityUtil.isAdmin() || roles.contains(Constant.ROLE_STATION_MANAGE)) {
|
||||||
Long stationId = orderPagingSearchParam.getStationId();
|
Long stationId = orderPagingSearchParam.getStationId();
|
||||||
Assert.notNull(stationId, () -> Exceptions.clierr("请选择站点"));
|
|
||||||
ew
|
ew
|
||||||
.eq("a.station_id", stationId)
|
.eq(stationId != null && stationId > 0, "a.station_id", stationId)
|
||||||
.ne("a.auto_order", 3)
|
.ne("a.auto_order", 3)
|
||||||
;
|
;
|
||||||
return;
|
return;
|
||||||
|
|
@ -660,7 +657,8 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean assignmentTrafficCompany(AssignmentOrderParam assignmentOrderParam, OrderInfoEntity orderInfo) {
|
private boolean assignmentTrafficCompany(AssignmentOrderParam assignmentOrderParam,
|
||||||
|
OrderInfoEntity orderInfo) {
|
||||||
Long transCompanyId = assignmentOrderParam.getTransCompanyId();
|
Long transCompanyId = assignmentOrderParam.getTransCompanyId();
|
||||||
if (transCompanyId == null) return false;
|
if (transCompanyId == null) return false;
|
||||||
Assert.isNull(orderInfo.getTransCompanyId(), () -> Exceptions.clierr("当前订单已分配清运公司,无需重复分配"));
|
Assert.isNull(orderInfo.getTransCompanyId(), () -> Exceptions.clierr("当前订单已分配清运公司,无需重复分配"));
|
||||||
|
|
@ -728,7 +726,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
settleForTransCompany(orderInfo, entity, 0);
|
settleForTransCompany(orderInfo, entity, 0);
|
||||||
|
|
||||||
// 处理公司支付
|
// 处理公司支付
|
||||||
handleCompanyPay(orderInfo, Boolean.TRUE);
|
handleCompanyPay(orderInfo, Boolean.TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.updateById(new OrderInfoEntity()
|
this.updateById(new OrderInfoEntity()
|
||||||
|
|
@ -857,7 +855,6 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void startTrackOrder(Long orderId) {
|
public void startTrackOrder(Long orderId) {
|
||||||
OrderInfoEntity orderInfo = this.getById(orderId);
|
OrderInfoEntity orderInfo = this.getById(orderId);
|
||||||
Long truckId = orderInfo.getTruckId();
|
Long truckId = orderInfo.getTruckId();
|
||||||
|
|
@ -1379,4 +1376,49 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void gpsTest(String sn, int count) {
|
||||||
|
if (count <= 0) {
|
||||||
|
if (test_thread != null) {
|
||||||
|
test_thread_running.set(false);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Assert.isTrue(count <= 1000, () -> Exceptions.clierr("数量必须大于0且小于等于1000"));
|
||||||
|
OrderInfoEntity orderInfo = this.getOne(Wrappers.lambdaQuery(OrderInfoEntity.class).eq(OrderInfoEntity::getSn, sn));
|
||||||
|
Assert.notNull(orderInfo, () -> Exceptions.clierr("订单不存在"));
|
||||||
|
Page<TruckLocationTrackEntity> page = truckLocationTrackService.page(new Page<>(1, count), Wrappers.lambdaQuery(TruckLocationTrackEntity.class)
|
||||||
|
.eq(TruckLocationTrackEntity::getOrderId, 1982687926996865026L)
|
||||||
|
.orderByAsc(TruckLocationTrackEntity::getLocationTime)
|
||||||
|
);
|
||||||
|
List<TruckLocationTrackEntity> records = page.getRecords();
|
||||||
|
if (CollUtil.isEmpty(records)) {
|
||||||
|
Assert.notNull(orderInfo, () -> Exceptions.clierr("无数据"));
|
||||||
|
}
|
||||||
|
|
||||||
|
test_thread = new Thread(() -> {
|
||||||
|
for (TruckLocationTrackEntity record : records) {
|
||||||
|
if (!test_thread_running.get()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
truckLocationTrackService.save(new TruckLocationTrackEntity()
|
||||||
|
.setOrderId(orderInfo.getId())
|
||||||
|
.setTruckId(record.getTruckId())
|
||||||
|
.setTerminalId(record.getTerminalId())
|
||||||
|
.setLatitude(record.getLatitude())
|
||||||
|
.setLongitude(record.getLongitude())
|
||||||
|
.setAltitude(record.getAltitude())
|
||||||
|
.setSpeed(record.getSpeed())
|
||||||
|
.setLocationTime(LocalDateTime.now())
|
||||||
|
.setDirection(record.getDirection())
|
||||||
|
.setOverspeed(record.getOverspeed())
|
||||||
|
.setCompensate(record.getCompensate()));
|
||||||
|
ThreadUtil.sleep(1000);
|
||||||
|
}
|
||||||
|
log.info("{} 数据导入完成", orderInfo.getSn());
|
||||||
|
});
|
||||||
|
test_thread_running.set(true);
|
||||||
|
test_thread.start();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@
|
||||||
a.deleted,
|
a.deleted,
|
||||||
a.cargo_place_id,
|
a.cargo_place_id,
|
||||||
a.car_in_out_id,
|
a.car_in_out_id,
|
||||||
|
a.trans_time,
|
||||||
a.site_photos,
|
a.site_photos,
|
||||||
b.province,
|
b.province,
|
||||||
b.city,
|
b.city,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue