Browse Source

完成质检记录统计存储接口,以及确认质检记录、切换米重接口

lingpeng.li 2 weeks ago
parent
commit
60cde55a0b
16 changed files with 928 additions and 213 deletions
  1. 18 0
      zgztBus/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtils.java
  2. 38 5
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetOriginalProductRecord/controller/BilletOriginalProductRecordController.java
  3. 40 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetOriginalProductRecord/dto/BilletOriginalProductRecordEditDTO.java
  4. 2 2
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetOriginalProductRecord/dto/QualityInspectionQueryDTO.java
  5. 20 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetOriginalProductRecord/entity/BilletOriginalProductRecord.java
  6. 1 1
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetOriginalProductRecord/service/IBilletOriginalProductRecordService.java
  7. 345 205
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetOriginalProductRecord/service/impl/BilletOriginalProductRecordServiceImpl.java
  8. 8 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetOriginalProductRecord/vo/QualityInspectionStatisticsVO.java
  9. 2 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetOriginalProductRecord/vo/QualityInspectionVO.java
  10. 241 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/qualityInspectionStatistics/controller/QualityInspectionStatisticsController.java
  11. 12 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/qualityInspectionStatistics/dto/MeterWeightDTO.java
  12. 149 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/qualityInspectionStatistics/entity/QualityInspectionStatistics.java
  13. 14 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/qualityInspectionStatistics/mapper/QualityInspectionStatisticsMapper.java
  14. 5 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/qualityInspectionStatistics/mapper/xml/QualityInspectionStatisticsMapper.xml
  15. 14 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/qualityInspectionStatistics/service/IQualityInspectionStatisticsService.java
  16. 19 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/qualityInspectionStatistics/service/impl/QualityInspectionStatisticsServiceImpl.java

+ 18 - 0
zgztBus/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtils.java

@@ -880,4 +880,22 @@ public class DateUtils extends PropertyEditorSupport {
         return calendar.getTime();
     }
 
+    /**
+     * 获取指定日期所在月份的起始时间(当月1日 00:00:00)
+     */
+    public static Date getMonthStart(Date date) {
+        if (date == null) {
+            date = new Date(); // 默认当前时间
+        }
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.set(Calendar.DAY_OF_MONTH, 1); // 设置为1号
+        calendar.set(Calendar.HOUR_OF_DAY, 0);  // 设置为 00:00:00
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        calendar.set(Calendar.MILLISECOND, 0);
+        return calendar.getTime();
+    }
+
+
 }

+ 38 - 5
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetOriginalProductRecord/controller/BilletOriginalProductRecordController.java

@@ -11,6 +11,7 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -36,6 +37,7 @@ import org.jeecg.modules.billet.billetHotsend.entity.BilletHotsend;
 import org.jeecg.modules.billet.billetHotsend.service.IBilletHotsendBaseService;
 import org.jeecg.modules.billet.billetHotsendChangeShift.entity.BilletHotsendChangeShift;
 import org.jeecg.modules.billet.billetHotsendChangeShift.service.IBilletHotsendChangeShiftService;
+import org.jeecg.modules.billet.billetOriginalProductRecord.dto.BilletOriginalProductRecordEditDTO;
 import org.jeecg.modules.billet.billetOriginalProductRecord.dto.LengthCountQueryDTO;
 import org.jeecg.modules.billet.billetOriginalProductRecord.dto.QualityInspectionQueryDTO;
 import org.jeecg.modules.billet.billetOriginalProductRecord.entity.BilletOriginalProductRecord;
@@ -638,6 +640,7 @@ public class BilletOriginalProductRecordController extends JeecgController<Bille
 				 billetOriginalProductRecord.setSixStrandSum(x.getSixSum());
 				 billetOriginalProductRecord.setSevenStrandSum(x.getSevenSum());
 				 billetOriginalProductRecord.setEightStrandSum(x.getEightSum());
+				 billetOriginalProductRecord.setBrandNum(x.getBrandNum());
 				 String totalInfoJson = x.getTotalInfo();
 				 if (oConvertUtils.isEmpty(totalInfoJson)){
 					 billetOriginalProductRecord.setAmount(0);// 合计
@@ -651,6 +654,7 @@ public class BilletOriginalProductRecordController extends JeecgController<Bille
 				 billetOriginalProductRecord.setStackLength(x.getStacking());
 				 billetOriginalProductRecord.setLengthDetails(x.getLength());
 				 billetOriginalProductRecord.setCreateTime(DateUtils.str2Date(x.getCreateTime(), DateUtils.datetimeFormat.get()));
+				 billetOriginalProductRecord.setDeliveryTime(DateUtils.str2Date(x.getCreateTime(), DateUtils.datetimeFormat.get()));
 				 billetOriginalProductRecord.setIsEditCharge("1");
 				 billetOriginalProductRecords.add(billetOriginalProductRecord);
 			 });
@@ -859,13 +863,42 @@ public class BilletOriginalProductRecordController extends JeecgController<Bille
 		 return Result.OK(result);
 	 }
 
+	 /**
+	  *  修改部分质检信息
+	  *
+	  * @param
+	  * @return
+	  */
+	 @AutoLog(value = "修改部分质检信息")
+	 @ApiOperation(value="修改部分质检信息", notes="修改部分质检信息")
+	 @PutMapping(value = "/updateInfo")
+	 public Result<String> updateInfo(@RequestBody BilletOriginalProductRecordEditDTO editDTO) {
+		 BilletOriginalProductRecord byId = billetOriginalProductRecordService.getById(editDTO.getOriginalProductRecordId());
+		 if (byId == null) {
+			 return Result.error("未找到对应数据,编辑失败!");
+		 }
 
-	 @ApiOperation("质检记录定尺明细(用于推钢室界面)")
-	 @GetMapping("/qualityInspectionScreen")
-	 public Result<Map<String, Object>> getQualityInspectionScreen(QualityInspectionQueryDTO queryDTO) {
+		 if (oConvertUtils.isEmpty(editDTO.getOriginalProductRecordId())) {
+			 return Result.error("原始记录id不能为空!");
+		 }
 
-		 Map<String, Object> result = billetOriginalProductRecordService.getQualityInspectionScreen(queryDTO);
-		 return Result.OK(result);
+		 // 使用 UpdateWrapper 只更新指定字段
+		 UpdateWrapper<BilletOriginalProductRecord> updateWrapper = new UpdateWrapper<>();
+		 updateWrapper.eq("id", editDTO.getOriginalProductRecordId());
+
+		 if (StringUtils.isNotBlank(editDTO.getBrandNum())) {
+			 updateWrapper.set("brand_num", editDTO.getBrandNum());
+		 }
+		 if (editDTO.getDeliveryTime() != null) {
+			 updateWrapper.set("delivery_time", editDTO.getDeliveryTime());
+		 }
+		 if (StringUtils.isNotBlank(editDTO.getNotes())) {
+			 updateWrapper.set("notes", editDTO.getNotes());
+		 }
+
+		 billetOriginalProductRecordService.update(updateWrapper);
+
+		 return Result.OK("编辑成功!");
 	 }
 
 

+ 40 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetOriginalProductRecord/dto/BilletOriginalProductRecordEditDTO.java

@@ -0,0 +1,40 @@
+package org.jeecg.modules.billet.billetOriginalProductRecord.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+@Data
+public class BilletOriginalProductRecordEditDTO {
+
+    /**
+     * 原始记录主键id
+     */
+    private String originalProductRecordId;
+
+    /**
+     * 牌号
+     */
+    @Excel(name = "牌号", width = 15)
+    @ApiModelProperty(value = "牌号")
+    private String brandNum;
+
+    /**
+     * 送样时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date deliveryTime;
+
+
+    /**
+     * 备注
+     */
+    @Excel(name = "备注", width = 15)
+    @ApiModelProperty(value = "备注")
+    private String notes;
+}

+ 2 - 2
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetOriginalProductRecord/dto/QualityInspectionQueryDTO.java

@@ -26,8 +26,8 @@ public class QualityInspectionQueryDTO {
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date endTime;
 
-    @DateTimeFormat(pattern = "yyyy-MM-dd")
-    private Date queryDate;
+//    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private String queryDate;
 
     /**
      * 班组

+ 20 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetOriginalProductRecord/entity/BilletOriginalProductRecord.java

@@ -167,4 +167,24 @@ public class BilletOriginalProductRecord implements Serializable {
     @ApiModelProperty(value = "起垛信息")
     private String stackInfo;
 
+    /**
+     * 牌号
+     */
+    @Excel(name = "牌号", width = 15)
+    @ApiModelProperty(value = "牌号")
+    private String brandNum;
+
+    /**
+     * 送样时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date deliveryTime;
+
+
+    /**备注*/
+    @Excel(name = "备注", width = 15)
+    @ApiModelProperty(value = "备注")
+    private String notes;
+
 }

+ 1 - 1
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetOriginalProductRecord/service/IBilletOriginalProductRecordService.java

@@ -17,5 +17,5 @@ public interface IBilletOriginalProductRecordService extends IService<BilletOrig
 
     Map<String, Object> getQualityInspectionMenu(QualityInspectionQueryDTO queryDTO);
 
-    Map<String, Object> getQualityInspectionScreen(QualityInspectionQueryDTO queryDTO);
+    void getQualityInspectionScreen(QualityInspectionQueryDTO queryDTO);
 }

