| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R matUpdate(BaseMatParms baseMatParms) { |
| | | if (StringUtils.isNotBlank(baseMatParms.getMatnr())) { |
| | | throw new CoolException("基础信息变更失败!!"); |
| | | if (StringUtils.isBlank(baseMatParms.getMatnr())) { |
| | | throw new CoolException("物料编码不能为空!!"); |
| | | } |
| | | Matnr matnr = matnrService.getOne(new LambdaQueryWrapper<Matnr>().eq(Matnr::getCode, baseMatParms.getMatnr())); |
| | | if (Objects.isNull(matnr)) { |
| | |
| | | throw new CoolException("物料新增失败!!"); |
| | | } |
| | | } else { |
| | | |
| | | if (!Objects.isNull(baseMatParms.getGroupName())) { |
| | | MatnrGroup matnrGroup = matnrGroupService.getOne(new LambdaQueryWrapper<MatnrGroup>() |
| | | .eq(MatnrGroup::getName, baseMatParms.getGroupName())); |
| | | if (Objects.isNull(matnrGroup)) { |
| | | if (!Objects.isNull(matnrGroup)) { |
| | | matnr.setGroupCode(matnrGroup.getCode()).setGroupId(matnrGroup.getId()); |
| | | } |
| | | } |
| | | |
| | | matnr.setName(baseMatParms.getMaktx()) |
| | | .setColor(baseMatParms.getColor()) |
| | | .setModel(baseMatParms.getModel()) |