JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/entity/BPjingpianKC.java
New file @@ -0,0 +1,53 @@ package com.mes.md.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; import java.io.Serializable; import java.util.Date; /** * 库位库存表 * * @author huang * @since 2025/9/10 */ @Data @EqualsAndHashCode(callSuper = false) @TableName(value = "BPjingpianKC") public class BPjingpianKC implements Serializable { /** * 库位库存表主键(客户提供样本) */ @TableId(value = "Id", type = IdType.AUTO) private Long id; /** * 库位号 */ @TableField(value="LGORTOT") private String LGORTOT; /** * 库存数量 */ @TableField(value="TotalLensStock") private String TotalLensStock; /** * 日期 */ @TableField(value="RecordDate") private Date RecordDate; /** * 创建时间 */ @TableField(value="CreatedDate") private Date CreatedDate; } JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/mapper/BPjingpianKCMapper.java
New file @@ -0,0 +1,15 @@ package com.mes.md.mapper; import com.baomidou.dynamic.datasource.annotation.DS; import com.github.yulichang.base.MPJBaseMapper; import com.mes.md.entity.BPjingpianKC; /** * 库位库存 Mapper 接口 * * @author huang * @since 2025/9/10 */ @DS("salve_JomooKBB") public interface BPjingpianKCMapper extends MPJBaseMapper<BPjingpianKC> { } JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/impl/TaskingLogServiceImpl.java
@@ -3,9 +3,11 @@ import cn.smallbun.screw.core.util.CollectionUtils; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.github.yulichang.base.MPJBaseServiceImpl; import com.mes.md.entity.BPjingpianKC; import com.mes.md.entity.KBBTJPDrawingBP; import com.mes.md.entity.KBBTProgramsOperationLogBP; import com.mes.md.entity.TaskingLog; import com.mes.md.mapper.BPjingpianKCMapper; import com.mes.md.mapper.KBBTJPDrawingBPMapper; import com.mes.md.mapper.KBBTProgramsOperationLogBPMapper; import com.mes.md.mapper.TaskingLogMapper; @@ -34,6 +36,8 @@ KBBTProgramsOperationLogBPMapper kBBTProgramsOperationLogBPMapper; @Autowired KBBTJPDrawingBPMapper kBBTJPDrawingBPMapper; @Autowired BPjingpianKCMapper bPjingpianKCMapper; @Override public List<Map> selectMechanicalReport(int dayCount, Date startDate, Date endDate, String taskType, String operationRecord, String lineType) { @@ -377,8 +381,7 @@ /** * 查询库位数据 * 按库位统计: * - 标准工艺:统计上片1和上片2的记录 * - 定制工艺:统计旋转1和旋转2的记录 * 查询 BPjingpianKC 表的库位数据 */ @Override public List<Map<String, Object>> selectWareHouse(int dayCount) { @@ -392,30 +395,17 @@ cal.set(Calendar.MILLISECOND, 0); cal.add(Calendar.DATE, -dayCount + 1); Date startDate = cal.getTime(); // 使用QueryWrapper构建查询 QueryWrapper<TaskingLog> queryWrapper = new QueryWrapper<>(); queryWrapper.select( "DATE_FORMAT(operation_record_time, '%Y-%m-%d') as date", "warehouse", "COUNT(*) as count" ) .and(wrapper -> wrapper .and(w -> w .eq("task_type", "标准") .in("operation_record", "上片1", "上片2") ) .or(w -> w .eq("task_type", "定制") .in("operation_record", "旋转1", "旋转2") ) ) .eq("operation_mode", "结束") .ge("operation_record_time", startDate) .groupBy("DATE_FORMAT(operation_record_time, '%Y-%m-%d')", "warehouse") .orderByAsc("date", "warehouse"); return baseMapper.selectMaps(queryWrapper); QueryWrapper<BPjingpianKC> queryWrapper = new QueryWrapper<>(); queryWrapper.select( "RecordDate as date", "LGORTOT as warehouse", "TotalLensStock as count" ) .ge("RecordDate", startDate) .orderByAsc("RecordDate", "LGORTOT"); return bPjingpianKCMapper.selectMaps(queryWrapper); } catch (Exception e) { log.error("查询库位数据失败", e); UI-Project/src/views/KanbanDisplay2/kanbanDisplay2.vue
@@ -199,9 +199,9 @@ resWareHouse.data.forEach(item => { const dateIndex = dates.indexOf(item.date); if (dateIndex !== -1) { if (item.warehouse === '7014') { if (item.warehouse === 7014) { data7014[dateIndex] = item.count; } else if (item.warehouse === '7016') { } else if (item.warehouse === 7016) { data7016[dateIndex] = item.count; } }