| | |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.project.domain.FunddetailReqVo; |
| | | import com.ruoyi.project.domain.ServiceFund; |
| | | import com.ruoyi.project.domain.ServiceFunddetail; |
| | | import com.ruoyi.project.domain.SpStatBonus; |
| | | import com.ruoyi.project.domain.SpStatBonusDept; |
| | |
| | | import com.ruoyi.project.domain.vo.TaxMoneyByItemEO; |
| | | import com.ruoyi.project.domain.vo.TaxMoneySumEO; |
| | | import com.ruoyi.project.domain.vo.TaxMoneyVO; |
| | | import com.ruoyi.project.service.IServiceFundService; |
| | | import com.ruoyi.project.service.IServiceFunddetailService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | public class ServiceFunddetailController extends BaseController { |
| | | @Autowired |
| | | private IServiceFunddetailService serviceFunddetailService; |
| | | |
| | | @Autowired |
| | | private IServiceFundService serviceFundService; |
| | | |
| | | /** |
| | | * 2026-11-17:该明细所属报销单是否要求附件名含中文。 |
| | | * 口径:专家劳务费(applytype=1)、伦理专家费(2) 不要求;医学成本(3)、办公费用(4) 等其他类型必须含中文。 |
| | | * 报销类型取父单 service_fund.ApplyType(明细行自身的 applytype 是费用项目类型,不能用于此判断)。 |
| | | * |
| | | * @return {@code true}=必须含中文 |
| | | */ |
| | | private boolean requireChineseName(ServiceFunddetail detail) { |
| | | if (detail == null || detail.getFundid() == null) { |
| | | return false; |
| | | } |
| | | try { |
| | | ServiceFund fund = serviceFundService.getById(detail.getFundid()); |
| | | if (fund == null || fund.getApplytype() == null) { |
| | | return false; |
| | | } |
| | | String type = String.valueOf(fund.getApplytype()).trim(); |
| | | return !("1".equals(type) || "2".equals(type)); |
| | | } catch (Exception e) { |
| | | // 取不到报销类型时不额外拦截,避免因读取异常把正常保存卡死 |
| | | log.warn("附件名中文校验获取报销类型失败,跳过中文校验:{}", e.getMessage()); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | // 2026-10-15:附件文件名规范二次校验(与前端 opo-web/src/utils/fileNameCheck.js 同口径, |
| | | // 目的是防止绕过前端直接调接口保存不合规附件名)。新增场景没有历史附件,用严格模式。 |
| | | String nameError = com.ruoyi.project.common.AttachmentNameValidator |
| | | .checkJsonList(serviceFunddetail.getInvoicefiles(), serviceFunddetail.getAnnexfiles()); |
| | | .checkJsonList(requireChineseName(serviceFunddetail), |
| | | serviceFunddetail.getInvoicefiles(), serviceFunddetail.getAnnexfiles()); |
| | | if (nameError != null) { |
| | | return AjaxResult.error("附件文件名不符合要求,无法保存:" + nameError); |
| | | } |
| | |
| | | } |
| | | } |
| | | String nameError = com.ruoyi.project.common.AttachmentNameValidator |
| | | .checkJsonListForUpdate(existingNames, serviceFunddetail.getInvoicefiles(), |
| | | serviceFunddetail.getAnnexfiles()); |
| | | .checkJsonListForUpdate(existingNames, requireChineseName(serviceFunddetail), |
| | | serviceFunddetail.getInvoicefiles(), serviceFunddetail.getAnnexfiles()); |
| | | if (nameError != null) { |
| | | return AjaxResult.error("附件文件名不符合要求,无法保存:" + nameError); |
| | | } |