删除 EmoneyRequestConfig 和 ProxyConfig 设置,改为数据库(SQLite)配置。默认配置的设置和删除逻辑由
SQLite 触发器配置。
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
package quant.rich.emoney.entity.postgre;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 益盟个股策略信息,包含策略类型和日期
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain=true)
|
||||
public class StockStrategy {
|
||||
|
||||
private String tsCode;
|
||||
|
||||
public StockStrategy setTsCodeFromGoodsId(Integer goodsId) {
|
||||
// 自动将益盟 goodsId 转换成 tsCode
|
||||
// 1301325 -> 301325.SZ
|
||||
// 600325 -> 600325.SH
|
||||
// 1920009 -> 920009.BJ
|
||||
String goodsIdStr = goodsId.toString();
|
||||
RuntimeException e = new RuntimeException("无法将 goodsId " + goodsIdStr + " 转换为 tsCode");
|
||||
if (goodsIdStr.length() == 6) {
|
||||
// SH
|
||||
return setTsCode(goodsIdStr + ".SH");
|
||||
}
|
||||
else if (goodsIdStr.length() == 7) {
|
||||
if (goodsIdStr.charAt(0) != '1') {
|
||||
throw e;
|
||||
}
|
||||
if (goodsIdStr.charAt(1) == '9') {
|
||||
// BJ
|
||||
return setTsCode(goodsIdStr.substring(1) + ".BJ");
|
||||
}
|
||||
// SZ
|
||||
return setTsCode(goodsIdStr.substring(1) + ".SZ");
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user