| | |
| | | @ApiOperation(value = "获取开票抬头数据列表", tags = {"小程序-充电发票"}) |
| | | public AjaxResult<List<InvoiceInformationVo>> getInvoiceInformationList(){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | List<TInvoiceInformation> list = invoiceInformationService.list(new LambdaQueryWrapper<TInvoiceInformation>().eq(TInvoiceInformation::getAppUserId, userId).eq(TInvoiceInformation::getDelFlag, 0)); |
| | | List<TInvoiceInformation> list = invoiceInformationService.list(new LambdaQueryWrapper<TInvoiceInformation>() |
| | | .eq(TInvoiceInformation::getAppUserId, userId).eq(TInvoiceInformation::getDelFlag, 0).orderByDesc(TInvoiceInformation::getIsDefault)); |
| | | List<InvoiceInformationVo> lists = new ArrayList<>(); |
| | | for (TInvoiceInformation tInvoiceInformation : list) { |
| | | InvoiceInformationVo vo = new InvoiceInformationVo(); |
| | |
| | | @ApiOperation(value = "获取开票抬头详情数据", tags = {"小程序-充电发票"}) |
| | | public AjaxResult<TInvoiceInformation> getInvoiceInformationInfo(@PathVariable String id){ |
| | | TInvoiceInformation information = invoiceInformationService.getById(id); |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | if(!information.getAppUserId().equals(userId)){ |
| | | return AjaxResult.error("权限不足"); |
| | | } |
| | | return AjaxResult.success(information); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "编辑开票抬头数据", tags = {"小程序-充电发票"}) |
| | | public AjaxResult editInvoiceInformation(@RequestBody TInvoiceInformation invoiceInformation){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | TInvoiceInformation information = invoiceInformationService.getById(invoiceInformation.getId()); |
| | | if(!information.getAppUserId().equals(userId)){ |
| | | return AjaxResult.error("权限不足"); |
| | | } |
| | | |
| | | //如果当前是默认抬头,则需要去除其他的默认配置 |
| | | if(1 == invoiceInformation.getIsDefault()){ |
| | | if(null != invoiceInformation.getIsDefault() && 1 == invoiceInformation.getIsDefault()){ |
| | | TInvoiceInformation one = invoiceInformationService.getOne(new LambdaQueryWrapper<TInvoiceInformation>().eq(TInvoiceInformation::getDelFlag, 0) |
| | | .eq(TInvoiceInformation::getIsDefault, 1).eq(TInvoiceInformation::getAppUserId, userId)); |
| | | if(null != one && !one.getId().equals(invoiceInformation.getId())){ |