val designChangeBuffer = DesignChangeManager().getDesinChangeInformation(designChange)
if(dcSeq != 0) {
val delRelation = designChange.delPartRelation.where(pr => pr.dcSeq === dcSeq).head
- PartRecursion().up(delRelation.child.head, partBuffer, 1)
+ for(returnPartBuffer <- PartRecursion().up(delRelation.child.head, 1)) {
+ partBuffer += returnPartBuffer
+ }
}
Ok(views.html.updateDesignChangeForm(designChangeRegistForm.fill(designChangeForm), designChangeId, designChangeBuffer, designChange.addPartRelation, partBuffer, dcSeq, message))
}
var partBuffer = ArrayBuffer[PartsListBean]()
inTransaction {
for (childPart <- PartManager().getByLikeName(key)) {
- PartRecursion().up(childPart, partBuffer, opt)
+ for(returnPartBuffer <- PartRecursion().up(childPart, opt)) {
+ partBuffer += returnPartBuffer
+ }
}
}
val row = Integer.decode(Messages("list.row"))
var message:String = null
var partBuffer = ArrayBuffer[PartsListBean]()
for (parentPart <- PartsListDb.parts.where(p => p.name === child )) {
-// PartRecursion().down(parentPart, partBuffer, 1)
for(returnPartBuffer <- PartRecursion().down(parentPart, 1)) {
partBuffer += returnPartBuffer
}
// 親品番逆展開配列
var upPartBuffer = ArrayBuffer[PartsListBean]()
for (childPart <- PartsListDb.parts.where(p => p.name === parent)) {
- PartRecursion().up(childPart, upPartBuffer, 0)
+ for(returnPartBuffer <- PartRecursion().up(childPart, 0)) {
+ upPartBuffer += returnPartBuffer
+ }
}
// 部品表ループチェック
// 親品番=子品番 の場合エラー
import beans._
import scala.collection.mutable.ArrayBuffer
case class PartRecursion(){
-
-/* def down(parentPart: Part, partBuffer: ArrayBuffer[PartsListBean], opt: Int):Unit = {
- for(child <-parentPart.parts) {
- if(parentPart.partRelation(child.id).delDcId==0) {
- if(opt!=3 || opt==3 && child.name.startsWith("Unit")) {
- partBuffer += PartsListBean(parentPart.name, child.name, parentPart.partRelation(child.id).quantity)
- }
- if(opt==1 || opt==2 && !child.name.startsWith("Part") || opt==3) {
- PartRecursion().down(child, partBuffer, opt)
- }
- }
- }
- }*/
-
+
def down(parentPart: Part, opt: Int):ArrayBuffer[PartsListBean] = {
val partBuffer = ArrayBuffer[PartsListBean]()
for(child <-parentPart.parts) {
return partBuffer
}
- def up(childPart: Part, partBuffer: ArrayBuffer[PartsListBean], opt: Int):Unit = {
+ def up(childPart: Part, opt: Int): ArrayBuffer[PartsListBean] = {
+ val partBuffer = ArrayBuffer[PartsListBean]()
if(childPart.parentParts.size == 0 && opt == 2) {
partBuffer += PartsListBean("", childPart.name,0)
}
partBuffer += PartsListBean(childPart.name, parent.name, parent.partRelation(childPart.id).quantity)
}
if(opt != 1) {
- PartRecursion().up(parent, partBuffer, opt)
+ for(returnPartBuffer <- PartRecursion().up(parent, opt)) {
+ partBuffer += returnPartBuffer
+ }
}
}
}
-
+ return partBuffer
}
}
\ No newline at end of file
import scala.collection.mutable.ArrayBuffer
case class ReplyRecursion(){
-/* def down(reply: Reply, notifyBuffer: ArrayBuffer[NotifyBean], i: Int):Unit ={
- var level = i+1
- notifyBuffer += NotifyBean(level, reply.message, reply.user.assign(reply.user.head).name, reply.id, Messages("notify.state9"), reply.atachs)
- for( childReply <- reply.childReplies) {
- ReplyRecursion().down(childReply, notifyBuffer, level)
- }
- }*/
def down(reply: Reply, i: Int): ArrayBuffer[NotifyBean] ={
val notifyBuffer = ArrayBuffer[NotifyBean]()