| | |
| | | public Result<IPage<ProfitLossConfigDTO>> list(ProfitLossConfigQuery profitLossConfigQuery, Page<ProfitLossConfig> page) throws Exception { |
| | | profitLossConfigQuery.setChildren(permissionFacade.getOwnerUserIds()); |
| | | |
| | | IPage<ProfitLossConfigDTO> result = profitAndLossConfigServiceFacade.getProfitLossConfigService().listRecord(page, profitLossConfigQuery); |
| | | IPage<ProfitLossConfigDTO> result = profitAndLossConfigServiceFacade.listRecord(page, profitLossConfigQuery); |
| | | return Result.ok(result); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "获取交割场控设置详情") |
| | | @GetMapping("get.action") |
| | | public Result<ProfitLossConfigDTO> findById(@RequestParam String id) { |
| | | ProfitLossConfig profitLossConfig = profitAndLossConfigServiceFacade.getProfitLossConfigService().getById(id); |
| | | ProfitLossConfig profitLossConfig = profitAndLossConfigServiceFacade.getById(id); |
| | | User party = this.userService.getById(profitLossConfig.getPartyId()); |
| | | ProfitLossConfigDTO profitLossConfigDTO = wrapper.toDTO(profitLossConfig); |
| | | profitLossConfigDTO.setUserCode(party.getUserCode()); |
| | |
| | | try { |
| | | User party = userService.findUserByUserCode(usercode); |
| | | if (null == party) { |
| | | throw new YamiShopBindException("用户不存在"); |
| | | throw new YamiShopBindException("User does not exist"); |
| | | } |
| | | |
| | | // todo代理上逻辑 |
| | |
| | | |
| | | } catch (Exception e) { |
| | | log.error("保存场控失败", e); |
| | | throw new YamiShopBindException("保存场控失败:"+ e.getMessage()); |
| | | throw new YamiShopBindException("Failed to save market control: " + e.getMessage()); |
| | | } |
| | | return Result.ok("操作成功"); |
| | | } |
| | |
| | | @ApiOperation(value = "修改 交割场控设置") |
| | | @PostMapping("update.action") |
| | | public Result<String> update(@Valid @RequestBody ProfitLossConfigUpdate update) { |
| | | ProfitLossConfig profitAndLossConfig = this.profitAndLossConfigServiceFacade.getProfitLossConfigService().getById(update.getUuid()); |
| | | ProfitLossConfig profitAndLossConfig = this.profitAndLossConfigServiceFacade.getById(update.getUuid()); |
| | | User party = userService.getById(profitAndLossConfig.getPartyId()); |
| | | if (null == party) { |
| | | throw new YamiShopBindException("用户不存在"); |
| | | throw new YamiShopBindException("User does not exist"); |
| | | } |
| | | String opName = SecurityUtils.getSysUser().getUsername(); |
| | | // todo 代理商数据权限验证 |
| | |
| | | @ApiOperation(value = "删除 交割场控设置") |
| | | @GetMapping("toDelete.action") |
| | | public Result<String> toDelete(@RequestParam String uuid) { |
| | | ProfitLossConfig profitAndLossConfig = this.profitAndLossConfigServiceFacade.getProfitLossConfigService().getById(uuid); |
| | | ProfitLossConfig profitAndLossConfig = this.profitAndLossConfigServiceFacade.getById(uuid); |
| | | User party = userService.getById(profitAndLossConfig.getPartyId()); |
| | | if (null == party) { |
| | | throw new YamiShopBindException("用户不存在"); |
| | | throw new YamiShopBindException("User does not exist"); |
| | | } |
| | | String opName = SecurityUtils.getSysUser().getUsername(); |
| | | // todo 代理商数据权限验证 |