From dbc803098082f47a9345a07970b417687d130adf Mon Sep 17 00:00:00 2001 From: anthonywj Date: Sun, 25 Jun 2023 17:23:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=A4=87=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../thrsys/ThrProductsController.java | 61 ++++++++++--------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/thrsys/ThrProductsController.java b/src/main/java/com/glxp/api/controller/thrsys/ThrProductsController.java index c01e1f19..8f7cc666 100644 --- a/src/main/java/com/glxp/api/controller/thrsys/ThrProductsController.java +++ b/src/main/java/com/glxp/api/controller/thrsys/ThrProductsController.java @@ -180,35 +180,38 @@ public class ThrProductsController { String value = systemParamConfigService.selectValueByParamKey("enable_edit_third"); if (StrUtil.isNotEmpty(value) && value.equals("1")) { UdiProductEntity udiProductEntity = udiProductService.findByNameCode(thrProductsEntity.getCode()); - if (StrUtil.isNotEmpty(thrProductsEntity.getMeasname())) - udiProductEntity.setMeasname(thrProductsEntity.getMeasname()); - if (StrUtil.isNotEmpty(thrProductsEntity.getSpec())) - udiProductEntity.setGgxh(thrProductsEntity.getSpec()); - if (StrUtil.isNotEmpty(thrProductsEntity.getRegisterNo())) - udiProductEntity.setZczbhhzbapzbh(thrProductsEntity.getRegisterNo()); - if (StrUtil.isNotEmpty(thrProductsEntity.getManufactory())) - udiProductEntity.setManufactory(thrProductsEntity.getManufactory()); - if (StrUtil.isNotEmpty(thrProductsEntity.getCplb())) - udiProductEntity.setCplb(thrProductsEntity.getCplb()); - if (StrUtil.isNotEmpty(thrProductsEntity.getFlbm())) - udiProductEntity.setFlbm(thrProductsEntity.getFlbm()); - if (StrUtil.isNotEmpty(thrProductsEntity.getQxlb())) - udiProductEntity.setQxlb(thrProductsEntity.getQxlb()); - if (StrUtil.isNotEmpty(thrProductsEntity.getYbbm())) - udiProductEntity.setYbbm(thrProductsEntity.getYbbm()); - if (StrUtil.isNotEmpty(thrProductsEntity.getSptm())) - udiProductEntity.setSptm(thrProductsEntity.getSptm()); - if (StrUtil.isNotEmpty(thrProductsEntity.getTyshxydm())) - udiProductEntity.setTyshxydm(thrProductsEntity.getTyshxydm()); - if (StrUtil.isNotEmpty(thrProductsEntity.getZczbhhzbapzbh())) - udiProductEntity.setZczbhhzbapzbh(thrProductsEntity.getZczbhhzbapzbh()); - if (StrUtil.isNotEmpty(thrProductsEntity.getYlqxzcrbarmc())) - udiProductEntity.setYlqxzcrbarmc(thrProductsEntity.getYlqxzcrbarmc()); - if (StrUtil.isNotEmpty(thrProductsEntity.getCpms())) - udiProductEntity.setCpms(thrProductsEntity.getCpms()); - if (StrUtil.isNotEmpty(thrProductsEntity.getStandard())) - udiProductEntity.setGgxh(thrProductsEntity.getStandard()); - udiProductService.updateUdiInfo(udiProductEntity); + if (udiProductEntity != null) { + if (StrUtil.isNotEmpty(thrProductsEntity.getMeasname())) + udiProductEntity.setMeasname(thrProductsEntity.getMeasname()); + if (StrUtil.isNotEmpty(thrProductsEntity.getSpec())) + udiProductEntity.setGgxh(thrProductsEntity.getSpec()); + if (StrUtil.isNotEmpty(thrProductsEntity.getRegisterNo())) + udiProductEntity.setZczbhhzbapzbh(thrProductsEntity.getRegisterNo()); + if (StrUtil.isNotEmpty(thrProductsEntity.getManufactory())) + udiProductEntity.setManufactory(thrProductsEntity.getManufactory()); + if (StrUtil.isNotEmpty(thrProductsEntity.getCplb())) + udiProductEntity.setCplb(thrProductsEntity.getCplb()); + if (StrUtil.isNotEmpty(thrProductsEntity.getFlbm())) + udiProductEntity.setFlbm(thrProductsEntity.getFlbm()); + if (StrUtil.isNotEmpty(thrProductsEntity.getQxlb())) + udiProductEntity.setQxlb(thrProductsEntity.getQxlb()); + if (StrUtil.isNotEmpty(thrProductsEntity.getYbbm())) + udiProductEntity.setYbbm(thrProductsEntity.getYbbm()); + if (StrUtil.isNotEmpty(thrProductsEntity.getSptm())) + udiProductEntity.setSptm(thrProductsEntity.getSptm()); + if (StrUtil.isNotEmpty(thrProductsEntity.getTyshxydm())) + udiProductEntity.setTyshxydm(thrProductsEntity.getTyshxydm()); + if (StrUtil.isNotEmpty(thrProductsEntity.getZczbhhzbapzbh())) + udiProductEntity.setZczbhhzbapzbh(thrProductsEntity.getZczbhhzbapzbh()); + if (StrUtil.isNotEmpty(thrProductsEntity.getYlqxzcrbarmc())) + udiProductEntity.setYlqxzcrbarmc(thrProductsEntity.getYlqxzcrbarmc()); + if (StrUtil.isNotEmpty(thrProductsEntity.getCpms())) + udiProductEntity.setCpms(thrProductsEntity.getCpms()); + if (StrUtil.isNotEmpty(thrProductsEntity.getStandard())) + udiProductEntity.setGgxh(thrProductsEntity.getStandard()); + udiProductService.updateUdiInfo(udiProductEntity); + } + } return ResultVOUtils.success("修改成功!"); }