From e443b4f9fab7ba34c71391cb34909f8bf749fb8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=B2=85?= <907037276@qq.com> Date: Wed, 27 Dec 2023 22:34:24 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81swagger=E6=8E=A5=E5=8F=A3=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StudentAccountMockTradingSystemDao.java | 2 + .../jlw/dao/StudentAccountP2pSystemDao.java | 2 +- .../ibeetl/jlw/service/HsValuesService.java | 15 ++- .../StudentAccountAssetAllocationService.java | 123 +++++++++++++++--- ...udentAccountCrowdfundingSystemService.java | 7 +- ...tAccountEquityInvestmentSystemService.java | 12 +- ...tudentAccountMockTradingSystemService.java | 12 +- .../StudentAccountP2pSystemService.java | 7 +- .../jlw/studentAccountMockTradingSystem.md | 6 +- .../sql/jlw/studentAccountP2pSystem.md | 2 +- 10 files changed, 153 insertions(+), 35 deletions(-) diff --git a/web/src/main/java/com/ibeetl/jlw/dao/StudentAccountMockTradingSystemDao.java b/web/src/main/java/com/ibeetl/jlw/dao/StudentAccountMockTradingSystemDao.java index db0f6c2c..f75b3ea2 100644 --- a/web/src/main/java/com/ibeetl/jlw/dao/StudentAccountMockTradingSystemDao.java +++ b/web/src/main/java/com/ibeetl/jlw/dao/StudentAccountMockTradingSystemDao.java @@ -25,4 +25,6 @@ public interface StudentAccountMockTradingSystemDao extends BaseMapper getByStudentId(Long studentId); + + StudentAccountMockTradingSystem getByStudentIdAndAppId(Long studentId,Long applicationId); } diff --git a/web/src/main/java/com/ibeetl/jlw/dao/StudentAccountP2pSystemDao.java b/web/src/main/java/com/ibeetl/jlw/dao/StudentAccountP2pSystemDao.java index 6081f359..b7632541 100644 --- a/web/src/main/java/com/ibeetl/jlw/dao/StudentAccountP2pSystemDao.java +++ b/web/src/main/java/com/ibeetl/jlw/dao/StudentAccountP2pSystemDao.java @@ -21,7 +21,7 @@ public interface StudentAccountP2pSystemDao extends BaseMapper getValuesByQueryNotWithPermission(StudentAccountP2pSystemQuery studentAccountP2pSystemQuery); - void updateByTransfer(BigDecimal availableFunds, BigDecimal initialCapital, BigDecimal initialInvestmentCapital,Long studentId); + void updateByTransfer(BigDecimal availableFunds, BigDecimal initialCapital, BigDecimal initialInvestmentCapital,Long id); List getValuesByQuery(StudentAccountP2pSystemQuery studentAccountP2pSystemQuery); diff --git a/web/src/main/java/com/ibeetl/jlw/service/HsValuesService.java b/web/src/main/java/com/ibeetl/jlw/service/HsValuesService.java index 02615dbe..645c0d5b 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/HsValuesService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/HsValuesService.java @@ -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 findAll(){ + public List findAll() { return hsValuesDao.all(); } } diff --git a/web/src/main/java/com/ibeetl/jlw/service/StudentAccountAssetAllocationService.java b/web/src/main/java/com/ibeetl/jlw/service/StudentAccountAssetAllocationService.java index 86d88937..6a239c1f 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/StudentAccountAssetAllocationService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/StudentAccountAssetAllocationService.java @@ -301,11 +301,12 @@ public class StudentAccountAssetAllocationService extends CoreBaseService 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 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 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 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); } diff --git a/web/src/main/java/com/ibeetl/jlw/service/StudentAccountMockTradingSystemService.java b/web/src/main/java/com/ibeetl/jlw/service/StudentAccountMockTradingSystemService.java index 31d3e1ba..2ba1046b 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/StudentAccountMockTradingSystemService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/StudentAccountMockTradingSystemService.java @@ -42,7 +42,7 @@ public class StudentAccountMockTradingSystemService extends CoreBaseService getByStudentId(Long studentId){ + public List getByStudentId(Long studentId) { return studentAccountMockTradingSystemDao.getByStudentId(studentId); } @@ -51,15 +51,19 @@ public class StudentAccountMockTradingSystemService extends CoreBaseService