大屏业务bug修复,系统预警信息待完善

This commit is contained in:
lhx
2025-11-13 18:26:29 +08:00
parent c6bc11e9b8
commit 47a6217329
10 changed files with 1522 additions and 17 deletions

View File

@@ -14,21 +14,21 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/bigScreen/laboratory")
@Tag(name = "大屏-实验室管理")
@RequestMapping("/bigScreen")
@Tag(name = "大屏")
@RequiredArgsConstructor(onConstructor_ = {@Autowired})
public class LaboratoryBigScreenController {
private final LaboratoryService laboratoryService;
private final BigScreenService bigScreenService;
@PostMapping("/list")
@PostMapping("/laboratoryList")
@Operation(summary = "实验室列表")
public ResponseResult list(@RequestBody LaboratoryDto laboratoryDto) {
return laboratoryService.getList(laboratoryDto);
}
@PostMapping("/Statistics")
@PostMapping("/statistics")
@Operation(summary = "大屏统计信息——总数统计")
public ResponseResult getStatistics() {
return bigScreenService.getPigStatistics();
@@ -41,7 +41,7 @@ public class LaboratoryBigScreenController {
}
@PostMapping("/record")
@Operation(summary = "本年实验室委托统计2")
@Operation(summary = "本年实验室委托统计2")
public ResponseResult recordReport(@RequestBody RecordBigScreenDto recordBigScreenDto) {
return bigScreenService.getRecordEntrustStatistics2(recordBigScreenDto);
}

View File

@@ -19,10 +19,9 @@ public interface EquipmentMapper extends BaseMapper<Equipment> {
/**
* 获取设备超期
* @param nowStr
* @param systemWarningDto
* @return
*/
BasePageVo<SystemWarningItemVo> getCheckOverdueCount(String nowStr, IPage<SystemWarningItemVo> systemWarningDto);
BasePageVo<SystemWarningItemVo> getCheckOverdueCount(String nowStr, IPage<SystemWarningItemVo> page);
BasePageVo<SystemWarningItemVo> getCheckExpiringCount(String nowStr, IPage<SystemWarningItemVo> page);
}

View File

@@ -1,6 +1,7 @@
package com.dc.dc_project.model.dto.bigScreen;
import com.dc.dc_project.model.dto.BasePage;
import com.dc.dc_project.utils.DateUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -12,12 +13,12 @@ public class RecordBigScreenDto extends BasePage<RecordBigScreenDto> {
/**
* 年份
*/
private String year;
private String year = DateUtils.getCurrentYear();
/**
* 分类模式
* 1按项目
* 2按工程
*/
private Integer typeMode;
private Integer typeMode = 1;
}

View File

@@ -4,6 +4,7 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.ArrayList;
import java.util.List;
@Data
@@ -34,6 +35,7 @@ public class RecordEntrustStatisticsVo {
private List<RecordEntrustStatisticsVo> recordEntrustStatisticsVos;
public RecordEntrustStatisticsVo(String year) {
this.recordEntrustStatisticsVos = new ArrayList<>();
this.year = year;
}
public RecordEntrustStatisticsVo(RecordEntrustStatisticsVo recordEntrustStatisticsVo) {

View File

@@ -17,6 +17,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.YearMonth;
import java.time.format.DateTimeFormatter;
import java.util.List;
@@ -54,11 +55,13 @@ public class BigScreenServiceImpl implements BigScreenService {
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
RecordEntrustStatisticsVo root = new RecordEntrustStatisticsVo(DateUtils.getCurrentYear());
for (int i = 1; i < 13; i++) {
int year = LocalDateTime.now().getYear();
// 本年开始时间1月1日 00:00:00
LocalDateTime startTime = LocalDateTime.of(LocalDateTime.now().getYear(), i, 1, 0, 0, 0);
LocalDateTime startTime = LocalDateTime.of(year, i, 1, 0, 0, 0);
String startTimeStr = startTime.format(dtf);
// 结束时间为当前时间
LocalDateTime endTime = LocalDateTime.of(LocalDateTime.now().getYear(), i, 31, 0, 0, 0);
YearMonth yearMonth = YearMonth.of(year, i);
LocalDateTime endTime = LocalDateTime.of(year, i, yearMonth.lengthOfMonth(), 23, 59, 59);
String endTimeStr = endTime.format(dtf);
RecordEntrustStatisticsVo recordEntrustStatistics = new RecordEntrustStatisticsVo(root);
recordEntrustStatistics.setMonth(i);
@@ -76,11 +79,13 @@ public class BigScreenServiceImpl implements BigScreenService {
@Override
public ResponseResult getRecordEntrustStatistics2(RecordBigScreenDto recordBigScreenDto) {
// 开始时间1月1日 00:00:00
int year = Integer.parseInt(recordBigScreenDto.getYear());
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
LocalDateTime startTime = LocalDateTime.of(Integer.parseInt(recordBigScreenDto.getYear()), 1, 1, 0, 0, 0);
LocalDateTime startTime = LocalDateTime.of(year, 1, 1, 0, 0, 0);
String startTimeStr = startTime.format(dtf);
// 结束时间
LocalDateTime endTime = LocalDateTime.of(Integer.parseInt(recordBigScreenDto.getYear()), 12, 31, 0, 0, 0);
YearMonth yearMonth = YearMonth.of(year, 12);
LocalDateTime endTime = LocalDateTime.of(year, 12, yearMonth.lengthOfMonth(), 0, 0, 0);
String endTimeStr = endTime.format(dtf);
Page<RecordStatisticsVo> page = new Page<>(
recordBigScreenDto.getCurrent(), recordBigScreenDto.getSize());

View File

@@ -19,6 +19,7 @@
AND se.is_deleted = 0
</where>
ORDER BY se.valid_until ASC
Limit #{page.offset}, #{page.size}
</select>
<select id="getCheckExpiringCount" resultType="com.dc.dc_project.model.vo.bigScreen.SystemWarningItemVo">
SELECT se.id, se.name, se.valid_until AS date, DATEDIFF(se.valid_until, #{nowStr}) AS day FROM sys_equipment se

View File

@@ -17,7 +17,9 @@
<select id="getList" resultType="com.dc.dc_project.model.pojo.Laboratory">
select sl.* from sys_laboratory sl
left join sys_org_laboratory_standard sols on sl.id = sols.laboratory_id
<if test="standardId != null">
LEFT JOIN sys_org_laboratory_standard sols ON sl.id = sols.laboratory_id
</if>
<where>
<if test="name != null">
and sl.name like concat('%',#{name},'%')

View File

@@ -11,7 +11,7 @@
created_at,updated_at,is_deleted
</sql>
<select id="getCountByTime" resultType="java.lang.Long">
select count(*) from sys_record_entrust where entrust_date between #{startTime} and #{endTime}
select count(*) from sys_record_entrust where entrust_date between #{startTimeStr} and #{endTime}
</select>
<select id="getCountByTimeGroupE" resultType="com.dc.dc_project.model.vo.bigScreen.RecordStatisticsVo">
SELECT
@@ -24,10 +24,11 @@
LEFT JOIN sys_record_entrust e ON p.id = e.engineering_id
LEFT JOIN sys_record_report r ON e.id = r.entrust_id
<where>
e.create_time &gt;= #{startTimeStr}
AND e.create_time &lt;= #{endTimeStr}
e.created_at &gt;= #{startTimeStr}
AND e.created_at &lt;= #{endTimeStr}
</where>
GROUP BY p.id, p.engineering_name
ORDER BY entrust_count DESC;
Limit #{page.offset}, #{page.size}
</select>
</mapper>