报工时间修改 新增汇率接口

This commit is contained in:
2025-07-04 10:40:26 +08:00
parent d542095080
commit 7fb6472b19
3 changed files with 42 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
package com.ruoyi.oa.controller;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.oa.service.IExchangeRateService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.util.Date;
@RestController
@Validated
@RequiredArgsConstructor
@RequestMapping("/oa/exchangeRate")
public class OaExchangeRateController extends BaseController {
private final IExchangeRateService oaExchangeRateService;
/**
* 获取指定日期的美元兑人民币汇率
*/
@GetMapping("/usd2cny")
public BigDecimal getUsd2CnyRate(@RequestParam(required = false) Date date) {
if (date == null) {
date = new Date();
}
return oaExchangeRateService.getUsdExchangeRate(date);
}
}