Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
custom-server
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lizhonghong
custom-server
Commits
bae1ccc6
Commit
bae1ccc6
authored
Jul 15, 2026
by
Lizh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改远程调用问题
parent
ba2bae90
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
316 additions
and
59 deletions
+316
-59
custom-server-app/src/main/java/com/jomalls/custom/app/service/system/impl/CountryCodeServiceImpl.java
+13
-9
custom-server-app/src/main/java/com/jomalls/custom/app/service/system/impl/SysLogininforServiceImpl.java
+2
-3
custom-server-app/src/main/java/com/jomalls/custom/app/service/warehouse/CustomWarehouseInfoService.java
+2
-1
custom-server-app/src/main/java/com/jomalls/custom/app/service/warehouse/impl/CustomWarehouseInfoServiceImpl.java
+5
-4
custom-server-app/src/main/java/com/jomalls/custom/app/vo/warehouse/CustomWarehouseInfoVO.java
+239
-0
custom-server-integrate/src/main/java/com/jomalls/custom/integrate/model/CountryCodeModel.java
+26
-8
custom-server-integrate/src/main/java/com/jomalls/custom/integrate/service/SaasAdminService.java
+2
-2
custom-server-integrate/src/main/java/com/jomalls/custom/integrate/service/impl/SaasAdminServiceImpl.java
+13
-16
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/system/CountryCodeController.java
+5
-6
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/warehouse/CustomWarehouseInfoController.java
+9
-10
No files found.
custom-server-app/src/main/java/com/jomalls/custom/app/service/system/impl/CountryCodeServiceImpl.java
View file @
bae1ccc6
...
@@ -2,13 +2,14 @@ package com.jomalls.custom.app.service.system.impl;
...
@@ -2,13 +2,14 @@ package com.jomalls.custom.app.service.system.impl;
import
com.jomalls.custom.app.service.system.CountryCodeService
;
import
com.jomalls.custom.app.service.system.CountryCodeService
;
import
com.jomalls.custom.app.vo.system.CountryCodeVO
;
import
com.jomalls.custom.app.vo.system.CountryCodeVO
;
import
com.jomalls.custom.integrate.model.
Base
CountryCodeModel
;
import
com.jomalls.custom.integrate.model.CountryCodeModel
;
import
com.jomalls.custom.integrate.service.SaasAdminService
;
import
com.jomalls.custom.integrate.service.SaasAdminService
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -27,20 +28,23 @@ public class CountryCodeServiceImpl implements CountryCodeService {
...
@@ -27,20 +28,23 @@ public class CountryCodeServiceImpl implements CountryCodeService {
@Override
@Override
public
Map
<
String
,
String
>
getMap
()
{
public
Map
<
String
,
String
>
getMap
()
{
List
<
Base
CountryCodeModel
>
list
=
saasAdminService
.
getAllCountryCode
();
List
<
CountryCodeModel
>
list
=
saasAdminService
.
getAllCountryCode
();
if
(
list
==
null
||
list
.
isEmpty
())
{
if
(
list
==
null
||
list
.
isEmpty
())
{
return
Collections
.
emptyMap
();
return
Collections
.
emptyMap
();
}
}
return
list
.
stream
()
Map
<
String
,
String
>
result
=
new
LinkedHashMap
<>();
.
collect
(
Collectors
.
toMap
(
for
(
CountryCodeModel
model
:
list
)
{
BaseCountryCodeModel:
:
getCountryCode
,
if
(
model
.
getCountryCode
()
!=
null
)
{
BaseCountryCodeModel:
:
getNameCn
,
result
.
put
(
String
.
valueOf
(
model
.
getCountryCode
()),
(
a
,
b
)
->
a
));
model
.
getNameCn
()
!=
null
?
model
.
getNameCn
()
:
""
);
}
}
return
result
;
}
}
@Override
@Override
public
List
<
CountryCodeVO
>
getAll
()
{
public
List
<
CountryCodeVO
>
getAll
()
{
List
<
Base
CountryCodeModel
>
list
=
saasAdminService
.
getAllCountryCode
();
List
<
CountryCodeModel
>
list
=
saasAdminService
.
getAllCountryCode
();
if
(
list
==
null
||
list
.
isEmpty
())
{
if
(
list
==
null
||
list
.
isEmpty
())
{
return
Collections
.
emptyList
();
return
Collections
.
emptyList
();
}
}
...
@@ -52,7 +56,7 @@ public class CountryCodeServiceImpl implements CountryCodeService {
...
@@ -52,7 +56,7 @@ public class CountryCodeServiceImpl implements CountryCodeService {
/**
/**
* 将 Model 转换为 VO
* 将 Model 转换为 VO
*/
*/
private
CountryCodeVO
toVO
(
Base
CountryCodeModel
model
)
{
private
CountryCodeVO
toVO
(
CountryCodeModel
model
)
{
CountryCodeVO
vo
=
new
CountryCodeVO
();
CountryCodeVO
vo
=
new
CountryCodeVO
();
vo
.
setCountryCode
(
model
.
getCountryCode
());
vo
.
setCountryCode
(
model
.
getCountryCode
());
vo
.
setNameCn
(
model
.
getNameCn
());
vo
.
setNameCn
(
model
.
getNameCn
());
...
...
custom-server-app/src/main/java/com/jomalls/custom/app/service/system/impl/SysLogininforServiceImpl.java
View file @
bae1ccc6
...
@@ -38,10 +38,9 @@ public class SysLogininforServiceImpl implements SysLogininforService {
...
@@ -38,10 +38,9 @@ public class SysLogininforServiceImpl implements SysLogininforService {
entity
.
setMsg
(
message
);
entity
.
setMsg
(
message
);
entity
.
setLoginTime
(
new
Date
());
entity
.
setLoginTime
(
new
Date
());
// 采集客户端信息
(与 custom-back AsyncFactory 对齐)
// 采集客户端信息
try
{
try
{
ServletRequestAttributes
attributes
=
ServletRequestAttributes
attributes
=
(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
if
(
attributes
!=
null
)
{
if
(
attributes
!=
null
)
{
HttpServletRequest
request
=
attributes
.
getRequest
();
HttpServletRequest
request
=
attributes
.
getRequest
();
entity
.
setIpaddr
(
getIpAddr
(
request
));
entity
.
setIpaddr
(
getIpAddr
(
request
));
...
...
custom-server-app/src/main/java/com/jomalls/custom/app/service/warehouse/CustomWarehouseInfoService.java
View file @
bae1ccc6
...
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.jomalls.custom.app.dto.warehouse.CustomWarehouseInfoSaveDTO
;
import
com.jomalls.custom.app.dto.warehouse.CustomWarehouseInfoSaveDTO
;
import
com.jomalls.custom.app.dto.warehouse.CustomWarehouseInfoUpdateDTO
;
import
com.jomalls.custom.app.dto.warehouse.CustomWarehouseInfoUpdateDTO
;
import
com.jomalls.custom.app.vo.warehouse.CustomWarehouseInfoSnakeVO
;
import
com.jomalls.custom.app.vo.warehouse.CustomWarehouseInfoSnakeVO
;
import
com.jomalls.custom.app.vo.warehouse.CustomWarehouseInfoVO
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -23,7 +24,7 @@ public interface CustomWarehouseInfoService {
...
@@ -23,7 +24,7 @@ public interface CustomWarehouseInfoService {
* @param page 分页参数
* @param page 分页参数
* @return 分页结果
* @return 分页结果
*/
*/
IPage
<
CustomWarehouseInfo
Snake
VO
>
pageList
(
CustomWarehouseInfoSnakeVO
entity
,
Page
<
CustomWarehouseInfoSnakeVO
>
page
);
IPage
<
CustomWarehouseInfoVO
>
pageList
(
CustomWarehouseInfoSnakeVO
entity
,
Page
<
CustomWarehouseInfoSnakeVO
>
page
);
/**
/**
* 获取仓库状态列表
* 获取仓库状态列表
...
...
custom-server-app/src/main/java/com/jomalls/custom/app/service/warehouse/impl/CustomWarehouseInfoServiceImpl.java
View file @
bae1ccc6
...
@@ -8,6 +8,7 @@ import com.jomalls.custom.app.dto.warehouse.CustomWarehouseInfoUpdateDTO;
...
@@ -8,6 +8,7 @@ import com.jomalls.custom.app.dto.warehouse.CustomWarehouseInfoUpdateDTO;
import
com.jomalls.custom.app.service.warehouse.CustomWarehouseInfoService
;
import
com.jomalls.custom.app.service.warehouse.CustomWarehouseInfoService
;
import
com.jomalls.custom.app.utils.BeanMapper
;
import
com.jomalls.custom.app.utils.BeanMapper
;
import
com.jomalls.custom.app.vo.warehouse.CustomWarehouseInfoSnakeVO
;
import
com.jomalls.custom.app.vo.warehouse.CustomWarehouseInfoSnakeVO
;
import
com.jomalls.custom.app.vo.warehouse.CustomWarehouseInfoVO
;
import
com.jomalls.custom.dal.entity.CustomWarehouseInfoEntity
;
import
com.jomalls.custom.dal.entity.CustomWarehouseInfoEntity
;
import
com.jomalls.custom.domain.service.warehouse.CustomWarehouseInfoDomainService
;
import
com.jomalls.custom.domain.service.warehouse.CustomWarehouseInfoDomainService
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
...
@@ -35,7 +36,7 @@ public class CustomWarehouseInfoServiceImpl implements CustomWarehouseInfoServic
...
@@ -35,7 +36,7 @@ public class CustomWarehouseInfoServiceImpl implements CustomWarehouseInfoServic
private
final
CustomWarehouseInfoDomainService
customWarehouseInfoDomainService
;
private
final
CustomWarehouseInfoDomainService
customWarehouseInfoDomainService
;
@Override
@Override
public
IPage
<
CustomWarehouseInfo
Snake
VO
>
pageList
(
CustomWarehouseInfoSnakeVO
entity
,
Page
<
CustomWarehouseInfoSnakeVO
>
page
)
{
public
IPage
<
CustomWarehouseInfoVO
>
pageList
(
CustomWarehouseInfoSnakeVO
entity
,
Page
<
CustomWarehouseInfoSnakeVO
>
page
)
{
LambdaQueryWrapper
<
CustomWarehouseInfoEntity
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
CustomWarehouseInfoEntity
>
wrapper
=
new
LambdaQueryWrapper
<>();
// 按仓库名称模糊搜索
// 按仓库名称模糊搜索
if
(
StringUtils
.
hasText
(
entity
.
getWarehouse_name
()))
{
if
(
StringUtils
.
hasText
(
entity
.
getWarehouse_name
()))
{
...
@@ -53,9 +54,9 @@ public class CustomWarehouseInfoServiceImpl implements CustomWarehouseInfoServic
...
@@ -53,9 +54,9 @@ public class CustomWarehouseInfoServiceImpl implements CustomWarehouseInfoServic
wrapper
.
orderByDesc
(
CustomWarehouseInfoEntity:
:
getCreateTime
);
wrapper
.
orderByDesc
(
CustomWarehouseInfoEntity:
:
getCreateTime
);
IPage
<
CustomWarehouseInfoEntity
>
entityPage
=
customWarehouseInfoDomainService
.
page
(
IPage
<
CustomWarehouseInfoEntity
>
entityPage
=
customWarehouseInfoDomainService
.
page
(
new
Page
<>(
page
.
getCurrent
(),
page
.
getSize
()),
wrapper
);
new
Page
<>(
page
.
getCurrent
(),
page
.
getSize
()),
wrapper
);
// Entity → VO 转换
(使用 snakeCase mapper 处理蛇形字段)
// Entity → VO 转换
IPage
<
CustomWarehouseInfo
Snake
VO
>
voPage
=
new
Page
<>(
entityPage
.
getCurrent
(),
entityPage
.
getSize
(),
entityPage
.
getTotal
());
IPage
<
CustomWarehouseInfoVO
>
voPage
=
new
Page
<>(
entityPage
.
getCurrent
(),
entityPage
.
getSize
(),
entityPage
.
getTotal
());
voPage
.
setRecords
(
BeanMapper
.
snakeCase
().
convertList
(
entityPage
.
getRecords
(),
CustomWarehouseInfo
Snake
VO
.
class
));
voPage
.
setRecords
(
BeanMapper
.
snakeCase
().
convertList
(
entityPage
.
getRecords
(),
CustomWarehouseInfoVO
.
class
));
return
voPage
;
return
voPage
;
}
}
...
...
custom-server-app/src/main/java/com/jomalls/custom/app/vo/warehouse/CustomWarehouseInfoVO.java
0 → 100644
View file @
bae1ccc6
package
com
.
jomalls
.
custom
.
app
.
vo
.
warehouse
;
import
com.jomalls.custom.app.vo.product.CustomProductWarehouseRelSnakeVO
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* Model
*
* @author Lizh
* @date 2026-06-03 14:47:24
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema
(
description
=
"VO"
)
public
class
CustomWarehouseInfoVO
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
1L
;
/**
*
*/
@Schema
(
description
=
""
)
private
Long
id
;
/**
* 仓库名称
*/
@Schema
(
description
=
"仓库名称"
)
private
String
warehouseName
;
/**
* 仓库编码
*/
@Schema
(
description
=
"仓库编码"
)
private
String
warehouseCode
;
/**
* 统筹物流
*/
@Schema
(
description
=
"统筹物流"
)
private
Boolean
overallLogistics
;
/**
* 超级工厂
*/
@Schema
(
description
=
"超级工厂"
)
private
Integer
superFactory
;
/**
* 系统物流
*/
@Schema
(
description
=
"系统物流"
)
private
Boolean
systemLogistics
;
/**
* 统筹物流覆盖范围
*/
@Schema
(
description
=
"统筹物流覆盖范围"
)
private
String
overallLogisticsScope
;
/**
* 联系人姓名
*/
@Schema
(
description
=
"联系人姓名"
)
private
String
contactName
;
/**
* 联系人电话
*/
@Schema
(
description
=
"联系人电话"
)
private
String
contactPhone
;
/**
* 联系人邮箱
*/
@Schema
(
description
=
"联系人邮箱"
)
private
String
contactEmail
;
/**
* 国家代码
*/
@Schema
(
description
=
"国家代码"
)
private
String
countryCode
;
/**
* 国家名称
*/
@Schema
(
description
=
"国家名称"
)
private
String
countryName
;
/**
* 州省
*/
@Schema
(
description
=
"州省"
)
private
String
province
;
/**
* 州省 code
*/
@Schema
(
description
=
"州省 code"
)
private
String
provinceCode
;
/**
* 州省简称
*/
@Schema
(
description
=
"州省简称"
)
private
String
provinceAbb
;
/**
* 城市
*/
@Schema
(
description
=
"城市"
)
private
String
city
;
/**
* 城市编码
*/
@Schema
(
description
=
"城市编码"
)
private
String
cityCode
;
/**
* 区县
*/
@Schema
(
description
=
"区县"
)
private
String
district
;
/**
* 街道
*/
@Schema
(
description
=
"街道"
)
private
String
street
;
/**
* 邮编
*/
@Schema
(
description
=
"邮编"
)
private
String
postcode
;
/**
* 公司名称
*/
@Schema
(
description
=
"公司名称"
)
private
String
companyName
;
/**
* 社会信用代码
*/
@Schema
(
description
=
"社会信用代码"
)
private
String
socialCreditCode
;
/**
* 备注
*/
@Schema
(
description
=
"备注"
)
private
String
remarks
;
/**
*
*/
@Schema
(
description
=
""
)
private
Date
updateTime
;
/**
*
*/
@Schema
(
description
=
""
)
private
Date
createTime
;
/**
* 1已上线,10待上线,20已下线,30待下线
*/
@Schema
(
description
=
"1已上线,10待上线,20已下线,30待下线"
)
private
Integer
status
;
/**
* 联系人姓名(中文)
*/
@Schema
(
description
=
"联系人姓名(中文)"
)
private
String
contactNameCn
;
/**
* 国家名称(中文)
*/
@Schema
(
description
=
"国家名称(中文)"
)
private
String
countryNameCn
;
/**
* 洲省(中文)
*/
@Schema
(
description
=
"洲省(中文)"
)
private
String
provinceCn
;
/**
* 城市(中文)
*/
@Schema
(
description
=
"城市(中文)"
)
private
String
cityCn
;
/**
* 区县(中文)
*/
@Schema
(
description
=
"区县(中文)"
)
private
String
districtCn
;
/**
* 街道(中文)
*/
@Schema
(
description
=
"街道(中文)"
)
private
String
streetCn
;
/**
* 是否为正式仓库
*/
@Schema
(
description
=
"是否为正式仓库"
)
private
Boolean
formal
;
/**
* 币种
*/
@Schema
(
description
=
"币种"
)
private
String
settlementCurrency
;
/**
* 公司名称(中文)
*/
@Schema
(
description
=
"公司名称(中文)"
)
private
String
companyNameCn
;
}
custom-server-integrate/src/main/java/com/jomalls/custom/integrate/model/
Base
CountryCodeModel.java
→
custom-server-integrate/src/main/java/com/jomalls/custom/integrate/model/CountryCodeModel.java
View file @
bae1ccc6
package
com
.
jomalls
.
custom
.
integrate
.
model
;
package
com
.
jomalls
.
custom
.
integrate
.
model
;
import
com.fasterxml.jackson.annotation.Json
Property
;
import
com.fasterxml.jackson.annotation.Json
Setter
;
import
lombok.Data
;
import
lombok.Data
;
/**
/**
* 国家代码模型(对接 admin 管理端 API)
* 国家代码模型(对接 admin 管理端 API)
* <p>
* 外部 API 返回的字段类型不统一,部分为 Integer(如 id, needProviceAbbr),
* 使用 @JsonSetter(Object) + toString() 统一转为 String。
*
*
* @author Lizh
* @author Lizh
*/
*/
@Data
@Data
public
class
Base
CountryCodeModel
{
public
class
CountryCodeModel
{
@JsonProperty
(
"countryCode"
)
/** ID */
private
String
id
;
/** 国家编码 */
private
String
countryCode
;
private
String
countryCode
;
@JsonProperty
(
"nameCn"
)
/** AE 国家编码 */
private
String
aeCountryCode
;
/** 洲编码 */
private
String
continentCode
;
/** 国家中文名 */
private
String
nameCn
;
private
String
nameCn
;
@JsonProperty
(
"nameEn"
)
/** 国家英文名 */
private
String
nameEn
;
private
String
nameEn
;
@JsonProperty
(
"continentCode"
)
/** 是否需要省缩写 */
private
String
continentCode
;
private
String
needProviceAbbr
;
@JsonProperty
(
"telephoneAreaCode"
)
/** 电话区号 */
private
String
telephoneAreaCode
;
private
String
telephoneAreaCode
;
/** 创建时间 */
private
String
createTime
;
/** 更新时间 */
private
String
updateTime
;
}
}
custom-server-integrate/src/main/java/com/jomalls/custom/integrate/service/SaasAdminService.java
View file @
bae1ccc6
package
com
.
jomalls
.
custom
.
integrate
.
service
;
package
com
.
jomalls
.
custom
.
integrate
.
service
;
import
com.jomalls.custom.integrate.model.
Base
CountryCodeModel
;
import
com.jomalls.custom.integrate.model.CountryCodeModel
;
import
com.jomalls.custom.integrate.model.CategoryInfoModel
;
import
com.jomalls.custom.integrate.model.CategoryInfoModel
;
import
com.jomalls.custom.integrate.model.PropertyModel
;
import
com.jomalls.custom.integrate.model.PropertyModel
;
...
@@ -40,5 +40,5 @@ public interface SaasAdminService {
...
@@ -40,5 +40,5 @@ public interface SaasAdminService {
* <p>
* <p>
* 调用 admin 管理端 API 查询所有国家代码。
* 调用 admin 管理端 API 查询所有国家代码。
*/
*/
List
<
Base
CountryCodeModel
>
getAllCountryCode
();
List
<
CountryCodeModel
>
getAllCountryCode
();
}
}
custom-server-integrate/src/main/java/com/jomalls/custom/integrate/service/impl/SaasAdminServiceImpl.java
View file @
bae1ccc6
package
com
.
jomalls
.
custom
.
integrate
.
service
.
impl
;
package
com
.
jomalls
.
custom
.
integrate
.
service
.
impl
;
import
com.alibaba.fastjson2.JSON
;
import
com.jomalls.custom.enums.CodeEnum
;
import
com.jomalls.custom.enums.CodeEnum
;
import
com.jomalls.custom.integrate.client.RemoteApiClient
;
import
com.jomalls.custom.integrate.client.RemoteApiClient
;
import
com.jomalls.custom.integrate.model.BaseCountryCodeModel
;
import
com.jomalls.custom.integrate.model.*
;
import
com.jomalls.custom.integrate.model.CategoryInfoModel
;
import
com.jomalls.custom.integrate.model.PropertyModel
;
import
com.jomalls.custom.integrate.model.SaasAdminApiResponseModel
;
import
com.jomalls.custom.integrate.service.SaasAdminService
;
import
com.jomalls.custom.integrate.service.SaasAdminService
;
import
com.jomalls.custom.security.LoginUser
;
import
com.jomalls.custom.security.LoginUser
;
import
com.jomalls.custom.security.SecurityUtils
;
import
com.jomalls.custom.security.SecurityUtils
;
...
@@ -39,7 +37,7 @@ public class SaasAdminServiceImpl implements SaasAdminService {
...
@@ -39,7 +37,7 @@ public class SaasAdminServiceImpl implements SaasAdminService {
private
static
final
String
GET_ALL_LIST_URL
=
"/api/manage/rest/baseCategoryInfo/all_list"
;
private
static
final
String
GET_ALL_LIST_URL
=
"/api/manage/rest/baseCategoryInfo/all_list"
;
private
static
final
String
GET_PROPERTY_BY_IDS_URL
=
"/api/manage/rest/baseProperty/getByIds"
;
private
static
final
String
GET_PROPERTY_BY_IDS_URL
=
"/api/manage/rest/baseProperty/getByIds"
;
private
static
final
String
GET_ALL_COUNTRY_CODE_URL
=
"/api/manage/rest/
baseCountryCode/all
"
;
private
static
final
String
GET_ALL_COUNTRY_CODE_URL
=
"/api/manage/rest/
getAllCountry
"
;
private
static
final
int
DEFAULT_MAP_SIZE
=
2
;
private
static
final
int
DEFAULT_MAP_SIZE
=
2
;
...
@@ -55,7 +53,7 @@ public class SaasAdminServiceImpl implements SaasAdminService {
...
@@ -55,7 +53,7 @@ public class SaasAdminServiceImpl implements SaasAdminService {
private
final
AtomicReference
<
CacheEntry
<
List
<
CategoryInfoModel
>>>
categoryCache
=
new
AtomicReference
<>();
private
final
AtomicReference
<
CacheEntry
<
List
<
CategoryInfoModel
>>>
categoryCache
=
new
AtomicReference
<>();
/** 国家代码本地缓存 */
/** 国家代码本地缓存 */
private
final
AtomicReference
<
CacheEntry
<
List
<
Base
CountryCodeModel
>>>
countryCodeCache
=
new
AtomicReference
<>();
private
final
AtomicReference
<
CacheEntry
<
List
<
CountryCodeModel
>>>
countryCodeCache
=
new
AtomicReference
<>();
@Value
(
"${server.admin.base-url:https://admin.jomalls.com}"
)
@Value
(
"${server.admin.base-url:https://admin.jomalls.com}"
)
private
String
adminBaseUrl
;
private
String
adminBaseUrl
;
...
@@ -149,26 +147,25 @@ public class SaasAdminServiceImpl implements SaasAdminService {
...
@@ -149,26 +147,25 @@ public class SaasAdminServiceImpl implements SaasAdminService {
*
*
* @return 国家代码列表,失败时返回空列表
* @return 国家代码列表,失败时返回空列表
*/
*/
public
List
<
Base
CountryCodeModel
>
getAllCountryCode
()
{
public
List
<
CountryCodeModel
>
getAllCountryCode
()
{
// 命中缓存且未过期 → 直接返回
// 命中缓存且未过期 → 直接返回
CacheEntry
<
List
<
Base
CountryCodeModel
>>
entry
=
countryCodeCache
.
get
();
CacheEntry
<
List
<
CountryCodeModel
>>
entry
=
countryCodeCache
.
get
();
if
(
entry
!=
null
&&
!
entry
.
isExpired
())
{
if
(
entry
!=
null
&&
!
entry
.
isExpired
())
{
return
entry
.
data
;
return
entry
.
data
;
}
}
// 未命中或已过期 → 远程调用刷新
// 未命中或已过期 → 远程调用刷新
String
url
=
adminBaseUrl
+
GET_ALL_COUNTRY_CODE_URL
;
String
url
=
adminBaseUrl
+
GET_ALL_COUNTRY_CODE_URL
;
try
{
try
{
ResponseEntity
<
SaasAdminApiResponseModel
<
List
<
BaseCountryCodeModel
>>>
response
=
remoteApiClient
.
get
(
// 该接口返回裸数组 [...], 不是 SaasAdminApiResponseModel 包装
url
,
ResponseEntity
<
String
>
response
=
remoteApiClient
.
get
(
new
ParameterizedTypeReference
<>()
{},
url
,
new
ParameterizedTypeReference
<>()
{},
getHeader
());
getHeader
());
if
(
response
!=
null
&&
response
.
getBody
()
!=
null
)
{
if
(
response
!=
null
&&
response
.
getBody
()
!=
null
)
{
S
aasAdminApiResponseModel
<
List
<
BaseCountryCodeModel
>>
responseB
ody
=
response
.
getBody
();
S
tring
b
ody
=
response
.
getBody
();
if
(
responseBody
.
getCode
()
==
CodeEnum
.
SUCCESS
.
getCode
())
{
List
<
CountryCodeModel
>
data
=
JSON
.
parseArray
(
body
,
CountryCodeModel
.
class
);
List
<
BaseCountryCodeModel
>
data
=
responseBody
.
getData
();
if
(!
data
.
isEmpty
())
{
countryCodeCache
.
set
(
new
CacheEntry
<>(
data
,
COUNTRY_CODE_CACHE_TTL_MS
));
countryCodeCache
.
set
(
new
CacheEntry
<>(
data
,
COUNTRY_CODE_CACHE_TTL_MS
));
return
data
;
}
}
return
data
;
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"[ SaasAdminService ] {} 调用失败"
,
url
,
e
);
log
.
error
(
"[ SaasAdminService ] {} 调用失败"
,
url
,
e
);
...
...
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/system/CountryCodeController.java
View file @
bae1ccc6
...
@@ -2,6 +2,7 @@ package com.jomalls.custom.webapp.controller.system;
...
@@ -2,6 +2,7 @@ package com.jomalls.custom.webapp.controller.system;
import
com.jomalls.custom.app.service.system.CountryCodeService
;
import
com.jomalls.custom.app.service.system.CountryCodeService
;
import
com.jomalls.custom.app.vo.system.CountryCodeVO
;
import
com.jomalls.custom.app.vo.system.CountryCodeVO
;
import
com.jomalls.custom.utils.AjaxResult
;
import
com.jomalls.custom.utils.R
;
import
com.jomalls.custom.utils.R
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
...
@@ -30,15 +31,13 @@ public class CountryCodeController {
...
@@ -30,15 +31,13 @@ public class CountryCodeController {
@Operation
(
summary
=
"获取国家代码映射(code → nameCn)"
)
@Operation
(
summary
=
"获取国家代码映射(code → nameCn)"
)
@GetMapping
(
"/map"
)
@GetMapping
(
"/map"
)
public
R
<
Map
<
String
,
String
>>
getMap
()
{
public
AjaxResult
getMap
()
{
Map
<
String
,
String
>
map
=
countryCodeService
.
getMap
();
return
AjaxResult
.
success
(
countryCodeService
.
getMap
());
return
R
.
ok
(
map
);
}
}
@Operation
(
summary
=
"获取全部国家代码列表"
)
@Operation
(
summary
=
"获取全部国家代码列表"
)
@GetMapping
(
"/all"
)
@GetMapping
(
"/all"
)
public
R
<
List
<
CountryCodeVO
>>
getAll
()
{
public
List
<
CountryCodeVO
>
getAll
()
{
List
<
CountryCodeVO
>
list
=
countryCodeService
.
getAll
();
return
countryCodeService
.
getAll
();
return
R
.
ok
(
list
);
}
}
}
}
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/warehouse/CustomWarehouseInfoController.java
View file @
bae1ccc6
...
@@ -7,6 +7,8 @@ import com.jomalls.custom.app.dto.warehouse.CustomWarehouseInfoSaveDTO;
...
@@ -7,6 +7,8 @@ import com.jomalls.custom.app.dto.warehouse.CustomWarehouseInfoSaveDTO;
import
com.jomalls.custom.app.dto.warehouse.CustomWarehouseInfoUpdateDTO
;
import
com.jomalls.custom.app.dto.warehouse.CustomWarehouseInfoUpdateDTO
;
import
com.jomalls.custom.app.service.warehouse.CustomWarehouseInfoService
;
import
com.jomalls.custom.app.service.warehouse.CustomWarehouseInfoService
;
import
com.jomalls.custom.app.vo.warehouse.CustomWarehouseInfoSnakeVO
;
import
com.jomalls.custom.app.vo.warehouse.CustomWarehouseInfoSnakeVO
;
import
com.jomalls.custom.app.vo.warehouse.CustomWarehouseInfoVO
;
import
com.jomalls.custom.utils.AjaxResult
;
import
com.jomalls.custom.utils.R
;
import
com.jomalls.custom.utils.R
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
...
@@ -33,38 +35,35 @@ public class CustomWarehouseInfoController {
...
@@ -33,38 +35,35 @@ public class CustomWarehouseInfoController {
@Operation
(
summary
=
"获取仓库状态列表"
)
@Operation
(
summary
=
"获取仓库状态列表"
)
@GetMapping
(
"/statusList"
)
@GetMapping
(
"/statusList"
)
public
R
<
List
<
Map
<
String
,
Object
>
>>
statusList
()
{
public
List
<
Map
<
String
,
Object
>>
statusList
()
{
return
R
.
ok
(
customWarehouseInfoService
.
statusList
()
);
return
customWarehouseInfoService
.
statusList
(
);
}
}
@Operation
(
summary
=
"分页查询仓库列表"
)
@Operation
(
summary
=
"分页查询仓库列表"
)
@RequiresPermissions
(
"business:customWarehouse:list"
)
@RequiresPermissions
(
"business:customWarehouse:list"
)
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
R
<
IPage
<
CustomWarehouseInfoSnakeVO
>
>
list
(
CustomWarehouseInfoSnakeVO
entity
,
Page
<
CustomWarehouseInfoSnakeVO
>
page
)
{
public
IPage
<
CustomWarehouseInfoVO
>
list
(
CustomWarehouseInfoSnakeVO
entity
,
Page
<
CustomWarehouseInfoSnakeVO
>
page
)
{
return
R
.
ok
(
customWarehouseInfoService
.
pageList
(
entity
,
page
)
);
return
customWarehouseInfoService
.
pageList
(
entity
,
page
);
}
}
@Operation
(
summary
=
"新增仓库"
)
@Operation
(
summary
=
"新增仓库"
)
@RequiresPermissions
(
"business:customWarehouse:add"
)
@RequiresPermissions
(
"business:customWarehouse:add"
)
@PostMapping
@PostMapping
public
R
<
Void
>
add
(
@RequestBody
CustomWarehouseInfoSaveDTO
dto
)
{
public
void
add
(
@RequestBody
CustomWarehouseInfoSaveDTO
dto
)
{
customWarehouseInfoService
.
add
(
dto
);
customWarehouseInfoService
.
add
(
dto
);
return
R
.
ok
();
}
}
@Operation
(
summary
=
"修改仓库"
)
@Operation
(
summary
=
"修改仓库"
)
@RequiresPermissions
(
"business:customWarehouse:edit"
)
@RequiresPermissions
(
"business:customWarehouse:edit"
)
@PutMapping
@PutMapping
public
R
<
Void
>
edit
(
@RequestBody
CustomWarehouseInfoUpdateDTO
dto
)
{
public
void
edit
(
@RequestBody
CustomWarehouseInfoUpdateDTO
dto
)
{
customWarehouseInfoService
.
edit
(
dto
);
customWarehouseInfoService
.
edit
(
dto
);
return
R
.
ok
();
}
}
@Operation
(
summary
=
"删除仓库"
)
@Operation
(
summary
=
"删除仓库"
)
@RequiresPermissions
(
"business:customWarehouse:remove"
)
@RequiresPermissions
(
"business:customWarehouse:remove"
)
@DeleteMapping
(
"/{ids}"
)
@DeleteMapping
(
"/{ids}"
)
public
R
<
Void
>
remove
(
@PathVariable
String
ids
)
{
public
void
remove
(
@PathVariable
String
ids
)
{
customWarehouseInfoService
.
remove
(
ids
);
customWarehouseInfoService
.
remove
(
ids
);
return
R
.
ok
();
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment