| | |
| | | @Override |
| | | @Transactional |
| | | public R<ComStreetVO> addStreet(ComStreetVO comStreetVO) { |
| | | String password = comStreetVO.getPassword(); |
| | | String encode = new BCryptPasswordEncoder().encode(password); |
| | | comStreetVO.setPassword(encode); |
| | | ComStreetDO comStreetDO = new ComStreetDO(); |
| | | LambdaQueryWrapper<ComStreetDO> param = new QueryWrapper<ComStreetDO>().lambda(); |
| | | param.eq(ComStreetDO::getName, comStreetVO.getName()); |
| | |
| | | BeanUtils.copyProperties(comStreetVO, comStreetDO); |
| | | int insert = comStreetDAO.insert(comStreetDO); |
| | | if (insert > 0) { |
| | | AdministratorsUserVO administratorsUserVO1=new AdministratorsUserVO(); |
| | | administratorsUserVO1.setUserId(Long.parseLong(r.getData().toString())); |
| | | administratorsUserVO1.setStreetId(comStreetDO.getStreetId()); |
| | | userService.updateStreet(administratorsUserVO1); |
| | | ComStreetDO comStreetDO1 = comStreetDAO.selectOne(param); |
| | | BeanUtils.copyProperties(comStreetDO1, comStreetVO); |
| | | return R.ok(comStreetVO); |