| | |
| | | import com.ruoyi.common.annotation.RepeatSubmit; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.PageDomain; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.core.page.TableSupport; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.bean.DtoConversionUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.project.domain.*; |
| | | import com.ruoyi.project.domain.dto.OrganfeeExportDto; |
| | | import com.ruoyi.project.service.IServiceDonorchargeorganService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | |
| | | * 查询捐献器官列表 |
| | | */ |
| | | @ApiOperation("查询捐献器官列表") |
| | | @PreAuthorize("@ss.hasPermi('project:donorchargeorgan:list')") |
| | | // // @PreAuthorize("@ss.hasPermi('project:donorchargeorgan:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ServiceDonorchargeorgan serviceDonorchargeorgan) { |
| | | log.info("查询捐献器官列表的入参:{}", serviceDonorchargeorgan); |
| | |
| | | serviceDonorchargeorganVO.setAnnexFilesList(rbDetailFiles); |
| | | } |
| | | } |
| | | |
| | | return getDataTable(serviceDonorchargeorganVOList); |
| | | return getDataTable2(serviceDonorchargeorganVOList, list); |
| | | } |
| | | |
| | | /** |
| | | * 导出捐献器官列表 |
| | | */ |
| | | @ApiOperation("导出捐献器官列表") |
| | | @PreAuthorize("@ss.hasPermi('project:donorchargeorgan:export')") |
| | | // // @PreAuthorize("@ss.hasPermi('project:donorchargeorgan:export')") |
| | | @Log(title = "捐献器官", businessType = BusinessType.EXPORT) |
| | | @GetMapping("/export") |
| | | public AjaxResult export(ServiceDonorchargeorgan serviceDonorchargeorgan) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 导出器官费用列表(查询条件与列表接口一致,含报告日期区间) |
| | | */ |
| | | @ApiOperation("导出器官费用列表") |
| | | @Log(title = "器官费用", businessType = BusinessType.EXPORT) |
| | | @GetMapping("/exportOrganfee") |
| | | public AjaxResult exportOrganfee(ServiceDonorchargeorgan serviceDonorchargeorgan) { |
| | | log.info("导出器官费用列表的入参:{}", serviceDonorchargeorgan); |
| | | List<ServiceDonorchargeorgan> list = null; |
| | | if (Boolean.TRUE.equals(serviceDonorchargeorgan.getPaymentidIsNotNull())) { |
| | | list = serviceDonorchargeorganService.queryList(serviceDonorchargeorgan); |
| | | } else { |
| | | list = serviceDonorchargeorganService.queryListBypaymentidIsNull(serviceDonorchargeorgan); |
| | | } |
| | | List<OrganfeeExportDto> exportList = new ArrayList<>(list.size()); |
| | | for (ServiceDonorchargeorgan serviceDonorchargeorganItem : list) { |
| | | OrganfeeExportDto exportDto = DtoConversionUtils.sourceToTarget(serviceDonorchargeorganItem, OrganfeeExportDto.class); |
| | | exportDto.setOrganStateName(organStateName(serviceDonorchargeorganItem.getOrganState())); |
| | | BigDecimal receivableBalance = receivableBalance(serviceDonorchargeorganItem.getOrgancharge(), serviceDonorchargeorganItem.getAmount()); |
| | | exportDto.setReceivableBalance(receivableBalance); |
| | | exportDto.setPayStatus(payStatus(receivableBalance)); |
| | | exportList.add(exportDto); |
| | | } |
| | | ExcelUtil<OrganfeeExportDto> util = new ExcelUtil<OrganfeeExportDto>(OrganfeeExportDto.class); |
| | | return util.exportExcel(exportList, "器官费用数据"); |
| | | } |
| | | |
| | | /** |
| | | * 器官状态值转文本 |
| | | */ |
| | | private String organStateName(String organState) { |
| | | if (StringUtils.isEmpty(organState)) { |
| | | return ""; |
| | | } |
| | | switch (organState) { |
| | | case "1": |
| | | return "移植"; |
| | | case "2": |
| | | return "弃用"; |
| | | case "3": |
| | | return "库存"; |
| | | case "4": |
| | | return "失功"; |
| | | case "5": |
| | | return "直系免除"; |
| | | case "6": |
| | | return "不良事件"; |
| | | default: |
| | | return organState; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 应收金额-实收金额的差额,应收金额为空时返回 null |
| | | */ |
| | | private BigDecimal receivableBalance(BigDecimal organcharge, BigDecimal amount) { |
| | | if (organcharge == null) { |
| | | return null; |
| | | } |
| | | return organcharge.subtract(amount == null ? BigDecimal.ZERO : amount); |
| | | } |
| | | |
| | | /** |
| | | * 差额为 0 已付,其它未付 |
| | | */ |
| | | private String payStatus(BigDecimal receivableBalance) { |
| | | if (receivableBalance == null) { |
| | | return ""; |
| | | } |
| | | return receivableBalance.compareTo(BigDecimal.ZERO) == 0 ? "已付" : "未付"; |
| | | } |
| | | |
| | | /** |
| | | * 获取捐献器官详细信息 |
| | | */ |
| | | @ApiOperation("获取捐献器官详细信息") |
| | | @PreAuthorize("@ss.hasPermi('project:donorchargeorgan:query')") |
| | | // // @PreAuthorize("@ss.hasPermi('project:donorchargeorgan:query')") |
| | | @GetMapping(value = "/getInfo/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) { |
| | | return AjaxResult.success(serviceDonorchargeorganService.getById(id)); |
| | |
| | | * 新增捐献器官 |
| | | */ |
| | | @ApiOperation("新增捐献器官") |
| | | @PreAuthorize("@ss.hasPermi('project:donorchargeorgan:add')") |
| | | // // @PreAuthorize("@ss.hasPermi('project:donorchargeorgan:add')") |
| | | @Log(title = "捐献器官", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @RepeatSubmit |
| | |
| | | * 修改捐献器官 |
| | | */ |
| | | @ApiOperation("修改捐献器官") |
| | | @PreAuthorize("@ss.hasPermi('project:donorchargeorgan:edit')") |
| | | // // @PreAuthorize("@ss.hasPermi('project:donorchargeorgan:edit')") |
| | | @Log(title = "捐献器官", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | @RepeatSubmit |
| | |
| | | * 删除捐献器官 |
| | | */ |
| | | @ApiOperation("删除捐献器官") |
| | | @PreAuthorize("@ss.hasPermi('project:donorchargeorgan:remove')") |
| | | // // @PreAuthorize("@ss.hasPermi('project:donorchargeorgan:remove')") |
| | | @Log(title = "捐献器官", businessType = BusinessType.DELETE) |
| | | @GetMapping("/remove/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) { |
| | |
| | | public TableDataInfo getListBySpStatChange(@RequestBody SpStatChangeReq spStatChangeReq) { |
| | | return getDataTable(serviceDonorchargeorganService.getListBySpStatChange(spStatChangeReq)); |
| | | } |
| | | |
| | | /** |
| | | * 导出收款统计 |
| | | */ |
| | | @ApiOperation("导出收款统计") |
| | | @Log(title = "收款统计", businessType = BusinessType.EXPORT) |
| | | @GetMapping("/exportChange") |
| | | public AjaxResult exportChange(SpStatChangeReq spStatChangeReq) { |
| | | List<SpStatChange> list = serviceDonorchargeorganService.getListBySpStatChange(spStatChangeReq); |
| | | ExcelUtil<SpStatChange> util = new ExcelUtil<SpStatChange>(SpStatChange.class); |
| | | return util.exportExcel(list, "收款统计数据"); |
| | | } |
| | | } |