From c46191d359fb8dcf9ea875d16200eff4fa8cad79 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期二, 25 三月 2025 13:39:35 +0800 Subject: [PATCH] #新增 1. 新增库区批量修改接口 2. 物料分组删除上级编码必传判断 --- rsf-server/src/main/java/com/vincent/rsf/server/common/utils/FieldsUtils.java | 37 ++++++++++++++++++++----------------- 1 files changed, 20 insertions(+), 17 deletions(-) diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/common/utils/FieldsUtils.java b/rsf-server/src/main/java/com/vincent/rsf/server/common/utils/FieldsUtils.java index 7b53065..0f7f8ae 100644 --- a/rsf-server/src/main/java/com/vincent/rsf/server/common/utils/FieldsUtils.java +++ b/rsf-server/src/main/java/com/vincent/rsf/server/common/utils/FieldsUtils.java @@ -118,23 +118,26 @@ String index = fieldsIndex.toString(); FieldsItemService fieldsItemService = SpringUtils.getBean(FieldsItemService.class); for (Fields field : fields) { - if (!Objects.isNull(params.get(field.getFields()))) { - FieldsItem indexItem = fieldsItemService.getOne(new LambdaQueryWrapper<FieldsItem>() - .eq(FieldsItem::getUuid, index) - .eq(FieldsItem::getFieldsId, field.getId())); - //濡傛灉瀛愯〃涓虹┖锛屾墽琛屾彃鍏ユ搷浣滐紝鍚﹀垯灏辨墽琛屼慨鏀规搷浣� - if (Objects.isNull(indexItem)) { - FieldsItem item = new FieldsItem(); - item.setUuid(index) - .setFieldsId(field.getId()) - .setValue(params.get(field.getFields()).toString()); - if (fieldsItemService.save(item)) { - throw new CoolException("鎵╁睍瀛楁淇敼澶辫触锛侊紒"); - } - } else { - indexItem.setValue(params.get(field.getFields()).toString()); - if (fieldsItemService.updateById(indexItem)) { - throw new CoolException("鎵╁睍瀛楁淇敼澶辫触锛侊紒"); + Map<String, String> extendFields = (Map<String, String>) params.get("extendFields"); + if (!Objects.isNull(extendFields)) { + if (!Objects.isNull(extendFields.get(field.getFields()))) { + FieldsItem indexItem = fieldsItemService.getOne(new LambdaQueryWrapper<FieldsItem>() + .eq(FieldsItem::getUuid, index) + .eq(FieldsItem::getFieldsId, field.getId())); + //濡傛灉瀛愯〃涓虹┖锛屾墽琛屾彃鍏ユ搷浣滐紝鍚﹀垯灏辨墽琛屼慨鏀规搷浣� + if (Objects.isNull(indexItem)) { + FieldsItem item = new FieldsItem(); + item.setUuid(index) + .setFieldsId(field.getId()) + .setValue(extendFields.get(field.getFields()).toString()); + if (!fieldsItemService.save(item)) { + throw new CoolException("鎵╁睍瀛楁淇敼澶辫触锛侊紒"); + } + } else { + indexItem.setValue(extendFields.get(field.getFields()).toString()); + if (!fieldsItemService.updateById(indexItem)) { + throw new CoolException("鎵╁睍瀛楁淇敼澶辫触锛侊紒"); + } } } } -- Gitblit v1.9.1