Commit 03db68f2 authored by tianbo's avatar tianbo

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents 1ced89e5 a858c20c
package com.yeejoin.amos.boot.module.tzs.api.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
......@@ -15,10 +16,10 @@ import java.util.Date;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="MsgLogDto", description="消息流水表")
public class MsgLogDto extends BaseDto {
@ApiModel(value = "MsgLogDto", description = "消息流水表")
public class MsgLogDto extends BaseDto {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "关联编号")
......@@ -27,6 +28,9 @@ public class MsgLogDto extends BaseDto {
@ApiModelProperty(value = "消息类型(超期预警、许可超期、风险预警)")
private String msgType;
@ApiModelProperty(value = "消息类型名称")
private String msgTypeName;
@ApiModelProperty(value = "消息内容")
private String body;
......@@ -39,4 +43,7 @@ public class MsgLogDto extends BaseDto {
@ApiModelProperty(value = "发送日期")
private Date sendTime;
@ApiModelProperty(value = "站端类型: WEB,APP")
private String terminalType;
}
......@@ -6,6 +6,8 @@ import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.naming.ldap.PagedResultsControl;
import java.util.Date;
/**
......@@ -35,6 +37,11 @@ public class MsgLog extends BaseEntity {
private String msgType;
/**
* 消息类型名称
*/
private String msgTypeName;
/**
* 消息内容
*/
@TableField("body")
......@@ -58,4 +65,10 @@ public class MsgLog extends BaseEntity {
@TableField("send_time")
private Date sendTime;
/**
* 站端类型: WEB,APP
*/
private String terminalType;
}
......@@ -15,10 +15,11 @@ import java.util.Optional;
public enum EarlyWarningLevelEnum {
/**
* 预警等级枚举
*
*/
FIRST_LEVEL("一级预警", "1", "即将超期"),
SECOND_LEVEL("二级预警", "2", "即将超期"),
THREE_LEVEL("三级预警", "3", "已超期");
EARLY_WARNING_FIRST_LEVEL("一级预警", "1", "即将超期", "earlyWarning_firstLevel"),
EARLY_WARNING_SECOND_LEVEL("二级预警", "2", "即将超期", "earlyWarning_secondLevel"),
EARLY_WARNING_THREE_LEVEL("三级预警", "3", "已超期", "earlyWarning_threeLevel");
private String name;
......@@ -26,6 +27,8 @@ public enum EarlyWarningLevelEnum {
private String status;
private String code;
public static EarlyWarningLevelEnum getEumByLevel(String level) {
Optional<EarlyWarningLevelEnum> op = Arrays.stream(EarlyWarningLevelEnum.values()).filter(e -> e.getLevel().equals(level)).findFirst();
return op.orElseThrow(() -> new RuntimeException("未知的类型"));
......
package com.yeejoin.amos.boot.module.tzs.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author DELL
*/
@AllArgsConstructor
@Getter
public enum TerminalTypeEnum {
/**
* 终端类型
*/
TERMINAL_TYPE_WEB("WEB"),
TERMINAL_TYPE_APP("APP");
private String code;
}
......@@ -122,4 +122,6 @@ public class CylinderInfoDto extends BaseDto {
@ApiModelProperty(value = "最近预警时间")
private Date earlyWarningLevelCalDate;
}
......@@ -22,6 +22,7 @@ import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.common.recycler.Recycler;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
......@@ -888,8 +889,9 @@ public class CylinderInfoController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "气瓶处置日志")
@GetMapping(value = "/msg/{sequenceCode}/list")
public ResponseModel<List<MsgLog>> getMsgList(@PathVariable String sequenceCode){
return ResponseHelper.buildResponse(cylinderInfoServiceImpl.getMsgList(sequenceCode));
public ResponseModel<List<MsgLog>> getMsgList(@PathVariable String sequenceCode,
@RequestParam(value = "terminalType",required = false) String terminalType){
return ResponseHelper.buildResponse(cylinderInfoServiceImpl.getMsgList(sequenceCode, terminalType));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......
......@@ -12,8 +12,10 @@ import com.yeejoin.amos.boot.module.tzs.flc.api.dto.*;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.*;
import com.yeejoin.amos.boot.module.tzs.flc.api.mapper.CylinderInfoMapper;
import com.yeejoin.amos.boot.module.tzs.flc.api.service.ICylinderInfoService;
import com.yeejoin.amos.component.rule.RuleTrigger;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
......@@ -88,6 +90,9 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
@Autowired
MsgLogServiceImpl msgLogService;
@Autowired
private RuleTrigger ruleTrigger;
/**
* 分页查询
*/
......@@ -599,7 +604,8 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
result.getRecords().forEach(r -> {
try {
int interval = DateUtils.dateBetweenIncludeToday(r.getNextInspectionDate(), now);
// TODO 循环调用规则 触发计算等级及发送消息
// TODO 循环调用规则 触发计算等级
// ruleTrigger.publish(equipmentInputItemRo, packageld, null);
} catch (ParseException e) {
log.error(JSON.toJSONString(r) + "格式化失败");
}
......@@ -615,9 +621,10 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
return this.baseMapper.getDetail(sequenceCode);
}
public List<MsgLog> getMsgList(String sequenceCode) {
public List<MsgLog> getMsgList(String sequenceCode, String terminalType) {
LambdaQueryWrapper<MsgLog> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(MsgLog::getRelationCode, sequenceCode);
wrapper.eq(StringUtils.isNotEmpty(terminalType),MsgLog::getTerminalType,terminalType);
wrapper.orderByDesc(MsgLog::getSendTime);
return msgLogService.list(wrapper);
}
......@@ -637,6 +644,7 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
cylinderInfo.setNextInspectionDate(c.getNextInspectionDate());
cylinderInfos.add(cylinderInfo);
// TODO 循环调用规则 触发计算等级及发送消息
// ruleTrigger.publish(equipmentInputItemRo, packageld, null);
});
if(!cylinderInfos.isEmpty()){
this.updateBatchById(cylinderInfos);
......
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 to comment