| | |
| | | } |
| | | Matnr matnr = matnrService.getOne(new LambdaQueryWrapper<Matnr>().eq(Matnr::getCode, baseMatParms.getMatnr())); |
| | | if (Objects.isNull(matnr)) { |
| | | BeanUtils.copyProperties(baseMatParms, matnr); |
| | | matnr.setCode(baseMatParms.getMatnr()); |
| | | matnr.setName(baseMatParms.getMaktx()); |
| | | Matnr matnr1 = new Matnr(); |
| | | BeanUtils.copyProperties(baseMatParms, matnr1); |
| | | matnr1.setCode(baseMatParms.getMatnr()); |
| | | matnr1.setName(baseMatParms.getMaktx()); |
| | | if (!Objects.isNull(baseMatParms.getGroupName())) { |
| | | MatnrGroup matnrGroup = matnrGroupService.getOne(new LambdaQueryWrapper<MatnrGroup>() |
| | | .eq(MatnrGroup::getName, baseMatParms.getGroupName())); |
| | | if (Objects.isNull(matnrGroup)) { |
| | | matnr.setGroupCode(matnrGroup.getCode()).setGroupId(matnrGroup.getId()); |
| | | if (!Objects.isNull(matnrGroup)) { |
| | | matnr1.setGroupCode(matnrGroup.getCode()).setGroupId(matnrGroup.getId()); |
| | | } |
| | | } |
| | | if (!matnrService.save(matnr)) { |
| | | if (!matnrService.save(matnr1)) { |
| | | throw new CoolException("物料新增失败!!"); |
| | | } |
| | | } else { |