新增子系统用户

beetlsql3-dev
chenyuan 11 months ago
parent 77a0dbdb0c
commit 3db1ec9223

@ -131,6 +131,9 @@ public class ApiStudentService {
if (allocation.getName().getText().equals("现金账户")) { if (allocation.getName().getText().equals("现金账户")) {
continue; continue;
} }
if(allocation.getApplicationId()==null||allocation.getApplicationId()==6){
continue;
}
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
if (allocation.getName().getText().equals("银行账户")) { if (allocation.getName().getText().equals("银行账户")) {
map.put("name", allocation.getName().getText()); map.put("name", allocation.getName().getText());

@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import static com.ibeetl.admin.core.util.user.CacheUserUtil.getUser; 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 @RestController
@Validated @Validated
@Api(tags = {"资产账户管理 学生资产账户 接口"}) @Api(tags = {"资产账户管理 学生资产账户 接口"})
public class StudentAccountAssetAllocationController{ public class StudentAccountAssetAllocationController {
private final Log log = LogFactory.getLog(this.getClass()); private final Log log = LogFactory.getLog(this.getClass());
private static final String MODEL = "/jlw/studentAccountAssetAllocation"; private static final String MODEL = "/jlw/studentAccountAssetAllocation";
private static final String API = "/api/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") @GetMapping(API + "/allOpenAccount.do")
@ApiOperation("激活该校的所有学生用户的股票/期货账户") @ApiOperation("激活该校的所有学生用户的股票/期货账户")
public JsonResult<String> allOpenAccount(Long orgId,@SCoreUser CoreUser coreUser) { public JsonResult<String> allOpenAccount(Long orgId, @SCoreUser CoreUser coreUser) {
if(null == coreUser){ if (null == coreUser) {
return JsonResult.failMessage("请登录后再操作"); return JsonResult.failMessage("请登录后再操作");
}else{ } else {
studentAccountAssetAllocationService.allOpenAccount(orgId); studentAccountAssetAllocationService.allOpenAccount(orgId);
return JsonResult.success("操作成功"); return JsonResult.success("操作成功");
} }
} }
@PostMapping(API + "/allOpenAccount.do") @PostMapping(API + "/allOpenAccount.do")
@ApiOperation("转账") @ApiOperation("转账")
public JsonResult<String> transferAccounts(Long toAccountsApplicationId, Long outAccountsApplicationId, BigDecimal money,Long studentId, @SCoreUser CoreUser coreUser) { public JsonResult<String> transferAccounts(Long toAccountsApplicationId, Long outAccountsApplicationId, BigDecimal money, Long studentId, @SCoreUser CoreUser coreUser) {
if(null == coreUser){ if (null == coreUser) {
return JsonResult.failMessage("请登录后再操作"); return JsonResult.failMessage("请登录后再操作");
}else{ } else {
return studentAccountAssetAllocationService.transferAccounts(toAccountsApplicationId, outAccountsApplicationId ,money , studentId,coreUser); return studentAccountAssetAllocationService.transferAccounts(toAccountsApplicationId, outAccountsApplicationId, money, studentId, coreUser);
} }
} }
@GetMapping(API + "/getCapitalAccount.do") @GetMapping(API + "/getCapitalAccount.do")
@ApiOperation("获取转账账户") @ApiOperation("获取转账账户")
public JsonResult<List<StudentAccountAssetAllocation>> getCapitalAccount(Long studentId, @SCoreUser CoreUser coreUser) { public JsonResult<List<StudentAccountAssetAllocation>> getCapitalAccount(Long studentId, @SCoreUser CoreUser coreUser) {
if(null == coreUser){ if (null == coreUser) {
return JsonResult.failMessage("请登录后再操作"); return JsonResult.failMessage("请登录后再操作");
}else{ } else {
return JsonResult.success(studentAccountAssetAllocationService.getCapitalAccount(studentId)); return JsonResult.success(studentAccountAssetAllocationService.getCapitalAccount(studentId));
} }
} }
@PostMapping(API + "/getPageList.do") @PostMapping(API + "/getPageList.do")
@ApiOperation("分页列表") @ApiOperation("分页列表")
public JsonResult<PageQuery> getPageList(StudentAccountAssetAllocationQuery condition,@SCoreUser CoreUser coreUser){ public JsonResult<PageQuery> getPageList(StudentAccountAssetAllocationQuery condition, @SCoreUser CoreUser coreUser) {
if(null == coreUser){ if (null == coreUser) {
return JsonResult.failMessage("请登录后再操作"); return JsonResult.failMessage("请登录后再操作");
}else{ } else {
PageQuery page = condition.getPageQuery(); PageQuery page = condition.getPageQuery();
studentAccountAssetAllocationService.queryByConditionQuery(page); studentAccountAssetAllocationService.queryByConditionQuery(page);
return JsonResult.success(page); return JsonResult.success(page);
@ -96,32 +99,41 @@ public class StudentAccountAssetAllocationController{
@GetMapping(API + "/getInfo.do") @GetMapping(API + "/getInfo.do")
@ApiOperation("获取数据") @ApiOperation("获取数据")
public JsonResult<StudentAccountAssetAllocation>getInfo(StudentAccountAssetAllocationQuery param,@SCoreUser CoreUser coreUser) { public JsonResult<StudentAccountAssetAllocation> getInfo(StudentAccountAssetAllocationQuery param, @SCoreUser CoreUser coreUser) {
if(null == coreUser){ if (null == coreUser) {
return JsonResult.failMessage("请登录后再操作"); return JsonResult.failMessage("请登录后再操作");
}else{ } else {
StudentAccountAssetAllocation studentAccountAssetAllocation = studentAccountAssetAllocationService.getInfo(param); StudentAccountAssetAllocation studentAccountAssetAllocation = studentAccountAssetAllocationService.getInfo(param);
return JsonResult.success(studentAccountAssetAllocation); return JsonResult.success(studentAccountAssetAllocation);
} }
} }
@GetMapping(API + "/getList.do") @GetMapping(API + "/getList.do")
@ApiOperation("列表") @ApiOperation("列表")
public JsonResult<List<StudentAccountAssetAllocation>>getList(StudentAccountAssetAllocationQuery param,@SCoreUser CoreUser coreUser) { public JsonResult<List<StudentAccountAssetAllocation>> getList(StudentAccountAssetAllocationQuery param, @SCoreUser CoreUser coreUser) {
if(null == coreUser){ if (null == coreUser) {
return JsonResult.failMessage("请登录后再操作"); return JsonResult.failMessage("请登录后再操作");
}else{ } else {
List<StudentAccountAssetAllocation>list = studentAccountAssetAllocationService.getValuesByQuery(param); List<StudentAccountAssetAllocation> list = studentAccountAssetAllocationService.getValuesByQuery(param);
return JsonResult.success(list); 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 * token
* @param applicationToken token *
* @param param * @param applicationToken token
* @param param
* @return * @return
*/ */
@PostMapping(API + "/externalApi/updateByApplicationToken.do") @PostMapping(API + "/externalApi/updateByApplicationToken.do")
@ -136,22 +148,24 @@ public class StudentAccountAssetAllocationController{
/** /**
* *
* token * token
* @param applicationToken token *
* @param param * @param applicationToken token
* @param param
* @return * @return
*/ */
@PostMapping(API + "/externalApi/getByApplicationToken.do") @PostMapping(API + "/externalApi/getByApplicationToken.do")
@ResponseBody @ResponseBody
@ApiOperation("通过token获取资金账户信息") @ApiOperation("通过token获取资金账户信息")
public JsonResult<List<StudentAccountAssetAllocation>> getByApplicationToken(@RequestParam("applicationToken") String applicationToken, public JsonResult<List<StudentAccountAssetAllocation>> getByApplicationToken(@RequestParam("applicationToken") String applicationToken,
@RequestBody StudentAccountAssetAllocationQuery param) { @RequestBody StudentAccountAssetAllocationQuery param) {
return JsonResult.success(studentAccountAssetAllocationService.getByApplicationToken(applicationToken, param)); return JsonResult.success(studentAccountAssetAllocationService.getByApplicationToken(applicationToken, param));
} }
/** /**
* *
* token * token
* @param applicationToken token *
* @param applicationToken token
* @return * @return
*/ */
@PostMapping(API + "/externalApi/getApplicationBindCourseInfo.do") @PostMapping(API + "/externalApi/getApplicationBindCourseInfo.do")
@ -168,7 +182,7 @@ public class StudentAccountAssetAllocationController{
@Function("studentAccountAssetAllocation.query") @Function("studentAccountAssetAllocation.query")
@ApiOperation("后台系统管理界面") @ApiOperation("后台系统管理界面")
public ModelAndView index() { 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()); view.addObject("search", StudentAccountAssetAllocationQuery.class.getName());
return view; return view;
} }
@ -188,10 +202,10 @@ public class StudentAccountAssetAllocationController{
@ApiOperation("后台系统管理界面-添加") @ApiOperation("后台系统管理界面-添加")
public ModelAndView add(Long id) { public ModelAndView add(Long id) {
ModelAndView view = new ModelAndView("/jlw/studentAccountAssetAllocation/add.html"); ModelAndView view = new ModelAndView("/jlw/studentAccountAssetAllocation/add.html");
if(null != id){ if (null != id) {
StudentAccountAssetAllocation studentAccountAssetAllocation = studentAccountAssetAllocationService.queryById(id); StudentAccountAssetAllocation studentAccountAssetAllocation = studentAccountAssetAllocationService.queryById(id);
view.addObject("studentAccountAssetAllocation", studentAccountAssetAllocation); view.addObject("studentAccountAssetAllocation", studentAccountAssetAllocation);
}else { } else {
view.addObject("studentAccountAssetAllocation", new StudentAccountAssetAllocation()); view.addObject("studentAccountAssetAllocation", new StudentAccountAssetAllocation());
} }
return view; return view;
@ -202,7 +216,7 @@ public class StudentAccountAssetAllocationController{
@PostMapping(MODEL + "/list.json") @PostMapping(MODEL + "/list.json")
@Function("studentAccountAssetAllocation.query") @Function("studentAccountAssetAllocation.query")
@ApiOperation("分页列表") @ApiOperation("分页列表")
public JsonResult<PageQuery> list(StudentAccountAssetAllocationQuery condition){ public JsonResult<PageQuery> list(StudentAccountAssetAllocationQuery condition) {
PageQuery page = condition.getPageQuery(); PageQuery page = condition.getPageQuery();
studentAccountAssetAllocationService.queryByCondition(page); studentAccountAssetAllocationService.queryByCondition(page);
return JsonResult.success(page); return JsonResult.success(page);
@ -211,17 +225,17 @@ public class StudentAccountAssetAllocationController{
@PostMapping(MODEL + "/addAll.json") @PostMapping(MODEL + "/addAll.json")
@Function("studentAccountAssetAllocation.add") @Function("studentAccountAssetAllocation.add")
@ApiOperation("批量添加") @ApiOperation("批量添加")
public JsonResult addAll(StudentAccountAssetAllocationQuery studentAccountAssetAllocationQuery,@SCoreUser CoreUser coreUser){ public JsonResult addAll(StudentAccountAssetAllocationQuery studentAccountAssetAllocationQuery, @SCoreUser CoreUser coreUser) {
if(null == coreUser){ if (null == coreUser) {
return JsonResult.failMessage("请登录后再操作"); return JsonResult.failMessage("请登录后再操作");
}else{ } else {
studentAccountAssetAllocationQuery.setUserId(coreUser.getId()); studentAccountAssetAllocationQuery.setUserId(coreUser.getId());
studentAccountAssetAllocationQuery.setOrgId(coreUser.getOrgId()); studentAccountAssetAllocationQuery.setOrgId(coreUser.getOrgId());
String msg = studentAccountAssetAllocationService.addAll(studentAccountAssetAllocationQuery); String msg = studentAccountAssetAllocationService.addAll(studentAccountAssetAllocationQuery);
if (StringUtils.isBlank(msg)) { if (StringUtils.isBlank(msg)) {
return JsonResult.success(); return JsonResult.success();
} else { } else {
return JsonResult.failMessage("新增失败,"+msg); return JsonResult.failMessage("新增失败," + msg);
} }
} }
} }
@ -229,13 +243,13 @@ public class StudentAccountAssetAllocationController{
@PostMapping(MODEL + "/add.json") @PostMapping(MODEL + "/add.json")
@Function("studentAccountAssetAllocation.add") @Function("studentAccountAssetAllocation.add")
@ApiOperation("添加") @ApiOperation("添加")
public JsonResult add(@Validated(ValidateConfig.ADD.class) StudentAccountAssetAllocationQuery studentAccountAssetAllocationQuery, BindingResult result,@SCoreUser CoreUser coreUser){ public JsonResult add(@Validated(ValidateConfig.ADD.class) StudentAccountAssetAllocationQuery studentAccountAssetAllocationQuery, BindingResult result, @SCoreUser CoreUser coreUser) {
if(result.hasErrors()){ if (result.hasErrors()) {
return JsonResult.failMessage(result); return JsonResult.failMessage(result);
}else{ } else {
studentAccountAssetAllocationQuery.setUserId(coreUser.getId()); studentAccountAssetAllocationQuery.setUserId(coreUser.getId());
studentAccountAssetAllocationQuery.setOrgId(coreUser.getOrgId()); studentAccountAssetAllocationQuery.setOrgId(coreUser.getOrgId());
return studentAccountAssetAllocationService.add(studentAccountAssetAllocationQuery); return studentAccountAssetAllocationService.add(studentAccountAssetAllocationQuery);
} }
} }
@ -244,17 +258,17 @@ public class StudentAccountAssetAllocationController{
@Function("studentAccountAssetAllocation.edit") @Function("studentAccountAssetAllocation.edit")
@ApiOperation("编辑") @ApiOperation("编辑")
public JsonResult<String> update(@Validated(ValidateConfig.UPDATE.class) StudentAccountAssetAllocationQuery studentAccountAssetAllocationQuery, BindingResult result) { public JsonResult<String> update(@Validated(ValidateConfig.UPDATE.class) StudentAccountAssetAllocationQuery studentAccountAssetAllocationQuery, BindingResult result) {
if(result.hasErrors()){ if (result.hasErrors()) {
return JsonResult.failMessage(result); return JsonResult.failMessage(result);
}else { } else {
Assert.notNull(getUser(), "请登录后再操作"); Assert.notNull(getUser(), "请登录后再操作");
studentAccountAssetAllocationQuery.setUserId(null); studentAccountAssetAllocationQuery.setUserId(null);
studentAccountAssetAllocationQuery.setOrgId(null); studentAccountAssetAllocationQuery.setOrgId(null);
String msg = studentAccountAssetAllocationService.edit(studentAccountAssetAllocationQuery); String msg = studentAccountAssetAllocationService.edit(studentAccountAssetAllocationQuery);
if (StringUtils.isBlank(msg)) { if (StringUtils.isBlank(msg)) {
return JsonResult.success(); return JsonResult.success();
} else { } else {
return JsonResult.failMessage("更新失败,"+msg); return JsonResult.failMessage("更新失败," + msg);
} }
} }
} }
@ -263,17 +277,17 @@ public class StudentAccountAssetAllocationController{
@GetMapping(MODEL + "/view.json") @GetMapping(MODEL + "/view.json")
@Function("studentAccountAssetAllocation.query") @Function("studentAccountAssetAllocation.query")
@ApiOperation("根据ID获取数据") @ApiOperation("根据ID获取数据")
public JsonResult<StudentAccountAssetAllocation>queryInfo(Long id) { public JsonResult<StudentAccountAssetAllocation> queryInfo(Long id) {
StudentAccountAssetAllocation studentAccountAssetAllocation = studentAccountAssetAllocationService.queryById( id); StudentAccountAssetAllocation studentAccountAssetAllocation = studentAccountAssetAllocationService.queryById(id);
return JsonResult.success(studentAccountAssetAllocation); return JsonResult.success(studentAccountAssetAllocation);
} }
@GetMapping(MODEL + "/getValues.json") @GetMapping(MODEL + "/getValues.json")
@Function("studentAccountAssetAllocation.query") @Function("studentAccountAssetAllocation.query")
@ApiOperation("列表") @ApiOperation("列表")
public JsonResult<List<StudentAccountAssetAllocation>>getValues(StudentAccountAssetAllocationQuery param) { public JsonResult<List<StudentAccountAssetAllocation>> getValues(StudentAccountAssetAllocationQuery param) {
List<StudentAccountAssetAllocation>list = studentAccountAssetAllocationService.getValuesByQuery(param); List<StudentAccountAssetAllocation> list = studentAccountAssetAllocationService.getValuesByQuery(param);
return JsonResult.success(list); return JsonResult.success(list);
} }

Loading…
Cancel
Save