报工时间修改 新增汇率接口
This commit is contained in:
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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")
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user