Merge remote-tracking branch 'origin/0.8.X' into 0.8.X

This commit is contained in:
朱昊天
2026-07-10 17:25:44 +08:00
7 changed files with 62 additions and 19 deletions

View File

@@ -220,7 +220,6 @@ export default {
this.labelRender.visible = true;
this.labelRender.data = {
...row,
itemName: itemName,
updateTime: row.updateTime?.split(' ')[0] || '',
};
},

View File

@@ -21,9 +21,12 @@
<el-form-item label="当前钢卷号" prop="currentCoilNo">
<el-input v-model="queryParams.currentCoilNo" placeholder="请输入当前钢卷号" clearable />
</el-form-item>
<el-form-item label="逻辑库区" prop="warehouseId">
<el-form-item label="出炉库区" prop="warehouseId">
<WarehouseSelect v-model="queryParams.warehouseId" placeholder="请选择" clearable filterable />
</el-form-item>
<el-form-item label="逻辑库区" prop="coilWarehouseId">
<WarehouseSelect v-model="queryParams.coilWarehouseId" placeholder="请选择" clearable filterable />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -56,6 +59,7 @@
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row" />
</template>
</el-table-column>
<el-table-column label="出炉库区" prop="logicWarehouseName" align="center" />
<el-table-column label="逻辑库区" prop="warehouseName" align="center" />
<el-table-column label="入场钢卷号" prop="enterCoilNo" align="center" />
<el-table-column label="当前钢卷号" prop="currentCoilNo" align="center" />
@@ -100,9 +104,12 @@ export default {
queryParams: {
startTime,
endTime,
currentCoilNo: undefined,
targetFurnaceId: undefined,
planNo: undefined,
enterCoilNo: undefined,
warehouseId: undefined,
coilWarehouseId: undefined,
},
summary: {},
detailList: [],
@@ -142,7 +149,6 @@ export default {
}
}) || []
}).flat();
console.log(this.detailList);
this.loading = false;
}).catch(() => {
this.loading = false;

View File

@@ -86,7 +86,7 @@
<el-table-column label="考勤编号" align="center" prop="sn" />
<el-table-column label="打卡时间" align="center" prop="checktime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.checktime, '{y}-{m}-{d}') }}</span>
<span>{{ parseTime(scope.row.checktime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="验证状态" align="center" prop="verify" />

View File

@@ -35,6 +35,9 @@ public class WmsAnnealPerformanceBo {
// 当前钢卷号
private String currentCoilNo;
// 逻辑库区id
// 逻辑库区id出炉时的逻辑库区对应wms_furnace_plan_coil.logic_warehouse_id
private Long warehouseId;
// 钢卷所在库区id钢卷本身的逻辑库区对应wms_material_coil.warehouse_id
private Long coilWarehouseId;
}

View File

@@ -15,6 +15,8 @@ import com.klp.domain.bo.AttendanceRecordsBo;
import com.klp.domain.vo.AttendanceRecordsVo;
import com.klp.domain.AttendanceRecords;
import com.klp.mapper.AttendanceRecordsMapper;
import com.klp.mapper.WmsEmployeeInfoMapper;
import com.klp.domain.WmsEmployeeInfo;
import com.klp.service.IAttendanceRecordsService;
import javax.servlet.http.HttpServletResponse;
@@ -35,6 +37,7 @@ public class AttendanceRecordsServiceImpl implements IAttendanceRecordsService {
private static final Logger log = LoggerFactory.getLogger(AttendanceRecordsServiceImpl.class);
private final AttendanceRecordsMapper baseMapper;
private final WmsEmployeeInfoMapper wmsEmployeeInfoMapper;
@Override
public AttendanceRecordsVo queryById(Integer id) {
@@ -134,6 +137,23 @@ public class AttendanceRecordsServiceImpl implements IAttendanceRecordsService {
lqw.orderByAsc(AttendanceRecords::getPin).orderByAsc(AttendanceRecords::getChecktime);
List<AttendanceRecords> records = baseMapper.selectList(lqw);
// 从 wms_employee_info 获取正确的部门(打卡机里的部门可能不准)
Set<String> names = records.stream()
.map(AttendanceRecords::getEname)
.filter(StringUtils::isNotBlank)
.collect(Collectors.toSet());
final Map<String, String> nameDeptMap = new HashMap<>();
if (!names.isEmpty()) {
List<WmsEmployeeInfo> empList = wmsEmployeeInfoMapper.selectList(
Wrappers.<WmsEmployeeInfo>lambdaQuery()
.select(WmsEmployeeInfo::getName, WmsEmployeeInfo::getDept)
.in(WmsEmployeeInfo::getName, names)
);
empList.stream()
.filter(e -> StringUtils.isNotBlank(e.getName()) && StringUtils.isNotBlank(e.getDept()))
.forEach(e -> nameDeptMap.put(e.getName(), e.getDept()));
}
// 3. 按员工分组,再按日期分组
// key: pin, value: 员工信息 + 按天分组的打卡记录
LinkedHashMap<String, EmployeeAttendance> employeeMap = new LinkedHashMap<>();
@@ -145,7 +165,7 @@ public class AttendanceRecordsServiceImpl implements IAttendanceRecordsService {
EmployeeAttendance e = new EmployeeAttendance();
e.pin = r.getPin();
e.ename = r.getEname();
e.deptname = r.getDeptname();
e.deptname = nameDeptMap.getOrDefault(r.getEname(), r.getDeptname());
e.dailyRecords = new TreeMap<>();
return e;
});

View File

@@ -118,7 +118,16 @@ public class WmsAnnealPerformanceServiceImpl implements IWmsAnnealPerformanceSer
continue;
}
// 为每个钢卷设置逻辑库区ID、层级和钢卷信息
// 设置出炉时的逻辑库区到detail级别取第一个非空的logicWarehouseId
for (WmsFurnacePlanCoil planCoil : planCoils) {
if (planCoil.getLogicWarehouseId() != null) {
detail.setLogicWarehouseId(planCoil.getLogicWarehouseId());
detail.setLogicWarehouseName(logicWarehouseNameMap.get(planCoil.getLogicWarehouseId()));
break;
}
}
// 为每个钢卷设置炉火层级和钢卷信息(不覆盖钢卷本身的逻辑库区)
List<WmsMaterialCoilVo> coilVos = new ArrayList<>();
for (WmsFurnacePlanCoil planCoil : planCoils) {
Long coilId = planCoil.getCoilId();
@@ -132,11 +141,8 @@ public class WmsAnnealPerformanceServiceImpl implements IWmsAnnealPerformanceSer
coilVo.setCoilId(coilId);
}
// 设置逻辑库区ID和层级每个钢卷可能不同
if (planCoil.getLogicWarehouseId() != null) {
coilVo.setWarehouseId(planCoil.getLogicWarehouseId());
coilVo.setWarehouseName(logicWarehouseNameMap.get(planCoil.getLogicWarehouseId()));
}
// 保持钢卷本身的warehouseId/warehouseName不变不覆盖
// 设置炉火层级
coilVo.setFurnaceLevel(planCoil.getFurnaceLevel());
@@ -153,9 +159,10 @@ public class WmsAnnealPerformanceServiceImpl implements IWmsAnnealPerformanceSer
continue; // 跳过不匹配的钢卷
}
}
if (bo.getWarehouseId() != null) {
// 钢卷本身的逻辑库区筛选coilVo.warehouseId保持不变
if (bo.getCoilWarehouseId() != null) {
if (coilVo.getWarehouseId() == null ||
!coilVo.getWarehouseId().equals(bo.getWarehouseId())) {
!coilVo.getWarehouseId().equals(bo.getCoilWarehouseId())) {
continue; // 跳过不匹配的钢卷
}
}
@@ -178,8 +185,11 @@ public class WmsAnnealPerformanceServiceImpl implements IWmsAnnealPerformanceSer
// 移除没有钢卷的计划
details.removeIf(detail -> detail.getCoils() == null || detail.getCoils().isEmpty());
// 如果传入了enterCoilNo筛选条件,重新计算统计信息
if (bo.getEnterCoilNo() != null && !bo.getEnterCoilNo().isEmpty()) {
// 如果传入了筛选条件,重新计算统计信息
if ((bo.getEnterCoilNo() != null && !bo.getEnterCoilNo().isEmpty())
|| (bo.getCurrentCoilNo() != null && !bo.getCurrentCoilNo().isEmpty())
|| bo.getWarehouseId() != null
|| bo.getCoilWarehouseId() != null) {
summary.setPlanCount(filteredPlanCount);
summary.setCoilCount(filteredCoilCount);
summary.setTotalWeight(filteredTotalWeight);

View File

@@ -20,12 +20,17 @@
<if test="enterCoilNo != null and enterCoilNo != ''">
AND mc.enter_coil_no LIKE CONCAT('%', #{enterCoilNo}, '%')
</if>
<!-- 当前钢卷号和逻辑库区id匹配 -->
<!-- 当前钢卷号匹配 -->
<if test="currentCoilNo != null and currentCoilNo != ''">
AND mc.current_coil_no LIKE CONCAT('%', #{currentCoilNo}, '%')
</if>
<!-- 出炉时的逻辑库区筛选wms_furnace_plan_coil.logic_warehouse_id -->
<if test="warehouseId != null">
AND mc.warehouse_id = #{warehouseId}
AND pc.logic_warehouse_id = #{warehouseId}
</if>
<!-- 钢卷本身的逻辑库区筛选wms_material_coil.warehouse_id -->
<if test="coilWarehouseId != null">
AND mc.warehouse_id = #{coilWarehouseId}
</if>
</where>
</sql>
@@ -49,7 +54,7 @@
p.end_time AS endTime
FROM wms_furnace_plan p
LEFT JOIN wms_furnace f ON f.furnace_id = p.target_furnace_id
<if test="enterCoilNo != null and enterCoilNo != '' or currentCoilNo != null and currentCoilNo != '' or warehouseId != null">
<if test="enterCoilNo != null and enterCoilNo != '' or currentCoilNo != null and currentCoilNo != '' or warehouseId != null or coilWarehouseId != null">
INNER JOIN wms_furnace_plan_coil pc ON pc.plan_id = p.plan_id AND pc.del_flag = 0
INNER JOIN wms_material_coil mc ON mc.coil_id = pc.coil_id AND mc.del_flag = 0
</if>