|
|
|
@ -1045,8 +1045,8 @@ public class InspectionRequestServiceImpl extends ServiceImpl<InspectionRequestH |
|
|
|
String targetStatus; |
|
|
|
String targetStatusDb; |
|
|
|
String targetRemark; |
|
|
|
if ("Audited".equals(currentStatusDb)) { |
|
|
|
// 已下达 -> 草稿(允许重新编辑)- rqrq |
|
|
|
if ("Confirmed".equals(currentStatusDb) || "Audited".equals(currentStatusDb)) { |
|
|
|
// 待审核/已下达 -> 草稿(未进入排程,无需走变更审批)- rqrq |
|
|
|
targetStatus = "草稿"; |
|
|
|
targetStatusDb = "Draft"; |
|
|
|
targetRemark = header.getRemark(); |
|
|
|
@ -1056,7 +1056,7 @@ public class InspectionRequestServiceImpl extends ServiceImpl<InspectionRequestH |
|
|
|
targetStatusDb = "ChangeApplying"; |
|
|
|
targetRemark = buildChangeApplyRemark(changeRemark); |
|
|
|
} else { |
|
|
|
throw new RuntimeException("只有已下达或已排程状态允许申请变更,当前状态:" + header.getStatus()); |
|
|
|
throw new RuntimeException("只有待审核、已下达或已排程状态允许申请变更,当前状态:" + header.getStatus()); |
|
|
|
} |
|
|
|
|
|
|
|
// 3) 回写主表状态与备注 - rqrq |
|
|
|
@ -1065,12 +1065,13 @@ public class InspectionRequestServiceImpl extends ServiceImpl<InspectionRequestH |
|
|
|
new LambdaUpdateWrapper<InspectionRequestHeader>() |
|
|
|
.eq(InspectionRequestHeader::getSite, site) |
|
|
|
.eq(InspectionRequestHeader::getRequestNo, requestNo) |
|
|
|
.eq(InspectionRequestHeader::getStatusDb, currentStatusDb) |
|
|
|
.set(InspectionRequestHeader::getStatus, targetStatus) |
|
|
|
.set(InspectionRequestHeader::getStatusDb, targetStatusDb) |
|
|
|
.set(InspectionRequestHeader::getRemark, targetRemark) |
|
|
|
); |
|
|
|
if (headerUpdateCount == 0) { |
|
|
|
throw new RuntimeException("申请变更失败,主表状态未更新"); |
|
|
|
throw new RuntimeException("申请单状态已变化,请刷新后重试"); |
|
|
|
} |
|
|
|
|
|
|
|
// 4) 同步明细状态,保证主从状态一致 - rqrq |
|
|
|
|