Commit ef50e72c by 杨伟程

老人月报

parent 50aa6365
...@@ -2,18 +2,23 @@ package com.makeit.module.controller.elder; ...@@ -2,18 +2,23 @@ package com.makeit.module.controller.elder;
import com.makeit.common.response.ApiResponseEntity; import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.platform.elder.PlatElderReportDTO; import com.makeit.dto.platform.elder.PlatElderReportDTO;
import com.makeit.service.platform.elder.PlatElderReportMonthService;
import com.makeit.vo.platform.elder.report.day.PlatElderHeartRespiratoryEvaluationVO; import com.makeit.vo.platform.elder.report.day.PlatElderHeartRespiratoryEvaluationVO;
import com.makeit.vo.platform.elder.report.day.PlatElderReportMonthVO; import com.makeit.vo.platform.elder.report.day.PlatElderReportMonthVO;
import com.makeit.vo.platform.elder.report.day.PlatElderSleepEvaluationVO; import com.makeit.vo.platform.elder.report.day.PlatElderSleepEvaluationVO;
import com.makeit.vo.platform.elder.report.week.PlatElderComprehensiveEvaluationVO; import com.makeit.vo.platform.elder.report.week.PlatElderComprehensiveEvaluationVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/** /**
* <p> * <p>
* 长者基本信息 前端控制器 * 长者基本信息 前端控制器
...@@ -27,6 +32,9 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -27,6 +32,9 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/plat/elder/report/month") @RequestMapping("/plat/elder/report/month")
public class PlatElderReportMonthController { public class PlatElderReportMonthController {
@Autowired
private PlatElderReportMonthService platElderReportMonthService;
@ApiOperation("综合评价") @ApiOperation("综合评价")
@PostMapping("comprehensiveEvaluation") @PostMapping("comprehensiveEvaluation")
public ApiResponseEntity<PlatElderComprehensiveEvaluationVO> comprehensiveEvaluation(@RequestBody PlatElderReportDTO platElderIdDTO) { public ApiResponseEntity<PlatElderComprehensiveEvaluationVO> comprehensiveEvaluation(@RequestBody PlatElderReportDTO platElderIdDTO) {
...@@ -48,8 +56,8 @@ public class PlatElderReportMonthController { ...@@ -48,8 +56,8 @@ public class PlatElderReportMonthController {
@ApiOperation("月报表") @ApiOperation("月报表")
@PostMapping("reportMonth") @PostMapping("reportMonth")
public ApiResponseEntity<PlatElderReportMonthVO> reportMonth(@RequestBody PlatElderReportDTO platElderIdDTO) { public ApiResponseEntity<List<PlatElderReportMonthVO>> reportMonth(@RequestBody PlatElderReportDTO platElderIdDTO) {
return null; return ApiResponseUtils.success(platElderReportMonthService.reportMonth(platElderIdDTO));
} }
......
...@@ -11,7 +11,7 @@ import java.time.LocalDateTime; ...@@ -11,7 +11,7 @@ import java.time.LocalDateTime;
/** /**
* <p> * <p>
* 长者基本信息server-service/src/main/java/com/makeit/server/platform/elder/PlatElderPhysicalReportService.java * 长者基本信息
* </p> * </p>
* *
* @author eugene young * @author eugene young
...@@ -20,12 +20,18 @@ import java.time.LocalDateTime; ...@@ -20,12 +20,18 @@ import java.time.LocalDateTime;
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel(value = "Elder对象", description = "长者基本信息") @ApiModel(value = "Elder对象", description = "长者基本信息")
public class PlatElderReportDTO extends PlatElderIdDTO{ public class PlatElderReportDTO extends PlatElderIdDTO {
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("日期") @ApiModelProperty("日期")
private LocalDate now; private LocalDate now;
@ApiModelProperty("月份")
private Integer year;
@ApiModelProperty("月份")
private Integer month;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("开始时间") @ApiModelProperty("开始时间")
private LocalDateTime startTime; private LocalDateTime startTime;
......
package com.makeit.service.platform.elder; package com.makeit.service.platform.elder;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.makeit.common.response.ApiResponseEntity;
import com.makeit.dto.platform.elder.PlatElderReportDTO;
import com.makeit.entity.platform.elder.PlatElderReportMonth; import com.makeit.entity.platform.elder.PlatElderReportMonth;
import com.makeit.vo.platform.elder.report.day.PlatElderReportMonthVO;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/** /**
* <p> * <p>
...@@ -13,4 +19,7 @@ import com.makeit.entity.platform.elder.PlatElderReportMonth; ...@@ -13,4 +19,7 @@ import com.makeit.entity.platform.elder.PlatElderReportMonth;
*/ */
public interface PlatElderReportMonthService extends IService<PlatElderReportMonth> { public interface PlatElderReportMonthService extends IService<PlatElderReportMonth> {
List<PlatElderReportMonthVO> reportMonth(PlatElderReportDTO platElderIdDTO);
} }
...@@ -105,7 +105,7 @@ public class PlatElderDayReportDayServiceImpl implements PlatElderDayReportDaySe ...@@ -105,7 +105,7 @@ public class PlatElderDayReportDayServiceImpl implements PlatElderDayReportDaySe
LocalDateTime start = dayStartNow(now); LocalDateTime start = dayStartNow(now);
LocalDateTime end = dayEndNow(now); LocalDateTime end = dayEndNow(now);
List<PlatElderSleepDiagramVO> voList = new ArrayList<>(10); List<PlatElderSleepDiagramVO> voList;
String nowString = DateTimeFormatter.ofPattern("yyyy-MM-dd").format(now); String nowString = DateTimeFormatter.ofPattern("yyyy-MM-dd").format(now);
......
package com.makeit.service.platform.elder.impl; package com.makeit.service.platform.elder.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.makeit.dto.platform.elder.PlatElderReportDTO;
import com.makeit.entity.platform.elder.PlatElderReportMonth; import com.makeit.entity.platform.elder.PlatElderReportMonth;
import com.makeit.mapper.platform.elder.PlatElderReportMonthMapper; import com.makeit.mapper.platform.elder.PlatElderReportMonthMapper;
import com.makeit.service.platform.elder.PlatElderReportMonthService; import com.makeit.service.platform.elder.PlatElderReportMonthService;
import com.makeit.utils.data.convert.BeanDtoVoUtils;
import com.makeit.utils.data.convert.StreamUtil;
import com.makeit.utils.time.LocalDateTimeUtils;
import com.makeit.vo.platform.elder.report.day.PlatElderReportMonthVO;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.util.List;
/** /**
* <p> * <p>
* 长者月报 服务实现类 * 长者月报 服务实现类
...@@ -17,4 +26,20 @@ import org.springframework.stereotype.Service; ...@@ -17,4 +26,20 @@ import org.springframework.stereotype.Service;
@Service @Service
public class PlatElderReportMonthServiceImpl extends ServiceImpl<PlatElderReportMonthMapper, PlatElderReportMonth> implements PlatElderReportMonthService { public class PlatElderReportMonthServiceImpl extends ServiceImpl<PlatElderReportMonthMapper, PlatElderReportMonth> implements PlatElderReportMonthService {
@Override
public List<PlatElderReportMonthVO> reportMonth(PlatElderReportDTO platElderIdDTO) {
LocalDate start = LocalDate.of(platElderIdDTO.getYear(), platElderIdDTO.getMonth(), 1);
LocalDate end = LocalDateTimeUtils.getMonthMax(start);
List<PlatElderReportMonth> monthList = list(new QueryWrapper<PlatElderReportMonth>().lambda()
.eq(PlatElderReportMonth::getElderId, platElderIdDTO.getElderId())
.ge(PlatElderReportMonth::getDay, start)
.le(PlatElderReportMonth::getDay, end)
);
List<PlatElderReportMonthVO> voList = BeanDtoVoUtils.listVo(monthList, PlatElderReportMonthVO.class);
return voList;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment