Commit c62be521 by 杨伟程
parents babd43d9 76f4cbdb
......@@ -78,7 +78,7 @@ public class SaasPlatMenuController {
@Action(module = "saas端-租户资源管理(菜单)", name = "编辑", code = "saas:plat:menu:edit")
@ApiOperation("编辑")
@PostMapping("edit")
public ApiResponseEntity<?> edit(@Validated @RequestBody PlatMenuDTOVO dto){
public ApiResponseEntity<Void> edit(@Validated @RequestBody PlatMenuDTOVO dto){
platMenuService.edit(dto);
saasOperationLogService.add("saas端-租户资源管理-编辑", null);
......
......@@ -5,14 +5,14 @@ import com.alibaba.fastjson.JSONArray;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.makeit.module.admin.vo.plat.PlatTenantVO;
import com.makeit.module.iot.dto.Condition;
import com.makeit.module.iot.dto.IotQueryParam;
import com.makeit.module.iot.dto.IotSort;
import com.makeit.module.iot.dto.Term;
import com.makeit.module.iot.util.HttpRequest;
import com.makeit.module.iot.util.Response;
import com.makeit.module.iot.util.SimpleHttpRequest;
import com.makeit.module.iot.vo.*;
import com.makeit.module.iot.vo.DeviceInstanceEntity;
import com.makeit.module.iot.vo.DeviceProductEntity;
import com.makeit.module.iot.vo.IotPagerResult;
import com.makeit.module.iot.vo.OrganizationEntity;
import com.makeit.module.iot.vo.ResponseMessage;
import com.makeit.utils.data.convert.JsonUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
......@@ -134,8 +134,8 @@ public class IotOrgService extends IotCommonService{
*/
public List<DeviceInstanceEntity> getOrgDevice(String iotOrgId) {
String url = iotUrl + "device/instance/_query";
IotQueryParam queryParam = buildQueryParam(10, "id", "dim-assets", "device", iotOrgId, "org", "createTime");
//todo 分页限制 导致设备没全部同步过来
IotQueryParam queryParam = buildQueryParam(10000, "id", "dim-assets", "device", iotOrgId, "org", "createTime");
String body = JsonUtil.toJson(queryParam);
......
......@@ -327,7 +327,7 @@ implements PlatRoleService {
List<PlatMenu> platMenuList = platMenuService.list(new QueryWrapper<PlatMenu>().lambda()
.in(StringUtils.isNotBlank(id), PlatMenu::getId, menuIdList)
//.orderByAsc(PlatMenu::getParentId)
.orderByAsc(PlatMenu::getSort)
.orderByDesc(PlatMenu::getSort)
.orderByAsc(PlatMenu::getCreateDate)
);
......
......@@ -475,7 +475,7 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
return platMenuService.list(new QueryWrapper<PlatMenu>().lambda()
.in(PlatMenu::getId, menuIdList)
.eq(PlatMenu::getStatus, CommonEnum.YES.getValue())
.orderByAsc(PlatMenu::getSort)
.orderByDesc(PlatMenu::getSort)
.orderByAsc(PlatMenu::getCreateDate)
);
}
......@@ -542,7 +542,7 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
List<PlatMenu> menuList = platMenuService.list(new QueryWrapper<PlatMenu>().lambda()
.in(PlatMenu::getId, menuIdList)
.eq(PlatMenu::getStatus, CommonEnum.YES.getValue())
.orderByAsc(PlatMenu::getSort)
.orderByDesc(PlatMenu::getSort)
.orderByAsc(PlatMenu::getCreateDate)
);
......
......@@ -323,19 +323,9 @@ public class DataScreenServiceImpl implements DataScreenService {
.isNotNull(PlatElder::getBedId)
.in(PlatElder::getOrgId, dto.getOrgIds()));
for(PlatElder elder : elders){
if(StringUtil.isNotEmpty(elder.getStreetSpaceId())){
elder.setSpaceId(elder.getStreetSpaceId());
}else {
if(StringUtil.isNotEmpty(elder.getBuildingSpaceId())) {
elder.setSpaceId(elder.getBuildingSpaceId());
}else {
if(StringUtil.isNotEmpty(elder.getUnitSpaceId())){
elder.setSpaceId(elder.getUnitSpaceId());
}else {
if(StringUtil.isNotEmpty(elder.getFloorSpaceId())){
elder.setSpaceId(elder.getFloorSpaceId());
}
}
if(StringUtil.isNotEmpty(elder.getSpacePath())){
if(Arrays.asList(elder.getSpacePath().split(",")).size()>0){
elder.setSpaceId(Arrays.asList(elder.getSpacePath().split(",")).get(0));
}
}
}
......
......@@ -30,5 +30,5 @@ public interface WorkStationService {
List<PlatSpaceVO> spaceTree(PlatOrgDTO dto);
Map<String, Map<String,List<String>>> mapElderAlarmType(List<PlatAlarmRecord> alarmRecords);
Map<String, Map<String,String>> mapElderAlarmType(List<PlatAlarmRecord> alarmRecords);
}
......@@ -167,15 +167,13 @@ public class WorkStationServiceImpl implements WorkStationService {
);
List<String> elderIds = alarmRecords.stream().filter(t -> StringUtil.isNotEmpty(t.getElderIds()))
.map(PlatAlarmRecord::getElderIds).collect(Collectors.toList());
if (elderIds.isEmpty()) {
return new PageVO<>();
}
elderIds.forEach(e -> {
elderIdList.addAll(Arrays.asList(e.split(",")));
});
dto.setElderIds(elderIdList);
//长者对应的报警类型
Map<String, Map<String,List<String>>> elderAlarmTypeMap = mapElderAlarmType(alarmRecords);
Map<String, Map<String,String>> elderAlarmTypeMap = mapElderAlarmType(alarmRecords);
Page<WorkStationInstitutionRoomVO> pages = platRoomService.workStationPage(
new Page<>(page.getPage(),page.getLimit()), page.getData());
List<WorkStationInstitutionRoomVO> roomVOList = pages.getRecords();
......@@ -218,47 +216,44 @@ public class WorkStationServiceImpl implements WorkStationService {
}
@Override
public Map<String, Map<String,List<String>>> mapElderAlarmType(List<PlatAlarmRecord> alarmRecords) {
Map<String, Map<String,List<String>>> map = new HashMap<>();
public Map<String, Map<String,String>> mapElderAlarmType(List<PlatAlarmRecord> alarmRecords) {
Map<String, Map<String,String>> map = new HashMap<>();
alarmRecords.forEach(a -> {
if (StringUtil.isNotEmpty(a.getElderIds())) {
List<String> elderIds = Arrays.asList(a.getElderIds().split(","));
elderIds.forEach(e -> {
if(map.containsKey(e)){
Map<String,List<String>> typeMap = map.get(e);
Map<String,String> typeMap = map.get(e);
if(PlatAlarmConfigEnum.AlarmTypeEnum.HEART.getValue().equals(a.getAlarmType())
|| PlatAlarmConfigEnum.AlarmTypeEnum.BREATHE.getValue().equals(a.getAlarmType())
){
if(typeMap.containsKey(a.getAlarmType())){
if(StringUtil.isNotEmpty(a.getRemark())){
typeMap.get(a.getAlarmType()).add(a.getRemark());
typeMap.put(a.getAlarmType(),typeMap.get(a.getAlarmType()));
String remark = typeMap.get(a.getAlarmType())+","+a.getRemark();
typeMap.put(a.getAlarmType(),remark);
}
}else {
if(StringUtil.isNotEmpty(a.getRemark())){
List<String> stautsList = new ArrayList<>();
stautsList.add(a.getRemark());
typeMap.put(a.getAlarmType(),stautsList);
typeMap.put(a.getAlarmType(),a.getRemark());
}
}
} else {
typeMap.put(a.getAlarmType(), new ArrayList<>());
typeMap.put(a.getAlarmType(),"");
}
map.put(e, typeMap);
}else {
Map<String,List<String>> typeMap = new HashMap<>();
Map<String,String> typeMap = new HashMap<>();
if(PlatAlarmConfigEnum.AlarmTypeEnum.HEART.getValue().equals(a.getAlarmType())
|| PlatAlarmConfigEnum.AlarmTypeEnum.BREATHE.getValue().equals(a.getAlarmType())
){
if(StringUtil.isNotEmpty(a.getRemark())){
List<String> stautsList = new ArrayList<>();
stautsList.add(a.getRemark());
typeMap.put(a.getAlarmType(),stautsList);
typeMap.put(a.getAlarmType(),a.getRemark());
}
} else {
typeMap.put(a.getAlarmType(), new ArrayList<>());
typeMap.put(a.getAlarmType(), "");
}
map.put(e, typeMap);
}
......@@ -350,9 +345,7 @@ public class WorkStationServiceImpl implements WorkStationService {
);
List<String> elderIds = alarmRecords.stream().filter(t -> StringUtil.isNotEmpty(t.getElderIds()))
.map(PlatAlarmRecord::getElderIds).collect(Collectors.toList());
if (elderIds.isEmpty()) {
return new PageVO<>();
}
elderIds.forEach(e -> {
elderIdList.addAll(Arrays.asList(e.split(",")));
......@@ -360,7 +353,7 @@ public class WorkStationServiceImpl implements WorkStationService {
dto.setElderIds(elderIdList);
//长者对应的报警类型
Map<String, Map<String,List<String>>> elderAlarmTypeMap = mapElderAlarmType(alarmRecords);
Map<String, Map<String,String>> elderAlarmTypeMap = mapElderAlarmType(alarmRecords);
Page<WorkStationHomeBedVO> pages = platBedService.selectByConditionPage(
new Page<>(page.getPage(),page.getLimit()), page.getData());
List<WorkStationHomeBedVO> list = pages.getRecords();
......
......@@ -70,7 +70,7 @@ public class PlatMenuServiceImpl extends ServiceImpl<PlatMenuMapper, PlatMenu>
.eq(StringUtils.isNotBlank(dto.getStatus()), PlatMenu::getStatus, dto.getStatus())
.in(StringUtils.isNotBlank(dto.getTenantId()), PlatMenu::getId, menuIdList)
//.orderByAsc(PlatMenu::getParentId)
.orderByAsc(PlatMenu::getSort)
.orderByDesc(PlatMenu::getSort)
.orderByAsc(PlatMenu::getCreateDate)
);
......
......@@ -80,7 +80,7 @@ public class PlatElderCenterWechatServiceImpl implements PlatElderCenterWechatSe
.eq(PlatAlarmRecord::getOrgId, space.getOrgId())
);
//长者对应的报警类型
Map<String, Map<String,List<String>>> elderAlarmTypeMap = workStationService.mapElderAlarmType(alarmRecords);
Map<String, Map<String,String>> elderAlarmTypeMap = workStationService.mapElderAlarmType(alarmRecords);
WorkStationQueryDTO queryDTO = new WorkStationQueryDTO();
queryDTO.setSpaceIds(spaceIds);
......@@ -154,7 +154,7 @@ public class PlatElderCenterWechatServiceImpl implements PlatElderCenterWechatSe
});
//长者对应的报警类型
Map<String, Map<String,List<String>>> elderAlarmTypeMap = workStationService.mapElderAlarmType(alarmRecords);
Map<String, Map<String,String>> elderAlarmTypeMap = workStationService.mapElderAlarmType(alarmRecords);
for (WorkStationInstitutionRoomVO vo : roomVOList) {
vo.setPathName(vo.getPathName() + "-" + vo.getRoomName());
......
......@@ -57,5 +57,5 @@ public class WorkStationHomeBedVO {
private Integer respiratoryRate;
@ApiModelProperty(value = "告警类型")
private Map<String,List<String>> alarmTypeMap;
private Map<String,String> alarmTypeMap;
}
......@@ -42,5 +42,5 @@ public class WorkStationInstitutionBedVO {
private String elderStatus;
@ApiModelProperty(value = "告警类型")
private Map<String,List<String>> alarmTypeMap;
private Map<String,String> alarmTypeMap;
}
......@@ -66,7 +66,7 @@
</select>
<select id="selectByCondition" resultType="com.makeit.vo.platform.workstation.WorkStationHomeBedVO">
SELECT pb.`name` as bedName, pb.id as bedId, pb.room_id , pe.id as elderId, pb.name as elderName, prbd.device_id,pm.id as roomId,pm.name as roomName ,pm.space_path,pb.status
SELECT pb.`name` as bedName, pb.id as bedId, pb.room_id , pe.id as elderId, pe.name as elderName, prbd.device_id,pm.id as roomId,pm.name as roomName ,pm.space_path,pb.status
FROM plat_bed pb
LEFT JOIN plat_room pm ON pm.id = pb.room_id
LEFT JOIN plat_space ps ON ps.id = pm.space_id
......@@ -122,7 +122,7 @@
</select>
<select id="selectByConditionPage" resultType="com.makeit.vo.platform.workstation.WorkStationHomeBedVO">
SELECT pb.`name` as bedName, pb.id as bedId, pb.room_id , pe.id as elderId, pb.name as elderName, prbd.device_id,pm.id as roomId,pm.name as roomName ,pm.space_path,pb.status
SELECT pb.`name` as bedName, pb.id as bedId, pb.room_id , pe.id as elderId, pe.name as elderName, prbd.device_id,pm.id as roomId,pm.name as roomName ,pm.space_path,pb.status
FROM plat_bed pb
LEFT JOIN plat_room pm ON pm.id = pb.room_id
LEFT JOIN plat_space ps ON ps.id = pm.space_id
......
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