| | |
| | | public int addOrEditSupply(SupplyDto supplyDto) { |
| | | Supply supply = new Supply(); |
| | | BeanUtils.copyProperties(supplyDto, supply); |
| | | if (supplyDto.getBids().size() != 3) { |
| | | throw new RuntimeException("请选择经营地址省市区"); |
| | | } |
| | | |
| | | if (supplyDto.getCids().size() != 3) { |
| | | throw new RuntimeException("请选择联系地址省市区"); |
| | | } |
| | | |
| | | supply.setBProvinceId(supplyDto.getBids().get(0)); |
| | | supply.setBCityId(supplyDto.getBids().get(1)); |
| | | supply.setBDistrictId(supplyDto.getBids().get(2)); |
| | | |
| | | supply.setCProvinceId(supplyDto.getCids().get(0)); |
| | | supply.setCCityId(supplyDto.getCids().get(1)); |
| | | supply.setCDistrictId(supplyDto.getCids().get(2)); |
| | | |
| | | |
| | | if (Objects.isNull(supplyDto.getId())) { |
| | | return supplyMapper.insert(supply); |
| | | } else { |