feat(qc): 质量评审模块增加库区管理功能
1. 为钢卷评审实体类新增改判前后逻辑库区相关字段 2. 新增数据库迁移脚本添加库区字段到qc_quality_review_coil表 3. 移除硬编码的技术部库区逻辑,改为支持手动指定目标库区 4. 在前端页面新增库区展示列和改判后库区选择器 5. 自动带出钢卷当前库区信息
This commit is contained in:
@@ -55,9 +55,21 @@ public class QcQualityReviewCoil extends BaseEntity {
|
||||
/** 改判前质量等级 */
|
||||
private String beforeQuality;
|
||||
|
||||
/** 改判前逻辑库区ID */
|
||||
private Long beforeWarehouseId;
|
||||
|
||||
/** 改判前逻辑库区名称 */
|
||||
private String beforeWarehouseName;
|
||||
|
||||
/** 改判后质量状态(字典:regrade_quality_type) */
|
||||
private String regradeQuality;
|
||||
|
||||
/** 改判后目标库区ID */
|
||||
private Long targetWarehouseId;
|
||||
|
||||
/** 改判后目标库区名称 */
|
||||
private String targetWarehouseName;
|
||||
|
||||
/** 执行状态:0=待执行 1=已执行 */
|
||||
private Long executeStatus;
|
||||
|
||||
|
||||
@@ -55,9 +55,21 @@ public class QcQualityReviewCoilBo extends BaseEntity {
|
||||
/** 改判前质量等级 */
|
||||
private String beforeQuality;
|
||||
|
||||
/** 改判前逻辑库区ID */
|
||||
private Long beforeWarehouseId;
|
||||
|
||||
/** 改判前逻辑库区名称 */
|
||||
private String beforeWarehouseName;
|
||||
|
||||
/** 改判后质量状态 */
|
||||
private String regradeQuality;
|
||||
|
||||
/** 改判后目标库区ID */
|
||||
private Long targetWarehouseId;
|
||||
|
||||
/** 改判后目标库区名称 */
|
||||
private String targetWarehouseName;
|
||||
|
||||
/** 执行状态 */
|
||||
private Long executeStatus;
|
||||
|
||||
|
||||
@@ -53,9 +53,21 @@ public class QcQualityReviewCoilVo extends BaseEntity {
|
||||
/** 改判前质量等级 */
|
||||
private String beforeQuality;
|
||||
|
||||
/** 改判前逻辑库区ID */
|
||||
private Long beforeWarehouseId;
|
||||
|
||||
/** 改判前逻辑库区名称 */
|
||||
private String beforeWarehouseName;
|
||||
|
||||
/** 改判后质量状态 */
|
||||
private String regradeQuality;
|
||||
|
||||
/** 改判后目标库区ID */
|
||||
private Long targetWarehouseId;
|
||||
|
||||
/** 改判后目标库区名称 */
|
||||
private String targetWarehouseName;
|
||||
|
||||
/** 执行状态 */
|
||||
private Long executeStatus;
|
||||
|
||||
|
||||
@@ -11,7 +11,9 @@ import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import com.klp.common.helper.LoginHelper;
|
||||
import com.klp.domain.WmsMaterialCoil;
|
||||
import com.klp.domain.WmsWarehouse;
|
||||
import com.klp.mapper.WmsMaterialCoilMapper;
|
||||
import com.klp.mapper.WmsWarehouseMapper;
|
||||
import com.klp.service.IWmsMaterialCoilService;
|
||||
import com.klp.mes.qc.domain.QcQualityReview;
|
||||
import com.klp.mes.qc.domain.QcQualityReviewCoil;
|
||||
@@ -43,13 +45,11 @@ import java.util.*;
|
||||
@Service
|
||||
public class QcQualityReviewServiceImpl implements IQcQualityReviewService {
|
||||
|
||||
/** 技术部逻辑库ID(C/D级改判后移入此库区) */
|
||||
private static final Long TECH_WAREHOUSE_ID = 2019583656787259393L;
|
||||
|
||||
private final QcQualityReviewMapper baseMapper;
|
||||
private final QcQualityReviewCoilMapper coilMapper;
|
||||
private final QcQualityReviewLogMapper logMapper;
|
||||
private final WmsMaterialCoilMapper wmsMaterialCoilMapper;
|
||||
private final WmsWarehouseMapper wmsWarehouseMapper;
|
||||
private final IWmsMaterialCoilService wmsMaterialCoilService;
|
||||
|
||||
/**
|
||||
@@ -313,12 +313,11 @@ public class QcQualityReviewServiceImpl implements IQcQualityReviewService {
|
||||
coil.getCoilId(), coil.getRegradeQuality(), reason);
|
||||
}
|
||||
|
||||
// 2. 根据改判后质量等级自动更新钢卷所在逻辑库区
|
||||
Long targetWarehouseId = determineTargetWarehouse(coil.getRegradeQuality());
|
||||
if (targetWarehouseId != null && coil.getCoilId() != null) {
|
||||
// 2. 使用手动指定的目标逻辑库区更新钢卷所在库区
|
||||
if (coil.getTargetWarehouseId() != null && coil.getCoilId() != null) {
|
||||
wmsMaterialCoilMapper.update(null, Wrappers.<WmsMaterialCoil>lambdaUpdate()
|
||||
.eq(WmsMaterialCoil::getCoilId, coil.getCoilId())
|
||||
.set(WmsMaterialCoil::getWarehouseId, targetWarehouseId));
|
||||
.set(WmsMaterialCoil::getWarehouseId, coil.getTargetWarehouseId()));
|
||||
}
|
||||
|
||||
// 3. 更新明细执行状态
|
||||
@@ -359,10 +358,12 @@ public class QcQualityReviewServiceImpl implements IQcQualityReviewService {
|
||||
coil.setGroupSeq(seq);
|
||||
}
|
||||
// 若未传改判前质量等级,从钢卷表获取
|
||||
if (StringUtils.isBlank(coil.getBeforeQuality()) && coil.getCoilId() != null) {
|
||||
if (coil.getCoilId() != null) {
|
||||
WmsMaterialCoil wmsCoil = wmsMaterialCoilMapper.selectById(coil.getCoilId());
|
||||
if (wmsCoil != null) {
|
||||
coil.setBeforeQuality(wmsCoil.getQualityStatus());
|
||||
if (StringUtils.isBlank(coil.getBeforeQuality())) {
|
||||
coil.setBeforeQuality(wmsCoil.getQualityStatus());
|
||||
}
|
||||
if (StringUtils.isBlank(coil.getCurrentCoilNo())) {
|
||||
coil.setCurrentCoilNo(wmsCoil.getCurrentCoilNo());
|
||||
}
|
||||
@@ -372,6 +373,14 @@ public class QcQualityReviewServiceImpl implements IQcQualityReviewService {
|
||||
if (coil.getNetWeight() == null) {
|
||||
coil.setNetWeight(wmsCoil.getNetWeight());
|
||||
}
|
||||
// 自动带出当前逻辑库区
|
||||
if (coil.getBeforeWarehouseId() == null && wmsCoil.getWarehouseId() != null) {
|
||||
coil.setBeforeWarehouseId(wmsCoil.getWarehouseId());
|
||||
WmsWarehouse wh = wmsWarehouseMapper.selectById(wmsCoil.getWarehouseId());
|
||||
if (wh != null) {
|
||||
coil.setBeforeWarehouseName(wh.getWarehouseName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
coilMapper.insert(coil);
|
||||
@@ -402,23 +411,6 @@ public class QcQualityReviewServiceImpl implements IQcQualityReviewService {
|
||||
return "QR-" + dateStr + "-" + String.format("%04d", count + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据改判后质量等级确定目标逻辑库区
|
||||
* O/A/B → 不移动,C+/C/C- → 技术部逻辑库,D+/D/D- → 技术部逻辑库
|
||||
*/
|
||||
private Long determineTargetWarehouse(String regradeQuality) {
|
||||
if (regradeQuality == null) return null;
|
||||
// O/A/B 级不移动
|
||||
if ("O".equals(regradeQuality) || "A".equals(regradeQuality) || "B".equals(regradeQuality)) {
|
||||
return null;
|
||||
}
|
||||
// C/D 级 → 技术部逻辑库
|
||||
if (regradeQuality.startsWith("C") || regradeQuality.startsWith("D")) {
|
||||
return TECH_WAREHOUSE_ID;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void validEntityBeforeSave(QcQualityReview entity) {
|
||||
if (StringUtils.isBlank(entity.getProductName())) {
|
||||
throw new RuntimeException("产品名称不能为空");
|
||||
|
||||
@@ -16,7 +16,11 @@
|
||||
<result property="netWeight" column="net_weight"/>
|
||||
<result property="defectDesc" column="defect_desc"/>
|
||||
<result property="beforeQuality" column="before_quality"/>
|
||||
<result property="beforeWarehouseId" column="before_warehouse_id"/>
|
||||
<result property="beforeWarehouseName" column="before_warehouse_name"/>
|
||||
<result property="regradeQuality" column="regrade_quality"/>
|
||||
<result property="targetWarehouseId" column="target_warehouse_id"/>
|
||||
<result property="targetWarehouseName" column="target_warehouse_name"/>
|
||||
<result property="executeStatus" column="execute_status"/>
|
||||
<result property="executeTime" column="execute_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
|
||||
Reference in New Issue
Block a user