package com.ruoyi.web.controller.project;
|
|
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.project.domain.CasePanorama;
|
import com.ruoyi.project.domain.CasePanoramaReq;
|
import com.ruoyi.project.service.ICasePanoramaService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import java.math.BigDecimal;
|
import java.util.List;
|
|
/**
|
* 案例全景
|
*
|
* @author ruoyi
|
* @date 2026-10-28
|
*/
|
@Slf4j
|
@Api("案例全景")
|
@RestController
|
@RequestMapping("/project/casePanorama")
|
public class CasePanoramaController extends BaseController {
|
|
@Autowired
|
private ICasePanoramaService casePanoramaService;
|
|
/**
|
* 查询案例全景
|
*/
|
@ApiOperation("查询案例全景")
|
@GetMapping("/list")
|
public TableDataInfo list(CasePanoramaReq req) {
|
startPage();
|
return getDataTable(casePanoramaService.selectCasePanoramaList(req));
|
}
|
|
/**
|
* 导出案例全景
|
*/
|
@ApiOperation("导出案例全景")
|
@Log(title = "案例全景", businessType = BusinessType.EXPORT)
|
@GetMapping("/export")
|
public AjaxResult export(CasePanoramaReq req) {
|
List<CasePanorama> list = casePanoramaService.selectCasePanoramaList(req);
|
for (CasePanorama row : list) {
|
blankZero(row);
|
}
|
ExcelUtil<CasePanorama> util = new ExcelUtil<CasePanorama>(CasePanorama.class);
|
return util.exportExcel(list, "案例全景数据");
|
}
|
|
/**
|
* 业务组下拉选项
|
*/
|
@ApiOperation("业务组下拉选项")
|
@GetMapping("/deptOptions")
|
public AjaxResult deptOptions() {
|
return AjaxResult.success(casePanoramaService.selectDeptNames());
|
}
|
|
/**
|
* 金额 0 导出为空
|
*/
|
private void blankZero(CasePanorama row) {
|
row.setTotalCost(blankZero(row.getTotalCost()));
|
row.setDonorFamilyCost(blankZero(row.getDonorFamilyCost()));
|
row.setMedCost(blankZero(row.getMedCost()));
|
row.setExpertCost(blankZero(row.getExpertCost()));
|
row.setItemCode34(blankZero(row.getItemCode34()));
|
row.setItemCode42(blankZero(row.getItemCode42()));
|
row.setItemCode46(blankZero(row.getItemCode46()));
|
row.setItemCode50(blankZero(row.getItemCode50()));
|
row.setItemCode44(blankZero(row.getItemCode44()));
|
row.setItemCode47(blankZero(row.getItemCode47()));
|
row.setItemCode48(blankZero(row.getItemCode48()));
|
row.setItemCode21(blankZero(row.getItemCode21()));
|
row.setItemCode12(blankZero(row.getItemCode12()));
|
row.setItemCode17(blankZero(row.getItemCode17()));
|
row.setItemCode23(blankZero(row.getItemCode23()));
|
row.setItemCode25(blankZero(row.getItemCode25()));
|
}
|
|
private BigDecimal blankZero(BigDecimal value) {
|
return (value == null || value.compareTo(BigDecimal.ZERO) == 0) ? null : value;
|
}
|
}
|