1
0

feat(all): 增加股票上市状态

This commit is contained in:
2025-08-30 22:19:26 +08:00
parent cbab5afeab
commit 877f460c26
4 changed files with 36 additions and 3 deletions

View File

@@ -100,6 +100,12 @@ public class CommonOptionsController {
.map(industry -> new Option(industry, industry))
.toList()
);
case "stock_listed" -> GlobalResponse.responseSuccess(
List.of(
new Option("已上市", true),
new Option("已退市", false)
)
);
default -> GlobalResponse.responseSuccess(List.of());
};
}
@@ -113,6 +119,13 @@ public class CommonOptionsController {
.toList(),
field
));
case "stock_listed" -> GlobalResponse.responseSuccess(buildMapping(
List.of(
new Mapping("true", "已上市"),
new Mapping("false", "已退市")
),
field
));
case "task_status" -> GlobalResponse.responseSuccess(buildMapping(
Arrays.stream(Task.Status.values())
.map(status -> new Mapping(status.name(), status.getChineseName()))

View File

@@ -36,7 +36,8 @@ public class StockController extends SimpleControllerSupport<Stock, Void, StockC
stock.getName(),
stock.getFullname(),
stock.getMarket(),
stock.getIndustry()
stock.getIndustry(),
stock.isListed()
);
}
@@ -56,7 +57,8 @@ public class StockController extends SimpleControllerSupport<Stock, Void, StockC
String name,
String fullname,
Stock.Market market,
String industry
String industry,
Boolean listed
) {
}
}

View File

@@ -50,7 +50,6 @@ public class Stock extends SimpleEntity {
@Comment("交易市场")
@Enumerated(EnumType.STRING)
private Market market;
@Column(nullable = false)
@Comment("行业")
private String industry;
@Column(nullable = false)

View File

@@ -33,6 +33,7 @@ function StockList() {
inside: {
market: '${filter_market|default:undefined}',
industry: '${filter_industry|default:undefined}',
listed: '${filter_listed|default:true|asArray}',
},
},
page: {
@@ -94,6 +95,16 @@ function StockList() {
checkAll: true,
checkAllBySearch: true,
},
{
name: 'filter_listed',
label: '状态',
...remoteOptions('select', 'stock_listed'),
multiple: true,
extractValue: true,
joinValues: false,
clearable: true,
checkAll: true,
},
],
},
columns: [
@@ -111,10 +122,18 @@ function StockList() {
name: 'fullname',
label: '全名',
},
{
name: 'listed',
label: '状态',
width: 100,
align: 'center',
...remoteMappings('stock_listed', 'listed'),
},
{
name: 'market',
label: '市场',
width: 100,
align: 'center',
...remoteMappings('stock_market', 'market'),
},
{