| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.ReportHousingDemandMapper; |
| | | import com.stylefeng.guns.modular.system.model.AppUser; |
| | | import com.stylefeng.guns.modular.system.model.ReportHousingDemand; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.IAppUserService; |
| | | import com.stylefeng.guns.modular.system.service.IHousingDemandService; |
| | | import com.stylefeng.guns.modular.system.service.IReportHousingDemandService; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.req.ReportHousingDemandReq; |
| | |
| | | |
| | | @Autowired |
| | | private IAppUserService appUserService; |
| | | @Autowired |
| | | private IHousingDemandService housingDemandService; |
| | | |
| | | |
| | | /** |
| | |
| | | BeanUtils.copyProperties(req, reportHousingDemand); |
| | | reportHousingDemand.setAppUserId(appUser.getId()); |
| | | reportHousingDemand.setInsertTime(new Date()); |
| | | reportHousingDemand.setHousingDemandId(req.getHousingDemandIid()); |
| | | this.insert(reportHousingDemand); |
| | | // 查询当前房源被举报通过了多少次 |
| | | int house_resource_id = this.selectList(new EntityWrapper<ReportHousingDemand>() |
| | | .eq("housing_demand_id", req.getHousingDemandIid())).size(); |
| | | if (house_resource_id==1 || house_resource_id==2){ |
| | | HousingDemand houseResource = housingDemandService.selectById(req.getHousingDemandIid()); |
| | | houseResource.setStatus(0); |
| | | housingDemandService.updateById(houseResource); |
| | | } |
| | | if (house_resource_id >= 3){ |
| | | HousingDemand houseResource = housingDemandService.selectById(req.getHousingDemandIid()); |
| | | houseResource.setIsDelete(1); |
| | | housingDemandService.updateById(houseResource); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | } |