1、swagger接口文档

beetlsql3-dev
陈沅
parent adb32a2439
commit e443b4f9fa

@ -25,4 +25,6 @@ public interface StudentAccountMockTradingSystemDao extends BaseMapper<StudentAc
void updateByTransfer(BigDecimal availableFunds, BigDecimal initialCapital, BigDecimal initialInvestmentCapital, Long studentId,Long applicationId);
List<StudentAccountMockTradingSystem> getByStudentId(Long studentId);
StudentAccountMockTradingSystem getByStudentIdAndAppId(Long studentId,Long applicationId);
}

@ -21,7 +21,7 @@ public interface StudentAccountP2pSystemDao extends BaseMapper<StudentAccountP2p
List<StudentAccountP2pSystem> getValuesByQueryNotWithPermission(StudentAccountP2pSystemQuery studentAccountP2pSystemQuery);
void updateByTransfer(BigDecimal availableFunds, BigDecimal initialCapital, BigDecimal initialInvestmentCapital,Long studentId);
void updateByTransfer(BigDecimal availableFunds, BigDecimal initialCapital, BigDecimal initialInvestmentCapital,Long id);
List<StudentAccountP2pSystem> getValuesByQuery(StudentAccountP2pSystemQuery studentAccountP2pSystemQuery);

