Commit 0535483c by 汪志阳

离床异常调试

parent 098dcc25
......@@ -28,6 +28,10 @@ public class DataScopeHandler {
if (where == null) {
where = new HexValue(" 1 = 1 ");
}
if ("com.makeit.mapper.platform.auth.PlatUserMapper.listAll".equals(whereSegment)) {
ItemsList delFlag = new ExpressionList(Stream.of("0").map(LongValue::new).collect(Collectors.toList()));
return new AndExpression(where, new InExpression(new Column("del_flag"), delFlag));
}
Table fromItem = (Table) plainSelect.getFromItem();
// 有别名用别名,无别名用表名,防止字段冲突报错
Alias fromItemAlias = fromItem.getAlias();
......
......@@ -23,16 +23,16 @@ import java.time.LocalTime;
public class PlatAlarmConfigOffBedDTOVO {
@ApiModelProperty("离床开始时间")
@DateTimeFormat(pattern = "HH:mm")
@JsonFormat(pattern = "HH:mm",timezone="GMT+8")
@DateTimeFormat(pattern = "HH:mm:ss")
@JsonFormat(pattern = "HH:mm:ss",timezone="GMT+8")
private LocalTime offBedStart;
@ApiModelProperty("离床时间类型 :1-当日,2-次日")
private String startTimeType;
@ApiModelProperty("离床结束时间")
@DateTimeFormat(pattern = "HH:mm")
@JsonFormat(pattern = "HH:mm",timezone="GMT+8")
@DateTimeFormat(pattern = "HH:mm:ss")
@JsonFormat(pattern = "HH:mm:ss",timezone="GMT+8")
private LocalTime offBedEnd;
@ApiModelProperty("离床时间类型 :1-当日,2-次日")
......
......@@ -20,4 +20,11 @@ public interface PlatUserMapper extends BaseMapper<PlatUser> {
Page<PlatUser> noDeptUserList(Page<PlatUser> page, PlatUserQueryDTO dto);
List<PlatMenu> getMenuListByUserId(String userId);
/**
* DataScopeHandler#getSqlSegment(PlainSelect, String)
* 改查询过滤掉全局org=xxx设置
* @return
*/
List<PlatUser> listAll();
}
......@@ -84,6 +84,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
......@@ -127,6 +128,8 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
@Autowired
private PlatOrgService platOrgService;
@Resource
private PlatUserMapper platUserMapper;
private DefaultIdentifierGenerator defaultIdentifierGenerator = new DefaultIdentifierGenerator();
......@@ -1179,9 +1182,10 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
LambdaQueryWrapper<PlatUser> userLambdaQueryWrapper = new LambdaQueryWrapper<>();
userLambdaQueryWrapper.select(PlatUser::getMobile, PlatUser::getEmail,PlatUser::getAccount, BaseEntity::getId);
List<PlatUser> userList = this.list(userLambdaQueryWrapper);
List<PlatUser> allUserList = platUserMapper.listAll();
Map<String, String> mobileMap = userList.stream().collect(Collectors.toMap(PlatUser::getMobile, BaseEntity::getId, (a, b) -> a));
Map<String, String> emailMap = userList.stream().filter(vo->StringUtils.isNotBlank(vo.getEmail())).collect(Collectors.toMap(PlatUser::getEmail, BaseEntity::getId, (a, b) -> a));
Map<String, String> accountMap = userList.stream().collect(Collectors.toMap(PlatUser::getAccount, BaseEntity::getId, (a, b) -> a));
Map<String, String> accountMap = allUserList.stream().collect(Collectors.toMap(PlatUser::getAccount, BaseEntity::getId, (a, b) -> a));
return ExcelValidatorUtil.validateMain(3, platUserImportDTOS, list -> {
......
......@@ -69,6 +69,7 @@ public class AlarmConfigCacheUtil implements ApplicationRunner {
if (StringUtils.equals(platDevice.getCategory(), PlatDeviceEnum.CategoryEnum.HEART.getValue())) {
set.add(this.get(platDevice.getOrgId() ,PlatAlarmConfigEnum.AlarmTypeEnum.BREATHE.getValue()));
set.add(this.get(platDevice.getOrgId() , PlatAlarmConfigEnum.AlarmTypeEnum.HEART.getValue()));
set.add(this.get(platDevice.getOrgId() , PlatAlarmConfigEnum.AlarmTypeEnum.OFF_BED.getValue()));
}
if (StringUtils.equals(platDevice.getCategory(), PlatDeviceEnum.CategoryEnum.FALL.getValue())) {
set.add(this.get(platDevice.getOrgId() , PlatAlarmConfigEnum.AlarmTypeEnum.FALL.getValue()));
......
......@@ -67,5 +67,9 @@
</where>
</select>
<select id="listAll" resultType="com.makeit.entity.platform.auth.PlatUser">
SELECT id, mobile, email, account, id FROM plat_user WHERE del_flag = '0'
</select>
</mapper>
......@@ -12,6 +12,7 @@ import com.makeit.global.aspect.tenant.TenantIdIgnore;
import com.makeit.module.iot.enums.DeviceState;
import com.makeit.module.iot.vo.DeviceInfo;
import com.makeit.module.iot.vo.HeaderInfo;
import com.makeit.service.platform.alarm.PlatAlarmConfigService;
import com.makeit.service.platform.alarm.alarmStrategy.IAlarm;
import com.makeit.service.platform.device.PlatDeviceService;
import com.makeit.service.saas.SaasSleepAnalysisModelService;
......@@ -30,6 +31,7 @@ import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.util.StopWatch;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List;
import java.util.Objects;
......@@ -43,12 +45,14 @@ public class PushCallback implements MqttCallback {
public static final String DEVICE_BR_DATA = "device:brhr:data:";
public static final String DEVICE_SPACE_DATA = "device:space:data:";
public static final String DEVICE_FALL_DATA = "device:fall:data:";
public static final String DEVICE_OFF_BED_DATA = "device:off_bed:data:";
public static final String SLEEP_ANALYSIS_KEY = "saas:sleep:analysis";
public static final String DEVICE_BR_ANALYSIS = "device:brhr:analysis:";
public static final String DEVICE_SPACE_TEMP_DATA = "device:space:tempData:";
public static final String DEVICE_FALL_TEMP_DATA = "device:fall:tempData:";
public static final String DEVICE_OFF_BED_TEMP_DATA = "device:off_bed:tempData:";
public static final String REPORT_PROPERTY = "REPORT_PROPERTY";
@Autowired
......@@ -69,6 +73,8 @@ public class PushCallback implements MqttCallback {
private StringRedisTemplate redisTemplate;
@Autowired
private SaasSleepAnalysisModelService saasSleepAnalysisModelService;
@Resource
private PlatAlarmConfigService alarmConfigService;
@Override
......
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