| | |
| | | |
| | | @Override |
| | | public R pageByComEvent(ComEvent comEvent, Page pagination,LoginUserInfoVO loginUserInfoVO) { |
| | | log.info("当前登录信息"+loginUserInfoVO); |
| | | Boolean isExpertCheck=false; |
| | | Long expertId=null; |
| | | Boolean isStretAccount = isStreetAccount(loginUserInfoVO); |
| | | // comEvent.setAppId(loginUserInfoVO.getAppId()); |
| | | comEvent.setAppId(loginUserInfoVO.getAppId()); |
| | | if (nonNull(comEvent.getUserType())){ |
| | | if (comEvent.getUserType().equals(1)){ |
| | | //个人账号权限 |
| | |
| | | IPage<ComEvent> list=null; |
| | | //是否为专家查看自己发布的事件 |
| | | if (isExpertCheck && comEvent.getUserType()!=1){ |
| | | if (nonNull(comEventMapper.listEventIds(expertId))){ |
| | | list = comEventMapper.pageByComEventExpert(comEventMapper.listEventIds(expertId), comEvent, pagination); |
| | | List<Long> ids=comEventMapper.listEventIds(expertId); |
| | | if (ids!=null && ids.size()>0 ){ |
| | | list = comEventMapper.pageByComEventExpert(ids, comEvent, pagination); |
| | | } |
| | | else |
| | | { |
| | | list = comEventMapper.pageByComEventExpert(null, comEvent, pagination); |
| | | } |
| | | }else{ |
| | | list = baseMapper.pageByComEvent(comEvent, pagination); |
| | | } |
| | | if (list.getRecords().size() < 1) { |
| | | if (list==null || list.getRecords().size() < 1) { |
| | | return R.ok(Collections.emptyList()); |
| | | } |
| | | list.getRecords().forEach(comEvent1 -> { |
| | |
| | | comEvent.setSolve(0); |
| | | comEvent.setArchive(0); |
| | | comEvent.setDistribution(0); |
| | | } else if (comEvent.getEventProcessStatus().equals(6) && comEvent.getEventResult().equals(1)){ |
| | | } else if (comEvent.getEventProcessStatus().equals(6) && comEvent.getEventResult().equals(1) && !comEvent.getIsEnd().equals(1)){ |
| | | //上报并且调解失败,此时事件的状态为6,事件结果为调解失败 |
| | | //comEvent.setDistribution(0); |
| | | comEvent.setEventResult(null); |
| | |
| | | //关闭所有权限 |
| | | comEvent.setDistribution(0); |
| | | comEvent.setSolve(0); |
| | | comEvent.setArchive(0); |
| | | //comEvent.setArchive(0); |
| | | comEvent.setChangeExpert(0); |
| | | comEvent.setConciliation(0); |
| | | } |
| | | |
| | | } |
| | |
| | | //调解中,可以查看,调解,更换专家,删除 |
| | | comEvent.setDistribution(0); |
| | | comEvent.setArchive(0); |
| | | } else if (comEvent.getEventProcessStatus().equals(6) && comEvent.getEventResult().equals(1)){ |
| | | comEvent.setSolve(0); |
| | | }else if (comEvent.getEventProcessStatus().equals(6) && comEvent.getEventResult().equals(1) && !comEvent.getIsEnd().equals(1)){ |
| | | //调解完成,可以归档,查看 |
| | | comEvent.setEventResult(null); |
| | | comEvent.setEventProcessStatus(2); |
| | |
| | | //comEvent.setChangeExpert(0); |
| | | //comEvent.setArchive(0); |
| | | comEvent.setConciliation(0); |
| | | } |
| | | else if (comEvent.getEventProcessStatus().equals(6) && comEvent.getEventSucceed().equals(2)){ |
| | | }else if (comEvent.getEventProcessStatus().equals(6) && comEvent.getEventSucceed().equals(2)){ |
| | | //调解完成,可以归档,查看 |
| | | comEvent.setSolve(0); |
| | | comEvent.setDistribution(0); |
| | | comEvent.setChangeExpert(0); |
| | | comEvent.setConciliation(0); |
| | | } |
| | | }else if (comEvent.getCurrentProcessType().equals(5)){ |
| | | //根据事件状态决定权限 |
| | |
| | | } |
| | | else{ |
| | | //未上上报到行业分中心,或者已上报到区三说会堂,仅查看 |
| | | comEvent.setArchive(0); |
| | | //comEvent.setArchive(0); |
| | | comEvent.setSolve(0); |
| | | comEvent.setDistribution(0); |
| | | comEvent.setChangeExpert(0); |
| | | //comEvent.setConciliation(0); |
| | | comEvent.setConciliation(0); |
| | | |
| | | } |
| | | }else if (userType.equals(5) || isStreet){ |
| | | //街道权限,操作街道下属社区的所有事件 |
| | |
| | | comEvent.setEventResult(null); |
| | | comEvent.setEventProcessStatus(1); |
| | | } |
| | | else if (comEvent.getEventProcessStatus().equals(6) && comEvent.getEventResult().equals(1)){ |
| | | else if (comEvent.getEventProcessStatus().equals(6) && comEvent.getEventResult().equals(1) && !comEvent.getIsEnd().equals(1)){ |
| | | //设置为待受理 |
| | | comEvent.setEventResult(null); |
| | | comEvent.setEventProcessStatus(2); |
| | |
| | | comEvent.setDistribution(0); |
| | | comEvent.setSolve(0); |
| | | comEvent.setArchive(0); |
| | | } else if (comEvent.getEventProcessStatus().equals(6) && comEvent.getEventResult().equals(1)){ |
| | | } else if (comEvent.getEventProcessStatus().equals(6) && comEvent.getEventResult().equals(1) && !comEvent.getIsEnd().equals(1)){ |
| | | //失败后转交三说会堂 |
| | | comEvent.setSolve(0); |
| | | comEvent.setDistribution(0); |
| | |
| | | public Integer hasPermission(ComEvent comEvent,LoginUserInfoVO sysUser){ |
| | | String account=""; |
| | | Integer perm=1; |
| | | |
| | | if(comEvent==null || sysUser == null ) |
| | | { |
| | | return perm; |
| | | } |
| | | |
| | | if (nonNull(sysUser.getAccount())){ |
| | | account=sysUser.getAccount(); |
| | | } |
| | |
| | | return map; |
| | | } |
| | | |
| | | public String getPhone(ComEvent comEvent){ |
| | | public String getPhone(ComEvent comEvent) |
| | | { |
| | | if(comEvent==null) |
| | | { |
| | | return ""; |
| | | } |
| | | if (isNull(comEvent.getRequestUserCommunity())){ |
| | | return comSanShuoIndustryCenterService.getById(comEvent.getCenterId()).getPhone(); |
| | | }else { |
| | | String contactsPhone = comActDAO.selectById(comEvent.getRequestUserCommunity()).getContactsPhone(); |
| | | if (isNull(contactsPhone)){ |
| | | return null; |
| | | ComSanshuoIndustryCenter sanshuoIndustryCenter=comSanShuoIndustryCenterService.getById(comEvent.getCenterId()); |
| | | if(sanshuoIndustryCenter==null) |
| | | { |
| | | return ""; |
| | | } |
| | | return contactsPhone; |
| | | else |
| | | { |
| | | return sanshuoIndustryCenter.getPhone(); |
| | | } |
| | | |
| | | }else { |
| | | ComActDO comActDO=comActDAO.selectById(comEvent.getRequestUserCommunity()); |
| | | if(comActDO!=null) |
| | | { |
| | | String contactsPhone = comActDO.getContactsPhone(); |
| | | if (isNull(contactsPhone)){ |
| | | return ""; |
| | | } |
| | | else |
| | | { |
| | | return contactsPhone; |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R calculate(LoginUserInfoVO loginUserInfoVO) { |
| | | public R calculate(LoginUserInfoVO loginUserInfoVO,Integer level,Long id) { |
| | | ComEvent comEvent=new ComEvent(); |
| | | Boolean isExpertCheck=false; |
| | | Long expertId=null; |
| | |
| | | comEvent.setSpecialistId(expert.getId()); |
| | | isExpertCheck=true; |
| | | expertId=expert.getId(); |
| | | // level=expert.getLevel(); |
| | | // id=expert.getCommunityId(); |
| | | comEvent.setCommunityId(expert.getCommunityId()); |
| | | } |
| | | |
| | | |
| | | }else if (loginUserInfoVO.getType().equals(12)){ |
| | | //行业分中心权限 |
| | | comEvent.setUserType(3); |
| | |
| | | List<Long> cids = comActDAO.selectCommunityByStreetId(loginUserInfoVO.getStreetId()); |
| | | comEvent.setUserType(5); |
| | | comEvent.setCommunityIds(cids); |
| | | } |
| | | } |
| | | if (isExpertCheck){ |
| | | if(nonNull(comEventMapper.listEventIds(expertId))){ |
| | | List<Long> eventIds = comEventMapper.listEventIds(expertId); |
| | | List<Long> eventIds = comEventMapper.listEventIds(expertId); |
| | | if(eventIds!=null && eventIds.size()>0){ |
| | | |
| | | //获取该专家的所有事件 |
| | | comEvent.setEventIds(eventIds); |
| | | } |
| | |
| | | } |
| | | log.info("当前userType===="+comEvent.getUserType()); |
| | | //comEvent.setAppId(loginUserInfoVO.getAppId()); |
| | | R<LoginUserInfoVO> r = userService.detailUser(loginUserInfoVO.getUserId()); |
| | | LoginUserInfoVO user = r.getData(); |
| | | // R<LoginUserInfoVO> r = userService.detailUser(loginUserInfoVO.getUserId()); |
| | | // LoginUserInfoVO user = r.getData(); |
| | | LoginUserInfoVO user = loginUserInfoVO; |
| | | if (nonNull(user.getAppId())){ |
| | | comEvent.setAppId(user.getAppId()); |
| | | } |
| | | if (nonNull(level) && nonNull(id)){ |
| | | comEvent.setLevel(level); |
| | | comEvent.setSearchId(id); |
| | | comEvent.setUserType(null); |
| | | } |
| | | List<ComEventCalculateVO> calculateList = baseMapper.calculate(comEvent); |
| | | ComEventCalculateVO comEventCalculateVO =new ComEventCalculateVO(); |
| | |
| | | return R.ok(vo); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public R eventIndexData(Integer type) { |
| | | //获取事件总数 |
| | |
| | | if (type.equals(1)){ |
| | | //受理级别占比 |
| | | List<EventRateVO> eventRateVOS = comEventMapper.eventRate(); |
| | | //获取专家受理的数量 |
| | | Integer expertCount=comEventMapper.expertSolveCountCommunity(); |
| | | //获取行业分中心受理数量 |
| | | Integer centerCount=comEventMapper.expertSolveCountCenter(); |
| | | for (EventRateVO eventRateVO : eventRateVOS) { |
| | | if (nonNull(eventRateVO)){ |
| | | eventRateVO.setName(typeToName(eventRateVO.getCurrentProcessType())); |
| | | eventRateVO.setName(typeToName(eventRateVO.getType())); |
| | | // if (eventRateVO.getCurrentProcessType().equals(2)){ |
| | | // eventRateVO.setCount(eventRateVO.getCount()+expertCount); |
| | | // } |
| | | // if (eventRateVO.getCurrentProcessType().equals(1)){ |
| | | // eventRateVO.setCount(eventRateVO.getCount()+centerCount); |
| | | // } |
| | | if (nonNull(eventCount) && !eventCount.equals(0)){ |
| | | //计算占比 |
| | | eventRateVO.setRate(NumberUtil.div(eventRateVO.getCount(),eventCount,2)); |