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

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);
}
}

View File

@@ -84,6 +84,12 @@ public class OaProjectReportBo extends BaseEntity {
*/ */
private Long workType; private Long workType;
/**
* 修改创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date time;
// 新增多用户ID和时间范围 // 新增多用户ID和时间范围
private List<Long> userIds; private List<Long> userIds;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")

View File

@@ -130,6 +130,10 @@ public class OaProjectReportServiceImpl implements IOaProjectReportService {
@Override @Override
public Boolean updateByBo(OaProjectReportBo bo) { public Boolean updateByBo(OaProjectReportBo bo) {
OaProjectReport update = BeanUtil.toBean(bo, OaProjectReport.class); OaProjectReport update = BeanUtil.toBean(bo, OaProjectReport.class);
// 如果time字段不为空则用time覆盖createTime
if (bo.getTime() != null) {
update.setCreateTime(bo.getTime());
}
validEntityBeforeSave(update); validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0; return baseMapper.updateById(update) > 0;
} }