|
|
|
@ -578,17 +578,31 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
|
|
|
|
|
List<ProOrderWorkorder> proOrderWorkorderList = new ArrayList<ProOrderWorkorder>();
|
|
|
|
|
// 查询该工单信息
|
|
|
|
|
ProOrderWorkorder proOrderWorkorder = proOrderWorkorderMapper.selectWorkOrderByCode(code);
|
|
|
|
|
proOrderWorkorderList.add(proOrderWorkorder);
|
|
|
|
|
boolean flag = true;
|
|
|
|
|
|
|
|
|
|
// 临时存放parentCode
|
|
|
|
|
StringBuilder tempCode = new StringBuilder();
|
|
|
|
|
tempCode.append(proOrderWorkorder.getParentOrder());
|
|
|
|
|
|
|
|
|
|
while (flag) {
|
|
|
|
|
proOrderWorkorderList.add(proOrderWorkorder);
|
|
|
|
|
ProOrderWorkorder workorder = proOrderWorkorderMapper.selectWorkOrderByCode(proOrderWorkorder.getParentOrder());
|
|
|
|
|
ProOrderWorkorder workorder = proOrderWorkorderMapper.selectWorkOrderByCode(tempCode.toString());
|
|
|
|
|
if (workorder != null) {
|
|
|
|
|
BeanUtils.copyProperties(workorder,proOrderWorkorder);
|
|
|
|
|
proOrderWorkorderList.add(workorder);
|
|
|
|
|
tempCode.setLength(0);
|
|
|
|
|
tempCode.append(workorder.getParentOrder());
|
|
|
|
|
} else {
|
|
|
|
|
flag = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return success(proOrderWorkorderList);
|
|
|
|
|
|
|
|
|
|
// 反转list
|
|
|
|
|
List<ProOrderWorkorder> reversalWorkOrderList = new ArrayList<>();
|
|
|
|
|
for (int i = proOrderWorkorderList.size()-1; i >= 0; i--) {
|
|
|
|
|
reversalWorkOrderList.add(proOrderWorkorderList.get(i));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return success(reversalWorkOrderList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|