|
|
|
@ -208,9 +208,9 @@ public class QcPDAServiceImpl implements IQcPDAService {
|
|
|
|
|
// 更新主记录
|
|
|
|
|
if (isUnqualified){
|
|
|
|
|
bo.setQualifiedQty(new BigDecimal(0));
|
|
|
|
|
bo.setUnqualifiedQty(main.getQualifiedQty());
|
|
|
|
|
bo.setUnqualifiedQty(main.getInspectionQty());
|
|
|
|
|
} else {
|
|
|
|
|
bo.setQualifiedQty(main.getQualifiedQty());
|
|
|
|
|
bo.setQualifiedQty(main.getInspectionQty());
|
|
|
|
|
bo.setUnqualifiedQty(new BigDecimal(0));
|
|
|
|
|
}
|
|
|
|
|
bo.setInspector(username);
|
|
|
|
@ -223,13 +223,14 @@ public class QcPDAServiceImpl implements IQcPDAService {
|
|
|
|
|
String unqualifiedReviewNo = remoteCodeRuleService.selectCodeRuleCode("4");
|
|
|
|
|
// 构建一个新的不合格评审业务对象
|
|
|
|
|
QcUnqualifiedReviewBo reviewBo = new QcUnqualifiedReviewBo();
|
|
|
|
|
// 关联原检验单号,质检单号
|
|
|
|
|
BeanUtils.copyProperties(bo, reviewBo);
|
|
|
|
|
// 设置不合格检测单号
|
|
|
|
|
reviewBo.setUnqualifiedReviewNo(unqualifiedReviewNo);
|
|
|
|
|
// 关联原检验单号,质检单号
|
|
|
|
|
reviewBo.setInspectionNo(main.getInspectionNo());
|
|
|
|
|
BeanUtils.copyProperties(bo, reviewBo);
|
|
|
|
|
String inspectionNo = main.getInspectionNo();
|
|
|
|
|
reviewBo.setInspectionNo(inspectionNo);
|
|
|
|
|
// 复制检验类型信息
|
|
|
|
|
// reviewBo.setInspectionType(main.getInspectionType());
|
|
|
|
|
reviewBo.setInspectionType(main.getInspectionType());
|
|
|
|
|
// 关联生产工单号
|
|
|
|
|
reviewBo.setWorkOrderNo(main.getProductionOrder());
|
|
|
|
|
// 复制工序名称
|
|
|
|
@ -251,39 +252,42 @@ public class QcPDAServiceImpl implements IQcPDAService {
|
|
|
|
|
for (QcInspectionResultBo resultBo : bo.getResults()) {
|
|
|
|
|
if ("1".equals(resultBo.getDetectResult())) {//检测结果(0合格,1不合格,2未判定)
|
|
|
|
|
// 创建一条不合格明细记录对象
|
|
|
|
|
Long resultId = resultBo.getResultId();
|
|
|
|
|
// 根据结果ID查询已有的结果详情
|
|
|
|
|
QcInspectionResultVo existingResult = qcInspectionResultService.queryById(resultId);
|
|
|
|
|
QcUnqualifiedRecordBo recordBo = new QcUnqualifiedRecordBo();
|
|
|
|
|
// 关联所属的评审ID
|
|
|
|
|
recordBo.setReviewId(reviewBo.getReviewId());
|
|
|
|
|
BeanUtils.copyProperties(resultBo, recordBo);
|
|
|
|
|
// BeanUtils.copyProperties(resultBo, recordBo);
|
|
|
|
|
// 设置项目编码
|
|
|
|
|
recordBo.setItemCode(resultBo.getItemCode());
|
|
|
|
|
recordBo.setItemCode(existingResult.getItemCode());
|
|
|
|
|
// 设置项目名称
|
|
|
|
|
recordBo.setItemName(resultBo.getItemName());
|
|
|
|
|
recordBo.setItemName(existingResult.getItemName());
|
|
|
|
|
// 设置检验位置
|
|
|
|
|
recordBo.setInspectionPosition(resultBo.getInspectionPosition());
|
|
|
|
|
recordBo.setInspectionPosition(existingResult.getInspectionPosition());
|
|
|
|
|
// 转换分类名称为Long类型并设置
|
|
|
|
|
recordBo.setCategoryName(resultBo.getCategoryName());
|
|
|
|
|
recordBo.setCategoryName(existingResult.getCategoryName());
|
|
|
|
|
// 设置类型ID
|
|
|
|
|
recordBo.setTypeId(resultBo.getTypeId());
|
|
|
|
|
recordBo.setTypeId(existingResult.getTypeId());
|
|
|
|
|
// recordBo.setInspectionMethod(); // 如果需要可补充检验方法字段
|
|
|
|
|
// 设置检测类型
|
|
|
|
|
recordBo.setDetectType(resultBo.getDetectType());
|
|
|
|
|
recordBo.setDetectType(existingResult.getDetectType());
|
|
|
|
|
// 设置检测结果(是否合格)
|
|
|
|
|
recordBo.setDetectResult(resultBo.getDetectResult());
|
|
|
|
|
recordBo.setDetectResult(existingResult.getDetectResult());
|
|
|
|
|
// 设置检测的具体数值
|
|
|
|
|
recordBo.setDetectValue(resultBo.getDetectValue());
|
|
|
|
|
recordBo.setDetectValue(existingResult.getDetectValue());
|
|
|
|
|
// 设置上限标准值
|
|
|
|
|
recordBo.setUpperLimit(resultBo.getUpperLimit());
|
|
|
|
|
recordBo.setUpperLimit(existingResult.getUpperLimit());
|
|
|
|
|
// 设置下限标准值
|
|
|
|
|
recordBo.setLowerLimit(resultBo.getLowerLimit());
|
|
|
|
|
recordBo.setLowerLimit(existingResult.getLowerLimit());
|
|
|
|
|
// 调整规格名称作为特殊检验值存储
|
|
|
|
|
recordBo.setSpecInspectionValue(resultBo.getSpecName()); // Adjust
|
|
|
|
|
recordBo.setSpecInspectionValue(existingResult.getSpecName()); // Adjust
|
|
|
|
|
// 设置规格上限
|
|
|
|
|
recordBo.setSpecUpper(resultBo.getSpecUpper());
|
|
|
|
|
recordBo.setSpecUpper(existingResult.getSpecUpper());
|
|
|
|
|
// 设置规格下限
|
|
|
|
|
recordBo.setSpecLower(resultBo.getSpecLower());
|
|
|
|
|
recordBo.setSpecLower(existingResult.getSpecLower());
|
|
|
|
|
// 设置相关描述信息
|
|
|
|
|
recordBo.setDescription(resultBo.getDescription());
|
|
|
|
|
recordBo.setDescription(existingResult.getDescription());
|
|
|
|
|
|
|
|
|
|
// 插入不合格明细记录到数据库
|
|
|
|
|
qcUnqualifiedRecordService.insertByBo(recordBo);
|
|
|
|
|