OSDN Git Service

refactoring
[open-pdm-light/PartList.git] / PartsList / PartsList / app / controllers / services / PartsList.scala
index b2c8843..a22eeea 100644 (file)
@@ -7,9 +7,9 @@ import models.services._
 case class PartsList() {
        def getPartsBuffer(opt:Int, page:Int, key:String, relationKey:String):ArrayBuffer[PartsListShowBean] = {
                var partsBuffer = ArrayBuffer[PartsListShowBean]()
-               val targetPart = PartManager().getByName(key)
-               if(targetPart != null) {
-                 for(returnPartBuffer <- PartRecursion().down(PartManager().getByName(key), 1, opt, relationKey)) {
+               val targetParts = PartManager().getByName(key)
+               if(targetParts.size != 0) {
+                 for(returnPartBuffer <- PartRecursion().down(PartManager().getByName(key).head, 1, opt, relationKey)) {
                    partsBuffer += returnPartBuffer
                  }
                }
@@ -40,7 +40,7 @@ case class PartsList() {
                                }
              }
                 // 表示制御済みの部品表配列を蓄積
-                matrixPartsListBeans.put(PartManager().getByName(partsListBean.head.parent), allChildrenList)
+                matrixPartsListBeans.put(PartManager().getByName(partsListBean.head.parent).head, allChildrenList)
            } else {
              for(allChild <- allChildrenList) {
                allChild.showOn = 0