+ 345 - 205
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetOriginalProductRecord/service/impl/BilletOriginalProductRecordServiceImpl.java

@@ -1,6 +1,8 @@
 package org.jeecg.modules.billet.billetOriginalProductRecord.service.impl;
 
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -17,6 +19,8 @@ import org.jeecg.modules.billet.billetOriginalProductRecord.mapper.BilletOrigina
 import org.jeecg.modules.billet.billetOriginalProductRecord.service.IBilletOriginalProductRecordService;
 import org.jeecg.modules.billet.billetOriginalProductRecord.vo.QualityInspectionStatisticsVO;
 import org.jeecg.modules.billet.billetOriginalProductRecord.vo.QualityInspectionVO;
+import org.jeecg.modules.billet.qualityInspectionStatistics.entity.QualityInspectionStatistics;
+import org.jeecg.modules.billet.qualityInspectionStatistics.mapper.QualityInspectionStatisticsMapper;
 import org.jeecg.modules.carUnit.service.ISysDictService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.RedisTemplate;
@@ -24,6 +28,9 @@ import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
 import java.math.RoundingMode;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -49,6 +56,9 @@ public class BilletOriginalProductRecordServiceImpl extends ServiceImpl<BilletOr
     @Autowired
     private BilletRulerConfigMapper billetRulerConfigMapper;
 
+    @Autowired
+    private QualityInspectionStatisticsMapper qualityInspectionStatisticsMapper;
+
     @Override
     public Map<String, Object> getQualityInspectionMenu(QualityInspectionQueryDTO queryDTO) {
         if (queryDTO == null || StringUtils.isBlank(queryDTO.getCcmNo())) {
@@ -58,42 +68,58 @@ public class BilletOriginalProductRecordServiceImpl extends ServiceImpl<BilletOr
         LambdaQueryWrapper<BilletOriginalProductRecord> oneQueryWrapper = new LambdaQueryWrapper<>();
         oneQueryWrapper.eq(BilletOriginalProductRecord::getCcmNo, queryDTO.getCcmNo());
         Boolean search = true;
+        LambdaQueryWrapper<BilletHotsendChangeShift> changeShiftQueryWrapper = new LambdaQueryWrapper<>();
+
+        BilletHotsendChangeShift newBilletHotsendChangeShift = null;
 
         if (oConvertUtils.isNotEmpty(queryDTO.getChangeShiftId())) {
-            LambdaQueryWrapper<BilletHotsendChangeShift> changeQueryWrapper = new LambdaQueryWrapper<>();
-            changeQueryWrapper.eq(BilletHotsendChangeShift::getId, queryDTO.getChangeShiftId()).eq(BilletHotsendChangeShift::getCcmNo, queryDTO.getCcmNo());
-            BilletHotsendChangeShift billetHotsendChangeShift = billetHotsendChangeShiftService.getOne(changeQueryWrapper);
-            if (billetHotsendChangeShift == null) {
-                return Collections.emptyMap(); // 空数据返回
-            }
-            Date startChangeTime = billetHotsendChangeShift.getCreateTime();
-            Date endChangeTime = oConvertUtils.isNotEmpty(billetHotsendChangeShift.getChangeShiftTime()) ? billetHotsendChangeShift.getChangeShiftTime() : new Date();
-            oneQueryWrapper.eq(BilletOriginalProductRecord::getShift, billetHotsendChangeShift.getShift());
-            oneQueryWrapper.eq(BilletOriginalProductRecord::getShiftGroup, billetHotsendChangeShift.getShiftGroup());
-            oneQueryWrapper.between(BilletOriginalProductRecord::getCreateTime, startChangeTime, endChangeTime);
-            search = false;
-        } else if (oConvertUtils.isNotEmpty(queryDTO.getStartTime()) && oConvertUtils.isNotEmpty(queryDTO.getEndTime())) {
-            oneQueryWrapper.between(BilletOriginalProductRecord::getCreateTime, queryDTO.getStartTime(), queryDTO.getEndTime());
-            search = false;
+            // 指定了换班记录ID
+            changeShiftQueryWrapper.eq(BilletHotsendChangeShift::getId, queryDTO.getChangeShiftId());
+        } else {
+            // 未指定ID,则取指定铸机号下最新一条换班记录
+            changeShiftQueryWrapper.eq(BilletHotsendChangeShift::getCcmNo, queryDTO.getCcmNo())
+                    .orderByDesc(BilletHotsendChangeShift::getCreateTime)
+                    .last("limit 1"); // 只取一条
         }
 
-        if (oConvertUtils.isNotEmpty(queryDTO.getQueryDate()) || search) {
-            if (oConvertUtils.isEmpty(queryDTO.getQueryDate())) {
-                String nowDate = DateUtils.getDate("yyyy-MM-dd");
-                Date startOneTime = DateUtils.getStartOfDayByDate(DateUtils.getStartOfDay(nowDate));
-                LambdaQueryWrapper<BilletHotsendChangeShift> changeQueryWrapper = new LambdaQueryWrapper<>();
-                changeQueryWrapper.eq(BilletHotsendChangeShift::getCcmNo, queryDTO.getCcmNo()).orderByDesc(BilletHotsendChangeShift::getCreateTime).last("limit 1");
-                BilletHotsendChangeShift billetHotsendChangeShift = billetHotsendChangeShiftService.getOne(changeQueryWrapper);
-                oneQueryWrapper.ge(BilletOriginalProductRecord::getCreateTime,
-                        oConvertUtils.isNotEmpty(billetHotsendChangeShift.getCreateTime()) ? billetHotsendChangeShift.getCreateTime() : startOneTime);
-            } else {
-                Date queryDate = queryDTO.getQueryDate();
-                Date startTime = DateUtils.getStartOfDayByDate(DateUtils.getStartOfDay(queryDate));
-                Date endTime = DateUtils.getEndOfDayByDate(startTime);
-                oneQueryWrapper.between(BilletOriginalProductRecord::getCreateTime, startTime, endTime);
-            }
+        newBilletHotsendChangeShift = billetHotsendChangeShiftService.getOne(changeShiftQueryWrapper);
+
+        if (newBilletHotsendChangeShift == null) {
+            return Collections.emptyMap(); // 无数据,直接返回空
         }
 
+        // 获取换班时间段
+        Date startChangeTime = newBilletHotsendChangeShift.getCreateTime();
+        Date endChangeTime = oConvertUtils.isNotEmpty(newBilletHotsendChangeShift.getChangeShiftTime())
+                ? newBilletHotsendChangeShift.getChangeShiftTime()
+                : new Date();
+
+        // 根据换班信息查询原始记录
+        oneQueryWrapper.eq(BilletOriginalProductRecord::getShift, newBilletHotsendChangeShift.getShift());
+        oneQueryWrapper.eq(BilletOriginalProductRecord::getShiftGroup, newBilletHotsendChangeShift.getShiftGroup());
+        oneQueryWrapper.between(BilletOriginalProductRecord::getCreateTime, startChangeTime, endChangeTime);
+//        else if (oConvertUtils.isNotEmpty(queryDTO.getStartTime()) && oConvertUtils.isNotEmpty(queryDTO.getEndTime())) {
+//            oneQueryWrapper.between(BilletOriginalProductRecord::getCreateTime, queryDTO.getStartTime(), queryDTO.getEndTime());
+//            search = false;
+//        }
+
+//        if (oConvertUtils.isNotEmpty(queryDTO.getQueryDate()) || search) {
+//            if (oConvertUtils.isEmpty(queryDTO.getQueryDate())) {
+//                String nowDate = DateUtils.getDate("yyyy-MM-dd");
+//                Date startOneTime = DateUtils.getStartOfDayByDate(DateUtils.getStartOfDay(nowDate));
+//                LambdaQueryWrapper<BilletHotsendChangeShift> changeQueryWrapper = new LambdaQueryWrapper<>();
+//                changeQueryWrapper.eq(BilletHotsendChangeShift::getCcmNo, queryDTO.getCcmNo()).orderByDesc(BilletHotsendChangeShift::getCreateTime).last("limit 1");
+//                BilletHotsendChangeShift billetHotsendChangeShift = billetHotsendChangeShiftService.getOne(changeQueryWrapper);
+//                oneQueryWrapper.ge(BilletOriginalProductRecord::getCreateTime,
+//                        oConvertUtils.isNotEmpty(billetHotsendChangeShift.getCreateTime()) ? billetHotsendChangeShift.getCreateTime() : startOneTime);
+//            } else {
+//                String queryDate = queryDTO.getQueryDate();
+//                Date startTime = DateUtils.getStartOfDayByDate(DateUtils.getStartOfDay(queryDate));
+//                Date endTime = DateUtils.getEndOfDayByDate(startTime);
+//                oneQueryWrapper.between(BilletOriginalProductRecord::getCreateTime, startTime, endTime);
+//            }
+//        }
+
         if (oConvertUtils.isNotEmpty(queryDTO.getHeatNo())) {
             oneQueryWrapper.eq(BilletOriginalProductRecord::getHeatNo, queryDTO.getHeatNo());
         }
@@ -145,6 +171,7 @@ public class BilletOriginalProductRecordServiceImpl extends ServiceImpl<BilletOr
                     .orElseGet(() -> sysDictService.queryDictTextByKey("billet_spec", "5"));
             vo.setBrandNum(brandNum);
             vo.setDeliveryTime(record.getCreateTime());
+            vo.setOriginalProductRecordId(record.getId());
 
             Map<String, Integer> mergedCount = new HashMap<>();
             Map<String, BigDecimal> mergedWeight = new HashMap<>();
@@ -252,150 +279,225 @@ public class BilletOriginalProductRecordServiceImpl extends ServiceImpl<BilletOr
             }
         }
 
-        // 1. 先对定尺重量 map 统一保留4位小数(班次 + 当天)
-        Map<String, BigDecimal> roundedClassWeightMap = classLengthWeightMap.entrySet().stream()
-                .collect(Collectors.toMap(
-                        Map.Entry::getKey,
-                        e -> e.getValue().setScale(4, RoundingMode.HALF_UP)
-                ));
+        LambdaQueryWrapper<QualityInspectionStatistics> qualityQueryWrapper = new LambdaQueryWrapper<>();
 
-        Map<String, BigDecimal> roundedDayWeightMap = dayLengthWeightMap.entrySet().stream()
-                .collect(Collectors.toMap(
-                        Map.Entry::getKey,
-                        e -> e.getValue().setScale(4, RoundingMode.HALF_UP)
-                ));
 
-        // 2. 总重量使用已四舍五入后的子项重量相加,再保留4位小数
-        BigDecimal roundedClassTotalWeight = roundedClassWeightMap.values().stream()
-                .reduce(BigDecimal.ZERO, BigDecimal::add)
-                .setScale(4, RoundingMode.HALF_UP);
-
-        BigDecimal roundedDayTotalWeight = roundedDayWeightMap.values().stream()
-                .reduce(BigDecimal.ZERO, BigDecimal::add)
-                .setScale(4, RoundingMode.HALF_UP);
-
-        // 3. 封装 VO 返回
-        QualityInspectionStatisticsVO stats = new QualityInspectionStatisticsVO();
-        stats.setClassLengthCountMap(classLengthCountMap);
-        stats.setClassLengthWeightMap(roundedClassWeightMap);
-        stats.setClassTotalCount(classTotalCount);
-        stats.setClassTotalWeight(roundedClassTotalWeight);
-
-        stats.setDayLengthCountMap(dayLengthCountMap);
-        stats.setDayLengthWeightMap(roundedDayWeightMap);
-        stats.setDayTotalCount(dayTotalCount);
-        stats.setDayTotalWeight(roundedDayTotalWeight);
+            // 未指定ID,则取指定铸机号下最新一条换班记录
+        qualityQueryWrapper.eq(QualityInspectionStatistics::getChangeShiftId, newBilletHotsendChangeShift.getId())
+                    .orderByDesc(QualityInspectionStatistics::getCreateTime)
+                    .last("limit 1"); // 只取一条
 
+        QualityInspectionStatistics qualityInspectionStatistics = qualityInspectionStatisticsMapper.selectOne(qualityQueryWrapper);
 
         Map<String, Object> result = new HashMap<>();
         result.put("records", resultList);
-        result.put("statistics", stats);
+        result.put("statistics", qualityInspectionStatistics);
 
         return result;
     }
 
     @Override
