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("修改成功!"); }