| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationHouseInsertAdminDTO; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public R insertHouse(ComMngPopulationHouseInsertAdminDTO houseEditAdminDTO) { |
| | | ComMngPopulationHouseDO houseDO=new ComMngPopulationHouseDO(); |
| | | BeanUtils.copyProperties(houseEditAdminDTO, houseDO); |
| | | houseDO.setCreateAt(new Date()); |
| | | if (this.baseMapper.insert(houseDO) > 0) { |
| | | ComMngPopulationHouseUserDO comMngPopulationHouseUserDO=new ComMngPopulationHouseUserDO(); |
| | | comMngPopulationHouseUserDO.setHouseId(houseDO.getId()); |
| | | comMngPopulationHouseUserDO.setPopulId(houseEditAdminDTO.getPopulationId()); |
| | | comMngPopulationHouseUserDAO.insert(comMngPopulationHouseUserDO); |
| | | return R.ok(); |
| | | } else { |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | } |