| | |
| | | |
| | | // 都为空 查他有的 |
| | | if(query.getCityCode()==null && query.getDistrictCode()==null && query.getStreetId()==null && query.getCommunityId()==null){ |
| | | if(systemUser.getSystemRoleId()==1 || systemUser.getSystemRoleId()==2){ |
| | | if(systemUser.getSystemRoleId()==1){ |
| | | wrapper.ne(Complaint::getProblemType,"检举"); |
| | | } |
| | | if(accountLevel==3){ |
| | | String streetId = systemUser.getStreetId(); |
| | | List<Long> ids = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, streetId)).stream().map(ComAct::getCommunityId).collect(Collectors.toList()); |
| | | wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel()).or(wrapper1 ->wrapper1.in(Complaint::getSuperiorId,ids).eq(Complaint::getNowLevel,4)); |
| | | } |
| | | if(accountLevel==4){ |
| | | wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel()); |
| | | } |
| | | }else { |
| | | wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel()) |
| | | .eq(Complaint::getAssignPersonId,systemUser.getOneDepartmentId()); |
| | | } |
| | | } |
| | | |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | List<Complaint> complaints =complaintService.list(wrapper); |
| | | // 第一部分数据 |
| | | AnalyticStatisticsOneVo analyticStatisticsOneVo = complaintService.analyticStatisticsOne(query,complaints,simpleDateFormat); |
| | | AnalyticStatisticsOneVo analyticStatisticsOneVo = complaintService.analyticStatisticsOne(query,complaints,simpleDateFormat,systemUser.getAccountLevel()); |
| | | |
| | | // 第二部分数据 |
| | | List<AnalyticStatisticsTwoVo> analyticStatisticsTwoVos =complaintService.analyticStatisticsTwo(query.getTime(),complaints,simpleDateFormat); |
| | |
| | | import com.panzhihua.common.model.vos.west.SystemUserVo; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.westcommittee.model.dto.UpdateStatusDeptDto; |
| | | import com.panzhihua.westcommittee.model.entity.ComAct; |
| | | import com.panzhihua.westcommittee.model.entity.Department; |
| | | import com.panzhihua.westcommittee.model.entity.SystemUser; |
| | | import com.panzhihua.westcommittee.service.*; |
| | |
| | | @ApiOperation(value = "获取单位列表", tags = {"西区纪委后台-单位管理"}) |
| | | @OperLog(operModul = "西区纪委后台",operType = 0, businessType = "获取单位列表") |
| | | public R<List<Department>> getList(String name,Integer level,String code,int type){ |
| | | SystemUserVo loginUserInfoWest = getLoginUserInfoWest(); |
| | | if(level==null){ |
| | | List<Department> list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name)); |
| | | return R.ok(list4); |
| | | }else { |
| | | if(loginUserInfoWest.getSystemRoleId()!=1){ |
| | | return R.ok(new ArrayList<>()); |
| | | } |
| | | level=loginUserInfoWest.getAccountLevel(); |
| | | type=2; |
| | | } |
| | | List<Department> list4=new ArrayList<>(); |
| | | if(level==2 && type==1){ |
| | | list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq( Department::getTier, 2)); |
| | | }else if(level==2 && type==2){ |
| | | list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).ge( Department::getTier, 2)); |
| | | }else if(level==3 && type==1){ |
| | | list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq( Department::getTier, 3)); |
| | | list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq( Department::getTier, 3).eq(Department::getStreetId, loginUserInfoWest.getStreetId())); |
| | | }else if(level==3 && type==2){ |
| | | list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).ge( Department::getTier, 3)); |
| | | List<Long> ids = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, loginUserInfoWest.getStreetId())).stream().map(ComAct::getCommunityId).collect(Collectors.toList()); |
| | | list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq( Department::getTier, 3).eq(Department::getStreetId, loginUserInfoWest.getStreetId()) |
| | | .or(w->w.eq(Department::getTier,4).in(Department::getCommunityId,ids))); |
| | | }else if(level==4 && type==1){ |
| | | list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq( Department::getTier, 4)); |
| | | list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq( Department::getTier, 4).eq(Department::getCommunityId,loginUserInfoWest.getCommunityId())); |
| | | }else if(level==4 && type==2){ |
| | | list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).ge(Department::getTier, 4)); |
| | | list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq(Department::getTier, 4).eq(Department::getCommunityId,loginUserInfoWest.getCommunityId())); |
| | | } |
| | | return R.ok(list4); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | @ApiOperation(value = "获取单位列表1", tags = {"西区纪委后台-单位管理"}) |
| | | @OperLog(operModul = "西区纪委后台",operType = 0, businessType = "获取单位列表") |
| | | public R<Page<Department>> getDeptList(String name,int pageNum,int pageSize){ |
| | | Page<Department> list4 = departmentService.page(new Page<Department>(pageNum,pageSize),new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).or().eq(StringUtils.isNotEmpty(name),Department::getId,name)); |
| | | SystemUserVo loginUserInfoWest = getLoginUserInfoWest(); |
| | | if(loginUserInfoWest.getSystemRoleId()!=1){ |
| | | return R.ok(new Page<>()); |
| | | } |
| | | Integer accountLevel = loginUserInfoWest.getAccountLevel(); |
| | | Page<Department> list4 = null; |
| | | if(accountLevel==2 ){ |
| | | list4 = departmentService.page(new Page<Department>(pageNum,pageSize),new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).or().eq(StringUtils.isNotEmpty(name),Department::getId,name).ge(Department::getTier,accountLevel)); |
| | | }else if(accountLevel==3){ |
| | | String streetId = loginUserInfoWest.getStreetId(); |
| | | List<Long> ids = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, streetId)).stream().map(ComAct::getCommunityId).collect(Collectors.toList()); |
| | | list4 = departmentService.page(new Page<Department>(pageNum,pageSize),new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).or().eq(StringUtils.isNotEmpty(name),Department::getId,name).eq(Department::getTier,accountLevel).eq(Department::getStreetId,streetId) |
| | | .or(department -> department.and(department1 -> department1.eq(Department::getTier, 4).in(Department::getCommunityId, ids)))); |
| | | }else if(accountLevel==4){ |
| | | list4 = departmentService.page(new Page<Department>(pageNum,pageSize),new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).or().eq(StringUtils.isNotEmpty(name),Department::getId,name).eq(Department::getTier,4).eq(Department::getCommunityId,loginUserInfoWest.getCommunityId())); |
| | | } |
| | | for (Department department : list4.getRecords()) { |
| | | int count = systemUserService.count(new LambdaQueryWrapper<SystemUser>().eq(SystemUser::getOneDepartmentId, department.getId())); |
| | | department.setUserCount(count); |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.west.SystemUserVo; |
| | | import com.panzhihua.westcommittee.annotation.DistributedLock; |
| | | import com.panzhihua.westcommittee.annotation.SysLog; |
| | | import com.panzhihua.westcommittee.model.dto.AssignComplainDto; |
| | | import com.panzhihua.westcommittee.model.dto.ComplaintProcessUpdateDto; |
| | | import com.panzhihua.westcommittee.model.dto.*; |
| | | import com.panzhihua.westcommittee.model.entity.Complaint; |
| | | import com.panzhihua.westcommittee.model.entity.ComplaintComment; |
| | | import com.panzhihua.westcommittee.model.entity.Department; |
| | | import com.panzhihua.westcommittee.model.entity.SystemUser; |
| | | import com.panzhihua.westcommittee.model.vo.ComplaintVO; |
| | | import com.panzhihua.westcommittee.model.vo.DispatchVO; |
| | | import com.panzhihua.westcommittee.service.IComplaintCommentService; |
| | | import com.panzhihua.westcommittee.service.IComplaintService; |
| | | import com.panzhihua.westcommittee.service.IDepartmentService; |
| | | import com.panzhihua.westcommittee.service.ISystemUserService; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.io.IOException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import static cn.hutool.core.util.ObjectUtil.isNull; |
| | | |
| | | /** |
| | | * @author mitao |
| | |
| | | private final IComplaintService complaintService; |
| | | private final ISystemUserService systemUserService; |
| | | private final IDepartmentService departmentService; |
| | | private final IComplaintCommentService complaintCommentService; |
| | | |
| | | @PostMapping("/save") |
| | | @ApiOperation(value = "录入诉求") |
| | |
| | | @PostMapping("/assignComplain") |
| | | @ApiOperation(value = "分配诉求") |
| | | public R<?> assignComplain(@Valid@RequestBody AssignComplainDto dto) { |
| | | complaintService.assignComplain(getLoginUserInfo(),dto.getComplainId(),dto.getDeptId(),dto.getRemark()); |
| | | SystemUserVo loginUserInfoWest = getLoginUserInfoWest(); |
| | | LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO(); |
| | | loginUserInfoVO.setPhone(loginUserInfoWest.getPhone()); |
| | | loginUserInfoVO.setUserId(Long.valueOf(loginUserInfoWest.getId())); |
| | | complaintService.assignComplain(loginUserInfoVO,dto.getComplainId(),dto.getDeptId(),dto.getRemark(),dto.getProblemType()); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | |
| | | @ApiOperation("诉求详情") |
| | | @GetMapping("/detail/{id}") |
| | | public R<ComplaintVO> detail(@ApiParam(name = "id", value = "诉求id", required = true) @PathVariable("id") Long id) { |
| | | return R.ok(complaintService.getDetailMgt(id)); |
| | | } |
| | | // @ApiOperation("诉求详情") |
| | | // @GetMapping("/detail/{id}") |
| | | // public R<ComplaintVO> detail(@ApiParam(name = "id", value = "诉求id", required = true) @PathVariable("id") Long id) { |
| | | // return R.ok(complaintService.getDetailMgt(id)); |
| | | // } |
| | | @ApiOperation("导出") |
| | | @PostMapping("/export") |
| | | @SysLog(operatorCategory = "诉求导出",operId = 9) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("社区问题单、问题处理单、协调通知单 下载") |
| | | @GetMapping("/download-file/{id}/{type}") |
| | | @SysLog(operatorCategory = "单导出",operId = 10) |
| | |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ApiOperation("诉求详情") |
| | | @GetMapping("/detail/{id}") |
| | | public R<ComplaintVO> detail(Long id) { |
| | | SystemUserVo loginUserInfoWest = getLoginUserInfoWest(); |
| | | LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO(); |
| | | loginUserInfoVO.setPhone(loginUserInfoWest.getPhone()); |
| | | loginUserInfoVO.setUserId(Long.valueOf(loginUserInfoWest.getId())); |
| | | return R.ok(complaintService.detail(id,loginUserInfoVO)); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/save-process") |
| | | @ApiOperation("办理进度录入") |
| | | public R<?> saveProcess(@Valid @RequestBody ComplaintProcessDTO dto){ |
| | | SystemUserVo loginUserInfoWest = getLoginUserInfoWest(); |
| | | LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO(); |
| | | loginUserInfoVO.setPhone(loginUserInfoWest.getPhone()); |
| | | complaintService.saveProcess(dto,loginUserInfoVO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/save-result") |
| | | @ApiOperation("办理结果录入") |
| | | public R<?> saveResult(@RequestBody ComplaintCompletionDTO dto){ |
| | | SystemUserVo loginUserInfoWest = getLoginUserInfoWest(); |
| | | LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO(); |
| | | loginUserInfoVO.setPhone(loginUserInfoWest.getPhone()); |
| | | loginUserInfoVO.setUserId(Long.valueOf(loginUserInfoWest.getId())); |
| | | complaintService.saveResult(dto,loginUserInfoVO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 问题上报 |
| | | */ |
| | | @PostMapping("/report") |
| | | @ApiOperation(value = "问题上报") |
| | | public R<?> report(@RequestBody ComplaintReportDTO complaintReportDTO) { |
| | | SystemUserVo loginUserInfoWest = getLoginUserInfoWest(); |
| | | LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO(); |
| | | loginUserInfoVO.setPhone(loginUserInfoWest.getPhone()); |
| | | loginUserInfoVO.setUserId(Long.valueOf(loginUserInfoWest.getId())); |
| | | complaintService.saveReport(complaintReportDTO, loginUserInfoVO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 延期申请 |
| | | */ |
| | | @PostMapping("/saveDelay") |
| | | @ApiOperation(value = "延期申请") |
| | | public R<?> saveDelay(@Valid @RequestBody ComplaintDelayDTO dto){ |
| | | SystemUserVo loginUserInfoWest = getLoginUserInfoWest(); |
| | | LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO(); |
| | | loginUserInfoVO.setPhone(loginUserInfoWest.getPhone()); |
| | | loginUserInfoVO.setUserId(Long.valueOf(loginUserInfoWest.getId())); |
| | | complaintService.saveDelay(dto, loginUserInfoVO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 延期审核 |
| | | */ |
| | | @PostMapping("/delayAudit") |
| | | @ApiOperation(value = "延期审核") |
| | | public R<?> delayAudit(@RequestBody ComplaintDelayAuditDTO dto) { |
| | | SystemUserVo loginUserInfoWest = getLoginUserInfoWest(); |
| | | LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO(); |
| | | loginUserInfoVO.setPhone(loginUserInfoWest.getPhone()); |
| | | loginUserInfoVO.setUserId(Long.valueOf(loginUserInfoWest.getId())); |
| | | complaintService.delayAudit(dto, loginUserInfoVO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 上报审核 |
| | | */ |
| | | @PostMapping("/reportAudit") |
| | | @ApiOperation(value = "问题上报审核并指派") |
| | | public R<?> reportAudit(@RequestBody ComplaintReporAuditDTO dto) { |
| | | SystemUserVo loginUserInfoWest = getLoginUserInfoWest(); |
| | | LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO(); |
| | | loginUserInfoVO.setPhone(loginUserInfoWest.getPhone()); |
| | | loginUserInfoVO.setUserId(Long.valueOf(loginUserInfoWest.getId())); |
| | | complaintService.reportAudit(dto, loginUserInfoVO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/setProblemType") |
| | | @ApiOperation(value = "分配问题类型") |
| | | public R<?> assignComplain(@Valid @RequestBody SetProblemTypeDto dto) { |
| | | SystemUserVo loginUserInfoWest = getLoginUserInfoWest(); |
| | | LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO(); |
| | | loginUserInfoVO.setPhone(loginUserInfoWest.getPhone()); |
| | | loginUserInfoVO.setUserId(Long.valueOf(loginUserInfoWest.getId())); |
| | | // 判断是否管理员 |
| | | complaintService.setProblemType(loginUserInfoVO,dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 评价诉求 |
| | | * @param complaintComment |
| | | * @return |
| | | */ |
| | | @PostMapping("/commentComplaint") |
| | | @ApiOperation(value = "评价诉求") |
| | | public R<?> commentComplaint(@RequestBody ComplaintComment complaintComment){ |
| | | SystemUserVo loginUserInfoWest = getLoginUserInfoWest(); |
| | | LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO(); |
| | | loginUserInfoVO.setPhone(loginUserInfoWest.getPhone()); |
| | | loginUserInfoVO.setUserId(Long.valueOf(loginUserInfoWest.getId())); |
| | | int count = complaintCommentService.count(new LambdaQueryWrapper<ComplaintComment>().eq(ComplaintComment::getComplaintId, complaintComment.getComplaintId()) |
| | | .eq(ComplaintComment::getDelFlag, 0)); |
| | | if(0 != count){ |
| | | return R.fail("不能重复评价"); |
| | | } |
| | | Long userId = loginUserInfoVO.getUserId(); |
| | | complaintComment.setUserId(userId); |
| | | complaintComment.setCreateTime(new Date()); |
| | | complaintComment.setCreateBy(userId); |
| | | complaintComment.setUpdateBy(userId); |
| | | complaintComment.setUpdateTime(new Date()); |
| | | complaintComment.setDelFlag(0); |
| | | complaintCommentService.save(complaintComment); |
| | | Complaint complaint = complaintService.getById(complaintComment.getComplaintId()); |
| | | complaint.setStatus(8); |
| | | complaint.setCommentRate(complaintComment.getRate()); |
| | | complaintService.updateById(complaint); |
| | | // 不满意 重新生成诉求 |
| | | if(complaintComment.getRate()==0){ |
| | | // 获取当前日期(年月日) |
| | | String datePrefix = new SimpleDateFormat("yyyyMMdd").format(new Date()); |
| | | |
| | | // 查询当前日期的最大流水号 |
| | | Complaint lastComplaint = complaintService.getOne(new LambdaQueryWrapper<Complaint>() |
| | | .likeRight(Complaint::getSerialNumber, datePrefix) // 查询以当前日期开头的流水号 |
| | | .orderByDesc(Complaint::getSerialNumber) |
| | | .last("limit 1")); |
| | | |
| | | String serialNumber; |
| | | if (isNull(lastComplaint)) { |
| | | // 如果当天没有记录,从 0001 开始 |
| | | serialNumber = datePrefix + "0001"; |
| | | } else { |
| | | // 获取当前日期的最大流水号,并递增 |
| | | String lastSerialNumber = lastComplaint.getSerialNumber(); |
| | | int num = Integer.parseInt(lastSerialNumber.substring(lastSerialNumber.length() - 4)); // 提取后4位数字 |
| | | serialNumber = datePrefix + String.format("%04d", num + 1); // 递增并格式化为4位 |
| | | } |
| | | Complaint complaint1 = new Complaint(); |
| | | BeanUtils.copyProperties(complaint,complaint1); |
| | | complaint1.setStatus(0); |
| | | complaint1.setSerialNumber(serialNumber); |
| | | complaint1.setAssignStatus(0); |
| | | complaint1.setCreateTime(new Date()); |
| | | complaint1.setId(null); |
| | | complaint1.setCompletionTime(null); |
| | | complaint1.setCompletionUserId(null); |
| | | complaint1.setCompletionUsername(null); |
| | | complaint1.setCompletionUserPhone(null); |
| | | complaint1.setCompletionImages(null); |
| | | complaint1.setCompletionUserLevel(null); |
| | | complaint1.setCompletionDescription(null); |
| | | complaint1.setCompletionVideos(null); |
| | | complaint1.setCompletionOtherDescription(null); |
| | | complaint1.setRemark(null); |
| | | complaint1.setNowLevelTime(new Date()); |
| | | complaint1.setNowLevelSms(0); |
| | | complaint1.setRedispatch(1); |
| | | complaintService.save(complaint1); |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 上报撤回 |
| | | */ |
| | | @PostMapping("/revoke") |
| | | @ApiOperation(value = "诉求上报撤回") |
| | | public R<?> reportWithdraw(@RequestBody ComplaintReportWithdrawDTO dto) { |
| | | SystemUserVo loginUserInfoWest = getLoginUserInfoWest(); |
| | | LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO(); |
| | | loginUserInfoVO.setPhone(loginUserInfoWest.getPhone()); |
| | | loginUserInfoVO.setUserId(Long.valueOf(loginUserInfoWest.getId())); |
| | | complaintService.reportWithdraw(dto, loginUserInfoVO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.panzhihua.westcommittee.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.interfaces.OperLog; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.westcommittee.model.entity.SystemMenu; |
| | |
| | | @Api |
| | | @RestController |
| | | @RequestMapping("/systemMenu") |
| | | public class SystemMenuController { |
| | | public class SystemMenuController extends BaseController { |
| | | |
| | | @Resource |
| | | private ISystemMenuService systemMenuService; |
| | |
| | | @ApiOperation(value = "获取菜单列表", tags = {"西区纪委后台-角色管理"}) |
| | | @OperLog(operModul = "西区纪委后台",operType = 0, businessType = "获取菜单列表") |
| | | public R<List<SystemMenu>> getSystemMenuList(){ |
| | | return R.ok(systemMenuService.getSystemMenuList()); |
| | | return R.ok(systemMenuService.getSystemMenuList(getLoginUserInfoWest())); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.interfaces.OperLog; |
| | | import com.panzhihua.common.model.vos.LoginReturnVO; |
| | |
| | | Set<String> collect1 = new HashSet<>(); |
| | | if(collect.size() > 0){ |
| | | LambdaQueryWrapper<SystemMenu> queryWrapper = new LambdaQueryWrapper<SystemMenu>().in(SystemMenu::getId, collect); |
| | | switch (systemUser.getAccountLevel()){ |
| | | case 3: |
| | | if(systemUser.getSystemRoleId()!=1){ |
| | | queryWrapper.notIn(SystemMenu::getUrl, Arrays.asList("/system_setting/position_management", "/system_setting/position_management/add", "/system_setting/position_management/del", |
| | | "/system_setting/role_management", "/system_setting/role_management/add", "/system_setting/role_management/edit", "/system_setting/role_management/del", |
| | | "/work_order_transaction_management/work_order_item_configuration", "/work_order_transaction_management/work_order_item_configuration/save", |
| | | "/work_order_transaction_management/problem_type_management", "/work_order_transaction_management/problem_type_management/add", |
| | | "/work_order_transaction_management/problem_type_management/edit", "/work_order_transaction_management/problem_type_management/del", "/work_order_transaction_management/banner_management", |
| | | "/work_order_transaction_management/banner_management/add", "/work_order_transaction_management/banner_management/edit", "/work_order_transaction_management/banner_management/del")); |
| | | break; |
| | | case 4: |
| | | queryWrapper.notIn(SystemMenu::getUrl, Arrays.asList("/system_setting/position_management", "/system_setting/position_management/add", "/system_setting/position_management/del", |
| | | "/system_setting/role_management", "/system_setting/role_management/add", "/system_setting/role_management/edit", "/system_setting/role_management/del", |
| | | "/work_order_transaction_management/work_order_item_configuration", "/work_order_transaction_management/work_order_item_configuration/save", |
| | | "/work_order_transaction_management/problem_type_management", "/work_order_transaction_management/problem_type_management/add", |
| | | "/work_order_transaction_management/problem_type_management/edit", "/work_order_transaction_management/problem_type_management/del", "/work_order_transaction_management/banner_management", |
| | | "/work_order_transaction_management/banner_management/add", "/work_order_transaction_management/banner_management/edit", "/work_order_transaction_management/banner_management/del")); |
| | | break; |
| | | case 5: |
| | | queryWrapper.notIn(SystemMenu::getUrl, Arrays.asList("/system_setting/position_management", "/system_setting/position_management/add", "/system_setting/position_management/del", |
| | | "/system_setting/role_management", "/system_setting/role_management/add", "/system_setting/role_management/edit", "/system_setting/role_management/del", |
| | | "/system_setting/people_management", "/system_setting/people_management/add", "/system_setting/people_management/edit", "/system_setting/people_management/del", |
| | | "/system_setting/people_management/freeze", "/system_setting/unit_management", "/system_setting/people_management/detail", "/system_setting/unit_management/add", |
| | | "/system_setting/unit_management/edit", "/system_setting/unit_management/del", "/work_order_transaction_management/work_order_item_configuration", |
| | | "/work_order_transaction_management/work_order_item_configuration/save", "/work_order_transaction_management/problem_type_management", |
| | | "/work_order_transaction_management/problem_type_management/add", "/work_order_transaction_management/problem_type_management/edit", |
| | | "/work_order_transaction_management/problem_type_management/del", "/work_order_transaction_management/banner_management", |
| | | "/work_order_transaction_management/banner_management/add", "/work_order_transaction_management/banner_management/edit", "/work_order_transaction_management/banner_management/del")); |
| | | break; |
| | | "/work_order_transaction_management/banner_management/add", "/work_order_transaction_management/banner_management/edit", "/work_order_transaction_management/banner_management/del","/complaint/assign")); |
| | | } |
| | | List<SystemMenu> systemMenus = systemMenuService.list(queryWrapper); |
| | | collect1 = systemMenus.stream().map(SystemMenu::getUrl).collect(Collectors.toSet()); |
| | |
| | | public R<IPage<SystemUserListVo>> list(SystemUserList query){ |
| | | Integer id = this.getLoginUserInfoWest().getId(); |
| | | SystemUser user = systemUserService.getById(id); |
| | | if(user.getSystemRoleId()!=1){ |
| | | return R.ok(new Page<>()); |
| | | } |
| | | IPage<SystemUserListVo> list = systemUserService.list(user, query); |
| | | return R.ok(list); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.westcommittee.annotation.DistributedLock; |
| | | import com.panzhihua.westcommittee.model.dto.*; |
| | |
| | | import com.panzhihua.westcommittee.service.IComplaintService; |
| | | import com.panzhihua.westcommittee.service.IProblemTypeService; |
| | | import com.panzhihua.westcommittee.warpper.GetHouseAddressQuery; |
| | | import com.panzhihua.westcommittee.warpper.IdentityInformation; |
| | | import io.swagger.annotations.*; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.checkerframework.checker.units.qual.C; |
| | |
| | | @PostMapping("/save-process") |
| | | @ApiOperation("办理进度录入") |
| | | public R<?> saveProcess(@Valid @RequestBody ComplaintProcessDTO dto){ |
| | | Complaint byId = complaintService.getById(dto.getComplaintId()); |
| | | if(byId.getAssignStatus()==0){ |
| | | return R.fail("该诉求未分配"); |
| | | } |
| | | complaintService.saveProcess(dto,getLoginUserInfo()); |
| | | return R.ok(); |
| | | } |
| | |
| | | @PostMapping("/report") |
| | | @ApiOperation(value = "问题上报") |
| | | public R<?> report(@RequestBody ComplaintReportDTO complaintReportDTO) { |
| | | Complaint byId = complaintService.getById(complaintReportDTO.getComplaintId()); |
| | | if(byId.getAssignStatus()==0){ |
| | | return R.fail("该诉求未分配"); |
| | | } |
| | | |
| | | |
| | | complaintService.saveReport(complaintReportDTO, getLoginUserInfo()); |
| | | return R.ok(); |
| | | } |
| | |
| | | @PostMapping("/saveDelay") |
| | | @ApiOperation(value = "延期申请") |
| | | public R<?> saveDelay(@Valid @RequestBody ComplaintDelayDTO dto){ |
| | | Complaint byId = complaintService.getById(dto.getComplaintId()); |
| | | if(byId.getAssignStatus()==0){ |
| | | return R.fail("该诉求未分配"); |
| | | } |
| | | complaintService.saveDelay(dto, getLoginUserInfo()); |
| | | return R.ok(); |
| | | } |
| | |
| | | @ApiOperation(value = "分配诉求") |
| | | public R<?> assignComplain(@Valid@RequestBody AssignComplainDto dto) { |
| | | |
| | | complaintService.assignComplain(getLoginUserInfo(),dto.getComplainId(),dto.getDeptId(),dto.getRemark()); |
| | | complaintService.assignComplain(getLoginUserInfo(),dto.getComplainId(),dto.getDeptId(),dto.getRemark(),dto.getProblemType()); |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/setProblemType") |
| | | @ApiOperation(value = "分配问题类型") |
| | | public R<?> assignComplain(@Valid @RequestBody SetProblemTypeDto dto) { |
| | | // 判断是否管理员 |
| | | complaintService.setProblemType(getLoginUserInfo(),dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 评价诉求 |
| | |
| | | public R<?> edit(@Valid @RequestBody PartyMemberApplicationRequest dto) { |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | String phone = loginUserInfo.getPhone(); |
| | | PartyMember partyMember = partyMemberService.getOne(new LambdaUpdateWrapper<PartyMember>() |
| | | PartyMember partyMember = partyMemberService.getOne(new LambdaQueryWrapper<PartyMember>() |
| | | .eq(PartyMember::getPhone, phone)); |
| | | if (partyMember == null){ |
| | | return R.fail("请先完善党员信息"); |
| | |
| | | public R<?> detail() { |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | String phone = loginUserInfo.getPhone(); |
| | | return R.ok(partyMemberService.getOne(new LambdaUpdateWrapper<PartyMember>() |
| | | return R.ok(partyMemberService.getOne(new LambdaQueryWrapper<PartyMember>() |
| | | .eq(PartyMember::getPhone, phone) |
| | | .eq(PartyMember::getDelFlag, 0))); |
| | | } |
| | |
| | | package com.panzhihua.westcommittee.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.west.SystemUserVo; |
| | | import com.panzhihua.westcommittee.model.entity.ComAct; |
| | | import com.panzhihua.westcommittee.model.entity.ComStreet; |
| | | import com.panzhihua.westcommittee.model.entity.Complaint; |
| | | import com.panzhihua.westcommittee.model.entity.SystemUser; |
| | | import com.panzhihua.westcommittee.model.query.AnalyticStatisticsQuery; |
| | | import com.panzhihua.westcommittee.model.query.AppStaticsQuery; |
| | | import com.panzhihua.westcommittee.model.vo.AnalyticStatisticsFourVo; |
| | | import com.panzhihua.westcommittee.model.vo.AnalyticStatisticsOneVo; |
| | | import com.panzhihua.westcommittee.model.vo.AnalyticStatisticsThreeVo; |
| | | import com.panzhihua.westcommittee.model.vo.AnalyticStatisticsTwoVo; |
| | | import com.panzhihua.westcommittee.model.vo.RegionVO; |
| | | import com.panzhihua.westcommittee.model.vo.*; |
| | | import com.panzhihua.westcommittee.service.IComActService; |
| | | import com.panzhihua.westcommittee.service.IComStreetService; |
| | | import com.panzhihua.westcommittee.service.IComplaintService; |
| | | import com.panzhihua.westcommittee.service.IdentityInformationService; |
| | | import com.panzhihua.westcommittee.service.impl.StaticsService; |
| | | import com.panzhihua.westcommittee.warpper.IdentityInformation; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author mitao |
| | |
| | | @RequiredArgsConstructor(onConstructor_ = {@Lazy}) |
| | | public class StaticsController extends BaseController { |
| | | private final StaticsService staticsService; |
| | | private final IdentityInformationService identityInformationService; |
| | | private final IComStreetService comStreetService; |
| | | private final IComActService comActService; |
| | | private final IComplaintService complaintService; |
| | | |
| | | @GetMapping("/region-tree") |
| | | @ApiOperation("获取区域树") |
| | |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | return R.ok(staticsService.queryStaticsPartFour(query,loginUserInfo)); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/data") |
| | | @ApiOperation(value = "分析统计", tags = {"西区纪委小程序-分析统计"}) |
| | | public R<AnalyticStatisticsDataVo> data(@Valid @RequestBody AnalyticStatisticsQuery query){ |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | IdentityInformation identityInformation = identityInformationService.getIdentityInformation(loginUserInfo); |
| | | SystemUser systemUser = identityInformation.getSystemUser(); |
| | | AnalyticStatisticsDataVo analyticStatisticsDataVo = new AnalyticStatisticsDataVo(); |
| | | if(systemUser==null || systemUser.getSystemRoleId()>2){ |
| | | return R.ok(analyticStatisticsDataVo); |
| | | } |
| | | Integer accountLevel = systemUser.getAccountLevel(); |
| | | LambdaQueryWrapper<Complaint> wrapper = new LambdaQueryWrapper<>(); |
| | | if(query.getDistrictCode()!=null){ |
| | | // 没有市权限 也没有该区权限 |
| | | if(accountLevel!=2){ |
| | | throw new ServiceException("没有该区县权限"); |
| | | } |
| | | wrapper.eq(Complaint::getSuperiorId, query.getDistrictCode()); |
| | | } |
| | | if(query.getStreetId()!=null){ |
| | | // 获取街道上一级查看是否有上级权限 |
| | | ComStreet comStreet = comStreetService.getById(query.getStreetId()); |
| | | if(comStreet==null){ |
| | | throw new ServiceException("没有该街道权限"); |
| | | } |
| | | // 没有市级 上级区县 本级街道权限 |
| | | if(accountLevel==2 || (accountLevel==3 && systemUser.getDistrictsCode().equals(query.getDistrictCode().toString()))){ |
| | | wrapper.eq(Complaint::getSuperiorId, query.getStreetId()); |
| | | }else { |
| | | throw new ServiceException("没有该街道权限"); |
| | | } |
| | | } |
| | | |
| | | if(query.getCommunityId()!=null){ |
| | | |
| | | ComAct comAct = comActService.getById(query.getCommunityId()); |
| | | if (comAct == null) { |
| | | throw new ServiceException("没有该社区权限"); |
| | | } |
| | | |
| | | // 判断是否有上面的4个权限 |
| | | if(accountLevel==2 || (accountLevel==3 && systemUser.getDistrictsCode().equals(comAct.getStreetId().toString()) || accountLevel==4 && systemUser.getCommunityId().equals(comAct.getCommunityId()))){ |
| | | wrapper.eq(Complaint::getSuperiorId, query.getCommunityId()); |
| | | }else { |
| | | throw new ServiceException("没有该社区权限"); |
| | | } |
| | | } |
| | | |
| | | // 都为空 查他有的 |
| | | if(query.getCityCode()==null && query.getDistrictCode()==null && query.getStreetId()==null && query.getCommunityId()==null){ |
| | | if(systemUser.getSystemRoleId()==1 || systemUser.getSystemRoleId()==2){ |
| | | if(systemUser.getSystemRoleId()==1){ |
| | | wrapper.ne(Complaint::getProblemType,"检举"); |
| | | } |
| | | if(accountLevel==3){ |
| | | String streetId = systemUser.getStreetId(); |
| | | List<Long> ids = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, streetId)).stream().map(ComAct::getCommunityId).collect(Collectors.toList()); |
| | | wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel()).or(wrapper1 ->wrapper1.in(Complaint::getSuperiorId,ids).eq(Complaint::getNowLevel,4)); |
| | | } |
| | | if(accountLevel==4){ |
| | | wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel()); |
| | | } |
| | | }else { |
| | | wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel()) |
| | | .eq(Complaint::getAssignPersonId,systemUser.getOneDepartmentId()); |
| | | } |
| | | } |
| | | |
| | | |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | List<Complaint> complaints =complaintService.list(wrapper); |
| | | // 第一部分数据 |
| | | AnalyticStatisticsOneVo analyticStatisticsOneVo = complaintService.analyticStatisticsOne(query,complaints,simpleDateFormat,systemUser.getAccountLevel()); |
| | | |
| | | // 第二部分数据 |
| | | List<AnalyticStatisticsTwoVo> analyticStatisticsTwoVos =complaintService.analyticStatisticsTwo(query.getTime(),complaints,simpleDateFormat); |
| | | |
| | | // 第三部分数据 |
| | | List<AnalyticStatisticsThreeVo> analyticStatisticsThreeVos =complaintService.analyticStatisticsThree(query.getRank(), complaints); |
| | | |
| | | // 第四部分数据 |
| | | AnalyticStatisticsFourVo analyticStatisticsFourVos =complaintService.analyticStatisticsFour(complaints); |
| | | |
| | | |
| | | analyticStatisticsDataVo.setAnalyticStatisticsOneVo(analyticStatisticsOneVo); |
| | | analyticStatisticsDataVo.setAnalyticStatisticsTwoVos(analyticStatisticsTwoVos); |
| | | analyticStatisticsDataVo.setAnalyticStatisticsThreeVos(analyticStatisticsThreeVos); |
| | | analyticStatisticsDataVo.setAnalyticStatisticsFourVo(analyticStatisticsFourVos); |
| | | return R.ok(analyticStatisticsDataVo); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | Page<ComplaintVO> pageList(Page<ComplaintVO> page, @Param("query") MgtComplaintQuery query, @Param("loginUserInfo") SystemUserVo loginUserInfo); |
| | | |
| | | List<ComplaintVO> pageListExport(@Param("query") MgtComplaintQuery query, @Param("loginUserInfo") SystemUserVo loginUserInfo); |
| | | |
| | | /** |
| | | * 诉求列表 |
| | | * @param query |
| | |
| | | Page<AppComplaintRejectVO> queryRejectRecordPage(Page<ComplaintVO> page, @Param("keyword") String keyword, |
| | | @Param("accountLevel") Integer accountLevel, @Param("targetId") Long targetId); |
| | | |
| | | List<Complaint> queryCompliantList(@Param("targetId") Long targetId, @Param("accountLevel") Integer accountLevel, @Param("loginUserInfo") LoginUserInfoVO loginUserInfo, @Param("query")AppStaticsQuery query); |
| | | |
| | | List<Complaint> getStatusForList(@Param("ids") List<Long> ids); |
| | | List<Complaint> getStatusForList(@Param("ids") List<Long> ids, @Param("level") Integer level); |
| | | |
| | | |
| | | |
| | | Page<ComplaintVO> selectComplaintPage3(@Param("page") Page<ComplaintVO> page, @Param("query") ComplaintQuery query, @Param("accountLevel") Integer accountLevel, @Param("targetId") Long targetId); |
| | | Page<ComplaintVO> selectComplaintPage3(@Param("page") Page<ComplaintVO> page, @Param("query") ComplaintQuery query, @Param("accountLevel") Integer accountLevel, @Param("targetId") Long targetId, @Param("roleId") Integer roleId); |
| | | |
| | | Page<ComplaintVO> selectComplaintPage4(@Param("page") Page<ComplaintVO> page, @Param("query") ComplaintQuery query, @Param("oneDepartmentId") Integer oneDepartmentId); |
| | | |
| | | |
| | | Page<ComplaintVO> selectComplaintPage5(@Param("page") Page<ComplaintVO> page, @Param("query") ComplaintQuery query, @Param("streetId") String streetId,@Param("ids") List<Long> ids); |
| | | Page<ComplaintVO> selectComplaintPage5(@Param("page") Page<ComplaintVO> page, @Param("query") ComplaintQuery query, @Param("streetId") String streetId,@Param("ids") List<Long> ids,@Param("roleId") Integer roleId); |
| | | |
| | | |
| | | Page<ComplaintVO> selectComplaintPage6(@Param("page") Page<ComplaintVO> page, @Param("query") ComplaintQuery query, @Param("communityId") Long communityId, @Param("ids") List<Integer> ids); |
| | | Page<ComplaintVO> selectComplaintPage6(@Param("page") Page<ComplaintVO> page, @Param("query") ComplaintQuery query, @Param("communityId") Long communityId, @Param("ids") List<Integer> ids,@Param("roleId") Integer roleId); |
| | | |
| | | Page<ComplaintVO> pageScreenList(@Param("page") Page<ComplaintVO> page, @Param("query") ScreenComplaintQuery query); |
| | | |
| | |
| | | |
| | | Page<ComplaintVO> pageList1(Page<ComplaintVO> page, @Param("query") MgtComplaintQuery query, @Param("loginUserInfo") SystemUserVo loginUserInfo); |
| | | |
| | | List<ComplaintVO> pageList1Export(@Param("query") MgtComplaintQuery query, @Param("loginUserInfo") SystemUserVo loginUserInfo); |
| | | |
| | | Page<ComplaintVO> pageList2(@Param("objectPage") Page<Object> objectPage, @Param("query") MgtComplaintQuery query, @Param("loginUserInfo") SystemUserVo loginUserInfo, @Param("ids") List<Long> communityIds); |
| | | |
| | | List<ComplaintVO> pageList2Export( @Param("query") MgtComplaintQuery query, @Param("loginUserInfo") SystemUserVo loginUserInfo, @Param("ids") List<Long> communityIds); |
| | | |
| | | |
| | | Page<ComplaintVO> pageList3(@Param("objectPage") Page<Object> objectPage, @Param("query") MgtComplaintQuery query, @Param("loginUserInfo") SystemUserVo loginUserInfo); |
| | | |
| | | List<ComplaintVO> pageList3Export(@Param("query") MgtComplaintQuery query, @Param("loginUserInfo") SystemUserVo loginUserInfo); |
| | | |
| | | |
| | | List<Complaint> queryCompliantList(@Param("accountLevel") Integer accountLevel, @Param("systemRoleId") Integer systemRoleId, @Param("query") AppStaticsQuery query); |
| | | |
| | | } |
| | |
| | | |
| | | String getCreateByIdPhone(@Param("createBy") Long createBy); |
| | | |
| | | IPage<SystemUserListVo> list1(@Param("page") Page page, @Param("user") SystemUser user, @Param("query") SystemUserList query, @Param("deptIds") List<Integer> deptIds); |
| | | |
| | | } |
| | |
| | | EXTENDED(1, "延期办理"), |
| | | OVERDUE(2, "超时办理"), |
| | | COMPLETED(3, "已办结"), |
| | | REPORT_PENDING_AUDIT(4, "上报待审核"), |
| | | REPORT_PENDING_AUDIT(5, "上报待审核"), |
| | | FINISHED(8, "已办结");//用于导出枚举值映射,实际状态为已评论 |
| | | private final Integer code; |
| | | private final String desc; |
| | |
| | | @ApiModelProperty("部门id") |
| | | @NotNull |
| | | private Integer deptId; |
| | | |
| | | @ApiModelProperty("问题类型") |
| | | private String problemType; |
| | | |
| | | @ApiModelProperty("备注") |
| | | private String remark; |
| | | } |
| | |
| | | private Long superiorId; |
| | | private Date closingTime; |
| | | |
| | | private String problemType; |
| | | private Integer nowLevel; |
| | | |
| | | private Integer assignStatus; |
New file |
| | |
| | | package com.panzhihua.westcommittee.model.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel("分配问题类型Dto") |
| | | public class SetProblemTypeDto { |
| | | @ApiModelProperty("诉求id") |
| | | @NotNull(message = "诉求id不能为空") |
| | | private Long complaintId; |
| | | |
| | | @ApiModelProperty("问题类型") |
| | | @NotBlank(message = "问题类型不能为空") |
| | | private String problemType; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "问题类型(事件类型)") |
| | | @TableField("problem_type") |
| | | @NotBlank(message = "问题类型不能为空") |
| | | private String problemType; |
| | | |
| | | @ApiModelProperty(value = "群众姓名(诉求人)") |
| | |
| | | ); |
| | | |
| | | if(!complaintTimeoutList.isEmpty()) { |
| | | // 后续当前不在发送 |
| | | // 当前不在发送 |
| | | complaintService.update(new LambdaUpdateWrapper<Complaint>().in(Complaint::getId, complaintTimeoutList.stream().map(ComplaintTimeout::getComplaintId).collect(Collectors.toList())).set(Complaint::getNowLevelSms, 1)); |
| | | |
| | | } |
| | |
| | | List<String> districtPhoneList1 = districtUserList.stream().filter(e->e.getSystemRoleId()==2).map(SystemUser::getPhone).collect(Collectors.toList()); |
| | | collect.forEach(complaintTimeout -> { |
| | | // 发送短信 |
| | | if(!districtPhoneList.isEmpty()){ |
| | | if(!districtPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("检举")){ |
| | | AliSmsUtil.sendTimeoutMessageAdmin(districtPhoneList,complaintTimeout.getSerialNumber()); |
| | | } |
| | | if(!districtPhoneList1.isEmpty()){ |
| | |
| | | List<String> districtPhoneList2 = systemUsers.stream().filter(e->e.getSystemRoleId()==1).map(SystemUser::getPhone).collect(Collectors.toList()); |
| | | List<String> districtPhoneList3 = systemUsers.stream().filter(e->e.getSystemRoleId()==2).map(SystemUser::getPhone).collect(Collectors.toList()); |
| | | // 发送短信 |
| | | if(!districtPhoneList2.isEmpty()){ |
| | | if(!districtPhoneList2.isEmpty() && !complaintTimeout.getProblemType().equals("检举")){ |
| | | AliSmsUtil.sendTimeoutMessageAdmin(districtPhoneList2,complaintTimeout.getSerialNumber()); |
| | | } |
| | | if(!districtPhoneList3.isEmpty()){ |
| | |
| | | } |
| | | }else { |
| | | // 发送短信 |
| | | if(!districtPhoneList.isEmpty()){ |
| | | if(!districtPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("检举")){ |
| | | AliSmsUtil.sendTimeoutMessageAdmin(districtPhoneList,complaintTimeout.getSerialNumber()); |
| | | } |
| | | if(!districtPhoneList1.isEmpty()){ |
| | |
| | | List<String> streetPhoneList = streetUserList.stream().filter(e->e.getSystemRoleId()==1 && e.getStreetId().equals(complaintTimeout.getSuperiorId().toString())).map(SystemUser::getPhone).collect(Collectors.toList()); |
| | | List<String> streetPhoneList1 = streetUserList.stream().filter(e->e.getSystemRoleId()==2 && e.getStreetId().equals(complaintTimeout.getSuperiorId().toString())).map(SystemUser::getPhone).collect(Collectors.toList()); |
| | | // 发送短信 |
| | | if(!streetPhoneList.isEmpty()){ |
| | | if(!streetPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("检举")){ |
| | | AliSmsUtil.sendTimeoutMessageAdmin(streetPhoneList,complaintTimeout.getSerialNumber()); |
| | | } |
| | | if(!streetPhoneList1.isEmpty()){ |
| | |
| | | List<String> streetPhoneList2 = systemUsers.stream().filter(e->e.getSystemRoleId()==1).map(SystemUser::getPhone).collect(Collectors.toList()); |
| | | List<String> streetPhoneList3 = systemUsers.stream().filter(e->e.getSystemRoleId()==2).map(SystemUser::getPhone).collect(Collectors.toList()); |
| | | // 发送短信 |
| | | if(!streetPhoneList2.isEmpty()){ |
| | | if(!streetPhoneList2.isEmpty() && !complaintTimeout.getProblemType().equals("检举")){ |
| | | AliSmsUtil.sendTimeoutMessageAdmin(streetPhoneList2,complaintTimeout.getSerialNumber()); |
| | | } |
| | | if(!streetPhoneList3.isEmpty()){ |
| | |
| | | List<String> streetPhoneList = streetUserList.stream().filter(e->e.getSystemRoleId()==1 && e.getStreetId().equals(complaintTimeout.getSuperiorId().toString())).map(SystemUser::getPhone).collect(Collectors.toList()); |
| | | List<String> streetPhoneList1 = streetUserList.stream().filter(e->e.getSystemRoleId()==2 && e.getStreetId().equals(complaintTimeout.getSuperiorId().toString())).map(SystemUser::getPhone).collect(Collectors.toList()); |
| | | // 发送短信 |
| | | if(!streetPhoneList.isEmpty()){ |
| | | if(!streetPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("检举")){ |
| | | AliSmsUtil.sendTimeoutMessageAdmin(streetPhoneList,complaintTimeout.getSerialNumber()); |
| | | } |
| | | if(!streetPhoneList1.isEmpty()){ |
| | |
| | | if (!CollectionUtils.isEmpty(communityTimeOutList)){ |
| | | List<ComplaintTimeout> collect = communityTimeOutList.stream().filter(e -> e.getAssignStatus() == 0).collect(Collectors.toList()); |
| | | |
| | | |
| | | |
| | | List<SystemUser> communityUserList = systemUserService.list(new LambdaQueryWrapper<SystemUser>() |
| | | .eq(SystemUser::getAccountLevel, 4) |
| | | .in(SystemUser::getSystemRoleId,1,2) |
| | |
| | | List<String> communityPhoneList1 = communityUserList.stream().filter(e->e.getSystemRoleId()==2 && e.getCommunityId().equals(complaintTimeout.getSuperiorId())).map(SystemUser::getPhone).collect(Collectors.toList()); |
| | | |
| | | // 发送短信 |
| | | if(!communityPhoneList.isEmpty()){ |
| | | if(!communityPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("检举")){ |
| | | AliSmsUtil.sendTimeoutMessageAdmin(communityPhoneList, complaintTimeout.getSerialNumber()); |
| | | } |
| | | if(!communityPhoneList1.isEmpty()){ |
| | |
| | | List<String> communityPhoneList2 = systemUsers.stream().filter(e->e.getSystemRoleId()==1).map(SystemUser::getPhone).collect(Collectors.toList()); |
| | | List<String> communityPhoneList3 = systemUsers.stream().filter(e->e.getSystemRoleId()==2).map(SystemUser::getPhone).collect(Collectors.toList()); |
| | | // 发送短信 |
| | | if(!communityPhoneList2.isEmpty()){ |
| | | if(!communityPhoneList2.isEmpty() && !complaintTimeout.getProblemType().equals("检举")){ |
| | | AliSmsUtil.sendTimeoutMessageAdmin(communityPhoneList2, complaintTimeout.getSerialNumber()); |
| | | } |
| | | if(!communityPhoneList3.isEmpty()){ |
| | |
| | | List<String> communityPhoneList = communityUserList.stream().filter(e->e.getSystemRoleId()==1 && e.getCommunityId().equals(complaintTimeout.getSuperiorId())).map(SystemUser::getPhone).collect(Collectors.toList()); |
| | | List<String> communityPhoneList1 = communityUserList.stream().filter(e->e.getSystemRoleId()==2 && e.getCommunityId().equals(complaintTimeout.getSuperiorId())).map(SystemUser::getPhone).collect(Collectors.toList()); |
| | | // 发送短信 |
| | | if(!communityPhoneList.isEmpty()){ |
| | | if(!communityPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("检举")){ |
| | | AliSmsUtil.sendTimeoutMessageAdmin(communityPhoneList, complaintTimeout.getSerialNumber()); |
| | | } |
| | | if(!communityPhoneList1.isEmpty()){ |
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | ComplaintVO detail(Long id, LoginUserInfoVO loginUserInfoVO); |
| | | |
| | | /** |
| | | * 保存办理进度 |
| | | * |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | AnalyticStatisticsOneVo analyticStatisticsOne(AnalyticStatisticsQuery query,List<Complaint> complaints, SimpleDateFormat simpleDateFormat); |
| | | AnalyticStatisticsOneVo analyticStatisticsOne(AnalyticStatisticsQuery query,List<Complaint> complaints, SimpleDateFormat simpleDateFormat,Integer level); |
| | | |
| | | |
| | | /** |
| | |
| | | * @param complainId |
| | | * @param userId |
| | | */ |
| | | void assignComplain(LoginUserInfoVO loginUserInfo, Long complainId, Integer userId,String remark); |
| | | void assignComplain(LoginUserInfoVO loginUserInfo, Long complainId, Integer userId,String remark,String problemType); |
| | | |
| | | List<DispatchVO> getAllocationList(LoginUserInfoVO loginUserInfo); |
| | | |
| | |
| | | |
| | | void saveComplaintAdmin(Complaint complaint, SystemUserVo loginUserInfoWest); |
| | | |
| | | void setProblemType(LoginUserInfoVO loginUserInfo, SetProblemTypeDto dto); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.panzhihua.westcommittee.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.vos.west.SystemUserVo; |
| | | import com.panzhihua.westcommittee.model.entity.SystemMenu; |
| | | |
| | | import java.util.List; |
| | |
| | | * 获取获取系统菜单列表 |
| | | * @return |
| | | */ |
| | | List<SystemMenu> getSystemMenuList(); |
| | | List<SystemMenu> getSystemMenuList(SystemUserVo systemUserVo); |
| | | } |
| | |
| | | page = baseMapper.selectComplaintPage2(page, query, accountLevel, targetId); |
| | | } else if (accountLevel == 2) { |
| | | // 西区单位 如果是西区单位,则只看自己上报的 |
| | | if (systemUser.getSystemRoleId() == 1) { |
| | | if (systemUser.getSystemRoleId() == 1 || systemUser.getSystemRoleId() == 2) { |
| | | // 是管理员 看所有的 |
| | | page = baseMapper.selectComplaintPage3(page, query, accountLevel, targetId); |
| | | page = baseMapper.selectComplaintPage3(page, query, accountLevel, targetId,systemUser.getSystemRoleId() ); |
| | | } else { |
| | | // 不是管理员 看到指派给我的单位的诉求 |
| | | page = baseMapper.selectComplaintPage4(page, query, systemUser.getOneDepartmentId()); |
| | | } |
| | | } else if (accountLevel == 3) { |
| | | // 街道 1 |
| | | if (systemUser.getSystemRoleId() == 1) { |
| | | if (systemUser.getSystemRoleId() == 1 || systemUser.getSystemRoleId() == 2) { |
| | | // 获取这个街道所管的社区id |
| | | List<Long> communityIds = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, systemUser.getStreetId())).stream().map(ComAct::getCommunityId).collect(Collectors.toList()); |
| | | // 是管理员 可以看到下派来的 也可以看到上派待审核的 |
| | | page = baseMapper.selectComplaintPage5(page, query, systemUser.getStreetId(), communityIds); |
| | | page = baseMapper.selectComplaintPage5(page, query, systemUser.getStreetId(), communityIds, systemUser.getSystemRoleId()); |
| | | } else { |
| | | // 不是管理员 看指派给我的 |
| | | page = baseMapper.selectComplaintPage4(page, query, systemUser.getOneDepartmentId()); |
| | | } |
| | | } else if (accountLevel == 4) { |
| | | // 社区 |
| | | if (systemUser.getSystemRoleId() == 1) { |
| | | if (systemUser.getSystemRoleId() == 1 || systemUser.getSystemRoleId() == 2) { |
| | | // 是管理员 |
| | | page = baseMapper.selectComplaintPage6(page, query, systemUser.getCommunityId(), null); |
| | | page = baseMapper.selectComplaintPage6(page, query, systemUser.getCommunityId(), null, systemUser.getSystemRoleId()); |
| | | } else { |
| | | // 不是管理员 看到负责社区的所有诉求 和 上级下派来的诉求 |
| | | page = baseMapper.selectComplaintPage4(page, query, systemUser.getOneDepartmentId()); |
| | |
| | | } |
| | | return detail; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | |
| | | */ |
| | | @Override |
| | | public Page<ComplaintVO> pageList(MgtComplaintQuery query, SystemUserVo loginUserInfo) { |
| | | Page<ComplaintVO> complaintVOPage=new Page<>(); |
| | | if (loginUserInfo.getAccountLevel() == 2) { |
| | | if(loginUserInfo.getSystemRoleId()==1 || loginUserInfo.getSystemRoleId()==2){ |
| | | Page<ComplaintVO> complaintVOPage = baseMapper.pageList(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo); |
| | | return complaintVOPage; |
| | | complaintVOPage = baseMapper.pageList(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo); |
| | | }else { |
| | | Page<ComplaintVO> complaintVOPage = baseMapper.pageList1(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo); |
| | | return complaintVOPage; |
| | | complaintVOPage = baseMapper.pageList1(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo); |
| | | } |
| | | } |
| | | if (loginUserInfo.getAccountLevel() == 3) { |
| | | if(loginUserInfo.getSystemRoleId()==1 || loginUserInfo.getSystemRoleId()==2){ |
| | | // 获取这个街道所管的社区id |
| | | List<Long> communityIds = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, loginUserInfo.getStreetId())).stream().map(ComAct::getCommunityId).collect(Collectors.toList()); |
| | | Page<ComplaintVO> complaintVOPage = baseMapper.pageList2(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo,communityIds); |
| | | return complaintVOPage; |
| | | complaintVOPage = baseMapper.pageList2(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo,communityIds); |
| | | }else { |
| | | Page<ComplaintVO> complaintVOPage = baseMapper.pageList1(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo); |
| | | return complaintVOPage; |
| | | complaintVOPage = baseMapper.pageList1(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo); |
| | | } |
| | | } |
| | | if (loginUserInfo.getAccountLevel() == 4) { |
| | | if(loginUserInfo.getSystemRoleId()==1 || loginUserInfo.getSystemRoleId()==2){ |
| | | Page<ComplaintVO> complaintVOPage = baseMapper.pageList3(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo); |
| | | return complaintVOPage; |
| | | complaintVOPage = baseMapper.pageList3(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo); |
| | | }else { |
| | | Page<ComplaintVO> complaintVOPage = baseMapper.pageList1(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo); |
| | | complaintVOPage = baseMapper.pageList1(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo); |
| | | } |
| | | } |
| | | |
| | | for (ComplaintVO record : complaintVOPage.getRecords()) { |
| | | int count = complaintCommentService.count(new LambdaQueryWrapper<ComplaintComment>().eq(ComplaintComment::getComplaintId, record.getId())); |
| | | if (count > 0) { |
| | | record.setEvaluateButtonStatus(1); |
| | | } else { |
| | | if (record.getStatus() == 3 && loginUserInfo.getAccountLevel() == record.getNowLevel()) { |
| | | record.setEvaluateButtonStatus(0); |
| | | } else { |
| | | record.setEvaluateButtonStatus(1); |
| | | } |
| | | } |
| | | } |
| | | return complaintVOPage; |
| | | } |
| | | } |
| | | return new Page<>(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | */ |
| | | @Override |
| | | public void export(MgtComplaintQuery query, SystemUserVo loginUserInfo) throws IOException { |
| | | List<ComplaintVO> list = baseMapper.getList(query, loginUserInfo); |
| | | List<ComplaintVO> list =null; |
| | | |
| | | if (loginUserInfo.getAccountLevel() == 2) { |
| | | if(loginUserInfo.getSystemRoleId()==1 || loginUserInfo.getSystemRoleId()==2){ |
| | | list = baseMapper.pageListExport(query, loginUserInfo); |
| | | }else { |
| | | list = baseMapper.pageList1Export(query, loginUserInfo); |
| | | } |
| | | } |
| | | if (loginUserInfo.getAccountLevel() == 3) { |
| | | if(loginUserInfo.getSystemRoleId()==1 || loginUserInfo.getSystemRoleId()==2){ |
| | | // 获取这个街道所管的社区id |
| | | List<Long> communityIds = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, loginUserInfo.getStreetId())).stream().map(ComAct::getCommunityId).collect(Collectors.toList()); |
| | | list = baseMapper.pageList2Export(query, loginUserInfo,communityIds); |
| | | }else { |
| | | list = baseMapper.pageList1Export( query, loginUserInfo); |
| | | } |
| | | } |
| | | if (loginUserInfo.getAccountLevel() == 4) { |
| | | if(loginUserInfo.getSystemRoleId()==1 || loginUserInfo.getSystemRoleId()==2){ |
| | | list = baseMapper.pageList3Export(query, loginUserInfo); |
| | | }else { |
| | | list = baseMapper.pageList1Export( query, loginUserInfo); |
| | | } |
| | | } |
| | | |
| | | List<ComplaintExcel> complaintExcels = BeanUtil.copyToList(list, ComplaintExcel.class); |
| | | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
| | | response.setCharacterEncoding("utf-8"); |
| | |
| | | .registerWriteHandler(new AutoColumnWidthStrategy()) |
| | | .doWrite(complaintExcels); |
| | | } |
| | | |
| | | // ComplaintVO(reporter=何健豪, reporterId=1676144498628919300, superiorId2=510403, auditCreateBy=1892421828085837826, reporterLevel=2, reporterPhone=null, departmentName=西区-金江镇, reportTime=Tue Jun 03 15:06:01 CST 2025, comment=1111, nickname=null, phone=null, auditorName=null, auditorPhone=null, rejectReason=null, auditTime=null, complaintFlows=null, complaintProgresses=null, auditButtonStatus=null, withdrawButtonStatus=null, rate=null, complaintComment=null, listControlsButtonStatus=null, evaluateButtonStatus=0, voiceFileList=null, progressCount=null, assignmentCount=null, reportCount=null, remindStatus=0, remindTime=null, reportStr=自办, deptName=aa) |
| | | // ComplaintVO(reporter=null, reporterId=null, superiorId2=null, auditCreateBy=null, reporterLevel=null, reporterPhone=null, departmentName=null, reportTime=null, comment=null, nickname=null, phone=null, auditorName=null, auditorPhone=null, rejectReason=null, auditTime=null, complaintFlows=null, complaintProgresses=null, auditButtonStatus=null, withdrawButtonStatus=null, rate=null, complaintComment=null, listControlsButtonStatus=null, evaluateButtonStatus=0, voiceFileList=null, progressCount=null, assignmentCount=null, reportCount=null, remindStatus=0, remindTime=null, reportStr=自办, deptName=aa) |
| | | // ComplaintVO(reporter=刘, reporterId=1552661132500668416, superiorId2=510403, auditCreateBy=1892403820151992322, reporterLevel=2, reporterPhone=null, departmentName=西区-格里坪镇, reportTime=Fri Jun 27 10:04:18 CST 2025, comment=null, nickname=null, phone=null, auditorName=null, auditorPhone=null, rejectReason=null, auditTime=null, complaintFlows=null, complaintProgresses=null, auditButtonStatus=null, withdrawButtonStatus=null, rate=null, complaintComment=null, listControlsButtonStatus=null, evaluateButtonStatus=0, voiceFileList=null, progressCount=null, assignmentCount=null, reportCount=null, remindStatus=0, remindTime=null, reportStr=自办, deptName=null) |
| | | // ComplaintVO(reporter=null, reporterId=null, superiorId2=null, auditCreateBy=null, reporterLevel=null, reporterPhone=null, departmentName=null, reportTime=null, comment=null, nickname=null, phone=null, auditorName=null, auditorPhone=null, rejectReason=null, auditTime=null, complaintFlows=null, complaintProgresses=null, auditButtonStatus=null, withdrawButtonStatus=null, rate=null, complaintComment=null, listControlsButtonStatus=null, evaluateButtonStatus=0, voiceFileList=null, progressCount=null, assignmentCount=null, reportCount=null, remindStatus=0, remindTime=null, reportStr=自办, deptName=aa) |
| | | @Override |
| | | public String downloadFile(Long id, Integer type, SystemUserVo loginUserInfo) throws IOException { |
| | | Complaint complaint = baseMapper.getDetailBg(id); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public AnalyticStatisticsOneVo analyticStatisticsOne(AnalyticStatisticsQuery query, List<Complaint> complaints, SimpleDateFormat simpleDateFormat) { |
| | | public AnalyticStatisticsOneVo analyticStatisticsOne(AnalyticStatisticsQuery query, List<Complaint> complaints, SimpleDateFormat simpleDateFormat,Integer level) { |
| | | String nowYearMonth; |
| | | String lastYearMonth; |
| | | int value = LocalDate.now().getMonth().getValue(); |
| | |
| | | if (CollUtil.isEmpty(ids)) { |
| | | ids.add(0, -1L); |
| | | } |
| | | complaints = this.baseMapper.getStatusForList(ids); |
| | | complaints = this.baseMapper.getStatusForList(ids,level); |
| | | |
| | | AnalyticStatisticsOneVo vo = new AnalyticStatisticsOneVo(); |
| | | |
| | |
| | | @Override |
| | | public List<Complaint> queryCompliantList(AppStaticsQuery query, LoginUserInfoVO loginUserInfo) { |
| | | IdentityInformation identityInformation = identityInformationService.getIdentityInformation(loginUserInfo); |
| | | Integer identity = identityInformation.getIdentity(); |
| | | PartyMember partyMember = identityInformation.getPartyMember(); |
| | | SystemUserLevel systemUserLevel = identityInformation.getSystemUserLevel(); |
| | | Long targetId = null; |
| | | Integer accountLevel = 5; |
| | | //党员,查询该党员 |
| | | if (identity.equals(1)) { |
| | | targetId = partyMember.getId(); |
| | | } else if (identity.equals(2)) { |
| | | //上级 |
| | | if (Objects.nonNull(query.getTier()) && query.getTier().equals(-1)) { |
| | | accountLevel = systemUserLevel.getLevel(); |
| | | switch (systemUserLevel.getLevel()) { |
| | | case 1: |
| | | //市级 |
| | | targetId = 510400L; |
| | | break; |
| | | case 2: |
| | | //区县级 |
| | | targetId = Long.valueOf(systemUserLevel.getDistrictsCode()); |
| | | break; |
| | | case 3: |
| | | //街道 |
| | | targetId = Long.valueOf(systemUserLevel.getStreetId()); |
| | | break; |
| | | case 4: |
| | | //社区 |
| | | targetId = systemUserLevel.getCommunityId(); |
| | | break; |
| | | SystemUser systemUserLevel = identityInformation.getSystemUser(); |
| | | if(systemUserLevel.getSystemRoleId()==1 || systemUserLevel.getSystemRoleId()==2){ |
| | | return baseMapper.queryCompliantList(systemUserLevel.getAccountLevel(),systemUserLevel.getSystemRoleId(),query); |
| | | } |
| | | } else { |
| | | targetId = Long.valueOf(query.getAreaId()); |
| | | accountLevel = query.getTier(); |
| | | } |
| | | } |
| | | return baseMapper.queryCompliantList(targetId, accountLevel, loginUserInfo, query); |
| | | return null; |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | @Override |
| | | public void assignComplain(LoginUserInfoVO loginUserInfo, Long complainId, Integer userId, String remark) { |
| | | public void assignComplain(LoginUserInfoVO loginUserInfo, Long complainId, Integer userId, String remark, String problemType) { |
| | | IdentityInformation currentIdentityInformation = identityInformationService.getCurrentIdentityInformation(loginUserInfo); |
| | | if (currentIdentityInformation.getIdentity().equals(2)) { |
| | | SystemUser systemUser = currentIdentityInformation.getSystemUser(); |
| | | Complaint complaint = baseMapper.selectById(complainId); |
| | | if(StringUtils.isEmpty(complaint.getProblemType())){ |
| | | complaint.setProblemType(problemType); |
| | | } |
| | | if (systemUser.getSystemRoleId() != 1 || !complaint.getNowLevel().equals(systemUser.getAccountLevel())) { |
| | | throw new ServiceException("你没有分配权限"); |
| | | } |
| | |
| | | save(complaint); |
| | | } |
| | | |
| | | @Override |
| | | public void setProblemType(LoginUserInfoVO loginUserInfo, SetProblemTypeDto dto) { |
| | | IdentityInformation currentIdentityInformation = identityInformationService.getCurrentIdentityInformation(loginUserInfo); |
| | | if (currentIdentityInformation.getSystemUser().getSystemRoleId() != 1) { |
| | | throw new ServiceException("无权限"); |
| | | } |
| | | Complaint complaint = getById(dto.getComplaintId()); |
| | | complaint.setProblemType(dto.getProblemType()); |
| | | updateById(complaint); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.westcommittee.dao.SystemUserMapper; |
| | | import com.panzhihua.westcommittee.model.entity.ComAct; |
| | | import com.panzhihua.westcommittee.model.entity.ComStreet; |
| | | import com.panzhihua.westcommittee.model.entity.Complaint; |
| | | import com.panzhihua.westcommittee.model.entity.SystemUserLevel; |
| | | import com.panzhihua.westcommittee.model.entity.*; |
| | | import com.panzhihua.westcommittee.model.query.AppStaticsQuery; |
| | | import com.panzhihua.westcommittee.model.vo.AnalyticStatisticsFourVo; |
| | | import com.panzhihua.westcommittee.model.vo.AnalyticStatisticsOneVo; |
| | |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | SystemUserLevel userLevel = currentIdentityInformation.getSystemUserLevel(); |
| | | Integer level = userLevel.getLevel(); |
| | | SystemUser userLevel = currentIdentityInformation.getSystemUser(); |
| | | Integer level = userLevel.getAccountLevel(); |
| | | |
| | | switch (level) { |
| | | case 1: |
| | |
| | | */ |
| | | public AnalyticStatisticsOneVo queryStaticsPartOne(AppStaticsQuery query, LoginUserInfoVO loginUserInfo) { |
| | | List<Complaint> complaints = complaintService.queryCompliantList(query,loginUserInfo); |
| | | return complaintService.analyticStatisticsOne(null, complaints, simpleDateFormat); |
| | | return complaintService.analyticStatisticsOne(null, complaints, simpleDateFormat,null); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.panzhihua.westcommittee.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.vos.west.SystemUserVo; |
| | | import com.panzhihua.westcommittee.dao.SystemMenuMapper; |
| | | import com.panzhihua.westcommittee.model.entity.SystemMenu; |
| | | import com.panzhihua.westcommittee.service.ISystemMenuService; |
| | |
| | | |
| | | |
| | | @Override |
| | | public List<SystemMenu> getSystemMenuList() { |
| | | public List<SystemMenu> getSystemMenuList(SystemUserVo systemUserVo) { |
| | | List<SystemMenu> list = this.list(); |
| | | List<SystemMenu> collect = list.stream().filter(s->s.getParentId() == 0 && (s.getId()==1 || s.getId()==2)).collect(Collectors.toList()); |
| | | if(systemUserVo.getSystemRoleId()!=1){ |
| | | list = list.stream().filter(s->s.getId() != 1 || s.getId()!=2 || s.getId()!=3 || s.getId()!=35 || s.getId()!=61 || s.getId()!=62).collect(Collectors.toList()); |
| | | } |
| | | List<SystemMenu> collect = list.stream().filter(s->s.getParentId() == 0 && s.getId() != 3 ).collect(Collectors.toList()); |
| | | for (SystemMenu systemMenu : collect) { |
| | | build(systemMenu, list); |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | Page page = new Page<>(); |
| | | page.setCurrent(query.getPageNum()); |
| | | page.setSize(query.getPageSize()); |
| | | if(query.getDeptId()!=null || user.getAccountLevel()==2){ |
| | | IPage<SystemUserListVo> list = this.baseMapper.list(page, user, query); |
| | | return list; |
| | | }else { |
| | | List<Integer> deptIds=new ArrayList<>(); |
| | | if(user.getAccountLevel()==3){ |
| | | List<Long> ids = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, user.getStreetId())).stream().map(ComAct::getCommunityId).collect(Collectors.toList()); |
| | | List<Department> list = departmentService.list(new LambdaQueryWrapper<Department>().eq(Department::getTier, 3).eq(Department::getStreetId, user.getStreetId()) |
| | | .or(department -> department.and(department1 -> department1.eq(Department::getTier, 4).in(Department::getCommunityId, ids)))); |
| | | if(list.isEmpty()){ |
| | | return new Page<>(); |
| | | } |
| | | deptIds= list.stream().map(Department::getId).collect(Collectors.toList()); |
| | | }else if(user.getAccountLevel()==4){ |
| | | List<Department> list = departmentService.list(new LambdaQueryWrapper<Department>().eq(Department::getTier, 4).eq(Department::getCommunityId, user.getCommunityId())); |
| | | if(list.isEmpty()){ |
| | | return new Page<>(); |
| | | } |
| | | deptIds= list.stream().map(Department::getId).collect(Collectors.toList()); |
| | | } |
| | | IPage<SystemUserListVo> list = this.baseMapper.list1(page, user, query,deptIds); |
| | | return list; |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | @ApiModelProperty(value = "处理人所属层级code") |
| | | private String code; |
| | | |
| | | @ApiModelProperty("全部:不传,上报待审核:5,正在办理:0, 办结:3 -1 待分配") |
| | | private Integer status; |
| | | } |
| | |
| | | SELECT |
| | | id complaintId, |
| | | description_title title, |
| | | problem_type problemType, |
| | | serial_number serialNumber, |
| | | create_by, |
| | | create_time, |
| | |
| | | LEFT JOIN west_complaint_audit_record scar ON scar.complaint_id = sc.id and scar.latest_flag = 1 |
| | | LEFT JOIN west_department wd ON wd.id = sc.assign_person_id |
| | | ) as t1 where 1=1 |
| | | <if test="query.status !=null"> |
| | | and t1.status = #{query.status} |
| | | </if> |
| | | <if test="query.name != null and query.name!=''"> |
| | | and t1.name = #{query.name} |
| | | </if> |
| | | <if test="query.contactNumber != null and query.contactNumber!=''"> |
| | | and t1.contact_number = #{query.contactNumber} |
| | | </if> |
| | | <if test="query.reportUserName != null and query.reportUserName!=''"> |
| | | and t1.report_user_name = #{query.reportUserName} |
| | | </if> |
| | | <if test="query.reportUserPhone != null and query.reportUserPhone!=''"> |
| | | and t1.report_user_phone = #{query.reportUserPhone} |
| | | </if> |
| | | <if test="query.startTime != null and query.endTime!=null"> |
| | | and t1.create_time between #{query.startTime} and #{query.endTime} |
| | | </if> |
| | | <if test="query.address != null and query.address!=''"> |
| | | and t1.detailed_address like concat("%",#{query.address},"%") |
| | | </if> |
| | | <if test="query.problemType != null and query.problemType!=''"> |
| | | and t1.problem_type =#{query.problemType} |
| | | </if> |
| | | <if test="query.deptName != null and query.deptName!=''"> |
| | | and t1.deptName =#{query.deptName} |
| | | </if> |
| | | <if test="query.reportStr != null and query.reportStr!=''"> |
| | | and t1.reportStr =#{query.reportStr} |
| | | </if> |
| | | <if test="query.commentRate != null"> |
| | | and t1.comment_rate =#{query.commentRate} |
| | | </if> |
| | | <if test="query.level!=null and query.level ==2 and query.code!=null "> |
| | | and t1.tier =2 and t1.code1=#{query.code} |
| | | </if> |
| | | <if test="query.level!=null and query.level ==3 and query.code!=null "> |
| | | and t1.tier =3 and t1.code2=#{query.code} |
| | | </if> |
| | | <if test="query.level!=null and query.level ==4 and query.code!=null "> |
| | | and t1.tier =4 and t1.code3=#{query.code} |
| | | </if> |
| | | <if test="loginUserInfo.systemRoleId !=2 "> |
| | | and t1.problem_type !='检举' |
| | | </if> |
| | | |
| | | ORDER BY t1.create_time DESC |
| | | </select> |
| | | <select id="pageListExport" resultType="com.panzhihua.westcommittee.model.vo.ComplaintVO"> |
| | | select * from ( |
| | | SELECT |
| | | sc.id, |
| | | sc.serial_number, |
| | | sc.time, |
| | | sc.problem_type, |
| | | sc.name, |
| | | sc.contact_number, |
| | | sc.location, |
| | | sc.detailed_address, |
| | | sc.description_title, |
| | | sc.description_content, |
| | | sc.images, |
| | | sc.videos, |
| | | case |
| | | WHEN sc.now_level = 2 and sc.assign_status =0 and (scar.audit_status=1 or scar.audit_status is null) THEN -1 |
| | | WHEN sc.now_level = 2 and sc.status = 0 and scar.audit_type = 1 AND scar.audit_status = 0 THEN 7 |
| | | WHEN sc.now_level = 2 and sc.status = 0 and scar.audit_type = 2 AND scar.audit_status = 0 THEN 5 |
| | | WHEN sc.now_level = 2 and sc.status = 0 and scar.audit_status = 2 and scar.audit_type = 2 THEN 6 |
| | | WHEN sc.`status` =8 THEN 3 |
| | | WHEN sc.`status` =3 THEN 3 |
| | | ELSE 0 |
| | | END AS status, |
| | | CASE |
| | | WHEN sc.status = 8 THEN 1 |
| | | ELSE 0 |
| | | END AS evaluateButtonStatus, |
| | | sc.report_type, |
| | | sc.superior_id, |
| | | sc.create_by, |
| | | sc.create_time, |
| | | sc.update_by, |
| | | sc.update_time, |
| | | sc.completion_description, |
| | | sc.completion_images, |
| | | sc.completion_videos, |
| | | sc.completion_other_description, |
| | | sc.completion_time, |
| | | sc.completion_user_id, |
| | | sc.completion_username, |
| | | sc.completion_user_phone, |
| | | sc.closing_time, |
| | | sc.over_time_days, |
| | | sc.latitude, |
| | | sc.longitude, |
| | | sc.redispatch, |
| | | sc.now_level, |
| | | sc.now_level_time, |
| | | scar.audit_type, |
| | | scar.audit_status, |
| | | scar.reporter_level, |
| | | scar.comment, |
| | | scar.create_time AS reportTime, |
| | | scar.system_user_id, |
| | | scar.create_by as auditCreateBy, |
| | | scar.reporter, |
| | | scar.reporter_id, |
| | | scar.superior_id superiorId2, |
| | | scar.department_name, |
| | | scar.department_id, |
| | | sc.assign_status AS assignStatus, |
| | | case |
| | | when scar.id is not null and scar.audit_status =1 and scar.audit_type= 2 then '上报' |
| | | else '自办' |
| | | end |
| | | AS reportStr, |
| | | wd.name as deptName, |
| | | wd.tier, |
| | | wd.districts_code as code1 , |
| | | wd.street_id as code2, |
| | | wd.community_id as code3, |
| | | sc.report_user_name, |
| | | sc.report_user_phone, |
| | | scar.auditor_name, |
| | | sc.comment_rate |
| | | |
| | | FROM west_complaint sc |
| | | LEFT JOIN west_complaint_audit_record scar ON scar.complaint_id = sc.id and scar.latest_flag = 1 |
| | | LEFT JOIN west_department wd ON wd.id = sc.assign_person_id |
| | | ) as t1 where 1=1 |
| | | <if test="query.status !=null"> |
| | | and t1.status = #{query.status} |
| | | </if> |
| | | <if test="query.name != null and query.name!=''"> |
| | | and t1.name = #{query.name} |
| | | </if> |
| | |
| | | FROM west_complaint sc |
| | | LEFT JOIN west_complaint_audit_record scar ON scar.complaint_id = sc.id and scar.latest_flag = 1 |
| | | <where> |
| | | <if test="1 == accountLevel"> |
| | | and sc.city_code = #{targetId} |
| | | </if> |
| | | <if test="2 == accountLevel"> |
| | | and (sc.districts_code = #{targetId} || sc.id in (select complaint_id from west_complaint_audit_record where audit_type = 3 and audit_status = 1 and report_type = #{accountLevel} and superior_id = #{targetId})) |
| | | </if> |
| | | <if test="3 == accountLevel"> |
| | | and (sc.street_id = #{targetId} || sc.id in (select complaint_id from west_complaint_audit_record where audit_type = 3 and audit_status = 1 and report_type = #{accountLevel} and superior_id = #{targetId})) |
| | | </if> |
| | | <if test="4 == accountLevel"> |
| | | and (sc.community_id = #{targetId} || sc.id in (select complaint_id from west_complaint_audit_record where audit_type = 3 and audit_status = 1 and report_type = #{accountLevel} and superior_id = #{targetId})) |
| | | </if> |
| | | <if test="5 == accountLevel"> |
| | | and (sc.party_member_id = #{targetId} || sc.id in (select complaint_id from west_complaint_audit_record where audit_type = 3 and audit_status = 1 and report_type = #{accountLevel} and superior_id = #{targetId})) |
| | | </if> |
| | | sc.now_level = #{accountLevel} |
| | | <if test="query.timeType !=null"> |
| | | <choose> |
| | | <when test="query.timeType == 1"> |
| | |
| | | sc.images, |
| | | sc.videos, |
| | | CASE |
| | | WHEN sc.status = 0 and scar.audit_type = 1 AND scar.audit_status = 0 THEN 7 |
| | | WHEN sc.status = 0 and scar.audit_type = 2 AND scar.audit_status = 0 THEN 5 |
| | | WHEN sc.status = 0 and scar.audit_status = 2 THEN 6 |
| | | WHEN sc.status = 0 and scar.audit_type = 1 AND scar.audit_status = 0 and sc.now_level =#{level} THEN 7 |
| | | WHEN sc.status = 0 and scar.audit_type = 2 AND scar.audit_status = 0 and sc.now_level =#{level} THEN 5 |
| | | WHEN sc.status = 0 and scar.audit_status = 2 and sc.now_level =#{level} THEN 6 |
| | | ELSE sc.status |
| | | END AS status, |
| | | sc.superior_type, |
| | |
| | | <if test="query.status !=null"> |
| | | and t1.status = #{query.status} |
| | | </if> |
| | | <if test="roleId !=2"> |
| | | and t1.problem_type != '检举' |
| | | </if> |
| | | |
| | | ORDER BY t1.create_time DESC |
| | | </select> |
| | |
| | | ) as t1 where 1=1 |
| | | <if test="query.status !=null"> |
| | | and t1.status = #{query.status} |
| | | </if> |
| | | <if test="roleId !=2"> |
| | | and t1.problem_type != '检举' |
| | | </if> |
| | | |
| | | ORDER BY t1.create_time DESC |
| | |
| | | <if test="query.status !=null"> |
| | | and t1.status = #{query.status} |
| | | </if> |
| | | <if test="roleId !=2"> |
| | | and t1.problem_type != '检举' |
| | | </if> |
| | | |
| | | |
| | | ORDER BY t1.create_time DESC |
| | | </select> |
| | |
| | | or (sc.community_id in <foreach collection="ids" item="item" separator="," open="(" close=")">#{item}</foreach>) |
| | | or (sc.street_id =#{loginUserInfo.streetId}) |
| | | ) as t1 where 1=1 |
| | | <if test="query.status !=null"> |
| | | and t1.status = #{query.status} |
| | | </if> |
| | | <if test="query.name != null and query.name!=''"> |
| | | and t1.name = #{query.name} |
| | | </if> |
| | |
| | | (sc.superior_id =#{loginUserInfo.communityId} and sc.now_level=4) or (sc.last_superior_id = #{loginUserInfo.communityId} and sc.last_level=4) |
| | | or (sc.community_id = #{loginUserInfo.communityId}) |
| | | ) as t1 where 1=1 |
| | | <if test="query.status !=null"> |
| | | and t1.status = #{query.status} |
| | | </if> |
| | | <if test="query.name != null and query.name!=''"> |
| | | and t1.name = #{query.name} |
| | | </if> |
| | | <if test="query.contactNumber != null and query.contactNumber!=''"> |
| | | and t1.contact_number = #{query.contactNumber} |
| | | </if> |
| | | <if test="query.reportUserName != null and query.reportUserName!=''"> |
| | | and t1.report_user_name = #{query.reportUserName} |
| | | </if> |
| | | <if test="query.reportUserPhone != null and query.reportUserPhone!=''"> |
| | | and t1.report_user_phone = #{query.reportUserPhone} |
| | | </if> |
| | | <if test="query.startTime != null and query.endTime!=null"> |
| | | and t1.create_time between #{query.startTime} and #{query.endTime} |
| | | </if> |
| | | <if test="query.address != null and query.address!=''"> |
| | | and t1.detailed_address like concat("%",#{query.address},"%") |
| | | </if> |
| | | <if test="query.problemType != null and query.problemType!=''"> |
| | | and t1.problem_type =#{query.problemType} |
| | | </if> |
| | | <if test="query.deptName != null and query.deptName!=''"> |
| | | and t1.deptName =#{query.deptName} |
| | | </if> |
| | | <if test="query.reportStr != null and query.reportStr!=''"> |
| | | and t1.reportStr =#{query.reportStr} |
| | | </if> |
| | | <if test="query.commentRate != null"> |
| | | and t1.comment_rate =#{query.commentRate} |
| | | </if> |
| | | <if test="query.level!=null and query.level ==2 and query.code!=null "> |
| | | and t1.tier =2 and t1.code1=#{query.code} |
| | | </if> |
| | | <if test="query.level!=null and query.level ==3 and query.code!=null "> |
| | | and t1.tier =3 and t1.code2=#{query.code} |
| | | </if> |
| | | <if test="query.level!=null and query.level ==4 and query.code!=null "> |
| | | and t1.tier =4 and t1.code3=#{query.code} |
| | | </if> |
| | | <if test="loginUserInfo.systemRoleId !=2 "> |
| | | and t1.problem_type !='检举' |
| | | </if> |
| | | ORDER BY t1.create_time DESC |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <select id="pageList1Export" resultType="com.panzhihua.westcommittee.model.vo.ComplaintVO"> |
| | | select * from ( |
| | | SELECT |
| | | sc.id, |
| | | sc.serial_number, |
| | | sc.time, |
| | | sc.problem_type, |
| | | sc.name, |
| | | sc.contact_number, |
| | | sc.location, |
| | | sc.detailed_address, |
| | | sc.description_title, |
| | | sc.description_content, |
| | | sc.images, |
| | | sc.videos, |
| | | case |
| | | WHEN sc.status = 0 and scar.audit_type = 1 AND scar.audit_status = 0 THEN 7 |
| | | WHEN sc.status = 0 and scar.audit_type = 2 AND scar.audit_status = 0 THEN 5 |
| | | WHEN sc.status = 0 and scar.audit_status = 2 and scar.audit_type = 2 THEN 6 |
| | | ELSE sc.status |
| | | END AS status, |
| | | CASE |
| | | WHEN sc.status = 8 THEN 1 |
| | | ELSE 0 |
| | | END AS evaluateButtonStatus, |
| | | sc.report_type, |
| | | sc.superior_id, |
| | | sc.create_by, |
| | | sc.create_time, |
| | | sc.update_by, |
| | | sc.update_time, |
| | | sc.completion_description, |
| | | sc.completion_images, |
| | | sc.completion_videos, |
| | | sc.completion_other_description, |
| | | sc.completion_time, |
| | | sc.completion_user_id, |
| | | sc.completion_username, |
| | | sc.completion_user_phone, |
| | | sc.closing_time, |
| | | sc.over_time_days, |
| | | sc.latitude, |
| | | sc.longitude, |
| | | sc.redispatch, |
| | | sc.now_level, |
| | | sc.now_level_time, |
| | | scar.audit_type, |
| | | scar.audit_status, |
| | | scar.reporter_level, |
| | | scar.comment, |
| | | scar.create_time AS reportTime, |
| | | scar.system_user_id, |
| | | scar.create_by as auditCreateBy, |
| | | scar.reporter, |
| | | scar.reporter_id, |
| | | scar.superior_id superiorId2, |
| | | scar.department_name, |
| | | scar.department_id, |
| | | sc.assign_status AS assignStatus, |
| | | case |
| | | when scar.id is not null and scar.audit_status =1 and scar.audit_type= 2 then '上报' |
| | | else '自办' |
| | | end |
| | | AS reportStr, |
| | | wd.name as deptName, |
| | | wd.tier, |
| | | wd.districts_code as code1 , |
| | | wd.street_id as code2, |
| | | wd.community_id as code3, |
| | | sc.report_user_name, |
| | | sc.report_user_phone, |
| | | scar.auditor_name, |
| | | sc.comment_rate |
| | | FROM west_complaint sc |
| | | LEFT JOIN west_complaint_audit_record scar ON scar.complaint_id = sc.id and scar.latest_flag = 1 |
| | | LEFT JOIN west_department wd ON wd.id = sc.assign_person_id |
| | | WHERE sc.assign_person_id =#{loginUserInfo.oneDepartmentId} |
| | | ) as t1 where 1=1 |
| | | <if test="query.name != null and query.name!=''"> |
| | | and t1.name = #{query.name} |
| | | </if> |
| | | <if test="query.contactNumber != null and query.contactNumber!=''"> |
| | | and t1.contact_number = #{query.contactNumber} |
| | | </if> |
| | | <if test="query.reportUserName != null and query.reportUserName!=''"> |
| | | and t1.report_user_name = #{query.reportUserName} |
| | | </if> |
| | | <if test="query.reportUserPhone != null and query.reportUserPhone!=''"> |
| | | and t1.report_user_phone = #{query.reportUserPhone} |
| | | </if> |
| | | <if test="query.startTime != null and query.endTime!=null"> |
| | | and t1.create_time between #{query.startTime} and #{query.endTime} |
| | | </if> |
| | | <if test="query.address != null and query.address!=''"> |
| | | and t1.detailed_address like concat("%",#{query.address},"%") |
| | | </if> |
| | | <if test="query.problemType != null and query.problemType!=''"> |
| | | and t1.problem_type =#{query.problemType} |
| | | </if> |
| | | <if test="query.deptName != null and query.deptName!=''"> |
| | | and t1.deptName =#{query.deptName} |
| | | </if> |
| | | <if test="query.reportStr != null and query.reportStr!=''"> |
| | | and t1.reportStr =#{query.reportStr} |
| | | </if> |
| | | <if test="query.commentRate != null"> |
| | | and t1.comment_rate =#{query.commentRate} |
| | | </if> |
| | | <if test="query.level!=null and query.level ==2 and query.code!=null "> |
| | | and t1.tier =2 and t1.code1=#{query.code} |
| | | </if> |
| | | <if test="query.level!=null and query.level ==3 and query.code!=null "> |
| | | and t1.tier =3 and t1.code2=#{query.code} |
| | | </if> |
| | | <if test="query.level!=null and query.level ==4 and query.code!=null "> |
| | | and t1.tier =4 and t1.code3=#{query.code} |
| | | </if> |
| | | <if test="loginUserInfo.systemRoleId !=2 "> |
| | | and t1.problem_type !='检举' |
| | | </if> |
| | | |
| | | ORDER BY t1.create_time DESC |
| | | </select> |
| | | |
| | | <select id="pageList2Export" resultType="com.panzhihua.westcommittee.model.vo.ComplaintVO"> |
| | | select * from ( |
| | | SELECT distinct |
| | | sc.id, |
| | | sc.serial_number, |
| | | sc.time, |
| | | sc.problem_type, |
| | | sc.name, |
| | | sc.contact_number, |
| | | sc.location, |
| | | sc.detailed_address, |
| | | sc.description_title, |
| | | sc.description_content, |
| | | sc.images, |
| | | sc.videos, |
| | | case |
| | | WHEN (sc.now_level = 3 or sc.last_level = 3) and sc.status = 0 and scar.audit_type = 1 AND scar.audit_status = 0 THEN 7 |
| | | WHEN (sc.now_level = 3 or sc.last_level = 3) and sc.status = 0 and scar.audit_type = 2 AND scar.audit_status = 0 THEN 5 |
| | | WHEN (sc.now_level = 3 or sc.last_level = 3) and sc.status = 0 and scar.audit_status = 2 and scar.audit_type = 2 THEN 6 |
| | | WHEN sc.`status` =8 THEN 3 |
| | | WHEN sc.`status` =3 THEN 3 |
| | | WHEN sc.now_level = 3 and sc.assign_status =0 and (scar.audit_status=1 or scar.audit_status is null) THEN -1 |
| | | ELSE 0 |
| | | END AS status, |
| | | CASE |
| | | WHEN sc.status = 8 THEN 1 |
| | | ELSE 0 |
| | | END AS evaluateButtonStatus, |
| | | sc.report_type, |
| | | sc.superior_id, |
| | | sc.create_by, |
| | | sc.create_time, |
| | | sc.update_by, |
| | | sc.update_time, |
| | | sc.completion_description, |
| | | sc.completion_images, |
| | | sc.completion_videos, |
| | | sc.completion_other_description, |
| | | sc.completion_time, |
| | | sc.completion_user_id, |
| | | sc.completion_username, |
| | | sc.completion_user_phone, |
| | | sc.closing_time, |
| | | sc.over_time_days, |
| | | sc.latitude, |
| | | sc.longitude, |
| | | sc.redispatch, |
| | | sc.now_level, |
| | | sc.now_level_time, |
| | | scar.audit_type, |
| | | scar.audit_status, |
| | | scar.reporter_level, |
| | | scar.comment, |
| | | scar.create_time AS reportTime, |
| | | scar.system_user_id, |
| | | scar.create_by as auditCreateBy, |
| | | scar.reporter, |
| | | scar.reporter_id, |
| | | scar.superior_id superiorId2, |
| | | scar.department_name, |
| | | scar.department_id, |
| | | sc.assign_status AS assignStatus, |
| | | case |
| | | when scar.id is not null and scar.audit_status =1 and scar.audit_type= 2 then '上报' |
| | | else '自办' |
| | | end |
| | | AS reportStr, |
| | | wd.name as deptName, |
| | | wd.tier, |
| | | wd.districts_code as code1 , |
| | | wd.street_id as code2, |
| | | wd.community_id as code3, |
| | | sc.report_user_name, |
| | | sc.report_user_phone, |
| | | scar.auditor_name, |
| | | sc.comment_rate |
| | | FROM west_complaint sc |
| | | LEFT JOIN west_complaint_audit_record scar ON scar.complaint_id = sc.id and scar.latest_flag = 1 |
| | | LEFT JOIN west_department wd ON wd.id = sc.assign_person_id |
| | | where |
| | | (sc.superior_id =#{loginUserInfo.streetId} and 3 =sc.now_level) or (sc.last_superior_id = #{loginUserInfo.streetId} and 3 =sc.last_level) |
| | | or (4 =sc.now_level and sc.superior_id in <foreach collection="ids" item="item" separator="," open="(" close=")">#{item}</foreach>) |
| | | or (sc.community_id in <foreach collection="ids" item="item" separator="," open="(" close=")">#{item}</foreach>) |
| | | or (sc.street_id =#{loginUserInfo.streetId}) |
| | | ) as t1 where 1=1 |
| | | <if test="query.status !=null"> |
| | | and t1.status = #{query.status} |
| | | </if> |
| | | <if test="query.name != null and query.name!=''"> |
| | | and t1.name = #{query.name} |
| | | </if> |
| | | <if test="query.contactNumber != null and query.contactNumber!=''"> |
| | | and t1.contact_number = #{query.contactNumber} |
| | | </if> |
| | | <if test="query.reportUserName != null and query.reportUserName!=''"> |
| | | and t1.report_user_name = #{query.reportUserName} |
| | | </if> |
| | | <if test="query.reportUserPhone != null and query.reportUserPhone!=''"> |
| | | and t1.report_user_phone = #{query.reportUserPhone} |
| | | </if> |
| | | <if test="query.startTime != null and query.endTime!=null"> |
| | | and t1.create_time between #{query.startTime} and #{query.endTime} |
| | | </if> |
| | | <if test="query.address != null and query.address!=''"> |
| | | and t1.detailed_address like concat("%",#{query.address},"%") |
| | | </if> |
| | | <if test="query.problemType != null and query.problemType!=''"> |
| | | and t1.problem_type =#{query.problemType} |
| | | </if> |
| | | <if test="query.deptName != null and query.deptName!=''"> |
| | | and t1.deptName =#{query.deptName} |
| | | </if> |
| | | <if test="query.reportStr != null and query.reportStr!=''"> |
| | | and t1.reportStr =#{query.reportStr} |
| | | </if> |
| | | <if test="query.commentRate != null"> |
| | | and t1.comment_rate =#{query.commentRate} |
| | | </if> |
| | | <if test="query.level!=null and query.level ==2 and query.code!=null "> |
| | | and t1.tier =2 and t1.code1=#{query.code} |
| | | </if> |
| | | <if test="query.level!=null and query.level ==3 and query.code!=null "> |
| | | and t1.tier =3 and t1.code2=#{query.code} |
| | | </if> |
| | | <if test="query.level!=null and query.level ==4 and query.code!=null "> |
| | | and t1.tier =4 and t1.code3=#{query.code} |
| | | </if> |
| | | <if test="loginUserInfo.systemRoleId !=2 "> |
| | | and t1.problem_type !='检举' |
| | | </if> |
| | | ORDER BY t1.create_time DESC |
| | | </select> |
| | | <select id="pageList3Export" resultType="com.panzhihua.westcommittee.model.vo.ComplaintVO"> |
| | | select * from ( |
| | | SELECT distinct |
| | | sc.id, |
| | | sc.serial_number, |
| | | sc.time, |
| | | sc.problem_type, |
| | | sc.name, |
| | | sc.contact_number, |
| | | sc.location, |
| | | sc.detailed_address, |
| | | sc.description_title, |
| | | sc.description_content, |
| | | sc.images, |
| | | sc.videos, |
| | | case |
| | | WHEN sc.now_level = 4 and sc.assign_status = 0 THEN -1 |
| | | WHEN (sc.now_level = 4 or sc.last_level = 4) and sc.status = 0 and scar.audit_type = 1 AND scar.audit_status = 0 THEN 7 |
| | | WHEN (sc.now_level = 4 or sc.last_level = 4) and sc.status = 0 and scar.audit_type = 2 AND scar.audit_status = 0 THEN 5 |
| | | WHEN (sc.now_level = 4 or sc.last_level = 4) and sc.status = 0 and scar.audit_status = 2 and scar.audit_type = 2 THEN 6 |
| | | WHEN sc.`status` =8 THEN 3 |
| | | WHEN sc.`status` =3 THEN 3 |
| | | WHEN sc.assign_status = 0 THEN -1 |
| | | ELSE 0 |
| | | END AS status, |
| | | CASE |
| | | WHEN sc.status = 8 THEN 1 |
| | | ELSE 0 |
| | | END AS evaluateButtonStatus, |
| | | sc.report_type, |
| | | sc.superior_id, |
| | | sc.create_by, |
| | | sc.create_time, |
| | | sc.update_by, |
| | | sc.update_time, |
| | | sc.completion_description, |
| | | sc.completion_images, |
| | | sc.completion_videos, |
| | | sc.completion_other_description, |
| | | sc.completion_time, |
| | | sc.completion_user_id, |
| | | sc.completion_username, |
| | | sc.completion_user_phone, |
| | | sc.closing_time, |
| | | sc.over_time_days, |
| | | sc.latitude, |
| | | sc.longitude, |
| | | sc.redispatch, |
| | | sc.now_level, |
| | | sc.now_level_time, |
| | | scar.audit_type, |
| | | scar.audit_status, |
| | | scar.reporter_level, |
| | | scar.comment, |
| | | scar.create_time AS reportTime, |
| | | scar.system_user_id, |
| | | scar.create_by as auditCreateBy, |
| | | scar.reporter, |
| | | scar.reporter_id, |
| | | scar.superior_id superiorId2, |
| | | scar.department_name, |
| | | scar.department_id, |
| | | sc.assign_status AS assignStatus, |
| | | case |
| | | when scar.id is not null and scar.audit_status =1 and scar.audit_type= 2 then '上报' |
| | | else '自办' |
| | | end |
| | | AS reportStr, |
| | | wd.name as deptName, |
| | | wd.tier, |
| | | wd.districts_code as code1 , |
| | | wd.street_id as code2, |
| | | wd.community_id as code3, |
| | | sc.report_user_name, |
| | | sc.report_user_phone, |
| | | scar.auditor_name, |
| | | sc.comment_rate |
| | | FROM west_complaint sc |
| | | LEFT JOIN west_complaint_audit_record scar ON scar.complaint_id = sc.id and scar.latest_flag = 1 |
| | | LEFT JOIN west_department wd ON wd.id = sc.assign_person_id |
| | | where |
| | | (sc.superior_id =#{loginUserInfo.communityId} and sc.now_level=4) or (sc.last_superior_id = #{loginUserInfo.communityId} and sc.last_level=4) |
| | | or (sc.community_id = #{loginUserInfo.communityId}) |
| | | ) as t1 where 1=1 |
| | | <if test="query.status !=null"> |
| | | and t1.status = #{query.status} |
| | | </if> |
| | | <if test="query.name != null and query.name!=''"> |
| | | and t1.name = #{query.name} |
| | | </if> |
| | |
| | | <select id="getCreateByIdPhone" resultType="java.lang.String"> |
| | | select phone from sys_user where user_id = #{createBy} |
| | | </select> |
| | | <select id="list1" resultType="com.panzhihua.westcommittee.warpper.SystemUserListVo"> |
| | | select distinct |
| | | a.id, |
| | | a.name, |
| | | a.phone, |
| | | f.`name` as systemPostName, |
| | | g.`name` as systemRoleName, |
| | | a.`status`, |
| | | h.name departmentName |
| | | from west_system_user a |
| | | left join west_system_post f on (a.system_post_id = f.id) |
| | | left join west_system_role g on (a.system_role_id = g.id) |
| | | left join west_department h on (a.one_department_id = h.id) |
| | | where a.`status` != 3 |
| | | <if test="null != query.name and '' != query.name"> |
| | | and a.name like CONCAT('%', #{query.name}, '%') |
| | | </if> |
| | | <if test="null != query.phone and '' != query.phone"> |
| | | and a.phone like CONCAT('%', #{query.phone}, '%') |
| | | </if> |
| | | <if test="null != query.systemRoleId"> |
| | | and a.system_role_id = #{query.systemRoleId} |
| | | </if> |
| | | and a.one_department_id in <foreach collection="deptIds" open="(" separator="," item="id" close=")">#{id}</foreach> |
| | | order by a.create_time desc |
| | | </select> |
| | | |
| | | </mapper> |