diff --git a/jnpf-java-boot/jnpf-scm/jnpf-scm-controller/src/main/java/jnpf/controller/RecycleBucketController.java b/jnpf-java-boot/jnpf-scm/jnpf-scm-controller/src/main/java/jnpf/controller/RecycleBucketController.java index 3616b04..9bd37a7 100644 --- a/jnpf-java-boot/jnpf-scm/jnpf-scm-controller/src/main/java/jnpf/controller/RecycleBucketController.java +++ b/jnpf-java-boot/jnpf-scm/jnpf-scm-controller/src/main/java/jnpf/controller/RecycleBucketController.java @@ -85,19 +85,7 @@ public class RecycleBucketController { Map configCollect = recycleDeviceConfigService.getConfigs(companyIds); List> realList = new ArrayList<>(); for (RecycleBucketEntity entity : list) { - if (configCollect.containsKey(entity.getCompanyId())) { - RecycleDeviceConfigEntity deviceConfig = configCollect.get(entity.getCompanyId()); - //如果为空 则获取公共配置 - if (Objects.isNull(entity.getPrice())) { - entity.setPrice(CompareUtil.compareBigDecimal(entity.getDoorNum(), deviceConfig)); - } - if (entity.getFullSet() == -1) { - entity.setFullSet(Integer.valueOf(deviceConfig.getFullSet())); - } - if (entity.getSmogSet() == -1) { - entity.setSmogSet(Integer.valueOf(deviceConfig.getSmogSet())); - } - } + buildEntity(entity, configCollect); Map recycleBucketMap = JsonUtil.entityToMap(entity); recycleBucketMap.put("id", recycleBucketMap.get("id")); //副表数据 @@ -213,7 +201,9 @@ public class RecycleBucketController { if (entity == null) { return ActionResult.fail("表单数据不存在!"); } - Map recycleBucketMap = JsonUtil.entityToMap(entity); + //查询统一配置 + Map configCollect = recycleDeviceConfigService.getConfigs(Collections.singletonList(entity.getCompanyId())); + Map recycleBucketMap = JsonUtil.entityToMap(buildEntity(entity, configCollect)); recycleBucketMap.put("id", recycleBucketMap.get("id")); //副表数据 //子表数据 @@ -240,7 +230,50 @@ public class RecycleBucketController { //副表数据 //子表数据 recycleBucketMap = generaterSwapUtil.swapDataForm(recycleBucketMap, RecycleBucketConstant.getFormData(), RecycleBucketConstant.TABLEFIELDKEY, RecycleBucketConstant.TABLERENAMES); + //查询统一配置 + Map configCollect = recycleDeviceConfigService.getConfigs(Collections.singletonList(entity.getCompanyId())); + if (configCollect.containsKey(entity.getCompanyId())) { + RecycleDeviceConfigEntity deviceConfig = configCollect.get(entity.getCompanyId()); + //如果为空 则获取公共配置 + if (Objects.isNull(entity.getPrice())) { + recycleBucketMap.put("priceDesc", CompareUtil.compareBigDecimal(entity.getDoorNum(), deviceConfig)); + } + if (Objects.nonNull(entity.getFullSet()) && entity.getFullSet() == -1) { + recycleBucketMap.put("fullSetDesc", Integer.valueOf(deviceConfig.getFullSet())); + } + if (Objects.nonNull(entity.getSmogSet()) && entity.getSmogSet() == -1) { + recycleBucketMap.put("smogSetDesc", Integer.valueOf(deviceConfig.getSmogSet())); + } + if (Objects.isNull(entity.getWarningWeight())) { + recycleBucketMap.put("warningWeightDesc", deviceConfig.getWarningWeight()); + } + if (Objects.nonNull(entity.getCloseDelay()) && entity.getCloseDelay() == -1) { + recycleBucketMap.put("closeDelayDesc", deviceConfig.getCloseDelay()); + } + } return ActionResult.success(recycleBucketMap); } + private RecycleBucketEntity buildEntity(RecycleBucketEntity entity, Map configCollect) { + if (configCollect.containsKey(entity.getCompanyId())) { + RecycleDeviceConfigEntity deviceConfig = configCollect.get(entity.getCompanyId()); + //如果为空 则获取公共配置 + if (Objects.isNull(entity.getPrice())) { + entity.setPrice(CompareUtil.compareBigDecimal(entity.getDoorNum(), deviceConfig)); + } + if (Objects.nonNull(entity.getFullSet()) && entity.getFullSet() == -1) { + entity.setFullSet(Integer.valueOf(deviceConfig.getFullSet())); + } + if (Objects.nonNull(entity.getSmogSet()) && entity.getSmogSet() == -1) { + entity.setSmogSet(Integer.valueOf(deviceConfig.getSmogSet())); + } + if (Objects.isNull(entity.getWarningWeight())) { + entity.setWarningWeight(deviceConfig.getWarningWeight()); + } + if (Objects.nonNull(entity.getCloseDelay()) && entity.getCloseDelay() == -1) { + entity.setCloseDelay(deviceConfig.getCloseDelay()); + } + } + return entity; + } } diff --git a/jnpf-java-boot/jnpf-web/src/views/recyclebucket/form.vue b/jnpf-java-boot/jnpf-web/src/views/recyclebucket/form.vue index 6e7f885..5a005ed 100644 --- a/jnpf-java-boot/jnpf-web/src/views/recyclebucket/form.vue +++ b/jnpf-java-boot/jnpf-web/src/views/recyclebucket/form.vue @@ -1,240 +1,270 @@ - - - -