1、资产配置

beetlsql3-dev
陈沅 1 year ago
parent 956e4d9138
commit 45c7e8f2e4

@ -9,6 +9,7 @@ import org.beetl.sql.mapper.BaseMapper;
import org.beetl.sql.mapper.annotation.SqlResource;
import org.springframework.stereotype.Repository;
import java.math.BigDecimal;
import java.util.List;
/**
@ -21,4 +22,7 @@ public interface StudentAccountCrowdfundingSystemDao extends BaseMapper<StudentA
PageQuery<StudentAccountCrowdfundingSystem> queryByCondition(PageQuery query);
List<StudentAccountCrowdfundingSystem> getValuesByQueryNotWithPermission(StudentAccountCrowdfundingSystemQuery studentAccountCrowdfundingSystemQuery);
void updateByTransfer(BigDecimal availableFunds, BigDecimal initialCapital, BigDecimal initialInvestmentCapital,Long studentId);
}

@ -10,6 +10,7 @@ import org.beetl.sql.mapper.BaseMapper;
import org.beetl.sql.mapper.annotation.SqlResource;
import org.springframework.stereotype.Repository;
import java.math.BigDecimal;
import java.util.List;
/**
@ -22,4 +23,9 @@ public interface StudentAccountEquityInvestmentSystemDao extends BaseMapper<Stud
PageQuery<StudentAccountEquityInvestmentSystem> queryByCondition(PageQuery query);
List<StudentAccountEquityInvestmentSystem> getValuesByQueryNotWithPermission(StudentAccountEquityInvestmentSystemQuery studentAccountEquityInvestmentSystemQuery);
List<StudentAccountEquityInvestmentSystem> getValuesByQuery(StudentAccountEquityInvestmentSystemQuery studentAccountEquityInvestmentSystemQuery);
void updateByTransfer(BigDecimal initialCapital,BigDecimal initialInvestmentCapital,BigDecimal totalAssets,BigDecimal freeMoney,Long studentId);
}

@ -7,6 +7,7 @@ import org.beetl.sql.mapper.BaseMapper;
import org.beetl.sql.mapper.annotation.SqlResource;
import org.springframework.stereotype.Repository;
import java.math.BigDecimal;
import java.util.List;
/**
@ -19,4 +20,9 @@ public interface StudentAccountMockTradingSystemDao extends BaseMapper<StudentAc
PageQuery<StudentAccountMockTradingSystem> queryByCondition(PageQuery query);
List<StudentAccountMockTradingSystem> getValuesByQueryNotWithPermission(StudentAccountMockTradingSystemQuery studentAccountMockTradingSystemQuery);
void updateByTransfer(BigDecimal availableFunds, BigDecimal initialCapital, BigDecimal initialInvestmentCapital, Long studentId,Long applicationId);
List<StudentAccountMockTradingSystem> getByStudentId(Long studentId);
}

@ -7,6 +7,7 @@ import org.beetl.sql.mapper.BaseMapper;
import org.beetl.sql.mapper.annotation.SqlResource;
import org.springframework.stereotype.Repository;
import java.math.BigDecimal;
import java.util.List;
/**
@ -19,4 +20,6 @@ public interface StudentAccountP2pSystemDao extends BaseMapper<StudentAccountP2p
PageQuery<StudentAccountP2pSystem> queryByCondition(PageQuery query);
List<StudentAccountP2pSystem> getValuesByQueryNotWithPermission(StudentAccountP2pSystemQuery studentAccountP2pSystemQuery);
void updateByTransfer(BigDecimal availableFunds, BigDecimal initialCapital, BigDecimal initialInvestmentCapital,Long studentId);
}

@ -7,6 +7,8 @@ import lombok.Data;
import org.beetl.sql.annotation.entity.AssignID;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
/*
*
@ -39,40 +41,40 @@ public class StudentAccountCrowdfundingSystem extends BaseEntity{
private Long state ;
@ApiModelProperty("期初资金")
private Long initialCapital ;
private BigDecimal initialCapital ;
@ApiModelProperty("期初投资资金")
private Long initialInvestmentCapital ;
private BigDecimal initialInvestmentCapital ;
@ApiModelProperty("可用余额")
private Long availableBalance ;
private BigDecimal availableBalance ;
@ApiModelProperty("资产总额")
private Long totalAssets ;
private BigDecimal totalAssets ;
@ApiModelProperty("投资总额")
private Long totalInvestment ;
private BigDecimal totalInvestment ;
@ApiModelProperty("众筹总额")
private Long totalCrowdfunding ;
private BigDecimal totalCrowdfunding ;
@ApiModelProperty("冻结总额")
private Long totalFrozen ;
private BigDecimal totalFrozen ;
@ApiModelProperty("累计收益")
private Long cumulativeIncome ;
private BigDecimal cumulativeIncome ;
@ApiModelProperty("自有资金投资收益率")
private Long frozenInvestmentIncome ;
private BigDecimal frozenInvestmentIncome ;
@ApiModelProperty("众筹投资收益率")
private Long crowdfundingFrozenInvestmentIncome ;
private BigDecimal crowdfundingFrozenInvestmentIncome ;
@ApiModelProperty("'修改时间'")
private Long updateTime ;
private Date updateTime ;
@ApiModelProperty("'创建时间'")
private Long createTime ;
private Date createTime ;
@ApiModelProperty("是否删除 1: 正常2: 删除")
private Long isDel ;

@ -7,6 +7,8 @@ import lombok.Data;
import org.beetl.sql.annotation.entity.AssignID;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
/*
*
@ -39,49 +41,52 @@ public class StudentAccountEquityInvestmentSystem extends BaseEntity{
private Long state ;
@ApiModelProperty("期初资金")
private Long initialCapital ;
private BigDecimal initialCapital ;
@ApiModelProperty("期初投资资金")
private Long initialInvestmentCapital ;
private BigDecimal initialInvestmentCapital ;
@ApiModelProperty("总募集资金")
private Long totalCollectAssets ;
private BigDecimal totalCollectAssets ;
@ApiModelProperty("已投资总额")
private Long totalInvestment ;
private BigDecimal totalInvestment ;
@ApiModelProperty("LP募集金额")
private Long lpCollectAssets ;
private BigDecimal lpCollectAssets ;
@ApiModelProperty("LP投资金额")
private Long lpInvestmentAssets ;
private BigDecimal lpInvestmentAssets ;
@ApiModelProperty("GP投资金额")
private Long glInvestmentAssets ;
private BigDecimal glInvestmentAssets ;
@ApiModelProperty("劣后级投资金额")
private BigDecimal poorInvestmentAssets ;
@ApiModelProperty("自有资金")
private Long ownFunds ;
private BigDecimal ownFunds ;
@ApiModelProperty("银行借款")
private Long bankLoan ;
private BigDecimal bankLoan ;
@ApiModelProperty("资金")
private Long investmentAssets ;
@ApiModelProperty("银行借款投资金")
private BigDecimal bankLoanInvestment ;
@ApiModelProperty("投资收益")
private Long investmentIncome ;
private BigDecimal investmentIncome ;
@ApiModelProperty("净资产投资收益率")
private Long netAssetInvestmentIncome ;
private BigDecimal netAssetInvestmentIncome ;
@ApiModelProperty("总资产收益率")
private Long totalAssetsIncome ;
private BigDecimal totalAssetsIncome ;
@ApiModelProperty("自有投资资金")
private BigDecimal ownInvestmentAssets ;
@ApiModelProperty("'修改时间'")
private Long updateTime ;
private Date updateTime ;
@ApiModelProperty("'创建时间'")
private Long createTime ;
private Date createTime ;
@ApiModelProperty("是否删除 1: 正常2: 删除")
private Long isDel ;

@ -7,6 +7,8 @@ import lombok.Data;
import org.beetl.sql.annotation.entity.AssignID;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
/*
*
@ -39,43 +41,47 @@ public class StudentAccountMockTradingSystem extends BaseEntity{
private Long state ;
@ApiModelProperty("期初资金")
private Long initialCapital ;
private BigDecimal initialCapital ;
@ApiModelProperty("期初投资资金")
private Long initialInvestmentCapital ;
private BigDecimal initialInvestmentCapital ;
@ApiModelProperty("总资产")
private Long totalAssets ;
private BigDecimal totalAssets ;
@ApiModelProperty("可用资金")
private Long availableCapital ;
private BigDecimal availableCapital ;
@ApiModelProperty("市值")
private Long marketValue ;
private BigDecimal marketValue ;
@ApiModelProperty("累计盈亏")
private Long cumulativeProfitAndLoss ;
private BigDecimal cumulativeProfitAndLoss ;
@ApiModelProperty("累计收益率")
private Long cumulativeIncome ;
private BigDecimal cumulativeIncome ;
@ApiModelProperty("年化收益率")
private Long annualRateOfIncome ;
private BigDecimal annualRateOfIncome ;
@ApiModelProperty("卡玛比率")
private Long kamarRatio ;
private BigDecimal kamarRatio ;
@ApiModelProperty("夏普比率")
private Long sharpeRatio ;
private BigDecimal sharpeRatio ;
@ApiModelProperty("最大回测")
private Long maximumBacktest ;
private BigDecimal maximumBacktest ;
@ApiModelProperty("总资产投资收益率")
private BigDecimal totalAssetsIncome ;
@ApiModelProperty("净资产投资收益率")
private BigDecimal netAssetsIncome ;
@ApiModelProperty("'修改时间'")
private Long updateTime ;
private Date updateTime ;
@ApiModelProperty("'创建时间'")
private Long createTime ;
private Date createTime ;
@ApiModelProperty("是否删除 1: 正常2: 删除")
private Long isDel ;

@ -45,49 +45,49 @@ public class StudentAccountP2pSystem extends BaseEntity{
private Long state ;
@ApiModelProperty("期初资金")
private Long initialCapital ;
private BigDecimal initialCapital ;
@ApiModelProperty("期初投资资金")
private Long initialInvestmentCapital ;
private BigDecimal initialInvestmentCapital ;
@ApiModelProperty("可用余额")
private Long availableBalance ;
private BigDecimal availableBalance ;
@ApiModelProperty("资产总额")
private Long totalAssets ;
private BigDecimal totalAssets ;
@ApiModelProperty("投资总额")
private Long totalInvestment ;
private BigDecimal totalInvestment ;
@ApiModelProperty("借款总额")
private Long totalBorrow ;
private BigDecimal totalBorrow ;
@ApiModelProperty("冻结资金")
private Long frozenFunds ;
private BigDecimal frozenFunds ;
@ApiModelProperty("累计收益")
private Long cumulativeIncome ;
private BigDecimal cumulativeIncome ;
@ApiModelProperty("总资产收益率")
private Long totalAssetIncome ;
private BigDecimal totalAssetIncome ;
@ApiModelProperty("净资产收益率")
private Long netAssetIncome ;
private BigDecimal netAssetIncome ;
@ApiModelProperty("日投资总金额")
private Long totalDailyInvestmentAmount ;
private BigDecimal totalDailyInvestmentAmount ;
@ApiModelProperty("周投资总金额")
private Long totalAmountWeeklyInvestment ;
private BigDecimal totalAmountWeeklyInvestment ;
@ApiModelProperty("月投资总金额")
private Long totalAmountMonthlyInvestment ;
private BigDecimal totalAmountMonthlyInvestment ;
@ApiModelProperty("'修改时间'")
private Long updateTime ;
private Date updateTime ;
@ApiModelProperty("'创建时间'")
private Long createTime ;
private Date createTime ;
@ApiModelProperty("是否删除 1: 正常2: 删除")
private Long isDel ;

@ -21,17 +21,24 @@ import com.ibeetl.jlw.enums.AccountTypeEnum;
import com.ibeetl.jlw.web.query.ResourcesApplicationCourseQuery;
import com.ibeetl.jlw.web.query.ResourcesApplicationQuery;
import com.ibeetl.jlw.web.query.StudentAccountAssetAllocationQuery;
import com.ibeetl.jlw.web.query.StudentAccountEquityInvestmentSystemQuery;
import org.apache.commons.lang3.StringUtils;
import org.beetl.sql.core.SqlId;
import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.NotBlank;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.*;
@ -73,6 +80,15 @@ public class StudentAccountAssetAllocationService extends CoreBaseService<Studen
@Autowired
private StudentAccountTradingRecordSheetDao studentAccountTradingRecordSheetDao;
@Autowired
private StudentAccountP2pSystemService studentAccountP2pSystemService;
@Autowired
private StudentAccountCrowdfundingSystemService studentAccountCrowdfundingSystemService;
@Autowired
private StudentAccountEquityInvestmentSystemService studentAccountEquityInvestmentSystemService;
@Autowired
private StudentAccountMockTradingSystemService studentAccountMockTradingSystemService;
public PageQuery<StudentAccountAssetAllocation> queryByCondition(PageQuery query) {
PageQuery ret = studentAccountAssetAllocationDao.queryByCondition(query);
@ -322,11 +338,11 @@ public class StudentAccountAssetAllocationService extends CoreBaseService<Studen
query.setApplicationSecondLevelRelation("数字资产");
} else if (ObjectUtil.equals(values[i].getText(), AccountTypeEnum.MARGIN_ACCOUNT.getText())) {
} else if (ObjectUtil.equals(values[i].getText(), AccountTypeEnum.MARGIN_ACCOUNT.getText())) {
query.setApplicationSecondLevelRelation("融资融券");
} else if (ObjectUtil.equals(values[i].getText(), AccountTypeEnum.INSURANCE_ACCOUNT.getText())) {
} else if (ObjectUtil.equals(values[i].getText(), AccountTypeEnum.INSURANCE_ACCOUNT.getText())) {
query.setApplicationSecondLevelRelation("保险公司");
@ -338,7 +354,7 @@ public class StudentAccountAssetAllocationService extends CoreBaseService<Studen
if (ObjectUtil.equals(values[i].getText(), AccountTypeEnum.CASH_ACCOUNT.getText()) || ObjectUtil.equals(values[i].getText(), AccountTypeEnum.BANK_ACCOUNT.getText())) {
allocation.setState(2);
allocation.setApplicationId(ObjectUtil.equals(values[i].getText(), AccountTypeEnum.CASH_ACCOUNT.getText()) ? -2L : -1L );
allocation.setApplicationId(ObjectUtil.equals(values[i].getText(), AccountTypeEnum.CASH_ACCOUNT.getText()) ? -2L : -1L);
allocation.setInitialCapital(ObjectUtil.equals(values[i].getText(), AccountTypeEnum.CASH_ACCOUNT.getText()) ?
new BigDecimal(1000000) : BigDecimal.ZERO);
@ -399,10 +415,10 @@ public class StudentAccountAssetAllocationService extends CoreBaseService<Studen
//获取添加院校权限,对账号进行限制
for (UniversitiesCollegesJurisdictionExperimentalSystem item : experimentalSystems) {
if (ObjectUtil.equals(accountAssetAllocation.getApplicationId(),item.getTypeId()) && ObjectUtil.isNotNull(item.getUseEndTime()) && DateUtil.endOfDay(item.getUseEndTime()).getTime() >= System.currentTimeMillis() && (ObjectUtil.equals(item.getUseType(), 1) || ObjectUtil.equals(item.getUseType(), 2))) {
if (ObjectUtil.equals(accountAssetAllocation.getApplicationId(), item.getTypeId()) && ObjectUtil.isNotNull(item.getUseEndTime()) && DateUtil.endOfDay(item.getUseEndTime()).getTime() >= System.currentTimeMillis() && (ObjectUtil.equals(item.getUseType(), 1) || ObjectUtil.equals(item.getUseType(), 2))) {
//后期添加应用开发权限,新增的时候已经有应用添加了
state = 2;
} else if (ObjectUtil.isEmpty(accountAssetAllocation.getApplicationId())){
} else if (ObjectUtil.isEmpty(accountAssetAllocation.getApplicationId())) {
//新增学生账号,应用还没有添加,后面才添加授权权限的时候获取应用ID设置
ResourcesApplicationQuery resourcesApplicationQuery = new ResourcesApplicationQuery();
if (ObjectUtil.equals(accountAssetAllocation.getName().getText(), AccountTypeEnum.P2P_ACCOUNT.getText())) {
@ -434,11 +450,11 @@ public class StudentAccountAssetAllocationService extends CoreBaseService<Studen
resourcesApplicationQuery.setApplicationSecondLevelRelation("数字资产");
} else if (ObjectUtil.equals(accountAssetAllocation.getName().getText(), AccountTypeEnum.MARGIN_ACCOUNT.getText())) {
} else if (ObjectUtil.equals(accountAssetAllocation.getName().getText(), AccountTypeEnum.MARGIN_ACCOUNT.getText())) {
resourcesApplicationQuery.setApplicationSecondLevelRelation("融资融券");
} else if (ObjectUtil.equals(accountAssetAllocation.getName().getText(), AccountTypeEnum.INSURANCE_ACCOUNT.getText())) {
} else if (ObjectUtil.equals(accountAssetAllocation.getName().getText(), AccountTypeEnum.INSURANCE_ACCOUNT.getText())) {
resourcesApplicationQuery.setApplicationSecondLevelRelation("保险公司");
@ -448,10 +464,10 @@ public class StudentAccountAssetAllocationService extends CoreBaseService<Studen
}
if (ObjectUtil.isNotNull(resourcesApplicationQuery.getApplicationSecondLevelRelation())){
if (ObjectUtil.isNotNull(resourcesApplicationQuery.getApplicationSecondLevelRelation())) {
List<ResourcesApplication> resourcesApplicationList = resourcesApplicationDao.getValuesByQuery(resourcesApplicationQuery);
if (CollectionUtil.isNotEmpty(resourcesApplicationList)){
if (ObjectUtil.equals(item.getTypeId(),resourcesApplicationList.get(0).getResourcesApplicationId())){
if (CollectionUtil.isNotEmpty(resourcesApplicationList)) {
if (ObjectUtil.equals(item.getTypeId(), resourcesApplicationList.get(0).getResourcesApplicationId())) {
accountAssetAllocation.setApplicationId(item.getTypeId());
state = 2;
}
@ -469,11 +485,11 @@ public class StudentAccountAssetAllocationService extends CoreBaseService<Studen
accountAssetAllocation.setInitialInvestmentCapital(Objects.equals(accountAssetAllocation.getInitialInvestmentCapital().compareTo(BigDecimal.ZERO), 0) ? new BigDecimal(1000000) : accountAssetAllocation.getInitialInvestmentCapital());
accountAssetAllocation.setUpdateTime(new Date());
}
if (!ObjectUtil.equals(accountAssetAllocation.getApplicationId(),-1L) &&
!ObjectUtil.equals(accountAssetAllocation.getApplicationId(),-2L) &&
if (!ObjectUtil.equals(accountAssetAllocation.getApplicationId(), -1L) &&
!ObjectUtil.equals(accountAssetAllocation.getApplicationId(), -2L) &&
!ObjectUtil.equals(accountAssetAllocation.getName().getText(), AccountTypeEnum.OPTIONS_INVESTMENT_ACCOUNT.getText()) &&
!ObjectUtil.equals(accountAssetAllocation.getName().getText(), AccountTypeEnum.FOREX_INVESTMENT_ACCOUNT.getText()) &&
!ObjectUtil.equals(accountAssetAllocation.getName().getText(), AccountTypeEnum.TRUST_ACCOUNT.getText())){
!ObjectUtil.equals(accountAssetAllocation.getName().getText(), AccountTypeEnum.TRUST_ACCOUNT.getText())) {
studentAccountAssetAllocationDao.updateById(accountAssetAllocation);
}
}
@ -503,7 +519,8 @@ public class StudentAccountAssetAllocationService extends CoreBaseService<Studen
/**
*
*
*
* @param toAccountsApplicationId
* @param outAccountsApplicationId
* @param money
@ -511,9 +528,9 @@ public class StudentAccountAssetAllocationService extends CoreBaseService<Studen
* @param coreUser
* @return
*/
public JsonResult<String> transferAccounts(Long toAccountsApplicationId, Long outAccountsApplicationId, BigDecimal money, Long studentId,CoreUser coreUser){
public JsonResult<String> transferAccounts(Long toAccountsApplicationId, Long outAccountsApplicationId, BigDecimal money, Long studentId, CoreUser coreUser) {
if (ObjectUtil.isEmpty(money)){
if (ObjectUtil.isEmpty(money)) {
return JsonResult.failMessage("转账金额为空");
}
@ -525,7 +542,7 @@ public class StudentAccountAssetAllocationService extends CoreBaseService<Studen
outAccounts.setApplicationId(outAccountsApplicationId);
outAccounts.setStudentId(studentId);
List<StudentAccountAssetAllocation> outAccountsList = studentAccountAssetAllocationDao.getValuesByQuery(outAccounts);
if (CollectionUtil.isEmpty(outAccountsList)){
if (CollectionUtil.isEmpty(outAccountsList)) {
return JsonResult.failMessage("转出账号未开通");
}
StudentAccountAssetAllocation outAccountAssetAllocation = outAccountsList.get(0);
@ -539,25 +556,25 @@ public class StudentAccountAssetAllocationService extends CoreBaseService<Studen
toAccounts.setStudentId(studentId);
List<StudentAccountAssetAllocation> toAccountsList = studentAccountAssetAllocationDao.getValuesByQuery(toAccounts);
if (CollectionUtil.isEmpty(toAccountsList)){
if (CollectionUtil.isEmpty(toAccountsList)) {
return JsonResult.failMessage("转入账号未开通");
}
StudentAccountAssetAllocation toAccountAssetAllocation = toAccountsList.get(0);
if (ObjectUtil.equals(outAccountAssetAllocation.getName(),toAccountAssetAllocation.getName())){
if (ObjectUtil.equals(outAccountAssetAllocation.getName(), toAccountAssetAllocation.getName())) {
return JsonResult.failMessage("不能转入相同账户");
}
if (!ObjectUtil.equals(outAccountAssetAllocation.getName(),AccountTypeEnum.BANK_ACCOUNT) && !ObjectUtil.equals(toAccountAssetAllocation.getName(),AccountTypeEnum.BANK_ACCOUNT)){
if (!ObjectUtil.equals(outAccountAssetAllocation.getName(), AccountTypeEnum.BANK_ACCOUNT) && !ObjectUtil.equals(toAccountAssetAllocation.getName(), AccountTypeEnum.BANK_ACCOUNT)) {
return JsonResult.failMessage("只能转入银行账号");
}
if (Objects.equals(availableFunds.compareTo(BigDecimal.ZERO), 0)){
if (Objects.equals(availableFunds.compareTo(BigDecimal.ZERO), 0)) {
return JsonResult.failMessage("可用资金不足");
}
if (availableFunds.compareTo(transfer) < 0){
if (availableFunds.compareTo(transfer) < 0) {
return JsonResult.failMessage("超出可用资金总额");
}
@ -580,16 +597,116 @@ public class StudentAccountAssetAllocationService extends CoreBaseService<Studen
tradingRecordSheet.setStudentId(studentId);
tradingRecordSheet.setOrgId(coreUser.getOrgId());
studentAccountTradingRecordSheetDao.insert(tradingRecordSheet);
if (outAccountAssetAllocation.getApplicationId() == 18 || toAccountAssetAllocation.getApplicationId() == 18) {
String url = "http://120.79.161.177:8029/Account/UpdatePevcAvailable";
String postData;
if (outAccountAssetAllocation.getApplicationId() == 18) {
postData = "UserId=" + coreUser.getId() + "&&Money=" + money + "&&CZId=" + 1;
} else {
postData = "UserId=" + coreUser.getId() + "&&Money=" + money + "&&CZId=" + 2;
}
String result = sendPostRequest(url, postData);
StudentAccountAssetAllocationQuery updateQuery = new StudentAccountAssetAllocationQuery();
updateQuery.setApplicationId(Long.valueOf(18));
updateQuery.setStudentId(studentId);
List<StudentAccountAssetAllocation> updateAccount = studentAccountAssetAllocationDao.getValuesByQuery(updateQuery);
StudentAccountAssetAllocation allocation = updateAccount.get(0);
studentAccountEquityInvestmentSystemService.updateByTransfer(allocation.getInitialCapital(), allocation.getInitialInvestmentCapital(),
allocation.getInitialInvestmentCapital(), allocation.getInitialInvestmentCapital(), studentId);
}
if (outAccountAssetAllocation.getApplicationId() == 4 || toAccountAssetAllocation.getApplicationId() == 4) {
updateStudentAccountByApplicationId(studentId, 4);
}
if (outAccountAssetAllocation.getApplicationId() == 5 || toAccountAssetAllocation.getApplicationId() == 5) {
updateStudentAccountByApplicationId(studentId, 4);
}
if (outAccountAssetAllocation.getApplicationId() == 16 || toAccountAssetAllocation.getApplicationId() == 16) {
updateStudentAccountByApplicationId(studentId, 16);
}
if (outAccountAssetAllocation.getApplicationId() == -16 || toAccountAssetAllocation.getApplicationId() == -16) {
updateStudentAccountByApplicationId(studentId, -16);
}
return JsonResult.success();
}
// 创建一个方法来执行更新子系统资产表操作
public void updateStudentAccountByApplicationId(long studentId, int applicationId) {
StudentAccountAssetAllocationQuery updateQuery = new StudentAccountAssetAllocationQuery();
updateQuery.setApplicationId((long) applicationId);
updateQuery.setStudentId(studentId);
List<StudentAccountAssetAllocation> updateAccount = studentAccountAssetAllocationDao.getValuesByQuery(updateQuery);
if (!updateAccount.isEmpty()) {
StudentAccountAssetAllocation allocation = updateAccount.get(0);
switch (applicationId) {
case 4:
studentAccountP2pSystemService.updateByTransfer(allocation.getAvailableFunds(), allocation.getInitialCapital(), allocation.getInitialInvestmentCapital(), studentId);
break;
case 5:
studentAccountCrowdfundingSystemService.updateByTransfer(allocation.getAvailableFunds(), allocation.getInitialCapital(), allocation.getInitialInvestmentCapital(), studentId);
break;
case 16:
studentAccountMockTradingSystemService.updateByTransfer(allocation.getAvailableFunds(), allocation.getInitialCapital(), allocation.getInitialInvestmentCapital(), studentId, Long.valueOf(16));
break;
case -16:
studentAccountMockTradingSystemService.updateByTransfer(allocation.getAvailableFunds(), allocation.getInitialCapital(), allocation.getInitialInvestmentCapital(), studentId, Long.valueOf(-16));
break;
default:
break;
}
}
}
public static String sendPostRequest(String url, String postData) {
try {
URL apiUrl = new URL(url);
HttpURLConnection connection = (HttpURLConnection) apiUrl.openConnection();
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
connection.setRequestProperty("Content-Length", String.valueOf(postData.length()));
connection.setDoOutput(true);
try (OutputStream os = connection.getOutputStream()) {
byte[] input = postData.getBytes("UTF-8");
os.write(input, 0, input.length);
}
int responseCode = connection.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_OK) {
try (BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
String inputLine;
StringBuilder response = new StringBuilder();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
return response.toString();
}
} else {
System.out.println("接口请求错误:" + responseCode);
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
*
*
* @param studentId
* @return
*/
public List<StudentAccountAssetAllocation> getCapitalAccount(Long studentId){
public List<StudentAccountAssetAllocation> getCapitalAccount(Long studentId) {
List<StudentAccountAssetAllocation> select = studentAccountAssetAllocationDao.getSQLManager().lambdaQuery(StudentAccountAssetAllocation.class)
.andEq(StudentAccountAssetAllocation::getStudentId, studentId)
.andEq(StudentAccountAssetAllocation::getState, 2)
@ -683,4 +800,7 @@ public class StudentAccountAssetAllocationService extends CoreBaseService<Studen
return courseInfoService.getByIds(courseInfoIds);
}
}

@ -10,6 +10,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import java.math.BigDecimal;
import java.util.List;
/**
@ -41,4 +42,17 @@ public class StudentAccountCrowdfundingSystemService extends CoreBaseService<Stu
studentAccountCrowdfundingSystemDao.insert(crowdfundingSystem);
}
public void add(StudentAccountCrowdfundingSystem crowdfundingSystem) {
studentAccountCrowdfundingSystemDao.insert(crowdfundingSystem);
}
public boolean update(StudentAccountCrowdfundingSystem crowdfundingSystem){
studentAccountCrowdfundingSystemDao.updateById(crowdfundingSystem);
return true;
}
public void updateByTransfer(BigDecimal availableFunds, BigDecimal initialCapital, BigDecimal initialInvestmentCapital,Long studentId) {
studentAccountCrowdfundingSystemDao.updateByTransfer(availableFunds,initialCapital,initialInvestmentCapital,studentId);
}
}

@ -10,6 +10,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import java.math.BigDecimal;
import java.util.List;
/**
@ -40,4 +41,21 @@ public class StudentAccountEquityInvestmentSystemService extends CoreBaseService
studentAccountEquityInvestmentSystemDao.insert(investmentSystem);
}
public void add(StudentAccountEquityInvestmentSystem system) {
studentAccountEquityInvestmentSystemDao.insert(system);
}
public boolean update(StudentAccountEquityInvestmentSystem system){
studentAccountEquityInvestmentSystemDao.updateById(system);
return true;
}
public List<StudentAccountEquityInvestmentSystem> getValuesByQuery(StudentAccountEquityInvestmentSystemQuery query){
return studentAccountEquityInvestmentSystemDao.getValuesByQuery(query);
}
public void updateByTransfer(BigDecimal initialCapital, BigDecimal initialInvestmentCapital, BigDecimal totalAssets, BigDecimal freeMoney, Long studentId){
studentAccountEquityInvestmentSystemDao.updateByTransfer(initialCapital,initialInvestmentCapital,totalAssets,freeMoney,studentId);
}
}

@ -10,6 +10,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import java.math.BigDecimal;
import java.util.List;
/**
@ -41,4 +42,24 @@ public class StudentAccountMockTradingSystemService extends CoreBaseService<Stud
studentAccountMockTradingSystemDao.insert(p2pSystem);
}
public List<StudentAccountMockTradingSystem> getByStudentId(Long studentId){
return studentAccountMockTradingSystemDao.getByStudentId(studentId);
}
public void add(StudentAccountMockTradingSystem studentAccountMockTradingSystem) {
studentAccountMockTradingSystemDao.insert(studentAccountMockTradingSystem);
}
public boolean update(StudentAccountMockTradingSystem system){
studentAccountMockTradingSystemDao.updateTemplateById(system);
return true;
}
public void updateByTransfer(BigDecimal availableFunds, BigDecimal initialCapital, BigDecimal initialInvestmentCapital, Long studentId,Long applicationId) {
studentAccountMockTradingSystemDao.updateByTransfer(availableFunds,initialCapital,initialInvestmentCapital,studentId,applicationId);
}
}

@ -10,6 +10,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import java.math.BigDecimal;
import java.util.List;
/**
@ -25,12 +26,10 @@ public class StudentAccountP2pSystemService extends CoreBaseService<StudentAccou
@Autowired
private StudentAccountP2pSystemDao studentAccountP2pSystemDao;
public JsonResult<List<StudentAccountP2pSystem>> getList(StudentAccountP2pSystemQuery query) {
return JsonResult.success(studentAccountP2pSystemDao.getValuesByQueryNotWithPermission(query));
}
/**
*
*/
@ -41,4 +40,18 @@ public class StudentAccountP2pSystemService extends CoreBaseService<StudentAccou
studentAccountP2pSystemDao.insert(p2pSystem);
}
public void add(StudentAccountP2pSystem p2pSystem) {
studentAccountP2pSystemDao.insert(p2pSystem);
}
public boolean update(StudentAccountP2pSystem system) {
studentAccountP2pSystemDao.updateById(system);
return true;
}
public void updateByTransfer(BigDecimal availableFunds, BigDecimal initialCapital, BigDecimal initialInvestmentCapital,Long studentId) {
studentAccountP2pSystemDao.updateByTransfer(availableFunds,initialCapital,initialInvestmentCapital,studentId);
}
}

@ -4,15 +4,12 @@ package com.ibeetl.jlw.web;
import com.ibeetl.admin.core.entity.CoreUser;
import com.ibeetl.admin.core.service.CoreUserService;
import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.jlw.entity.ResourcesApplication;
import com.ibeetl.jlw.entity.Student;
import com.ibeetl.jlw.entity.StudentAccountAssetAllocation;
import com.ibeetl.jlw.entity.*;
import com.ibeetl.jlw.enums.AccountTypeEnum;
import com.ibeetl.jlw.service.ResourcesApplicationService;
import com.ibeetl.jlw.service.StudentAccountAssetAllocationService;
import com.ibeetl.jlw.service.StudentService;
import com.ibeetl.jlw.service.*;
import com.ibeetl.jlw.web.query.ResourcesApplicationQuery;
import com.ibeetl.jlw.web.query.StudentAccountAssetAllocationQuery;
import com.ibeetl.jlw.web.query.StudentAccountEquityInvestmentSystemQuery;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javafx.beans.binding.DoubleExpression;
@ -40,7 +37,15 @@ public class AccountController {
private StudentService studentService;
@Autowired
private StudentAccountAssetAllocationService studentAccountAssetAllocationService;
@Autowired
private StudentAccountP2pSystemService studentAccountP2pSystemService;
@Autowired
private StudentAccountCrowdfundingSystemService studentAccountCrowdfundingSystemService;
@Autowired
private StudentAccountMockTradingSystemService studentAccountMockTradingSystemService;
@Autowired
private StudentAccountEquityInvestmentSystemService studentAccountEquityInvestmentSystemService;
private final static String URL = "jdbc:sqlserver://120.79.161.177:1433;databaseName=Test.Zhiyun_v2.0;trustServerCertificate=true;encrypt=true";
private final static String USER = "sa";
@ -106,8 +111,26 @@ public class AccountController {
// if (studentAccountAssetAllocations != null && studentAccountAssetAllocations.size() > 0) {
// continue;
// }
String sql = "select top 100 EduUsers.UserName,EduAssetAllocation.* from EduUsers " +
"join EduAssetAllocation on EduUsers.Id = EduAssetAllocation.UserId where UserName = '" + username + "'";
String sql = "SELECT\n" +
" EduUsers.UserName,\n" +
" EduAssetAllocation.ApplicationId,\n" +
" CAST(EduAssetAllocation.InitialCapital AS DECIMAL(18, 2)) AS InitialCapital,\n" +
" CAST(EduAssetAllocation.AvailableFunds AS DECIMAL(18, 2)) AS AvailableFunds,\n" +
" EduAssetAllocation.IntoAccount," +
" EduAssetAllocation.name,\n" +
" CAST(EduAssetAllocation.TransferInAmount AS DECIMAL(18, 2)) AS TransferInAmount,\n" +
" CAST(EduAssetAllocation.InitialInvestmentCapital AS DECIMAL(18, 2)) AS InitialInvestmentCapital,\n" +
" CAST(EduAssetAllocation.TransferOutAmount AS DECIMAL(18, 2)) AS TransferOutAmount,\n" +
" CAST(EduAssetAllocation.Borrowed_Funds AS DECIMAL(18, 2)) AS Borrowed_Funds,\n" +
" CAST(EduAssetAllocation.InvestmentFunds AS DECIMAL(18, 2)) AS InvestmentFunds,\n" +
" CAST(EduAssetAllocation.Investment_value AS DECIMAL(18, 2)) AS Investment_value,\n" +
" CAST(EduAssetAllocation.Investment_income AS DECIMAL(18, 2)) AS Investment_income,\n" +
" CAST(EduAssetAllocation.Total_assets_of_subaccounts AS DECIMAL(18, 2)) AS Total_assets_of_subaccounts,\n" +
" CAST(EduAssetAllocation.Asset_Investment AS DECIMAL(18, 2)) AS Asset_Investment,\n" +
" CAST(EduAssetAllocation.Return_on_equity AS DECIMAL(18, 2)) AS Return_on_equity\n" +
"FROM EduUsers\n" +
"JOIN EduAssetAllocation ON EduUsers.Id = EduAssetAllocation.UserId\n" +
"WHERE EduUsers.UserName = '" + username + "'";
PreparedStatement preparedStatement = connection.prepareStatement(sql);
ResultSet resultSet = preparedStatement.executeQuery();
while (resultSet.next()) {
@ -137,30 +160,310 @@ public class AccountController {
} else if (applicationId == 4) {
allocationQuery.setApplicationId(Long.valueOf(4));
allocationQuery.setName(AccountTypeEnum.P2P_ACCOUNT);
}else if (applicationId==5){
Connection connection1 = openConn();
String sql1 = "SELECT\n" +
" ExaP2PAssetAllocation.Id,\n" +
" ExaP2PAssetAllocation.ApplicationId,\n" +
" CAST(ExaP2PAssetAllocation.InitialCapital AS DECIMAL(18, 2)) AS InitialCapital,\n" +
" CAST(ExaP2PAssetAllocation.InitialInvestmentCapital AS DECIMAL(18, 2)) AS InitialInvestmentCapital,\n" +
" CAST(ExaP2PAssetAllocation.The_Total_AssetsOf AS DECIMAL(18, 2)) AS The_Total_AssetsOf,\n" +
" CAST(ExaP2PAssetAllocation.AvailableFunds AS DECIMAL(18, 2)) AS AvailableFunds,\n" +
" CAST(ExaP2PAssetAllocation.InvestmentFunds AS DECIMAL(18, 2)) AS InvestmentFunds,\n" +
" CAST(ExaP2PAssetAllocation.Borrowed_Funds AS DECIMAL(18, 2)) AS Borrowed_Funds,\n" +
" CAST(ExaP2PAssetAllocation.Freeze_Funds AS DECIMAL(18, 2)) AS Freeze_Funds,\n" +
" CAST(ExaP2PAssetAllocation.Cumulative_of_return AS DECIMAL(18, 2)) AS Cumulative_of_return,\n" +
" CAST(ExaP2PAssetAllocation.TotalAssets_Rate_Return AS DECIMAL(18, 2)) AS TotalAssets_Rate_Return,\n" +
" CAST(ExaP2PAssetAllocation.Return_on_equity AS DECIMAL(18, 2)) AS Return_on_equity,\n" +
" CAST(ExaP2PAssetAllocation.TotalDailyInvestment AS DECIMAL(18, 2)) AS TotalDailyInvestment,\n" +
" CAST(ExaP2PAssetAllocation.TotalWeeklyInvestment AS DECIMAL(18, 2)) AS TotalWeeklyInvestment,\n" +
" CAST(ExaP2PAssetAllocation.TotalMonthlyInvestment AS DECIMAL(18, 2)) AS TotalMonthlyInvestment,\n" +
" ExaP2PAssetAllocation.UserId,\n" +
" ExaP2PAssetAllocation.IsDeleted,\n" +
" ExaP2PAssetAllocation.DeleterUserId,\n" +
" ExaP2PAssetAllocation.DeletionTime,\n" +
" ExaP2PAssetAllocation.LastModificationTime,\n" +
" ExaP2PAssetAllocation.LastModifierUserId,\n" +
" ExaP2PAssetAllocation.CreationTime,\n" +
" ExaP2PAssetAllocation.CreatorUserId\n" +
"FROM ExaP2PAssetAllocation\n" +
"JOIN EduUsers ON ExaP2PAssetAllocation.UserId = EduUsers.Id\n" +
"WHERE EduUsers.UserName = '" + username + "'";
PreparedStatement preparedStatement1 = connection1.prepareStatement(sql1);
ResultSet resultSet1 = preparedStatement1.executeQuery();
while (resultSet1.next()) {
StudentAccountP2pSystem studentAccountP2pSystem = new StudentAccountP2pSystem();
BigDecimal InitialCapital1 = resultSet1.getBigDecimal("InitialCapital");
BigDecimal InitialInvestmentCapital1 = resultSet1.getBigDecimal("InitialInvestmentCapital");
BigDecimal The_Total_AssetsOf1 = resultSet1.getBigDecimal("The_Total_AssetsOf");
BigDecimal AvailableFunds1 = resultSet1.getBigDecimal("AvailableFunds");
BigDecimal InvestmentFunds1 = resultSet1.getBigDecimal("InvestmentFunds");
BigDecimal Borrowed_Funds1 = resultSet1.getBigDecimal("Borrowed_Funds");
BigDecimal Freeze_Funds1 = resultSet1.getBigDecimal("Freeze_Funds");
BigDecimal Cumulative_of_return1 = resultSet1.getBigDecimal("Cumulative_of_return");
BigDecimal TotalAssets_Rate_Return1 = resultSet1.getBigDecimal("TotalAssets_Rate_Return");
BigDecimal Return_on_equity1 = resultSet1.getBigDecimal("Return_on_equity");
BigDecimal TotalDailyInvestment1 = resultSet1.getBigDecimal("TotalDailyInvestment");
BigDecimal TotalWeeklyInvestment1 = resultSet1.getBigDecimal("TotalWeeklyInvestment");
BigDecimal TotalMonthlyInvestment1 = resultSet1.getBigDecimal("TotalMonthlyInvestment");
studentAccountP2pSystem.setStudentId(student.getStudentId());
studentAccountP2pSystem.setApplicationId(Long.valueOf(applicationId));
studentAccountP2pSystem.setUniversitiesCollegesId(student.getOrgId());
studentAccountP2pSystem.setInitialCapital(InitialCapital1);
studentAccountP2pSystem.setState(Long.valueOf(1));
studentAccountP2pSystem.setInitialInvestmentCapital(InitialInvestmentCapital1);
studentAccountP2pSystem.setAvailableBalance(AvailableFunds1);
studentAccountP2pSystem.setTotalAssets(The_Total_AssetsOf1);
studentAccountP2pSystem.setTotalInvestment(InvestmentFunds1);
studentAccountP2pSystem.setTotalBorrow(Borrowed_Funds1);
studentAccountP2pSystem.setFrozenFunds(Freeze_Funds1);
studentAccountP2pSystem.setCumulativeIncome(Cumulative_of_return1);
studentAccountP2pSystem.setTotalAssetIncome(TotalAssets_Rate_Return1);
studentAccountP2pSystem.setNetAssetIncome(Return_on_equity1);
studentAccountP2pSystem.setTotalDailyInvestmentAmount(TotalDailyInvestment1);
studentAccountP2pSystem.setTotalAmountWeeklyInvestment(TotalWeeklyInvestment1);
studentAccountP2pSystem.setTotalAmountMonthlyInvestment(TotalMonthlyInvestment1);
studentAccountP2pSystem.setIsDel(Long.valueOf(1));
studentAccountP2pSystem.setOrgId(student.getOrgId());
studentAccountP2pSystem.setIsInstitution(Long.valueOf(1));
studentAccountP2pSystemService.add(studentAccountP2pSystem);
}
closeConn(connection1);
preparedStatement1.close();
} else if (applicationId == 5) {
allocationQuery.setApplicationId(Long.valueOf(5));
allocationQuery.setName(AccountTypeEnum.CROWDFUNDING_ACCOUNT);
}else if(applicationId==16){
Connection connection1 = openConn();
String sql1 = "SELECT\n" +
" ExaTheRaiseAssetAllocation.Id,\n" +
" ExaTheRaiseAssetAllocation.ApplicationId,\n" +
" CAST(ExaTheRaiseAssetAllocation.InitialCapital AS DECIMAL(18, 2)) AS InitialCapital,\n" +
" CAST(ExaTheRaiseAssetAllocation.InitialInvestmentCapital AS DECIMAL(18, 2)) AS InitialInvestmentCapital,\n" +
" CAST(ExaTheRaiseAssetAllocation.The_Total_AssetsOf AS DECIMAL(18, 2)) AS The_Total_AssetsOf,\n" +
" CAST(ExaTheRaiseAssetAllocation.AvailableFunds AS DECIMAL(18, 2)) AS AvailableFunds,\n" +
" CAST(ExaTheRaiseAssetAllocation.InvestmentFunds AS DECIMAL(18, 2)) AS InvestmentFunds,\n" +
" CAST(ExaTheRaiseAssetAllocation.TheTotalAmountOfTheRaise AS DECIMAL(18, 2)) AS TheTotalAmountOfTheRaise,\n" +
" CAST(ExaTheRaiseAssetAllocation.TheTotalAmountOfFrozen AS DECIMAL(18, 2)) AS TheTotalAmountOfFrozen,\n" +
" CAST(ExaTheRaiseAssetAllocation.Cumulative_of_return AS DECIMAL(18, 2)) AS Cumulative_of_return,\n" +
" CAST(ExaTheRaiseAssetAllocation.ReturnOnInvestmentOwnCapital AS DECIMAL(18, 2)) AS ReturnOnInvestmentOwnCapital,\n" +
" CAST(ExaTheRaiseAssetAllocation.ReturnOnCrowdfundingInvestment AS DECIMAL(18, 2)) AS ReturnOnCrowdfundingInvestment,\n" +
" ExaTheRaiseAssetAllocation.UserId,\n" +
" ExaTheRaiseAssetAllocation.IsDeleted,\n" +
" ExaTheRaiseAssetAllocation.DeleterUserId,\n" +
" ExaTheRaiseAssetAllocation.DeletionTime,\n" +
" ExaTheRaiseAssetAllocation.LastModificationTime,\n" +
" ExaTheRaiseAssetAllocation.LastModifierUserId,\n" +
" ExaTheRaiseAssetAllocation.CreationTime,\n" +
" ExaTheRaiseAssetAllocation.CreatorUserId\n" +
"FROM ExaTheRaiseAssetAllocation\n" +
"JOIN EduUsers ON ExaTheRaiseAssetAllocation.UserId = EduUsers.Id\n" +
"WHERE EduUsers.UserName ='" + username + "'";
PreparedStatement preparedStatement1 = connection1.prepareStatement(sql1);
ResultSet resultSet1 = preparedStatement1.executeQuery();
while (resultSet1.next()) {
StudentAccountCrowdfundingSystem system = new StudentAccountCrowdfundingSystem();
system.setStudentId(student.getStudentId());
system.setState(Long.valueOf(1));
system.setApplicationId(Long.valueOf(applicationId));
system.setUniversitiesCollegesId(student.getOrgId());
system.setIsDel(1L);
system.setIsInstitution(1L);
system.setOrgId(student.getOrgId());
BigDecimal InitialCapital1 = resultSet1.getBigDecimal("InitialCapital");
BigDecimal InitialInvestmentCapital1 = resultSet1.getBigDecimal("InitialInvestmentCapital");
BigDecimal The_Total_AssetsOf1 = resultSet1.getBigDecimal("The_Total_AssetsOf");
BigDecimal AvailableFunds1 = resultSet1.getBigDecimal("AvailableFunds");
BigDecimal InvestmentFunds1 = resultSet1.getBigDecimal("InvestmentFunds");
BigDecimal TheTotalAmountOfTheRaise1 = resultSet1.getBigDecimal("TheTotalAmountOfTheRaise");
BigDecimal TheTotalAmountOfFrozen1 = resultSet1.getBigDecimal("TheTotalAmountOfFrozen");
BigDecimal Cumulative_of_return1 = resultSet1.getBigDecimal("Cumulative_of_return");
BigDecimal ReturnOnInvestmentOwnCapital1 = resultSet1.getBigDecimal("ReturnOnInvestmentOwnCapital");
BigDecimal ReturnOnCrowdfundingInvestment1 = resultSet1.getBigDecimal("ReturnOnCrowdfundingInvestment");
system.setInitialCapital(InitialCapital1);
system.setInitialInvestmentCapital(InitialInvestmentCapital1);
system.setAvailableBalance(AvailableFunds1);
system.setTotalAssets(The_Total_AssetsOf1);
system.setTotalInvestment(InvestmentFunds1);
system.setTotalCrowdfunding(TheTotalAmountOfTheRaise1);
system.setTotalFrozen(TheTotalAmountOfFrozen1);
system.setCumulativeIncome(Cumulative_of_return1);
system.setFrozenInvestmentIncome(ReturnOnInvestmentOwnCapital1);
system.setCrowdfundingFrozenInvestmentIncome(ReturnOnCrowdfundingInvestment1);
studentAccountCrowdfundingSystemService.add(system);
}
closeConn(connection1);
preparedStatement1.close();
} else if (applicationId == 16) {
allocationQuery.setApplicationId(Long.valueOf(16));
allocationQuery.setName(AccountTypeEnum.EQUITY_FUND_INVESTMENT_ACCOUNT);
}else if(applicationId==-16){
Connection connection1 = openConn();
String sql1 = "SELECT\n" +
" ExaMNJYAssetAllocation.Id,\n" +
" ExaMNJYAssetAllocation.ApplicationId,\n" +
" CAST(ExaMNJYAssetAllocation.InitialCapital AS DECIMAL(18, 2)) AS InitialCapital,\n" +
" CAST(ExaMNJYAssetAllocation.InitialInvestmentCapital AS DECIMAL(18, 2)) AS InitialInvestmentCapital,\n" +
" CAST(ExaMNJYAssetAllocation.TotalAssets AS DECIMAL(18, 2)) AS TotalAssets,\n" +
" CAST(ExaMNJYAssetAllocation.AvailableFunds AS DECIMAL(18, 2)) AS AvailableFunds,\n" +
" CAST(ExaMNJYAssetAllocation.Market_value AS DECIMAL(18, 2)) AS Market_value,\n" +
" CAST(ExaMNJYAssetAllocation.Accumulative_total_profit_and_loss AS DECIMAL(18, 2)) AS Accumulative_total_profit_and_loss,\n" +
" CAST(ExaMNJYAssetAllocation.Cumulative_rate_of_return AS DECIMAL(18, 2)) AS Cumulative_rate_of_return,\n" +
" CAST(ExaMNJYAssetAllocation.Annualized_rate_of_return AS DECIMAL(18, 2)) AS Annualized_rate_of_return,\n" +
" CAST(ExaMNJYAssetAllocation.Kumar_ratio AS DECIMAL(18, 2)) AS Kumar_ratio,\n" +
" CAST(ExaMNJYAssetAllocation.Sharpe_ratio AS DECIMAL(18, 2)) AS Sharpe_ratio,\n" +
" CAST(ExaMNJYAssetAllocation.The_biggest_back_test AS DECIMAL(18, 2)) AS The_biggest_back_test,\n" +
" CAST(ExaMNJYAssetAllocation.Asset_Investment_Rate AS DECIMAL(18, 2)) AS Asset_Investment_Rate,\n" +
" CAST(ExaMNJYAssetAllocation.Return_on_equity AS DECIMAL(18, 2)) AS Return_on_equity,\n" +
" ExaMNJYAssetAllocation.UserId,\n" +
" ExaMNJYAssetAllocation.SecType,\n" +
" ExaMNJYAssetAllocation.IsDeleted,\n" +
" ExaMNJYAssetAllocation.DeleterUserId,\n" +
" ExaMNJYAssetAllocation.DeletionTime,\n" +
" ExaMNJYAssetAllocation.LastModificationTime,\n" +
" ExaMNJYAssetAllocation.LastModifierUserId,\n" +
" ExaMNJYAssetAllocation.CreationTime,\n" +
" ExaMNJYAssetAllocation.CreatorUserId\n" +
"FROM ExaMNJYAssetAllocation\n" +
"JOIN EduUsers ON ExaMNJYAssetAllocation.UserId = EduUsers.Id\n" +
"WHERE EduUsers.UserName ='" + username + "'";
PreparedStatement preparedStatement1 = connection1.prepareStatement(sql1);
ResultSet resultSet1 = preparedStatement1.executeQuery();
while (resultSet1.next()) {
StudentAccountMockTradingSystem system = new StudentAccountMockTradingSystem();
BigDecimal InitialCapital1 = resultSet1.getBigDecimal("InitialCapital");
BigDecimal InitialInvestmentCapital1 = resultSet1.getBigDecimal("InitialInvestmentCapital");
BigDecimal TotalAssets1 = resultSet1.getBigDecimal("TotalAssets");
BigDecimal AvailableFunds1 = resultSet1.getBigDecimal("AvailableFunds");
BigDecimal Market_value1 = resultSet1.getBigDecimal("Market_value");
BigDecimal Accumulative_total_profit_and_loss1 = resultSet1.getBigDecimal("Accumulative_total_profit_and_loss");
BigDecimal Cumulative_rate_of_return1 = resultSet1.getBigDecimal("Cumulative_rate_of_return");
BigDecimal Annualized_rate_of_return1 = resultSet1.getBigDecimal("Annualized_rate_of_return");
BigDecimal Kumar_ratio1 = resultSet1.getBigDecimal("Kumar_ratio");
BigDecimal Sharpe_ratio1 = resultSet1.getBigDecimal("Sharpe_ratio");
BigDecimal The_biggest_back_test1 = resultSet1.getBigDecimal("The_biggest_back_test");
BigDecimal Asset_Investment_Rate1 = resultSet1.getBigDecimal("Asset_Investment_Rate");
BigDecimal Return_on_equity1 = resultSet1.getBigDecimal("Return_on_equity");
Long applicationId1 = resultSet1.getLong("ApplicationId");
system.setStudentId(student.getStudentId());
system.setApplicationId(applicationId1);
system.setUniversitiesCollegesId(student.getOrgId());
system.setState(Long.valueOf(1));
system.setIsDel(1L);
system.setInitialCapital(InitialCapital1);
system.setInitialInvestmentCapital(InitialInvestmentCapital1);
system.setTotalAssets(TotalAssets1);
system.setAvailableCapital(AvailableFunds1);
system.setMarketValue(Market_value1);
system.setCumulativeProfitAndLoss(Accumulative_total_profit_and_loss1);
system.setCumulativeIncome(Cumulative_rate_of_return1);
system.setAnnualRateOfIncome(Annualized_rate_of_return1);
system.setKamarRatio(Kumar_ratio1);
system.setSharpeRatio(Sharpe_ratio1);
system.setMaximumBacktest(The_biggest_back_test1);
system.setTotalAssetsIncome(Asset_Investment_Rate1);
system.setNetAssetsIncome(Return_on_equity1);
studentAccountMockTradingSystemService.add(system);
}
closeConn(connection1);
preparedStatement1.close();
} else if (applicationId == -16) {
allocationQuery.setApplicationId(Long.valueOf(-16));
allocationQuery.setName(AccountTypeEnum.FUTURES_INVESTMENT_ACCOUNT);
}else if(applicationId==18){
} else if (applicationId == 18) {
allocationQuery.setApplicationId(Long.valueOf(18));
allocationQuery.setName(AccountTypeEnum.EQUITY_INVESTMENT_ACCOUNT);
}else if(applicationName.equals("外汇投资账户")){
Connection connection1 = openConn();
String sql1 = "SELECT\n" +
" ExaPEVCAssetAllocation.Id,\n" +
" ExaPEVCAssetAllocation.ApplicationId,\n" +
" CAST(ExaPEVCAssetAllocation.InitialInvestmentCapital AS DECIMAL(18, 2)) AS InitialInvestmentCapital,\n" +
" CAST(ExaPEVCAssetAllocation.InitialCapital AS DECIMAL(18, 2)) AS InitialCapital,\n" +
" CAST(ExaPEVCAssetAllocation.TotalAssets AS DECIMAL(18, 2)) AS TotalAssets,\n" +
" CAST(ExaPEVCAssetAllocation.InvestmentFunds AS DECIMAL(18, 2)) AS InvestmentFunds,\n" +
" CAST(ExaPEVCAssetAllocation.LPAmount AS DECIMAL(18, 2)) AS LPAmount,\n" +
" CAST(ExaPEVCAssetAllocation.LPInvestmentAmount AS DECIMAL(18, 2)) AS LPInvestmentAmount,\n" +
" CAST(ExaPEVCAssetAllocation.GPInvestmentAmount AS DECIMAL(18, 2)) AS GPInvestmentAmount,\n" +
" CAST(ExaPEVCAssetAllocation.LhAmount AS DECIMAL(18, 2)) AS LhAmount,\n" +
" CAST(ExaPEVCAssetAllocation.FreeMoney AS DECIMAL(18, 2)) AS FreeMoney,\n" +
" CAST(ExaPEVCAssetAllocation.Bank_loan AS DECIMAL(18, 2)) AS Bank_loan,\n" +
" CAST(ExaPEVCAssetAllocation.BankInvestmentFunds AS DECIMAL(18, 2)) AS BankInvestmentFunds,\n" +
" CAST(ExaPEVCAssetAllocation.FreeInvestment_funds AS DECIMAL(18, 2)) AS FreeInvestment_funds,\n" +
" CAST(ExaPEVCAssetAllocation.Return_On_investment AS DECIMAL(18, 2)) AS Return_On_investment,\n" +
" CAST(ExaPEVCAssetAllocation.Return_on_net_asset_investment AS DECIMAL(18, 2)) AS Return_on_net_asset_investment,\n" +
" CAST(ExaPEVCAssetAllocation.Return_on_total_assets AS DECIMAL(18, 2)) AS Return_on_total_assets,\n" +
" ExaPEVCAssetAllocation.UserId,\n" +
" ExaPEVCAssetAllocation.IsDeleted,\n" +
" ExaPEVCAssetAllocation.DeleterUserId,\n" +
" ExaPEVCAssetAllocation.DeletionTime,\n" +
" ExaPEVCAssetAllocation.LastModificationTime,\n" +
" ExaPEVCAssetAllocation.LastModifierUserId,\n" +
" ExaPEVCAssetAllocation.CreationTime,\n" +
" ExaPEVCAssetAllocation.CreatorUserId\n" +
"FROM ExaPEVCAssetAllocation\n" +
"JOIN EduUsers ON ExaPEVCAssetAllocation.UserId = EduUsers.Id\n" +
"WHERE EduUsers.UserName ='" + username + "'";
PreparedStatement preparedStatement1 = connection1.prepareStatement(sql1);
ResultSet resultSet1 = preparedStatement1.executeQuery();
while (resultSet1.next()) {
StudentAccountEquityInvestmentSystem system = new StudentAccountEquityInvestmentSystem();
BigDecimal InitialInvestmentCapital1 = resultSet1.getBigDecimal("InitialInvestmentCapital");
BigDecimal InitialCapital1 = resultSet1.getBigDecimal("InitialCapital");
BigDecimal TotalAssets1 = resultSet1.getBigDecimal("TotalAssets");
BigDecimal InvestmentFunds1 = resultSet1.getBigDecimal("InvestmentFunds");
BigDecimal LPAmount1 = resultSet1.getBigDecimal("LPAmount");
BigDecimal LPInvestmentAmount1 = resultSet1.getBigDecimal("LPInvestmentAmount");
BigDecimal GPInvestmentAmount1 = resultSet1.getBigDecimal("GPInvestmentAmount");
BigDecimal LhAmount1 = resultSet1.getBigDecimal("LhAmount");
BigDecimal FreeMoney1 = resultSet1.getBigDecimal("FreeMoney");
BigDecimal Bank_loan1 = resultSet1.getBigDecimal("Bank_loan");
BigDecimal BankInvestmentFunds1 = resultSet1.getBigDecimal("BankInvestmentFunds");
BigDecimal FreeInvestment_funds1 = resultSet1.getBigDecimal("FreeInvestment_funds");
BigDecimal Return_On_investment1 = resultSet1.getBigDecimal("Return_On_investment");
BigDecimal Return_on_net_asset_investment1 = resultSet1.getBigDecimal("Return_on_net_asset_investment");
BigDecimal Return_on_total_assets1 = resultSet1.getBigDecimal("Return_on_total_assets");
system.setStudentId(student.getStudentId());
system.setApplicationId(Long.valueOf(applicationId));
system.setUniversitiesCollegesId(student.getOrgId());
system.setState(Long.valueOf(1));
system.setIsDel(1L);
system.setInitialCapital(InitialCapital1);
system.setInitialInvestmentCapital(InitialInvestmentCapital1);
system.setTotalCollectAssets(TotalAssets1);
system.setTotalInvestment(InvestmentFunds1);
system.setLpCollectAssets(LPAmount1);
system.setLpInvestmentAssets(LPInvestmentAmount1);
system.setGlInvestmentAssets(GPInvestmentAmount1);
system.setOwnFunds(FreeMoney1);
system.setBankLoan(Bank_loan1);
system.setBankLoanInvestment(BankInvestmentFunds1);
system.setInvestmentIncome(Return_On_investment1);
system.setNetAssetInvestmentIncome(Return_on_net_asset_investment1);
system.setTotalAssetsIncome(Return_on_total_assets1);
system.setOwnInvestmentAssets(FreeInvestment_funds1);
system.setPoorInvestmentAssets(LhAmount1);
studentAccountEquityInvestmentSystemService.add(system);
}
} else if (applicationName.equals("外汇投资账户")) {
allocationQuery.setApplicationId(Long.valueOf(113));
allocationQuery.setName(AccountTypeEnum.FOREX_INVESTMENT_ACCOUNT);
}
allocationQuery.setUniversitiesCollegesId(student.getOrgId());
allocationQuery.setState(1);
allocationQuery.setInitialCapital(applicationName.equals("外汇投资账户")?new BigDecimal(1000000D):BigDecimal.valueOf(initialCapital));
allocationQuery.setAvailableFunds(applicationName.equals("外汇投资账户")?new BigDecimal(1000000D):BigDecimal.valueOf(AvailableFunds));
allocationQuery.setIntoAccount(applicationId==-1?null:AccountTypeEnum.BANK_ACCOUNT);
allocationQuery.setInitialCapital(applicationName.equals("外汇投资账户") ? new BigDecimal(1000000D) : BigDecimal.valueOf(initialCapital));
allocationQuery.setAvailableFunds(applicationName.equals("外汇投资账户") ? new BigDecimal(1000000D) : BigDecimal.valueOf(AvailableFunds));
allocationQuery.setIntoAccount(applicationId == -1 ? null : AccountTypeEnum.BANK_ACCOUNT);
allocationQuery.setTransferinAmount(BigDecimal.valueOf(transferInAmount));
allocationQuery.setTransferOutAmount(BigDecimal.valueOf(TransferOutAmount));
allocationQuery.setInitialInvestmentCapital(applicationName.equals("外汇投资账户")?new BigDecimal(1000000D):BigDecimal.valueOf(InitialInvestmentCapital));
allocationQuery.setInitialInvestmentCapital(applicationName.equals("外汇投资账户") ? new BigDecimal(1000000D) : BigDecimal.valueOf(InitialInvestmentCapital));
allocationQuery.setBorrowedFunds(BigDecimal.valueOf(Borrowed_Funds));
allocationQuery.setInvestmentFunds(BigDecimal.valueOf(InvestmentFunds));
allocationQuery.setInvestmentValue(BigDecimal.valueOf(Investment_value));
@ -173,11 +476,103 @@ public class AccountController {
allocationQuery.setUpdateVersion(Long.valueOf(-1));
allocationQuery.setIsDel(1);
allocationQuery.setIsInstitution(1);
if(allocationQuery.getName()==null)continue;
if (allocationQuery.getName() == null) continue;
studentAccountAssetAllocationService.add(allocationQuery);
}
closeConn(connection);
}
}
}
public void updateMnjyAccount() throws SQLException {
List<Student> students = studentService.getValues(null);
if (students != null && students.size() > 0) {
for (Student student : students) {
Connection connection = openConn();
String username = student.getStudentSn();
List<StudentAccountMockTradingSystem> valuesByQuery = studentAccountMockTradingSystemService.getByStudentId(student.getStudentId());
for (StudentAccountMockTradingSystem system : valuesByQuery) {
Integer secType = system.getApplicationId() == 16 ? 1 : 4;
String sql = "SELECT\n" +
" \n" +
" top 1" +
" CompetitionId,\n" +
" StudentId,\n" +
" CAST(InitialCapital AS DECIMAL(18, 2)) AS InitialCapital,\n" +
" CAST(TotalAssets AS DECIMAL(18, 2)) AS TotalAssets,\n" +
" CAST(Available AS DECIMAL(18, 2)) AS Available,\n" +
" CAST(Market_value AS DECIMAL(18, 2)) AS Market_value,\n" +
" CAST(Accumulative_total_profit_loss AS DECIMAL(18, 2)) AS Accumulative_total_profit_loss,\n" +
" CAST(Fpnl AS DECIMAL(18, 2)) AS Fpnl,\n" +
" CAST(Cum_Commission AS DECIMAL(18, 2)) AS Cum_Commission,\n" +
" CAST(Pnl_ration AS DECIMAL(18, 2)) AS Pnl_ration,\n" +
" CAST(Benchmark_rate_return AS DECIMAL(18, 2)) AS Benchmark_rate_return,\n" +
" CAST(Pnl_ratio_annual AS DECIMAL(18, 2)) AS Pnl_ratio_annual,\n" +
" CAST(Max_drawdown AS DECIMAL(18, 2)) AS Max_drawdown,\n" +
" CAST(Calmar_ratio AS DECIMAL(18, 2)) AS Calmar_ratio,\n" +
" CAST(Sharp_ratio AS DECIMAL(18, 2)) AS Sharp_ratio,\n" +
" Open_count,\n" +
" Close_count,\n" +
" CAST(Win_ratio AS DECIMAL(18, 2)) AS Win_ratio,\n" +
" Sec_Type\n" +
"FROM EduCompetitionofStudents\n" +
"JOIN EduStudents ON EduCompetitionofStudents.StudentId = EduStudents.Id\n" +
"WHERE EduStudents.StudentNo = '" + username + "'\n" +
" AND CompetitionId = 0\n" +
" AND Sec_Type = " + secType +
" ORDER BY EduCompetitionofStudents.CreationTime DESC";
PreparedStatement ps = connection.prepareStatement(sql);
ResultSet resultSet = ps.executeQuery();
while (resultSet.next()) {
BigDecimal initialCapital = resultSet.getBigDecimal("InitialCapital");
BigDecimal totalAssets = resultSet.getBigDecimal("TotalAssets");
BigDecimal available = resultSet.getBigDecimal("Available");
BigDecimal marketValue = resultSet.getBigDecimal("Market_value");
BigDecimal accumulativeTotalProfitLoss = resultSet.getBigDecimal("Accumulative_total_profit_loss");
BigDecimal fpnl = resultSet.getBigDecimal("Fpnl");
BigDecimal cumCommission = resultSet.getBigDecimal("Cum_Commission");
BigDecimal pnlRation = resultSet.getBigDecimal("Pnl_ration");
BigDecimal benchmarkRateReturn = resultSet.getBigDecimal("Benchmark_rate_return");
BigDecimal pnlRatioAnnual = resultSet.getBigDecimal("Pnl_ratio_annual");
BigDecimal maxDrawdown = resultSet.getBigDecimal("Max_drawdown");
BigDecimal calmarRatio = resultSet.getBigDecimal("Calmar_ratio");
BigDecimal sharpRatio = resultSet.getBigDecimal("Sharp_ratio");
system.setInitialInvestmentCapital(initialCapital);
system.setTotalAssets(totalAssets);
system.setAvailableCapital(available);
system.setMarketValue(marketValue);
system.setCumulativeProfitAndLoss(accumulativeTotalProfitLoss);
system.setAnnualRateOfIncome(pnlRatioAnnual);
system.setKamarRatio(calmarRatio);
system.setSharpeRatio(sharpRatio);
system.setMaximumBacktest(maxDrawdown);
if (totalAssets.compareTo(BigDecimal.ZERO) != 0) {
BigDecimal totalAssetRate = accumulativeTotalProfitLoss.divide(totalAssets);
system.setTotalAssetsIncome(totalAssetRate);
system.setNetAssetsIncome(totalAssetRate);
} else {
system.setTotalAssetsIncome(BigDecimal.ZERO);
system.setNetAssetsIncome(BigDecimal.ZERO);
}
studentAccountMockTradingSystemService.update(system);
StudentAccountAssetAllocationQuery query = new StudentAccountAssetAllocationQuery();
query.setStudentId(student.getStudentId());
query.setApplicationId(system.getApplicationId());
StudentAccountAssetAllocation info = studentAccountAssetAllocationService.getInfo(query);
info.setAvailableFunds(available);
info.setInitialCapital(system.getInitialCapital());
info.setInitialInvestmentCapital(system.getInitialInvestmentCapital());
info.setInvestmentValue(marketValue);
info.setAssetInvestment(system.getTotalAssetsIncome());
info.setReturnOnEquity(system.getNetAssetsIncome());
studentAccountAssetAllocationService.updateTemplate(info);
}
}
}
}
}
}

@ -9,6 +9,8 @@ import lombok.Data;
import org.beetl.sql.annotation.entity.AssignID;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
/*
*
@ -41,40 +43,40 @@ public class StudentAccountCrowdfundingSystemQuery extends BaseEntity{
private Long state ;
@ApiModelProperty("期初资金")
private Long initialCapital ;
private BigDecimal initialCapital ;
@ApiModelProperty("期初投资资金")
private Long initialInvestmentCapital ;
private BigDecimal initialInvestmentCapital ;
@ApiModelProperty("可用余额")
private Long availableBalance ;
private BigDecimal availableBalance ;
@ApiModelProperty("资产总额")
private Long totalAssets ;
private BigDecimal totalAssets ;
@ApiModelProperty("投资总额")
private Long totalInvestment ;
private BigDecimal totalInvestment ;
@ApiModelProperty("众筹总额")
private Long totalCrowdfunding ;
private BigDecimal totalCrowdfunding ;
@ApiModelProperty("冻结总额")
private Long totalFrozen ;
private BigDecimal totalFrozen ;
@ApiModelProperty("累计收益")
private Long cumulativeIncome ;
private BigDecimal cumulativeIncome ;
@ApiModelProperty("自有资金投资收益率")
private Long frozenInvestmentIncome ;
private BigDecimal frozenInvestmentIncome ;
@ApiModelProperty("众筹投资收益率")
private Long crowdfundingFrozenInvestmentIncome ;
private BigDecimal crowdfundingFrozenInvestmentIncome ;
@ApiModelProperty("'修改时间'")
private Long updateTime ;
private Date updateTime ;
@ApiModelProperty("'创建时间'")
private Long createTime ;
private Date createTime ;
@ApiModelProperty("是否删除 1: 正常2: 删除")
private Long isDel ;

@ -9,6 +9,8 @@ import lombok.Data;
import org.beetl.sql.annotation.entity.AssignID;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
/*
*
@ -41,49 +43,52 @@ public class StudentAccountEquityInvestmentSystemQuery extends BaseEntity{
private Long state ;
@ApiModelProperty("期初资金")
private Long initialCapital ;
private BigDecimal initialCapital ;
@ApiModelProperty("期初投资资金")
private Long initialInvestmentCapital ;
private BigDecimal initialInvestmentCapital ;
@ApiModelProperty("总募集资金")
private Long totalCollectAssets ;
private BigDecimal totalCollectAssets ;
@ApiModelProperty("已投资总额")
private Long totalInvestment ;
private BigDecimal totalInvestment ;
@ApiModelProperty("LP募集金额")
private Long lpCollectAssets ;
private BigDecimal lpCollectAssets ;
@ApiModelProperty("LP投资金额")
private Long lpInvestmentAssets ;
private BigDecimal lpInvestmentAssets ;
@ApiModelProperty("GP投资金额")
private Long glInvestmentAssets ;
private BigDecimal glInvestmentAssets ;
@ApiModelProperty("劣后级投资金额")
private BigDecimal poorInvestmentAssets ;
@ApiModelProperty("自有资金")
private Long ownFunds ;
private BigDecimal ownFunds ;
@ApiModelProperty("银行借款")
private Long bankLoan ;
private BigDecimal bankLoan ;
@ApiModelProperty("资金")
private Long investmentAssets ;
@ApiModelProperty("银行借款投资金")
private BigDecimal bankLoanInvestment ;
@ApiModelProperty("投资收益")
private Long investmentIncome ;
private BigDecimal investmentIncome ;
@ApiModelProperty("净资产投资收益率")
private Long netAssetInvestmentIncome ;
private BigDecimal netAssetInvestmentIncome ;
@ApiModelProperty("总资产收益率")
private Long totalAssetsIncome ;
private BigDecimal totalAssetsIncome ;
@ApiModelProperty("自有投资资金")
private BigDecimal ownInvestmentAssets ;
@ApiModelProperty("'修改时间'")
private Long updateTime ;
private Date updateTime ;
@ApiModelProperty("'创建时间'")
private Long createTime ;
private Date createTime ;
@ApiModelProperty("是否删除 1: 正常2: 删除")
private Long isDel ;
@ -122,7 +127,7 @@ public class StudentAccountEquityInvestmentSystemQuery extends BaseEntity{
pojo.setGlInvestmentAssets(this.getGlInvestmentAssets());
pojo.setOwnFunds(this.getOwnFunds());
pojo.setBankLoan(this.getBankLoan());
pojo.setInvestmentAssets(this.getInvestmentAssets());
pojo.setBankLoanInvestment(this.getBankLoanInvestment());
pojo.setInvestmentIncome(this.getInvestmentIncome());
pojo.setNetAssetInvestmentIncome(this.getNetAssetInvestmentIncome());
pojo.setTotalAssetsIncome(this.getTotalAssetsIncome());
@ -132,6 +137,7 @@ public class StudentAccountEquityInvestmentSystemQuery extends BaseEntity{
pojo.setIsInstitution(this.getIsInstitution());
pojo.setUserId(this.getUserId());
pojo.setOrgId(this.getOrgId());
pojo.setPoorInvestmentAssets(this.getPoorInvestmentAssets());
return pojo;
}

@ -9,6 +9,8 @@ import lombok.Data;
import org.beetl.sql.annotation.entity.AssignID;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
/*
*
@ -41,43 +43,43 @@ public class StudentAccountMockTradingSystemQuery extends BaseEntity{
private Long state ;
@ApiModelProperty("期初资金")
private Long initialCapital ;
private BigDecimal initialCapital ;
@ApiModelProperty("期初投资资金")
private Long initialInvestmentCapital ;
private BigDecimal initialInvestmentCapital ;
@ApiModelProperty("总资产")
private Long totalAssets ;
private BigDecimal totalAssets ;
@ApiModelProperty("可用资金")
private Long availableCapital ;
private BigDecimal availableCapital ;
@ApiModelProperty("市值")
private Long marketValue ;
private BigDecimal marketValue ;
@ApiModelProperty("累计盈亏")
private Long cumulativeProfitAndLoss ;
private BigDecimal cumulativeProfitAndLoss ;
@ApiModelProperty("累计收益率")
private Long cumulativeIncome ;
private BigDecimal cumulativeIncome ;
@ApiModelProperty("年化收益率")
private Long annualRateOfIncome ;
private BigDecimal annualRateOfIncome ;
@ApiModelProperty("卡玛比率")
private Long kamarRatio ;
private BigDecimal kamarRatio ;
@ApiModelProperty("夏普比率")
private Long sharpeRatio ;
private BigDecimal sharpeRatio ;
@ApiModelProperty("最大回测")
private Long maximumBacktest ;
private BigDecimal maximumBacktest ;
@ApiModelProperty("'修改时间'")
private Long updateTime ;
private Date updateTime ;
@ApiModelProperty("'创建时间'")
private Long createTime ;
private Date createTime ;
@ApiModelProperty("是否删除 1: 正常2: 删除")
private Long isDel ;

@ -9,6 +9,8 @@ import lombok.Data;
import org.beetl.sql.annotation.entity.AssignID;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
/*
* P2P
@ -41,49 +43,49 @@ public class StudentAccountP2pSystemQuery extends BaseEntity{
private Long state ;
@ApiModelProperty("期初资金")
private Long initialCapital ;
private BigDecimal initialCapital ;
@ApiModelProperty("期初投资资金")
private Long initialInvestmentCapital ;
private BigDecimal initialInvestmentCapital ;
@ApiModelProperty("可用余额")
private Long availableBalance ;
private BigDecimal availableBalance ;
@ApiModelProperty("资产总额")
private Long totalAssets ;
private BigDecimal totalAssets ;
@ApiModelProperty("投资总额")
private Long totalInvestment ;
private BigDecimal totalInvestment ;
@ApiModelProperty("借款总额")
private Long totalBorrow ;
private BigDecimal totalBorrow ;
@ApiModelProperty("冻结资金")
private Long frozenFunds ;
private BigDecimal frozenFunds ;
@ApiModelProperty("累计收益")
private Long cumulativeIncome ;
private BigDecimal cumulativeIncome ;
@ApiModelProperty("总资产收益率")
private Long totalAssetIncome ;
private BigDecimal totalAssetIncome ;
@ApiModelProperty("净资产收益率")
private Long netAssetIncome ;
private BigDecimal netAssetIncome ;
@ApiModelProperty("日投资总金额")
private Long totalDailyInvestmentAmount ;
private BigDecimal totalDailyInvestmentAmount ;
@ApiModelProperty("周投资总金额")
private Long totalAmountWeeklyInvestment ;
private BigDecimal totalAmountWeeklyInvestment ;
@ApiModelProperty("月投资总金额")
private Long totalAmountMonthlyInvestment ;
private BigDecimal totalAmountMonthlyInvestment ;
@ApiModelProperty("'修改时间'")
private Long updateTime ;
private Date updateTime ;
@ApiModelProperty("'创建时间'")
private Long createTime ;
private Date createTime ;
@ApiModelProperty("是否删除 1: 正常2: 删除")
private Long isDel ;

@ -185,3 +185,10 @@ getValuesByQueryNotWithPermission
@if(!isEmpty(orgIdPlural)){
and find_in_set(t.org_id,#orgIdPlural#)
@}
updateByTransfer
===
update student_account_crowdfunding_system set available_balance = #availableFunds#
,initial_capital =#initialCapital# ,initial_investment_capital=#initialInvestmentCapital# , total_assets =#availableFunds# where student_id =#studentId#

@ -202,4 +202,8 @@ getValuesByQueryNotWithPermission
@}
@if(!isEmpty(orgIdPlural)){
and find_in_set(t.org_id,#orgIdPlural#)
@}
@}
updateByTransfer
====
update student_account_equity_investment_system set initial_capital =#initialCapital# ,initial_investment_capital =#initialInvestmentCapital# ,total_assets=#initialInvestmentCapital# , own_funds = #initialInvestmentCapital# where student_id = #studentId#

@ -190,4 +190,15 @@ getValuesByQueryNotWithPermission
@}
@if(!isEmpty(orgIdPlural)){
and find_in_set(t.org_id,#orgIdPlural#)
@}
@}
updateByTransfer
===
update student_account_mock_trading_system set available_capital = #availableFunds#,
initial_capital =#initialCapital# ,initial_investment_capital=#initialInvestmentCapital# , total_assets =#availableFunds# where student_id = #studentId# and application_id=#applicationId#
getByStudentId
===
select * from student_account_mock_trading_system where student_id = #studentId#

@ -0,0 +1,5 @@
updateByTransfer
=======
update student_account_p2p_system set available_balance = #availableFunds#,
initial_capital =#initialCapital# ,initial_investment_capital=#initialInvestmentCapital# ,
total_assets = #availableFunds# where student_id = #studentId#
Loading…
Cancel
Save