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)) .map(industry -> new Option(industry, industry))
.toList() .toList()
); );
case "stock_listed" -> GlobalResponse.responseSuccess(
List.of(
new Option("已上市", true),
new Option("已退市", false)
)
);
default -> GlobalResponse.responseSuccess(List.of()); default -> GlobalResponse.responseSuccess(List.of());
}; };
} }
@@ -113,6 +119,13 @@ public class CommonOptionsController {
.toList(), .toList(),
field field
)); ));
case "stock_listed" -> GlobalResponse.responseSuccess(buildMapping(
List.of(
new Mapping("true", "已上市"),
new Mapping("false", "已退市")
),
field
));
case "task_status" -> GlobalResponse.responseSuccess(buildMapping( case "task_status" -> GlobalResponse.responseSuccess(buildMapping(
Arrays.stream(Task.Status.values()) Arrays.stream(Task.Status.values())
.map(status -> new Mapping(status.name(), status.getChineseName())) .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.getName(),
stock.getFullname(), stock.getFullname(),
stock.getMarket(), stock.getMarket(),
stock.getIndustry() stock.getIndustry(),
stock.isListed()
); );
} }
@@ -56,7 +57,8 @@ public class StockController extends SimpleControllerSupport<Stock, Void, StockC
String name, String name,
String fullname, String fullname,
Stock.Market market, Stock.Market market,
String industry String industry,
Boolean listed
) { ) {
} }
} }

View File

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

View File

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