| | |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngStructOtherBuildVO; |
| | | import com.panzhihua.service_community.dao.ComActDAO; |
| | | import com.panzhihua.service_community.dao.ComActVillageDAO; |
| | | import com.panzhihua.service_community.dao.ComStreetDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngVillageDO; |
| | | import com.panzhihua.service_community.model.dos.ComStreetDO; |
| | | import com.panzhihua.service_community.service.ComActService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
| | |
| | | public class ComActServiceImpl implements ComActService { |
| | | @Resource |
| | | private ComActDAO comActDAO; |
| | | @Resource |
| | | private ComStreetDAO comStreetDAO; |
| | | |
| | | /** |
| | | * 新增社区 |
| | | * |
| | |
| | | String password = comActVO.getPassword(); |
| | | String encode = new BCryptPasswordEncoder().encode(password); |
| | | comActVO.setPassword(encode); |
| | | ComStreetDO comStreetDO = comStreetDAO.selectById(comActVO.getStreetId()); |
| | | if (comStreetDO == null) { |
| | | return R.fail("当前街道不存在!"); |
| | | } |
| | | ComActDO comActDO=new ComActDO(); |
| | | Integer integer = comActDAO.selectCount(new QueryWrapper<ComActDO>().lambda().eq(ComActDO::getName, comActVO.getName())); |
| | | if (integer>0) { |
| | |
| | | comActVO.setPassword(encode); |
| | | a=1; |
| | | } |
| | | ComStreetDO comStreetDO = comStreetDAO.selectById(comActVO.getStreetId()); |
| | | if (comStreetDO == null) { |
| | | return R.fail("当前街道不存在!"); |
| | | } |
| | | // if(!ObjectUtils.isEmpty(account)||!ObjectUtils.isEmpty(contacts)){ |
| | | // a=1; |
| | | // } |
| | | BeanUtils.copyProperties(comActVO,comActDO); |
| | | |
| | | int update = comActDAO.updateById(comActDO); |
| | | if (update>0) { |
| | | if (a==1) { |