| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.core.collection.ListUtil; |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.lang.generator.SnowflakeGenerator; |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import cn.hutool.core.util.NumberUtil; |
| | | import cn.hutool.core.util.RandomUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | import com.panzhihua.common.model.dtos.community.sanshuo.IndexDateDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.switchs.CommunitySwitchAllAppletsVO; |
| | | import com.panzhihua.common.model.vos.sanshuo.*; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.CopyUtil; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | /** |
| | |
| | | |
| | | @Override |
| | | public R pageByComEvent(ComEvent comEvent, Page pagination,LoginUserInfoVO loginUserInfoVO) { |
| | | log.info("当前登陆的用户信息,用户类型"+loginUserInfoVO.getType()+"社区id"+loginUserInfoVO.getCommunityId()); |
| | | log.info("=================当前登陆的用户信息,用户类型"+loginUserInfoVO.getType()+"社区id"+loginUserInfoVO.getCommunityId()); |
| | | Boolean isExpertCheck=false; |
| | | Long expertId=null; |
| | | Boolean isStretAccount = isStreetAccount(loginUserInfoVO); |
| | | if (nonNull(comEvent.getUserType())){ |
| | | if (comEvent.getUserType().equals(1)){ |
| | | //个人账号权限 |
| | | comEvent.setRequestUserId(loginUserInfoVO.getUserId()); |
| | | }else if (comEvent.getUserType().equals(2) || loginUserInfoVO.getType().equals(13)){ |
| | | }else if (comEvent.getUserType().equals(2) || loginUserInfoVO.getType().equals(13) || loginUserInfoVO.getType().equals(11)){ |
| | | ComSanshuoExpert expert=new ComSanshuoExpert(); |
| | | //专家账号权限(小程序和后台) |
| | | if (nonNull(loginUserInfoVO.getPhone())){ |
| | |
| | | //社区后台权限 |
| | | comEvent.setUserType(4); |
| | | comEvent.setCommunityId(loginUserInfoVO.getCommunityId()); |
| | | }else if (isStretAccount){ |
| | | //街道权限,查看街道范围下的所有社区事件 |
| | | //获取街道下属社区id |
| | | List<Long> cids = comActDAO.selectCommunityByStreetId(loginUserInfoVO.getStreetId()); |
| | | comEvent.setUserType(5); |
| | | comEvent.setCommunityIds(cids); |
| | | } |
| | | } |
| | | // if (nonNull(loginUserInfoVO.getAccount())){ |
| | | // if (loginUserInfoVO.getAccount().equals("admin")){ |
| | | // comEvent.setUserType(null); |
| | | // } |
| | | // } |
| | | IPage<ComEvent> list=null; |
| | | log.info("=====================当前的userType"+comEvent.getUserType()); |
| | | if (isExpertCheck){ |
| | | list = comEventMapper.pageByComEventExpert(comEventMapper.listEventIds(expertId), comEvent, pagination); |
| | | log.info("=====================是否专家账号查看"+isExpertCheck); |
| | | //是否为专家查看自己发布的事件 |
| | | if (isExpertCheck && comEvent.getUserType()!=1){ |
| | | if (nonNull(comEventMapper.listEventIds(expertId))){ |
| | | list = comEventMapper.pageByComEventExpert(comEventMapper.listEventIds(expertId), comEvent, pagination); |
| | | } |
| | | }else{ |
| | | list = baseMapper.pageByComEvent(comEvent, pagination); |
| | | } |
| | |
| | | } |
| | | ComMediateType category = commediateTypeService.getById(comEvent1.getEventCategory()); |
| | | comEvent1.setEventCategoryName(category.getName()); |
| | | //当前账号能否操作此条记录,根据事件流转记录是否有归档的记录决定当前用户能否对添加归档记录 |
| | | ComEventTransferRecord archiveRecord = comEventTransferRecordService.getOne(new QueryWrapper<ComEventTransferRecord>().lambda().eq(ComEventTransferRecord::getEventId, comEvent1.getId()).eq(ComEventTransferRecord::getFromUserId, loginUserInfoVO.getUserId()).eq(ComEventTransferRecord::getEventStatus, 7)); |
| | | comEvent1.setIsArchive(1); |
| | | if(nonNull(archiveRecord)){ |
| | | comEvent1.setIsArchive(0); |
| | | comEvent1.setHasPerm(hasPermission(comEvent1,loginUserInfoVO )); |
| | | if (!comEvent.getUserType().equals(1)){ |
| | | this.accountMenu(comEvent1,comEvent.getUserType(),loginUserInfoVO,isStretAccount); |
| | | } |
| | | }); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | /** |
| | | * 当前账号对事件的操作权限 |
| | | * 1有权限 0无权限 |
| | | * 1、用户提交调解申请后,调解专家状态为待受理,可操作受理、查看,专家所在部门状态为待受理,可操作受理(帮专家进行受理处理)、查看、删除, |
| | | * 所在部门上级部门状态为待受理,仅可查看、删除;ok |
| | | * 2、专家拒绝受理后,专家看不到该调解申请,所在单位状态变为待分配,可操作分配、调解、查看、删除,所在单位的上级单位状态变为待分配,仅可查看、删除; ok |
| | | * 3、专家受理后,专家状态变为调解中,可操作调解、查看,专家所在部门状态变为调解中,可操作调解、查看、删除,专家做在单位的上级单位状态变为调解中,仅可查看、删除; |
| | | * 4、专家调解调解完成未上报上级,专家状态变为已完成、可操作归档、查看,专家所在部门状态变为已完成,可操作归档、查看,专家所在部门的上级单位状态变为已完成, |
| | | * 可查看、删除; |
| | | * 5、专家所在部门调解完成未上报上级,专家状态变为已完成、可操作归档、查看,专家所在部门状态变为已完成,可操作归档、查看,专家所在部门的上级单位状态变为已完成, |
| | | * 可查看、删除; |
| | | * 6、专家调解完成上报上级,专家状态变为已完成、可操作归档、查看,专家所在部门状态变为待分配,可操作分配专家、调解、查看、删除,专家所在部门的上级单位状态变为调解中,可查看、删除; |
| | | * 7、专家所在部门调解完成上报上级,专家状态变为已完成、可操作归档、查看,专家所在部门状态变为已完成,可操作归档、查看、删除,专家所在部门的上级单位状态变为待分配,可分配专家、查看、删除, |
| | | * 上上级单位状态变为调解中,可查看、删除; |
| | | * 8、专家调解/专家所在部门调解未完成,专家状态变为调解中,可操作调解、查看,专家所在部门状态变为调解中,可操作更换专家、调解、查看、删除,专家所在部门的上级单位状态变为调解中,可查看、删除; |
| | | * 9、专家所在部门分配给专家后,专家状态变为待受理,可操作受理、查看,专家所在部门状态变为待受理,可操作受理(帮专家进行受理处理)、查看、删除,专家所在部门的上级部门状态变为待受理, |
| | | * 仅可查看、删除; |
| | | * 10、专家所在部门更换专家,原专家状态已完成,专家所在部门状态不变,专家所在部门的上级单位状态不变; |
| | | * */ |
| | | public void accountMenu(ComEvent comEvent,Integer userType,LoginUserInfoVO loginUserInfoVO,Boolean isStreet){ |
| | | //四个账号级别 |
| | | Boolean isAdmin=false; |
| | | if (isNull(userType)){ |
| | | isAdmin=true; |
| | | } |
| | | comEvent.setDelete(1); |
| | | comEvent.setArchive(1); |
| | | comEvent.setSolve(1); |
| | | comEvent.setConciliation(1); |
| | | comEvent.setDistribution(1); |
| | | comEvent.setChangeExpert(1); |
| | | if (userType.equals(2)){ |
| | | //专家后台权限,根据事件的流转信息决定专家对此事件的操作权限 |
| | | //细分到事件的每个状态和流转情况 |
| | | ComSanshuoExpert expert=new ComSanshuoExpert(); |
| | | comEvent.setDistribution(0); |
| | | comEvent.setChangeExpert(0); |
| | | comEvent.setDelete(0); |
| | | if (nonNull(loginUserInfoVO.getPhone())){ |
| | | expert = comSanShuoExpertService.getOne(new QueryWrapper<ComSanshuoExpert>().lambda().eq(ComSanshuoExpert::getPhone, loginUserInfoVO.getPhone())); |
| | | }else{ |
| | | //账号获取 |
| | | expert = comSanShuoExpertService.getOne(new QueryWrapper<ComSanshuoExpert>().lambda().eq(ComSanshuoExpert::getAccount, loginUserInfoVO.getAccount())); |
| | | } |
| | | if (!comEvent.getSpecialistId().equals(expert.getId()) || !comEvent.getCurrentProcessType().equals(5)){ |
| | | //已经上报或者重新分配专家,只能查看 |
| | | comEvent.setConciliation(0); |
| | | //comEvent.setArchive(0); |
| | | comEvent.setSolve(0); |
| | | return; |
| | | }//未上报,根据状态决定权限 |
| | | if (comEvent.getEventProcessStatus().equals(1) || comEvent.getEventProcessStatus().equals(2)){ |
| | | //待受理和待验证状态,仅有查看和受理权限,可能为用户选择该专家或上级单位分配给该专家 |
| | | //关闭调解和归档 |
| | | comEvent.setArchive(0); |
| | | comEvent.setConciliation(0); |
| | | } else if (comEvent.getEventProcessStatus().equals(5)){ |
| | | //调解中,可以查看,调解 |
| | | comEvent.setArchive(0); |
| | | comEvent.setSolve(0); |
| | | }else if (comEvent.getEventProcessStatus().equals(3)){ |
| | | //重新分配给该专家的事件,可以进行受理 |
| | | // comEvent.setSolve(0); |
| | | comEvent.setConciliation(0); |
| | | comEvent.setArchive(0); |
| | | } else if (comEvent.getEventProcessStatus().equals(6)){ |
| | | //调解完成,可以归档,查看 |
| | | comEvent.setSolve(0); |
| | | comEvent.setConciliation(0); |
| | | } |
| | | }else if (userType.equals(4)){ |
| | | //社区后台权限 |
| | | //如果未上报到街道,当前事件权限和专家一样 |
| | | if (comEvent.getCurrentProcessType().equals(5)){ |
| | | //根据事件状态决定权限 |
| | | if (comEvent.getEventProcessStatus().equals(1) || comEvent.getEventProcessStatus().equals(2)){ |
| | | //待受理和待验证状态,可以受理,分配专家 |
| | | //关闭调解和归档 |
| | | comEvent.setArchive(0); |
| | | comEvent.setConciliation(0); |
| | | comEvent.setChangeExpert(0); |
| | | } else if (comEvent.getEventProcessStatus().equals(5)){ |
| | | //调解中,可以查看,调解,更换专家,删除 |
| | | comEvent.setDistribution(0); |
| | | comEvent.setSolve(0); |
| | | comEvent.setArchive(0); |
| | | } 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(2)){ |
| | | //上报到社区后,增加分配专家权限 |
| | | if (comEvent.getEventProcessStatus().equals(1) || comEvent.getEventProcessStatus().equals(2)){ |
| | | //待受理和待验证状态,可以受理,更换专家 |
| | | //关闭调解和归档 |
| | | comEvent.setArchive(0); |
| | | comEvent.setConciliation(0); |
| | | comEvent.setDistribution(0); |
| | | } else if (comEvent.getEventProcessStatus().equals(5)){ |
| | | //调解中,可以查看,调解,更换专家,删除 |
| | | comEvent.setSolve(0); |
| | | comEvent.setArchive(0); |
| | | comEvent.setDistribution(0); |
| | | } else if (comEvent.getEventProcessStatus().equals(6) && comEvent.getEventResult().equals(1)){ |
| | | //上报并且调解失败,此时事件的状态为6,事件结果为调解失败 |
| | | //comEvent.setDistribution(0); |
| | | comEvent.setEventResult(null); |
| | | comEvent.setEventProcessStatus(2); |
| | | comEvent.setChangeExpert(0); |
| | | comEvent.setSolve(0); |
| | | //comEvent.setConciliation(0); |
| | | comEvent.setArchive(0); |
| | | }else if (comEvent.getEventProcessStatus().equals(6) && comEvent.getEventResult().equals(2) && comEvent.getEventSucceed().equals(2)){ |
| | | //调解完成,可以归档,查看 |
| | | //关闭所有权限 |
| | | comEvent.setDistribution(0); |
| | | comEvent.setChangeExpert(0); |
| | | comEvent.setSolve(0); |
| | | comEvent.setConciliation(0); |
| | | //comEvent.setArchive(0); |
| | | } |
| | | else if (comEvent.getEventProcessStatus().equals(6) && comEvent.getEventSucceed().equals(2)){ |
| | | //调解完成,可以归档,查看 |
| | | //关闭所有权限 |
| | | comEvent.setDistribution(0); |
| | | comEvent.setSolve(0); |
| | | comEvent.setArchive(0); |
| | | } |
| | | } |
| | | else{ |
| | | //已上报到街道或三说会堂,社区没有分配和受理权限权限 |
| | | comEvent.setDistribution(0); |
| | | comEvent.setChangeExpert(0); |
| | | //comEvent.setDelete(0); |
| | | comEvent.setSolve(0); |
| | | comEvent.setConciliation(0); |
| | | } |
| | | }else if (userType.equals(3)){ |
| | | //分配行业分中心操作权限 |
| | | //是否上报到行业分中心 |
| | | if (comEvent.getReportCenter().equals(1) || comEvent.getCurrentProcessType().equals(1)){ |
| | | //已经报到行业分中心 |
| | | if (comEvent.getEventProcessStatus().equals(1) || comEvent.getEventProcessStatus().equals(2)){ |
| | | //待受理和待验证状态,可以受理,分配专家 |
| | | //关闭调解和归档 |
| | | comEvent.setArchive(0); |
| | | comEvent.setConciliation(0); |
| | | } else if (comEvent.getEventProcessStatus().equals(5)){ |
| | | //调解中,可以查看,调解,更换专家,删除 |
| | | comEvent.setDistribution(0); |
| | | comEvent.setArchive(0); |
| | | } else if (comEvent.getEventProcessStatus().equals(6) && comEvent.getEventResult().equals(1)){ |
| | | //调解完成,可以归档,查看 |
| | | comEvent.setEventResult(null); |
| | | comEvent.setEventProcessStatus(2); |
| | | comEvent.setSolve(0); |
| | | comEvent.setDistribution(0); |
| | | comEvent.setChangeExpert(0); |
| | | } |
| | | else if (comEvent.getEventProcessStatus().equals(6) && comEvent.getEventSucceed().equals(2)){ |
| | | //调解完成,可以归档,查看 |
| | | comEvent.setSolve(0); |
| | | comEvent.setDistribution(0); |
| | | comEvent.setChangeExpert(0); |
| | | } |
| | | }else{ |
| | | //未上上报到行业分中心,或者已上报到区三说会堂,仅查看 |
| | | comEvent.setArchive(0); |
| | | comEvent.setSolve(0); |
| | | comEvent.setDistribution(0); |
| | | comEvent.setChangeExpert(0); |
| | | } |
| | | }else if (userType.equals(5) || isStreet){ |
| | | //街道权限,操作街道下属社区的所有事件 |
| | | //是否上报到街道 |
| | | if (comEvent.getReportStreet().equals(1) || comEvent.getCurrentProcessType().equals(3)){ |
| | | //已上报到街道 |
| | | if (comEvent.getEventProcessStatus().equals(1) || comEvent.getEventProcessStatus().equals(2)){ |
| | | //待受理和待验证状态,可以受理,分配专家 |
| | | //关闭调解和归档 |
| | | comEvent.setArchive(0); |
| | | comEvent.setConciliation(0); |
| | | comEvent.setChangeExpert(0); |
| | | //comEvent.setDistribution(0); |
| | | comEvent.setSolve(0); |
| | | } else if (comEvent.getEventProcessStatus().equals(5)){ |
| | | //调解中,可以查看,调解,更换专家,删除 |
| | | comEvent.setDistribution(0); |
| | | comEvent.setArchive(0); |
| | | }else if (comEvent.getEventProcessStatus().equals(3)){ |
| | | //分配新专家后 |
| | | comEvent.setDistribution(0); |
| | | comEvent.setArchive(0); |
| | | comEvent.setChangeExpert(0); |
| | | comEvent.setEventResult(null); |
| | | comEvent.setEventProcessStatus(1); |
| | | } |
| | | else if (comEvent.getEventProcessStatus().equals(6) && comEvent.getEventResult().equals(1)){ |
| | | //设置为待受理 |
| | | comEvent.setEventResult(null); |
| | | comEvent.setEventProcessStatus(2); |
| | | //上报到单位,并且调解失败, |
| | | //调解完成,可以归档,查看 |
| | | comEvent.setSolve(0); |
| | | //comEvent.setDistribution(0); |
| | | comEvent.setChangeExpert(0); |
| | | //comEvent.setConciliation(0); |
| | | comEvent.setArchive(0); |
| | | } |
| | | else if (comEvent.getEventProcessStatus().equals(6) && comEvent.getEventSucceed().equals(2)){ |
| | | //调解完成,可以归档,查看 |
| | | comEvent.setSolve(0); |
| | | comEvent.setDistribution(0); |
| | | comEvent.setChangeExpert(0); |
| | | comEvent.setConciliation(0); |
| | | } |
| | | }else{ |
| | | //未上报到街道,仅查看 |
| | | comEvent.setArchive(0); |
| | | comEvent.setSolve(0); |
| | | comEvent.setDistribution(0); |
| | | comEvent.setChangeExpert(0); |
| | | comEvent.setConciliation(0); |
| | | } |
| | | }else if (isAdmin){ |
| | | //区三说会堂账号,最高权限全部开放 |
| | | // 是否上报到三说会堂 |
| | | if (comEvent.getCurrentProcessType().equals(4) || comEvent.getReportHall().equals(1)){ |
| | | //已上报到三说会堂,可以操作 |
| | | if (comEvent.getEventProcessStatus().equals(1) || comEvent.getEventProcessStatus().equals(2)){ |
| | | //待受理和待验证状态,可以受理,分配专家 |
| | | //关闭调解和归档 |
| | | comEvent.setArchive(0); |
| | | comEvent.setConciliation(0); |
| | | } else if (comEvent.getEventProcessStatus().equals(5)){ |
| | | //调解中,可以查看,调解,更换专家,删除 |
| | | comEvent.setDistribution(0); |
| | | comEvent.setArchive(0); |
| | | } else if (comEvent.getEventProcessStatus().equals(6) && comEvent.getEventSucceed().equals(2)){ |
| | | //调解完成,可以归档,查看 |
| | | comEvent.setSolve(0); |
| | | comEvent.setDistribution(0); |
| | | comEvent.setChangeExpert(0); |
| | | } |
| | | }else{ |
| | | //未上报到三说会堂,仅查看 |
| | | comEvent.setArchive(0); |
| | | comEvent.setSolve(0); |
| | | comEvent.setDistribution(0); |
| | | comEvent.setChangeExpert(0); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 当前账号是否有操作事件权限 |
| | | * */ |
| | | public Integer hasPermission(ComEvent comEvent,LoginUserInfoVO sysUser){ |
| | | String account=""; |
| | | Integer perm=1; |
| | | if (nonNull(sysUser.getAccount())){ |
| | | account=sysUser.getAccount(); |
| | | } |
| | | //上报级别是否匹配当前账号级别 |
| | | if (sysUser.getType().equals(12) ){ |
| | | if (!comEvent.getCurrentProcessType().equals(1)){ |
| | | perm=0; |
| | | } |
| | | }else if (account.equals("admin")){ |
| | | if (!comEvent.getCurrentProcessType().equals(4)){ |
| | | perm=0; |
| | | } |
| | | }else if (isStreetAccount(sysUser)){ |
| | | if (!comEvent.getCurrentProcessType().equals(3)){ |
| | | perm=0; |
| | | } |
| | | } |
| | | return perm; |
| | | } |
| | | /** |
| | | * 是否为综治后台街道账号 |
| | | * */ |
| | | public Boolean isStreetAccount(LoginUserInfoVO sysUser){ |
| | | Boolean flag=false; |
| | | String[] account={"glpz","qxpjd","tjdjd","dbdjd","yqjd","bcg","hmkjd","dhjd","jsgyy","dzhljd"}; |
| | | if (nonNull(sysUser.getAccount())){ |
| | | if (ArrayUtil.contains(account,sysUser.getAccount() )){ |
| | | flag=true; |
| | | } |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | @Override |
| | |
| | | //上报到社区 |
| | | //查询社区账号,由专家转交到社区 |
| | | comEvent.setCurrentProcessType(2); |
| | | comEvent.setSpecialistName("待分配"); |
| | | comEvent.setSpecialistId(99999L); |
| | | comEvent.setReportCommunity(1); |
| | | ComActDO comActDO = comActDAO.selectById(expert.getCommunityId()); |
| | | comEvent.setCurrentOrgId(comActDO.getStreetId().toString()); |
| | | //生成一次流转记录 |
| | |
| | | comEvent.setReportLevel(4); |
| | | }else if (expert.getLevel().equals(2)){ |
| | | //上报到行业分中心 |
| | | comEvent.setReportCenter(1); |
| | | comEvent.setCurrentProcessType(1); |
| | | comEvent.setCurrentOrgId(expert.getIndustryCenterId().toString()); |
| | | comEvent.setSpecialistName("待分配"); |
| | | comEvent.setSpecialistId(99999L); |
| | | //生成一次流转记录 |
| | | comEvent.setCurrentEventProcessResult("专家上报到行业分中心"); |
| | | comEventTransferRecord.setFromId(comEvent.getSpecialistId()); |
| | |
| | | comEvent.setCurrentProcessType(4); |
| | | comEvent.setCurrentOrgId("99999"); |
| | | //生成一次流转记录 |
| | | comEvent.setReportHall(1); |
| | | comEvent.setCurrentEventProcessResult("行业分中心上报到区三说会堂"); |
| | | comEventTransferRecord.setFromId(comEvent.getSpecialistId()); |
| | | comEventTransferRecord.setToId(99999L); |
| | |
| | | //社区上报到街道 |
| | | comEvent.setCurrentProcessType(3); |
| | | //获取街道id |
| | | comEvent.setReportStreet(1); |
| | | ComActDO comActDO = comActDAO.selectOne(new QueryWrapper<ComActDO>().lambda().eq(ComActDO::getCommunityId, comEvent.getRequestUserCommunity()).eq(ComActDO::getAppId, "wx0cef797390444b75")); |
| | | comEvent.setCurrentOrgId(comActDO.getStreetId().toString()); |
| | | //生成一次流转记录 |
| | |
| | | }else if(comEvent.getCurrentProcessType() == 3){ |
| | | //街道上报到区三说会堂 |
| | | comEvent.setCurrentProcessType(4); |
| | | comEvent.setReportHall(1); |
| | | comEvent.setCurrentOrgId("99999"); |
| | | //生成一次流转记录 |
| | | comEvent.setCurrentEventProcessResult("街道上报到区三说会堂"); |
| | | comEventTransferRecord.setFromId(comEvent.getSpecialistId()); |
| | | comEventTransferRecord.setToId(99999L); |
| | | comEventTransferRecord.setFromId(Long.parseLong(comEvent.getCurrentOrgId())); |
| | | comEventTransferRecord.setReportLevel(1); |
| | | comEvent.setReportLevel(1); |
| | | }else { |
| | |
| | | comEventDetailVO.setImages(comEventRequestImageVO); |
| | | map.put("specter", specter); |
| | | map.put("eventDetail", comEventDetailVO); |
| | | List<ComEventTransferRecord> transferRecord = comEventTransferRecordService.list(new QueryWrapper<ComEventTransferRecord>().lambda().eq(ComEventTransferRecord::getEventId, id).orderByAsc(ComEventTransferRecord::getCreateAt)); |
| | | List<ComEventTransferRecord> transferRecord = comEventTransferRecordService.list(new QueryWrapper<ComEventTransferRecord>().lambda().eq(ComEventTransferRecord::getEventId, id).orderByDesc(ComEventTransferRecord::getCreateAt)); |
| | | transferRecord.forEach(comEventTransferRecord -> { |
| | | List<ComEventResource> list = comEventResourceService.list(new QueryWrapper<ComEventResource>().lambda().eq(ComEventResource::getRefId, comEvent.getId()).notIn(ComEventResource::getStatus,(1)).eq(ComEventResource::getTransferId, comEventTransferRecord.getId())); |
| | | List<ComEventRequestImageVO> ImageVO = CopyUtil.deepCopyListObject(list, ComEventRequestImageVO.class); |
| | |
| | | ComSanshuoExpert specter = comSanShuoExpertService.getById(specialistId); |
| | | comEvent.setSpecialistAcceptTime(new Date()); |
| | | comEvent.setSpecialistName(specter.getName()); |
| | | comEvent.setEventProcessStatus(SanShuoEventStatusEnum.ACCEPT.getCode()); |
| | | comEvent.setEventProcessStatus(SanShuoEventStatusEnum.VALID.getCode()); |
| | | int flag = baseMapper.updateById(comEvent); |
| | | //添加一条对应记录 |
| | | comEventMapper.insertEventAndExpertRecord(id, specialistId,1); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R calculate() { |
| | | List<ComEventCalculateVO> calculateList = baseMapper.calculate(); |
| | | public R calculate(LoginUserInfoVO loginUserInfoVO) { |
| | | ComEvent comEvent=new ComEvent(); |
| | | comEvent.setUserType(3); |
| | | Boolean isExpertCheck=false; |
| | | Long expertId=null; |
| | | Boolean isStretAccount = isStreetAccount(loginUserInfoVO); |
| | | if (nonNull(comEvent.getUserType())){ |
| | | if (loginUserInfoVO.getType().equals(13) || loginUserInfoVO.getType().equals(11)){ |
| | | ComSanshuoExpert expert=new ComSanshuoExpert(); |
| | | //专家账号权限(后台) |
| | | if (nonNull(loginUserInfoVO.getPhone())){ |
| | | expert = comSanShuoExpertService.getOne(new QueryWrapper<ComSanshuoExpert>().lambda().eq(ComSanshuoExpert::getPhone, loginUserInfoVO.getPhone())); |
| | | }else{ |
| | | //账号获取 |
| | | expert = comSanShuoExpertService.getOne(new QueryWrapper<ComSanshuoExpert>().lambda().eq(ComSanshuoExpert::getAccount, loginUserInfoVO.getAccount())); |
| | | } |
| | | comEvent.setUserType(2); |
| | | if (nonNull(expert)){ |
| | | comEvent.setSpecialistId(expert.getId()); |
| | | isExpertCheck=true; |
| | | expertId=expert.getId(); |
| | | } |
| | | }else if (loginUserInfoVO.getType().equals(12)){ |
| | | //行业分中心权限 |
| | | comEvent.setUserType(3); |
| | | //获取行业分中心id |
| | | ComSanshuoIndustryCenter center = comSanShuoIndustryCenterService.getOne(new QueryWrapper<ComSanshuoIndustryCenter>().lambda().eq(ComSanshuoIndustryCenter::getAccount, loginUserInfoVO.getAccount())); |
| | | if (nonNull(center)){ |
| | | comEvent.setCenterId(center.getId().toString()); |
| | | } |
| | | }else if (loginUserInfoVO.getType().equals(3)){ |
| | | //社区后台权限 |
| | | comEvent.setUserType(4); |
| | | comEvent.setCommunityId(loginUserInfoVO.getCommunityId()); |
| | | }else if (isStretAccount){ |
| | | //街道权限,查看街道范围下的所有社区事件 |
| | | //获取街道下属社区id |
| | | List<Long> cids = comActDAO.selectCommunityByStreetId(loginUserInfoVO.getStreetId()); |
| | | comEvent.setUserType(5); |
| | | comEvent.setCommunityIds(cids); |
| | | } |
| | | } |
| | | if (isExpertCheck && comEvent.getUserType()!=1){ |
| | | if (nonNull(comEventMapper.listEventIds(expertId))){ |
| | | List<Long> eventIds = comEventMapper.listEventIds(expertId); |
| | | comEvent.setEventIds(eventIds); |
| | | |
| | | } |
| | | } |
| | | if (nonNull(loginUserInfoVO.getAccount())){ |
| | | if (loginUserInfoVO.getAccount().equals("admin")){ |
| | | comEvent.setUserType(null); |
| | | } |
| | | } |
| | | List<ComEventCalculateVO> calculateList = baseMapper.calculate(comEvent); |
| | | ComEventCalculateVO comEventCalculateVO =new ComEventCalculateVO(); |
| | | comEventCalculateVO.setStatus("0"); |
| | | comEventCalculateVO.setSum(baseMapper.selectCount(new QueryWrapper<ComEvent>().lambda().notIn(ComEvent::getEventProcessStatus,(9))).toString()); |
| | | comEventCalculateVO.setSum(baseMapper.caculateSum(comEvent)+""); |
| | | calculateList.add(comEventCalculateVO); |
| | | return R.ok(calculateList); |
| | | } |
| | |
| | | return R.ok(eventRateVOS); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void updateEventStransferRecord(Long id) { |
| | | ComEvent comEvent = comEventMapper.selectById(id); |
| | | comEventMapper.updateLog(id,comEvent.getSpecialistId()); |
| | | } |
| | | |
| | | public String typeToName(Integer type){ |
| | | switch (type){ |
| | | case 1: |