diff --git a/admin-core/src/main/resources/sql/core/coreUser.md b/admin-core/src/main/resources/sql/core/coreUser.md index 85e771a1..ef588af1 100644 --- a/admin-core/src/main/resources/sql/core/coreUser.md +++ b/admin-core/src/main/resources/sql/core/coreUser.md @@ -67,7 +67,7 @@ getStudentByNoOfNet === SELECT core_user.old_id AS userId, - core_user.NAME AS NAME, + student.student_name AS NAME, core_role.NAME AS roleName, core_user.CODE as username, 4 as roleId, diff --git a/web/src/main/java/com/ibeetl/jlw/service/SchoolClassService.java b/web/src/main/java/com/ibeetl/jlw/service/SchoolClassService.java index dcf45015..fe088204 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/SchoolClassService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/SchoolClassService.java @@ -210,7 +210,7 @@ public class SchoolClassService extends CoreBaseService { insertSchoolClass.setAddTime(new Date()); insertSchoolClass.setOrgId(orgId); insertSchoolClass.setUserId(userId); - Integer icibtClassId = BXApiUtil.createBxClass(schoolClass.getClassName(), universitiesColleges.getIcibtSchoolId()); + Integer icibtClassId = BXApiUtil.createBxClass(insertSchoolClass.getClassName(), universitiesColleges.getIcibtSchoolId()); insertSchoolClass.setIcibtClassId(icibtClassId); insert(insertSchoolClass); SchoolClass s = new SchoolClass(); 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 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 allOpenAccount(Long orgId,@SCoreUser CoreUser coreUser) { - if(null == coreUser){ + public JsonResult 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 transferAccounts(Long toAccountsApplicationId, Long outAccountsApplicationId, BigDecimal money,Long studentId, @SCoreUser CoreUser coreUser) { - if(null == coreUser){ + public JsonResult 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> 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 getPageList(StudentAccountAssetAllocationQuery condition,@SCoreUser CoreUser coreUser){ - if(null == coreUser){ + public JsonResult 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 JsonResultgetInfo(StudentAccountAssetAllocationQuery param,@SCoreUser CoreUser coreUser) { - if(null == coreUser){ + public JsonResult 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>getList(StudentAccountAssetAllocationQuery param,@SCoreUser CoreUser coreUser) { - if(null == coreUser){ + public JsonResult> getList(StudentAccountAssetAllocationQuery param, @SCoreUser CoreUser coreUser) { + if (null == coreUser) { return JsonResult.failMessage("请登录后再操作"); - }else{ - Listlist = studentAccountAssetAllocationService.getValuesByQuery(param); - return JsonResult.success(list); + } else { + List list = studentAccountAssetAllocationService.getValuesByQuery(param); + List 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> 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 list(StudentAccountAssetAllocationQuery condition){ + public JsonResult 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 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 JsonResultqueryInfo(Long id) { - StudentAccountAssetAllocation studentAccountAssetAllocation = studentAccountAssetAllocationService.queryById( id); - return JsonResult.success(studentAccountAssetAllocation); + public JsonResult queryInfo(Long id) { + StudentAccountAssetAllocation studentAccountAssetAllocation = studentAccountAssetAllocationService.queryById(id); + return JsonResult.success(studentAccountAssetAllocation); } @GetMapping(MODEL + "/getValues.json") @Function("studentAccountAssetAllocation.query") @ApiOperation("列表") - public JsonResult>getValues(StudentAccountAssetAllocationQuery param) { - Listlist = studentAccountAssetAllocationService.getValuesByQuery(param); - return JsonResult.success(list); + public JsonResult> getValues(StudentAccountAssetAllocationQuery param) { + List list = studentAccountAssetAllocationService.getValuesByQuery(param); + return JsonResult.success(list); } diff --git a/web/src/main/java/com/ibeetl/jlw/web/TestController.java b/web/src/main/java/com/ibeetl/jlw/web/TestController.java index dea06ca4..99eff767 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/TestController.java +++ b/web/src/main/java/com/ibeetl/jlw/web/TestController.java @@ -7,6 +7,8 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.reflect.TypeToken; +import com.ibeetl.admin.core.dao.CoreDictDao; +import com.ibeetl.admin.core.entity.CoreDict; import com.ibeetl.admin.core.entity.CoreUser; import com.ibeetl.admin.core.service.CorePlatformService; import com.ibeetl.admin.core.service.CoreUserService; @@ -24,6 +26,7 @@ import io.swagger.annotations.ApiOperation; import org.apache.regexp.RE; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -80,6 +83,9 @@ public class TestController { private final static String USER = "sa"; private final static String PASSWORD = "sztzjy@2017"; + @Autowired + CoreDictDao coreDictDao; + // 打开数据库连接 public static Connection openConn() throws SQLException { try { @@ -517,7 +523,7 @@ public class TestController { " JOIN EduMajors maj ON stu.MajorId = maj.Id " + " JOIN EduSchools sch ON stu.SchoolId = sch.Id " + " JOIN EduClasses cla ON stu.ClassId = cla.Id" + - " join EduUsers us on stu.StudentNo = us.UserName where stu.isdeleted=0 "; + " join EduUsers us on stu.StudentNo = us.UserName where stu.isdeleted=0 and cla.id = 1274"; ps = conn.prepareStatement(sql); ResultSet resultSet = ps.executeQuery(); int i = 0; @@ -1674,4 +1680,11 @@ public class TestController { } } } + + @ApiOperation("异常测试") + @GetMapping("errorTest") + public void errorTest() { + List aLlListByTable = coreDictDao.findALlListByTable("student_id", "student_name", "", "student", new String[]{"student_status=1"}); + int a = 0; + } } \ No newline at end of file