File tree Expand file tree Collapse file tree
base/src/main/java/com/tinyengine/it/mcp/tools Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -384,16 +384,17 @@ public FileResult bulkCreate(List<Component> componentList) {
384384 if (queryComponent .isEmpty ()) {
385385 // 插入新记录
386386 Integer result = baseMapper .createComponent (component );
387- if (result == 1 ) {
388- MaterialComponent materialComponent = new MaterialComponent ();
389- materialComponent .setMaterialId (1 );
390- materialComponent .setComponentId (component .getId ());
391- baseMapper .createMaterialComponent (materialComponent );
392- MaterialHistoryComponent materialHistoryComponent = new MaterialHistoryComponent ();
393- materialHistoryComponent .setComponentId (component .getId ());
394- materialHistoryComponent .setMaterialHistoryId (1 );
395- baseMapper .createMaterialHistoryComponent (materialHistoryComponent );
387+ if (result != 1 ) {
388+ throw new IllegalStateException ("createComponent failed: " + result );
396389 }
390+ MaterialComponent materialComponent = new MaterialComponent ();
391+ materialComponent .setMaterialId (1 );
392+ materialComponent .setComponentId (component .getId ());
393+ baseMapper .createMaterialComponent (materialComponent );
394+ MaterialHistoryComponent materialHistoryComponent = new MaterialHistoryComponent ();
395+ materialHistoryComponent .setComponentId (component .getId ());
396+ materialHistoryComponent .setMaterialHistoryId (1 );
397+ baseMapper .createMaterialHistoryComponent (materialHistoryComponent );
397398 addNum = addNum + 1 ;
398399 } else {
399400 // 更新记录
You can’t perform that action at this time.
0 commit comments