| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.sangeshenbian.SystemUserVo; |
| | | import com.panzhihua.sangeshenbian.model.entity.SystemUserLevel; |
| | | import com.panzhihua.sangeshenbian.model.query.ComplaintRejectQuery; |
| | | import com.panzhihua.sangeshenbian.model.vo.ComplaintRejectVo; |
| | | import com.panzhihua.sangeshenbian.service.IComplaintRejectService; |
| | | import com.panzhihua.sangeshenbian.service.ISystemUserLevelService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @RequestMapping("/complaint-reject") |
| | | @Api |
| | | public class ComplaintRejectController { |
| | | public class ComplaintRejectController extends BaseController { |
| | | @Resource |
| | | private IComplaintRejectService complaintRejectService; |
| | | @Resource |
| | | private ISystemUserLevelService systemUserLevelService; |
| | | |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "获取问题驳回统计列表", tags = {"三个身边后台-问题驳回统计"}) |
| | | public R<IPage<ComplaintRejectVo>> list(ComplaintRejectQuery query){ |
| | | SystemUserVo loginUserInfoSanGeShenBian = getLoginUserInfoSanGeShenBian(); |
| | | Integer id = loginUserInfoSanGeShenBian.getId(); |
| | | List<SystemUserLevel> listBySystemUsers = systemUserLevelService.getListBySystemUserId(id); |
| | | SystemUserLevel systemUserLevel = listBySystemUsers.stream().filter(e -> e.getLevel() == 1).findFirst().orElse(null); |
| | | List<String> districtsCodes=new ArrayList<>(); |
| | | List<String> streetIds=new ArrayList<>(); |
| | | List<Long> communityIds=new ArrayList<>(); |
| | | // 看是否直接是市级账号 |
| | | if(systemUserLevel==null){ |
| | | // 不是市级 查看是否是区县账号 |
| | | List<SystemUserLevel> systemUserLevels2 = listBySystemUsers.stream().filter(e -> e.getLevel() == 2).collect(Collectors.toList()); |
| | | if(!systemUserLevels2.isEmpty()){ |
| | | // 区县账号 找出code |
| | | districtsCodes = systemUserLevels2.stream().map(SystemUserLevel::getDistrictsCode).collect(Collectors.toList()); |
| | | }else { |
| | | districtsCodes.add("-1"); |
| | | } |
| | | |
| | | List<SystemUserLevel> systemUserLevels3 = listBySystemUsers.stream().filter(e -> e.getLevel() == 3).collect(Collectors.toList()); |
| | | if(!systemUserLevels3.isEmpty()){ |
| | | // 街道账号 找出id 且不在上面的区县下的街道 |
| | | List<String> finalDistrictsCodes1 = districtsCodes; |
| | | streetIds = systemUserLevels3.stream().filter(e -> !finalDistrictsCodes1.contains(e.getDistrictsCode())).map(SystemUserLevel::getStreetId).collect(Collectors.toList()); |
| | | if(streetIds.isEmpty()){ |
| | | streetIds.add("-1"); |
| | | } |
| | | }else { |
| | | streetIds.add("-1"); |
| | | } |
| | | |
| | | List<SystemUserLevel> systemUserLevels4 = listBySystemUsers.stream().filter(e -> e.getLevel() == 4).collect(Collectors.toList()); |
| | | if(!systemUserLevels4.isEmpty()){ |
| | | // community账号 找出id 且不在上面的街道下的社区 |
| | | List<String> finalStreetIds1 = streetIds; |
| | | List<String> finalDistrictsCodes2 = districtsCodes; |
| | | communityIds = systemUserLevels4.stream().filter(e -> !finalStreetIds1.contains(e.getStreetId()) && !finalDistrictsCodes2.contains(e.getDistrictsCode())).map(SystemUserLevel::getCommunityId).collect(Collectors.toList()); |
| | | }else { |
| | | communityIds.add(-1L); |
| | | } |
| | | List<String> finalDistrictsCodes = districtsCodes; |
| | | List<String> finalStreetIds = streetIds; |
| | | List<Long> finalCommunityIds = communityIds; |
| | | IPage<ComplaintRejectVo> list = complaintRejectService.getComplaintRejectListOther(query,finalDistrictsCodes,finalStreetIds,finalCommunityIds); |
| | | return R.ok(list); |
| | | }else { |
| | | IPage<ComplaintRejectVo> list = complaintRejectService.getComplaintRejectList(query); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | IPage<ComplaintRejectVo> list = complaintRejectService.getComplaintRejectList(query); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |