|
|
|
@ -147,33 +147,41 @@ public class QcInspectionItemServiceImpl implements IQcInspectionItemService {
|
|
|
|
|
QcInspectionItem update = MapstructUtils.convert(bo, QcInspectionItem.class);
|
|
|
|
|
validEntityBeforeSave(update);
|
|
|
|
|
|
|
|
|
|
// 创建一个新的QcTemplateItemBo对象
|
|
|
|
|
QcTemplateItem qcTemplateItem = new QcTemplateItem();
|
|
|
|
|
QcTemplateItemVo newQcTemplateItem = qcTemplateItemMapper.selectQcTemplateItemByItemId(update.getItemId());
|
|
|
|
|
newQcTemplateItem.setItemCode(update.getItemCode());
|
|
|
|
|
newQcTemplateItem.setItemName(update.getItemName());
|
|
|
|
|
newQcTemplateItem.setInspectionItemCode(update.getItemCode());
|
|
|
|
|
newQcTemplateItem.setInspectionItemName(update.getItemName());
|
|
|
|
|
newQcTemplateItem.setInspectionPosition(update.getInspectionPosition());
|
|
|
|
|
newQcTemplateItem.setCategoryName(update.getCategoryName());
|
|
|
|
|
newQcTemplateItem.setInspectionType(update.getInspectionType());
|
|
|
|
|
newQcTemplateItem.setDetectType(update.getDetectType());
|
|
|
|
|
newQcTemplateItem.setControlType(update.getControlType());
|
|
|
|
|
newQcTemplateItem.setStandardValue(update.getStandardValue());
|
|
|
|
|
newQcTemplateItem.setUpperLimit(update.getUpperLimit());
|
|
|
|
|
newQcTemplateItem.setLowerLimit(update.getLowerLimit());
|
|
|
|
|
newQcTemplateItem.setSpecName(update.getSpecName());
|
|
|
|
|
newQcTemplateItem.setSpecUpper(update.getSpecUpper());
|
|
|
|
|
newQcTemplateItem.setSpecLower(update.getSpecLower());
|
|
|
|
|
newQcTemplateItem.setDescription(update.getDescription());
|
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(newQcTemplateItem, qcTemplateItem);
|
|
|
|
|
// qcTemplateItemService.updateByBo(qcTemplateItemBo);
|
|
|
|
|
qcTemplateItemMapper.updateById(qcTemplateItem);
|
|
|
|
|
/*修改检测项定义同步模板子表内容*/
|
|
|
|
|
updateQcTemplateItem(update);
|
|
|
|
|
|
|
|
|
|
return baseMapper.updateById(update) > 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 修改检测项定义时同步更新检测模板子表内容
|
|
|
|
|
* @param update 检测项定义实体
|
|
|
|
|
*/
|
|
|
|
|
private void updateQcTemplateItem(QcInspectionItem update) {
|
|
|
|
|
// 创建一个新的QcTemplateItemBo对象
|
|
|
|
|
QcTemplateItem qcTemplateItem = new QcTemplateItem();
|
|
|
|
|
QcTemplateItemVo oldQcTemplateItem = qcTemplateItemMapper.selectQcTemplateItemByItemId(update.getItemId());
|
|
|
|
|
oldQcTemplateItem.setItemCode(update.getItemCode());
|
|
|
|
|
oldQcTemplateItem.setItemName(update.getItemName());
|
|
|
|
|
oldQcTemplateItem.setInspectionItemCode(update.getItemCode());
|
|
|
|
|
oldQcTemplateItem.setInspectionItemName(update.getItemName());
|
|
|
|
|
oldQcTemplateItem.setInspectionPosition(update.getInspectionPosition());
|
|
|
|
|
oldQcTemplateItem.setCategoryName(update.getCategoryName());
|
|
|
|
|
oldQcTemplateItem.setInspectionType(update.getInspectionType());
|
|
|
|
|
oldQcTemplateItem.setDetectType(update.getDetectType());
|
|
|
|
|
oldQcTemplateItem.setControlType(update.getControlType());
|
|
|
|
|
oldQcTemplateItem.setStandardValue(update.getStandardValue());
|
|
|
|
|
oldQcTemplateItem.setUpperLimit(update.getUpperLimit());
|
|
|
|
|
oldQcTemplateItem.setLowerLimit(update.getLowerLimit());
|
|
|
|
|
oldQcTemplateItem.setSpecName(update.getSpecName());
|
|
|
|
|
oldQcTemplateItem.setSpecUpper(update.getSpecUpper());
|
|
|
|
|
oldQcTemplateItem.setSpecLower(update.getSpecLower());
|
|
|
|
|
oldQcTemplateItem.setDescription(update.getDescription());
|
|
|
|
|
BeanUtils.copyProperties(oldQcTemplateItem, qcTemplateItem);
|
|
|
|
|
qcTemplateItemMapper.updateById(qcTemplateItem);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 保存前的数据校验
|
|
|
|
|
*/
|
|
|
|
@ -195,4 +203,5 @@ public class QcInspectionItemServiceImpl implements IQcInspectionItemService {
|
|
|
|
|
}
|
|
|
|
|
return baseMapper.deleteByIds(ids) > 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|