改成批量

This commit is contained in:
lihao 2025-12-15 19:27:12 +08:00
parent 47e1e4139a
commit 6e80829c4d
1 changed files with 9 additions and 1 deletions

View File

@ -367,6 +367,7 @@ public class WrResource extends AbstractNCCRestResource {
}
vo.setChildren(WrItemVO.class, items.toArray(new WrItemVO[0]));
voList.add(vo);
}
IAPIWrMaintain server = NCLocator.getInstance().lookup(IAPIWrMaintain.class);
List<AggWrVO> aggWrVOS = TransferCodeToPKTool.transferAggVO(voList);
// 翻译报告类型
@ -439,11 +440,14 @@ public class WrResource extends AbstractNCCRestResource {
}
}
if (successFlag) {
// if(aggvos.length!=voList.size()){
// throw new BusinessException("保存失败,请检查数据是否符合要求!");
// }
return ResultMessageUtil.toJSON(aggvos, "生产报告保存成功");
} else {
ExceptionUtils.wrappBusinessException(errMsg.toString());
}
}
} catch (Exception e) {
return ResultMessageUtil.exceptionToJSON(e);
}
@ -571,6 +575,7 @@ public class WrResource extends AbstractNCCRestResource {
}
AggWrVO[] aggvos = server.update(voList.toArray(new AggWrVO[0]));
boolean successFlag = true;
StringBuilder errMsg = new StringBuilder();
if (MMArrayUtil.isNotEmpty(aggvos)) {
@ -588,6 +593,9 @@ public class WrResource extends AbstractNCCRestResource {
}
}
if (successFlag) {
// if(aggvos.length!=voList.size()){
// throw new BusinessException("保存失败,请检查数据是否符合要求!");
// }
return ResultMessageUtil.toJSON(aggvos, "生产报告修改成功");
} else {
ExceptionUtils.wrappBusinessException(errMsg.toString());