@ -5,6 +5,7 @@ import cn.hutool.core.util.IdUtil;
import com.ibeetl.jlw.dao.HsValuesDao;
import com.ibeetl.jlw.entity.HsValues;
import com.ibeetl.jlw.util.HttpJsonRequest;
import lombok.extern.slf4j.Slf4j;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
@ -21,6 +22,7 @@ import java.util.List;
@Service
@Transactional
@Slf4j
public class HsValuesService {
@Autowired
@ -33,8 +35,9 @@ public class HsValuesService {
// 每天早上9点执行一次任务
@Scheduled(cron = "0 0 9 * * *")
@Scheduled(cron = "0 */2 * * * *")
public void getHsValues() throws JSONException, ParseException {
log.info("------------------------------------开始执行沪深300数据导入-----------------------------");
LocalDate startTime = LocalDate.now().minusDays(5);
LocalDate endTime = LocalDate.now().plusDays(1);
@ -54,12 +57,12 @@ public class HsValuesService {
String createdAt = jsonObject.getString("created_at");
Date createdDate = dateFormat.parse(createdAt);
String dateString = stringDateFormat.format(createdDate);
if(findByTimeStr(dateString)!=null)
continue;
if (findByTimeStr(dateString) != null)
continue;
HsValues hsValues = new HsValues();
if(jsonObject.has("ratio")){
if (jsonObject.has("ratio")) {
hsValues.setHsValue(Double.valueOf(jsonObject.getString("ratio")));
}else{
} else {
hsValues.setHsValue(0.0);
}
@ -73,7 +76,7 @@ public class HsValuesService {
return hsValuesDao.findByTimeStr(timeStr);
}
public List<HsValues> findAll(){
public List<HsValues> findAll() {
return hsValuesDao.all();
}
}

@ -301,11 +301,12 @@ public class StudentAccountAssetAllocationService extends CoreBaseService<Studen
//开设7个账户现金账户100万银行账户0元其他应用的账户开设但是未被激活没有初始资金
AccountTypeEnum[] values = AccountTypeEnum.values();
UniversitiesColleges universitiesColleges = universitiesCollegesDao.getByOrgId(orgId);
boolean lock = false;
//1: 个人2: 机构
for (int j = 1; j < 3; j++) {
for (int i = 0; i < values.length; i++) {
if(values[i].getText().equals("现金账户"))continue;
if (values[i].getText().equals("现金账户")) continue;
StudentAccountAssetAllocation allocation = new StudentAccountAssetAllocation();
allocation.setStudentId(studentId);
//先默认不开通,条件符合就开通
@ -355,27 +356,30 @@ public class StudentAccountAssetAllocationService extends CoreBaseService<Studen
query.setApplicationSecondLevelRelation("供应链金融服务公司");
}else if(ObjectUtil.equals(values[i].getText(),AccountTypeEnum.FINANCIAL_ACCOUNT.getText())){
} else if (ObjectUtil.equals(values[i].getText(), AccountTypeEnum.FINANCIAL_ACCOUNT.getText())) {
query.setApplicationSecondLevelRelation("智能理财");
}else if(ObjectUtil.equals(values[i].getText(),AccountTypeEnum.FOREX_INVESTMENT_ACCOUNT.getText())){
} else if (ObjectUtil.equals(values[i].getText(), AccountTypeEnum.FOREX_INVESTMENT_ACCOUNT.getText())) {
query.setApplicationSecondLevelRelation("外汇");
}
if (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.BANK_ACCOUNT.getText()) ? -2L : -1L);
allocation.setInitialCapital(ObjectUtil.equals(values[i].getText(), AccountTypeEnum.CASH_ACCOUNT.getText()) ?
allocation.setInitialCapital(ObjectUtil.equals(values[i].getText(), AccountTypeEnum.BANK_ACCOUNT.getText()) ?
new BigDecimal(2000000) : BigDecimal.ZERO);
allocation.setAvailableFunds(ObjectUtil.equals(values[i].getText(), AccountTypeEnum.CASH_ACCOUNT.getText()) ?
allocation.setAvailableFunds(ObjectUtil.equals(values[i].getText(), AccountTypeEnum.BANK_ACCOUNT.getText()) ?
new BigDecimal(2000000) : BigDecimal.ZERO);
allocation.setInitialInvestmentCapital(ObjectUtil.equals(values[i].getText(), AccountTypeEnum.CASH_ACCOUNT.getText()) ?
allocation.setInitialInvestmentCapital(ObjectUtil.equals(values[i].getText(), AccountTypeEnum.BANK_ACCOUNT.getText()) ?
new BigDecimal(2000000) : BigDecimal.ZERO);
} else {
if (ObjectUtil.isNotNull(query.getApplicationSecondLevelRelation())) {
List<ResourcesApplication> applications = resourcesApplicationDao.getValuesByQuery(query);
if (CollectionUtil.isNotEmpty(applications)) {
allocation.setApplicationId(applications.get(0).getResourcesApplicationId());
if (lock && applications.get(0).getResourcesApplicationId() == 16) {
allocation.setApplicationId(-16L);
} else {
allocation.setApplicationId(applications.get(0).getResourcesApplicationId());
}
List<UniversitiesCollegesJurisdictionExperimentalSystem> experimentalSystems = universitiesCollegesJurisdictionExperimentalSystemDao.getNotExpireApply(orgId, applications.get(0).getResourcesApplicationId().toString());
allocation.setState(CollectionUtil.isNotEmpty(experimentalSystems) ? 2 : 1);
Double money = 0D;
@ -402,7 +406,7 @@ public class StudentAccountAssetAllocationService extends CoreBaseService<Studen
money = 2000000D;
} else if (values[i].getText().equals(AccountTypeEnum.FINANCIAL_ACCOUNT.getText())) {
money = 2000000D;
}else if(values[i].getText().equals(AccountTypeEnum.INSURANCE_ACCOUNT.getText())){
} else if (values[i].getText().equals(AccountTypeEnum.INSURANCE_ACCOUNT.getText())) {
money = 2000000D;
}
allocation.setInitialCapital(CollectionUtil.isNotEmpty(experimentalSystems) ?
@ -416,8 +420,6 @@ public class StudentAccountAssetAllocationService extends CoreBaseService<Studen
}
}
}
allocation.setUniversitiesCollegesId(universitiesColleges.getUniversitiesCollegesId());
allocation.setName(values[i]);
allocation.setUpdateTime(new Date());
@ -427,6 +429,83 @@ public class StudentAccountAssetAllocationService extends CoreBaseService<Studen
allocation.setUpdateVersion(-1L);
allocation.setIsInstitution(j);
studentAccountAssetAllocationDao.insert(allocation);
if (allocation != null&&allocation.getApplicationId()!=null) {
if (allocation.getApplicationId() == 4 && j == 1) {
StudentAccountP2pSystem p2pSystem = new StudentAccountP2pSystem();
p2pSystem.setStudentId(studentId);
p2pSystem.setApplicationId(4L);
p2pSystem.setUniversitiesCollegesId(universitiesColleges.getUniversitiesCollegesId());
p2pSystem.setState(Long.valueOf(allocation.getState()));
p2pSystem.setInitialInvestmentCapital(new BigDecimal(2000000));
p2pSystem.setAvailableBalance(new BigDecimal(2000000));
p2pSystem.setInitialCapital(new BigDecimal(2000000));
p2pSystem.setTotalAssets(new BigDecimal(2000000));
p2pSystem.setIsDel(1L);
p2pSystem.setIsInstitution(1L);
p2pSystem.setUserId(allocation.getUserId());
studentAccountP2pSystemService.add(p2pSystem);
} else if (allocation.getApplicationId() == 5 && j == 1) {
StudentAccountCrowdfundingSystem crowdfundingSystem = new StudentAccountCrowdfundingSystem();
crowdfundingSystem.setStudentId(studentId);
crowdfundingSystem.setApplicationId(5L);
crowdfundingSystem.setUniversitiesCollegesId(universitiesColleges.getUniversitiesCollegesId());
crowdfundingSystem.setState(Long.valueOf(allocation.getState()));
crowdfundingSystem.setInitialInvestmentCapital(new BigDecimal(2000000));
crowdfundingSystem.setAvailableBalance(new BigDecimal(2000000));
crowdfundingSystem.setInitialCapital(new BigDecimal(2000000));
crowdfundingSystem.setTotalAssets(new BigDecimal(2000000));
crowdfundingSystem.setIsDel(1L);
crowdfundingSystem.setIsInstitution(1L);
crowdfundingSystem.setUserId(allocation.getUserId());
studentAccountCrowdfundingSystemService.add(crowdfundingSystem);
} else if (allocation.getApplicationId() == 16 && j == 1 && !lock) {
lock = true;
StudentAccountMockTradingSystem mockTradingSystem = new StudentAccountMockTradingSystem();
mockTradingSystem.setStudentId(studentId);
mockTradingSystem.setApplicationId(16L);
mockTradingSystem.setUniversitiesCollegesId(universitiesColleges.getUniversitiesCollegesId());
mockTradingSystem.setState(Long.valueOf(allocation.getState()));
mockTradingSystem.setInitialInvestmentCapital(new BigDecimal(2000000));
mockTradingSystem.setAvailableCapital(new BigDecimal(2000000));
mockTradingSystem.setInitialCapital(new BigDecimal(2000000));
mockTradingSystem.setTotalAssets(new BigDecimal(2000000));
mockTradingSystem.setIsDel(1L);
mockTradingSystem.setIsInstitution(1L);
mockTradingSystem.setUserId(allocation.getUserId());
studentAccountMockTradingSystemService.add(mockTradingSystem);
StudentAccountMockTradingSystem mockTradingSystem1 = new StudentAccountMockTradingSystem();
mockTradingSystem1.setStudentId(studentId);
mockTradingSystem1.setApplicationId(-16L);
mockTradingSystem1.setUniversitiesCollegesId(universitiesColleges.getUniversitiesCollegesId());
mockTradingSystem1.setState(Long.valueOf(allocation.getState()));
mockTradingSystem1.setInitialInvestmentCapital(new BigDecimal(2000000));
mockTradingSystem1.setAvailableCapital(new BigDecimal(2000000));
mockTradingSystem1.setInitialCapital(new BigDecimal(2000000));
mockTradingSystem1.setTotalAssets(new BigDecimal(2000000));
mockTradingSystem1.setIsDel(1L);
mockTradingSystem1.setIsInstitution(1L);
mockTradingSystem1.setUserId(allocation.getUserId());
studentAccountMockTradingSystemService.add(mockTradingSystem1);
} else if (allocation.getApplicationId() == 18 && j == 1) {
StudentAccountEquityInvestmentSystem investmentSystem = new StudentAccountEquityInvestmentSystem();
investmentSystem.setStudentId(studentId);
investmentSystem.setApplicationId(18L);
investmentSystem.setUniversitiesCollegesId(universitiesColleges.getUniversitiesCollegesId());
investmentSystem.setState(Long.valueOf(allocation.getState()));
investmentSystem.setInitialInvestmentCapital(new BigDecimal(2000000));
investmentSystem.setOwnFunds(new BigDecimal(2000000));
investmentSystem.setInitialCapital(new BigDecimal(2000000));
investmentSystem.setIsDel(1L);
investmentSystem.setIsInstitution(1L);
investmentSystem.setUserId(allocation.getUserId());
studentAccountEquityInvestmentSystemService.add(investmentSystem);
}
}
}
}
@ -497,7 +576,7 @@ public class StudentAccountAssetAllocationService extends CoreBaseService<Studen
resourcesApplicationQuery.setApplicationSecondLevelRelation("供应链金融服务公司");
}else if(ObjectUtil.equals(accountAssetAllocation.getName().getText(),AccountTypeEnum.FINANCIAL_ACCOUNT.getText())){
} else if (ObjectUtil.equals(accountAssetAllocation.getName().getText(), AccountTypeEnum.FINANCIAL_ACCOUNT.getText())) {
resourcesApplicationQuery.setApplicationSecondLevelRelation("智能理财");
}
@ -617,12 +696,20 @@ public class StudentAccountAssetAllocationService extends CoreBaseService<Studen
outAccountAssetAllocation.setAvailableFunds(availableFunds.subtract(transfer));
outAccountAssetAllocation.setInitialInvestmentCapital(outAccountAssetAllocation.getApplicationId() == -1 ? availableFunds : availableFunds.subtract(transfer));
if (outAccountAssetAllocation.getTransferOutAmount() == null) {
outAccountAssetAllocation.setTransferOutAmount(BigDecimal.ZERO);
}
outAccountAssetAllocation.setTransferOutAmount(outAccountAssetAllocation.getTransferOutAmount().add(transfer));
studentAccountAssetAllocationDao.updateById(outAccountAssetAllocation);
toAccountAssetAllocation.setInitialInvestmentCapital(toAccountAssetAllocation.getTransferOutAmount().add(transfer));
toAccountAssetAllocation.setAvailableFunds(toAccountAssetAllocation.getTransferOutAmount().add(transfer));
if (toAccountAssetAllocation.getTransferOutAmount() == null) {
toAccountAssetAllocation.setTransferOutAmount(BigDecimal.ZERO);
}
if (toAccountAssetAllocation.getTransferinAmount() == null) {
toAccountAssetAllocation.setTransferinAmount(BigDecimal.ZERO);
}
toAccountAssetAllocation.setInitialInvestmentCapital(toAccountAssetAllocation.getInitialInvestmentCapital().add(transfer));
toAccountAssetAllocation.setAvailableFunds(toAccountAssetAllocation.getAvailableFunds().add(transfer));
toAccountAssetAllocation.setTransferinAmount(toAccountAssetAllocation.getTransferinAmount().add(transfer));
studentAccountAssetAllocationDao.updateById(toAccountAssetAllocation);
@ -650,7 +737,7 @@ public class StudentAccountAssetAllocationService extends CoreBaseService<Studen
updateQuery.setStudentId(studentId);
List<StudentAccountAssetAllocation> updateAccount = studentAccountAssetAllocationDao.getValuesByQuery(updateQuery);
StudentAccountAssetAllocation allocation = updateAccount.get(0);
studentAccountEquityInvestmentSystemService.updateByTransfer(allocation.getInitialCapital(), allocation.getInitialInvestmentCapital(),
studentAccountEquityInvestmentSystemService.updateByTransfer(allocation.getAvailableFunds(),allocation.getInitialCapital(), allocation.getInitialInvestmentCapital(),
allocation.getInitialInvestmentCapital(), allocation.getInitialInvestmentCapital(), studentId);
}
if (outAccountAssetAllocation.getApplicationId() == 4 || toAccountAssetAllocation.getApplicationId() == 4) {
@ -658,7 +745,7 @@ public class StudentAccountAssetAllocationService extends CoreBaseService<Studen
}
if (outAccountAssetAllocation.getApplicationId() == 5 || toAccountAssetAllocation.getApplicationId() == 5) {
updateStudentAccountByApplicationId(studentId, 4);
updateStudentAccountByApplicationId(studentId, 5);
}
if (outAccountAssetAllocation.getApplicationId() == 16 || toAccountAssetAllocation.getApplicationId() == 16) {

@ -4,6 +4,7 @@ import com.ibeetl.admin.core.service.CoreBaseService;
import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.jlw.dao.StudentAccountCrowdfundingSystemDao;
import com.ibeetl.jlw.entity.StudentAccountCrowdfundingSystem;
import com.ibeetl.jlw.entity.StudentAccountP2pSystem;
import com.ibeetl.jlw.web.query.StudentAccountCrowdfundingSystemQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -52,7 +53,11 @@ public class StudentAccountCrowdfundingSystemService extends CoreBaseService<Stu
}
public void updateByTransfer(BigDecimal availableFunds, BigDecimal initialCapital, BigDecimal initialInvestmentCapital,Long studentId) {
studentAccountCrowdfundingSystemDao.updateByTransfer(availableFunds,initialCapital,initialInvestmentCapital,studentId);
StudentAccountCrowdfundingSystem system = studentAccountCrowdfundingSystemDao.getInfoByStudentId(studentId);
system.setAvailableBalance(availableFunds);
system.setInitialCapital(initialCapital);
system.setInitialInvestmentCapital(initialInvestmentCapital);
studentAccountCrowdfundingSystemDao.updateTemplateById(system);
}
public StudentAccountCrowdfundingSystem getInfo(Long studentId) {

@ -58,7 +58,17 @@ public class StudentAccountEquityInvestmentSystemService extends CoreBaseService
return studentAccountEquityInvestmentSystemDao.getInfo(studentId);
}
public void updateByTransfer(BigDecimal initialCapital, BigDecimal initialInvestmentCapital, BigDecimal totalAssets, BigDecimal freeMoney, Long studentId){
public void updateByTransfer(BigDecimal ownFunds, BigDecimal initialCapital, BigDecimal initialInvestmentCapital, BigDecimal totalAssets, BigDecimal freeMoney, Long studentId){
List<StudentAccountEquityInvestmentSystem> info = studentAccountEquityInvestmentSystemDao.getInfo(studentId);
if(info!=null){
StudentAccountEquityInvestmentSystem system = info.get(0);
system.setOwnFunds(ownFunds);
system.setInitialCapital(initialCapital);
system.setInitialInvestmentCapital(initialInvestmentCapital);
studentAccountEquityInvestmentSystemDao.updateTemplateById(system);
}
studentAccountEquityInvestmentSystemDao.updateByTransfer(initialCapital,initialInvestmentCapital,totalAssets,freeMoney,studentId);
}

@ -42,7 +42,7 @@ public class StudentAccountMockTradingSystemService extends CoreBaseService<Stud
studentAccountMockTradingSystemDao.insert(p2pSystem);
}
public List<StudentAccountMockTradingSystem> getByStudentId(Long studentId){
public List<StudentAccountMockTradingSystem> getByStudentId(Long studentId) {
return studentAccountMockTradingSystemDao.getByStudentId(studentId);
}
@ -51,15 +51,19 @@ public class StudentAccountMockTradingSystemService extends CoreBaseService<Stud
studentAccountMockTradingSystemDao.insert(studentAccountMockTradingSystem);
}
public boolean update(StudentAccountMockTradingSystem system){
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);
public void updateByTransfer(BigDecimal availableFunds, BigDecimal initialCapital, BigDecimal initialInvestmentCapital, Long studentId, Long applicationId) {
StudentAccountMockTradingSystem system = studentAccountMockTradingSystemDao.getByStudentIdAndAppId(studentId, applicationId);
system.setAvailableCapital(availableFunds);
system.setInitialCapital(initialCapital);
system.setInitialInvestmentCapital(initialInvestmentCapital);
studentAccountMockTradingSystemDao.updateTemplateById(system);
}
}

@ -51,8 +51,11 @@ public class StudentAccountP2pSystemService extends CoreBaseService<StudentAccou
}
public void updateByTransfer(BigDecimal availableFunds, BigDecimal initialCapital, BigDecimal initialInvestmentCapital,Long studentId) {
studentAccountP2pSystemDao.updateByTransfer(availableFunds,initialCapital,initialInvestmentCapital,studentId);
StudentAccountP2pSystem p2pSystem = studentAccountP2pSystemDao.getValuesByStudentId(studentId);
p2pSystem.setAvailableBalance(availableFunds);
p2pSystem.setInitialInvestmentCapital(initialInvestmentCapital);
p2pSystem.setInitialCapital(initialCapital);
studentAccountP2pSystemDao.updateTemplateById(p2pSystem);
}

@ -201,4 +201,8 @@ initial_capital =#initialCapital# ,initial_investment_capital=#initialInvestment
getByStudentId
===
select * from student_account_mock_trading_system where student_id = #studentId#
select * from student_account_mock_trading_system where student_id = #studentId#
getByStudentIdAndAppId
===
select * from student_account_mock_trading_system where student_id = #studentId# and application_id = #applicationId#

@ -2,7 +2,7 @@ updateByTransfer
=======
update student_account_p2p_system set available_balance = #availableFunds#,
initial_capital =#initialCapital# ,initial_investment_capital=#initialInvestmentCapital# ,
total_assets = #availableFunds# where student_id = #studentId#
total_assets = #availableFunds# where id = #id#
getValuesByStudentId

Loading…
Cancel
Save