Commit b8c0c6f3 by huangjy

Merge remote-tracking branch 'origin/dev' into dev

parents bc6f5356 fb5f8744
ALTER TABLE `plat_device_other`
ALTER TABLE `plat_device_other`
......@@ -4,7 +4,8 @@ ADD COLUMN `secure_key` varchar(255) COMMENT '密钥key' AFTER `secure_id`;
ALTER TABLE `plat_alarm_record`
ADD COLUMN `misinformation_flag` char(1) DEFAULT 0 COMMENT '是否误报 1 误报 0 没有误报' AFTER `read_flag`;
ADD COLUMN `misinformation_flag` char(1) DEFAULT 0 COMMENT '是否误报 1 误报 0 没有误报' AFTER `read_flag`
ADD COLUMN `wechat_read_flag` char(1) DEFAULT 0 COMMENT '小程序端是否读取 0未读 1已读' AFTER `misinformation_flag`;
ALTER TABLE `plat_elder_report_month`
......
......@@ -7,6 +7,7 @@ import com.makeit.common.page.PageVO;
import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.platform.alarm.PlatAlarmRecordQueryDTO;
import com.makeit.enums.report.PlatformTypeEnum;
import com.makeit.global.aspect.tenant.TenantIdIgnore;
import com.makeit.service.platform.alarm.PlatAlarmRecordService;
import com.makeit.vo.platform.alarm.PlatAlarmRecordVO;
......@@ -44,7 +45,7 @@ public class PlatAlarmRecordChildrenController {
@PostMapping("read")
@TenantIdIgnore
public ApiResponseEntity<Void> read(@RequestBody BaseIdDTO dto) {
platAlarmRecordService.read(dto.getId());
platAlarmRecordService.read(dto.getId(), PlatformTypeEnum.PC);
return ApiResponseUtils.success();
}
......
......@@ -17,11 +17,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
......
......@@ -9,6 +9,7 @@ import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.platform.alarm.PlatAlarmRecordQueryDTO;
import com.makeit.enums.CommonEnum;
import com.makeit.enums.report.PlatformTypeEnum;
import com.makeit.service.platform.alarm.PlatAlarmRecordService;
import com.makeit.utils.user.common.CommonUserUtil;
import com.makeit.vo.platform.alarm.PlatAlarmRecordVO;
......@@ -61,7 +62,7 @@ public class PlatAlarmRecordWechatController {
@ApiOperation("已读")
@PostMapping("read")
public ApiResponseEntity<Void> read(@RequestBody BaseIdDTO dto) {
platAlarmRecordService.read(dto.getId());
platAlarmRecordService.read(dto.getId(), PlatformTypeEnum.WECHAT);
return ApiResponseUtils.success();
}
@ApiOperation("通知家属")
......
......@@ -70,6 +70,9 @@ public class PlatAlarmRecordQueryDTO extends BaseTenantDTO {
private String readFlag;
@ApiModelProperty(value = "微信端 0-未读 1-已读")
private String wechatReadFlag;
}
......@@ -25,6 +25,12 @@ public class PlatUserImportDTO {
private String roleName;
@ExcelProperty(value = {headDesc,"备注"})
private String remark;
/**
* excel中无此字段
* 导入手机号会作为账号使用,所以导入需要特殊处理,手机号没有判重后,账号要再判断下有没有判重
*/
@ExcelProperty(value = {headDesc,"账户"})
private String account;
@ExcelIgnore
......
......@@ -91,6 +91,9 @@ public class PlatAlarmRecord extends BaseBusEntity {
@ApiModelProperty(value = "是否误报 1 误报 0 没有误报")
private String misinformationFlag;
@ApiModelProperty(value = "微信端 0-未读 1-已读")
private String wechatReadFlag;
}
......
package com.makeit.enums.report;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author wangz
*/
@Getter
@AllArgsConstructor
public enum PlatformTypeEnum {
PC("1", "pc端"),
WECHAT("2", "微信小程序");
private String code;
private String value;
}
......@@ -9,6 +9,7 @@ import com.makeit.dto.platform.alarm.PlatAlarmRecordQueryDTO;
import com.makeit.entity.platform.alarm.PlatAlarmConfig;
import com.makeit.entity.platform.alarm.PlatAlarmRecord;
import com.makeit.entity.platform.elder.PlatElder;
import com.makeit.enums.report.PlatformTypeEnum;
import com.makeit.shengwang.agora.dto.PlatCallingDeviceDTO;
import com.makeit.shengwang.agora.vo.PlatAlarmCallDeviceVO;
import com.makeit.vo.platform.alarm.PlatAlarmRecordVO;
......@@ -64,7 +65,7 @@ public interface PlatAlarmRecordService extends IService<PlatAlarmRecord> {
void dealAlarm(BaseIdDTO dto);
void read(String id);
void read(String id, PlatformTypeEnum typeEnum);
Integer unreadCount(PlatAlarmRecordQueryDTO dto);
......
......@@ -13,7 +13,6 @@ import com.makeit.common.entity.BaseBusEntity;
import com.makeit.common.entity.BaseEntity;
import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO;
import com.makeit.config.ShengwangProperties;
import com.makeit.dto.platform.alarm.PlatAlarmCheckDTO;
import com.makeit.dto.platform.alarm.PlatAlarmRecordQueryDTO;
import com.makeit.entity.platform.alarm.PlatAlarmConfig;
......@@ -28,6 +27,7 @@ import com.makeit.entity.platform.space.PlatRoom;
import com.makeit.entity.platform.space.PlatRoomBedDevice;
import com.makeit.entity.saas.PlatTenant;
import com.makeit.enums.CommonEnum;
import com.makeit.enums.report.PlatformTypeEnum;
import com.makeit.exception.BusinessException;
import com.makeit.global.aspect.tenant.TenantIdIgnore;
import com.makeit.mapper.platform.alarm.PlatAlarmRecordMapper;
......@@ -44,8 +44,6 @@ import com.makeit.service.platform.space.PlatRoomBedDeviceService;
import com.makeit.service.platform.space.PlatRoomService;
import com.makeit.service.saas.PlatTenantService;
import com.makeit.shengwang.agora.dto.PlatCallingDeviceDTO;
import com.makeit.shengwang.agora.media.RtcTokenBuilder2;
import com.makeit.shengwang.agora.rtm.RtmTokenBuilder2;
import com.makeit.shengwang.agora.service.ShengwangService;
import com.makeit.shengwang.agora.vo.PlatAlarmCallDeviceVO;
import com.makeit.utils.data.convert.BeanDtoVoUtils;
......@@ -63,15 +61,12 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
......@@ -207,6 +202,7 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
.in(CollectionUtils.isNotEmpty(param.getElderIdList()),PlatAlarmRecord::getElderIds,param.getElderIdList())
.eq(StringUtils.isNotBlank(param.getNoticeStatus()),PlatAlarmRecord::getNoticeStatus,param.getNoticeStatus())
.eq(StringUtils.isNotBlank(param.getReadFlag()),PlatAlarmRecord::getReadFlag,param.getReadFlag())
.eq(StringUtils.isNotBlank(param.getWechatReadFlag()), PlatAlarmRecord::getWechatReadFlag, param.getWechatReadFlag())
.orderByDesc(BaseEntity::getCreateDate)
;
}
......@@ -559,11 +555,15 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
}
@Override
@Transactional
public void read(String id) {
@Transactional(rollbackFor = Exception.class)
public void read(String id, PlatformTypeEnum typeEnum) {
LambdaUpdateWrapper<PlatAlarmRecord> recordLambdaUpdateWrapper = Wrappers.lambdaUpdate(PlatAlarmRecord.class)
.eq(BaseEntity::getId, id)
.set(PlatAlarmRecord::getReadFlag, CommonEnum.YES.getValue());
.eq(BaseEntity::getId, id);
if (PlatformTypeEnum.WECHAT.equals(typeEnum)) {
recordLambdaUpdateWrapper.set(PlatAlarmRecord::getWechatReadFlag, CommonEnum.YES.getValue());
} else {
recordLambdaUpdateWrapper.set(PlatAlarmRecord::getReadFlag, CommonEnum.YES.getValue());
}
update(recordLambdaUpdateWrapper);
}
......
......@@ -1177,10 +1177,12 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
Map<String, String> roleNameMap = roleList.stream().collect(Collectors.toMap(vo->vo.getOrgId()+vo.getName(), BaseEntity::getId, (a, b) -> a));
LambdaQueryWrapper<PlatUser> userLambdaQueryWrapper = new LambdaQueryWrapper<>();
userLambdaQueryWrapper.select(PlatUser::getMobile, PlatUser::getEmail, BaseEntity::getId);
userLambdaQueryWrapper.select(PlatUser::getMobile, PlatUser::getEmail,PlatUser::getAccount, BaseEntity::getId);
List<PlatUser> userList = this.list(userLambdaQueryWrapper);
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));
return ExcelValidatorUtil.validateMain(3, platUserImportDTOS, list -> {
List<ExcelErrorVo> errorVoList = new ArrayList<>();
......@@ -1194,6 +1196,7 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
PlatOrg platOrg = Optional.ofNullable(orgNameMap.get(dto.getOrgName())).orElse(new PlatOrg());
ExcelErrorVo.notExists(platOrg.getId(), errorVoList, start + i, "*所属组织");
ExcelErrorVo.notExists(roleNameMap.get(platOrg.getId()+dto.getRoleName()), errorVoList, start + i, "*角色");
ExcelErrorVo.exists(accountMap, dto.getMobile(), errorVoList, start + i, "账户*");
ExcelErrorVo.exists(mobileMap, dto.getMobile(), errorVoList, start + i, "手机号*");
ExcelErrorVo.exists(emailMap, dto.getEmail(), errorVoList, start + i, "邮箱");
}
......
package com.makeit.service.platform.space.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -193,6 +194,13 @@ public class PlatBedServiceImpl extends ServiceImpl<PlatBedMapper, PlatBed> impl
}
}
// 数据权限
if (StrUtil.isBlank(dto.getOrgId()) && StrUtil.isBlank(dto.getType())) {
//查询用户权限组织id
List<PlatOrg> orgs = platOrgService.belongToScopeList(new PlatOrg());
orgIdList = orgs.stream().map(PlatOrg::getId).collect(Collectors.toList());
}
return baseMapper.selectBySpaceIdAndStatus(new Page<>(pageReqDTO.getPage(),pageReqDTO.getLimit()),dto,orgIdList);
}
......
......@@ -19,7 +19,6 @@ import com.makeit.entity.platform.space.PlatRoom;
import com.makeit.entity.platform.space.PlatSpace;
import com.makeit.enums.CodeMessageEnum;
import com.makeit.enums.CommonEnum;
import com.makeit.enums.platform.space.PlatSpaceEnum;
import com.makeit.exception.BusinessException;
import com.makeit.mapper.platform.space.PlatSpaceMapper;
import com.makeit.service.platform.auth.PlatOrgService;
......@@ -511,6 +510,7 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
// 进行匹配
if(!matcher.find()){
errorVoList.add(new ExcelErrorVo(i + 3, excelField.get(4), "床位数量格式错误"));
errorFlag = true;
}
}
......@@ -536,7 +536,8 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
if (!firstSpaceNameMap.containsKey(item.getCommunity())) {
PlatSpace platSpace = new PlatSpace();
platSpace.setName(item.getCommunity());
platSpace.setType(PlatSpaceEnum.TypeEnum.COMMUNITY.getValue());
// bug 29480 空间类型默认为空
// platSpace.setType(PlatSpaceEnum.TypeEnum.COMMUNITY.getValue());
platSpace.setOrgId(orgId);
if (org != null) {
platSpace.setAttribute(org.getType());
......@@ -567,7 +568,7 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
if (!childrenIdMap.containsKey(secondKey)) {
PlatSpace platSpace = new PlatSpace();
platSpace.setName(item.getBuilding());
platSpace.setType(PlatSpaceEnum.TypeEnum.BUILDING.getValue());
// platSpace.setType(PlatSpaceEnum.TypeEnum.BUILDING.getValue());
platSpace.setOrgId(orgId);
platSpace.setParentId(firstId);
platSpace.setParentPath(firstId);
......@@ -604,7 +605,7 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
if (!childrenIdMap.containsKey(threeKey)) {
PlatSpace platSpace = new PlatSpace();
platSpace.setName(item.getUnit());
platSpace.setType(PlatSpaceEnum.TypeEnum.UNIT.getValue());
// platSpace.setType(PlatSpaceEnum.TypeEnum.UNIT.getValue());
platSpace.setOrgId(orgId);
platSpace.setParentId(secondId);
platSpace.setParentPath(firstId + "," + secondId);
......@@ -641,7 +642,7 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
if (!childrenIdMap.containsKey(fourKey)) {
PlatSpace platSpace = new PlatSpace();
platSpace.setName(item.getFloor());
platSpace.setType(PlatSpaceEnum.TypeEnum.FLOOR.getValue());
// platSpace.setType(PlatSpaceEnum.TypeEnum.FLOOR.getValue());
platSpace.setOrgId(orgId);
if (org != null) {
platSpace.setAttribute(org.getType());
......
......@@ -63,6 +63,9 @@ public class PlatAlarmRecordVO extends BaseTenantDTO {
@ApiModelProperty(value = "0-未读 1-已读")
private String readFlag;
@ApiModelProperty(value = "微信端 0-未读 1-已读")
private String wechatReadFlag;
@ApiModelProperty(value = "是否误报 1 误报 0 没有误报")
private String misinformationFlag;
......
......@@ -12,7 +12,7 @@
LEFT JOIN plat_elder pe on pe.bed_id = pb.id
<where>
pb.del_flag = 0
<if test="dto.id != null and dto.id != ''">
<if test="dto.id != null and dto.id != '' and dto.type == 1">
AND FIND_IN_SET(#{dto.id},pm.space_path)
</if>
<if test="dto.status != null and dto.status != ''">
......@@ -24,6 +24,9 @@
#{item}
</foreach>
</if>
<if test="dto.id != null and dto.id != '' and dto.type == 2">
AND pm.id = #{dto.id}
</if>
</where>
</select>
......
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