This commit is contained in:
parent
ca208034b9
commit
96e6a56fab
|
|
@ -79,12 +79,20 @@ public class SyncGyMesPickmUtil {
|
|||
|
||||
// 场景1:原始单据不存在(新增单据)→ 所有子项都是新增,全部保留
|
||||
if (originVO == null) {
|
||||
// 修复:增加空值校验,避免null数组
|
||||
PickmItemVO[] allItems = (PickmItemVO[]) currentVO.getChildrenVO();
|
||||
modifiedItems.addAll(Arrays.asList(allItems));
|
||||
if (allItems != null) {
|
||||
modifiedItems.addAll(Arrays.asList(allItems));
|
||||
}
|
||||
} else {
|
||||
// 提取原始/当前子项,并按cpickm_bid分组
|
||||
// 修复核心:对getChildrenVO返回值做空值校验,null转为空数组
|
||||
PickmItemVO[] currentItems = (PickmItemVO[]) currentVO.getChildrenVO();
|
||||
PickmItemVO[] originItems = (PickmItemVO[]) originVO.getChildrenVO();
|
||||
|
||||
// 关键修复:将null数组转为空数组,避免后续遍历报错
|
||||
currentItems = currentItems == null ? new PickmItemVO[0] : currentItems;
|
||||
originItems = originItems == null ? new PickmItemVO[0] : originItems;
|
||||
|
||||
Map<String, PickmItemVO> originItemMap = new HashMap<>();
|
||||
for (PickmItemVO originItem : originItems) {
|
||||
originItemMap.put(originItem.getCpickm_bid(), originItem);
|
||||
|
|
|
|||
Loading…
Reference in New Issue