提交 89441ae6 authored 作者: huyufan's avatar huyufan

开发:bug优化

上级 ea010983
......@@ -19,8 +19,8 @@ public enum BreakContractOwnerRecordEnum {
private final Integer code;
private final String msg;
public static Optional<PayStatus> getByCode(int code) {
return Arrays.stream(values()).filter(e -> e.code == code).findFirst();
public static Optional<PayStatus> getByCode(Integer code) {
return Arrays.stream(values()).filter(e -> e.code.equals(code)).findFirst();
}
public static String getMsgByCode(int code) {
......@@ -38,8 +38,8 @@ public enum BreakContractOwnerRecordEnum {
private final Integer code;
private final String msg;
public static Optional<CompensationStatusStatus> getByCode(int code) {
return Arrays.stream(values()).filter(e -> e.code == code).findFirst();
public static Optional<CompensationStatusStatus> getByCode(Integer code) {
return Arrays.stream(values()).filter(e -> e.code.equals(code)).findFirst();
}
public static String getMsgByCode(int code) {
......@@ -58,8 +58,8 @@ public enum BreakContractOwnerRecordEnum {
private final Integer code;
private final String msg;
public static Optional<ConfirmStatus> getByCode(int code) {
return Arrays.stream(values()).filter(e -> e.code == code).findFirst();
public static Optional<ConfirmStatus> getByCode(Integer code) {
return Arrays.stream(values()).filter(e -> e.code.equals(code)).findFirst();
}
public static String getMsgByCode(int code) {
......
......@@ -19,8 +19,8 @@ public enum BreakContractRecordEnum {
private final Integer code;
private final String msg;
public static Optional<TriggerType> getByCode(int code) {
return Arrays.stream(values()).filter(e -> e.code == code).findFirst();
public static Optional<TriggerType> getByCode(Integer code) {
return Arrays.stream(values()).filter(e -> e.code.equals(code)).findFirst();
}
}
@Getter
......@@ -34,8 +34,8 @@ public enum BreakContractRecordEnum {
private final Integer code;
private final String msg;
public static Optional<BreakContractPartyType> getByCode(int code) {
return Arrays.stream(values()).filter(e -> e.code == code).findFirst();
public static Optional<BreakContractPartyType> getByCode(Integer code) {
return Arrays.stream(values()).filter(e -> e.code.equals(code)).findFirst();
}
}
......
......@@ -20,8 +20,8 @@ public enum BreakContractSettlementDriverEnum {
private final Integer code;
private final String msg;
public static Optional<BreakContractPartyType> getByCode(int code) {
return Arrays.stream(values()).filter(e -> e.code == code).findFirst();
public static Optional<BreakContractPartyType> getByCode(Integer code) {
return Arrays.stream(values()).filter(e -> e.code.equals(code)).findFirst();
}
public static String getMsgByCode(int code) {
......@@ -39,8 +39,8 @@ public enum BreakContractSettlementDriverEnum {
private final Integer code;
private final String msg;
public static Optional<SettleStatus> getByCode(int code) {
return Arrays.stream(values()).filter(e -> e.code == code).findFirst();
public static Optional<SettleStatus> getByCode(Integer code) {
return Arrays.stream(values()).filter(e -> e.code.equals(code)).findFirst();
}
public static String getMsgByCode(int code) {
......@@ -57,8 +57,8 @@ public enum BreakContractSettlementDriverEnum {
private final Integer code;
private final String msg;
public static Optional<SettlePlatform> getByCode(int code) {
return Arrays.stream(values()).filter(e -> e.code == code).findFirst();
public static Optional<SettlePlatform> getByCode(Integer code) {
return Arrays.stream(values()).filter(e -> e.code.equals(code)).findFirst();
}
public static String getMsgByCode(int code) {
......
......@@ -21,8 +21,8 @@ public enum OrderGoodsPendingVehicleUsageEnum {
private final Integer code;
private final String name;
public static Optional<Status> getByCode(String c) {
return Arrays.stream(values()).filter(e -> e.code.equals(c)).findFirst();
public static Optional<Status> getByCode(Integer code) {
return Arrays.stream(values()).filter(e -> e.code.equals(code)).findFirst();
}
}
......
......@@ -27,7 +27,7 @@ public enum OrderGoodsStatusEnum {
private final String name;
public static Optional<Status> getByCode(Integer code) {
return Arrays.stream(values()).filter(e -> e.code == code).findFirst();
return Arrays.stream(values()).filter(e -> e.code.equals(code)).findFirst();
}
}
......
......@@ -22,7 +22,7 @@ public enum OrderGoodsStopEnum {
private final String name;
public static Optional<Status> getByCode(Integer code) {
return Arrays.stream(values()).filter(e -> e.code == code).findFirst();
return Arrays.stream(values()).filter(e -> e.code.equals(code)).findFirst();
}
}
......
......@@ -22,7 +22,7 @@ public enum PendingOrderWayStatusEnum {
private final String name;
public static Optional<Status> getByCode(Integer code) {
return Arrays.stream(values()).filter(e -> e.code == code).findFirst();
return Arrays.stream(values()).filter(e -> e.code.equals(code)).findFirst();
}
}
......
......@@ -108,10 +108,13 @@ public class SendMessageMachineCheckComponent {
InetAddress inet = null;
try {
inet = InetAddress.getLocalHost();
if (inet != null) {
ip = inet.getHostAddress();
}
} catch (Exception e) {
e.printStackTrace();
}
ip = inet.getHostAddress();
}
}
// 多个代理的情况,第一个IP为客户端真实IP,多个IP按照','分割
......
......@@ -46,7 +46,7 @@ public class NetworkDriverAccountSyncJob {
param.setMobile(vo.getMobile());
try {
Thread.sleep(2000L);
} catch (InterruptedException e) {
} catch (Exception e) {
throw new RuntimeException(e);
}
networkDriverAccountService.createNetworkDriverAccount(param);
......
......@@ -21,6 +21,7 @@ import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
......@@ -85,14 +86,13 @@ public abstract class GoodsOrderStrategy {
LocalDateTime sendLazyTime = goodsOrderProcess(orderGoodsParams, orderInfo, now);
Message message = MessageBuilder.withBody(orderNo.getBytes()).build();
long epochMilli = 0L;
BigDecimal epochMilli = null;
if (sendLazyTime.isAfter(now)) {
epochMilli = sendLazyTime.minusMinutes(now.getMinute()).getMinute() * 60 * 1000;
epochMilli = new BigDecimal(sendLazyTime.minusMinutes(now.getMinute()).getMinute() * 60 * 1000);
log.info("执行订单状态更改,选择时间在当前时间之后,则设置延迟队列时间,时间为:{}", epochMilli);
}
if (epochMilli == 0L) {
if (epochMilli == null) {
log.info("执行订单状态更改,epochMilli时间为0,时间为:{}", epochMilli);
rabbitTemplate.send(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论