Merge branch 'dev_20260429' into dev_WMS20260401
# Conflicts: # mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/OmsServiceFeign.java # mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/UserServiceFeign.java # mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteOmsFeignFallbackFactory.java # mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteUserFeignFallbackFactory.java # mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/batchDetail/BatchDetailApplicationService.java # mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/batchDetail/service/BatchDetailDomainService.java # mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/sysTableConfig/SysTableConfigApi.java
This commit is contained in:
+12
@@ -1,5 +1,6 @@
|
||||
package com.mhd.common.core.domain.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
@@ -233,4 +234,15 @@ public class BusinessDocumentDTO extends BaseVOEntity{
|
||||
private String paymentAccountId;
|
||||
@ApiModelProperty("收款帐户名称")
|
||||
private String paymentAccountName;
|
||||
|
||||
@ApiModelProperty("计费单位")
|
||||
private String billingUnit;
|
||||
@ApiModelProperty("计费单位2")
|
||||
private String billingUnit2;
|
||||
@ApiModelProperty("预计费金额")
|
||||
private BigDecimal billingNum;
|
||||
@ApiModelProperty("预计费金额")
|
||||
private BigDecimal billingUnitPrice;
|
||||
@ApiModelProperty("nc科目编码")
|
||||
private String ncSubjectCode;
|
||||
}
|
||||
+2
@@ -27,6 +27,8 @@ public class TmsShipperDTO implements Serializable {
|
||||
/**货主类型(0-个人货主,1-企业货主))*/
|
||||
@ApiModelProperty(value = "货主类型(0-个人货主,1-企业货主))")
|
||||
private Integer shipperType;
|
||||
@ApiModelProperty(name = "货主账号")
|
||||
private String userAccount;
|
||||
@ApiModelProperty(name = "最高组织id")
|
||||
private Long topOrganizationId;
|
||||
@ApiModelProperty(name = "归属组织id")
|
||||
|
||||
+5
@@ -1,6 +1,7 @@
|
||||
package com.mhd.common.core.domain.po;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.annotation.fieldsetvalue.NeedSetValue;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@@ -12,6 +13,7 @@ import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class UserShipperPo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -266,6 +268,9 @@ public class UserShipperPo {
|
||||
|
||||
@ApiModelProperty("结算币种")
|
||||
private String settlementCurrency;
|
||||
|
||||
@ApiModelProperty("货主code")
|
||||
private String roleCodeShipper;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -65,27 +65,67 @@ public class IpUtil {
|
||||
public static IpLocation getLocation(String ip) {
|
||||
IpLocation location = new IpLocation();
|
||||
location.setIp(ip);
|
||||
try (InputStream inputStream = IpUtils.class.getResourceAsStream("/ip2region.xdb");) {
|
||||
if (StrUtil.isBlank(ip) || "unknown".equalsIgnoreCase(ip.trim()))
|
||||
{
|
||||
return location;
|
||||
}
|
||||
String ipv4 = ip.trim();
|
||||
if (ipv4.contains(","))
|
||||
{
|
||||
ipv4 = ipv4.substring(0, ipv4.indexOf(',')).trim();
|
||||
}
|
||||
// ip2region xdb 对 IPv6 / 非法串可能抛 ArrayIndexOutOfBoundsException,仅对 IPv4 做库查询
|
||||
if (!isLikelyIpv4(ipv4))
|
||||
{
|
||||
return location;
|
||||
}
|
||||
try (InputStream inputStream = IpUtils.class.getResourceAsStream("/ip2region.xdb"))
|
||||
{
|
||||
if (inputStream == null)
|
||||
{
|
||||
log.warn("ip2region.xdb 未找到,跳过 IP 归属解析");
|
||||
return location;
|
||||
}
|
||||
byte[] bytes = IoUtil.readBytes(inputStream);
|
||||
Searcher searcher = Searcher.newWithBuffer(bytes);
|
||||
String region = searcher.search(ip);
|
||||
if (StrUtil.isAllNotBlank(region)) {
|
||||
// xdb返回格式 国家|区域|省份|城市|ISP,
|
||||
// 只有中国的数据绝大部分精确到了城市,其他国家部分数据只能定位到国家,后前的选项全部是0
|
||||
String[] result = region.split("\\|");
|
||||
location.setCountry(ZERO.equals(result[0]) ? StrUtil.EMPTY : result[0]);
|
||||
location.setProvince(ZERO.equals(result[2]) ? StrUtil.EMPTY : result[2]);
|
||||
location.setCity(ZERO.equals(result[3]) ? StrUtil.EMPTY : result[3]);
|
||||
location.setIsp(ZERO.equals(result[4]) ? StrUtil.EMPTY : result[4]);
|
||||
try
|
||||
{
|
||||
String region = searcher.search(ipv4);
|
||||
if (StrUtil.isNotBlank(region))
|
||||
{
|
||||
// xdb返回格式 国家|区域|省份|城市|ISP,
|
||||
String[] result = region.split("\\|");
|
||||
if (result.length >= 5)
|
||||
{
|
||||
location.setCountry(ZERO.equals(result[0]) ? StrUtil.EMPTY : result[0]);
|
||||
location.setProvince(ZERO.equals(result[2]) ? StrUtil.EMPTY : result[2]);
|
||||
location.setCity(ZERO.equals(result[3]) ? StrUtil.EMPTY : result[3]);
|
||||
location.setIsp(ZERO.equals(result[4]) ? StrUtil.EMPTY : result[4]);
|
||||
}
|
||||
}
|
||||
}
|
||||
searcher.close();
|
||||
} catch (Exception e) {
|
||||
log.error("ip地址解析异常,error:", e);
|
||||
finally
|
||||
{
|
||||
searcher.close();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.warn("ip地址解析失败,ip={}, msg={}", ipv4, e.getMessage());
|
||||
return location;
|
||||
}
|
||||
return location;
|
||||
}
|
||||
|
||||
private static boolean isLikelyIpv4(String ip)
|
||||
{
|
||||
if (ip == null || ip.contains(":"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return ip.chars().filter(ch -> ch == '.').count() == 3L;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据iP获取归属地信息 - 拼接
|
||||
*
|
||||
@@ -93,7 +133,7 @@ public class IpUtil {
|
||||
*/
|
||||
public static String getLocationSplicing(String ip) {
|
||||
IpLocation location = getLocation(ip);
|
||||
return location.getProvince()+location.getCity();
|
||||
return StrUtil.nullToEmpty(location.getProvince()) + StrUtil.nullToEmpty(location.getCity());
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -80,7 +80,15 @@ public class LogAspect
|
||||
// 请求的地址
|
||||
String ip = IpUtils.getIpAddr(ServletUtils.getRequest());
|
||||
operLog.setOperIp(ip);
|
||||
operLog.setOperLocation(StrUtil.isNotEmpty(operLog.getOperIp()) ? IpUtil.getLocationSplicing(operLog.getOperIp()) : "");
|
||||
try
|
||||
{
|
||||
operLog.setOperLocation(StrUtil.isNotEmpty(operLog.getOperIp()) ? IpUtil.getLocationSplicing(operLog.getOperIp()) : "");
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
log.warn("操作日志 IP 归属解析跳过: {}", t.getMessage());
|
||||
operLog.setOperLocation("");
|
||||
}
|
||||
operLog.setOperUrl(ServletUtils.getRequest().getRequestURI());
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null){
|
||||
|
||||
+9
@@ -72,4 +72,13 @@ public class DictUtils
|
||||
{
|
||||
return Constants.SYS_DICT_KEY + configKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典缓存键:同一 dict_type 在不同组织下可并存,需带上组织维度(null 视为 0 平台)
|
||||
*/
|
||||
public static String dictTypeOrgCacheKey(String dictType, Long organizationId)
|
||||
{
|
||||
long oid = organizationId == null ? 0L : organizationId.longValue();
|
||||
return dictType + "@" + oid;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user