-    public Map<String, Object> getQualityInspectionScreen(QualityInspectionQueryDTO queryDTO) {
-        if (queryDTO == null || StringUtils.isBlank(queryDTO.getCcmNo())) {
-            return Collections.emptyMap();
-        }
-        List<QualityInspectionVO> resultList = new ArrayList<>();
-        LambdaQueryWrapper<BilletOriginalProductRecord> oneQueryWrapper = new LambdaQueryWrapper<>();
-        oneQueryWrapper.eq(BilletOriginalProductRecord::getCcmNo, queryDTO.getCcmNo());
-        Boolean search = true;
+    public void getQualityInspectionScreen(QualityInspectionQueryDTO queryDTO) {
+        String ccmNo = "5";
 
-        if (oConvertUtils.isNotEmpty(queryDTO.getChangeShiftId())) {
-            LambdaQueryWrapper<BilletHotsendChangeShift> changeQueryWrapper = new LambdaQueryWrapper<>();
-            changeQueryWrapper.eq(BilletHotsendChangeShift::getId, queryDTO.getChangeShiftId()).eq(BilletHotsendChangeShift::getCcmNo, queryDTO.getCcmNo());
-            BilletHotsendChangeShift billetHotsendChangeShift = billetHotsendChangeShiftService.getOne(changeQueryWrapper);
-            if (billetHotsendChangeShift == null) {
-                return Collections.emptyMap(); // 空数据返回
-            }
-            Date startChangeTime = billetHotsendChangeShift.getCreateTime();
-            Date endChangeTime = oConvertUtils.isNotEmpty(billetHotsendChangeShift.getChangeShiftTime()) ? billetHotsendChangeShift.getChangeShiftTime() : new Date();
-            oneQueryWrapper.eq(BilletOriginalProductRecord::getShift, billetHotsendChangeShift.getShift());
-            oneQueryWrapper.eq(BilletOriginalProductRecord::getShiftGroup, billetHotsendChangeShift.getShiftGroup());
-            oneQueryWrapper.between(BilletOriginalProductRecord::getCreateTime, startChangeTime, endChangeTime);
-            search = false;
-        } else if (oConvertUtils.isNotEmpty(queryDTO.getStartTime()) && oConvertUtils.isNotEmpty(queryDTO.getEndTime())) {
-            oneQueryWrapper.between(BilletOriginalProductRecord::getCreateTime, queryDTO.getStartTime(), queryDTO.getEndTime());
-            search = false;
+        // 1. 初始化补全月统计(缺失部分)
+        initMonthlyStatisticsIfMissing(ccmNo);
+
+        // 2. 查询当天班次
+        String nowDate = DateUtils.getDate("yyyy-MM-dd");
+        Date dayStart = DateUtils.getStartOfDayByDate(DateUtils.getStartOfDay(nowDate));
+        Date dayEnd = DateUtils.getEndOfDayByDate(DateUtils.getEndOfDay(nowDate));
+
+        List<BilletHotsendChangeShift> shifts = billetHotsendChangeShiftService.list(
+                new LambdaQueryWrapper<BilletHotsendChangeShift>()
+                        .eq(BilletHotsendChangeShift::getCcmNo, ccmNo)
+                        .between(BilletHotsendChangeShift::getCreateTime, dayStart, dayEnd)
+        );
+
+        // 按 change_shift_time 升序排序
+        shifts.sort(Comparator.comparing(BilletHotsendChangeShift::getCreateTime));
+
+        // 日累计起点
+        BigDecimal dayStartWeight = BigDecimal.ONE;
+        int dayStartCount = 1;
+
+        // 月累计起点(查询已有最大记录)
+        Date monthStart = DateUtils.getMonthStart(new Date());
+        QualityInspectionStatistics last = qualityInspectionStatisticsMapper.selectOne(
+                new LambdaQueryWrapper<QualityInspectionStatistics>()
+                        .eq(QualityInspectionStatistics::getCcmNo, ccmNo)
+                        .ge(QualityInspectionStatistics::getChangeShiftTime, monthStart)
+                        .orderByDesc(QualityInspectionStatistics::getChangeShiftTime)
+                        .last("limit 1")
+        );
+        BigDecimal monthStartWeight = last != null ? last.getMonthEndWeight().add(BigDecimal.ONE) : BigDecimal.ONE;
+        int monthStartCount = last != null ? last.getMonthEndCount() + 1 : 1;
+
+        for (BilletHotsendChangeShift shift : shifts) {
+            QualityInspectionStatisticsVO vo = this.getStatisticsByShift(shift,shifts);
+
+            QualityInspectionStatistics entity = new QualityInspectionStatistics();
+            entity.setId(String.valueOf(IdWorker.getId()));
+            entity.setClassLengthCountWeight(JSON.toJSONString(vo.getClassLengthCountWeight()));
+            entity.setDayLengthCountWeight(JSON.toJSONString(vo.getDayLengthCountWeight()));
+            entity.setClassTotalCount(vo.getClassTotalCount());
+            entity.setClassTotalWeight(vo.getClassTotalWeight());
+            entity.setChangeShiftId(shift.getId());
+            entity.setShift(shift.getShift());
+            entity.setShiftGroup(shift.getShiftGroup());
+            entity.setClassHeatNum(vo.getClassHeatNum());
+            entity.setChangeShiftTime(shift.getCreateTime());
+            entity.setCcmNo(ccmNo);
+
+            // 日累计
+            entity.setDayStartCount(dayStartCount);
+            entity.setDayStartWeight(dayStartWeight);
+            int dayEndCount = dayStartCount + vo.getClassTotalCount() - 1;
+            BigDecimal dayEndWeight = dayStartWeight.add(vo.getClassTotalWeight()).subtract(BigDecimal.ONE);
+            entity.setDayEndCount(dayEndCount);
+            entity.setDayEndWeight(dayEndWeight);
+            dayStartCount = dayEndCount + 1;
+            dayStartWeight = dayEndWeight.add(BigDecimal.ONE);
+
+            // 月累计
+            entity.setMonthStartCount(monthStartCount);
+            entity.setMonthStartWeight(monthStartWeight);
+            int monthEndCount = monthStartCount + vo.getClassTotalCount() - 1;
+            BigDecimal monthEndWeight = monthStartWeight.add(vo.getClassTotalWeight()).subtract(BigDecimal.ONE);
+            entity.setMonthEndCount(monthEndCount);
+            entity.setMonthEndWeight(monthEndWeight);
+            monthStartCount = monthEndCount + 1;
+            monthStartWeight = monthEndWeight.add(BigDecimal.ONE);
+
+            qualityInspectionStatisticsMapper.insert(entity);
         }
+    }
 
-        if (oConvertUtils.isNotEmpty(queryDTO.getQueryDate()) || search) {
-            if (oConvertUtils.isEmpty(queryDTO.getQueryDate())) {
-                String nowDate = DateUtils.getDate("yyyy-MM-dd");
-                Date startOneTime = DateUtils.getStartOfDayByDate(DateUtils.getStartOfDay(nowDate));
-                LambdaQueryWrapper<BilletHotsendChangeShift> changeQueryWrapper = new LambdaQueryWrapper<>();
-                changeQueryWrapper.eq(BilletHotsendChangeShift::getCcmNo, queryDTO.getCcmNo()).orderByDesc(BilletHotsendChangeShift::getCreateTime).last("limit 1");
-                BilletHotsendChangeShift billetHotsendChangeShift = billetHotsendChangeShiftService.getOne(changeQueryWrapper);
-                oneQueryWrapper.ge(BilletOriginalProductRecord::getCreateTime,
-                        oConvertUtils.isNotEmpty(billetHotsendChangeShift.getCreateTime()) ? billetHotsendChangeShift.getCreateTime() : startOneTime);
-            } else {
-                Date queryDate = queryDTO.getQueryDate();
-                Date startTime = DateUtils.getStartOfDayByDate(DateUtils.getStartOfDay(queryDate));
-                Date endTime = DateUtils.getEndOfDayByDate(startTime);
-                oneQueryWrapper.between(BilletOriginalProductRecord::getCreateTime, startTime, endTime);
+
+
+    private void initMonthlyStatisticsIfMissing(String ccmNo) {
+        Date monthStart = DateUtils.getMonthStart(new Date());
+        Date searchStart = new Date(monthStart.getTime() - 10 * 60 * 1000); // 向前推10分钟
+        Date now = new Date();
+
+        List<BilletHotsendChangeShift> allShifts = billetHotsendChangeShiftService.list(
+                new LambdaQueryWrapper<BilletHotsendChangeShift>()
+                        .eq(BilletHotsendChangeShift::getCcmNo, ccmNo)
+                        .between(BilletHotsendChangeShift::getCreateTime, searchStart, now)
+        );
+
+        // 按归属日期分组
+        Map<LocalDate, List<BilletHotsendChangeShift>> shiftByDate = allShifts.stream()
+                .collect(Collectors.groupingBy(s -> getShiftDate(s.getCreateTime(), s.getShift()),
+                        TreeMap::new, Collectors.toList()));
+
+        // 初始化月累计起点
+        int monthStartCount = 1;
+        BigDecimal monthStartWeight = BigDecimal.ONE;
+
+        for (List<BilletHotsendChangeShift> shiftList : shiftByDate.values()) {
+            // 按班次顺序处理:夜班 > 白班 > 中班
+            Map<String, Integer> shiftOrder = new HashMap<>();
+            shiftOrder.put("1", 0); // 夜班
+            shiftOrder.put("0", 1); // 白班
+            shiftOrder.put("2", 2); // 中班
+
+            shiftList.sort(Comparator
+                    .comparing((BilletHotsendChangeShift s) -> shiftOrder.getOrDefault(s.getShift(), 99))
+                    .thenComparing(BilletHotsendChangeShift::getCreateTime));
+
+            // 日累计起点
+            int dayStartCount = 1;
+            BigDecimal dayStartWeight = BigDecimal.ONE;
+
+            for (BilletHotsendChangeShift shift : shiftList) {
+                Long count = qualityInspectionStatisticsMapper.selectCount(
+                        new LambdaQueryWrapper<QualityInspectionStatistics>()
+                                .eq(QualityInspectionStatistics::getChangeShiftId, shift.getId())
+                );
+                if (count > 0) continue;
+
+                QualityInspectionStatisticsVO vo = this.getStatisticsByShift(shift,shiftList);
+
+                QualityInspectionStatistics entity = new QualityInspectionStatistics();
+                entity.setId(String.valueOf(IdWorker.getId()));
+                entity.setClassLengthCountWeight(JSON.toJSONString(vo.getClassLengthCountWeight()));
+                entity.setDayLengthCountWeight(JSON.toJSONString(vo.getDayLengthCountWeight()));
+                entity.setClassTotalCount(vo.getClassTotalCount());
+                entity.setClassTotalWeight(vo.getClassTotalWeight());
+                entity.setChangeShiftId(shift.getId());
+                entity.setShift(shift.getShift());
+                entity.setShiftGroup(shift.getShiftGroup());
+                entity.setClassHeatNum(vo.getClassHeatNum());
+                entity.setChangeShiftTime(shift.getCreateTime());
+                entity.setCcmNo(ccmNo);
+
+                // 日累计
+                entity.setDayStartCount(dayStartCount);
+                entity.setDayStartWeight(dayStartWeight);
+                int dayEndCount = dayStartCount + vo.getClassTotalCount() - 1;
+                BigDecimal dayEndWeight = dayStartWeight.add(vo.getClassTotalWeight()).subtract(BigDecimal.ONE);
+                entity.setDayEndCount(dayEndCount);
+                entity.setDayEndWeight(dayEndWeight);
+                dayStartCount = dayEndCount + 1;
+                dayStartWeight = dayEndWeight.add(BigDecimal.ONE);
+
+                // 月累计
+                entity.setMonthStartCount(monthStartCount);
+                entity.setMonthStartWeight(monthStartWeight);
+                int monthEndCount = monthStartCount + vo.getClassTotalCount() - 1;
+                BigDecimal monthEndWeight = monthStartWeight.add(vo.getClassTotalWeight()).subtract(BigDecimal.ONE);
+                entity.setMonthEndCount(monthEndCount);
+                entity.setMonthEndWeight(monthEndWeight);
+                monthStartCount = monthEndCount + 1;
+                monthStartWeight = monthEndWeight.add(BigDecimal.ONE);
+
+                qualityInspectionStatisticsMapper.insert(entity);
             }
         }
+    }
 
-        if (oConvertUtils.isNotEmpty(queryDTO.getHeatNo())) {
-            oneQueryWrapper.eq(BilletOriginalProductRecord::getHeatNo, queryDTO.getHeatNo());
-        }
-        if (oConvertUtils.isNotEmpty(queryDTO.getSize())) {
-            oneQueryWrapper.like(BilletOriginalProductRecord::getRollClubOneDetails, queryDTO.getSize());
-        }
-        if (oConvertUtils.isNotEmpty(queryDTO.getBrandNum())) {
-            oneQueryWrapper.eq(BilletOriginalProductRecord::getGrade, queryDTO.getBrandNum());
-        }
-        oneQueryWrapper.orderByAsc(BilletOriginalProductRecord::getCreateTime);
 
-        List<BilletOriginalProductRecord> records = this.list(oneQueryWrapper);
-        Set<String> allLengths = new TreeSet<>();
-        ObjectMapper objectMapper = new ObjectMapper();
 
-        // 获取当前班次记录
-        LambdaQueryWrapper<BilletHotsendChangeShift> changeQueryWrapper = new LambdaQueryWrapper<>();
-        changeQueryWrapper.eq(BilletHotsendChangeShift::getCcmNo, queryDTO.getCcmNo())
-                .orderByDesc(BilletHotsendChangeShift::getCreateTime)
-                .last("limit 1");
-        BilletHotsendChangeShift billetHotsendChangeShift = billetHotsendChangeShiftService.getOne(changeQueryWrapper);
 
-        // 设置班次时间范围
-        Date classStartTime = billetHotsendChangeShift != null ? billetHotsendChangeShift.getCreateTime() : null;
-        Date classEndTime = billetHotsendChangeShift != null && billetHotsendChangeShift.getChangeShiftTime() != null
-                ? billetHotsendChangeShift.getChangeShiftTime()
-                : new Date();
+    public QualityInspectionStatisticsVO getStatisticsByShift(BilletHotsendChangeShift shiftRecord, List<BilletHotsendChangeShift> allShiftsOfTheDay) {
+        Date classStartTime = shiftRecord.getCreateTime();
+        Date classEndTime = Optional.ofNullable(shiftRecord.getChangeShiftTime()).orElse(new Date());
+        String ccmNo = shiftRecord.getCcmNo();
 
-        String nowDate = DateUtils.getDate("yyyy-MM-dd");
+        // 获取米重数据
+        String meterWeightKey = String.format("ccmno:meter:weight:%s", ccmNo);
+        String mWeightStr = oConvertUtils.getString(redisTemplate.opsForValue().get(meterWeightKey));
+        BigDecimal meterWeightFactor = StringUtils.isNotEmpty(mWeightStr)
+                ? new BigDecimal(mWeightStr)
+                : BigDecimal.ONE; // 如果没有米重数据,使用1作为系数
 
-        Date startCurrentTime = DateUtils.getStartOfDayByDate(DateUtils.getStartOfDay(nowDate));
-        Date endCurrentTime = DateUtils.getEndOfDayByDate(DateUtils.getEndOfDay(nowDate));
+        // 查询当前班次的原始记录
+        LambdaQueryWrapper<BilletOriginalProductRecord> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(BilletOriginalProductRecord::getCcmNo, ccmNo)
+                .eq(BilletOriginalProductRecord::getShift, shiftRecord.getShift())
+                .eq(BilletOriginalProductRecord::getShiftGroup, shiftRecord.getShiftGroup())
+                .between(BilletOriginalProductRecord::getCreateTime, classStartTime, classEndTime)
+                .orderByAsc(BilletOriginalProductRecord::getCreateTime);
+        List<BilletOriginalProductRecord> records = this.list(queryWrapper);
+
+        // 获取当前班次逻辑日期,用作日统计参考
+        LocalDate logicalDay = getShiftDate(classStartTime, shiftRecord.getShift());
+        Date dayStartTime = shiftRecord.getCreateTime(); // 日累计从当前班次开始
+        Date dayEndTime = DateUtils.getEndOfDayByDate(Date.from(logicalDay.atStartOfDay(ZoneId.systemDefault()).toInstant()));
 
-        // 汇总统计
         Map<String, Integer> classLengthCountMap = new TreeMap<>();
         Map<String, BigDecimal> classLengthWeightMap = new TreeMap<>();
-        Map<String, Integer> dayLengthCountMap = new TreeMap<>();
-        Map<String, BigDecimal> dayLengthWeightMap = new TreeMap<>();
         int classTotalCount = 0;
         BigDecimal classTotalWeight = BigDecimal.ZERO;
-        int dayTotalCount = 0;
-        BigDecimal dayTotalWeight = BigDecimal.ZERO;
 
-        for (BilletOriginalProductRecord record : records) {
-            QualityInspectionVO vo = new QualityInspectionVO();
-            vo.setHeatNo(record.getHeatNo());
-            String brandNum = Optional.ofNullable(record.getGrade())
-                    .map(bn -> sysDictService.queryDictTextByKey("billet_spec", bn))
-                    .orElseGet(() -> sysDictService.queryDictTextByKey("billet_spec", "5"));
-            vo.setBrandNum(brandNum);
-            vo.setDeliveryTime(record.getCreateTime());
+        ObjectMapper objectMapper = new ObjectMapper();
 
+        for (BilletOriginalProductRecord record : records) {
             Map<String, Integer> mergedCount = new HashMap<>();
             Map<String, BigDecimal> mergedWeight = new HashMap<>();
 
             try {
-                // --- rollClubOneDetails ---
                 JsonNode rollDetails = objectMapper.readTree(record.getRollClubOneDetails());
                 JsonNode lengthGroupCount = rollDetails.path("lengthGroupCount");
                 BigDecimal totalWeight = rollDetails.path("directRollingTotalWeight").decimalValue();
@@ -407,24 +509,21 @@ public class BilletOriginalProductRecordServiceImpl extends ServiceImpl<BilletOr
                         int count = entry.getValue().asInt(0);
 
                         LambdaQueryWrapper<BilletRulerConfig> configQuery = new LambdaQueryWrapper<BilletRulerConfig>()
-                                .eq(BilletRulerConfig::getLength, Integer.valueOf(mm)); // mm 是字符串长度
-
+                                .eq(BilletRulerConfig::getLength, Integer.valueOf(mm));
                         BilletRulerConfig rulerConfig = billetRulerConfigMapper.selectOne(configQuery);
 
                         BigDecimal weight;
-
                         if (rulerConfig != null && rulerConfig.getWeight() != null) {
-                            // 方式一:用定尺表配置重量
-                            weight = BigDecimal.valueOf(rulerConfig.getWeight())
-                                    .multiply(BigDecimal.valueOf(count));
+                            weight = BigDecimal.valueOf(rulerConfig.getWeight()).multiply(BigDecimal.valueOf(count));
                         } else {
-                            // 方式二:用总重量按支数比例分摊
                             weight = (totalCount > 0)
-                                    ? totalWeight.divide(BigDecimal.valueOf(totalCount), 4, RoundingMode.HALF_UP)
-                                    .multiply(BigDecimal.valueOf(count))
+                                    ? totalWeight.divide(BigDecimal.valueOf(totalCount), 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(count))
                                     : BigDecimal.ZERO;
                         }
 
+                        // 应用米重系数
+                        weight = weight.multiply(meterWeightFactor);
+
                         mergedCount.merge(mm, count, Integer::sum);
                         mergedWeight.merge(mm, weight, BigDecimal::add);
                     }
@@ -432,110 +531,151 @@ public class BilletOriginalProductRecordServiceImpl extends ServiceImpl<BilletOr
             } catch (Exception ignored) {}
 
             try {
-                // --- hotChargeLength ---
                 JsonNode hotArray = objectMapper.readTree(record.getHotChargeLength());
                 for (JsonNode node : hotArray) {
                     String mm = node.path("hotChargeLength").asText();
                     int count = node.path("totalCount").asInt(0);
                     BigDecimal weight = new BigDecimal(node.path("totalWeight").asText("0"));
+
+                    // 应用米重系数
+                    weight = weight.multiply(meterWeightFactor);
+
                     mergedCount.merge(mm, count, Integer::sum);
                     mergedWeight.merge(mm, weight, BigDecimal::add);
                 }
             } catch (Exception ignored) {}
 
             try {
-                // --- stackLength ---
                 JsonNode stackArray = objectMapper.readTree(record.getStackLength());
                 for (JsonNode node : stackArray) {
                     String mm = node.path("stackingLength").asText();
                     int count = node.path("stackingCount").asInt(0);
                     BigDecimal weight = new BigDecimal(node.path("stackingWeight").asText("0"));
+
+                    // 应用米重系数
+                    weight = weight.multiply(meterWeightFactor);
+
                     mergedCount.merge(mm, count, Integer::sum);
                     mergedWeight.merge(mm, weight, BigDecimal::add);
                 }
             } catch (Exception ignored) {}
 
             Date createTime = record.getCreateTime();
-            boolean isInClassTime = createTime != null && !createTime.before(classStartTime) && !createTime.after(classEndTime);
-            boolean isInDayTime = createTime != null && !createTime.before(startCurrentTime) && !createTime.after(endCurrentTime);
-
-            for (Map.Entry<String, Integer> entry : mergedCount.entrySet()) {
-                String mmStr = entry.getKey();
-                int count = entry.getValue();
-                BigDecimal weight = mergedWeight.getOrDefault(mmStr, BigDecimal.ZERO);
-                String mStr;
-                try {
-                    BigDecimal mm = new BigDecimal(mmStr);
-                    mStr = mm.divide(BigDecimal.valueOf(1000), 2, RoundingMode.HALF_UP).toString();
-                } catch (Exception e) {
-                    mStr = mmStr;
-                }
-                vo.getLengthCountMap().put(mStr, count);
-                allLengths.add(mStr);
-
-                if (isInClassTime) {
-                    classLengthCountMap.merge(mStr, count, Integer::sum);
-                    classLengthWeightMap.merge(mStr, weight, BigDecimal::add);
+            if (createTime != null && !createTime.before(classStartTime) && !createTime.after(classEndTime)) {
+                for (Map.Entry<String, Integer> entry : mergedCount.entrySet()) {
+                    String mm = entry.getKey();
+                    int count = entry.getValue();
+                    BigDecimal weight = mergedWeight.getOrDefault(mm, BigDecimal.ZERO);
+
+                    classLengthCountMap.merge(mm, count, Integer::sum);
+                    classLengthWeightMap.merge(mm, weight, BigDecimal::add);
                     classTotalCount += count;
                     classTotalWeight = classTotalWeight.add(weight);
                 }
-                if (isInDayTime) {
-                    dayLengthCountMap.merge(mStr, count, Integer::sum);
-                    dayLengthWeightMap.merge(mStr, weight, BigDecimal::add);
-                    dayTotalCount += count;
-                    dayTotalWeight = dayTotalWeight.add(weight);
-                }
             }
-
-            resultList.add(vo);
         }
 
-        // 补齐定尺列
-        for (QualityInspectionVO vo : resultList) {
-            for (String length : allLengths) {
-                vo.getLengthCountMap().putIfAbsent(length, 0);
-            }
+        // 构建日累计数据,初始为当前班次数据
+        Map<String, Integer> dayLengthCountMap = new TreeMap<>(classLengthCountMap);
+        Map<String, BigDecimal> dayLengthWeightMap = new TreeMap<>(classLengthWeightMap);
+        int dayTotalCount = classTotalCount;
+        BigDecimal dayTotalWeight = classTotalWeight;
+
+        // 当前班次信息
+        String shift = shiftRecord.getShift();
+        Map<String, Integer> shiftOrder = new HashMap<>();
+        shiftOrder.put("1", 0); // 夜班
+        shiftOrder.put("0", 1); // 白班
+        shiftOrder.put("2", 2); // 中班
+
+        int currentOrder = shiftOrder.getOrDefault(shift, 99);
+
+        // 查找当前逻辑日内的前置班次
+        List<BilletHotsendChangeShift> previousShifts = allShiftsOfTheDay.stream()
+                .filter(s -> getShiftDate(s.getCreateTime(), s.getShift()).equals(logicalDay))
+                .filter(s -> shiftOrder.getOrDefault(s.getShift(), 99) < currentOrder)
+                .sorted(Comparator.comparing(s -> shiftOrder.getOrDefault(s.getShift(), 99)))
+                .collect(Collectors.toList());
+
+        for (BilletHotsendChangeShift previous : previousShifts) {
+            QualityInspectionStatisticsVO prevVO = this.getStatisticsByShift(previous, allShiftsOfTheDay);
+            prevVO.getClassLengthCountMap().forEach((k, v) -> dayLengthCountMap.merge(k, v, Integer::sum));
+            prevVO.getClassLengthWeightMap().forEach((k, v) -> dayLengthWeightMap.merge(k, v, BigDecimal::add));
+            dayTotalCount += prevVO.getClassTotalCount();
+            dayTotalWeight = dayTotalWeight.add(prevVO.getClassTotalWeight());
         }
 
-        // 1. 先对定尺重量 map 统一保留4位小数(班次 + 当天)
+        // 四舍五入保留 4 位小数
         Map<String, BigDecimal> roundedClassWeightMap = classLengthWeightMap.entrySet().stream()
-                .collect(Collectors.toMap(
-                        Map.Entry::getKey,
-                        e -> e.getValue().setScale(4, RoundingMode.HALF_UP)
-                ));
+                .collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().setScale(4, RoundingMode.HALF_UP)));
 
         Map<String, BigDecimal> roundedDayWeightMap = dayLengthWeightMap.entrySet().stream()
-                .collect(Collectors.toMap(
-                        Map.Entry::getKey,
-                        e -> e.getValue().setScale(4, RoundingMode.HALF_UP)
-                ));
+                .collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().setScale(4, RoundingMode.HALF_UP)));
 
-        // 2. 总重量使用已四舍五入后的子项重量相加,再保留4位小数
         BigDecimal roundedClassTotalWeight = roundedClassWeightMap.values().stream()
-                .reduce(BigDecimal.ZERO, BigDecimal::add)
-                .setScale(4, RoundingMode.HALF_UP);
+                .reduce(BigDecimal.ZERO, BigDecimal::add).setScale(4, RoundingMode.HALF_UP);
 
         BigDecimal roundedDayTotalWeight = roundedDayWeightMap.values().stream()
-                .reduce(BigDecimal.ZERO, BigDecimal::add)
-                .setScale(4, RoundingMode.HALF_UP);
+                .reduce(BigDecimal.ZERO, BigDecimal::add).setScale(4, RoundingMode.HALF_UP);
 
-        // 3. 封装 VO 返回
         QualityInspectionStatisticsVO stats = new QualityInspectionStatisticsVO();
         stats.setClassLengthCountMap(classLengthCountMap);
         stats.setClassLengthWeightMap(roundedClassWeightMap);
         stats.setClassTotalCount(classTotalCount);
         stats.setClassTotalWeight(roundedClassTotalWeight);
-
         stats.setDayLengthCountMap(dayLengthCountMap);
         stats.setDayLengthWeightMap(roundedDayWeightMap);
         stats.setDayTotalCount(dayTotalCount);
         stats.setDayTotalWeight(roundedDayTotalWeight);
+        stats.setClassHeatNum(records.size());
+
+        // 合并展示格式
+        Map<String, String> classLengthCountWeight = new TreeMap<>();
+        for (String length : classLengthCountMap.keySet()) {
+            int count = classLengthCountMap.getOrDefault(length, 0);
+            BigDecimal weight = roundedClassWeightMap.getOrDefault(length, BigDecimal.ZERO);
+            classLengthCountWeight.put(length, count + " / " + weight.toPlainString());
+        }
+        stats.setClassLengthCountWeight(classLengthCountWeight);
 
+        Map<String, String> dayLengthCountWeight = new TreeMap<>();
+        for (String length : dayLengthCountMap.keySet()) {
+            int count = dayLengthCountMap.getOrDefault(length, 0);
+            BigDecimal weight = roundedDayWeightMap.getOrDefault(length, BigDecimal.ZERO);
+            dayLengthCountWeight.put(length, count + " / " + weight.toPlainString());
+        }
+        stats.setDayLengthCountWeight(dayLengthCountWeight);
 
-        Map<String, Object> result = new HashMap<>();
-        result.put("records", resultList);
-        result.put("statistics", stats);
+        return stats;
+    }
 
-        return result;
+
+    /**
+     * 判断班次所属的业务日期(白班/中班/夜班)
+     * - 夜班(shift = "1"):
+     *   - 如果时间在 00:00 ~ 08:00,视为“当天的夜班”
+     *   - 如果时间在 23:50 ~ 23:59,视为“第二天的夜班”
+     * - 其他:按正常的 createTime 日期返回
+     */
+    /**
+     * 获取班次逻辑日期:
+     * - 夜班如果时间在 23:50 ~ 次日 08:00,算作第二天夜班
+     * - 其他班次默认用日期当天
+     */
+    private LocalDate getShiftDate(Date date, String shift) {
+        LocalDateTime ldt = LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault());
+        int hour = ldt.getHour();
+        int minute = ldt.getMinute();
+
+        if ("1".equals(shift)) { // 夜班
+            if ((hour == 23 && minute >= 50) || hour < 8) {
+                return ldt.toLocalDate().plusDays(1); // 属于第二天夜班
+            }
+        }
+        return ldt.toLocalDate();
     }
+
+
+
+
 }

+ 8 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetOriginalProductRecord/vo/QualityInspectionStatisticsVO.java

@@ -17,4 +17,12 @@ public class QualityInspectionStatisticsVO {
     private Map<String, BigDecimal> dayLengthWeightMap;
     private int dayTotalCount;
     private BigDecimal dayTotalWeight;
+
+    private Map<String, String> classLengthCountWeight;
+    private Map<String, String> dayLengthCountWeight;
+
+    private Integer classHeatNum;
+
+
+
 }

+ 2 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetOriginalProductRecord/vo/QualityInspectionVO.java

@@ -26,6 +26,8 @@ public class QualityInspectionVO {
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date deliveryTime;
 
+    private String originalProductRecordId;
+
     private Map<String, Integer> lengthCountMap = new LinkedHashMap<>();
 
 }

+ 241 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/qualityInspectionStatistics/controller/QualityInspectionStatisticsController.java

@@ -0,0 +1,241 @@
+package org.jeecg.modules.billet.qualityInspectionStatistics.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.billet.billetOriginalProductRecord.dto.QualityInspectionQueryDTO;
+import org.jeecg.modules.billet.billetOriginalProductRecord.service.IBilletOriginalProductRecordService;
+import org.jeecg.modules.billet.qualityInspectionStatistics.dto.MeterWeightDTO;
+import org.jeecg.modules.billet.qualityInspectionStatistics.entity.QualityInspectionStatistics;
+import org.jeecg.modules.billet.qualityInspectionStatistics.service.IQualityInspectionStatisticsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.StringRedisTemplate;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
+import java.util.Date;
+
+ /**
+ * @Description: 质检记录统计
+ * @Author: jeecg-boot
+ * @Date:   2025-07-07
+ * @Version: V1.0
+ */
+@Api(tags="质检记录统计")
+@RestController
+@RequestMapping("/qualityInspectionStatistics/qualityInspectionStatistics")
+@Slf4j
+public class QualityInspectionStatisticsController extends JeecgController<QualityInspectionStatistics, IQualityInspectionStatisticsService> {
+	@Autowired
+	private IQualityInspectionStatisticsService qualityInspectionStatisticsService;
+	@Autowired
+	private IBilletOriginalProductRecordService billetOriginalProductRecordService;
+	@Autowired
+	private StringRedisTemplate stringRedisTemplate;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param qualityInspectionStatistics
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "质检记录统计-分页列表查询")
+	@ApiOperation(value="质检记录统计-分页列表查询", notes="质检记录统计-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<QualityInspectionStatistics>> queryPageList(QualityInspectionStatistics qualityInspectionStatistics,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<QualityInspectionStatistics> queryWrapper = QueryGenerator.initQueryWrapper(qualityInspectionStatistics, req.getParameterMap());
+		Page<QualityInspectionStatistics> page = new Page<QualityInspectionStatistics>(pageNo, pageSize);
+		IPage<QualityInspectionStatistics> pageList = qualityInspectionStatisticsService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 *   添加
+	 *
+	 * @param qualityInspectionStatistics
+	 * @return
+	 */
+	@AutoLog(value = "质检记录统计-添加")
+	@ApiOperation(value="质检记录统计-添加", notes="质检记录统计-添加")
+	@RequiresPermissions("qualityInspectionStatistics:quality_inspection_statistics:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody QualityInspectionStatistics qualityInspectionStatistics) {
+		qualityInspectionStatisticsService.save(qualityInspectionStatistics);
+		return Result.OK("添加成功!");
+	}
+	
+	/**
+	 *  编辑
+	 *
+	 * @param qualityInspectionStatistics
+	 * @return
+	 */
+	@AutoLog(value = "质检记录统计-编辑")
+	@ApiOperation(value="质检记录统计-编辑", notes="质检记录统计-编辑")
+	@RequiresPermissions("qualityInspectionStatistics:quality_inspection_statistics:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody QualityInspectionStatistics qualityInspectionStatistics) {
+		qualityInspectionStatisticsService.updateById(qualityInspectionStatistics);
+		return Result.OK("编辑成功!");
+	}
+	
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "质检记录统计-通过id删除")
+	@ApiOperation(value="质检记录统计-通过id删除", notes="质检记录统计-通过id删除")
+	@RequiresPermissions("qualityInspectionStatistics:quality_inspection_statistics:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		qualityInspectionStatisticsService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+	
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "质检记录统计-批量删除")
+	@ApiOperation(value="质检记录统计-批量删除", notes="质检记录统计-批量删除")
+	@RequiresPermissions("qualityInspectionStatistics:quality_inspection_statistics:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.qualityInspectionStatisticsService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+	
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "质检记录统计-通过id查询")
+	@ApiOperation(value="质检记录统计-通过id查询", notes="质检记录统计-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<QualityInspectionStatistics> queryById(@RequestParam(name="id",required=true) String id) {
+		QualityInspectionStatistics qualityInspectionStatistics = qualityInspectionStatisticsService.getById(id);
+		if(qualityInspectionStatistics==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(qualityInspectionStatistics);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param qualityInspectionStatistics
+    */
+    @RequiresPermissions("qualityInspectionStatistics:quality_inspection_statistics:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, QualityInspectionStatistics qualityInspectionStatistics) {
+        return super.exportXls(request, qualityInspectionStatistics, QualityInspectionStatistics.class, "质检记录统计");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    @RequiresPermissions("qualityInspectionStatistics:quality_inspection_statistics:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, QualityInspectionStatistics.class);
+    }
+
+	 @ApiOperation("质检记录子表写入数据")
+	 @GetMapping("/qualityInspectionAdd")
+	 public Result<String> getQualityInspectionAdd(QualityInspectionQueryDTO queryDTO) {
+
+		 billetOriginalProductRecordService.getQualityInspectionScreen(queryDTO);
+		 return Result.OK("新增成功!");
+	 }
+
+	 /**
+	  *  确认质检记录
+	  *
+	  * @param qualityInspectionStatistics
+	  * @return
+	  */
+	 @AutoLog(value = "确认质检记录")
+	 @ApiOperation(value="确认质检记录", notes="确认质检记录")
+	 @PutMapping(value = "/confirmRecord")
+	 public Result<String> confirmRecord(@RequestBody QualityInspectionStatistics qualityInspectionStatistics) {
+		 QualityInspectionStatistics byId = qualityInspectionStatisticsService.getById(qualityInspectionStatistics.getId());
+		 if (byId == null) {
+			 return Result.error("未找到对应数据,编辑失败!");
+		 }
+
+		 if (oConvertUtils.isEmpty(qualityInspectionStatistics.getRemark())) {
+			 return Result.error("备注不能为空!");
+		 }
+
+		 LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+
+		 // 使用 UpdateWrapper 只更新指定字段
+		 UpdateWrapper<QualityInspectionStatistics> updateWrapper = new UpdateWrapper<>();
+		 updateWrapper.eq("id", qualityInspectionStatistics.getId())
+				 .set("confirm_by", sysUser.getRealname())
+				 .set("confirm_time", new Date())
+				 .set("remark", qualityInspectionStatistics.getRemark());
+
+		 qualityInspectionStatisticsService.update(updateWrapper);
+
+		 return Result.OK("确认成功!");
+	 }
+
+
+	 /**
+	  * 切换米重值
+	  *
+	  * @param dto ccmNo 和 米重值
+	  * @return 操作结果
+	  */
+	 @AutoLog(value = "切换米重")
+	 @ApiOperation(value="切换米重", notes="切换米重")
+	 @PostMapping("/switch")
+	 public Result<String> switchMeterWeight(@RequestBody MeterWeightDTO dto) {
+		 if (dto == null || StringUtils.isBlank(dto.getCcmNo()) || dto.getMeterWeight() == null) {
+			 return Result.error("参数不能为空");
+		 }
+
+		 String redisKey = String.format("ccmno:meter:weight:%s", dto.getCcmNo());
+		 try {
+			 stringRedisTemplate.opsForValue().set(redisKey, dto.getMeterWeight().toString());
+			 return Result.ok("米重切换成功");
+		 } catch (Exception e) {
+			 return Result.error("Redis写入失败: " + e.getMessage());
+		 }
+	 }
+
+}

+ 12 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/qualityInspectionStatistics/dto/MeterWeightDTO.java

@@ -0,0 +1,12 @@
+package org.jeecg.modules.billet.qualityInspectionStatistics.dto;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class MeterWeightDTO {
+
+    private String ccmNo;             // 铸机号
+    private BigDecimal meterWeight;   // 米重值
+}

+ 149 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/qualityInspectionStatistics/entity/QualityInspectionStatistics.java

@@ -0,0 +1,149 @@
+package org.jeecg.modules.billet.qualityInspectionStatistics.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: 质检记录统计
+ * @Author: jeecg-boot
+ * @Date:   2025-07-07
+ * @Version: V1.0
+ */
+@Data
+@TableName("quality_inspection_statistics")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="quality_inspection_statistics对象", description="质检记录统计")
+public class QualityInspectionStatistics implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+    private String id;
+	/**创建人*/
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+	/**创建日期*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建日期")
+    private Date createTime;
+	/**更新人*/
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+	/**更新日期*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "更新日期")
+    private Date updateTime;
+	/**所属部门*/
+    @ApiModelProperty(value = "所属部门")
+    private String sysOrgCode;
+	/**当班定尺及其数量重量*/
+	@Excel(name = "当班定尺及其数量重量", width = 15)
+    @ApiModelProperty(value = "当班定尺及其数量重量")
+    private String classLengthCountWeight;
+	/**当天定尺及其数量重量*/
+	@Excel(name = "当天定尺及其数量重量", width = 15)
+    @ApiModelProperty(value = "当天定尺及其数量重量")
+    private String dayLengthCountWeight;
+	/**当班总支数*/
+	@Excel(name = "当班总支数", width = 15)
+    @ApiModelProperty(value = "当班总支数")
+    private Integer classTotalCount;
+	/**当班总重量*/
+	@Excel(name = "当班总重量", width = 15)
+    @ApiModelProperty(value = "当班总重量")
+    private BigDecimal classTotalWeight;
+	/**当天起始支数*/
+	@Excel(name = "当天起始支数", width = 15)
+    @ApiModelProperty(value = "当天起始支数")
+    private Integer dayStartCount;
+	/**当天结束支数*/
+	@Excel(name = "当天结束支数", width = 15)
+    @ApiModelProperty(value = "当天结束支数")
+    private Integer dayEndCount;
+	/**当天起始重量*/
+	@Excel(name = "当天起始重量", width = 15)
+    @ApiModelProperty(value = "当天起始重量")
+    private BigDecimal dayStartWeight;
+	/**当天结束重量*/
+	@Excel(name = "当天结束重量", width = 15)
+    @ApiModelProperty(value = "当天结束重量")
+    private BigDecimal dayEndWeight;
+	/**铸机号*/
+	@Excel(name = "铸机号", width = 15)
+    @ApiModelProperty(value = "铸机号")
+    private String ccmNo;
+	/**当月起始支数*/
+	@Excel(name = "当月起始支数", width = 15)
+    @ApiModelProperty(value = "当月起始支数")
+    private Integer monthStartCount;
+	/**当月结束支数*/
+	@Excel(name = "当月结束支数", width = 15)
+    @ApiModelProperty(value = "当月结束支数")
+    private Integer monthEndCount;
+	/**当月起始重量*/
+	@Excel(name = "当月起始重量", width = 15)
+    @ApiModelProperty(value = "当月起始重量")
+    private BigDecimal monthStartWeight;
+	/**当月结束重量*/
+	@Excel(name = "当月结束重量", width = 15)
+    @ApiModelProperty(value = "当月结束重量")
+    private BigDecimal monthEndWeight;
+	/**班次id*/
+	@Excel(name = "班次id", width = 15)
+    @ApiModelProperty(value = "班次id")
+    private String changeShiftId;
+	/**本班冶炼炉数*/
+	@Excel(name = "本班冶炼炉数", width = 15)
+    @ApiModelProperty(value = "本班冶炼炉数")
+    private Integer classHeatNum;
+	/**班别*/
+	@Excel(name = "班别", width = 15)
+    @ApiModelProperty(value = "班别")
+    private String shift;
+	/**班组*/
+	@Excel(name = "班组", width = 15)
+    @ApiModelProperty(value = "班组")
+    private String shiftGroup;
+	/**确认人*/
+	@Excel(name = "确认人", width = 15)
+    @ApiModelProperty(value = "确认人")
+    private String confirmBy;
+	/**确认时间*/
+	@Excel(name = "确认时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "确认时间")
+    private Date confirmTime;
+	/**备注1*/
+	@Excel(name = "备注1", width = 15)
+    @ApiModelProperty(value = "备注1")
+    private String remark;
+	/**备注2*/
+	@Excel(name = "备注2", width = 15)
+    @ApiModelProperty(value = "备注2")
+    private String notes;
+
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "班次创建创建日期")
+    private Date changeShiftTime;
+}

+ 14 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/qualityInspectionStatistics/mapper/QualityInspectionStatisticsMapper.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.billet.qualityInspectionStatistics.mapper;
+
+import org.jeecg.modules.billet.qualityInspectionStatistics.entity.QualityInspectionStatistics;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 质检记录统计
+ * @Author: jeecg-boot
+ * @Date:   2025-07-07
+ * @Version: V1.0
+ */
+public interface QualityInspectionStatisticsMapper extends BaseMapper<QualityInspectionStatistics> {
+
+}

+ 5 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/qualityInspectionStatistics/mapper/xml/QualityInspectionStatisticsMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.billet.qualityInspectionStatistics.mapper.QualityInspectionStatisticsMapper">
+
+</mapper>

+ 14 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/qualityInspectionStatistics/service/IQualityInspectionStatisticsService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.billet.qualityInspectionStatistics.service;
+
+import org.jeecg.modules.billet.qualityInspectionStatistics.entity.QualityInspectionStatistics;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 质检记录统计
+ * @Author: jeecg-boot
+ * @Date:   2025-07-07
+ * @Version: V1.0
+ */
+public interface IQualityInspectionStatisticsService extends IService<QualityInspectionStatistics> {
+
+}

+ 19 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/qualityInspectionStatistics/service/impl/QualityInspectionStatisticsServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.billet.qualityInspectionStatistics.service.impl;
+
+import org.jeecg.modules.billet.qualityInspectionStatistics.entity.QualityInspectionStatistics;
+import org.jeecg.modules.billet.qualityInspectionStatistics.mapper.QualityInspectionStatisticsMapper;
+import org.jeecg.modules.billet.qualityInspectionStatistics.service.IQualityInspectionStatisticsService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 质检记录统计
+ * @Author: jeecg-boot
+ * @Date:   2025-07-07
+ * @Version: V1.0
+ */
+@Service
+public class QualityInspectionStatisticsServiceImpl extends ServiceImpl<QualityInspectionStatisticsMapper, QualityInspectionStatistics> implements IQualityInspectionStatisticsService {
+
+}