Commit 4f6e42f6 by 朱淼
parents 3498d151 bcdfae67
...@@ -32,6 +32,9 @@ VALUES ('300', 'device.status', '设备状态', '2022-05-16 17:08:33', '2022-05- ...@@ -32,6 +32,9 @@ VALUES ('300', 'device.status', '设备状态', '2022-05-16 17:08:33', '2022-05-
INSERT INTO sys_dictionary_category (id, code, name, create_date, update_date, del_flag) INSERT INTO sys_dictionary_category (id, code, name, create_date, update_date, del_flag)
VALUES ('1000', 'device.breathe.personState', '呼吸心率运动状态', '2022-05-16 17:08:33', '2022-05-16 17:08:37', '0'); VALUES ('1000', 'device.breathe.personState', '呼吸心率运动状态', '2022-05-16 17:08:33', '2022-05-16 17:08:37', '0');
INSERT INTO sys_dictionary_category (id, code, name, create_date, update_date, del_flag)
VALUES ('2000', 'elder.marriage', '长者婚姻状况', '2022-05-16 17:08:33', '2022-05-16 17:08:37', '0');
INSERT INTO sys_dictionary (id, code, name, value, sort, description, category_id, create_date, update_date, del_flag) INSERT INTO sys_dictionary (id, code, name, value, sort, description, category_id, create_date, update_date, del_flag)
VALUES ('1', 'common.status.yes', '是', '1', 1, '', '2', '2022-05-16 17:13:23', '2022-05-16 17:13:27', '0'); VALUES ('1', 'common.status.yes', '是', '1', 1, '', '2', '2022-05-16 17:13:23', '2022-05-16 17:13:27', '0');
...@@ -124,6 +127,12 @@ VALUES ('1002', 'device.breathe.personState.breathe', '呼吸', '2', 2, '', '100 ...@@ -124,6 +127,12 @@ VALUES ('1002', 'device.breathe.personState.breathe', '呼吸', '2', 2, '', '100
INSERT INTO sys_dictionary (id, code, name, value, sort, description, category_id, create_date, update_date, del_flag) INSERT INTO sys_dictionary (id, code, name, value, sort, description, category_id, create_date, update_date, del_flag)
VALUES ('1003', 'device.breathe.personState.enter', '进入呼吸', '3', 3, '', '1000', '2022-05-16 17:13:23', '2022-05-16 17:13:27', '0'); VALUES ('1003', 'device.breathe.personState.enter', '进入呼吸', '3', 3, '', '1000', '2022-05-16 17:13:23', '2022-05-16 17:13:27', '0');
INSERT INTO sys_dictionary (id, code, name, value, sort, description, category_id, create_date, update_date, del_flag)
VALUES ('2000', 'elder.marriage.no', '未婚', '0', 0, '', '2000', '2022-05-16 17:13:23', '2022-05-16 17:13:27', '0');
INSERT INTO sys_dictionary (id, code, name, value, sort, description, category_id, create_date, update_date, del_flag)
VALUES ('2001', 'elder.marriage.yes', '已婚', '1', 1, '', '2000', '2022-05-16 17:13:23', '2022-05-16 17:13:27', '0');
INSERT INTO sys_config_category (id, tenant_id, code, name, create_date, update_date, del_flag, create_by, update_by, eng_name) VALUES ('1', '0', 'elder.certificateType', '长者证件类型', '2023-07-11 10:55:06', '2023-07-11 10:55:08', '0', null, null, null); INSERT INTO sys_config_category (id, tenant_id, code, name, create_date, update_date, del_flag, create_by, update_by, eng_name) VALUES ('1', '0', 'elder.certificateType', '长者证件类型', '2023-07-11 10:55:06', '2023-07-11 10:55:08', '0', null, null, null);
INSERT INTO sys_config_category (id, tenant_id, code, name, create_date, update_date, del_flag, create_by, update_by, eng_name) VALUES ('2', '0', 'elder.blood', '长者血型', '2023-07-11 10:55:06', '2023-07-11 10:55:08', '0', null, null, null); INSERT INTO sys_config_category (id, tenant_id, code, name, create_date, update_date, del_flag, create_by, update_by, eng_name) VALUES ('2', '0', 'elder.blood', '长者血型', '2023-07-11 10:55:06', '2023-07-11 10:55:08', '0', null, null, null);
...@@ -135,6 +144,8 @@ INSERT INTO sys_config_category (id, tenant_id, code, name, create_date, update_ ...@@ -135,6 +144,8 @@ INSERT INTO sys_config_category (id, tenant_id, code, name, create_date, update_
INSERT INTO sys_config_category (id, tenant_id, code, name, create_date, update_date, del_flag, create_by, update_by, eng_name) VALUES ('8', '0', 'elder.education', '长者文化程度', '2023-07-11 10:55:06', '2023-07-11 10:55:08', '0', null, null, null); INSERT INTO sys_config_category (id, tenant_id, code, name, create_date, update_date, del_flag, create_by, update_by, eng_name) VALUES ('8', '0', 'elder.education', '长者文化程度', '2023-07-11 10:55:06', '2023-07-11 10:55:08', '0', null, null, null);
INSERT INTO sys_config_category (id, tenant_id, code, name, create_date, update_date, del_flag, create_by, update_by, eng_name) VALUES ('9', '0', 'elder.belief', '长者宗教信仰', '2023-07-11 10:55:06', '2023-07-11 10:55:08', '0', null, null, null); INSERT INTO sys_config_category (id, tenant_id, code, name, create_date, update_date, del_flag, create_by, update_by, eng_name) VALUES ('9', '0', 'elder.belief', '长者宗教信仰', '2023-07-11 10:55:06', '2023-07-11 10:55:08', '0', null, null, null);
INSERT INTO sys_config_category (id, tenant_id, code, name, create_date, update_date, del_flag, create_by, update_by, eng_name) VALUES ('10', '0', 'elder.income', '长者收入水平', '2023-07-11 10:55:06', '2023-07-11 10:55:08', '0', null, null, null); INSERT INTO sys_config_category (id, tenant_id, code, name, create_date, update_date, del_flag, create_by, update_by, eng_name) VALUES ('10', '0', 'elder.income', '长者收入水平', '2023-07-11 10:55:06', '2023-07-11 10:55:08', '0', null, null, null);
INSERT INTO sys_config_category (id, tenant_id, code, name, create_date, update_date, del_flag, create_by, update_by, eng_name) VALUES ('11', '0', 'elder.marriage', '长者婚姻狀況', '2023-07-11 10:55:06', '2023-07-11 10:55:08', '0', null, null, null);
INSERT INTO sys_config (id, tenant_id, code, name, value, sort, description, category_id, create_date, update_date, del_flag, create_by, update_by, eng_name) VALUES ('1', '0', 'elder.certificateType.idCard', '身份证', '1', DEFAULT, DEFAULT, '1', '2023-07-11 10:57:57', '2023-07-11 10:58:02', '0', null, null, null); INSERT INTO sys_config (id, tenant_id, code, name, value, sort, description, category_id, create_date, update_date, del_flag, create_by, update_by, eng_name) VALUES ('1', '0', 'elder.certificateType.idCard', '身份证', '1', DEFAULT, DEFAULT, '1', '2023-07-11 10:57:57', '2023-07-11 10:58:02', '0', null, null, null);
...@@ -156,6 +167,9 @@ INSERT INTO sys_config (id, tenant_id, code, name, value, sort, description, cat ...@@ -156,6 +167,9 @@ INSERT INTO sys_config (id, tenant_id, code, name, value, sort, description, cat
INSERT INTO sys_config (id, tenant_id, code, name, value, sort, description, category_id, create_date, update_date, del_flag, create_by, update_by, eng_name) VALUES ('10', '0', 'elder.income.low', '低收入', '1', DEFAULT, DEFAULT, '10', '2023-07-11 10:57:57', '2023-07-11 10:58:02', '0', null, null, null); INSERT INTO sys_config (id, tenant_id, code, name, value, sort, description, category_id, create_date, update_date, del_flag, create_by, update_by, eng_name) VALUES ('10', '0', 'elder.income.low', '低收入', '1', DEFAULT, DEFAULT, '10', '2023-07-11 10:57:57', '2023-07-11 10:58:02', '0', null, null, null);
INSERT INTO sys_config (id, tenant_id, code, name, value, sort, description, category_id, create_date, update_date, del_flag, create_by, update_by, eng_name) VALUES ('20', '0', 'elder.marriage.no', '未婚', '0', DEFAULT, DEFAULT, '11', '2023-07-11 10:57:57', '2023-07-11 10:58:02', '0', null, null, null);
INSERT INTO sys_config (id, tenant_id, code, name, value, sort, description, category_id, create_date, update_date, del_flag, create_by, update_by, eng_name) VALUES ('21', '0', 'elder.marriage.yes', '已婚', '1', DEFAULT, DEFAULT, '11', '2023-07-11 10:57:57', '2023-07-11 10:58:02', '0', null, null, null);
...@@ -8,6 +8,7 @@ package com.makeit.global.validator; ...@@ -8,6 +8,7 @@ package com.makeit.global.validator;
import com.makeit.enums.BaseEnum; import com.makeit.enums.BaseEnum;
import com.makeit.utils.data.locale.LocaleUtil; import com.makeit.utils.data.locale.LocaleUtil;
import com.makeit.utils.old.StringUtils;
import org.hibernate.validator.constraintvalidation.HibernateConstraintValidatorContext; import org.hibernate.validator.constraintvalidation.HibernateConstraintValidatorContext;
import org.hibernate.validator.internal.util.logging.Log; import org.hibernate.validator.internal.util.logging.Log;
import org.hibernate.validator.internal.util.logging.LoggerFactory; import org.hibernate.validator.internal.util.logging.LoggerFactory;
...@@ -50,11 +51,16 @@ public class DictEnumValidator implements ConstraintValidator<DictEnum, String> ...@@ -50,11 +51,16 @@ public class DictEnumValidator implements ConstraintValidator<DictEnum, String>
return true; return true;
} }
//TODO ywc 因为StringTrimRequestBodyAdvice变更
if (StringUtils.isBlank(value)) {
return true;
}
if (constraintValidatorContext instanceof HibernateConstraintValidatorContext) { if (constraintValidatorContext instanceof HibernateConstraintValidatorContext) {
// if(){ // if(){
String s = Arrays.stream(em.getEnumConstants()).map(e -> e.getValue() + e.getName()).collect(Collectors.joining(" ")); String s = Arrays.stream(em.getEnumConstants()).map(e -> e.getValue() + e.getName()).collect(Collectors.joining(" "));
//constraintValidatorContext.unwrap(HibernateConstraintValidatorContext.class).addMessageParameter("m", "可选值为 " + s); //constraintValidatorContext.unwrap(HibernateConstraintValidatorContext.class).addMessageParameter("m", "可选值为 " + s);
constraintValidatorContext.unwrap(HibernateConstraintValidatorContext.class).addMessageParameter("m", String.format(LocaleUtil.getMessage("validation.error.system.dict.option"), s)); constraintValidatorContext.unwrap(HibernateConstraintValidatorContext.class).addMessageParameter("m", String.format(LocaleUtil.getMessage("validation.error.system.dict.option"), s));
// //
} }
......
...@@ -7,6 +7,7 @@ import com.makeit.common.page.PageVO; ...@@ -7,6 +7,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.entity.saas.PlatTenant; import com.makeit.entity.saas.PlatTenant;
import com.makeit.global.annotation.AuthIgnore;
import com.makeit.module.admin.dto.plat.PlatTenantDTOVO; import com.makeit.module.admin.dto.plat.PlatTenantDTOVO;
import com.makeit.module.admin.vo.plat.PlatTenantVO; import com.makeit.module.admin.vo.plat.PlatTenantVO;
import com.makeit.service.saas.PlatTenantService; import com.makeit.service.saas.PlatTenantService;
...@@ -53,14 +54,16 @@ public class PlatTenantChildrenController { ...@@ -53,14 +54,16 @@ public class PlatTenantChildrenController {
@ApiOperation("分页列表(AuthIgnore)") @ApiOperation("分页列表(AuthIgnore)")
@PostMapping("pageAuthIgnore") @PostMapping("pageAuthIgnore")
@AuthIgnore
public ApiResponseEntity<PageVO<PlatTenantVO>> pageAuthIgnore(@RequestBody PageReqDTO<PlatTenantVO> page){ public ApiResponseEntity<PageVO<PlatTenantVO>> pageAuthIgnore(@RequestBody PageReqDTO<PlatTenantVO> page){
return ApiResponseUtils.success(platTenantService.page(page)); return ApiResponseUtils.success(platTenantService.pageAuthIgnore(page));
} }
@ApiOperation("列表(AuthIgnore)") @ApiOperation("列表(AuthIgnore)")
@PostMapping("listAuthIgnore") @PostMapping("listAuthIgnore")
@AuthIgnore
public ApiResponseEntity<List<PlatTenant>> listAuthIgnore(@RequestBody PlatTenantVO dto){ public ApiResponseEntity<List<PlatTenant>> listAuthIgnore(@RequestBody PlatTenantVO dto){
return ApiResponseUtils.success(platTenantService.list(dto)); return ApiResponseUtils.success(platTenantService.listAuthIgnore(dto));
} }
@ApiOperation("列表 根据账号精确查询") @ApiOperation("列表 根据账号精确查询")
......
...@@ -37,7 +37,7 @@ public class PlatRoomBedDeviceController { ...@@ -37,7 +37,7 @@ public class PlatRoomBedDeviceController {
@ApiOperation("设备列表(选择设备)-房间绑定") @ApiOperation("设备列表(选择设备)-房间绑定")
@PostMapping("pageRoomDevice") @PostMapping("pageRoomDevice")
public ApiResponseEntity<PageVO<PlatDeviceDTO>> pageRoomDevice(@RequestBody PageReqDTO<PlatSpaceDeviceQueryDTO> page) { public ApiResponseEntity<PageVO<PlatDeviceDTO>> pageRoomDevice(@RequestBody PageReqDTO<PlatSpaceDeviceQueryDTO> page) {
page.getData().setIsRoom(CommonEnum.YES.getValue()); //page.getData().setIsRoom(CommonEnum.YES.getValue());
PageVO<PlatDeviceDTO> data = platRoomBedDeviceService.pageDevice(page); PageVO<PlatDeviceDTO> data = platRoomBedDeviceService.pageDevice(page);
return ApiResponseUtils.success(data); return ApiResponseUtils.success(data);
} }
......
...@@ -18,6 +18,20 @@ public class PlatElderEnum { ...@@ -18,6 +18,20 @@ public class PlatElderEnum {
} }
} }
public enum MarriageEnum implements BaseEnum {
MAN("elder.marriage.no"), WOMAN("elder.marriage.yes");
private String code;
MarriageEnum(String code) {
this.code = code;
}
public String getValue() {
return SysDictUtil.getValue(code);
}
}
public enum MedicalInsuranceEnum implements BaseEnum { public enum MedicalInsuranceEnum implements BaseEnum {
YES("elder.medicalInsurance.yes"), NO("elder.medicalInsurance.no"); YES("elder.medicalInsurance.yes"), NO("elder.medicalInsurance.no");
......
...@@ -48,4 +48,6 @@ public interface PlatElderDayReportWeekService { ...@@ -48,4 +48,6 @@ public interface PlatElderDayReportWeekService {
List<PlatElderBehaviorDistributionVO> behaviorDistribution(PlatElderReportDTO platElderIdDTO); List<PlatElderBehaviorDistributionVO> behaviorDistribution(PlatElderReportDTO platElderIdDTO);
void heartRespiratoryJob();
} }
...@@ -4,14 +4,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -4,14 +4,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.makeit.dto.platform.elder.PlatElderReportDTO; import com.makeit.dto.platform.elder.PlatElderReportDTO;
import com.makeit.entity.platform.device.PlatDevice; import com.makeit.entity.platform.device.PlatDevice;
import com.makeit.entity.platform.elder.PlatElderBreatheAnalysis; import com.makeit.entity.platform.elder.*;
import com.makeit.entity.platform.elder.PlatElderBreatheDayStat;
import com.makeit.entity.platform.elder.PlatElderSleep;
import com.makeit.entity.platform.elder.PlatElderSleepAnalysis;
import com.makeit.enums.platform.alarm.PlatAlarmConfigEnum; import com.makeit.enums.platform.alarm.PlatAlarmConfigEnum;
import com.makeit.enums.report.SleepTypeEnum; import com.makeit.enums.report.SleepTypeEnum;
import com.makeit.module.iot.service.IotProductDeviceService;
import com.makeit.module.iot.vo.analysis.EvaluateReportVO; import com.makeit.module.iot.vo.analysis.EvaluateReportVO;
import com.makeit.module.iot.vo.breathe.DeviceInfoContentBreathe;
import com.makeit.service.platform.elder.*; import com.makeit.service.platform.elder.*;
import com.makeit.service.saas.PlatTenantService;
import com.makeit.service.saas.SaasDiseaseReportService; import com.makeit.service.saas.SaasDiseaseReportService;
import com.makeit.service.saas.SaasElderReportConfigService; import com.makeit.service.saas.SaasElderReportConfigService;
import com.makeit.service.saas.SaasSleepEvaluateReportService; import com.makeit.service.saas.SaasSleepEvaluateReportService;
...@@ -45,6 +45,12 @@ import java.util.stream.Collectors; ...@@ -45,6 +45,12 @@ import java.util.stream.Collectors;
public class PlatElderDayReportWeekServiceImpl implements PlatElderDayReportWeekService { public class PlatElderDayReportWeekServiceImpl implements PlatElderDayReportWeekService {
@Autowired @Autowired
private PlatElderService platElderService;
@Autowired
private PlatTenantService platTenantService;
@Autowired
private PlatElderRealTimeService platElderRealTimeService; private PlatElderRealTimeService platElderRealTimeService;
@Autowired @Autowired
...@@ -71,6 +77,9 @@ public class PlatElderDayReportWeekServiceImpl implements PlatElderDayReportWeek ...@@ -71,6 +77,9 @@ public class PlatElderDayReportWeekServiceImpl implements PlatElderDayReportWeek
@Autowired @Autowired
private PlatElderBreatheDayStatService platElderBreatheDayStatService; private PlatElderBreatheDayStatService platElderBreatheDayStatService;
@Autowired
private IotProductDeviceService iotProductDeviceService;
private LocalDateTime weekStartDateTime(LocalDateTime defaultTime) { private LocalDateTime weekStartDateTime(LocalDateTime defaultTime) {
return weekStartDateTime(LocalDate.now().minusDays(1), defaultTime); return weekStartDateTime(LocalDate.now().minusDays(1), defaultTime);
} }
...@@ -423,7 +432,51 @@ public class PlatElderDayReportWeekServiceImpl implements PlatElderDayReportWeek ...@@ -423,7 +432,51 @@ public class PlatElderDayReportWeekServiceImpl implements PlatElderDayReportWeek
List<LocalDate> dateList = LocalDateTimeUtils.getDateSeries(weekStartDate, weekEndDate); List<LocalDate> dateList = LocalDateTimeUtils.getDateSeries(weekStartDate, weekEndDate);
return platElderDayReportDayService.behaviorDistributionInternal(platElderIdDTO, dateList); return platElderDayReportDayService.behaviorDistributionInternal(platElderIdDTO, dateList);
}
@Override
public void heartRespiratoryJob() {
LocalDate nowDate = LocalDate.now();
LocalDate yesDate = nowDate.minusDays(1);
LocalDateTime yesStart = LocalDateTimeUtils.getDayStart(yesDate);
LocalDateTime yesEnd = LocalDateTimeUtils.getDayEnd(yesDate);
List<PlatElderBreatheDayStat> breatheDayStatList = new ArrayList<>(10);
platTenantService.executeTenantList(() -> {
List<PlatElder> elderList = platElderService.list(new QueryWrapper<PlatElder>().lambda()
.isNotNull(PlatElder::getBedId));
elderList.forEach(e -> {
PlatDevice platDevice = platElderRealTimeService.getBreathDevice(e.getId(), null);
PlatElderBreatheDayStat platElderBreatheDayStat = new PlatElderBreatheDayStat();
platElderBreatheDayStat.setElderId(e.getId());
platElderBreatheDayStat.setDeviceId(platDevice.getId());
platElderBreatheDayStat.setOriDeviceId(platDevice.getOriDeviceId());
platElderBreatheDayStat.setDay(yesDate);
List<DeviceInfoContentBreathe> breatheList = iotProductDeviceService.getDeviceLogByTimeRangeBreathe(platDevice.getOriDeviceId(), 2 * 24 * 3600, yesStart, yesEnd);
platElderBreatheDayStat.setHeartRateMax(breatheList.stream().map(i -> i.getProperties().getHr()).max(Integer::compareTo).orElse(null));
platElderBreatheDayStat.setHeartRateMin(breatheList.stream().map(i -> i.getProperties().getHr()).min(Integer::compareTo).orElse(null));
platElderBreatheDayStat.setHeartRateAvg((int) (StreamUtil.reduce(breatheList, i -> (long) i.getProperties().getHr(), 0L, Long::sum) / breatheList.size()));
platElderBreatheDayStat.setRespiratoryRateMax(breatheList.stream().map(i -> i.getProperties().getBr()).max(Integer::compareTo).orElse(null));
platElderBreatheDayStat.setRespiratoryRateMin(breatheList.stream().map(i -> i.getProperties().getBr()).min(Integer::compareTo).orElse(null));
platElderBreatheDayStat.setRespiratoryRateAvg((int) (StreamUtil.reduce(breatheList, i -> (long) i.getProperties().getBr(), 0L, Long::sum) / breatheList.size()));
breatheDayStatList.add(platElderBreatheDayStat);
});
platElderBreatheDayStatService.saveBatch(breatheDayStatList);
});
} }
} }
...@@ -531,6 +531,7 @@ public class PlatElderServiceImpl extends ServiceImpl<PlatElderMapper, PlatElder ...@@ -531,6 +531,7 @@ public class PlatElderServiceImpl extends ServiceImpl<PlatElderMapper, PlatElder
save(platElder); save(platElder);
dto.setId(platElder.getId());
addOrEditExt(dto); addOrEditExt(dto);
if (StringUtils.isNotBlank(dto.getBedId())) { if (StringUtils.isNotBlank(dto.getBedId())) {
......
...@@ -88,8 +88,8 @@ public class PlatRoomBedDeviceServiceImpl extends ServiceImpl<PlatRoomBedDeviceM ...@@ -88,8 +88,8 @@ public class PlatRoomBedDeviceServiceImpl extends ServiceImpl<PlatRoomBedDeviceM
if (StringUtil.isNotEmpty(dto.getRoomId())) { if (StringUtil.isNotEmpty(dto.getRoomId())) {
queryWrapper1.ne(PlatRoomBedDevice::getRoomId, dto.getRoomId()); queryWrapper1.ne(PlatRoomBedDevice::getRoomId, dto.getRoomId());
} }
if (CommonEnum.YES.getValue().equals(dto.getIsRoom())) { if (CommonEnum.NO.getValue().equals(dto.getIsRoom())) {
queryWrapper1.isNull(PlatRoomBedDevice::getBedId); queryWrapper1.isNotNull(PlatRoomBedDevice::getBedId);
} }
List<PlatRoomBedDevice> list = list(queryWrapper1); List<PlatRoomBedDevice> list = list(queryWrapper1);
List<String> listEquipmentIds = list.stream().map(item -> item.getDeviceId()).collect(Collectors.toList()); List<String> listEquipmentIds = list.stream().map(item -> item.getDeviceId()).collect(Collectors.toList());
......
...@@ -12,6 +12,7 @@ import com.makeit.entity.platform.space.PlatBed; ...@@ -12,6 +12,7 @@ import com.makeit.entity.platform.space.PlatBed;
import com.makeit.entity.platform.space.PlatRoom; import com.makeit.entity.platform.space.PlatRoom;
import com.makeit.entity.platform.space.PlatSpace; import com.makeit.entity.platform.space.PlatSpace;
import com.makeit.enums.CodeMessageEnum; import com.makeit.enums.CodeMessageEnum;
import com.makeit.enums.CommonEnum;
import com.makeit.enums.platform.space.PlatSpaceEnum; import com.makeit.enums.platform.space.PlatSpaceEnum;
import com.makeit.exception.BusinessException; import com.makeit.exception.BusinessException;
import com.makeit.mapper.platform.space.PlatSpaceMapper; import com.makeit.mapper.platform.space.PlatSpaceMapper;
...@@ -174,7 +175,9 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace ...@@ -174,7 +175,9 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
List<PlatRoom> listRoom = platRoomService.list(new LambdaQueryWrapper<>()); List<PlatRoom> listRoom = platRoomService.list(new LambdaQueryWrapper<>());
//床位 //床位
List<PlatBed> listBeds = platBedService.list(new LambdaQueryWrapper<>()); LambdaQueryWrapper<PlatBed> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(PlatBed::getStatus, CommonEnum.YES.getValue());
List<PlatBed> listBeds = platBedService.list(queryWrapper1);
Map<String,List<PlatBed>> mapBed = listBeds.stream().collect(Collectors.groupingBy(PlatBed::getRoomId)); Map<String,List<PlatBed>> mapBed = listBeds.stream().collect(Collectors.groupingBy(PlatBed::getRoomId));
List<PlatSpaceVO> listRoomVo = new ArrayList<>(); List<PlatSpaceVO> listRoomVo = new ArrayList<>();
...@@ -202,7 +205,8 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace ...@@ -202,7 +205,8 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
//父级 //父级
List<PlatSpaceVO> listParent = listSpaceVo.stream().filter(item->StringUtil.isEmpty(item.getParentId())).collect(Collectors.toList()); List<PlatSpaceVO> listParent = listSpaceVo.stream().filter(item->StringUtil.isEmpty(item.getParentId())).
collect(Collectors.toList());
//子集 //子集
List<PlatSpaceVO> listChild = listSpaceVo.stream().filter(item->item.getParentId() != null).collect(Collectors.toList()); List<PlatSpaceVO> listChild = listSpaceVo.stream().filter(item->item.getParentId() != null).collect(Collectors.toList());
......
...@@ -21,6 +21,10 @@ public interface PlatTenantService extends IService<PlatTenant> { ...@@ -21,6 +21,10 @@ public interface PlatTenantService extends IService<PlatTenant> {
List<PlatTenant> list(PlatTenantVO dto); List<PlatTenant> list(PlatTenantVO dto);
PageVO<PlatTenantVO> pageAuthIgnore(PageReqDTO<PlatTenantVO> page);
List<PlatTenant> listAuthIgnore(PlatTenantVO dto);
List<PlatTenant> listByUserIdAndAccount(PlatTenantVO dto); List<PlatTenant> listByUserIdAndAccount(PlatTenantVO dto);
String add(PlatTenantDTOVO dto); String add(PlatTenantDTOVO dto);
......
...@@ -106,6 +106,27 @@ public class PlatTenantServiceImpl extends ServiceImpl<PlatTenantMapper, PlatTen ...@@ -106,6 +106,27 @@ public class PlatTenantServiceImpl extends ServiceImpl<PlatTenantMapper, PlatTen
return lambdaQueryWrapper; return lambdaQueryWrapper;
} }
private LambdaQueryWrapper<PlatTenant> listLambdaQueryWrapperAuthIgnore(PlatTenantVO dto, boolean userAccountLike) {
List<String> tenantUserIdList = new ArrayList<>(10);
tenantUserIdList.add(-1 + "");
if (StringUtils.isNotBlank(dto.getUserAccount())) {
List<PlatUser> tntUserList = platUserService.list(new QueryWrapper<PlatUser>().lambda()
.like(userAccountLike, PlatUser::getAccount, dto.getUserAccount())
.eq(!userAccountLike, PlatUser::getAccount, dto.getUserAccount())
.eq(PlatUser::getIsTenant, IsTenantAccountEnum.YES.getValue())
);
tenantUserIdList.addAll(StreamUtil.map(tntUserList, PlatUser::getId));
}
LambdaQueryWrapper<PlatTenant> lambdaQueryWrapper = new QueryWrapper<PlatTenant>().lambda()
.like(StringUtils.isNotBlank(dto.getName()), PlatTenant::getName, dto.getName())
.eq(StringUtils.isNotBlank(dto.getStatus()), PlatTenant::getStatus, dto.getStatus())
.in(StringUtils.isNotBlank(dto.getUserAccount()), PlatTenant::getPlatUserId, tenantUserIdList)
;
lambdaQueryWrapper.orderByDesc(PlatTenant::getCreateDate);
return lambdaQueryWrapper;
}
@Override @Override
public List<PlatTenant> list(PlatTenantVO dto) { public List<PlatTenant> list(PlatTenantVO dto) {
LambdaQueryWrapper<PlatTenant> lambdaQueryWrapper = listLambdaQueryWrapper(dto, true); LambdaQueryWrapper<PlatTenant> lambdaQueryWrapper = listLambdaQueryWrapper(dto, true);
...@@ -114,6 +135,13 @@ public class PlatTenantServiceImpl extends ServiceImpl<PlatTenantMapper, PlatTen ...@@ -114,6 +135,13 @@ public class PlatTenantServiceImpl extends ServiceImpl<PlatTenantMapper, PlatTen
} }
@Override @Override
public List<PlatTenant> listAuthIgnore(PlatTenantVO dto) {
LambdaQueryWrapper<PlatTenant> lambdaQueryWrapper = listLambdaQueryWrapperAuthIgnore(dto, true);
List<PlatTenant> tntTenantList = list(lambdaQueryWrapper);
return tntTenantList;
}
@Override
public List<PlatTenant> listByUserIdAndAccount(PlatTenantVO dto) { public List<PlatTenant> listByUserIdAndAccount(PlatTenantVO dto) {
LambdaQueryWrapper<PlatTenant> lambdaQueryWrapper = listLambdaQueryWrapper(dto, false); LambdaQueryWrapper<PlatTenant> lambdaQueryWrapper = listLambdaQueryWrapper(dto, false);
List<PlatTenant> tntTenantList = list(lambdaQueryWrapper); List<PlatTenant> tntTenantList = list(lambdaQueryWrapper);
...@@ -142,6 +170,28 @@ public class PlatTenantServiceImpl extends ServiceImpl<PlatTenantMapper, PlatTen ...@@ -142,6 +170,28 @@ public class PlatTenantServiceImpl extends ServiceImpl<PlatTenantMapper, PlatTen
return PageUtil.toPageVO(voList, pageList); return PageUtil.toPageVO(voList, pageList);
} }
@Override
public PageVO<PlatTenantVO> pageAuthIgnore(PageReqDTO<PlatTenantVO> page) {
PlatTenantVO dto = page.getData();
Page<PlatTenant> p = PageUtil.toMpPage(page);
LambdaQueryWrapper<PlatTenant> lambdaQueryWrapper = listLambdaQueryWrapperAuthIgnore(dto, true);
Page<PlatTenant> pageList = page(p, lambdaQueryWrapper);
List<PlatTenantVO> voList = BeanDtoVoUtils.listVo(pageList.getRecords(), PlatTenantVO.class);
TntUserJoinUtil.join(platUserService, voList, qw -> qw.eq(PlatUser::getIsTenant, IsTenantAccountEnum.YES.getValue()),
PlatTenantVO::getPlatUserId, (t, u) -> {
t.setUserAccount(u.getAccount());
t.setUserName(u.getUsername());
}, BaseEntity::getId);
return PageUtil.toPageVO(voList, pageList);
}
private void checkName(PlatTenantDTOVO dto) { private void checkName(PlatTenantDTOVO dto) {
PlatTenant tntTenant = getOne( PlatTenant tntTenant = getOne(
new QueryWrapper<PlatTenant>().lambda() new QueryWrapper<PlatTenant>().lambda()
......
package com.makeit.task;
import com.makeit.service.platform.elder.PlatElderDayReportWeekService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Component
public class HeartRespiratoryTask {
@Autowired
private PlatElderDayReportWeekService platElderDayReportWeekService;
@Scheduled(cron = "0 0 2 * * ? ")
public void job(){
platElderDayReportWeekService.heartRespiratoryJob();
}
}
...@@ -6,7 +6,7 @@ import org.springframework.scheduling.annotation.Scheduled; ...@@ -6,7 +6,7 @@ import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@Component @Component
public class ReportMonthJob { public class ReportMonthTask {
@Autowired @Autowired
private PlatElderReportMonthService platElderReportMonthService; private PlatElderReportMonthService platElderReportMonthService;
......
package com.makeit.vo.platform.elder.report.day; package com.makeit.vo.platform.elder.report.day;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -8,10 +9,10 @@ import java.time.LocalDate; ...@@ -8,10 +9,10 @@ import java.time.LocalDate;
@Data @Data
public class PlatElderReportMonthVO { public class PlatElderReportMonthVO {
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("日期") @ApiModelProperty("日期")
private LocalDate day; private LocalDate day;
@ApiModelProperty("睡眠结果") @ApiModelProperty("睡眠结果")
private String sleepResult; private String sleepResult;
......
...@@ -125,7 +125,7 @@ interceptor: ...@@ -125,7 +125,7 @@ interceptor:
authorizationSaasPathIgnore: /saas/login/login authorizationSaasPathIgnore: /saas/login/login
authenticationWechatPath: /children/**,/wechat/** authenticationWechatPath: /children/**,/wechat/**
authenticationWechatPathIgnore: /children/login/login,/wechat/plat/login/login authenticationWechatPathIgnore: /children/login/login,/wechat/plat/login/login,/children/tenant/pageAuthIgnore,/children/tenant/listAuthIgnore
sign: sign:
flag: true flag: true
......
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