Commit eab5ffec by 杨伟程
parents 437fcf0b 246819c1
package com.makeit.module.controller.dataScreen; package com.makeit.module.controller.dataScreen;
import com.makeit.common.page.PageReqDTO;
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.dto.platform.dataScreen.PlatDataScreenQueryDTO; import com.makeit.dto.platform.dataScreen.PlatDataScreenQueryDTO;
import com.makeit.dto.platform.space.PlatBedQueryDTO;
import com.makeit.module.system.entity.ChinaArea; import com.makeit.module.system.entity.ChinaArea;
import com.makeit.service.platform.dataScreen.DataScreenService; import com.makeit.service.platform.dataScreen.DataScreenService;
import com.makeit.utils.area.ChinaAreaVO; import com.makeit.utils.area.ChinaAreaVO;
import com.makeit.vo.platform.dataScreen.*; import com.makeit.vo.platform.dataScreen.*;
import com.makeit.vo.platform.space.PlatBedVo;
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.beans.factory.annotation.Autowired;
...@@ -55,6 +59,12 @@ public class DataScreenController { ...@@ -55,6 +59,12 @@ public class DataScreenController {
return ApiResponseUtils.success(dataScreenService.alarmStatistics(dto)); return ApiResponseUtils.success(dataScreenService.alarmStatistics(dto));
} }
@ApiOperation("实时告警分页列表")
@PostMapping("alarmPage")
public ApiResponseEntity<PageVO<PlatAlarmStatisticsListVo>> alarmPage(@RequestBody PageReqDTO<PlatDataScreenQueryDTO> page) {
return ApiResponseUtils.success(dataScreenService.alarmPage(page));
}
@ApiOperation("机构养老-基础数据统计") @ApiOperation("机构养老-基础数据统计")
@PostMapping("baseInfoStatistics") @PostMapping("baseInfoStatistics")
public ApiResponseEntity<PlatBaseInfoStatisticsVO> baseInfoStatistics(@RequestBody PlatDataScreenQueryDTO dto) { public ApiResponseEntity<PlatBaseInfoStatisticsVO> baseInfoStatistics(@RequestBody PlatDataScreenQueryDTO dto) {
......
...@@ -35,6 +35,9 @@ public class PlatRegionSettingDTO extends BaseIdDTO { ...@@ -35,6 +35,9 @@ public class PlatRegionSettingDTO extends BaseIdDTO {
@ApiModelProperty("设备ID") @ApiModelProperty("设备ID")
private String deviceId; private String deviceId;
@ApiModelProperty("原始设备ID")
private String oriDeviceId;
@ApiModelProperty("房间ID") @ApiModelProperty("房间ID")
private String roomId; private String roomId;
......
...@@ -25,6 +25,9 @@ public class PlatSpaceVO extends BaseIdDTO { ...@@ -25,6 +25,9 @@ public class PlatSpaceVO extends BaseIdDTO {
@ApiModelProperty("父级名称") @ApiModelProperty("父级名称")
private String parentName; private String parentName;
@ApiModelProperty("属性 1-居家 2-机构")
private String attribute;
@ApiModelProperty("子集") @ApiModelProperty("子集")
private List<PlatSpaceVO> children; private List<PlatSpaceVO> children;
} }
...@@ -396,8 +396,8 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg> ...@@ -396,8 +396,8 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
*/ */
@Override @Override
public List<PlatOrg> belongToOrgTree(PlatOrg param) { public List<PlatOrg> belongToOrgTree(PlatOrg param) {
PlatUserVO userVO = PlatUserUtil.getUserVO(); PlatUserVO userVOCanNull = PlatUserUtil.getUserVOCanNull();
String isTenant = userVO.getIsTenant(); String isTenant = userVOCanNull.getIsTenant();
//如果是租户账号 则有所有权限 //如果是租户账号 则有所有权限
if (StringUtils.equals(isTenant, CommonEnum.YES.getValue())) { if (StringUtils.equals(isTenant, CommonEnum.YES.getValue())) {
List<PlatOrg> orgList = this.list(new LambdaQueryWrapper<PlatOrg>() List<PlatOrg> orgList = this.list(new LambdaQueryWrapper<PlatOrg>()
...@@ -408,7 +408,7 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg> ...@@ -408,7 +408,7 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
} }
//平台账号 //平台账号
Set<String> orgIdList = getOrgIdListByUserId(userVO.getId()); Set<String> orgIdList = getOrgIdListByUserId(userVOCanNull.getId());
List<PlatOrg> orgList = this.list(new LambdaQueryWrapper<PlatOrg>() List<PlatOrg> orgList = this.list(new LambdaQueryWrapper<PlatOrg>()
.eq(StringUtils.isNotEmpty(param.getType()), PlatOrg::getType, param.getType()) .eq(StringUtils.isNotEmpty(param.getType()), PlatOrg::getType, param.getType())
.in(BaseEntity::getId, orgIdList).eq(PlatOrg::getStatus, CommonEnum.YES.getValue())); .in(BaseEntity::getId, orgIdList).eq(PlatOrg::getStatus, CommonEnum.YES.getValue()));
......
...@@ -3,6 +3,7 @@ package com.makeit.service.platform.auth.impl; ...@@ -3,6 +3,7 @@ package com.makeit.service.platform.auth.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.incrementer.DefaultIdentifierGenerator;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
...@@ -43,7 +44,6 @@ import com.makeit.module.admin.vo.plat.PlatButtonVO; ...@@ -43,7 +44,6 @@ import com.makeit.module.admin.vo.plat.PlatButtonVO;
import com.makeit.module.admin.vo.plat.PlatTenantVO; import com.makeit.module.admin.vo.plat.PlatTenantVO;
import com.makeit.module.admin.vo.plat.PlatUserLoginVO; import com.makeit.module.admin.vo.plat.PlatUserLoginVO;
import com.makeit.module.admin.vo.plat.PlatUserRoleMenuRedisVO; import com.makeit.module.admin.vo.plat.PlatUserRoleMenuRedisVO;
import com.makeit.module.system.service.SysDictionaryCategoryService;
import com.makeit.service.platform.auth.PlatOrgService; import com.makeit.service.platform.auth.PlatOrgService;
import com.makeit.service.platform.auth.PlatRoleMenuService; import com.makeit.service.platform.auth.PlatRoleMenuService;
import com.makeit.service.platform.auth.PlatRoleOrgService; import com.makeit.service.platform.auth.PlatRoleOrgService;
...@@ -123,8 +123,7 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser> ...@@ -123,8 +123,7 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
@Autowired @Autowired
private PlatOrgService platOrgService; private PlatOrgService platOrgService;
@Autowired private DefaultIdentifierGenerator defaultIdentifierGenerator = new DefaultIdentifierGenerator();
private SysDictionaryCategoryService sysDictionaryCategoryService;
private static final Logger logger = LoggerFactory.getLogger(PlatUserServiceImpl.class); private static final Logger logger = LoggerFactory.getLogger(PlatUserServiceImpl.class);
...@@ -1074,6 +1073,7 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser> ...@@ -1074,6 +1073,7 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
* @param excelFile * @param excelFile
*/ */
@Override @Override
@Transactional
public ExcelImportVo importExcel(MultipartFile excelFile) throws Exception { public ExcelImportVo importExcel(MultipartFile excelFile) throws Exception {
List<PlatUserImportDTO> platUserImportDTOS = ExcelUtil.importExcel(null, 3, excelFile, PlatUserImportDTO.class); List<PlatUserImportDTO> platUserImportDTOS = ExcelUtil.importExcel(null, 3, excelFile, PlatUserImportDTO.class);
...@@ -1109,6 +1109,7 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser> ...@@ -1109,6 +1109,7 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
} }
if (errorVoList.isEmpty()) { if (errorVoList.isEmpty()) {
List<PlatUser> platUsers = new ArrayList<>(); List<PlatUser> platUsers = new ArrayList<>();
List<PlatUserRole> platUserRoles = new ArrayList<>();
platUserImportDTOS.forEach(vo -> { platUserImportDTOS.forEach(vo -> {
PlatUser platUser = BeanDtoVoUtils.convert(vo, PlatUser.class); PlatUser platUser = BeanDtoVoUtils.convert(vo, PlatUser.class);
vo.setPassword(PasswordUtils.encryptPassword(vo.getPassword())); vo.setPassword(PasswordUtils.encryptPassword(vo.getPassword()));
...@@ -1119,10 +1120,17 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser> ...@@ -1119,10 +1120,17 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
PlatOrg platOrg = Optional.ofNullable(orgNameMap.get(vo.getOrgName())).orElse(new PlatOrg()); PlatOrg platOrg = Optional.ofNullable(orgNameMap.get(vo.getOrgName())).orElse(new PlatOrg());
platUser.setOrgId(platOrg.getId()); platUser.setOrgId(platOrg.getId());
platUser.setOrgPath(platOrg.getPath() + "," + platOrg.getId()); platUser.setOrgPath(platOrg.getPath() + "," + platOrg.getId());
platUser.setId(String.valueOf(defaultIdentifierGenerator.nextId(platUser)));
platUsers.add(platUser); platUsers.add(platUser);
PlatUserRole platUserRole = new PlatUserRole();
platUserRole.setUserId(platUser.getId());
String roleId = roleNameMap.get(vo.getRoleName());
platUserRole.setRoleId(roleId);
platUserRoles.add(platUserRole);
}); });
saveBatch(platUsers); saveBatch(platUsers);
platUserRoleService.saveBatch(platUserRoles);
} }
return errorVoList; return errorVoList;
}); });
......
package com.makeit.service.platform.dataScreen; package com.makeit.service.platform.dataScreen;
import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO;
import com.makeit.dto.platform.dataScreen.PlatDataScreenQueryDTO; import com.makeit.dto.platform.dataScreen.PlatDataScreenQueryDTO;
import com.makeit.utils.area.ChinaAreaVO; import com.makeit.utils.area.ChinaAreaVO;
import com.makeit.vo.platform.dataScreen.*; import com.makeit.vo.platform.dataScreen.*;
...@@ -26,4 +28,6 @@ public interface DataScreenService { ...@@ -26,4 +28,6 @@ public interface DataScreenService {
List<PlatMapStatisticsVO> mapStatistics(PlatDataScreenQueryDTO dto); List<PlatMapStatisticsVO> mapStatistics(PlatDataScreenQueryDTO dto);
List<ChinaAreaVO> mapList(PlatDataScreenQueryDTO dto); List<ChinaAreaVO> mapList(PlatDataScreenQueryDTO dto);
PageVO<PlatAlarmStatisticsListVo> alarmPage(PageReqDTO<PlatDataScreenQueryDTO> page);
} }
...@@ -110,11 +110,13 @@ public class PlatRegionSettingServiceImpl extends ServiceImpl<PlatRegionSettingM ...@@ -110,11 +110,13 @@ public class PlatRegionSettingServiceImpl extends ServiceImpl<PlatRegionSettingM
List<String> listDeviceIds = data.stream().map(item->item.getDeviceId()).collect(Collectors.toList()); List<String> listDeviceIds = data.stream().map(item->item.getDeviceId()).collect(Collectors.toList());
LambdaQueryWrapper<PlatDevice> queryWrapper1 = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PlatDevice> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.in(PlatDevice::getId,listDeviceIds); queryWrapper1.in(PlatDevice::getId,listDeviceIds);
queryWrapper1.select(PlatDevice::getId,PlatDevice::getName); queryWrapper1.select(PlatDevice::getId,PlatDevice::getName,PlatDevice::getOriDeviceId);
List<PlatDevice> devices = platDeviceService.list(queryWrapper1); List<PlatDevice> devices = platDeviceService.list(queryWrapper1);
Map<String,String> map = devices.stream().collect(Collectors.toMap(PlatDevice::getId,PlatDevice::getName,(k1,k2)->k1)); Map<String,String> map = devices.stream().collect(Collectors.toMap(PlatDevice::getId,PlatDevice::getName,(k1,k2)->k1));
Map<String,String> oriDeviceIdMap = devices.stream().collect(Collectors.toMap(PlatDevice::getId,PlatDevice::getOriDeviceId,(k1,k2)->k1));
data.forEach(item->{ data.forEach(item->{
item.setDeviceName(map.get(item.getDeviceId())); item.setDeviceName(map.get(item.getDeviceId()));
item.setOriDeviceId(oriDeviceIdMap.get(item.getDeviceId()));
}); });
} }
return data; return data;
......
...@@ -269,6 +269,7 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace ...@@ -269,6 +269,7 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
vo.setName(space.getName()); vo.setName(space.getName());
vo.setParentId(space.getParentId()); vo.setParentId(space.getParentId());
vo.setId(space.getId()); vo.setId(space.getId());
vo.setAttribute(space.getAttribute());
return vo; return vo;
} }
......
...@@ -23,6 +23,6 @@ public class PlatAlarmStatisticsVO { ...@@ -23,6 +23,6 @@ public class PlatAlarmStatisticsVO {
@ApiModelProperty(value = "待处理数") @ApiModelProperty(value = "待处理数")
private Long unhandledNumber; private Long unhandledNumber;
private List<PlatAlarmStatisticsListVo> list; // private List<PlatAlarmStatisticsListVo> list;
} }
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<select id="countByOrdIdsAndType" resultType="java.lang.Long"> <select id="countByOrdIdsAndType" resultType="java.lang.Long">
SELECT count(*) from plat_bed pb LEFT JOIN plat_space ps ON pb.space_id = ps.id SELECT count(*) from plat_bed pb LEFT JOIN plat_space ps ON pb.space_id = ps.id
<where> <where>
ps.del_flag = 0 pb.del_flag = 0
<if test="orgIds != null and orgIds.size() > 0 "> <if test="orgIds != null and orgIds.size() > 0 ">
AND ps.org_id IN AND ps.org_id IN
<foreach collection="orgIds" item="item" separator="," open="(" close=")" index=""> <foreach collection="orgIds" item="item" separator="," open="(" close=")" index="">
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.makeit.mapper.platform.auth.PlatUserRoleMapper">
<select id="getByUserIdList" resultType="com.makeit.dto.platform.auth.PlatUserRoleDTO">
select distinct pur.role_id,
pur.user_id,
pr.name as roleName
from plat_user_role pur
left join plat_role pr on pur.role_id = pr.id
<where>
<if test="userIdList != null and userIdList.size()>0">
AND pur.user_id IN
<foreach collection="userIdList" item="item" separator="," open="(" close=")" index="">
#{item}
</foreach>
</if>
</where>
</select>
</mapper>
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