计划模块(工单打印逻辑顺序BUG解决)

highway
wws 1 year ago
parent 0f372dae51
commit 5aa0d0c640

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

Loading…
Cancel
Save