Commit 28e2f994 by 朱淼
parents c723baa3 4d63c04f
...@@ -8,6 +8,7 @@ import com.makeit.common.page.PageVO; ...@@ -8,6 +8,7 @@ import com.makeit.common.page.PageVO;
import com.makeit.common.response.ApiResponseEntity; import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils; import com.makeit.common.response.ApiResponseUtils;
import com.makeit.common.vo.ExcelImportVo; import com.makeit.common.vo.ExcelImportVo;
import com.makeit.dto.platform.elder.PlatElderAvatarDTO;
import com.makeit.dto.platform.elder.PlatElderCheckInDTO; import com.makeit.dto.platform.elder.PlatElderCheckInDTO;
import com.makeit.dto.platform.elder.PlatElderCheckOutDTO; import com.makeit.dto.platform.elder.PlatElderCheckOutDTO;
import com.makeit.dto.platform.elder.PlatElderQueryDTO; import com.makeit.dto.platform.elder.PlatElderQueryDTO;
...@@ -128,6 +129,13 @@ public class PlatElderController { ...@@ -128,6 +129,13 @@ public class PlatElderController {
return ApiResponseUtils.success(); return ApiResponseUtils.success();
} }
@ApiOperation("上传头像")
@PostMapping("uploadAvatar")
public ApiResponseEntity<?> uploadAvatar(@RequestBody PlatElderAvatarDTO dto) {
platElderService.uploadAvatar(dto);
return ApiResponseUtils.success();
}
} }
package com.makeit.dto.platform.elder;
import com.makeit.common.dto.BaseTenantDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 长者基本信息
* </p>
*
* @author eugene young
* @since 2023-08-29
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "Elder对象", description = "长者基本信息")
public class PlatElderAvatarDTO extends BaseTenantDTO {
@ApiModelProperty(value = "头像文件id")
private String avatar;
}
...@@ -52,6 +52,8 @@ public interface PlatElderService extends IService<PlatElder> { ...@@ -52,6 +52,8 @@ public interface PlatElderService extends IService<PlatElder> {
void delBatch(List<String> idList); void delBatch(List<String> idList);
void uploadAvatar(PlatElderAvatarDTO dto);
PlatDevice getBreathDevice(String id); PlatDevice getBreathDevice(String id);
List<PlatDevice> getSpaceDevice(String id); List<PlatDevice> getSpaceDevice(String id);
......
...@@ -17,7 +17,9 @@ import com.makeit.service.platform.elder.*; ...@@ -17,7 +17,9 @@ import com.makeit.service.platform.elder.*;
import com.makeit.service.saas.PlatTenantService; import com.makeit.service.saas.PlatTenantService;
import com.makeit.utils.data.convert.BeanDtoVoUtils; import com.makeit.utils.data.convert.BeanDtoVoUtils;
import com.makeit.utils.data.convert.StreamUtil; import com.makeit.utils.data.convert.StreamUtil;
import com.makeit.utils.data.validate.CollectionUtils;
import com.makeit.utils.data.validate.MapUtil; import com.makeit.utils.data.validate.MapUtil;
import com.makeit.utils.old.StringUtils;
import com.makeit.utils.time.LocalDateTimeUtils; import com.makeit.utils.time.LocalDateTimeUtils;
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;
...@@ -173,8 +175,10 @@ public class PlatElderReportMonthServiceImpl extends ServiceImpl<PlatElderReport ...@@ -173,8 +175,10 @@ public class PlatElderReportMonthServiceImpl extends ServiceImpl<PlatElderReport
List<DeviceInfoContentBreathe> breatheList = iotProductDeviceService.getDeviceLogByTimeRangeBreathe(platDevice.getOriDeviceId(), 2 * 24 * 3600, yesStart, yesEnd); List<DeviceInfoContentBreathe> breatheList = iotProductDeviceService.getDeviceLogByTimeRangeBreathe(platDevice.getOriDeviceId(), 2 * 24 * 3600, yesStart, yesEnd);
if (CollectionUtils.isNotEmpty(breatheList)) {
reportMonth.setHeartRate((int) (StreamUtil.reduce(breatheList, i -> (long) i.getProperties().getHr(), 0L, Long::sum) / breatheList.size())); reportMonth.setHeartRate((int) (StreamUtil.reduce(breatheList, i -> (long) i.getProperties().getHr(), 0L, Long::sum) / breatheList.size()));
reportMonth.setRespiratoryRate((int) (StreamUtil.reduce(breatheList, i -> (long) i.getProperties().getBr(), 0L, Long::sum) / breatheList.size())); reportMonth.setRespiratoryRate((int) (StreamUtil.reduce(breatheList, i -> (long) i.getProperties().getBr(), 0L, Long::sum) / breatheList.size()));
}
List<PlatAlarmRecord> rList = Optional.ofNullable(recordMap.get(e.getId())).orElse(new ArrayList<>(10)); List<PlatAlarmRecord> rList = Optional.ofNullable(recordMap.get(e.getId())).orElse(new ArrayList<>(10));
......
...@@ -9,10 +9,7 @@ import com.makeit.common.page.PageReqDTO; ...@@ -9,10 +9,7 @@ import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO; import com.makeit.common.page.PageVO;
import com.makeit.common.vo.ExcelErrorVo; import com.makeit.common.vo.ExcelErrorVo;
import com.makeit.common.vo.ExcelImportVo; import com.makeit.common.vo.ExcelImportVo;
import com.makeit.dto.platform.elder.PlatElderCheckInDTO; import com.makeit.dto.platform.elder.*;
import com.makeit.dto.platform.elder.PlatElderCheckOutDTO;
import com.makeit.dto.platform.elder.PlatElderImportDTO;
import com.makeit.dto.platform.elder.PlatElderQueryDTO;
import com.makeit.dto.platform.elder.add.*; import com.makeit.dto.platform.elder.add.*;
import com.makeit.dto.platform.space.PlatSpaceSplitDTO; import com.makeit.dto.platform.space.PlatSpaceSplitDTO;
import com.makeit.dto.platform.space.TreeDTOVO; import com.makeit.dto.platform.space.TreeDTOVO;
...@@ -855,6 +852,14 @@ public class PlatElderServiceImpl extends ServiceImpl<PlatElderMapper, PlatElder ...@@ -855,6 +852,14 @@ public class PlatElderServiceImpl extends ServiceImpl<PlatElderMapper, PlatElder
} }
@Override @Override
public void uploadAvatar(PlatElderAvatarDTO dto) {
PlatElder platElder = getById(dto.getId());
platElder.setAvatar(dto.getAvatar());
updateById(platElder);
}
@Override
public PlatDevice getBreathDevice(String id) { public PlatDevice getBreathDevice(String id) {
PlatElder platElder = getById(id); PlatElder platElder = getById(id);
......
...@@ -11,6 +11,7 @@ import com.makeit.module.system.dto.SysFileDTOVO; ...@@ -11,6 +11,7 @@ import com.makeit.module.system.dto.SysFileDTOVO;
import com.makeit.service.platform.sys.PlatLogoConfigService; import com.makeit.service.platform.sys.PlatLogoConfigService;
import com.makeit.utils.data.convert.BeanDtoVoUtils; import com.makeit.utils.data.convert.BeanDtoVoUtils;
import com.makeit.utils.sys.FileUtil; import com.makeit.utils.sys.FileUtil;
import jodd.util.StringUtil;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -44,7 +45,7 @@ public class PlatLogoConfigServiceImpl extends ServiceImpl<PlatLogoConfigMapper, ...@@ -44,7 +45,7 @@ public class PlatLogoConfigServiceImpl extends ServiceImpl<PlatLogoConfigMapper,
public PlatLogoConfigDTOVO view(PlatLogoConfigQueryDTO dto) { public PlatLogoConfigDTOVO view(PlatLogoConfigQueryDTO dto) {
LambdaQueryWrapper<PlatLogoConfig> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PlatLogoConfig> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(PlatLogoConfig::getCode,dto.getCode()); queryWrapper.eq(StringUtil.isNotEmpty(dto.getCode()),PlatLogoConfig::getCode,dto.getCode());
List<PlatLogoConfig> list = list(queryWrapper); List<PlatLogoConfig> list = list(queryWrapper);
PlatLogoConfigDTOVO data = new PlatLogoConfigDTOVO(); PlatLogoConfigDTOVO data = new PlatLogoConfigDTOVO();
......
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