diff --git a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/constants/AlarmConstants.java b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/constants/AlarmConstants.java index 0a05c3f..d3e3789 100644 --- a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/constants/AlarmConstants.java +++ b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/constants/AlarmConstants.java @@ -64,4 +64,8 @@ public interface AlarmConstants { List HZ3000_TYPES = Arrays.asList("0","1","2","3","4","5","6","7","8","9","10","11","12"); String SMS_MESSAGE_TEMPLATE_CODE = "aliyun-alert-push"; + + String FDP_INVALID_STATUS = "1.0"; + + String FDP_INVALID_ZOME_STATUS = "1"; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/dto/OperDefectRepeatRatioDTO.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/dto/OperDefectRepeatRatioDTO.java index 99d29d2..0baf91a 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/dto/OperDefectRepeatRatioDTO.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/dto/OperDefectRepeatRatioDTO.java @@ -27,9 +27,13 @@ public class OperDefectRepeatRatioDTO { // @ApiModelProperty(value = "缺陷等级名称") // private String defectLevelName; - @ApiModelProperty(value = "发生数量") + @ApiModelProperty(value = "重复缺陷发生数量") private Long happenNum = 0L; + @ApiModelProperty(value = "缺陷发生总数") + private Long happenSumNum = 0L; + + @ApiModelProperty(value = "占总缺陷的比率") private Double happenRatio = 0.0; diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java index 7c079bf..a080158 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java @@ -70,6 +70,9 @@ public interface MainConstants { // 集中监控数据处理 String CENTRALIZED_MONITORING = "centralizedMonitoring"; + // 清理历史告警数据 + String CLEAR_HISTORY_ALARM = "clearHistoryAlarm"; + // 开停机告警 String START_STOP_ALARM = "startStopAlarm"; diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpWarehouseOutController.java b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpWarehouseOutController.java index 54e8b2f..cbfa7ba 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpWarehouseOutController.java +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpWarehouseOutController.java @@ -11,7 +11,6 @@ import com.hnac.hzims.spare.entity.SpWarehouseOutEntity; import com.hnac.hzims.spare.service.ISpWarehouseOutService; import com.hnac.hzims.spare.vo.SpWarehouseExportVO; import com.hnac.hzims.spare.vo.SpWarehouseOutVO; -import com.hnac.hzims.vo.VoteChartVo; import com.hnac.hzinfo.log.annotation.Business; import com.hnac.hzinfo.log.annotation.Operate; import io.swagger.annotations.Api; @@ -39,7 +38,6 @@ import java.util.Date; import java.util.List; import java.util.stream.Collectors; - /** * 控制器 * @@ -81,6 +79,7 @@ public class SpWarehouseOutController extends BladeController { IPage pages = sp_warehouse_outService.selectPageList(Condition.getPage(query),warehouseOutVO); return R.data(pages); } + /** * 分页 代码自定义代号 */ @@ -120,6 +119,7 @@ public class SpWarehouseOutController extends BladeController { e.printStackTrace(); } } + /** * 工单预警 */ @@ -165,7 +165,6 @@ public class SpWarehouseOutController extends BladeController { return R.status(sp_warehouse_outService.saveOrUpdate(sp_warehouse_out)); } - /** * 删除 代码自定义代号 */ @@ -176,6 +175,7 @@ public class SpWarehouseOutController extends BladeController { public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { return R.status(sp_warehouse_outService.deleteLogic(Func.toLongList(ids))); } + /** * 完成流程 修改状态 */ diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpWarehouseOutMapper.java b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpWarehouseOutMapper.java index 78bb951..5927778 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpWarehouseOutMapper.java +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpWarehouseOutMapper.java @@ -1,10 +1,8 @@ package com.hnac.hzims.spare.mapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.spare.entity.SpWarehouseOutEntity; import com.hnac.hzims.spare.vo.SpWarehouseOutVO; -import feign.Param; import org.springblade.core.datascope.annotation.UserDataAuth; import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; @@ -19,6 +17,7 @@ import java.util.Map; public interface SpWarehouseOutMapper extends UserDataScopeBaseMapper { String selectMaxCode(Map params); + /** * 分页列表 * @param page @@ -27,8 +26,10 @@ public interface SpWarehouseOutMapper extends UserDataScopeBaseMapper selectPageList(IPage page, Map params); -// @UserDataAuth + + @UserDataAuth List selectListByCondition( Map params); + /** * 根据工单ID查询出库单编码 * @param ticketId diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpWarehouseOutServiceImpl.java b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpWarehouseOutServiceImpl.java index df050df..9e5e594 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpWarehouseOutServiceImpl.java +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpWarehouseOutServiceImpl.java @@ -17,15 +17,12 @@ import com.hnac.hzims.spare.vo.WtSpBasicVO; import lombok.AllArgsConstructor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springblade.core.launch.constant.FlowConstant; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; -import org.springblade.core.tool.support.Kv; -import org.springblade.core.tool.utils.StringUtil; import org.springblade.system.entity.Dept; import org.springblade.system.feign.IDictBizClient; import org.springblade.system.feign.ISysClient; @@ -34,13 +31,11 @@ import org.springblade.system.user.feign.IUserClient; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import javax.annotation.Resource; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.*; -import java.util.stream.Collectors; /** * 服务实现类 diff --git a/hzims-service/equipment/src/main/resources/db/2.0.0.sql.1 b/hzims-service/equipment/src/main/resources/db/2.0.0.sql.1 index 8f62292..adcfe59 100644 --- a/hzims-service/equipment/src/main/resources/db/2.0.0.sql.1 +++ b/hzims-service/equipment/src/main/resources/db/2.0.0.sql.1 @@ -32,4 +32,7 @@ update bladex.blade_dict set dict_key = '2' where id = 1675699613977288706; update equipment.hzims_em_definition set type = '2' where type = '0'; update bladex.blade_dict set dict_key = '2' where id = 1675699613977288706; -update equipment.hzims_em_definition set type = '2' where type = '0'; \ No newline at end of file +update equipment.hzims_em_definition set type = '2' where type = '0'; + +-- 修改故障诊断任务表的字符集 +ALTER TABLE hzims_fdp_task CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/service/impl/AlarmConfigDetailServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/service/impl/AlarmConfigDetailServiceImpl.java index ba8d184..deed511 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/service/impl/AlarmConfigDetailServiceImpl.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/service/impl/AlarmConfigDetailServiceImpl.java @@ -92,38 +92,32 @@ public class AlarmConfigDetailServiceImpl extends BaseServiceImpl> result = stationClient.querySatationByCodes(alarms.stream().map(AlarmEntity::getStationId).collect(Collectors.toList())); if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){ - log.error("alarm query station is null : {}",alarms.stream().map(AlarmEntity::getAlarmId).collect(Collectors.toList())); + log.error("alarm_query_station_is_null : {}",alarms.stream().map(AlarmEntity::getAlarmId).collect(Collectors.toList())); return false; } // 步骤2.遍历保存告警数据 alarms.forEach(alarm->{ - List stations = result.getData().stream().filter(o->o.getCode().equals(alarm.getStationId())).collect(Collectors.toList()); if(CollectionUtil.isEmpty(stations)){ return; @@ -64,10 +63,9 @@ public class AlarmSaveServiceImpl implements AlarmSaveService { // 步骤4.根据站点查询配置标识 AlarmHandleMarkVo mark = alarmConfigService.mark(alarm.getStationId(),alarm.getAlarmSource(),alarm.getAlarmType()); if(ObjectUtil.isEmpty(mark)){ - log.error("alarm obtain mark is null : {}",alarm.getAlarmId()); + log.error("alarm_obtain_mark_is_null : {}",alarm.getAlarmId()); return; } - // 步骤5.告警处理标识赋值 alarm.setIsRightTabulation(mark.getIsRightTabulation()); alarm.setIsBroadcast(mark.getIsBroadcast()); @@ -77,11 +75,10 @@ public class AlarmSaveServiceImpl implements AlarmSaveService { alarm.setIsSmallBell(mark.getIsSmallBell()); alarm.setIsShortMessage(mark.getIsShortMessage()); alarm.setIsWxMessage(mark.getIsWxMessage()); - // 步骤6.保存当日告警数据 boolean isSave = alarmService.save(alarm); if(!isSave){ - log.error("alarm save fail : {}",alarm.getAlarmId()); + log.error("alarm_save_fail : {}",alarm.getAlarmId()); return; } @@ -90,4 +87,5 @@ public class AlarmSaveServiceImpl implements AlarmSaveService { }); return true; } + } \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/FdpMqttConsumer.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/FdpMqttConsumer.java index 97a8822..c4c2d97 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/FdpMqttConsumer.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/FdpMqttConsumer.java @@ -2,10 +2,12 @@ package com.hnac.hzims.alarm.mqtt; import com.alibaba.fastjson.JSONObject; import com.hnac.hzims.alarm.config.entity.AlarmEntity; -import com.hnac.hzims.alarm.source.service.FdpAlarmService; import com.hnac.hzims.alarm.monitor.service.AlarmSaveService; +import com.hnac.hzims.alarm.source.service.FdpAlarmService; import com.hnac.hzinfo.subscribe.SubscribeCallBack; +import lombok.extern.slf4j.Slf4j; import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.tool.utils.CollectionUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -18,6 +20,7 @@ import java.util.Map; */ @Service +@Slf4j public class FdpMqttConsumer implements SubscribeCallBack { @Autowired private FdpAlarmService fdpAlarmService; @@ -25,11 +28,15 @@ public class FdpMqttConsumer implements SubscribeCallBack { private AlarmSaveService alarmSaveService; @Override public void onMessage(Map data) { - System.out.println("监听到消息"+data.toString()); String s = JSONObject.toJSONString(data); + log.error("监听Fdp消息 : {}" ,s); //消费代码 List alarmEntities = fdpAlarmService.receiveMessage(s); + if(CollectionUtil.isEmpty(alarmEntities)){ + return; + } + log.error("监听Fdp有效消息 : {}" ,alarmEntities.get(0).getAlarmId()); //统一数据处理 try { alarmSaveService.save(alarmEntities); diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/HZ300MqttConsumer.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/HZ300MqttConsumer.java index 67c4895..82880ad 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/HZ300MqttConsumer.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/HZ300MqttConsumer.java @@ -6,6 +6,7 @@ import com.hnac.hzims.alarm.source.service.SystemAlarmService; import com.hnac.hzims.alarm.monitor.service.AlarmSaveService; import com.hnac.hzinfo.subscribe.SubscribeCallBack; import lombok.extern.slf4j.Slf4j; +import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.DateUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -31,11 +32,15 @@ public class HZ300MqttConsumer implements SubscribeCallBack { log.error("HZ3000队列监听到消息 : {}",data); //消费代码 List alarmEntities = systemAlarmService.receiveMessage(JSONObject.toJSONString(data)); + if(CollectionUtil.isEmpty(alarmEntities)){ + log.error("HZ3000消息转换数据异常"); + return; + } //统一数据处理 try { alarmSaveService.save(alarmEntities); }catch (Exception e){ - log.error("HZ3000告警数据处理报错(HZ300Alarm):"+e); + log.error("HZ3000告警数据处理报错(HZ300Alarm):{}" , e.getMessage()); } } } \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleMapper.xml b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleMapper.xml index e7991ea..971f958 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleMapper.xml +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleMapper.xml @@ -4,9 +4,10 @@ - SELECT t.*,u.USER_ID as userIds,u.USER_NAME from HZ_ST_EX_TASK t - LEFT JOIN HZ_ST_EX_TASK_USER u on t.ID=u.TASK_ID - and u.IS_DELETED=0 + SELECT t.*,u.USER_ID as userIds,u.USER_NAME as userNames + from + HZ_ST_EX_TASK t + LEFT JOIN HZ_ST_EX_TASK_USER u on t.ID=u.TASK_ID and u.IS_DELETED=0 where t.IS_DELETED=0 and u.USER_ID=#{task.userId} @@ -191,12 +192,15 @@ order by t.UPDATE_TIME desc