From 1950343e20b33dae87918e967bce949052961acc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=B2=85?= <907037276@qq.com> Date: Mon, 25 Dec 2023 11:44:31 +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 --- .../jlw/dao/StudentAccountAssetAllocationDao.java | 2 ++ .../java/com/ibeetl/jlw/enums/AccountTypeEnum.java | 2 +- .../StudentAccountAssetAllocationService.java | 13 ++++++++++++- .../jlw/service/api/student/ApiStudentService.java | 8 ++++---- .../sql/jlw/studentAccountAssetAllocation.md | 9 ++++++++- 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/web/src/main/java/com/ibeetl/jlw/dao/StudentAccountAssetAllocationDao.java b/web/src/main/java/com/ibeetl/jlw/dao/StudentAccountAssetAllocationDao.java index 74ab2103..d98de70c 100644 --- a/web/src/main/java/com/ibeetl/jlw/dao/StudentAccountAssetAllocationDao.java +++ b/web/src/main/java/com/ibeetl/jlw/dao/StudentAccountAssetAllocationDao.java @@ -33,4 +33,6 @@ public interface StudentAccountAssetAllocationDao extends BaseMapper getInfo(Long studentId); + + List getInfoByStudentIdAnIsInstitution(Long studentId); } diff --git a/web/src/main/java/com/ibeetl/jlw/enums/AccountTypeEnum.java b/web/src/main/java/com/ibeetl/jlw/enums/AccountTypeEnum.java index eabd511d..04922418 100644 --- a/web/src/main/java/com/ibeetl/jlw/enums/AccountTypeEnum.java +++ b/web/src/main/java/com/ibeetl/jlw/enums/AccountTypeEnum.java @@ -44,7 +44,7 @@ public enum AccountTypeEnum { /**银行账户*/ BANK_ACCOUNT("银行账户"), /**P2P账户*/ - P2P_ACCOUNT("P2P账户"), + P2P_ACCOUNT("网络融资账户"), /**众筹账户*/ CROWDFUNDING_ACCOUNT("众筹账户"), /**股票基金投资账户*/ 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 2ca90205..fd78f410 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/StudentAccountAssetAllocationService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/StudentAccountAssetAllocationService.java @@ -305,6 +305,7 @@ public class StudentAccountAssetAllocationService extends CoreBaseService getInfoByStudentIdAnIsInstitution(Long studentId) { + return studentAccountAssetAllocationDao.getInfoByStudentIdAnIsInstitution(studentId); + } + public static String sendPostRequest(String url, String postData) { try { URL apiUrl = new URL(url); diff --git a/web/src/main/java/com/ibeetl/jlw/service/api/student/ApiStudentService.java b/web/src/main/java/com/ibeetl/jlw/service/api/student/ApiStudentService.java index 811e2d54..d835f736 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/api/student/ApiStudentService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/api/student/ApiStudentService.java @@ -109,7 +109,7 @@ public class ApiStudentService { //饼状图数据 //todo 查询数据库 - List studentAccountAssetAllocations = studentAccountAssetAllocationService.getInfoByStudentId(studentId); + List studentAccountAssetAllocations = studentAccountAssetAllocationService.getInfoByStudentIdAnIsInstitution(studentId); List> pieMaps = new ArrayList<>(); for (StudentAccountAssetAllocation allocation : studentAccountAssetAllocations) { if (allocation.getName().getText().equals("现金账户")) { @@ -118,14 +118,14 @@ public class ApiStudentService { Map map = new HashMap<>(); if (allocation.getName().getText().equals("银行账户")) { map.put("name", allocation.getName().getText()); - map.put("value", allocation.getAvailableFunds()); + map.put("value", allocation.getAvailableFunds()==null?0:allocation.getAvailableFunds()); } else { if (allocation.getName().getText().equals("P2P账户")) { map.put("name", "网络融资账户"); - map.put("value", allocation.getTotalAssetsOfSubAccounts()); + map.put("value", allocation.getTotalAssetsOfSubAccounts()==null?0:allocation.getTotalAssetsOfSubAccounts()); } else { map.put("name", allocation.getName().getText()); - map.put("value", allocation.getTotalAssetsOfSubAccounts()); + map.put("value", allocation.getTotalAssetsOfSubAccounts()==null?0:allocation.getTotalAssetsOfSubAccounts()); } } pieMaps.add(map); diff --git a/web/src/main/resources/sql/jlw/studentAccountAssetAllocation.md b/web/src/main/resources/sql/jlw/studentAccountAssetAllocation.md index cbdb1c4e..99d76dd2 100644 --- a/web/src/main/resources/sql/jlw/studentAccountAssetAllocation.md +++ b/web/src/main/resources/sql/jlw/studentAccountAssetAllocation.md @@ -657,6 +657,9 @@ getValuesByQuery @if(!isEmpty(orgId)){ and t.org_id =#orgId# @} + @if(!isEmpty(isInstitution)){ + and t.is_institution = #isInstitution# + @} @if(!isEmpty(orgIdPlural)){ and find_in_set(t.org_id,#orgIdPlural#) @} @@ -780,4 +783,8 @@ application_id =#applicationId# and student_id=#studentId# getInfo === - select * from student_account_asset_allocation where student_id=#studentId# \ No newline at end of file + select * from student_account_asset_allocation where student_id=#studentId# + +getInfoByStudentIdAnIsInstitution +=== +select * from student_account_asset_allocation where student_id=#studentId# and is_institution =1 \ No newline at end of file