| | |
| | | |
| | | @Override |
| | | public List<AdminAgentLevelOptionTreeVo> getAgentLevelOption() { |
| | | return dataDictionaryCustomMapper.getAgentLevelOption(); |
| | | List<AdminAgentLevelOptionTreeVo> agentLevelOption = dataDictionaryCustomMapper.getAgentLevelOption(); |
| | | AdminAgentLevelOptionTreeVo adminAgentLevelOptionTreeVo = new AdminAgentLevelOptionTreeVo(); |
| | | adminAgentLevelOptionTreeVo.setId("MEMBER"); |
| | | adminAgentLevelOptionTreeVo.setName("MEMBER"); |
| | | agentLevelOption.add(adminAgentLevelOptionTreeVo); |
| | | return agentLevelOption; |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Transactional |
| | | public Long createOrder(AddOrderDto addOrderDto) { |
| | | DappMemberEntity member = LoginUserUtil.getAppUser(); |
| | | |
| | | DappMemberEntity dappMemberEntity = dappMemberDao.selectById(member.getId()); |
| | | if(2 == dappMemberEntity.getChangeAble()){ |
| | | throw new FebsException("账号已冻结"); |
| | | } |
| | | // DappMemberEntity member = dappMemberDao.selectById(1L); |
| | | /** |
| | | * 1、商品是否上架 |
| | | * 2、用户余额是否足够 |
| | | */ |
| | | |
| | | MallGoods mallGoods = mallGoodsMapper.selectById(addOrderDto.getGoodsId()); |
| | | if(ObjectUtil.isEmpty(mallGoods)){ |
| | | throw new FebsException("商品不存在"); |
| | |
| | | public FebsResponse salePackage(SalePackageDto salePackageDto) { |
| | | Long memberId = LoginUserUtil.getAppUser().getId(); |
| | | BigDecimal cnt = salePackageDto.getCnt(); |
| | | |
| | | if(ObjectUtil.isEmpty(salePackageDto.getCnt())){ |
| | | throw new FebsException("请输入正确的数量"); |
| | | } |
| | | DappMemberEntity dappMemberEntity = dappMemberDao.selectById(memberId); |
| | | |
| | | if(2 == dappMemberEntity.getChangeAble()){ |
| | | throw new FebsException("账号已冻结"); |
| | | } |
| | | BigDecimal saleDoing = dappFundFlowDao.selectSumAmountByMemberIdAndTypeAndStatus(memberId, FundFlowEnum.SALE_PACKAGE.getCode(), DappFundFlowEntity.WITHDRAW_STATUS_ING); |
| | | if(BigDecimal.ZERO.compareTo(saleDoing) < 0){ |
| | | throw new FebsException("正在进行中,请稍后再试"); |
| | |
| | | if(ObjectUtil.isEmpty(dappMemberEntity)) { |
| | | return new FebsResponse().fail().message("会员信息不存在"); |
| | | } |
| | | dappMemberEntity.setChangeAble(1); |
| | | dappMemberEntity.setChangeAble(2); |
| | | dappMemberDao.updateById(dappMemberEntity); |
| | | return new FebsResponse().success(); |
| | | } |
| | |
| | | if(ObjectUtil.isEmpty(dappMemberEntity)) { |
| | | return new FebsResponse().fail().message("会员信息不存在"); |
| | | } |
| | | dappMemberEntity.setChangeAble(2); |
| | | dappMemberEntity.setChangeAble(1); |
| | | dappMemberDao.updateById(dappMemberEntity); |
| | | |
| | | redisUtils.hdel(AppContants.REDIS_KEY_SIGN, dappMemberEntity.getAddress()); |