Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
ty 7 months ago
parent
commit
e6324712bd
  1. 2
      hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/business/interruption/constants/InterruptionConstants.java
  2. 6
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceEntity.java
  3. 7
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java
  4. 44
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java
  5. 2
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java
  6. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/CentralMonitorServiceImpl.java
  7. 7
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/data/service/impl/HzimsDataServiceImpl.java
  8. 7
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygienePlanMapper.java
  9. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygienePlanMapper.xml
  10. 14
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.java
  11. 14
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml
  12. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneZoneMapper.java
  13. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml
  14. 6
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.java
  15. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceMapper.java
  16. 11
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.java
  17. 12
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.xml
  18. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestScoreMapper.java
  19. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.java
  20. 11
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java
  21. 12
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml
  22. 5
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java
  23. 5
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java
  24. 5
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java
  25. 4
      hzims-service/safeproduct/src/main/resources/db/2.0.1.sql

2
hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/business/interruption/constants/InterruptionConstants.java

@ -8,6 +8,8 @@ import java.util.List;
*/
public interface InterruptionConstants {
String HZ3000_TOPIC_PREFIX = "iot/sync/hz3000soe/";
List<String> INTERRUPTION_TYPE = Arrays.asList("13","14");
/**通讯恢复*/

6
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceEntity.java

@ -7,6 +7,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
@ -20,6 +21,11 @@ import java.util.Date;
@ApiModel(value = "特种设备实体类")
public class SpecialDeviceEntity extends BaseEntity {
@NotNull
@Size(max = 50, message = "设备所属机构字段长度不能超过50")
@ApiModelProperty("设备所属机构")
private String unit;
@Size(max = 50, message = "设备名称长度不能超过50")
@ApiModelProperty("设备名称")
private String name;

7
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java

@ -2,6 +2,7 @@ package com.hnac.hzims.alarm.monitor.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.hnac.hzims.alarm.config.constants.AlarmConstants;
import com.hnac.hzims.alarm.config.service.AlarmConfigService;
import com.hnac.hzims.alarm.config.entity.AlarmEntity;
import com.hnac.hzims.alarm.monitor.service.AlarmSaveService;
@ -60,13 +61,17 @@ public class AlarmSaveServiceImpl implements AlarmSaveService {
if(CollectionUtil.isEmpty(stations)){
return;
}
//根据最近5分钟的数据,做去重
// 根据最近5分钟的数据,做去重
for (String key : keys) {
String value = stringRedisTemplate.opsForValue().get(key);
if (value.equals(stations.get(0).getName()+alarm.getAlarmContext())){
return;
}
}
// fpd告警拼接
if(AlarmConstants.EARLY_WARNING.equals(alarm.getAlarmSource())){
alarm.setAlarmContext(stations.get(0).getName() + "." + alarm.getAlarmContext());
}
// 步骤3.站点参数设置
alarm.setCreateDept(stations.get(0).getCreateDept());
alarm.setStationName(stations.get(0).getName());

44
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.alarm.config.constants.AlarmConstants;
import com.hnac.hzims.alarm.config.entity.AlarmDefaultConfigEntity;
import com.hnac.hzims.alarm.config.entity.AlarmEntity;
import com.hnac.hzims.alarm.config.vo.SystemAlarmVo;
import com.hnac.hzims.business.interruption.constants.InterruptionConstants;
import com.hnac.hzims.business.interruption.entity.InterruptionEntity;
import com.hnac.hzims.operational.main.constant.HomePageConstant;
@ -21,10 +22,12 @@ import com.hnac.hzinfo.sdk.core.response.HzPage;
import com.hnac.hzinfo.sdk.core.response.Result;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.jackson.JsonUtil;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.mqtt.producer.IMqttSender;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
@ -52,6 +55,8 @@ public class AlarmServiceImpl implements AlarmService {
private final RedisTemplate redisTemplate;
private final IMqttSender mqttSender;
private final static String start_stop_cache_final = "hzims:operation:start:stop:key";
private final static String load_hydropower_unit_real_key = "hzims:operation:loadhydropowerunit:real:key";
@ -151,12 +156,12 @@ public class AlarmServiceImpl implements AlarmService {
alarm.setDeviceCode(real.getDeviceCode());
alarm.setDeviceName(real.getDeviceName());
alarm.setAlarmId(station.getCode() + "_" + Func.randomUUID());
alarm.setAlarmContext(station.getName() + "_" + real.getDeviceName() + "_关机");
alarm.setAlarmContext(station.getName() + "." + real.getDeviceName() + "_关机");
alarm.setAlarmSource(AlarmConstants.START_STOP_WARNING);
alarm.setAlarmType(AlarmConstants.STOP);
if(state == 1){
alarm.setAlarmType(AlarmConstants.START);
alarm.setAlarmContext(station.getName() + "_" + real.getDeviceName() + "_开机");
alarm.setAlarmContext(station.getName() + "." + real.getDeviceName() + "_开机");
}
alarm.setStatus(0);
alarm.setAlarmTime(new Date());
@ -221,8 +226,7 @@ public class AlarmServiceImpl implements AlarmService {
List<SoeData> soes = result.getData().getRecords();
// 查询当天数据中断告警记录
List<InterruptionEntity> saves = this.saveInterruptions(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()));
// 批量保存中断告警数据
this.interruptionAlarmService.saveBatch(soes.stream().filter(o-> CollectionUtil.isEmpty(saves) || !saves.stream().map(InterruptionEntity::getAlarmId).collect(Collectors.toList()).contains(o.getId())).map(soe->{
List<InterruptionEntity> entities = soes.stream().filter(o-> CollectionUtil.isEmpty(saves) || !saves.stream().map(InterruptionEntity::getAlarmId).collect(Collectors.toList()).contains(o.getId())).map(soe->{
InterruptionEntity entity = new InterruptionEntity();
List<StationEntity> soeStations = stations.stream().filter(o->o.getCode().equals(soe.getStation())).collect(Collectors.toList());
if(!CollectionUtil.isEmpty(soeStations)){
@ -243,7 +247,37 @@ public class AlarmServiceImpl implements AlarmService {
entity.setStatus(1);
}
return entity;
}).collect(Collectors.toList()));
}).collect(Collectors.toList());
if(CollectionUtil.isEmpty(entities)){
return;
}
// 批量保存中断告警数据
this.interruptionAlarmService.saveBatch(entities);
// FIXME 发送HZ3000中通讯告警
this.sendInterruptionMsg(entities);
}
/**
* 发送HZ3000中通讯告警
* @param entities
*/
private void sendInterruptionMsg(List<InterruptionEntity> entities) {
entities.forEach(entity->{
SystemAlarmVo alarm = new SystemAlarmVo();
if(ObjectUtil.isEmpty(entity.getId())){
alarm.setId(DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME_MINI));
}else{
alarm.setId(String.valueOf(entity.getId()));
}
alarm.setTs(entity.getAlarmTime().getTime());
alarm.setType(Integer.parseInt(entity.getType()));
alarm.setStation(entity.getStationId());
alarm.setRealId(entity.getRealId());
alarm.setContext(entity.getSoeExplain());
alarm.setState(entity.getStatus());
log.error("send_interruption_msg : {}",JsonUtil.toJson(alarm));
mqttSender.sendToMqtt(InterruptionConstants.HZ3000_TOPIC_PREFIX + entity.getStationId(), JsonUtil.toJson(alarm));
});
}

2
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java

@ -720,7 +720,7 @@ public class MonitorServiceImpl implements MonitorService {
if(!CollectionUtil.isEmpty(powers)){
for(RealAttributeVo attr : powers){
if(!"-".equals(attr.getValue())){
if(Double.parseDouble(attr.getValue()) > 0){
if(attr.getQuality() == 0 && Double.parseDouble(attr.getValue()) > 0){
station.setStatus(0);
return;
}

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/CentralMonitorServiceImpl.java

@ -98,6 +98,7 @@ public class CentralMonitorServiceImpl implements CentralMonitorService {
OriginalDataQuery originalDataQuery = new OriginalDataQuery();
originalDataQuery.setRealId(roleId);
originalDataQuery.setLimit(size);
originalDataQuery.setPage(page);
// 当日
if(ObjectUtil.isEmpty(start) && ObjectUtil.isEmpty(end)){
Calendar calendar = Calendar.getInstance();

7
hzims-service/operational/src/main/java/com/hnac/hzims/operational/data/service/impl/HzimsDataServiceImpl.java

@ -281,7 +281,12 @@ public class HzimsDataServiceImpl implements HzimsDataService {
ActivePowerVo activePower = new ActivePowerVo();
activePower.setHour(entry.getKey());
activePower.setStrHour(entry.getValue().get(0).getStrHour());
activePower.setActivePower(String.valueOf(entry.getValue().stream().mapToDouble(o->Double.parseDouble(o.getActivePower())).sum()));
List<ActivePowerVo> powers = entry.getValue().stream().filter(o->StringUtil.isNotBlank(o.getActivePower())).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(powers)){
activePower.setActivePower(String.valueOf(powers.stream().mapToDouble(o->Double.parseDouble(o.getActivePower())).sum()));
}else {
activePower.setActivePower(null);
}
return activePower;
}).sorted(Comparator.comparing(ActivePowerVo::getStrHour)).collect(Collectors.toList());
}

7
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygienePlanMapper.java

@ -1,10 +1,11 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.entity.HygienePlanEntity;
import com.hnac.hzims.safeproduct.vo.HygieneMonthVO;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.annotation.UserDataAuth;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
@ -14,7 +15,7 @@ import org.apache.ibatis.annotations.Mapper;
* @date 2023-12-27
*/
@Mapper
public interface HygienePlanMapper extends BaseMapper<HygienePlanEntity> {
public interface HygienePlanMapper extends UserDataScopeBaseMapper<HygienePlanEntity> {
/**
* 查询当月各单位的卫生自查总数
@ -23,6 +24,7 @@ public interface HygienePlanMapper extends BaseMapper<HygienePlanEntity> {
* @param month 月份
* @return 当月的卫生自查总数据
*/
@UserDataAuth
IPage<HygieneMonthVO> selectByMonth(IPage<HygieneMonthVO> page, String unit, String month);
/**
@ -32,5 +34,6 @@ public interface HygienePlanMapper extends BaseMapper<HygienePlanEntity> {
* @param month 月份
* @return 当月的已完成数据
*/
@UserDataAuth
IPage<HygieneMonthVO> selectFinishedDataByMonth(IPage<HygieneMonthVO> page, String unit, String month);
}

4
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygienePlanMapper.xml

@ -3,7 +3,7 @@
<select id="selectByMonth" resultType="com.hnac.hzims.safeproduct.vo.HygieneMonthVO">
SELECT
unit, count(1) as scheduled_check_num
unit, count(1) as scheduled_check_num, create_user, create_dept
FROM
hzims_hygiene_plan
WHERE
@ -20,7 +20,7 @@
<select id="selectFinishedDataByMonth" resultType="com.hnac.hzims.safeproduct.vo.HygieneMonthVO">
SELECT
unit, count(1) as finished_check_num
unit, count(1) as finished_check_num, create_user, create_dept
FROM
hzims_hygiene_plan
WHERE

14
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.java

@ -1,12 +1,14 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.entity.HygieneRecordEntity;
import com.hnac.hzims.safeproduct.vo.HygieneRecordDetailVO;
import com.hnac.hzims.safeproduct.vo.HygieneRecordPageVO;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.annotation.UserDataAuth;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.List;
import java.util.Map;
/**
@ -16,7 +18,7 @@ import java.util.Map;
* @date 2023-12-27
*/
@Mapper
public interface HygieneRecordMapper extends BaseMapper<HygieneRecordEntity> {
public interface HygieneRecordMapper extends UserDataScopeBaseMapper<HygieneRecordEntity> {
/**
* 查询卫生自查记录详情
@ -31,5 +33,13 @@ public interface HygieneRecordMapper extends BaseMapper<HygieneRecordEntity> {
* @param page 分页类
* @return 记录数据页
*/
@UserDataAuth
IPage<HygieneRecordPageVO> recordPage(IPage<HygieneRecordPageVO> page, Map<String, Object> param);
/**
* 查询当月卫生自查记录
* @param month 当月
* @return 当月卫生自查数据表
*/
List<HygieneRecordEntity> selectHygieneByMonth(String month);
}

14
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml

@ -14,7 +14,7 @@
<select id="recordPage" resultType="com.hnac.hzims.safeproduct.vo.HygieneRecordPageVO">
SELECT
id, unit, actual_start_time, actual_end_time, check_user, week_num, hygiene_plan_id
id, unit, actual_start_time, actual_end_time, check_user, week_num, hygiene_plan_id, create_user, create_dept
FROM
hzims_hygiene_record
WHERE
@ -34,4 +34,16 @@
ORDER BY
create_time DESC
</select>
<select id="selectHygieneByMonth" resultType="com.hnac.hzims.safeproduct.entity.HygieneRecordEntity">
SELECT
*
FROM
hzims_hygiene_record
WHERE
is_deleted = 0
AND create_time like concat(#{month}, '%')
ORDER BY
code DESC
</select>
</mapper>

4
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneZoneMapper.java

@ -1,8 +1,8 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.safeproduct.entity.HygieneZoneEntity;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* 卫生自查责任区Mapper类
@ -11,6 +11,6 @@ import org.apache.ibatis.annotations.Mapper;
* @date 2024-01-02
*/
@Mapper
public interface HygieneZoneMapper extends BaseMapper<HygieneZoneEntity> {
public interface HygieneZoneMapper extends UserDataScopeBaseMapper<HygieneZoneEntity> {
}

2
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml

@ -49,6 +49,6 @@
is_deleted = 0
AND create_time like concat(#{month}, '%')
ORDER BY
create_time DESC
code DESC
</select>
</mapper>

6
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.java

@ -1,9 +1,10 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.entity.SpecialDeviceInspectionEntity;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.annotation.UserDataAuth;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.List;
import java.util.Map;
@ -15,7 +16,7 @@ import java.util.Map;
* @date 2024-01-22
*/
@Mapper
public interface SpecialDeviceInspectionMapper extends BaseMapper<SpecialDeviceInspectionEntity> {
public interface SpecialDeviceInspectionMapper extends UserDataScopeBaseMapper<SpecialDeviceInspectionEntity> {
/**
* 设备检验记录分页
@ -23,6 +24,7 @@ public interface SpecialDeviceInspectionMapper extends BaseMapper<SpecialDeviceI
* @param page 分页类
* @return 设备检验记录数据
*/
@UserDataAuth
IPage<SpecialDeviceInspectionEntity> getInspectionPage(IPage<SpecialDeviceInspectionEntity> page, Map<String, Object> param);
/**

4
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceMapper.java

@ -1,8 +1,8 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.safeproduct.entity.SpecialDeviceEntity;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* 特种设备Mapper类
@ -11,6 +11,6 @@ import org.apache.ibatis.annotations.Mapper;
* @date 2024-01-12
*/
@Mapper
public interface SpecialDeviceMapper extends BaseMapper<SpecialDeviceEntity> {
public interface SpecialDeviceMapper extends UserDataScopeBaseMapper<SpecialDeviceEntity> {
}

11
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.java

@ -1,11 +1,11 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.dto.TestDTO;
import com.hnac.hzims.safeproduct.entity.TestEntity;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.annotation.UserDataAuth;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.List;
import java.util.Map;
@ -17,7 +17,7 @@ import java.util.Map;
* @date 2023-12-25
*/
@Mapper
public interface TestMapper extends BaseMapper<TestEntity> {
public interface TestMapper extends UserDataScopeBaseMapper<TestEntity> {
/**
* 查询考试记录名称列表
@ -35,4 +35,11 @@ public interface TestMapper extends BaseMapper<TestEntity> {
*/
@UserDataAuth
IPage<TestEntity> testPage(IPage<TestEntity> page, Map<String, Object> param);
/**
* 查询当月考试记录
* @param month 当月
* @return 当月考试记录
*/
List<TestEntity> selectTestByMonth(String month);
}

12
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.xml

@ -38,4 +38,16 @@
ORDER BY
create_time DESC
</select>
<select id="selectTestByMonth" resultType="com.hnac.hzims.safeproduct.entity.TestEntity">
SELECT
*
FROM
hzims_test
WHERE
is_deleted = 0
AND create_time like concat(#{month}, '%')
ORDER BY
code DESC
</select>
</mapper>

4
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestScoreMapper.java

@ -1,9 +1,9 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.safeproduct.entity.TestScoreEntity;
import com.hnac.hzims.safeproduct.vo.TestScoreVO;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.List;
@ -14,7 +14,7 @@ import java.util.List;
* @date 2023-12-25
*/
@Mapper
public interface TestScoreMapper extends BaseMapper<TestScoreEntity> {
public interface TestScoreMapper extends UserDataScopeBaseMapper<TestScoreEntity> {
/**
* 查询考试成绩列表

4
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.java

@ -1,6 +1,5 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.dto.AnalysisYearDTO;
import com.hnac.hzims.safeproduct.entity.TrainPlanEntity;
@ -8,6 +7,7 @@ import com.hnac.hzims.safeproduct.vo.TrainMonthVO;
import com.hnac.hzims.safeproduct.vo.TrainYearVO;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.annotation.UserDataAuth;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.List;
import java.util.Map;
@ -19,7 +19,7 @@ import java.util.Map;
* @date 2023-12-25
*/
@Mapper
public interface TrainPlanMapper extends BaseMapper<TrainPlanEntity> {
public interface TrainPlanMapper extends UserDataScopeBaseMapper<TrainPlanEntity> {
/**
* 查询当月各单位的培训计划总数

11
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java

@ -1,6 +1,5 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.dto.TrainRecordDTO;
import com.hnac.hzims.safeproduct.entity.TrainRecordEntity;
@ -8,6 +7,7 @@ import com.hnac.hzims.safeproduct.vo.TrainRecordDetailVO;
import com.hnac.hzims.safeproduct.vo.TrainRecordVO;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.annotation.UserDataAuth;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.List;
import java.util.Map;
@ -19,7 +19,7 @@ import java.util.Map;
* @date 2023-12-25
*/
@Mapper
public interface TrainRecordMapper extends BaseMapper<TrainRecordEntity> {
public interface TrainRecordMapper extends UserDataScopeBaseMapper<TrainRecordEntity> {
/**
* 查询培训记录名称列表
@ -44,4 +44,11 @@ public interface TrainRecordMapper extends BaseMapper<TrainRecordEntity> {
*/
@UserDataAuth
IPage<TrainRecordVO> trainRecordPage(IPage<TrainRecordVO> page, Map<String, Object> param);
/**
* 查询当月培训记录
* @param month 当月
* @return 当月培训记录
*/
List<TrainRecordEntity> selectTrainByMonth(String month);
}

12
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml

@ -53,4 +53,16 @@
ORDER BY
t1.create_time DESC
</select>
<select id="selectTrainByMonth" resultType="com.hnac.hzims.safeproduct.entity.TrainRecordEntity">
SELECT
*
FROM
hzims_train_record
WHERE
is_deleted = 0
AND create_time like concat(#{month}, '%')
ORDER BY
code DESC
</select>
</mapper>

5
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java

@ -218,10 +218,7 @@ public class HygieneRecordServiceImpl extends ServiceImpl<HygieneRecordMapper, H
* @return 当月卫生自查数据表
*/
private List<HygieneRecordEntity> getHygieneByMonth(String month) {
QueryWrapper<HygieneRecordEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().like(HygieneRecordEntity::getCreateTime, month)
.orderByDesc(HygieneRecordEntity::getCode);
return this.list(queryWrapper);
return baseMapper.selectHygieneByMonth(month);
}
/**

5
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java

@ -246,9 +246,6 @@ public class TestServiceImpl extends ServiceImpl<TestMapper, TestEntity> impleme
* @return 当月考试记录
*/
public List<TestEntity> getTestByMonth(String month) {
QueryWrapper<TestEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().like(TestEntity::getCreateTime, month)
.orderByDesc(TestEntity::getCode);
return this.list(queryWrapper);
return baseMapper.selectTestByMonth(month);
}
}

5
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java

@ -219,9 +219,6 @@ public class TrainRecordServiceImpl extends ServiceImpl<TrainRecordMapper, Train
* @return 当月培训记录
*/
public List<TrainRecordEntity> getTrainByMonth(String month) {
QueryWrapper<TrainRecordEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().like(TrainRecordEntity::getCreateTime, month)
.orderByDesc(TrainRecordEntity::getCode);
return this.list(queryWrapper);
return baseMapper.selectTrainByMonth(month);
}
}

4
hzims-service/safeproduct/src/main/resources/db/2.0.1.sql

@ -7,3 +7,7 @@ ALTER TABLE hzims_conference_plan
ALTER TABLE hzims_rehearsal_plan
MODIFY COLUMN scheduled_start_time datetime NOT NULL COMMENT '演练计划开始时间',
MODIFY COLUMN scheduled_end_time datetime NOT NULL COMMENT '演练计划结束时间';
-- 特种设备表:添加单位字段
ALTER TABLE hzims_device
ADD COLUMN unit varchar(50) NOT NULL COMMENT '单位';
Loading…
Cancel
Save