luo
2023-12-25 23c4967b4cb8dbce8277f830f7152d315c5a4a57
guns-management/src/main/java/com/stylefeng/guns/modular/code/controller/ReportController.java
@@ -4,6 +4,7 @@
import com.github.pagehelper.PageInfo;
import com.stylefeng.guns.modular.system.dto.FeedBackVo;
import com.stylefeng.guns.modular.system.dto.THouseResource;
import com.stylefeng.guns.modular.system.model.HouseResource;
import com.stylefeng.guns.modular.system.model.ReportHouseResource;
import com.stylefeng.guns.modular.system.service.IFeedBackService;
import com.stylefeng.guns.modular.system.service.IHouseResourceService;
@@ -16,6 +17,7 @@
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
@Controller
@@ -64,18 +66,27 @@
    @ResponseBody
    @PutMapping("/change")
    @ApiOperation(value = "status 1=通过,2=拒绝,3删除)", tags = {"后台-房源举报管理"})
    public ResultUtil change(Integer id, Integer status,String reason){
        ReportHouseResource reportHouseResource = reportHouseResourceService.selectById(id);
    public ResultUtil change(String ids, Integer status,String reason){
        String[] split = ids.split(",");
        for (String id : split) {
        ReportHouseResource reportHouseResource = reportHouseResourceService.selectById(Integer.valueOf(id));
        if (status==1){
                reportHouseResource.setAudit(1);
          }else if (status ==2){
            reportHouseResource.setAudit(2);
            reportHouseResource.setBackDate(new Date());
            reportHouseResource.setBackReason(reason);
            HouseResource houseResource = houseResourceService.selectById(reportHouseResource.getHouseResourceId());
            houseResource.setStatus(0);
            houseResourceService.updateById(houseResource);
        }else if (status == 3){
            reportHouseResourceService.deleteById(id);
            reportHouseResourceService.deleteById(Integer.valueOf(id));
            return ResultUtil.success();
        }
        reportHouseResourceService.updateById(reportHouseResource);
        }
        return ResultUtil.success();
    }
@@ -108,11 +119,15 @@
    @ResponseBody
    @DeleteMapping("/feedback/delete")
    @ApiOperation(value = "删除", tags = {"后台-意见反馈"})
    public ResultUtil delete(Integer id){
        feedBackService.deleteById(id);
    public ResultUtil delete(Integer[] ids){
        for (Integer id : ids) {
            feedBackService.deleteById(Integer.valueOf(id));
        }
        return ResultUtil.success("删除成功");
    }
}