From 3db1ec92237cabbf7e58cc4a8f50014e3fa34b52 Mon Sep 17 00:00:00 2001
From: chenyuan <907037276@qq.com>
Date: Sun, 28 Apr 2024 17:54:13 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AD=90=E7=B3=BB=E7=BB=9F?=
 =?UTF-8?q?=E7=94=A8=E6=88=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../api/student/ApiStudentService.java        |   3 +
 ...udentAccountAssetAllocationController.java | 128 ++++++++++--------
 2 files changed, 74 insertions(+), 57 deletions(-)

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 2d5b8707..bb9fb599 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
@@ -131,6 +131,9 @@ public class ApiStudentService {
             if (allocation.getName().getText().equals("现金账户")) {
                 continue;
             }
+            if(allocation.getApplicationId()==null||allocation.getApplicationId()==6){
+                continue;
+            }
             Map<String, Object> map = new HashMap<>();
             if (allocation.getName().getText().equals("银行账户")) {
                 map.put("name", allocation.getName().getText());
diff --git a/web/src/main/java/com/ibeetl/jlw/web/StudentAccountAssetAllocationController.java b/web/src/main/java/com/ibeetl/jlw/web/StudentAccountAssetAllocationController.java
index dbc01ff3..d0fcd512 100644
--- a/web/src/main/java/com/ibeetl/jlw/web/StudentAccountAssetAllocationController.java
+++ b/web/src/main/java/com/ibeetl/jlw/web/StudentAccountAssetAllocationController.java
@@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
 
 import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.List;
 
 import static com.ibeetl.admin.core.util.user.CacheUserUtil.getUser;
@@ -36,57 +37,59 @@ import static com.ibeetl.admin.core.util.user.CacheUserUtil.getUser;
 @RestController
 @Validated
 @Api(tags = {"资产账户管理 学生资产账户 接口"})
-public class StudentAccountAssetAllocationController{
+public class StudentAccountAssetAllocationController {
 
     private final Log log = LogFactory.getLog(this.getClass());
     private static final String MODEL = "/jlw/studentAccountAssetAllocation";
     private static final String API = "/api/studentAccountAssetAllocation";
 
 
-    @Autowired private StudentAccountAssetAllocationService studentAccountAssetAllocationService;
+    @Autowired
+    private StudentAccountAssetAllocationService studentAccountAssetAllocationService;
 
-    @Autowired FileService fileService;
+    @Autowired
+    FileService fileService;
 
     /* 前端接口 */
 
 
     @GetMapping(API + "/allOpenAccount.do")
     @ApiOperation("激活该校的所有学生用户的股票/期货账户")
-    public JsonResult<String> allOpenAccount(Long orgId,@SCoreUser CoreUser coreUser) {
-        if(null == coreUser){
+    public JsonResult<String> allOpenAccount(Long orgId, @SCoreUser CoreUser coreUser) {
+        if (null == coreUser) {
             return JsonResult.failMessage("请登录后再操作");
-        }else{
+        } else {
             studentAccountAssetAllocationService.allOpenAccount(orgId);
-            return  JsonResult.success("操作成功");
+            return JsonResult.success("操作成功");
         }
     }
 
     @PostMapping(API + "/allOpenAccount.do")
     @ApiOperation("转账")
-    public JsonResult<String> transferAccounts(Long toAccountsApplicationId, Long outAccountsApplicationId, BigDecimal money,Long studentId, @SCoreUser CoreUser coreUser) {
-        if(null == coreUser){
+    public JsonResult<String> transferAccounts(Long toAccountsApplicationId, Long outAccountsApplicationId, BigDecimal money, Long studentId, @SCoreUser CoreUser coreUser) {
+        if (null == coreUser) {
             return JsonResult.failMessage("请登录后再操作");
-        }else{
-            return  studentAccountAssetAllocationService.transferAccounts(toAccountsApplicationId, outAccountsApplicationId ,money , studentId,coreUser);
+        } else {
+            return studentAccountAssetAllocationService.transferAccounts(toAccountsApplicationId, outAccountsApplicationId, money, studentId, coreUser);
         }
     }
 
     @GetMapping(API + "/getCapitalAccount.do")
     @ApiOperation("获取转账账户")
     public JsonResult<List<StudentAccountAssetAllocation>> getCapitalAccount(Long studentId, @SCoreUser CoreUser coreUser) {
-        if(null == coreUser){
+        if (null == coreUser) {
             return JsonResult.failMessage("请登录后再操作");
-        }else{
+        } else {
             return JsonResult.success(studentAccountAssetAllocationService.getCapitalAccount(studentId));
         }
     }
 
     @PostMapping(API + "/getPageList.do")
     @ApiOperation("分页列表")
-    public JsonResult<PageQuery> getPageList(StudentAccountAssetAllocationQuery condition,@SCoreUser CoreUser coreUser){
-        if(null == coreUser){
+    public JsonResult<PageQuery> getPageList(StudentAccountAssetAllocationQuery condition, @SCoreUser CoreUser coreUser) {
+        if (null == coreUser) {
             return JsonResult.failMessage("请登录后再操作");
-        }else{
+        } else {
             PageQuery page = condition.getPageQuery();
             studentAccountAssetAllocationService.queryByConditionQuery(page);
             return JsonResult.success(page);
@@ -96,32 +99,41 @@ public class StudentAccountAssetAllocationController{
 
     @GetMapping(API + "/getInfo.do")
     @ApiOperation("获取数据")
-    public JsonResult<StudentAccountAssetAllocation>getInfo(StudentAccountAssetAllocationQuery param,@SCoreUser CoreUser coreUser) {
-        if(null == coreUser){
+    public JsonResult<StudentAccountAssetAllocation> getInfo(StudentAccountAssetAllocationQuery param, @SCoreUser CoreUser coreUser) {
+        if (null == coreUser) {
             return JsonResult.failMessage("请登录后再操作");
-        }else{
+        } else {
             StudentAccountAssetAllocation studentAccountAssetAllocation = studentAccountAssetAllocationService.getInfo(param);
-            return  JsonResult.success(studentAccountAssetAllocation);
+            return JsonResult.success(studentAccountAssetAllocation);
         }
     }
 
 
     @GetMapping(API + "/getList.do")
     @ApiOperation("列表")
-    public JsonResult<List<StudentAccountAssetAllocation>>getList(StudentAccountAssetAllocationQuery param,@SCoreUser CoreUser coreUser) {
-        if(null == coreUser){
+    public JsonResult<List<StudentAccountAssetAllocation>> getList(StudentAccountAssetAllocationQuery param, @SCoreUser CoreUser coreUser) {
+        if (null == coreUser) {
             return JsonResult.failMessage("请登录后再操作");
-        }else{
-            List<StudentAccountAssetAllocation>list = studentAccountAssetAllocationService.getValuesByQuery(param);
-            return  JsonResult.success(list);
+        } else {
+            List<StudentAccountAssetAllocation> list = studentAccountAssetAllocationService.getValuesByQuery(param);
+            List<StudentAccountAssetAllocation> result = new ArrayList<>();
+            if (list != null && list.size() > 0) {
+                for (StudentAccountAssetAllocation item : list) {
+                    if (item.getApplicationId() == null || item.getApplicationId() == 6)
+                        continue;
+                    result.add(item);
+                }
+            }
+            return JsonResult.success(result);
         }
     }
 
     /**
      * 需要对外暴露,不需要权限控制
      * 通过token修改资金账户信息
-     * @param applicationToken      跳转时候,传递的token
-     * @param param                 资金账户参数
+     *
+     * @param applicationToken 跳转时候,传递的token
+     * @param param            资金账户参数
      * @return
      */
     @PostMapping(API + "/externalApi/updateByApplicationToken.do")
@@ -136,22 +148,24 @@ public class StudentAccountAssetAllocationController{
     /**
      * 需要对外暴露,不需要权限控制
      * 通过token获取资金账户信息
-     * @param applicationToken      跳转时候,传递的token
-     * @param param                 资金账户参数
+     *
+     * @param applicationToken 跳转时候,传递的token
+     * @param param            资金账户参数
      * @return
      */
     @PostMapping(API + "/externalApi/getByApplicationToken.do")
     @ResponseBody
     @ApiOperation("通过token获取资金账户信息")
     public JsonResult<List<StudentAccountAssetAllocation>> getByApplicationToken(@RequestParam("applicationToken") String applicationToken,
-                                               @RequestBody StudentAccountAssetAllocationQuery param) {
+                                                                                 @RequestBody StudentAccountAssetAllocationQuery param) {
         return JsonResult.success(studentAccountAssetAllocationService.getByApplicationToken(applicationToken, param));
     }
 
     /**
      * 需要对外暴露,不需要权限控制
      * 通过token获取应用绑定的课程信息
-     * @param applicationToken      跳转时候,传递的token
+     *
+     * @param applicationToken 跳转时候,传递的token
      * @return
      */
     @PostMapping(API + "/externalApi/getApplicationBindCourseInfo.do")
@@ -168,7 +182,7 @@ public class StudentAccountAssetAllocationController{
     @Function("studentAccountAssetAllocation.query")
     @ApiOperation("后台系统管理界面")
     public ModelAndView index() {
-        ModelAndView view = new ModelAndView("/jlw/studentAccountAssetAllocation/index.html") ;
+        ModelAndView view = new ModelAndView("/jlw/studentAccountAssetAllocation/index.html");
         view.addObject("search", StudentAccountAssetAllocationQuery.class.getName());
         return view;
     }
@@ -188,10 +202,10 @@ public class StudentAccountAssetAllocationController{
     @ApiOperation("后台系统管理界面-添加")
     public ModelAndView add(Long id) {
         ModelAndView view = new ModelAndView("/jlw/studentAccountAssetAllocation/add.html");
-        if(null != id){
+        if (null != id) {
             StudentAccountAssetAllocation studentAccountAssetAllocation = studentAccountAssetAllocationService.queryById(id);
             view.addObject("studentAccountAssetAllocation", studentAccountAssetAllocation);
-        }else {
+        } else {
             view.addObject("studentAccountAssetAllocation", new StudentAccountAssetAllocation());
         }
         return view;
@@ -202,7 +216,7 @@ public class StudentAccountAssetAllocationController{
     @PostMapping(MODEL + "/list.json")
     @Function("studentAccountAssetAllocation.query")
     @ApiOperation("分页列表")
-    public JsonResult<PageQuery> list(StudentAccountAssetAllocationQuery condition){
+    public JsonResult<PageQuery> list(StudentAccountAssetAllocationQuery condition) {
         PageQuery page = condition.getPageQuery();
         studentAccountAssetAllocationService.queryByCondition(page);
         return JsonResult.success(page);
@@ -211,17 +225,17 @@ public class StudentAccountAssetAllocationController{
     @PostMapping(MODEL + "/addAll.json")
     @Function("studentAccountAssetAllocation.add")
     @ApiOperation("批量添加")
-    public JsonResult addAll(StudentAccountAssetAllocationQuery studentAccountAssetAllocationQuery,@SCoreUser CoreUser coreUser){
-        if(null == coreUser){
+    public JsonResult addAll(StudentAccountAssetAllocationQuery studentAccountAssetAllocationQuery, @SCoreUser CoreUser coreUser) {
+        if (null == coreUser) {
             return JsonResult.failMessage("请登录后再操作");
-        }else{
-                studentAccountAssetAllocationQuery.setUserId(coreUser.getId());
-                studentAccountAssetAllocationQuery.setOrgId(coreUser.getOrgId());
+        } else {
+            studentAccountAssetAllocationQuery.setUserId(coreUser.getId());
+            studentAccountAssetAllocationQuery.setOrgId(coreUser.getOrgId());
             String msg = studentAccountAssetAllocationService.addAll(studentAccountAssetAllocationQuery);
             if (StringUtils.isBlank(msg)) {
                 return JsonResult.success();
             } else {
-                return JsonResult.failMessage("新增失败,"+msg);
+                return JsonResult.failMessage("新增失败," + msg);
             }
         }
     }
@@ -229,13 +243,13 @@ public class StudentAccountAssetAllocationController{
     @PostMapping(MODEL + "/add.json")
     @Function("studentAccountAssetAllocation.add")
     @ApiOperation("添加")
-    public JsonResult add(@Validated(ValidateConfig.ADD.class) StudentAccountAssetAllocationQuery studentAccountAssetAllocationQuery, BindingResult result,@SCoreUser CoreUser coreUser){
-        if(result.hasErrors()){
+    public JsonResult add(@Validated(ValidateConfig.ADD.class) StudentAccountAssetAllocationQuery studentAccountAssetAllocationQuery, BindingResult result, @SCoreUser CoreUser coreUser) {
+        if (result.hasErrors()) {
             return JsonResult.failMessage(result);
-        }else{
+        } else {
 
-                studentAccountAssetAllocationQuery.setUserId(coreUser.getId());
-                studentAccountAssetAllocationQuery.setOrgId(coreUser.getOrgId());
+            studentAccountAssetAllocationQuery.setUserId(coreUser.getId());
+            studentAccountAssetAllocationQuery.setOrgId(coreUser.getOrgId());
             return studentAccountAssetAllocationService.add(studentAccountAssetAllocationQuery);
         }
     }
@@ -244,17 +258,17 @@ public class StudentAccountAssetAllocationController{
     @Function("studentAccountAssetAllocation.edit")
     @ApiOperation("编辑")
     public JsonResult<String> update(@Validated(ValidateConfig.UPDATE.class) StudentAccountAssetAllocationQuery studentAccountAssetAllocationQuery, BindingResult result) {
-        if(result.hasErrors()){
+        if (result.hasErrors()) {
             return JsonResult.failMessage(result);
-        }else {
+        } else {
             Assert.notNull(getUser(), "请登录后再操作");
-                studentAccountAssetAllocationQuery.setUserId(null);
-                studentAccountAssetAllocationQuery.setOrgId(null);
+            studentAccountAssetAllocationQuery.setUserId(null);
+            studentAccountAssetAllocationQuery.setOrgId(null);
             String msg = studentAccountAssetAllocationService.edit(studentAccountAssetAllocationQuery);
             if (StringUtils.isBlank(msg)) {
                 return JsonResult.success();
             } else {
-                return JsonResult.failMessage("更新失败,"+msg);
+                return JsonResult.failMessage("更新失败," + msg);
             }
         }
     }
@@ -263,17 +277,17 @@ public class StudentAccountAssetAllocationController{
     @GetMapping(MODEL + "/view.json")
     @Function("studentAccountAssetAllocation.query")
     @ApiOperation("根据ID获取数据")
-    public JsonResult<StudentAccountAssetAllocation>queryInfo(Long id) {
-        StudentAccountAssetAllocation studentAccountAssetAllocation = studentAccountAssetAllocationService.queryById( id);
-        return  JsonResult.success(studentAccountAssetAllocation);
+    public JsonResult<StudentAccountAssetAllocation> queryInfo(Long id) {
+        StudentAccountAssetAllocation studentAccountAssetAllocation = studentAccountAssetAllocationService.queryById(id);
+        return JsonResult.success(studentAccountAssetAllocation);
     }
 
     @GetMapping(MODEL + "/getValues.json")
     @Function("studentAccountAssetAllocation.query")
     @ApiOperation("列表")
-    public JsonResult<List<StudentAccountAssetAllocation>>getValues(StudentAccountAssetAllocationQuery param) {
-        List<StudentAccountAssetAllocation>list = studentAccountAssetAllocationService.getValuesByQuery(param);
-        return  JsonResult.success(list);
+    public JsonResult<List<StudentAccountAssetAllocation>> getValues(StudentAccountAssetAllocationQuery param) {
+        List<StudentAccountAssetAllocation> list = studentAccountAssetAllocationService.getValuesByQuery(param);
+        return JsonResult.success(list);
     }