Commit 14cea1ba by huangjy

Merge remote-tracking branch 'origin/dev'

parents 975db581 624c867b
Showing with 876 additions and 106 deletions
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`
......@@ -37,4 +38,20 @@ ADD COLUMN `activation_time` int8 COMMENT '激活时间' AFTER `expire_time`;
ALTER TABLE `plat_tenant`
ADD COLUMN `appid` varchar(64) COMMENT 'appid' AFTER `url`,
ADD COLUMN `secret` varchar(64) COMMENT 'secret' AFTER `appid`;
\ No newline at end of file
ADD COLUMN `secret` varchar(64) COMMENT 'secret' AFTER `appid`;
CREATE TABLE `plat_device_log` (
`id` VARCHAR ( 64 ) NOT NULL COMMENT 'id',
`device_id` VARCHAR ( 64 ) DEFAULT NULL COMMENT 'iot设备sn',
`type` VARCHAR ( 1 ) DEFAULT NULL COMMENT '类型 1 误报',
`product_name` VARCHAR ( 64 ) DEFAULT NULL COMMENT '产品名称',
`url` VARCHAR ( 256 ) DEFAULT NULL COMMENT '日志url',
`file_name` VARCHAR ( 256 ) DEFAULT NULL COMMENT '文件名称',
`create_date` datetime NOT NULL COMMENT '创建时间',
`update_date` datetime NOT NULL COMMENT '更新时间',
`del_flag` CHAR ( 1 ) DEFAULT NULL COMMENT '删除标识',
`create_by` VARCHAR ( 64 ) DEFAULT NULL COMMENT '创建人',
`update_by` VARCHAR ( 64 ) DEFAULT NULL COMMENT '更新人',
`tenant_id` varchar(64) DEFAULT NULL COMMENT ' 租户id',
PRIMARY KEY ( `id` )
) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 ROW_FORMAT = COMPACT COMMENT = '设备日志';
\ No newline at end of file
package com.makeit.controller.device;
import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO;
import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils;
import com.makeit.entity.platform.device.PlatDeviceLog;
import com.makeit.global.aspect.tenant.TenantIdIgnore;
import com.makeit.service.platform.device.PlatDeviceLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
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.RestController;
/**
* <p>
* 设备日志 前端控制器
* </p>
*
* @author eugene young
* @since 2023-12-01
*/
@RestController
@RequestMapping("/saas/deviceLog")
@Api(tags = "租户管理-查看设备日志")
public class PlatDeviceLogController {
@Autowired
private PlatDeviceLogService platDeviceLogService;
@ApiOperation("列表")
@PostMapping("page")
@TenantIdIgnore
public ApiResponseEntity<PageVO<PlatDeviceLog>> page(@RequestBody PageReqDTO<PlatDeviceLog> pageReqDTO) {
return ApiResponseUtils.success(platDeviceLogService.pageList(pageReqDTO));
}
}
......@@ -14,8 +14,11 @@ import com.makeit.entity.platform.device.PlatDevice;
import com.makeit.global.annotation.AuthIgnore;
import com.makeit.global.aspect.tenant.TenantIdIgnore;
import com.makeit.module.iot.vo.DeviceProperties;
import com.makeit.service.platform.alarm.PlatAlarmRecordService;
import com.makeit.service.platform.device.PlatDeviceService;
import com.makeit.service.saas.SaasOperationLogService;
import com.makeit.shengwang.agora.dto.PlatCallingDeviceDTO;
import com.makeit.shengwang.agora.vo.PlatAlarmCallDeviceVO;
import com.makeit.vo.platform.device.PlatDeviceListVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -23,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.util.List;
@Api(tags = "租户管理-租户设备管理")
......@@ -33,6 +37,8 @@ public class SaasDeviceController {
private PlatDeviceService platDeviceService;
@Autowired
private SaasOperationLogService saasOperationLogService;
@Autowired
private PlatAlarmRecordService platAlarmRecordService;
@ApiOperation("列表")
@PostMapping("page")
......@@ -90,6 +96,13 @@ public class SaasDeviceController {
return ApiResponseUtils.success();
}
@ApiOperation("呼叫设备rtm")
@PostMapping("callingDeviceAuthRtm")
@TenantIdIgnore
public ApiResponseEntity<PlatAlarmCallDeviceVO> callingDeviceAuthRtm(@RequestBody PlatCallingDeviceDTO dto) {
return ApiResponseUtils.success(platAlarmRecordService.callingDeviceAuthIgnoreRtm(dto));
}
@ApiOperation("激活设备license")
@PostMapping("active")
@TenantIdIgnore
......@@ -98,13 +111,20 @@ public class SaasDeviceController {
return ApiResponseUtils.success();
}
@ApiOperation("设备呼叫设备")
@PostMapping("callingDevice")
@TenantIdIgnore
public ApiResponseEntity<PlatAlarmCallDeviceVO> callingDevice(@RequestBody PlatCallingDeviceDTO dto) {
return ApiResponseUtils.success(platDeviceService.callingDevice(dto));
}
@ApiOperation("设备日志推送")
@PostMapping("devicePushLog")
@TenantIdIgnore
@AuthIgnore
public ApiResponseEntity devicePushLog(@RequestParam(value = "file", required = false) MultipartFile multipartFile,
@RequestParam(value = "deviceId") String deviceId) {
platDeviceService.devicePushLog(multipartFile);
public ApiResponseEntity devicePushLog(@RequestParam(value = "rawData", required = false) MultipartFile multipartFile,
@RequestParam(value = "deviceId") String deviceId) throws IOException {
platDeviceService.devicePushLog(multipartFile,deviceId);
return ApiResponseUtils.success();
}
......
......@@ -31,6 +31,8 @@ public class IotCommonService {
@Value("${iot.url:}")
public String iotUrl;
@Value("${iot.uploadUrl:}")
public String uploadUrl;
protected static HttpClient httpClient = HttpClientBuilder.create().build();
......
......@@ -101,4 +101,26 @@ public class IotDevicePropertiesOperateService extends IotCommonService {
}
return "";
}
public String deviceFunctionAttr(String deviceId, Long timestamp) {
String url = iotUrl + "device/invoked/" + deviceId + "/function/misinformation";
Map<String,Map<String,Object>> map = Maps.newHashMap();
Map<String,Object> reqMap = Maps.newHashMap();
reqMap.put("timestamp",timestamp);
reqMap.put("url", uploadUrl);
map.put("misinformationNotify",reqMap);
HttpRequest request = buildRequest(url, JSON.toJSONString(map));
try {
ResponseMessage responseMessage = sendPost(url, request);
log.info("发送误报通知到设备返回信息:{}", responseMessage.getMessage());
if (responseMessage.getStatus() != 200) {
String errorMsg = responseMessage.getMessage();
log.error("发送误报通知失败:{}",errorMsg);
return errorMsg;
}
} catch (IOException e) {
log.error("调用:{}接口异常:{}", url, e.getMessage());
}
return "";
}
}
package com.makeit.oss;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.constraints.NotNull;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.net.URL;
public interface AccessoryRepository {
/**
* 根据保存的相对路径获取存储的文件对象
*
* @return java.io.File
* @Author 滕鑫源
* @Date 2020/8/20 14:46
* @Param path
* @Param fileName
**/
File get(String path, String fileName) throws FileNotFoundException;
URL getURL(String path, String fileName) throws FileNotFoundException;
/**
* 根据保存的相对路径获取可下载文件的完整http路径
*
* @Author 滕鑫源
* @Date 2020/8/26 10:46
* @param path
* @param fileName
* @return
**/
// String getUrl(String path, String fileName);
/**
* 根据给定的多个相对路径获取多个存储的文件对象
*
* @Author 滕鑫源
* @Date 2020/8/26 10:46
* @param urls
* @return
**/
// List<File> findList(String... urls);
/**
* 保存文件对象
*
* @Author 滕鑫源
* @Date 2020/8/20 14:47
* @Param file
* @Param fileName
**/
File save(File file, String path, String fileName);
/**
* 保存文件流文件为文件对象
*
* @Author 滕鑫源
* @Date 2020/8/20 14:49
* @Param file
* @Param fileName
**/
String save(MultipartFile file, String path, String fileName);
/**
* 保存输入流为文件对象
*
* @Author 滕鑫源
* @Date 2020/8/20 14:47
* @Param file
* @Param fileName
**/
File save(InputStream is, String path, @NotNull String fileName);
}
package com.makeit.oss;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.aliyun.oss.OSSException;
import com.aliyun.oss.model.OSSObject;
import com.aliyun.oss.model.ObjectMetadata;
import com.aliyun.oss.model.PutObjectRequest;
import com.makeit.utils.FileUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.constraints.NotNull;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.Date;
/**
* aliyunOSS存储服务类
*
* @author 滕鑫源
* @date 2020/8/20 14:42
*/
@Component
public class AliyunOSSRepository implements AccessoryRepository {
private final Logger logger = LoggerFactory.getLogger(getClass());
@Value("${aliyun.oss.baseDir}")
private String accessoryBaseDir;
@Value("${aliyun.oss.endpoint}")
private String endpoint;
@Value("${aliyun.oss.accessKey}")
private String accessKeyId;
@Value("${aliyun.oss.secretKey}")
private String accessKeySecret;
@Value("${aliyun.oss.bucket}")
private String bucketName;
@Override
public File get(String path, String fileName) throws FileNotFoundException {
logger.debug("开始从aliyun-oss获取文件: {}{}{}", path, "/", fileName);
long begin = System.currentTimeMillis();
InputStream is = null;
try {
if (path == null) {
path = "";
}
OSS client = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
OSSObject object = client.getObject(bucketName, accessoryBaseDir + "/" + path + "/" + fileName);
is = object.getObjectContent();
File localTempDir = new File(FileUtils.getTempDirectory() + File.separator + accessoryBaseDir + File.separator + path);
FileUtils.createDirectory(localTempDir.getPath());
File dest = new File(localTempDir, fileName);
FileUtils.copyInputStreamToFile(is, dest);
client.shutdown();
return dest;
} catch (IOException e) {
e.printStackTrace();
} catch (OSSException e) {
throw new FileNotFoundException("指定的文件不存在");
} finally {
if (is!=null){
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
logger.debug("完成从aliyun-oss获取文件: {}", System.currentTimeMillis() - begin);
}
return null;
}
@Override
public URL getURL(String path, String fileName) throws FileNotFoundException {
logger.debug("开始从aliyun-oss获取文件: {}{}{}", path, "/", fileName);
long begin = System.currentTimeMillis();
URL downloadURL = null;
try {
if (path == null) {
path = "";
}
OSS client = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
Date expireDate = DateUtils.addHours(new Date(), 1);
downloadURL = client.generatePresignedUrl(bucketName, accessoryBaseDir + "/" + path + "/" + fileName, expireDate);
return downloadURL;
} catch (OSSException e) {
throw new FileNotFoundException("指定的文件不存在");
} finally {
logger.debug("完成从aliyun-oss获取文件临时授权路径 {}, 耗时: {}", downloadURL, System.currentTimeMillis() - begin);
}
}
/**
* 保存文件对象
*
* @param file
* @param path
* @param fileName
* @Author 滕鑫源
* @Date 2020/8/20 14:47
*/
@Override
public File save(File file, String path, String fileName) {
logger.debug("开始向aliyun-oss保存文件: {}", fileName);
long begin = System.currentTimeMillis();
OSS client = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
ObjectMetadata meta = new ObjectMetadata();
meta.setContentDisposition("attachment;filename=" + new String(fileName.getBytes(), StandardCharsets.ISO_8859_1));
PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, accessoryBaseDir + "/" + path + "/" + fileName, file, meta);
client.putObject(putObjectRequest);
client.shutdown();
logger.debug("完成向aliyun-oss保存文件: {}", System.currentTimeMillis() - begin);
return file;
}
/**
* 保存文件流文件为文件对象
*
* @param file
* @param path
* @param fileName
* @Author 滕鑫源
* @Date 2020/8/20 14:49
*/
@Override
public String save(MultipartFile file, String path, String fileName) {
logger.debug("开始向aliyun-oss保存文件: {}", fileName);
long begin = System.currentTimeMillis();
try {
OSS client = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
ObjectMetadata meta = new ObjectMetadata();
meta.setContentDisposition("attachment;filename=" + new String(fileName.getBytes(), StandardCharsets.ISO_8859_1));
PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, accessoryBaseDir + "/" + path + (path.endsWith("/") ? "" : "/") + fileName, file.getInputStream(), meta);
client.putObject(putObjectRequest);
client.shutdown();
} catch (IOException e) {
e.printStackTrace();
}
logger.debug("完成向aliyun-oss保存文件: {}", System.currentTimeMillis() - begin);
return bucketName + "." +endpoint + "/" + accessoryBaseDir + "/" +path + "/" + fileName;
}
/**
* 保存输入流为文件对象
*
* @param is
* @param path
* @param fileName
* @Author 滕鑫源
* @Date 2020/8/20 14:47
*/
@Override
public File save(InputStream is, String path, @NotNull String fileName) {
logger.debug("开始向aliyun-oss保存文件: {}", fileName);
long begin = System.currentTimeMillis();
try {
OSS client = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
ObjectMetadata meta = new ObjectMetadata();
meta.setContentDisposition("attachment;filename=" + new String(fileName.getBytes(), StandardCharsets.ISO_8859_1));
PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, accessoryBaseDir + "/" + path + (path.endsWith("/") ? "" : "/") + fileName, is, meta);
client.putObject(putObjectRequest);
client.shutdown();
} catch (Exception e) {
e.printStackTrace();
}
logger.debug("完成向aliyun-oss保存文件: {}", System.currentTimeMillis() - begin);
return null;
}
}
......@@ -3,6 +3,7 @@ package com.makeit.shengwang.agora.service;
import com.alibaba.fastjson.JSON;
import com.makeit.config.ShengwangProperties;
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.vo.PlatAlarmCallDeviceVO;
import org.apache.commons.lang3.StringUtils;
......@@ -43,4 +44,19 @@ public class ShengwangService {
shengwangProperties.getTokenExpirationInSeconds(), TimeUnit.SECONDS);
return platAlarmCallDeviceVO;
}
public PlatAlarmCallDeviceVO callingDeviceAuthIgnoreRtc(String deviceId) {
PlatAlarmCallDeviceVO platAlarmCallDeviceVO = new PlatAlarmCallDeviceVO();
platAlarmCallDeviceVO.setDeviceId(deviceId);
platAlarmCallDeviceVO.setAppId(shengwangProperties.getAppId());
LocalDateTime now = LocalDateTime.now();
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
String channelName = String.format("%s:%s","RTC",now.format(dateTimeFormatter));
RtcTokenBuilder2 token = new RtcTokenBuilder2();
String result = token.buildTokenWithUid(shengwangProperties.getAppId(), shengwangProperties.getAppCertificate(), channelName, 0, RtcTokenBuilder2.Role.ROLE_SUBSCRIBER,
shengwangProperties.getTokenExpirationInSeconds(), shengwangProperties.getPrivilegeExpirationInSeconds());
platAlarmCallDeviceVO.setAccessToken(result);
platAlarmCallDeviceVO.setChannelName(channelName);
return platAlarmCallDeviceVO;
}
}
package com.makeit.utils.data.excel;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.excel.annotation.ExcelProperty;
import com.makeit.common.vo.ExcelErrorVo;
import com.makeit.common.vo.ExcelImportVo;
......@@ -194,18 +195,23 @@ public class ExcelValidatorUtil {
}
List<ExcelErrorVo> errorVoList = bizValidate(beanMap, row.stream().collect(Collectors.groupingBy(ExcelErrorVo::getTitle)), start + i, o);
if (errorVoList == null || errorVoList.isEmpty()) {
if (CollUtil.isEmpty(errorVoList) || errorVoList.isEmpty()) {
successCount++;
}
excelErrorVoList.addAll(errorVoList);
}
int errorCount = list.size() - successCount;
ExcelImportVo excelImportVo = new ExcelImportVo();
excelImportVo.setTotalCount(list.size());
excelImportVo.setErrorCount(list.size() - successCount);
excelImportVo.setErrorCount(errorCount);
excelImportVo.setSuccessCount(successCount);
excelImportVo.setList(excelErrorVoList);
excelImportVo.setMatchesCount(successCount);
if (errorCount > 0) {
excelImportVo.setSuccessCount(0);
}
if (excelImportVo.getErrorCount() == 0 && saveBatch != null) {
saveBatch.accept(list);
......
......@@ -106,7 +106,7 @@ public class CodeGenerator {
// 使用重点 下列字段填写表名 运行方法
// strategy.setInclude("edu_teacher","..."); // 多表-逆向工程
strategy.setInclude("plat_region_setting_fix","plat_elder_coordinate_record");
strategy.setInclude("plat_device_log");
strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略
strategy.setTablePrefix(pc.getModuleName() + "_"); //生成实体属性时去掉表"_"前缀并且第一个字母大写 如:gmt_create -> gmtCreate
......
......@@ -59,6 +59,14 @@ public class PlatAlarmRecordController {
return ApiResponseUtils.success();
}
@PostMapping("misinformation1")
@AuthIgnore
@TenantIdIgnore
public ApiResponseEntity<Void> misinformation1(@RequestBody BaseIdDTO dto) {
platAlarmRecordService.misinformation(dto.getId());
return ApiResponseUtils.success();
}
@ApiOperation("未读条数")
@PostMapping("unreadCount")
public ApiResponseEntity<Integer> unreadCount(@RequestBody PlatAlarmRecordQueryDTO dto) {
......
......@@ -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
......
......@@ -45,7 +45,7 @@ public class PlatDeviceBaseAttrDTO {
@Data
static class DeviceAttrRange {
public static class DeviceAttrRange {
private Integer max;
private Integer min;
}
......
......@@ -39,6 +39,8 @@ public class PlatDeviceQueryDTO extends BaseTenantDTO {
@ApiModelProperty(value = "组织id")
private String orgId;
@ApiModelProperty(value = "设备是否激活 1 激活 0 没激活")
private Integer active;
@ApiModelProperty(value = "数据权限")
private List<String> orgIds;
......
......@@ -28,8 +28,6 @@ public class PlatElderChildrenInfoDTOVO extends BaseTenantDTO {
@ApiModelProperty(value = "长者id")
private String elderName;
@NotBlank(message = "姓名不能为空")
@Size(max = 50, message = "姓名最长为50个字符")
@ApiModelProperty(value = "姓名")
private String name;
......
......@@ -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.entity.platform.device;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.makeit.common.entity.BaseBusEntity;
import com.makeit.module.iot.enums.DeviceState;
......@@ -81,6 +82,9 @@ public class PlatDevice extends BaseBusEntity {
private Long expireTime;
@ApiModelProperty(value = "激活时间")
private Long activationTime;
@ApiModelProperty(value = "设备是否激活 1 激活 0 没激活")
@TableField(exist = false)
private Integer active;
@ApiModelProperty(value = "设备类型 0-呼吸心率雷达 1-空间人体雷达 2-跌倒检测雷达")
private String category;
......@@ -92,4 +96,5 @@ public class PlatDevice extends BaseBusEntity {
private LocalDateTime endDate;
}
package com.makeit.entity.platform.device;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.makeit.common.entity.BaseBusEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
/**
* <p>
* 设备日志
* </p>
*
* @author eugene young
* @since 2023-12-01
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="PlatDeviceLog对象", description="设备日志")
public class PlatDeviceLog extends BaseBusEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "iot设备sn")
private String deviceId;
@ApiModelProperty(value = "类型 1 误报")
private String type;
@ApiModelProperty(value = "产品名称")
private String productName;
@ApiModelProperty(value = "日志url")
private String url;
@ApiModelProperty(value = "文件名称")
private String fileName;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("开始时间")
@TableField(exist = false)
private LocalDateTime startTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("结束时间")
@TableField(exist = false)
private LocalDateTime endTime;
}
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;
}
package com.makeit.mapper.platform.device;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.makeit.entity.platform.device.PlatDeviceLog;
/**
* <p>
* 设备日志 Mapper 接口
* </p>
*
* @author eugene young
* @since 2023-12-01
*/
public interface PlatDeviceLogMapper extends BaseMapper<PlatDeviceLog> {
}
......@@ -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,9 +27,11 @@ 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;
import com.makeit.module.iot.service.IotDevicePropertiesOperateService;
import com.makeit.service.platform.alarm.PlatAlarmConfigService;
import com.makeit.service.platform.alarm.PlatAlarmRecordService;
import com.makeit.service.platform.auth.PlatOrgService;
......@@ -43,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;
......@@ -62,14 +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;
......@@ -111,9 +108,9 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
@Autowired
private PlatDeviceService platDeviceService;
@Autowired
private ShengwangProperties shengwangProperties;
@Autowired
private ShengwangService shengwangService;
@Autowired
private IotDevicePropertiesOperateService iotDevicePropertiesOperateService;
@Override
......@@ -127,6 +124,14 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
JoinUtil.join(dtos, platAlarmConfigService, PlatAlarmRecordVO::getAlarmId, BaseEntity::getId, (t, m) -> t.setNotifyRelation(m.getNotifyRelation()));
List<PlatDevice> platDeviceList = platDeviceService.list();
Map<String, PlatDevice> deviceMap = StreamUtil.toMap(platDeviceList, BaseEntity::getId);
for (PlatAlarmRecordVO platAlarmRecordVO : dtos) {
PlatDevice platDevice = deviceMap.get(platAlarmRecordVO.getDeviceId());
if (platDevice != null) {
platAlarmRecordVO.setDevice(platDevice);
}
}
return PageUtil.toPageVO(dtos, page);
}
......@@ -162,18 +167,27 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
choiceOrgIdList.addAll(Lists.newArrayList(param.getOrgId().split(",")));
}
List<String> orgIdList = Lists.newArrayList();
if (CollectionUtils.isNotEmpty(choiceOrgIdList)) {
orgIdList = choiceOrgIdList;
}
if (CollectionUtils.isNotEmpty(typeOrgIdList)) {
if (com.makeit.utils.old.StringUtils.isNotEmpty(param.getType()) && com.makeit.utils.old.StringUtils.isEmpty(param.getOrgId())) {
orgIdList = typeOrgIdList;
if (CollectionUtils.isEmpty(orgIdList)) {
orgIdList.add("-1");
}
}
if (CollectionUtils.isNotEmpty(choiceOrgIdList) && CollectionUtils.isNotEmpty(typeOrgIdList)) {
orgIdList = new ArrayList<>(CollectionUtils.intersection(typeOrgIdList, choiceOrgIdList));
if (com.makeit.utils.old.StringUtils.isNotEmpty(param.getOrgId()) && com.makeit.utils.old.StringUtils.isEmpty(param.getType())) {
orgIdList = choiceOrgIdList;
if (CollectionUtils.isEmpty(orgIdList)) {
orgIdList.add("-1");
}
}
if (com.makeit.utils.old.StringUtils.isNotEmpty(param.getOrgId()) && com.makeit.utils.old.StringUtils.isNotEmpty(param.getType())) {
if (CollectionUtils.isNotEmpty(choiceOrgIdList) && CollectionUtils.isNotEmpty(typeOrgIdList)) {
orgIdList = new ArrayList<>(CollectionUtils.intersection(typeOrgIdList, choiceOrgIdList));
if (CollectionUtils.isEmpty(orgIdList)) {
orgIdList.add("-1");
}
}
}
return new LambdaQueryWrapper<PlatAlarmRecord>().ge(Objects.nonNull(param.getCreateDateFrom()), BaseEntity::getCreateDate, param.getCreateDateFrom())
.eq(StringUtils.isNotBlank(param.getId()),BaseEntity::getId,param.getId())
......@@ -188,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)
;
}
......@@ -540,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);
}
......@@ -578,15 +597,21 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
platAlarmRecord.setStatus(CommonEnum.YES.getValue());
platAlarmRecord.setDealDate(LocalDateTime.now());
CommonUserVO user = CommonUserUtil.getUser();
platAlarmRecord.setDealUser(user.getName());
//platAlarmRecord.setDealUser(user.getName());
updateById(platAlarmRecord);
// todo 误报结果写入设备
String deviceId = platAlarmRecord.getDeviceId();
PlatDevice platDevice = platDeviceService.getById(deviceId);
if (platDevice == null) {
throw new RuntimeException("找不到告警关联的设备,设备已解绑" + deviceId);
}
Timestamp timestamp = Timestamp.valueOf(platAlarmRecord.getCreateDate());
log.info("开始想设备发送误报通知");
iotDevicePropertiesOperateService.deviceFunctionAttr(platDevice.getOriDeviceId(),timestamp.getTime());
}
@Override
public PlatAlarmCallDeviceVO callingDevice(PlatCallingDeviceDTO dto) {
PlatAlarmCallDeviceVO platAlarmCallDeviceVO = new PlatAlarmCallDeviceVO();
PlatAlarmRecord platAlarmRecord = getById(dto.getId());
if (platAlarmRecord == null) {
throw new RuntimeException("告警记录为空:" + dto.getId());
......@@ -596,17 +621,7 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
if (platDevice == null) {
throw new RuntimeException("找不到告警关联的设备,设备已解绑" + deviceId);
}
platAlarmCallDeviceVO.setDeviceId(platDevice.getOriDeviceId());
platAlarmCallDeviceVO.setAppId(shengwangProperties.getAppId());
LocalDateTime now = LocalDateTime.now();
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
String channelName = String.format("%s:%s","RTC",now.format(dateTimeFormatter));
RtcTokenBuilder2 token = new RtcTokenBuilder2();
String result = token.buildTokenWithUid(shengwangProperties.getAppId(), shengwangProperties.getAppCertificate(), channelName, 0, RtcTokenBuilder2.Role.ROLE_SUBSCRIBER,
shengwangProperties.getTokenExpirationInSeconds(), shengwangProperties.getPrivilegeExpirationInSeconds());
platAlarmCallDeviceVO.setAccessToken(result);
platAlarmCallDeviceVO.setChannelName(channelName);
return platAlarmCallDeviceVO;
return shengwangService.callingDeviceAuthIgnoreRtc(platDevice.getOriDeviceId());
}
@Override
......
......@@ -413,11 +413,6 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
.eq(PlatOrg::getStatus, CommonEnum.YES.getValue())
);
if (typeFlag || nameFlag) {
Map<String, List<PlatOrg>> parentIdMap = orgList.stream().collect(Collectors.groupingBy(PlatOrg::getParentId));
orgList.forEach(vo -> {
List<PlatOrg> childList = parentIdMap.get(vo.getId());
vo.setChildren(childList);
});
return orgList;
}
return getOrgTree(orgList, Collections.singletonList(TenantIdUtil.getTenantId()));
......
package com.makeit.service.platform.auth.impl;
import cn.hutool.core.collection.CollUtil;
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.core.conditions.update.LambdaUpdateWrapper;
......@@ -219,23 +221,33 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
}
/**
* 平台用户唯一校验
* @param dto
*/
private void checkPerson(PlatPersonDTOVO dto) {
// 账户全局唯一
List<PlatUser> countList = list(Wrappers.<PlatUser>lambdaQuery().eq(PlatUser::getAccount, dto.getAccount())
.ne(StrUtil.isNotBlank(dto.getId()), PlatUser::getId, dto.getId()));
List<PlatUser> userList = list(
new QueryWrapper<PlatUser>().lambda()
.eq(PlatUser::getIsTenant, IsTenantAccountEnum.NO.getValue())
.and(qw -> qw.eq(PlatUser::getAccount, dto.getAccount())
.or()
.eq(PlatUser::getMobile, dto.getMobile())
.and(qw ->
qw.eq(PlatUser::getMobile, dto.getMobile())
.or()
.eq(StringUtils.isNotBlank(dto.getEmail()),PlatUser::getEmail,dto.getEmail())
)
);
if (CollUtil.isNotEmpty(countList)) {
throw new BusinessException(CodeMessageEnum.SYSTEM_ERROR_USER_ACCOUNT_DUPLICATE);
}
userList.forEach(e -> {
if (e.getAccount().equals(dto.getAccount()) && !e.getId().equals(dto.getId())) {
throw new BusinessException(CodeMessageEnum.SYSTEM_ERROR_USER_ACCOUNT_DUPLICATE);
}
//if (e.getAccount().equals(dto.getAccount()) && !e.getId().equals(dto.getId())) {
// throw new BusinessException(CodeMessageEnum.SYSTEM_ERROR_USER_ACCOUNT_DUPLICATE);
//}
if (e.getMobile().equals(dto.getMobile()) && !e.getId().equals(dto.getId())) {
throw new BusinessException(CodeMessageEnum.SYSTEM_ERROR_USER_MOBILE_DUPLICATE);
}
......@@ -599,6 +611,7 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
TokenUtil.platLogin(TokenUtil.tntGetToken(), userLoginVO);
supperRoleMenuList(userLoginVO);
filterOrgManageMenu(userLoginVO);
setRoleMenuToRedis(userLoginVO);
return userLoginVO;
}
......@@ -607,12 +620,36 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
List<PlatMenu> menuList = getMenuListByUserId(userLoginVO);
fillMenuList(menuList, userLoginVO);
filterOrgManageMenu(userLoginVO);
setRoleMenuToRedis(userLoginVO);
return userLoginVO;
}
/**
* 用户所在的角色不是根组织上的角色,就不返回 “组织管理” 菜单
* @param userLoginVO
*/
private void filterOrgManageMenu(PlatUserLoginVO userLoginVO) {
List<PlatMenuDTOVO> menuList = userLoginVO.getMenuList();
if (CollUtil.isEmpty(menuList)) {
return;
}
String tenantId = userLoginVO.getTenantId();
if (StrUtil.isBlank(tenantId)) {
return;
}
PlatOrg platOrg = platOrgService.getById(userLoginVO.getOrgId());
if (platOrg != null && !"0".equals(platOrg.getParentId())) {
PlatMenuDTOVO platMenuDTOVO =
menuList.stream().filter(m -> "组织管理".equals(m.getName())).findFirst().orElse(null);
if (platMenuDTOVO == null || CollUtil.isEmpty(platMenuDTOVO.getChildren())) {
return;
}
platMenuDTOVO.getChildren().removeIf(m -> "组织管理".equals(m.getName()));
}
}
@Override
public PlatUserLoginVO getRoleAndMenuList2() {
//TODO 用join做
......@@ -1140,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<>();
......@@ -1157,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.device;
import com.baomidou.mybatisplus.extension.service.IService;
import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO;
import com.makeit.entity.platform.device.PlatDeviceLog;
/**
* <p>
* 设备日志 服务类
* </p>
*
* @author eugene young
* @since 2023-12-01
*/
public interface PlatDeviceLogService extends IService<PlatDeviceLog> {
PageVO<PlatDeviceLog> pageList(PageReqDTO<PlatDeviceLog> pageReqDTO);
}
......@@ -18,6 +18,7 @@ import com.makeit.vo.platform.device.PlatDeviceListVO;
import com.makeit.vo.platform.device.PlatDeviceViewVO;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.util.List;
/**
......@@ -90,5 +91,5 @@ public interface PlatDeviceService extends IService<PlatDevice> {
PlatAlarmCallDeviceVO callingDevice(PlatCallingDeviceDTO dto);
void devicePushLog(MultipartFile multipartFile);
void devicePushLog(MultipartFile multipartFile, String deviceId) throws IOException;
}
package com.makeit.service.platform.device.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO;
import com.makeit.dto.platform.device.PlatDeviceQueryDTO;
import com.makeit.entity.platform.alarm.PlatAlarmRecord;
import com.makeit.entity.platform.device.PlatDevice;
import com.makeit.entity.platform.device.PlatDeviceLog;
import com.makeit.mapper.platform.device.PlatDeviceLogMapper;
import com.makeit.service.platform.device.PlatDeviceLogService;
import com.makeit.utils.data.convert.PageUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>
* 设备日志 服务实现类
* </p>
*
* @author eugene young
* @since 2023-12-01
*/
@Service
public class PlatDeviceLogServiceImpl extends ServiceImpl<PlatDeviceLogMapper, PlatDeviceLog> implements PlatDeviceLogService {
@Autowired
private PlatDeviceLogMapper platDeviceLogMapper;
@Override
public PageVO<PlatDeviceLog> pageList(PageReqDTO<PlatDeviceLog> pageReqDTO) {
PlatDeviceLog dto = pageReqDTO.getData();
Page<PlatDeviceLog> p = PageUtil.toMpPage(pageReqDTO);
LambdaQueryWrapper<PlatDeviceLog> lambdaQueryWrapper = new QueryWrapper<PlatDeviceLog>().lambda()
.eq(StringUtils.isNotEmpty(dto.getDeviceId()), PlatDeviceLog::getDeviceId, dto.getDeviceId())
.eq(StringUtils.isNotEmpty(dto.getProductName()), PlatDeviceLog::getProductName, dto.getProductName())
.eq(StringUtils.isNotEmpty(dto.getTenantId()), PlatDeviceLog::getTenantId, dto.getTenantId())
.ge(dto.getStartTime() != null, PlatDeviceLog::getCreateDate, dto.getStartTime())
.ge(dto.getEndTime() != null, PlatDeviceLog::getCreateDate, dto.getEndTime());
Page<PlatDeviceLog> deviceLogPage = platDeviceLogMapper.selectPage(p, lambdaQueryWrapper);
return PageUtil.toPageVO(deviceLogPage.getRecords(), deviceLogPage);
}
}
......@@ -375,7 +375,7 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService {
if (platDevice == null) {
return vo;
}
vo.setDeviceId(platDevice.getOriDeviceId());
String result = redisTemplate.opsForValue().get(DEVICE_BR_DATA + platDevice.getOriDeviceId());
log.info("实时获取设备呼吸数据:{}",result);
if (result != null) {
......@@ -499,7 +499,7 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService {
List<PlatDevice> fallDeviceList = Lists.newArrayList();
if (StringUtils.isNotBlank(platElderIdDTO.getDeviceId())) {
PlatDevice device = platDeviceService.getOne(new QueryWrapper<PlatDevice>().lambda()
.eq(PlatDevice::getOriDeviceId, platElderIdDTO.getDeviceId()).last("limit 1"));
.eq(PlatDevice::getId, platElderIdDTO.getDeviceId()).last("limit 1"));
if (device != null) {
deviceListSpace.add(device);
}
......
......@@ -37,6 +37,7 @@ import com.makeit.mapper.platform.elder.PlatElderMapper;
import com.makeit.module.system.service.SysConfigService;
import com.makeit.module.system.vo.SysConfigVO;
import com.makeit.service.platform.auth.PlatOrgService;
import com.makeit.service.platform.device.PlatDeviceService;
import com.makeit.service.platform.elder.*;
import com.makeit.service.platform.space.PlatBedService;
import com.makeit.service.platform.space.PlatRoomBedDeviceService;
......@@ -53,7 +54,6 @@ import com.makeit.utils.sql.join.JoinUtil;
import com.makeit.utils.sys.FileUtil;
import com.makeit.utils.user.plat.PlatUserUtil;
import com.makeit.utils.user.plat.PlatUserVO;
import com.makeit.utils.user.wechat.WechatUserUtil;
import com.makeit.vo.platform.elder.PlatElderExportVO;
import com.makeit.vo.platform.elder.PlatElderListVO;
import com.makeit.vo.wechat.elder.PlatElderChildrenInfoWechatVO;
......@@ -115,6 +115,8 @@ public class PlatElderServiceImpl extends ServiceImpl<PlatElderMapper, PlatElder
private PersonalConfigCacheUtil personalConfigCacheUtil;
@Autowired
private SysConfigService sysConfigService;
@Autowired
private PlatDeviceService platDeviceService;
private LambdaQueryWrapper<PlatElder> lambdaQueryWrapper(PlatElderQueryDTO dto) {
List<String> typeOrgIdList = Lists.newArrayList();
......@@ -127,19 +129,27 @@ public class PlatElderServiceImpl extends ServiceImpl<PlatElderMapper, PlatElder
choiceOrgIdList.addAll(Lists.newArrayList(dto.getOrgId().split(",")));
}
List<String> orgIdList = Lists.newArrayList();
if (CollectionUtils.isNotEmpty(choiceOrgIdList)) {
orgIdList = choiceOrgIdList;
}
if (CollectionUtils.isNotEmpty(typeOrgIdList)) {
if (StringUtils.isNotEmpty(dto.getType()) && StringUtils.isEmpty(dto.getOrgId())) {
orgIdList = typeOrgIdList;
}
if (CollectionUtils.isNotEmpty(choiceOrgIdList) && CollectionUtils.isNotEmpty(typeOrgIdList)) {
orgIdList = new ArrayList<>(CollectionUtils.intersection(typeOrgIdList, choiceOrgIdList));
if (CollectionUtils.isEmpty(orgIdList)) {
orgIdList.add("-1");
}
}
if (StringUtils.isNotEmpty(dto.getOrgId()) && StringUtils.isEmpty(dto.getType())) {
orgIdList = choiceOrgIdList;
if (CollectionUtils.isEmpty(orgIdList)) {
orgIdList.add("-1");
}
}
if (StringUtils.isNotEmpty(dto.getOrgId()) && StringUtils.isNotEmpty(dto.getType())) {
if (CollectionUtils.isNotEmpty(choiceOrgIdList) && CollectionUtils.isNotEmpty(typeOrgIdList)) {
orgIdList = new ArrayList<>(CollectionUtils.intersection(typeOrgIdList, choiceOrgIdList));
if (CollectionUtils.isEmpty(orgIdList)) {
orgIdList.add("-1");
}
}
}
return new QueryWrapper<PlatElder>().lambda()
.like(StringUtils.isNotBlank(dto.getName()), PlatElder::getName, dto.getName())
.like(StringUtils.isNotBlank(dto.getPhone()), PlatElder::getPhone, dto.getPhone())
......@@ -216,6 +226,46 @@ public class PlatElderServiceImpl extends ServiceImpl<PlatElderMapper, PlatElder
fill(list);
List<String> roomIds = list.stream().filter(platElderListVO -> StringUtils.isNotEmpty(platElderListVO.getRoomId()))
.map(PlatElderListVO::getRoomId).collect(Collectors.toList());
List<PlatRoomBedDevice> platRoomDevices = platRoomBedDeviceService.list(new QueryWrapper<PlatRoomBedDevice>().lambda()
.in(PlatRoomBedDevice::getRoomId, roomIds)
.isNull(PlatRoomBedDevice::getBedId));
List<PlatRoomBedDevice> platBedDevices = platRoomBedDeviceService.list(new QueryWrapper<PlatRoomBedDevice>().lambda()
.in(PlatRoomBedDevice::getRoomId, roomIds)
.isNotNull(PlatRoomBedDevice::getBedId));
Map<String, List<PlatRoomBedDevice>> roomDeviceMap = StreamUtil.groupBy(platRoomDevices, PlatRoomBedDevice::getRoomId);
Map<String, PlatRoomBedDevice> bedDeviceMap = StreamUtil.toMap(platBedDevices, PlatRoomBedDevice::getBedId);
List<PlatDevice> platDeviceList = platDeviceService.list();
Map<String, PlatDevice> deviceMap = StreamUtil.toMap(platDeviceList, BaseEntity::getId);
for (PlatElderListVO vo : list) {
List<PlatDevice> deviceList = Lists.newArrayList();
if (StringUtils.isNotEmpty(vo.getRoomId())) {
List<PlatRoomBedDevice> platRoomBedDevices = roomDeviceMap.get(vo.getRoomId());
if (CollectionUtils.isNotEmpty(platRoomBedDevices)) {
List<String> tempDeviceIdList = StreamUtil.map(platRoomBedDevices, PlatRoomBedDevice::getDeviceId);
for (String s : tempDeviceIdList) {
PlatDevice platDevice = deviceMap.get(s);
if (platDevice != null) {
deviceList.add(platDevice);
}
}
}
}
if (StringUtils.isNotEmpty(vo.getBedId())) {
PlatRoomBedDevice platRoomBedDevice = bedDeviceMap.get(vo.getBedId());
if (platRoomBedDevice != null) {
PlatDevice platDevice = deviceMap.get(platRoomBedDevice.getDeviceId());
if (platDevice != null) {
deviceList.add(platDevice);
}
}
}
vo.setDeviceList(deviceList);
}
return PageUtil.toPageVO(list, voPage);
}
......@@ -441,6 +491,9 @@ public class PlatElderServiceImpl extends ServiceImpl<PlatElderMapper, PlatElder
//List<SysConfigVO> sysConfigVOS1 = sysConfigService.viewListByCategoryCode(SysConfigCategoryConst.ELDER_CERTIFICATE_TYPE);
ExcelImportVo result = new ExcelImportVo();
return ExcelValidatorUtil.validateMain(3, list, l -> {
int start = 3;
......@@ -468,10 +521,10 @@ public class PlatElderServiceImpl extends ServiceImpl<PlatElderMapper, PlatElder
List<String> excelField = Arrays.asList(
"小区",
"楼栋",
"单元",
"楼层"
"一级空间",
"二级空间",
"三级空间",
"四级空间"
);
List<String> spaceName = Arrays.asList(
......@@ -556,7 +609,7 @@ public class PlatElderServiceImpl extends ServiceImpl<PlatElderMapper, PlatElder
);
if (c == 0 && StreamUtil.anyMatch(roomAndBed, StringUtils::isNotBlank)) {
errorVoList.add(new ExcelErrorVo(i + start, "小区、楼栋、单元、楼层", "不能为空"));
errorVoList.add(new ExcelErrorVo(i + start, "一级空间,二级空间,三级空间,四级空间", "不能为空"));
for (int j = 0; j < 2; j++) {
if (StringUtils.isBlank(roomAndBed.get(j))) {
......
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;
......@@ -171,18 +172,35 @@ public class PlatBedServiceImpl extends ServiceImpl<PlatBedMapper, PlatBed> impl
choiceOrgIdList.addAll(Lists.newArrayList(dto.getOrgId().split(",")));
}
List<String> orgIdList = Lists.newArrayList();
if (CollectionUtils.isNotEmpty(choiceOrgIdList)) {
orgIdList = choiceOrgIdList;
}
if (CollectionUtils.isNotEmpty(typeOrgIdList)) {
if (com.makeit.utils.old.StringUtils.isNotEmpty(dto.getOrgType()) && com.makeit.utils.old.StringUtils.isEmpty(dto.getOrgId())) {
orgIdList = typeOrgIdList;
if (CollectionUtils.isEmpty(orgIdList)) {
orgIdList.add("-1");
}
}
if (CollectionUtils.isNotEmpty(choiceOrgIdList) && CollectionUtils.isNotEmpty(typeOrgIdList)) {
orgIdList = new ArrayList<>(CollectionUtils.intersection(typeOrgIdList, choiceOrgIdList));
if (com.makeit.utils.old.StringUtils.isNotEmpty(dto.getOrgId()) && com.makeit.utils.old.StringUtils.isEmpty(dto.getOrgType())) {
orgIdList = choiceOrgIdList;
if (CollectionUtils.isEmpty(orgIdList)) {
orgIdList.add("-1");
}
}
if (com.makeit.utils.old.StringUtils.isNotEmpty(dto.getOrgId()) && com.makeit.utils.old.StringUtils.isNotEmpty(dto.getOrgType())) {
if (CollectionUtils.isNotEmpty(choiceOrgIdList) && CollectionUtils.isNotEmpty(typeOrgIdList)) {
orgIdList = new ArrayList<>(CollectionUtils.intersection(typeOrgIdList, choiceOrgIdList));
if (CollectionUtils.isEmpty(orgIdList)) {
orgIdList.add("-1");
}
}
}
// 数据权限
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);
}
......
package com.makeit.service.platform.space.impl;
import cn.hutool.core.collection.CollUtil;
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.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.xiaoymin.knife4j.core.util.CollectionUtils;
import com.google.common.collect.Lists;
......@@ -16,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;
......@@ -40,6 +42,7 @@ import org.springframework.web.multipart.MultipartFile;
import java.util.*;
import java.util.function.BiConsumer;
import java.util.function.Function;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
......@@ -150,6 +153,25 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
platRoom.setSpacePath(dto.getParentPath() + "," + space.getId());
platRoomService.updateById(platRoom);
}
List<String> roomIds = platRoomList.stream().map(PlatRoom::getId).collect(Collectors.toList());
Map<String, PlatRoom> roomMap = platRoomList.stream().collect(Collectors.toMap(PlatRoom::getId,
Function.identity()));
if (CollUtil.isEmpty(roomIds)) {
return;
}
List<PlatElder> elderList = platElderService.list(Wrappers.<PlatElder>lambdaQuery().in(PlatElder::getRoomId,
roomIds));
if (CollUtil.isNotEmpty(elderList)) {
elderList.forEach(e -> {
String roomId = e.getRoomId();
if (StrUtil.isBlank(roomId) || !roomMap.containsKey(roomId)) {
return;
}
PlatRoom platRoom = roomMap.get(roomId);
e.setSpacePath(platRoom.getSpacePath() + "," + e.getBedId());
platElderService.updateById(e);
});
}
}
@Override
......@@ -488,6 +510,7 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
// 进行匹配
if(!matcher.find()){
errorVoList.add(new ExcelErrorVo(i + 3, excelField.get(4), "床位数量格式错误"));
errorFlag = true;
}
}
......@@ -513,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());
......@@ -544,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);
......@@ -581,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);
......@@ -618,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());
......@@ -698,6 +722,7 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
excelImportVo.setErrorCount(errorCount);
excelImportVo.setSuccessCount(successCount);
excelImportVo.setList(errorVoList);
excelImportVo.setMatchesCount(successCount);
if(errorCount > 0){
excelImportVo.setSuccessCount(0);
excelImportVo.setMatchesCount(successCount);
......
......@@ -2,6 +2,7 @@ package com.makeit.vo.platform.alarm;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.makeit.common.dto.BaseTenantDTO;
import com.makeit.entity.platform.device.PlatDevice;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -62,9 +63,13 @@ 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;
private String deviceId;
private PlatDevice device;
}
......@@ -93,6 +93,8 @@ public class PlatDeviceListVO extends BaseTenantDTO {
private String roomName;
private String bedName;
@ApiModelProperty(value = "许可证")
private String deviceLicense;
}
......@@ -2,12 +2,14 @@ package com.makeit.vo.platform.elder;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.makeit.common.dto.BaseTenantDTO;
import com.makeit.entity.platform.device.PlatDevice;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
import java.util.List;
/**
* <p>
......@@ -137,5 +139,7 @@ public class PlatElderListVO extends BaseTenantDTO {
private String updateBy;
@ApiModelProperty(value = "头像文件id")
private String avatar;
@ApiModelProperty("设备列表")
private List<PlatDevice> deviceList;
}
......@@ -23,5 +23,7 @@ public class PlatElderRealTimeHeartRespiratoryVO {
@ApiModelProperty("状态")
private String status;
@ApiModelProperty("设备id")
private String deviceId;
}
package com.makeit.vo.platform.workstation;
import com.makeit.entity.platform.device.PlatDevice;
import com.makeit.shengwang.agora.vo.PlatAlarmCallDeviceVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -64,6 +66,8 @@ public class WorkStationHomeBedVO {
@ApiModelProperty("呼吸率")
private Integer respiratoryRate;
@ApiModelProperty("设备列表")
private List<PlatDevice> deviceList;
@ApiModelProperty(value = "告警类型")
private Map<String,String> alarmTypeMap;
......
package com.makeit.vo.platform.workstation;
import com.makeit.entity.platform.device.PlatDevice;
import com.makeit.shengwang.agora.vo.PlatAlarmCallDeviceVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -43,7 +45,8 @@ public class WorkStationInstitutionBedVO {
@ApiModelProperty(value = "长者状态")
private String elderStatus;
@ApiModelProperty("设备列表")
private List<PlatDevice> deviceList;
@ApiModelProperty(value = "告警类型")
private Map<String,String> alarmTypeMap;
}
......@@ -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>
......
......@@ -40,6 +40,17 @@
<if test="param.orgId != null and param.orgId != '' ">
and pd.org_id = #{param.orgId}
</if>
<if test="param.tenantId != null and param.tenantId != ''">
and pd.tenant_id = #{param.tenantId}
</if>
<choose>
<when test="param.active !=null and param.active !='' and param.active == 1">
and pd.device_license is not null
</when>
<when test="param.active !=null and param.active !='' and param.active == 0">
and pd.device_license is null
</when>
</choose>
<if test="param.orgIds != null and param.orgIds.size() > 0 ">
AND pd.org_id in
<foreach collection="param.orgIds" item="item" separator="," open="(" close=")" index="">
......
......@@ -62,6 +62,11 @@ mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
logging:
level:
root: debug
file:
filePath: file
file: D:/pro/${file.filePath}
......@@ -109,6 +114,7 @@ libreOffice: C:\\Program Files\\LibreOffice\\program\\soffice
iot:
url: https://iot.qa.insightica.cn/api/
uploadUrl: https://saas.qa.insightica.cn/api/saas/device/devicePushLog
clientId: fyxmb5h52iKwE2Hi
secureKey: 22fZbnH36wdHn7ZTyKKHraFw233npcez
sync:
......@@ -163,6 +169,16 @@ shengwang:
pid: 9851781E9E31453DA3C572A4A4AF9402
aliyun:
oss:
accessKey: LTAI5tMjaFCiaYYLmtCLiuMj
secretKey: Oq1925mQ8663nxaf83MyoOGAbVM71H
endpoint: oss-cn-shenzhen.aliyuncs.com
bucket: kangyang-oss
baseDir: kangyang
......@@ -105,6 +105,7 @@ libreOffice: /home/group1_lzy/iot-server/LibreOffice/program/soffice
iot:
url: https://iot.qa.insightica.cn/api/
uploadUrl: https://saas.qa.insightica.cn/api/saas/device/devicePushLog
clientId: fyxmb5h52iKwE2Hi
secureKey: 22fZbnH36wdHn7ZTyKKHraFw233npcez
......@@ -157,3 +158,12 @@ shengwang:
customerSecret: bd81828a133140a58dfb04e9d80eba43
pid: 9851781E9E31453DA3C572A4A4AF9402
aliyun:
oss:
accessKey: LTAI5tMjaFCiaYYLmtCLiuMj
secretKey: Oq1925mQ8663nxaf83MyoOGAbVM71H
endpoint: oss-cn-shenzhen.aliyuncs.com
bucket: kangyang-oss
baseDir: kangyang
......@@ -7,11 +7,6 @@
<property name="pattern"
value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%X{appName}] [%X{profile}] [%X{traceId:-},%X{spanId:-}] [%X{requestId}] [%X{userId}] [%thread] %-5level %logger{50} - %msg%n"/>
<springProfile name="dev">
<property name="logback.logdir" value="/home/group1_lzy/iot-server/logs"/>
<property name="logback.appname" value="app"/>
</springProfile>
<springProfile name="prod">
<property name="logback.logdir" value="/home/group1_lzy/iot-server/logs"/>
<property name="logback.appname" value="app"/>
......@@ -132,11 +127,6 @@
<appender-ref ref="FILEERRORLOG"/>
<appender-ref ref="FILEWARNLOG"/>
</logger>
<logger name="com.makeit" level="ERROR" additivity="false">
<appender-ref ref="FILEINFOLOG"/>
<appender-ref ref="FILEERRORLOG"/>
<appender-ref ref="FILEWARNLOG"/>
</logger>
</springProfile>
<springProfile name="test">
......
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