diff --git a/admin-core/src/main/java/com/ibeetl/admin/core/dao/CoreUserDao.java b/admin-core/src/main/java/com/ibeetl/admin/core/dao/CoreUserDao.java index 12a615f6..5ce7c5eb 100644 --- a/admin-core/src/main/java/com/ibeetl/admin/core/dao/CoreUserDao.java +++ b/admin-core/src/main/java/com/ibeetl/admin/core/dao/CoreUserDao.java @@ -56,4 +56,5 @@ public interface CoreUserDao extends BaseMapper { void updateUserId(Long newId, Long oldId); List getCoreUserListAndOldIdIsNull(); + CoreUser getCoreUserByOldId(Long oldId); } diff --git a/admin-core/src/main/java/com/ibeetl/admin/core/service/CoreUserService.java b/admin-core/src/main/java/com/ibeetl/admin/core/service/CoreUserService.java index 642d4320..977aa6a9 100644 --- a/admin-core/src/main/java/com/ibeetl/admin/core/service/CoreUserService.java +++ b/admin-core/src/main/java/com/ibeetl/admin/core/service/CoreUserService.java @@ -160,6 +160,10 @@ public class CoreUserService extends CoreBaseService { return coreUserDao.getCoreUserListAndOldIdIsNull(); } + public CoreUser findByOldId(Long oldId){ + return coreUserDao.getCoreUserByOldId(oldId); + } + /** * 验证 * @return diff --git a/admin-core/src/main/resources/sql/core/coreUser.md b/admin-core/src/main/resources/sql/core/coreUser.md index 825b7e12..2822e78e 100644 --- a/admin-core/src/main/resources/sql/core/coreUser.md +++ b/admin-core/src/main/resources/sql/core/coreUser.md @@ -155,4 +155,9 @@ JOIN core_role ON core_user_role.ROLE_ID = core_role.ID where core_user.CODE = # getCoreUserListAndOldIdIsNull === - select * from core_user where old_id is null \ No newline at end of file + select * from core_user where old_id is null + + +getCoreUserByOldId +=== +select * from core_user where old_id = #oldId# \ No newline at end of file diff --git a/web/src/main/java/com/ibeetl/jlw/web/AccountController.java b/web/src/main/java/com/ibeetl/jlw/web/AccountController.java index 3fe2c7b6..3b51490b 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/AccountController.java +++ b/web/src/main/java/com/ibeetl/jlw/web/AccountController.java @@ -952,5 +952,80 @@ public class AccountController { return null; } + @ApiOperation("智云2.0接口:修改PEVC资金") + @PostMapping("updatePEVCAssetAllocations.json") + public JsonResult updatePEVCAssetAllocations(Integer userId, Double amount, Double totalAsset) { + if (userId != null) { + CoreUser user = userService.findByOldId(Long.valueOf(userId)); + if (user != null) { + Student student = studentService.getByUserId(user.getId()); + StudentAccountAssetAllocation allocation = studentAccountAssetAllocationService.getByApplicationIdAndStudentId(18L, student.getStudentId()); + if (allocation != null) { + allocation.setAvailableFunds(BigDecimal.valueOf(amount)); + allocation.setTotalAssetsOfSubAccounts(BigDecimal.valueOf(totalAsset)); + studentAccountAssetAllocationService.updateTemplate(allocation); + } + } + } + return JsonResult.success(); + } + + @ApiOperation("智云2.0接口:UpdatePevcInvestAmount") + @PostMapping("updatePevcInvestAmount.json") + public JsonResult updatePevcInvestAmount(Integer userId, + Double amount, + Double TotalAsset, + Double zyInvestAmount, + Double yxInvestAmount, + Double lhInvestAmount, + Double bankInvestAmount) { + if (userId != null) { + CoreUser user = userService.findByOldId(Long.valueOf(userId)); + if (user != null) { + Student student = studentService.getByUserId(user.getId()); + List info = studentAccountEquityInvestmentSystemService.getInfo(student.getStudentId()); + StudentAccountEquityInvestmentSystem system = info.get(0); + system.setTotalCollectAssets(BigDecimal.valueOf(amount)); + system.setOwnInvestmentAssets(BigDecimal.valueOf(zyInvestAmount)); + system.setLpInvestmentAssets(BigDecimal.valueOf(yxInvestAmount)); + system.setGlInvestmentAssets(BigDecimal.valueOf(lhInvestAmount)); + system.setBankLoanInvestment(BigDecimal.valueOf(bankInvestAmount)); + studentAccountEquityInvestmentSystemService.updateTemplate(system); + + StudentAccountAssetAllocation allocation = studentAccountAssetAllocationService.getByApplicationIdAndStudentId(18L, student.getStudentId()); + if (allocation != null) { + allocation.setAvailableFunds(BigDecimal.valueOf(amount)); + allocation.setTotalAssetsOfSubAccounts(BigDecimal.valueOf(TotalAsset)); + double investAmount = zyInvestAmount + yxInvestAmount + lhInvestAmount + bankInvestAmount; + allocation.setInvestmentFunds(BigDecimal.valueOf(investAmount)); + studentAccountAssetAllocationService.updateTemplate(allocation); + } + } + } + return JsonResult.success(); + } + + @ApiOperation("智云2.0接口:GetUserNameByUserId") + @GetMapping("getUserNameByUserId") + public JsonResult getUserNameByUserId(Integer userId) { + if (userId != null) { + CoreUser user = userService.findByOldId(Long.valueOf(userId)); + if (user != null) { + return JsonResult.success(user.getName()); + } + } + return JsonResult.success(); + } + @ApiOperation("智云2.0接口:GetClassNameByClassId") + @GetMapping("getClassNameByClassId") + public JsonResult getClassNameByClassId(Integer classId) { + if (classId != null) { + SchoolClass schoolClass = schoolClassService.getByOldId(Long.valueOf(classId)); + if (schoolClass != null) { + return JsonResult.success(schoolClass.getClassName()); + } + } + return JsonResult.success(); + } }